Clock.js 439 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217
  1. "use strict";
  2. (wx["webpackJsonp"] = wx["webpackJsonp"] || []).push([["pages/Clock"],{
  3. /***/ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/Clock.tsx":
  4. /*!**************************************************************************************************!*\
  5. !*** ./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/Clock.tsx ***!
  6. \**************************************************************************************************/
  7. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  8. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9. /* harmony export */ "default": function() { return /* binding */ IndexPage; }
  10. /* harmony export */ });
  11. /* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js */ "./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js");
  12. /* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ "./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
  13. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
  14. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  15. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  16. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
  17. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__);
  18. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
  19. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_2__);
  20. /* harmony import */ var _store_user__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/store/user */ "./src/store/user.tsx");
  21. /* harmony import */ var _services_permission__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/services/permission */ "./src/services/permission.tsx");
  22. /* harmony import */ var _features_trackTimeDuration_components_Clock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/features/trackTimeDuration/components/Clock */ "./src/features/trackTimeDuration/components/Clock.tsx");
  23. /* harmony import */ var _features_trackTimeDuration_components_Console__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/features/trackTimeDuration/components/Console */ "./src/features/trackTimeDuration/components/Console.tsx");
  24. /* harmony import */ var _features_trackTimeDuration_components_More__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/features/trackTimeDuration/components/More */ "./src/features/trackTimeDuration/components/More.tsx");
  25. /* harmony import */ var _features_trackTimeDuration_components_Schedule__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/features/trackTimeDuration/components/Schedule */ "./src/features/trackTimeDuration/components/Schedule.tsx");
  26. /* harmony import */ var _services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/services/trackTimeDuration */ "./src/services/trackTimeDuration.tsx");
  27. /* harmony import */ var _store_scenario__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/store/scenario */ "./src/store/scenario.tsx");
  28. /* harmony import */ var _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/store/trackTimeMachine */ "./src/store/trackTimeMachine.tsx");
  29. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  30. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__);
  31. // import ComponentA from './component'
  32. // import TabBar from '../../components/Tabbar';
  33. function IndexPage() {
  34. var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.useDispatch)();
  35. var array = [];
  36. var user = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.useSelector)(function (state) {
  37. return state.user;
  38. });
  39. var permission = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.useSelector)(function (state) {
  40. return state.permission;
  41. });
  42. var common = (0,react_redux__WEBPACK_IMPORTED_MODULE_2__.useSelector)(function (state) {
  43. return state.common;
  44. });
  45. array.push('ffff');
  46. array.push( /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_13__.Text, {
  47. children: "ffff"
  48. }));
  49. // array.push(<Rings radius={50}/>)
  50. (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
  51. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__["default"].onTransition(function (state) {
  52. // console.log(state.value);
  53. // console.log('aaaa')
  54. if (state.value.FAST_SLEEP == 'COMPLETED' || state.value.FAST_SLEEP == 'ONGOING1' || state.value.FAST_SLEEP == 'ONGOING2' || state.value.FAST_SLEEP == 'ONGOING3' || state.value.FAST == 'COMPLETED' || state.value.SLEEP == 'COMPLETED') {
  55. getCheckData();
  56. }
  57. });
  58. }, []);
  59. (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__.useReady)( /*#__PURE__*/(0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_14__["default"])( /*#__PURE__*/(0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_15__["default"])().mark(function _callee() {
  60. var userData;
  61. return (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_15__["default"])().wrap(function _callee$(_context) {
  62. while (1) switch (_context.prev = _context.next) {
  63. case 0:
  64. _context.next = 2;
  65. return getStorage('userData');
  66. case 2:
  67. userData = _context.sent;
  68. if (userData) {
  69. dispatch((0,_store_user__WEBPACK_IMPORTED_MODULE_3__.getInfoSuccess)(JSON.parse(userData)));
  70. // return JSON.parse(userData as string) as UserState;
  71. setTimeout(function () {
  72. checkWXPubFollow();
  73. getCheckData();
  74. }, 200);
  75. }
  76. case 4:
  77. case "end":
  78. return _context.stop();
  79. }
  80. }, _callee);
  81. })));
  82. (0,_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__.useDidShow)(function () {
  83. if (user.isLogin) getCheckData();
  84. });
  85. function getCheckData() {
  86. (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_9__.getClocks)().then(function (res) {
  87. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__.machine.context.checkData = res;
  88. __webpack_require__.g.scenario = res.current_record.scenario;
  89. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__["default"].send({
  90. type: 'RESET'
  91. });
  92. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__["default"].send({
  93. type: res.current_record.scenario
  94. });
  95. var currentState = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__["default"].getSnapshot();
  96. var json = {};
  97. var key = res.current_record.scenario;
  98. var status = res.current_record.status;
  99. json[key] = status;
  100. currentState.value = json;
  101. // debugger
  102. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__.machine.context.currentStatus = "".concat(key, ".").concat(status); //'mixed.ON_GOING2'
  103. console.log(_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__.machine.context.checkData);
  104. });
  105. return;
  106. (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_9__.getChecks)().then(function (res) {
  107. if (res.scenario) {
  108. dispatch((0,_store_scenario__WEBPACK_IMPORTED_MODULE_10__.setScenario)(res.scenario));
  109. __webpack_require__.g.scenario = res.scenario;
  110. // global.checkData = res;
  111. // console.log((res as any).scenario.name + ' ' + (res as any).status);
  112. // trackTimeService.send({type:(res as any).scenario.name});
  113. // setSpecifiedStatus('FAST_SLEEP', 'ON_GOING');
  114. // 初始化状态机
  115. // const initialState = machine.initialState;
  116. // 设置指定状态为 C->3
  117. // const nextState = machine.transition(initialState, 'SET_SPECIFIED_STATE');
  118. // const specifiedState = setSpecifiedState(nextState, 'FAST_SLEEP');
  119. // setSpecifiedState();
  120. // console.log('name:'+(res as any).scenario.name)
  121. // machine.reset();
  122. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__["default"].send({
  123. type: 'RESET'
  124. });
  125. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__["default"].send({
  126. type: res.scenario.name
  127. });
  128. var currentState = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__["default"].getSnapshot();
  129. var json = {};
  130. var key = res.scenario.name;
  131. json[key] = res.status;
  132. currentState.value = json;
  133. // debugger
  134. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__.machine.context.currentStatus = "".concat(key, ".").concat(res.status); //'mixed.ON_GOING2'
  135. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_11__.machine.context.checkData = res;
  136. // debugger
  137. // trackTimeService.send('APPLE');
  138. // machine.transition(`${key}.${(res as any).status}`,'' as any);
  139. // trackTimeService.send({type:'START_FAST'});
  140. // trackTimeService.send({type:'START_SLEEP'});
  141. // trackTimeService.send({type:'END_SLEEP'});
  142. // trackTimeService.send({type:'END_SLEEP'});
  143. // trackTimeService.send({type:'START_FAST'});
  144. // trackTimeService.send({type:'END_FAST'});
  145. // trackTimeService.send({type:'START_SLEEP'});
  146. // console.log(currentState.value);
  147. // debugger
  148. // trackTimeService.send('setCurrentStatus', {status:(res as any).status});
  149. // setCurrentStatus((res as any).status);
  150. // trackTimeService.send({type:'START_FAST'});
  151. }
  152. });
  153. }
  154. function checkWXPubFollow() {
  155. (0,_services_permission__WEBPACK_IMPORTED_MODULE_4__.wxPubFollow)().then(function (res) {
  156. console.log(res);
  157. });
  158. }
  159. function followWxPub() {
  160. var resource = common.resources.filter(function (item) {
  161. return item.code == 'follow_wx_pub';
  162. });
  163. _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().showModal({
  164. title: '提示',
  165. content: '关注公众号后可接收提醒\n点击确定,前往关注',
  166. showCancel: true,
  167. success: function success(result) {
  168. if (result.confirm) {
  169. _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().navigateTo({
  170. url: '/pages/H5?title=fast16cc 关注服务号&url=' + resource[0].url
  171. });
  172. }
  173. }
  174. });
  175. }
  176. function getStorage(_x) {
  177. return _getStorage.apply(this, arguments);
  178. }
  179. function _getStorage() {
  180. _getStorage = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_14__["default"])( /*#__PURE__*/(0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_15__["default"])().mark(function _callee2(key) {
  181. var res;
  182. return (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_15__["default"])().wrap(function _callee2$(_context2) {
  183. while (1) switch (_context2.prev = _context2.next) {
  184. case 0:
  185. _context2.prev = 0;
  186. _context2.next = 3;
  187. return _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getStorage({
  188. key: key
  189. });
  190. case 3:
  191. res = _context2.sent;
  192. return _context2.abrupt("return", res.data);
  193. case 7:
  194. _context2.prev = 7;
  195. _context2.t0 = _context2["catch"](0);
  196. return _context2.abrupt("return", '');
  197. case 10:
  198. case "end":
  199. return _context2.stop();
  200. }
  201. }, _callee2, null, [[0, 7]]);
  202. }));
  203. return _getStorage.apply(this, arguments);
  204. }
  205. function goDetail() {
  206. _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().navigateTo({
  207. // url: '/pages/index/detail'
  208. //src/moduleA/pages/third.tsx
  209. url: '../../moduleA/pages/third'
  210. });
  211. }
  212. function login() {
  213. if (user.isLogin) {
  214. _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().navigateTo({
  215. url: '/pages/ChooseScenario'
  216. });
  217. } else {
  218. _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().navigateTo({
  219. url: '/pages/ChooseAuth'
  220. });
  221. }
  222. }
  223. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_13__.View, {
  224. style: {
  225. backgroundColor: '#fff',
  226. flex: 1,
  227. flexDirection: 'column',
  228. display: 'flex'
  229. },
  230. children: [permission.wxPubFollow == false ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_13__.Text, {
  231. onClick: function onClick() {
  232. return followWxPub();
  233. },
  234. children: "\u53BB\u5173\u6CE8\u516C\u4F17\u53F7"
  235. }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_13__.Text, {
  236. children: "\u5DF2\u5173\u6CE8"
  237. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_13__.Button, {
  238. onClick: function onClick() {
  239. return goDetail();
  240. },
  241. children: "go detail"
  242. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_13__.Text, {
  243. className: "login",
  244. onClick: function onClick() {
  245. return login();
  246. },
  247. children: "sss"
  248. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_features_trackTimeDuration_components_Clock__WEBPACK_IMPORTED_MODULE_5__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_features_trackTimeDuration_components_Console__WEBPACK_IMPORTED_MODULE_6__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_features_trackTimeDuration_components_More__WEBPACK_IMPORTED_MODULE_7__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_features_trackTimeDuration_components_Schedule__WEBPACK_IMPORTED_MODULE_8__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_features_trackTimeDuration_components_Schedule__WEBPACK_IMPORTED_MODULE_8__["default"], {
  249. type: "latest"
  250. })]
  251. });
  252. }
  253. /***/ }),
  254. /***/ "./node_modules/taro-ui/dist/index.esm.js":
  255. /*!************************************************!*\
  256. !*** ./node_modules/taro-ui/dist/index.esm.js ***!
  257. \************************************************/
  258. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  259. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  260. /* harmony export */ AtFloatLayout: function() { return /* binding */ AtFloatLayout; }
  261. /* harmony export */ });
  262. /* unused harmony exports AtAccordion, AtActionSheet, AtActionSheetItem, AtActivityIndicator, AtAvatar, AtBadge, AtButton, AtCalendar, AtCard, AtCheckbox, AtComponent, AtCountdown, AtCurtain, AtDivider, AtDrawer, AtFab, AtForm, AtGrid, AtIcon, AtImagePicker, AtIndexes, AtInput, AtInputNumber, AtList, AtListItem, AtLoadMore, AtLoading, AtMessage, AtModal, AtModalAction, AtModalContent, AtModalHeader, AtNavBar, AtNoticebar, AtPagination, AtProgress, AtRadio, AtRange, AtRate, AtSearchBar, AtSegmentedControl, AtSlider, AtSteps, AtSwipeAction, AtSwitch, AtTabBar, AtTabs, AtTabsPane, AtTag, AtTextarea, AtTimeline, AtToast */
  263. /* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/typeof.js */ "./node_modules/@babel/runtime/helpers/esm/typeof.js");
  264. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
  265. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  266. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  267. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
  268. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_1__);
  269. /* provided dependency */ var window = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime")["window"];
  270. /* provided dependency */ var document = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime")["document"];
  271. /******************************************************************************
  272. Copyright (c) Microsoft Corporation.
  273. Permission to use, copy, modify, and/or distribute this software for any
  274. purpose with or without fee is hereby granted.
  275. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  276. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  277. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  278. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  279. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  280. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  281. PERFORMANCE OF THIS SOFTWARE.
  282. ***************************************************************************** */
  283. /* global Reflect, Promise */
  284. var _extendStatics = function extendStatics(d, b) {
  285. _extendStatics = Object.setPrototypeOf || {
  286. __proto__: []
  287. } instanceof Array && function (d, b) {
  288. d.__proto__ = b;
  289. } || function (d, b) {
  290. for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
  291. };
  292. return _extendStatics(d, b);
  293. };
  294. function __extends(d, b) {
  295. if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  296. _extendStatics(d, b);
  297. function __() {
  298. this.constructor = d;
  299. }
  300. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  301. }
  302. var _assign = function __assign() {
  303. _assign = Object.assign || function __assign(t) {
  304. for (var s, i = 1, n = arguments.length; i < n; i++) {
  305. s = arguments[i];
  306. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  307. }
  308. return t;
  309. };
  310. return _assign.apply(this, arguments);
  311. };
  312. function __awaiter(thisArg, _arguments, P, generator) {
  313. function adopt(value) {
  314. return value instanceof P ? value : new P(function (resolve) {
  315. resolve(value);
  316. });
  317. }
  318. return new (P || (P = Promise))(function (resolve, reject) {
  319. function fulfilled(value) {
  320. try {
  321. step(generator.next(value));
  322. } catch (e) {
  323. reject(e);
  324. }
  325. }
  326. function rejected(value) {
  327. try {
  328. step(generator["throw"](value));
  329. } catch (e) {
  330. reject(e);
  331. }
  332. }
  333. function step(result) {
  334. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  335. }
  336. step((generator = generator.apply(thisArg, _arguments || [])).next());
  337. });
  338. }
  339. function __generator(thisArg, body) {
  340. var _ = {
  341. label: 0,
  342. sent: function sent() {
  343. if (t[0] & 1) throw t[1];
  344. return t[1];
  345. },
  346. trys: [],
  347. ops: []
  348. },
  349. f,
  350. y,
  351. t,
  352. g;
  353. return g = {
  354. next: verb(0),
  355. "throw": verb(1),
  356. "return": verb(2)
  357. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  358. return this;
  359. }), g;
  360. function verb(n) {
  361. return function (v) {
  362. return step([n, v]);
  363. };
  364. }
  365. function step(op) {
  366. if (f) throw new TypeError("Generator is already executing.");
  367. while (g && (g = 0, op[0] && (_ = 0)), _) try {
  368. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  369. if (y = 0, t) op = [op[0] & 2, t.value];
  370. switch (op[0]) {
  371. case 0:
  372. case 1:
  373. t = op;
  374. break;
  375. case 4:
  376. _.label++;
  377. return {
  378. value: op[1],
  379. done: false
  380. };
  381. case 5:
  382. _.label++;
  383. y = op[1];
  384. op = [0];
  385. continue;
  386. case 7:
  387. op = _.ops.pop();
  388. _.trys.pop();
  389. continue;
  390. default:
  391. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  392. _ = 0;
  393. continue;
  394. }
  395. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  396. _.label = op[1];
  397. break;
  398. }
  399. if (op[0] === 6 && _.label < t[1]) {
  400. _.label = t[1];
  401. t = op;
  402. break;
  403. }
  404. if (t && _.label < t[2]) {
  405. _.label = t[2];
  406. _.ops.push(op);
  407. break;
  408. }
  409. if (t[2]) _.ops.pop();
  410. _.trys.pop();
  411. continue;
  412. }
  413. op = body.call(thisArg, _);
  414. } catch (e) {
  415. op = [6, e];
  416. y = 0;
  417. } finally {
  418. f = t = 0;
  419. }
  420. if (op[0] & 5) throw op[1];
  421. return {
  422. value: op[0] ? op[1] : void 0,
  423. done: true
  424. };
  425. }
  426. }
  427. function __read(o, n) {
  428. var m = typeof Symbol === "function" && o[Symbol.iterator];
  429. if (!m) return o;
  430. var i = m.call(o),
  431. r,
  432. ar = [],
  433. e;
  434. try {
  435. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  436. } catch (error) {
  437. e = {
  438. error: error
  439. };
  440. } finally {
  441. try {
  442. if (r && !r.done && (m = i["return"])) m.call(i);
  443. } finally {
  444. if (e) throw e.error;
  445. }
  446. }
  447. return ar;
  448. }
  449. /** @deprecated */
  450. function __spread() {
  451. for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
  452. return ar;
  453. }
  454. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};
  455. function createCommonjsModule(fn, module) {
  456. return module = {
  457. exports: {}
  458. }, fn(module, module.exports), module.exports;
  459. }
  460. var classnames = createCommonjsModule(function (module) {
  461. /*!
  462. Copyright (c) 2018 Jed Watson.
  463. Licensed under the MIT License (MIT), see
  464. http://jedwatson.github.io/classnames
  465. */
  466. /* global define */
  467. (function () {
  468. var hasOwn = {}.hasOwnProperty;
  469. function classNames() {
  470. var classes = [];
  471. for (var i = 0; i < arguments.length; i++) {
  472. var arg = arguments[i];
  473. if (!arg) continue;
  474. var argType = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(arg);
  475. if (argType === 'string' || argType === 'number') {
  476. classes.push(arg);
  477. } else if (Array.isArray(arg)) {
  478. if (arg.length) {
  479. var inner = classNames.apply(null, arg);
  480. if (inner) {
  481. classes.push(inner);
  482. }
  483. }
  484. } else if (argType === 'object') {
  485. if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
  486. classes.push(arg.toString());
  487. continue;
  488. }
  489. for (var key in arg) {
  490. if (hasOwn.call(arg, key) && arg[key]) {
  491. classes.push(key);
  492. }
  493. }
  494. }
  495. }
  496. return classes.join(' ');
  497. }
  498. if (module.exports) {
  499. classNames.default = classNames;
  500. module.exports = classNames;
  501. } else {
  502. window.classNames = classNames;
  503. }
  504. })();
  505. });
  506. /** @license React v16.13.1
  507. * react-is.production.min.js
  508. *
  509. * Copyright (c) Facebook, Inc. and its affiliates.
  510. *
  511. * This source code is licensed under the MIT license found in the
  512. * LICENSE file in the root directory of this source tree.
  513. */
  514. var b = "function" === typeof Symbol && Symbol.for,
  515. c = b ? Symbol.for("react.element") : 60103,
  516. d = b ? Symbol.for("react.portal") : 60106,
  517. e = b ? Symbol.for("react.fragment") : 60107,
  518. f = b ? Symbol.for("react.strict_mode") : 60108,
  519. g = b ? Symbol.for("react.profiler") : 60114,
  520. h = b ? Symbol.for("react.provider") : 60109,
  521. k = b ? Symbol.for("react.context") : 60110,
  522. l = b ? Symbol.for("react.async_mode") : 60111,
  523. m = b ? Symbol.for("react.concurrent_mode") : 60111,
  524. n = b ? Symbol.for("react.forward_ref") : 60112,
  525. p = b ? Symbol.for("react.suspense") : 60113,
  526. q = b ? Symbol.for("react.suspense_list") : 60120,
  527. r = b ? Symbol.for("react.memo") : 60115,
  528. t = b ? Symbol.for("react.lazy") : 60116,
  529. v = b ? Symbol.for("react.block") : 60121,
  530. w = b ? Symbol.for("react.fundamental") : 60117,
  531. x = b ? Symbol.for("react.responder") : 60118,
  532. y = b ? Symbol.for("react.scope") : 60119;
  533. function z(a) {
  534. if ("object" === (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(a) && null !== a) {
  535. var u = a.$$typeof;
  536. switch (u) {
  537. case c:
  538. switch (a = a.type, a) {
  539. case l:
  540. case m:
  541. case e:
  542. case g:
  543. case f:
  544. case p:
  545. return a;
  546. default:
  547. switch (a = a && a.$$typeof, a) {
  548. case k:
  549. case n:
  550. case t:
  551. case r:
  552. case h:
  553. return a;
  554. default:
  555. return u;
  556. }
  557. }
  558. case d:
  559. return u;
  560. }
  561. }
  562. }
  563. function A(a) {
  564. return z(a) === m;
  565. }
  566. var AsyncMode = l;
  567. var ConcurrentMode = m;
  568. var ContextConsumer = k;
  569. var ContextProvider = h;
  570. var Element = c;
  571. var ForwardRef = n;
  572. var Fragment = e;
  573. var Lazy = t;
  574. var Memo = r;
  575. var Portal = d;
  576. var Profiler = g;
  577. var StrictMode = f;
  578. var Suspense = p;
  579. var isAsyncMode = function isAsyncMode(a) {
  580. return A(a) || z(a) === l;
  581. };
  582. var isConcurrentMode = A;
  583. var isContextConsumer = function isContextConsumer(a) {
  584. return z(a) === k;
  585. };
  586. var isContextProvider = function isContextProvider(a) {
  587. return z(a) === h;
  588. };
  589. var isElement = function isElement(a) {
  590. return "object" === (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(a) && null !== a && a.$$typeof === c;
  591. };
  592. var isForwardRef = function isForwardRef(a) {
  593. return z(a) === n;
  594. };
  595. var isFragment = function isFragment(a) {
  596. return z(a) === e;
  597. };
  598. var isLazy = function isLazy(a) {
  599. return z(a) === t;
  600. };
  601. var isMemo = function isMemo(a) {
  602. return z(a) === r;
  603. };
  604. var isPortal = function isPortal(a) {
  605. return z(a) === d;
  606. };
  607. var isProfiler = function isProfiler(a) {
  608. return z(a) === g;
  609. };
  610. var isStrictMode = function isStrictMode(a) {
  611. return z(a) === f;
  612. };
  613. var isSuspense = function isSuspense(a) {
  614. return z(a) === p;
  615. };
  616. var isValidElementType = function isValidElementType(a) {
  617. return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(a) && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
  618. };
  619. var typeOf = z;
  620. var reactIs_production_min = {
  621. AsyncMode: AsyncMode,
  622. ConcurrentMode: ConcurrentMode,
  623. ContextConsumer: ContextConsumer,
  624. ContextProvider: ContextProvider,
  625. Element: Element,
  626. ForwardRef: ForwardRef,
  627. Fragment: Fragment,
  628. Lazy: Lazy,
  629. Memo: Memo,
  630. Portal: Portal,
  631. Profiler: Profiler,
  632. StrictMode: StrictMode,
  633. Suspense: Suspense,
  634. isAsyncMode: isAsyncMode,
  635. isConcurrentMode: isConcurrentMode,
  636. isContextConsumer: isContextConsumer,
  637. isContextProvider: isContextProvider,
  638. isElement: isElement,
  639. isForwardRef: isForwardRef,
  640. isFragment: isFragment,
  641. isLazy: isLazy,
  642. isMemo: isMemo,
  643. isPortal: isPortal,
  644. isProfiler: isProfiler,
  645. isStrictMode: isStrictMode,
  646. isSuspense: isSuspense,
  647. isValidElementType: isValidElementType,
  648. typeOf: typeOf
  649. };
  650. var reactIs_development = createCommonjsModule(function (module, exports) {
  651. if (true) {
  652. (function () {
  653. // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  654. // nor polyfill, then a plain number is used for performance.
  655. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  656. var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
  657. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  658. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  659. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  660. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  661. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  662. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
  663. // (unstable) APIs that have been removed. Can we remove the symbols?
  664. var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
  665. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  666. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  667. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  668. var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
  669. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  670. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  671. var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
  672. var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
  673. var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
  674. var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
  675. function isValidElementType(type) {
  676. return typeof type === 'string' || typeof type === 'function' ||
  677. // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  678. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(type) === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
  679. }
  680. function typeOf(object) {
  681. if ((0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) === 'object' && object !== null) {
  682. var $$typeof = object.$$typeof;
  683. switch ($$typeof) {
  684. case REACT_ELEMENT_TYPE:
  685. var type = object.type;
  686. switch (type) {
  687. case REACT_ASYNC_MODE_TYPE:
  688. case REACT_CONCURRENT_MODE_TYPE:
  689. case REACT_FRAGMENT_TYPE:
  690. case REACT_PROFILER_TYPE:
  691. case REACT_STRICT_MODE_TYPE:
  692. case REACT_SUSPENSE_TYPE:
  693. return type;
  694. default:
  695. var $$typeofType = type && type.$$typeof;
  696. switch ($$typeofType) {
  697. case REACT_CONTEXT_TYPE:
  698. case REACT_FORWARD_REF_TYPE:
  699. case REACT_LAZY_TYPE:
  700. case REACT_MEMO_TYPE:
  701. case REACT_PROVIDER_TYPE:
  702. return $$typeofType;
  703. default:
  704. return $$typeof;
  705. }
  706. }
  707. case REACT_PORTAL_TYPE:
  708. return $$typeof;
  709. }
  710. }
  711. return undefined;
  712. } // AsyncMode is deprecated along with isAsyncMode
  713. var AsyncMode = REACT_ASYNC_MODE_TYPE;
  714. var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
  715. var ContextConsumer = REACT_CONTEXT_TYPE;
  716. var ContextProvider = REACT_PROVIDER_TYPE;
  717. var Element = REACT_ELEMENT_TYPE;
  718. var ForwardRef = REACT_FORWARD_REF_TYPE;
  719. var Fragment = REACT_FRAGMENT_TYPE;
  720. var Lazy = REACT_LAZY_TYPE;
  721. var Memo = REACT_MEMO_TYPE;
  722. var Portal = REACT_PORTAL_TYPE;
  723. var Profiler = REACT_PROFILER_TYPE;
  724. var StrictMode = REACT_STRICT_MODE_TYPE;
  725. var Suspense = REACT_SUSPENSE_TYPE;
  726. var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
  727. function isAsyncMode(object) {
  728. {
  729. if (!hasWarnedAboutDeprecatedIsAsyncMode) {
  730. hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
  731. console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
  732. }
  733. }
  734. return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
  735. }
  736. function isConcurrentMode(object) {
  737. return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
  738. }
  739. function isContextConsumer(object) {
  740. return typeOf(object) === REACT_CONTEXT_TYPE;
  741. }
  742. function isContextProvider(object) {
  743. return typeOf(object) === REACT_PROVIDER_TYPE;
  744. }
  745. function isElement(object) {
  746. return (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  747. }
  748. function isForwardRef(object) {
  749. return typeOf(object) === REACT_FORWARD_REF_TYPE;
  750. }
  751. function isFragment(object) {
  752. return typeOf(object) === REACT_FRAGMENT_TYPE;
  753. }
  754. function isLazy(object) {
  755. return typeOf(object) === REACT_LAZY_TYPE;
  756. }
  757. function isMemo(object) {
  758. return typeOf(object) === REACT_MEMO_TYPE;
  759. }
  760. function isPortal(object) {
  761. return typeOf(object) === REACT_PORTAL_TYPE;
  762. }
  763. function isProfiler(object) {
  764. return typeOf(object) === REACT_PROFILER_TYPE;
  765. }
  766. function isStrictMode(object) {
  767. return typeOf(object) === REACT_STRICT_MODE_TYPE;
  768. }
  769. function isSuspense(object) {
  770. return typeOf(object) === REACT_SUSPENSE_TYPE;
  771. }
  772. exports.AsyncMode = AsyncMode;
  773. exports.ConcurrentMode = ConcurrentMode;
  774. exports.ContextConsumer = ContextConsumer;
  775. exports.ContextProvider = ContextProvider;
  776. exports.Element = Element;
  777. exports.ForwardRef = ForwardRef;
  778. exports.Fragment = Fragment;
  779. exports.Lazy = Lazy;
  780. exports.Memo = Memo;
  781. exports.Portal = Portal;
  782. exports.Profiler = Profiler;
  783. exports.StrictMode = StrictMode;
  784. exports.Suspense = Suspense;
  785. exports.isAsyncMode = isAsyncMode;
  786. exports.isConcurrentMode = isConcurrentMode;
  787. exports.isContextConsumer = isContextConsumer;
  788. exports.isContextProvider = isContextProvider;
  789. exports.isElement = isElement;
  790. exports.isForwardRef = isForwardRef;
  791. exports.isFragment = isFragment;
  792. exports.isLazy = isLazy;
  793. exports.isMemo = isMemo;
  794. exports.isPortal = isPortal;
  795. exports.isProfiler = isProfiler;
  796. exports.isStrictMode = isStrictMode;
  797. exports.isSuspense = isSuspense;
  798. exports.isValidElementType = isValidElementType;
  799. exports.typeOf = typeOf;
  800. })();
  801. }
  802. });
  803. reactIs_development.AsyncMode;
  804. reactIs_development.ConcurrentMode;
  805. reactIs_development.ContextConsumer;
  806. reactIs_development.ContextProvider;
  807. reactIs_development.Element;
  808. reactIs_development.ForwardRef;
  809. reactIs_development.Fragment;
  810. reactIs_development.Lazy;
  811. reactIs_development.Memo;
  812. reactIs_development.Portal;
  813. reactIs_development.Profiler;
  814. reactIs_development.StrictMode;
  815. reactIs_development.Suspense;
  816. reactIs_development.isAsyncMode;
  817. reactIs_development.isConcurrentMode;
  818. reactIs_development.isContextConsumer;
  819. reactIs_development.isContextProvider;
  820. reactIs_development.isElement;
  821. reactIs_development.isForwardRef;
  822. reactIs_development.isFragment;
  823. reactIs_development.isLazy;
  824. reactIs_development.isMemo;
  825. reactIs_development.isPortal;
  826. reactIs_development.isProfiler;
  827. reactIs_development.isStrictMode;
  828. reactIs_development.isSuspense;
  829. reactIs_development.isValidElementType;
  830. reactIs_development.typeOf;
  831. var reactIs = createCommonjsModule(function (module) {
  832. if (false) {} else {
  833. module.exports = reactIs_development;
  834. }
  835. });
  836. /*
  837. object-assign
  838. (c) Sindre Sorhus
  839. @license MIT
  840. */
  841. /* eslint-disable no-unused-vars */
  842. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  843. var hasOwnProperty$7 = Object.prototype.hasOwnProperty;
  844. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  845. function toObject(val) {
  846. if (val === null || val === undefined) {
  847. throw new TypeError('Object.assign cannot be called with null or undefined');
  848. }
  849. return Object(val);
  850. }
  851. function shouldUseNative() {
  852. try {
  853. if (!Object.assign) {
  854. return false;
  855. }
  856. // Detect buggy property enumeration order in older V8 versions.
  857. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  858. var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  859. test1[5] = 'de';
  860. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  861. return false;
  862. }
  863. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  864. var test2 = {};
  865. for (var i = 0; i < 10; i++) {
  866. test2['_' + String.fromCharCode(i)] = i;
  867. }
  868. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  869. return test2[n];
  870. });
  871. if (order2.join('') !== '0123456789') {
  872. return false;
  873. }
  874. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  875. var test3 = {};
  876. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  877. test3[letter] = letter;
  878. });
  879. if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
  880. return false;
  881. }
  882. return true;
  883. } catch (err) {
  884. // We don't expect any of the above to throw, but better to be safe.
  885. return false;
  886. }
  887. }
  888. var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
  889. var from;
  890. var to = toObject(target);
  891. var symbols;
  892. for (var s = 1; s < arguments.length; s++) {
  893. from = Object(arguments[s]);
  894. for (var key in from) {
  895. if (hasOwnProperty$7.call(from, key)) {
  896. to[key] = from[key];
  897. }
  898. }
  899. if (getOwnPropertySymbols) {
  900. symbols = getOwnPropertySymbols(from);
  901. for (var i = 0; i < symbols.length; i++) {
  902. if (propIsEnumerable.call(from, symbols[i])) {
  903. to[symbols[i]] = from[symbols[i]];
  904. }
  905. }
  906. }
  907. }
  908. return to;
  909. };
  910. /**
  911. * Copyright (c) 2013-present, Facebook, Inc.
  912. *
  913. * This source code is licensed under the MIT license found in the
  914. * LICENSE file in the root directory of this source tree.
  915. */
  916. var ReactPropTypesSecret$2 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  917. var ReactPropTypesSecret_1 = ReactPropTypesSecret$2;
  918. var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
  919. var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
  920. var has$1 = has$2;
  921. var printWarning$1 = function printWarning$1() {};
  922. if (true) {
  923. var ReactPropTypesSecret = ReactPropTypesSecret$1;
  924. var loggedTypeFailures = {};
  925. var has = has$1;
  926. printWarning$1 = function printWarning$1(text) {
  927. var message = 'Warning: ' + text;
  928. if (typeof console !== 'undefined') {
  929. console.error(message);
  930. }
  931. try {
  932. // --- Welcome to debugging React ---
  933. // This error was thrown as a convenience so that you can use this stack
  934. // to find the callsite that caused this warning to fire.
  935. throw new Error(message);
  936. } catch (x) {/**/}
  937. };
  938. }
  939. /**
  940. * Assert that the values match with the type specs.
  941. * Error messages are memorized and will only be shown once.
  942. *
  943. * @param {object} typeSpecs Map of name to a ReactPropType
  944. * @param {object} values Runtime values that need to be type-checked
  945. * @param {string} location e.g. "prop", "context", "child context"
  946. * @param {string} componentName Name of the component for error messages.
  947. * @param {?Function} getStack Returns the component stack.
  948. * @private
  949. */
  950. function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
  951. if (true) {
  952. for (var typeSpecName in typeSpecs) {
  953. if (has(typeSpecs, typeSpecName)) {
  954. var error;
  955. // Prop type validation may throw. In case they do, we don't want to
  956. // fail the render phase where it didn't fail before. So we log it.
  957. // After these have been cleaned up, we'll let them throw.
  958. try {
  959. // This is intentionally an invariant that gets caught. It's the same
  960. // behavior as without this statement except with a better message.
  961. if (typeof typeSpecs[typeSpecName] !== 'function') {
  962. var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(typeSpecs[typeSpecName]) + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
  963. err.name = 'Invariant Violation';
  964. throw err;
  965. }
  966. error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
  967. } catch (ex) {
  968. error = ex;
  969. }
  970. if (error && !(error instanceof Error)) {
  971. printWarning$1((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(error) + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
  972. }
  973. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  974. // Only monitor this failure once because there tends to be a lot of the
  975. // same error.
  976. loggedTypeFailures[error.message] = true;
  977. var stack = getStack ? getStack() : '';
  978. printWarning$1('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
  979. }
  980. }
  981. }
  982. }
  983. }
  984. /**
  985. * Resets warning cache when testing.
  986. *
  987. * @private
  988. */
  989. checkPropTypes$1.resetWarningCache = function () {
  990. if (true) {
  991. loggedTypeFailures = {};
  992. }
  993. };
  994. var checkPropTypes_1 = checkPropTypes$1;
  995. var checkPropTypes = checkPropTypes_1;
  996. var printWarning = function printWarning() {};
  997. if (true) {
  998. printWarning = function printWarning(text) {
  999. var message = 'Warning: ' + text;
  1000. if (typeof console !== 'undefined') {
  1001. console.error(message);
  1002. }
  1003. try {
  1004. // --- Welcome to debugging React ---
  1005. // This error was thrown as a convenience so that you can use this stack
  1006. // to find the callsite that caused this warning to fire.
  1007. throw new Error(message);
  1008. } catch (x) {}
  1009. };
  1010. }
  1011. function emptyFunctionThatReturnsNull() {
  1012. return null;
  1013. }
  1014. var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) {
  1015. /* global Symbol */
  1016. var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  1017. var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
  1018. /**
  1019. * Returns the iterator method function contained on the iterable object.
  1020. *
  1021. * Be sure to invoke the function with the iterable as context:
  1022. *
  1023. * var iteratorFn = getIteratorFn(myIterable);
  1024. * if (iteratorFn) {
  1025. * var iterator = iteratorFn.call(myIterable);
  1026. * ...
  1027. * }
  1028. *
  1029. * @param {?object} maybeIterable
  1030. * @return {?function}
  1031. */
  1032. function getIteratorFn(maybeIterable) {
  1033. var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
  1034. if (typeof iteratorFn === 'function') {
  1035. return iteratorFn;
  1036. }
  1037. }
  1038. /**
  1039. * Collection of methods that allow declaration and validation of props that are
  1040. * supplied to React components. Example usage:
  1041. *
  1042. * var Props = require('ReactPropTypes');
  1043. * var MyArticle = React.createClass({
  1044. * propTypes: {
  1045. * // An optional string prop named "description".
  1046. * description: Props.string,
  1047. *
  1048. * // A required enum prop named "category".
  1049. * category: Props.oneOf(['News','Photos']).isRequired,
  1050. *
  1051. * // A prop named "dialog" that requires an instance of Dialog.
  1052. * dialog: Props.instanceOf(Dialog).isRequired
  1053. * },
  1054. * render: function() { ... }
  1055. * });
  1056. *
  1057. * A more formal specification of how these methods are used:
  1058. *
  1059. * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
  1060. * decl := ReactPropTypes.{type}(.isRequired)?
  1061. *
  1062. * Each and every declaration produces a function with the same signature. This
  1063. * allows the creation of custom validation functions. For example:
  1064. *
  1065. * var MyLink = React.createClass({
  1066. * propTypes: {
  1067. * // An optional string or URI prop named "href".
  1068. * href: function(props, propName, componentName) {
  1069. * var propValue = props[propName];
  1070. * if (propValue != null && typeof propValue !== 'string' &&
  1071. * !(propValue instanceof URI)) {
  1072. * return new Error(
  1073. * 'Expected a string or an URI for ' + propName + ' in ' +
  1074. * componentName
  1075. * );
  1076. * }
  1077. * }
  1078. * },
  1079. * render: function() {...}
  1080. * });
  1081. *
  1082. * @internal
  1083. */
  1084. var ANONYMOUS = '<<anonymous>>';
  1085. // Important!
  1086. // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
  1087. var ReactPropTypes = {
  1088. array: createPrimitiveTypeChecker('array'),
  1089. bigint: createPrimitiveTypeChecker('bigint'),
  1090. bool: createPrimitiveTypeChecker('boolean'),
  1091. func: createPrimitiveTypeChecker('function'),
  1092. number: createPrimitiveTypeChecker('number'),
  1093. object: createPrimitiveTypeChecker('object'),
  1094. string: createPrimitiveTypeChecker('string'),
  1095. symbol: createPrimitiveTypeChecker('symbol'),
  1096. any: createAnyTypeChecker(),
  1097. arrayOf: createArrayOfTypeChecker,
  1098. element: createElementTypeChecker(),
  1099. elementType: createElementTypeTypeChecker(),
  1100. instanceOf: createInstanceTypeChecker,
  1101. node: createNodeChecker(),
  1102. objectOf: createObjectOfTypeChecker,
  1103. oneOf: createEnumTypeChecker,
  1104. oneOfType: createUnionTypeChecker,
  1105. shape: createShapeTypeChecker,
  1106. exact: createStrictShapeTypeChecker
  1107. };
  1108. /**
  1109. * inlined Object.is polyfill to avoid requiring consumers ship their own
  1110. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  1111. */
  1112. /*eslint-disable no-self-compare*/
  1113. function is(x, y) {
  1114. // SameValue algorithm
  1115. if (x === y) {
  1116. // Steps 1-5, 7-10
  1117. // Steps 6.b-6.e: +0 != -0
  1118. return x !== 0 || 1 / x === 1 / y;
  1119. } else {
  1120. // Step 6.a: NaN == NaN
  1121. return x !== x && y !== y;
  1122. }
  1123. }
  1124. /*eslint-enable no-self-compare*/
  1125. /**
  1126. * We use an Error-like object for backward compatibility as people may call
  1127. * PropTypes directly and inspect their output. However, we don't use real
  1128. * Errors anymore. We don't inspect their stack anyway, and creating them
  1129. * is prohibitively expensive if they are created too often, such as what
  1130. * happens in oneOfType() for any type before the one that matched.
  1131. */
  1132. function PropTypeError(message, data) {
  1133. this.message = message;
  1134. this.data = data && (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data) === 'object' ? data : {};
  1135. this.stack = '';
  1136. }
  1137. // Make `instanceof Error` still work for returned errors.
  1138. PropTypeError.prototype = Error.prototype;
  1139. function createChainableTypeChecker(validate) {
  1140. if (true) {
  1141. var manualPropTypeCallCache = {};
  1142. var manualPropTypeWarningCount = 0;
  1143. }
  1144. function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
  1145. componentName = componentName || ANONYMOUS;
  1146. propFullName = propFullName || propName;
  1147. if (secret !== ReactPropTypesSecret$1) {
  1148. if (throwOnDirectAccess) {
  1149. // New behavior only for users of `prop-types` package
  1150. var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
  1151. err.name = 'Invariant Violation';
  1152. throw err;
  1153. } else if ( true && typeof console !== 'undefined') {
  1154. // Old behavior for people using React.PropTypes
  1155. var cacheKey = componentName + ':' + propName;
  1156. if (!manualPropTypeCallCache[cacheKey] &&
  1157. // Avoid spamming the console because they are often not actionable except for lib authors
  1158. manualPropTypeWarningCount < 3) {
  1159. printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
  1160. manualPropTypeCallCache[cacheKey] = true;
  1161. manualPropTypeWarningCount++;
  1162. }
  1163. }
  1164. }
  1165. if (props[propName] == null) {
  1166. if (isRequired) {
  1167. if (props[propName] === null) {
  1168. return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
  1169. }
  1170. return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
  1171. }
  1172. return null;
  1173. } else {
  1174. return validate(props, propName, componentName, location, propFullName);
  1175. }
  1176. }
  1177. var chainedCheckType = checkType.bind(null, false);
  1178. chainedCheckType.isRequired = checkType.bind(null, true);
  1179. return chainedCheckType;
  1180. }
  1181. function createPrimitiveTypeChecker(expectedType) {
  1182. function validate(props, propName, componentName, location, propFullName, secret) {
  1183. var propValue = props[propName];
  1184. var propType = getPropType(propValue);
  1185. if (propType !== expectedType) {
  1186. // `propValue` being instance of, say, date/regexp, pass the 'object'
  1187. // check, but we can offer a more precise error message here rather than
  1188. // 'of type `object`'.
  1189. var preciseType = getPreciseType(propValue);
  1190. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
  1191. expectedType: expectedType
  1192. });
  1193. }
  1194. return null;
  1195. }
  1196. return createChainableTypeChecker(validate);
  1197. }
  1198. function createAnyTypeChecker() {
  1199. return createChainableTypeChecker(emptyFunctionThatReturnsNull);
  1200. }
  1201. function createArrayOfTypeChecker(typeChecker) {
  1202. function validate(props, propName, componentName, location, propFullName) {
  1203. if (typeof typeChecker !== 'function') {
  1204. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
  1205. }
  1206. var propValue = props[propName];
  1207. if (!Array.isArray(propValue)) {
  1208. var propType = getPropType(propValue);
  1209. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
  1210. }
  1211. for (var i = 0; i < propValue.length; i++) {
  1212. var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
  1213. if (error instanceof Error) {
  1214. return error;
  1215. }
  1216. }
  1217. return null;
  1218. }
  1219. return createChainableTypeChecker(validate);
  1220. }
  1221. function createElementTypeChecker() {
  1222. function validate(props, propName, componentName, location, propFullName) {
  1223. var propValue = props[propName];
  1224. if (!isValidElement(propValue)) {
  1225. var propType = getPropType(propValue);
  1226. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
  1227. }
  1228. return null;
  1229. }
  1230. return createChainableTypeChecker(validate);
  1231. }
  1232. function createElementTypeTypeChecker() {
  1233. function validate(props, propName, componentName, location, propFullName) {
  1234. var propValue = props[propName];
  1235. if (!reactIs.isValidElementType(propValue)) {
  1236. var propType = getPropType(propValue);
  1237. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
  1238. }
  1239. return null;
  1240. }
  1241. return createChainableTypeChecker(validate);
  1242. }
  1243. function createInstanceTypeChecker(expectedClass) {
  1244. function validate(props, propName, componentName, location, propFullName) {
  1245. if (!(props[propName] instanceof expectedClass)) {
  1246. var expectedClassName = expectedClass.name || ANONYMOUS;
  1247. var actualClassName = getClassName(props[propName]);
  1248. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
  1249. }
  1250. return null;
  1251. }
  1252. return createChainableTypeChecker(validate);
  1253. }
  1254. function createEnumTypeChecker(expectedValues) {
  1255. if (!Array.isArray(expectedValues)) {
  1256. if (true) {
  1257. if (arguments.length > 1) {
  1258. printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
  1259. } else {
  1260. printWarning('Invalid argument supplied to oneOf, expected an array.');
  1261. }
  1262. }
  1263. return emptyFunctionThatReturnsNull;
  1264. }
  1265. function validate(props, propName, componentName, location, propFullName) {
  1266. var propValue = props[propName];
  1267. for (var i = 0; i < expectedValues.length; i++) {
  1268. if (is(propValue, expectedValues[i])) {
  1269. return null;
  1270. }
  1271. }
  1272. var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
  1273. var type = getPreciseType(value);
  1274. if (type === 'symbol') {
  1275. return String(value);
  1276. }
  1277. return value;
  1278. });
  1279. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
  1280. }
  1281. return createChainableTypeChecker(validate);
  1282. }
  1283. function createObjectOfTypeChecker(typeChecker) {
  1284. function validate(props, propName, componentName, location, propFullName) {
  1285. if (typeof typeChecker !== 'function') {
  1286. return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
  1287. }
  1288. var propValue = props[propName];
  1289. var propType = getPropType(propValue);
  1290. if (propType !== 'object') {
  1291. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
  1292. }
  1293. for (var key in propValue) {
  1294. if (has$1(propValue, key)) {
  1295. var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
  1296. if (error instanceof Error) {
  1297. return error;
  1298. }
  1299. }
  1300. }
  1301. return null;
  1302. }
  1303. return createChainableTypeChecker(validate);
  1304. }
  1305. function createUnionTypeChecker(arrayOfTypeCheckers) {
  1306. if (!Array.isArray(arrayOfTypeCheckers)) {
  1307. true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0;
  1308. return emptyFunctionThatReturnsNull;
  1309. }
  1310. for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
  1311. var checker = arrayOfTypeCheckers[i];
  1312. if (typeof checker !== 'function') {
  1313. printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
  1314. return emptyFunctionThatReturnsNull;
  1315. }
  1316. }
  1317. function validate(props, propName, componentName, location, propFullName) {
  1318. var expectedTypes = [];
  1319. for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
  1320. var checker = arrayOfTypeCheckers[i];
  1321. var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
  1322. if (checkerResult == null) {
  1323. return null;
  1324. }
  1325. if (checkerResult.data && has$1(checkerResult.data, 'expectedType')) {
  1326. expectedTypes.push(checkerResult.data.expectedType);
  1327. }
  1328. }
  1329. var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
  1330. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
  1331. }
  1332. return createChainableTypeChecker(validate);
  1333. }
  1334. function createNodeChecker() {
  1335. function validate(props, propName, componentName, location, propFullName) {
  1336. if (!isNode(props[propName])) {
  1337. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
  1338. }
  1339. return null;
  1340. }
  1341. return createChainableTypeChecker(validate);
  1342. }
  1343. function invalidValidatorError(componentName, location, propFullName, key, type) {
  1344. return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
  1345. }
  1346. function createShapeTypeChecker(shapeTypes) {
  1347. function validate(props, propName, componentName, location, propFullName) {
  1348. var propValue = props[propName];
  1349. var propType = getPropType(propValue);
  1350. if (propType !== 'object') {
  1351. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
  1352. }
  1353. for (var key in shapeTypes) {
  1354. var checker = shapeTypes[key];
  1355. if (typeof checker !== 'function') {
  1356. return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
  1357. }
  1358. var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
  1359. if (error) {
  1360. return error;
  1361. }
  1362. }
  1363. return null;
  1364. }
  1365. return createChainableTypeChecker(validate);
  1366. }
  1367. function createStrictShapeTypeChecker(shapeTypes) {
  1368. function validate(props, propName, componentName, location, propFullName) {
  1369. var propValue = props[propName];
  1370. var propType = getPropType(propValue);
  1371. if (propType !== 'object') {
  1372. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
  1373. }
  1374. // We need to check all keys in case some are required but missing from props.
  1375. var allKeys = objectAssign({}, props[propName], shapeTypes);
  1376. for (var key in allKeys) {
  1377. var checker = shapeTypes[key];
  1378. if (has$1(shapeTypes, key) && typeof checker !== 'function') {
  1379. return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
  1380. }
  1381. if (!checker) {
  1382. return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
  1383. }
  1384. var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
  1385. if (error) {
  1386. return error;
  1387. }
  1388. }
  1389. return null;
  1390. }
  1391. return createChainableTypeChecker(validate);
  1392. }
  1393. function isNode(propValue) {
  1394. switch ((0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(propValue)) {
  1395. case 'number':
  1396. case 'string':
  1397. case 'undefined':
  1398. return true;
  1399. case 'boolean':
  1400. return !propValue;
  1401. case 'object':
  1402. if (Array.isArray(propValue)) {
  1403. return propValue.every(isNode);
  1404. }
  1405. if (propValue === null || isValidElement(propValue)) {
  1406. return true;
  1407. }
  1408. var iteratorFn = getIteratorFn(propValue);
  1409. if (iteratorFn) {
  1410. var iterator = iteratorFn.call(propValue);
  1411. var step;
  1412. if (iteratorFn !== propValue.entries) {
  1413. while (!(step = iterator.next()).done) {
  1414. if (!isNode(step.value)) {
  1415. return false;
  1416. }
  1417. }
  1418. } else {
  1419. // Iterator will provide entry [k,v] tuples rather than values.
  1420. while (!(step = iterator.next()).done) {
  1421. var entry = step.value;
  1422. if (entry) {
  1423. if (!isNode(entry[1])) {
  1424. return false;
  1425. }
  1426. }
  1427. }
  1428. }
  1429. } else {
  1430. return false;
  1431. }
  1432. return true;
  1433. default:
  1434. return false;
  1435. }
  1436. }
  1437. function isSymbol(propType, propValue) {
  1438. // Native Symbol.
  1439. if (propType === 'symbol') {
  1440. return true;
  1441. }
  1442. // falsy value can't be a Symbol
  1443. if (!propValue) {
  1444. return false;
  1445. }
  1446. // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
  1447. if (propValue['@@toStringTag'] === 'Symbol') {
  1448. return true;
  1449. }
  1450. // Fallback for non-spec compliant Symbols which are polyfilled.
  1451. if (typeof Symbol === 'function' && propValue instanceof Symbol) {
  1452. return true;
  1453. }
  1454. return false;
  1455. }
  1456. // Equivalent of `typeof` but with special handling for array and regexp.
  1457. function getPropType(propValue) {
  1458. var propType = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(propValue);
  1459. if (Array.isArray(propValue)) {
  1460. return 'array';
  1461. }
  1462. if (propValue instanceof RegExp) {
  1463. // Old webkits (at least until Android 4.0) return 'function' rather than
  1464. // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
  1465. // passes PropTypes.object.
  1466. return 'object';
  1467. }
  1468. if (isSymbol(propType, propValue)) {
  1469. return 'symbol';
  1470. }
  1471. return propType;
  1472. }
  1473. // This handles more types than `getPropType`. Only used for error messages.
  1474. // See `createPrimitiveTypeChecker`.
  1475. function getPreciseType(propValue) {
  1476. if (typeof propValue === 'undefined' || propValue === null) {
  1477. return '' + propValue;
  1478. }
  1479. var propType = getPropType(propValue);
  1480. if (propType === 'object') {
  1481. if (propValue instanceof Date) {
  1482. return 'date';
  1483. } else if (propValue instanceof RegExp) {
  1484. return 'regexp';
  1485. }
  1486. }
  1487. return propType;
  1488. }
  1489. // Returns a string that is postfixed to a warning about an invalid type.
  1490. // For example, "undefined" or "of type array"
  1491. function getPostfixForTypeWarning(value) {
  1492. var type = getPreciseType(value);
  1493. switch (type) {
  1494. case 'array':
  1495. case 'object':
  1496. return 'an ' + type;
  1497. case 'boolean':
  1498. case 'date':
  1499. case 'regexp':
  1500. return 'a ' + type;
  1501. default:
  1502. return type;
  1503. }
  1504. }
  1505. // Returns class name of the object, if any.
  1506. function getClassName(propValue) {
  1507. if (!propValue.constructor || !propValue.constructor.name) {
  1508. return ANONYMOUS;
  1509. }
  1510. return propValue.constructor.name;
  1511. }
  1512. ReactPropTypes.checkPropTypes = checkPropTypes;
  1513. ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
  1514. ReactPropTypes.PropTypes = ReactPropTypes;
  1515. return ReactPropTypes;
  1516. };
  1517. function emptyFunction() {}
  1518. function emptyFunctionWithReset() {}
  1519. emptyFunctionWithReset.resetWarningCache = emptyFunction;
  1520. var factoryWithThrowingShims = function factoryWithThrowingShims() {
  1521. function shim(props, propName, componentName, location, propFullName, secret) {
  1522. if (secret === ReactPropTypesSecret$1) {
  1523. // It is still safe when called from React.
  1524. return;
  1525. }
  1526. var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
  1527. err.name = 'Invariant Violation';
  1528. throw err;
  1529. }
  1530. shim.isRequired = shim;
  1531. function getShim() {
  1532. return shim;
  1533. } // Important!
  1534. // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
  1535. var ReactPropTypes = {
  1536. array: shim,
  1537. bigint: shim,
  1538. bool: shim,
  1539. func: shim,
  1540. number: shim,
  1541. object: shim,
  1542. string: shim,
  1543. symbol: shim,
  1544. any: shim,
  1545. arrayOf: getShim,
  1546. element: shim,
  1547. elementType: shim,
  1548. instanceOf: getShim,
  1549. node: shim,
  1550. objectOf: getShim,
  1551. oneOf: getShim,
  1552. oneOfType: getShim,
  1553. shape: getShim,
  1554. exact: getShim,
  1555. checkPropTypes: emptyFunctionWithReset,
  1556. resetWarningCache: emptyFunction
  1557. };
  1558. ReactPropTypes.PropTypes = ReactPropTypes;
  1559. return ReactPropTypes;
  1560. };
  1561. var require$$1 = factoryWithTypeCheckers;
  1562. var require$$2 = factoryWithThrowingShims;
  1563. var propTypes = createCommonjsModule(function (module) {
  1564. /**
  1565. * Copyright (c) 2013-present, Facebook, Inc.
  1566. *
  1567. * This source code is licensed under the MIT license found in the
  1568. * LICENSE file in the root directory of this source tree.
  1569. */
  1570. if (true) {
  1571. var ReactIs = reactIs;
  1572. // By explicitly using `prop-types` you are opting into new development behavior.
  1573. // http://fb.me/prop-types-in-prod
  1574. var throwOnDirectAccess = true;
  1575. module.exports = require$$1(ReactIs.isElement, throwOnDirectAccess);
  1576. } else {}
  1577. });
  1578. var PropTypes = propTypes;
  1579. var AtActionSheetBody = /** @class */function (_super) {
  1580. __extends(AtActionSheetBody, _super);
  1581. function AtActionSheetBody() {
  1582. return _super !== null && _super.apply(this, arguments) || this;
  1583. }
  1584. AtActionSheetBody.prototype.render = function () {
  1585. var rootClass = classnames('at-action-sheet__body', this.props.className);
  1586. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1587. className: rootClass
  1588. }, this.props.children);
  1589. };
  1590. return AtActionSheetBody;
  1591. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  1592. var AtActionSheetFooter = /** @class */function (_super) {
  1593. __extends(AtActionSheetFooter, _super);
  1594. function AtActionSheetFooter() {
  1595. var _this = _super !== null && _super.apply(this, arguments) || this;
  1596. _this.handleClick = function () {
  1597. var _a;
  1598. var args = [];
  1599. for (var _i = 0; _i < arguments.length; _i++) {
  1600. args[_i] = arguments[_i];
  1601. }
  1602. if (typeof _this.props.onClick === 'function') {
  1603. (_a = _this.props).onClick.apply(_a, __spread(args));
  1604. }
  1605. };
  1606. return _this;
  1607. }
  1608. AtActionSheetFooter.prototype.render = function () {
  1609. var rootClass = classnames('at-action-sheet__footer', this.props.className);
  1610. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1611. onClick: this.handleClick,
  1612. className: rootClass
  1613. }, this.props.children);
  1614. };
  1615. return AtActionSheetFooter;
  1616. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  1617. AtActionSheetFooter.propTypes = {
  1618. onClick: PropTypes.func
  1619. };
  1620. var AtActionSheetHeader = /** @class */function (_super) {
  1621. __extends(AtActionSheetHeader, _super);
  1622. function AtActionSheetHeader() {
  1623. return _super !== null && _super.apply(this, arguments) || this;
  1624. }
  1625. AtActionSheetHeader.prototype.render = function () {
  1626. var rootClass = classnames('at-action-sheet__header', this.props.className);
  1627. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1628. className: rootClass
  1629. }, this.props.children);
  1630. };
  1631. return AtActionSheetHeader;
  1632. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  1633. var AtActionSheet = /** @class */function (_super) {
  1634. __extends(AtActionSheet, _super);
  1635. function AtActionSheet(props) {
  1636. var _this = _super.call(this, props) || this;
  1637. _this.handleClose = function () {
  1638. if (typeof _this.props.onClose === 'function') {
  1639. _this.props.onClose();
  1640. }
  1641. };
  1642. _this.handleCancel = function () {
  1643. if (typeof _this.props.onCancel === 'function') {
  1644. return _this.props.onCancel();
  1645. }
  1646. _this.close();
  1647. };
  1648. _this.close = function () {
  1649. _this.setState({
  1650. _isOpened: false
  1651. }, _this.handleClose);
  1652. };
  1653. _this.handleTouchMove = function (e) {
  1654. e.stopPropagation();
  1655. e.preventDefault();
  1656. };
  1657. var isOpened = props.isOpened;
  1658. _this.state = {
  1659. _isOpened: isOpened
  1660. };
  1661. return _this;
  1662. }
  1663. AtActionSheet.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  1664. var isOpened = nextProps.isOpened;
  1665. if (isOpened !== this.state._isOpened) {
  1666. this.setState({
  1667. _isOpened: isOpened
  1668. });
  1669. !isOpened && this.handleClose();
  1670. }
  1671. };
  1672. AtActionSheet.prototype.render = function () {
  1673. var _a = this.props,
  1674. title = _a.title,
  1675. cancelText = _a.cancelText,
  1676. className = _a.className;
  1677. var _isOpened = this.state._isOpened;
  1678. var rootClass = classnames('at-action-sheet', {
  1679. 'at-action-sheet--active': _isOpened
  1680. }, className);
  1681. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1682. className: rootClass,
  1683. onTouchMove: this.handleTouchMove
  1684. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1685. onClick: this.close,
  1686. className: 'at-action-sheet__overlay'
  1687. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1688. className: 'at-action-sheet__container'
  1689. }, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtActionSheetHeader, null, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtActionSheetBody, null, this.props.children), cancelText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtActionSheetFooter, {
  1690. onClick: this.handleCancel
  1691. }, cancelText)));
  1692. };
  1693. return AtActionSheet;
  1694. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  1695. AtActionSheet.defaultProps = {
  1696. title: '',
  1697. cancelText: '',
  1698. isOpened: false
  1699. };
  1700. AtActionSheet.propTypes = {
  1701. title: PropTypes.string,
  1702. onClose: PropTypes.func,
  1703. onCancel: PropTypes.func,
  1704. isOpened: PropTypes.bool.isRequired,
  1705. cancelText: PropTypes.string
  1706. };
  1707. var AtActionSheetItem = /** @class */function (_super) {
  1708. __extends(AtActionSheetItem, _super);
  1709. function AtActionSheetItem() {
  1710. var _this = _super !== null && _super.apply(this, arguments) || this;
  1711. _this.handleClick = function (args) {
  1712. if (typeof _this.props.onClick === 'function') {
  1713. _this.props.onClick(args);
  1714. }
  1715. };
  1716. return _this;
  1717. }
  1718. AtActionSheetItem.prototype.render = function () {
  1719. var rootClass = classnames('at-action-sheet__item', this.props.className);
  1720. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1721. className: rootClass,
  1722. onClick: this.handleClick
  1723. }, this.props.children);
  1724. };
  1725. return AtActionSheetItem;
  1726. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  1727. AtActionSheetItem.propTypes = {
  1728. onClick: PropTypes.func
  1729. };
  1730. var ENV$4 = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv();
  1731. function delay(delayTime) {
  1732. if (delayTime === void 0) {
  1733. delayTime = 25;
  1734. }
  1735. return new Promise(function (resolve) {
  1736. setTimeout(function () {
  1737. resolve();
  1738. }, delayTime);
  1739. });
  1740. }
  1741. function delayQuerySelector(selectorStr, delayTime) {
  1742. if (delayTime === void 0) {
  1743. delayTime = 500;
  1744. }
  1745. return new Promise(function (resolve) {
  1746. var selector = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().createSelectorQuery();
  1747. delay(delayTime).then(function () {
  1748. selector.select(selectorStr).boundingClientRect().exec(function (res) {
  1749. resolve(res);
  1750. });
  1751. });
  1752. });
  1753. }
  1754. function delayGetClientRect(_a) {
  1755. var selectorStr = _a.selectorStr,
  1756. _b = _a.delayTime,
  1757. delayTime = _b === void 0 ? 500 : _b;
  1758. var selector = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().createSelectorQuery();
  1759. return new Promise(function (resolve) {
  1760. delay(delayTime).then(function () {
  1761. selector.select(selectorStr).boundingClientRect().exec(function (res) {
  1762. resolve(res);
  1763. });
  1764. });
  1765. });
  1766. }
  1767. function uuid(len, radix) {
  1768. if (len === void 0) {
  1769. len = 8;
  1770. }
  1771. if (radix === void 0) {
  1772. radix = 16;
  1773. }
  1774. var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  1775. var value = [];
  1776. var i = 0;
  1777. radix = radix || chars.length;
  1778. if (len) {
  1779. // Compact form
  1780. for (i = 0; i < len; i++) value[i] = chars[0 | Math.random() * radix];
  1781. } else {
  1782. // rfc4122, version 4 form
  1783. var r
  1784. // rfc4122 requires these characters
  1785. /* eslint-disable-next-line */ = void 0;
  1786. // rfc4122 requires these characters
  1787. /* eslint-disable-next-line */
  1788. value[8] = value[13] = value[18] = value[23] = '-';
  1789. value[14] = '4';
  1790. // Fill in random data. At i==19 set the high bits of clock sequence as
  1791. // per rfc4122, sec. 4.1.5
  1792. for (i = 0; i < 36; i++) {
  1793. if (!value[i]) {
  1794. r = 0 | Math.random() * 16;
  1795. value[i] = chars[i === 19 ? r & 0x3 | 0x8 : r];
  1796. }
  1797. }
  1798. }
  1799. return value.join('');
  1800. }
  1801. function getEventDetail(event) {
  1802. var detail;
  1803. switch (ENV$4) {
  1804. case (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEB:
  1805. detail = {
  1806. pageX: event.pageX,
  1807. pageY: event.pageY,
  1808. clientX: event.clientX,
  1809. clientY: event.clientY,
  1810. offsetX: event.offsetX,
  1811. offsetY: event.offsetY,
  1812. x: event.x,
  1813. y: event.y
  1814. };
  1815. break;
  1816. case (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEAPP:
  1817. detail = {
  1818. pageX: event.touches[0].pageX,
  1819. pageY: event.touches[0].pageY,
  1820. clientX: event.touches[0].clientX,
  1821. clientY: event.touches[0].clientY,
  1822. offsetX: event.target.offsetLeft,
  1823. offsetY: event.target.offsetTop,
  1824. x: event.target.x,
  1825. y: event.target.y
  1826. };
  1827. break;
  1828. case (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).ALIPAY:
  1829. detail = {
  1830. pageX: event.target.pageX,
  1831. pageY: event.target.pageY,
  1832. clientX: event.target.clientX,
  1833. clientY: event.target.clientY,
  1834. offsetX: event.target.offsetLeft,
  1835. offsetY: event.target.offsetTop,
  1836. x: event.target.x,
  1837. y: event.target.y
  1838. };
  1839. break;
  1840. case (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).SWAN:
  1841. detail = {
  1842. pageX: event.changedTouches[0].pageX,
  1843. pageY: event.changedTouches[0].pageY,
  1844. clientX: event.target.clientX,
  1845. clientY: event.target.clientY,
  1846. offsetX: event.target.offsetLeft,
  1847. offsetY: event.target.offsetTop,
  1848. x: event.detail.x,
  1849. y: event.detail.y
  1850. };
  1851. break;
  1852. default:
  1853. detail = {
  1854. pageX: 0,
  1855. pageY: 0,
  1856. clientX: 0,
  1857. clientY: 0,
  1858. offsetX: 0,
  1859. offsetY: 0,
  1860. x: 0,
  1861. y: 0
  1862. };
  1863. console.warn('getEventDetail暂未支持该环境');
  1864. break;
  1865. }
  1866. return detail;
  1867. }
  1868. function isTest() {
  1869. return "development" === 'test';
  1870. }
  1871. var scrollTop = 0;
  1872. function handleTouchScroll(flag) {
  1873. if (ENV$4 !== (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEB) {
  1874. return;
  1875. }
  1876. if (flag) {
  1877. scrollTop = document.documentElement.scrollTop;
  1878. // 使body脱离文档流
  1879. document.body.classList.add('at-frozen');
  1880. // 把脱离文档流的body拉上去!否则页面会回到顶部!
  1881. document.body.style.top = -scrollTop + "px";
  1882. } else {
  1883. document.body.style.top = '';
  1884. document.body.classList.remove('at-frozen');
  1885. document.documentElement.scrollTop = scrollTop;
  1886. }
  1887. }
  1888. function pxTransform(size) {
  1889. if (!size) return '';
  1890. var designWidth = 750;
  1891. var deviceRatio = {
  1892. 640: 2.34 / 2,
  1893. 750: 1,
  1894. 828: 1.81 / 2
  1895. };
  1896. return size / deviceRatio[designWidth] + "rpx";
  1897. }
  1898. function objectToString$2(style) {
  1899. if (style && (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(style) === 'object') {
  1900. var styleStr_1 = '';
  1901. Object.keys(style).forEach(function (key) {
  1902. var lowerCaseKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();
  1903. styleStr_1 += lowerCaseKey + ":" + style[key] + ";";
  1904. });
  1905. return styleStr_1;
  1906. } else if (style && typeof style === 'string') {
  1907. return style;
  1908. }
  1909. return '';
  1910. }
  1911. /**
  1912. * 合并 style
  1913. * @param {Object|String} style1
  1914. * @param {Object|String} style2
  1915. * @returns {String}
  1916. */
  1917. function mergeStyle(style1, style2) {
  1918. if (style1 && (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(style1) === 'object' && style2 && (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(style2) === 'object') {
  1919. return Object.assign({}, style1, style2);
  1920. }
  1921. return objectToString$2(style1) + objectToString$2(style2);
  1922. }
  1923. var AtLoading = /** @class */function (_super) {
  1924. __extends(AtLoading, _super);
  1925. function AtLoading() {
  1926. return _super !== null && _super.apply(this, arguments) || this;
  1927. }
  1928. AtLoading.prototype.render = function () {
  1929. var _a = this.props,
  1930. color = _a.color,
  1931. size = _a.size;
  1932. var loadingSize = typeof size === 'string' ? size : String(size);
  1933. var sizeStyle = {
  1934. width: size ? "" + pxTransform(parseInt(loadingSize)) : '',
  1935. height: size ? "" + pxTransform(parseInt(loadingSize)) : ''
  1936. };
  1937. var colorStyle = {
  1938. border: color ? "1px solid " + color : '',
  1939. borderColor: color ? color + " transparent transparent transparent" : ''
  1940. };
  1941. var ringStyle = Object.assign({}, colorStyle, sizeStyle);
  1942. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1943. className: 'at-loading',
  1944. style: sizeStyle
  1945. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1946. className: 'at-loading__ring',
  1947. style: ringStyle
  1948. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1949. className: 'at-loading__ring',
  1950. style: ringStyle
  1951. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1952. className: 'at-loading__ring',
  1953. style: ringStyle
  1954. }));
  1955. };
  1956. return AtLoading;
  1957. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  1958. AtLoading.defaultProps = {
  1959. size: 0,
  1960. color: ''
  1961. };
  1962. AtLoading.propTypes = {
  1963. size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  1964. color: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
  1965. };
  1966. var AtActivityIndicator = /** @class */function (_super) {
  1967. __extends(AtActivityIndicator, _super);
  1968. function AtActivityIndicator() {
  1969. return _super !== null && _super.apply(this, arguments) || this;
  1970. }
  1971. AtActivityIndicator.prototype.render = function () {
  1972. var _a = this.props,
  1973. color = _a.color,
  1974. size = _a.size,
  1975. mode = _a.mode,
  1976. content = _a.content,
  1977. isOpened = _a.isOpened;
  1978. var rootClass = classnames('at-activity-indicator', {
  1979. 'at-activity-indicator--center': mode === 'center',
  1980. 'at-activity-indicator--isopened': isOpened
  1981. }, this.props.className);
  1982. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1983. className: rootClass
  1984. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  1985. className: 'at-activity-indicator__body'
  1986. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtLoading, {
  1987. size: size,
  1988. color: color
  1989. })), content && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  1990. className: 'at-activity-indicator__content'
  1991. }, content));
  1992. };
  1993. return AtActivityIndicator;
  1994. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  1995. AtActivityIndicator.defaultProps = {
  1996. size: 0,
  1997. mode: 'normal',
  1998. color: '',
  1999. content: '',
  2000. className: '',
  2001. isOpened: true
  2002. };
  2003. AtActivityIndicator.propTypes = {
  2004. size: PropTypes.number,
  2005. mode: PropTypes.string,
  2006. color: PropTypes.string,
  2007. content: PropTypes.string,
  2008. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  2009. isOpened: PropTypes.bool
  2010. };
  2011. var SIZE_CLASS$2 = {
  2012. large: 'large',
  2013. normal: 'normal',
  2014. small: 'small'
  2015. };
  2016. var AtAvatar = /** @class */function (_super) {
  2017. __extends(AtAvatar, _super);
  2018. function AtAvatar(props) {
  2019. var _this = _super.call(this, props) || this;
  2020. _this.state = {
  2021. isWEAPP: _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv() === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEAPP
  2022. };
  2023. return _this;
  2024. }
  2025. AtAvatar.prototype.render = function () {
  2026. var _a;
  2027. var _b = this.props,
  2028. size = _b.size,
  2029. circle = _b.circle,
  2030. image = _b.image,
  2031. text = _b.text,
  2032. openData = _b.openData,
  2033. customStyle = _b.customStyle;
  2034. var rootClassName = ['at-avatar'];
  2035. var iconSize = SIZE_CLASS$2[size || 'normal'];
  2036. var classObject = (_a = {}, _a["at-avatar--" + iconSize] = iconSize, _a['at-avatar--circle'] = circle, _a);
  2037. var letter = '';
  2038. if (text) letter = text[0];
  2039. var elem;
  2040. if (openData && openData.type === 'userAvatarUrl' && this.state.isWEAPP) {
  2041. elem = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.OpenData, {
  2042. type: openData.type
  2043. });
  2044. } else if (image) {
  2045. elem = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Image, {
  2046. className: 'at-avatar__img',
  2047. src: image
  2048. });
  2049. } else {
  2050. elem = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  2051. className: 'at-avatar__text'
  2052. }, letter);
  2053. }
  2054. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2055. className: classnames(rootClassName, classObject, this.props.className),
  2056. style: customStyle
  2057. }, elem);
  2058. };
  2059. return AtAvatar;
  2060. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  2061. AtAvatar.defaultProps = {
  2062. size: 'normal',
  2063. circle: false,
  2064. text: '',
  2065. image: '',
  2066. customStyle: {},
  2067. className: ''
  2068. };
  2069. AtAvatar.propTypes = {
  2070. size: PropTypes.oneOf(['large', 'normal', 'small']),
  2071. circle: PropTypes.bool,
  2072. text: PropTypes.string,
  2073. image: PropTypes.string,
  2074. openData: PropTypes.object,
  2075. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  2076. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
  2077. };
  2078. var AtBadge = /** @class */function (_super) {
  2079. __extends(AtBadge, _super);
  2080. function AtBadge(props) {
  2081. var _this = _super.call(this, props) || this;
  2082. _this.state = {};
  2083. return _this;
  2084. }
  2085. AtBadge.prototype.formatValue = function (value, maxValue) {
  2086. if (value === '' || value === null || typeof value === 'undefined') return '';
  2087. var numValue = +value;
  2088. if (Number.isNaN(numValue)) {
  2089. return value;
  2090. }
  2091. return numValue > maxValue ? maxValue + "+" : numValue;
  2092. };
  2093. AtBadge.prototype.render = function () {
  2094. var _a = this.props,
  2095. dot = _a.dot,
  2096. value = _a.value,
  2097. _b = _a.maxValue,
  2098. maxValue = _b === void 0 ? 99 : _b,
  2099. customStyle = _a.customStyle;
  2100. var rootClassName = ['at-badge'];
  2101. var val = this.formatValue(value, maxValue);
  2102. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2103. className: classnames(rootClassName, this.props.className),
  2104. style: customStyle
  2105. }, this.props.children, dot ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2106. className: 'at-badge__dot'
  2107. }) : val !== '' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2108. className: 'at-badge__num'
  2109. }, val));
  2110. };
  2111. return AtBadge;
  2112. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  2113. AtBadge.defaultProps = {
  2114. dot: false,
  2115. value: '',
  2116. maxValue: 99,
  2117. customStyle: {},
  2118. className: ''
  2119. };
  2120. AtBadge.propTypes = {
  2121. dot: PropTypes.bool,
  2122. value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  2123. maxValue: PropTypes.number,
  2124. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  2125. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
  2126. };
  2127. var SIZE_CLASS$1 = {
  2128. normal: 'normal',
  2129. small: 'small'
  2130. };
  2131. var TYPE_CLASS$1 = {
  2132. primary: 'primary',
  2133. secondary: 'secondary'
  2134. };
  2135. var AtButton = /** @class */function (_super) {
  2136. __extends(AtButton, _super);
  2137. function AtButton(props) {
  2138. var _this = _super.call(this, props) || this;
  2139. _this.state = {
  2140. isWEB: _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv() === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEB,
  2141. isWEAPP: _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv() === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEAPP,
  2142. isALIPAY: _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv() === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).ALIPAY
  2143. };
  2144. return _this;
  2145. }
  2146. AtButton.prototype.onClick = function (event) {
  2147. if (!this.props.disabled) {
  2148. this.props.onClick && this.props.onClick(event);
  2149. }
  2150. };
  2151. AtButton.prototype.onGetUserInfo = function (event) {
  2152. this.props.onGetUserInfo && this.props.onGetUserInfo(event);
  2153. };
  2154. AtButton.prototype.onContact = function (event) {
  2155. this.props.onContact && this.props.onContact(event);
  2156. };
  2157. AtButton.prototype.onGetPhoneNumber = function (event) {
  2158. this.props.onGetPhoneNumber && this.props.onGetPhoneNumber(event);
  2159. };
  2160. AtButton.prototype.onError = function (event) {
  2161. this.props.onError && this.props.onError(event);
  2162. };
  2163. AtButton.prototype.onOpenSetting = function (event) {
  2164. this.props.onOpenSetting && this.props.onOpenSetting(event);
  2165. };
  2166. AtButton.prototype.render = function () {
  2167. var _a;
  2168. var _b = this.props,
  2169. _c = _b.size,
  2170. size = _c === void 0 ? 'normal' : _c,
  2171. _d = _b.type,
  2172. type = _d === void 0 ? '' : _d,
  2173. circle = _b.circle,
  2174. full = _b.full,
  2175. loading = _b.loading,
  2176. disabled = _b.disabled,
  2177. customStyle = _b.customStyle,
  2178. formType = _b.formType,
  2179. openType = _b.openType,
  2180. lang = _b.lang,
  2181. sessionFrom = _b.sessionFrom,
  2182. sendMessageTitle = _b.sendMessageTitle,
  2183. sendMessagePath = _b.sendMessagePath,
  2184. sendMessageImg = _b.sendMessageImg,
  2185. showMessageCard = _b.showMessageCard,
  2186. appParameter = _b.appParameter;
  2187. var _e = this.state,
  2188. isWEAPP = _e.isWEAPP,
  2189. isALIPAY = _e.isALIPAY,
  2190. isWEB = _e.isWEB;
  2191. var rootClassName = ['at-button'];
  2192. var classObject = (_a = {}, _a["at-button--" + SIZE_CLASS$1[size]] = SIZE_CLASS$1[size], _a['at-button--disabled'] = disabled, _a["at-button--" + type] = TYPE_CLASS$1[type], _a['at-button--circle'] = circle, _a['at-button--full'] = full, _a);
  2193. var loadingColor = type === 'primary' ? '#fff' : '';
  2194. var loadingSize = size === 'small' ? '30' : 0;
  2195. var loadingComponent = null;
  2196. if (loading) {
  2197. loadingComponent = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2198. className: 'at-button__icon'
  2199. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtLoading, {
  2200. color: loadingColor,
  2201. size: loadingSize
  2202. }));
  2203. rootClassName.push('at-button--icon');
  2204. }
  2205. var webButton = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
  2206. className: 'at-button__wxbutton',
  2207. lang: lang,
  2208. formType: formType
  2209. });
  2210. var button = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
  2211. className: 'at-button__wxbutton',
  2212. formType: formType,
  2213. openType: openType,
  2214. lang: lang,
  2215. sessionFrom: sessionFrom,
  2216. sendMessageTitle: sendMessageTitle,
  2217. sendMessagePath: sendMessagePath,
  2218. sendMessageImg: sendMessageImg,
  2219. showMessageCard: showMessageCard,
  2220. appParameter: appParameter,
  2221. onGetUserInfo: this.onGetUserInfo.bind(this),
  2222. onGetPhoneNumber: this.onGetPhoneNumber.bind(this),
  2223. onOpenSetting: this.onOpenSetting.bind(this),
  2224. onError: this.onError.bind(this),
  2225. onContact: this.onContact.bind(this)
  2226. });
  2227. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2228. className: classnames(rootClassName, classObject, this.props.className),
  2229. style: customStyle,
  2230. onClick: this.onClick.bind(this)
  2231. }, isWEB && !disabled && webButton, isWEAPP && !disabled && button, isALIPAY && !disabled && button, loadingComponent, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2232. className: 'at-button__text'
  2233. }, this.props.children));
  2234. };
  2235. return AtButton;
  2236. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  2237. AtButton.defaultProps = {
  2238. size: 'normal',
  2239. circle: false,
  2240. full: false,
  2241. loading: false,
  2242. disabled: false,
  2243. customStyle: {},
  2244. // Button props
  2245. lang: 'en',
  2246. sessionFrom: '',
  2247. sendMessageTitle: '',
  2248. sendMessagePath: '',
  2249. sendMessageImg: '',
  2250. showMessageCard: false,
  2251. appParameter: ''
  2252. };
  2253. AtButton.propTypes = {
  2254. size: PropTypes.oneOf(['normal', 'small']),
  2255. type: PropTypes.oneOf(['primary', 'secondary', '']),
  2256. circle: PropTypes.bool,
  2257. full: PropTypes.bool,
  2258. loading: PropTypes.bool,
  2259. disabled: PropTypes.bool,
  2260. onClick: PropTypes.func,
  2261. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  2262. formType: PropTypes.oneOf(['submit', 'reset', '']),
  2263. openType: PropTypes.oneOf(['contact', 'share', 'getUserInfo', 'getPhoneNumber', 'launchApp', 'openSetting', 'feedback', 'getRealnameAuthInfo', 'getAuthorize', 'contactShare', '']),
  2264. lang: PropTypes.string,
  2265. sessionFrom: PropTypes.string,
  2266. sendMessageTitle: PropTypes.string,
  2267. sendMessagePath: PropTypes.string,
  2268. sendMessageImg: PropTypes.string,
  2269. showMessageCard: PropTypes.bool,
  2270. appParameter: PropTypes.string,
  2271. onGetUserInfo: PropTypes.func,
  2272. onContact: PropTypes.func,
  2273. onGetPhoneNumber: PropTypes.func,
  2274. onError: PropTypes.func,
  2275. onOpenSetting: PropTypes.func
  2276. };
  2277. var AtCard = /** @class */function (_super) {
  2278. __extends(AtCard, _super);
  2279. function AtCard() {
  2280. var _this = _super !== null && _super.apply(this, arguments) || this;
  2281. _this.handleClick = function (args) {
  2282. if (typeof _this.props.onClick === 'function') {
  2283. _this.props.onClick(args);
  2284. }
  2285. };
  2286. return _this;
  2287. }
  2288. AtCard.prototype.render = function () {
  2289. var _a;
  2290. var _b = this.props,
  2291. title = _b.title,
  2292. note = _b.note,
  2293. extra = _b.extra,
  2294. extraStyle = _b.extraStyle,
  2295. thumb = _b.thumb,
  2296. isFull = _b.isFull,
  2297. icon = _b.icon,
  2298. renderIcon = _b.renderIcon;
  2299. var rootClass = classnames('at-card', {
  2300. 'at-card--full': isFull
  2301. }, this.props.className);
  2302. var iconClass = classnames((_a = {
  2303. 'at-icon': true
  2304. }, _a["at-icon-" + (icon && icon.value)] = icon && icon.value, _a['at-card__header-icon'] = true, _a));
  2305. var iconStyle = {
  2306. color: icon && icon.color || '',
  2307. fontSize: icon && icon.size + "px" || ''
  2308. };
  2309. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2310. onClick: this.handleClick,
  2311. className: rootClass
  2312. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2313. className: 'at-card__header'
  2314. }, thumb && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2315. className: 'at-card__header-thumb'
  2316. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Image, {
  2317. className: 'at-card__header-thumb-info',
  2318. mode: 'scaleToFill',
  2319. src: thumb
  2320. })), renderIcon || '', !thumb && icon && icon.value && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  2321. className: iconClass,
  2322. style: iconStyle
  2323. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  2324. className: 'at-card__header-title'
  2325. }, title), extra && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  2326. style: _assign({}, extraStyle),
  2327. className: 'at-card__header-extra'
  2328. }, extra)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2329. className: 'at-card__content'
  2330. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2331. className: 'at-card__content-info'
  2332. }, this.props.children), note && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2333. className: 'at-card__content-note'
  2334. }, note)));
  2335. };
  2336. return AtCard;
  2337. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  2338. AtCard.defaultProps = {
  2339. note: '',
  2340. isFull: false,
  2341. thumb: '',
  2342. title: '',
  2343. extra: '',
  2344. extraStyle: {}
  2345. };
  2346. AtCard.propTypes = {
  2347. note: PropTypes.string,
  2348. isFull: PropTypes.bool,
  2349. thumb: PropTypes.string,
  2350. title: PropTypes.string,
  2351. extra: PropTypes.string,
  2352. icon: PropTypes.object,
  2353. onClick: PropTypes.func,
  2354. renderIcon: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
  2355. extraStyle: PropTypes.object // 自定义extra样式
  2356. };
  2357. var AtCheckbox = /** @class */function (_super) {
  2358. __extends(AtCheckbox, _super);
  2359. function AtCheckbox() {
  2360. return _super !== null && _super.apply(this, arguments) || this;
  2361. }
  2362. AtCheckbox.prototype.handleClick = function (idx) {
  2363. var _a = this.props,
  2364. selectedList = _a.selectedList,
  2365. options = _a.options;
  2366. var option = options[idx];
  2367. var disabled = option.disabled,
  2368. value = option.value;
  2369. if (disabled) return;
  2370. var selectedSet = new Set(selectedList);
  2371. if (!selectedSet.has(value)) {
  2372. selectedSet.add(value);
  2373. } else {
  2374. selectedSet.delete(value);
  2375. }
  2376. this.props.onChange(__spread(selectedSet));
  2377. };
  2378. AtCheckbox.prototype.render = function () {
  2379. var _this = this;
  2380. var _a = this.props,
  2381. customStyle = _a.customStyle,
  2382. className = _a.className,
  2383. options = _a.options,
  2384. selectedList = _a.selectedList;
  2385. var rootCls = classnames('at-checkbox', className);
  2386. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2387. className: rootCls,
  2388. style: customStyle
  2389. }, options.map(function (option, idx) {
  2390. var value = option.value,
  2391. disabled = option.disabled,
  2392. label = option.label,
  2393. desc = option.desc;
  2394. var optionCls = classnames('at-checkbox__option', {
  2395. 'at-checkbox__option--disabled': disabled,
  2396. 'at-checkbox__option--selected': selectedList.includes(value)
  2397. });
  2398. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2399. className: optionCls,
  2400. key: value,
  2401. onClick: _this.handleClick.bind(_this, idx)
  2402. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2403. className: 'at-checkbox__option-wrap'
  2404. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2405. className: 'at-checkbox__option-cnt'
  2406. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2407. className: 'at-checkbox__icon-cnt'
  2408. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  2409. className: 'at-icon at-icon-check'
  2410. })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2411. className: 'at-checkbox__title'
  2412. }, label)), desc && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2413. className: 'at-checkbox__desc'
  2414. }, desc)));
  2415. }));
  2416. };
  2417. return AtCheckbox;
  2418. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  2419. AtCheckbox.defaultProps = {
  2420. customStyle: '',
  2421. className: '',
  2422. options: [],
  2423. selectedList: [],
  2424. // eslint-disable-next-line @typescript-eslint/no-empty-function
  2425. onChange: function onChange() {}
  2426. };
  2427. AtCheckbox.propTypes = {
  2428. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  2429. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  2430. options: PropTypes.array,
  2431. selectedList: PropTypes.array,
  2432. onChange: PropTypes.func
  2433. };
  2434. var AtList = /** @class */function (_super) {
  2435. __extends(AtList, _super);
  2436. function AtList() {
  2437. return _super !== null && _super.apply(this, arguments) || this;
  2438. }
  2439. AtList.prototype.render = function () {
  2440. var rootClass = classnames('at-list', {
  2441. 'at-list--no-border': !this.props.hasBorder
  2442. }, this.props.className);
  2443. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2444. className: rootClass
  2445. }, this.props.children);
  2446. };
  2447. return AtList;
  2448. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  2449. AtList.defaultProps = {
  2450. hasBorder: true
  2451. };
  2452. AtList.propTypes = {
  2453. hasBorder: PropTypes.bool
  2454. };
  2455. var AtListItem = /** @class */function (_super) {
  2456. __extends(AtListItem, _super);
  2457. function AtListItem() {
  2458. var _this = _super !== null && _super.apply(this, arguments) || this;
  2459. _this.handleClick = function (event) {
  2460. if (typeof _this.props.onClick === 'function' && !_this.props.disabled) {
  2461. _this.props.onClick(event);
  2462. }
  2463. };
  2464. _this.handleSwitchChange = function (event) {
  2465. if (typeof _this.props.onSwitchChange === 'function' && !_this.props.disabled) {
  2466. _this.props.onSwitchChange(event);
  2467. }
  2468. };
  2469. return _this;
  2470. }
  2471. AtListItem.prototype.handleSwitchClick = function (e) {
  2472. e.stopPropagation();
  2473. };
  2474. AtListItem.prototype.render = function () {
  2475. var _a;
  2476. var _b = this.props,
  2477. note = _b.note,
  2478. arrow = _b.arrow,
  2479. thumb = _b.thumb,
  2480. iconInfo = _b.iconInfo,
  2481. disabled = _b.disabled,
  2482. isSwitch = _b.isSwitch,
  2483. hasBorder = _b.hasBorder,
  2484. extraThumb = _b.extraThumb,
  2485. switchColor = _b.switchColor,
  2486. switchIsCheck = _b.switchIsCheck;
  2487. var _c = this.props,
  2488. extraText = _c.extraText,
  2489. title = _c.title;
  2490. extraText = String(extraText);
  2491. title = String(title);
  2492. var rootClass = classnames('at-list__item', {
  2493. 'at-list__item--thumb': thumb,
  2494. 'at-list__item--multiple': note,
  2495. 'at-list__item--disabled': disabled,
  2496. 'at-list__item--no-border': !hasBorder
  2497. }, this.props.className);
  2498. var iconClass = classnames(iconInfo && iconInfo.prefixClass || 'at-icon', (_a = {}, _a[(iconInfo && iconInfo.prefixClass || 'at-icon') + "-" + (iconInfo && iconInfo.value)] = iconInfo && iconInfo.value, _a), iconInfo && iconInfo.className);
  2499. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2500. className: rootClass,
  2501. onClick: this.handleClick
  2502. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2503. className: 'at-list__item-container'
  2504. }, thumb && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2505. className: 'at-list__item-thumb item-thumb'
  2506. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Image, {
  2507. className: 'item-thumb__info',
  2508. mode: 'scaleToFill',
  2509. src: thumb
  2510. })), iconInfo && iconInfo.value && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2511. className: 'at-list__item-icon item-icon'
  2512. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  2513. className: iconClass,
  2514. style: mergeStyle({
  2515. color: iconInfo.color || '',
  2516. fontSize: (iconInfo.size || 24) + "px"
  2517. }, iconInfo.customStyle || '')
  2518. })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2519. className: 'at-list__item-content item-content'
  2520. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2521. className: 'item-content__info'
  2522. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2523. className: 'item-content__info-title'
  2524. }, title), note && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2525. className: 'item-content__info-note'
  2526. }, note))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2527. className: 'at-list__item-extra item-extra'
  2528. }, extraText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2529. className: 'item-extra__info'
  2530. }, extraText), extraThumb && !extraText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2531. className: 'item-extra__image'
  2532. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Image, {
  2533. className: 'item-extra__image-info',
  2534. mode: 'aspectFit',
  2535. src: extraThumb
  2536. })), isSwitch && !extraThumb && !extraText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2537. className: 'item-extra__switch',
  2538. onClick: this.handleSwitchClick
  2539. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Switch, {
  2540. color: switchColor,
  2541. disabled: disabled,
  2542. checked: switchIsCheck,
  2543. onChange: this.handleSwitchChange
  2544. })), arrow ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2545. className: 'item-extra__icon'
  2546. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  2547. className: "at-icon item-extra__icon-arrow at-icon-chevron-" + arrow
  2548. })) : null)));
  2549. };
  2550. return AtListItem;
  2551. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  2552. AtListItem.defaultProps = {
  2553. note: '',
  2554. disabled: false,
  2555. title: '',
  2556. thumb: '',
  2557. isSwitch: false,
  2558. hasBorder: true,
  2559. switchColor: '#6190E8',
  2560. switchIsCheck: false,
  2561. extraText: '',
  2562. extraThumb: '',
  2563. iconInfo: {
  2564. value: ''
  2565. }
  2566. };
  2567. AtListItem.propTypes = {
  2568. note: PropTypes.string,
  2569. disabled: PropTypes.bool,
  2570. title: PropTypes.string,
  2571. thumb: PropTypes.string,
  2572. onClick: PropTypes.func,
  2573. isSwitch: PropTypes.bool,
  2574. hasBorder: PropTypes.bool,
  2575. switchColor: PropTypes.string,
  2576. switchIsCheck: PropTypes.bool,
  2577. extraText: PropTypes.string,
  2578. extraThumb: PropTypes.string,
  2579. onSwitchChange: PropTypes.func,
  2580. arrow: PropTypes.oneOf(['up', 'down', 'right']),
  2581. iconInfo: PropTypes.shape({
  2582. size: PropTypes.number,
  2583. value: PropTypes.string,
  2584. color: PropTypes.string,
  2585. prefixClass: PropTypes.string,
  2586. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  2587. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
  2588. })
  2589. };
  2590. var AtDrawer = /** @class */function (_super) {
  2591. __extends(AtDrawer, _super);
  2592. function AtDrawer(props) {
  2593. var _this = _super.call(this, props) || this;
  2594. _this.state = {
  2595. animShow: false,
  2596. _show: props.show
  2597. };
  2598. return _this;
  2599. }
  2600. AtDrawer.prototype.componentDidMount = function () {
  2601. var _show = this.state._show;
  2602. if (_show) this.animShow();
  2603. };
  2604. AtDrawer.prototype.onItemClick = function (index) {
  2605. this.props.onItemClick && this.props.onItemClick(index);
  2606. this.animHide();
  2607. };
  2608. AtDrawer.prototype.onHide = function () {
  2609. var _this = this;
  2610. this.setState({
  2611. _show: false
  2612. }, function () {
  2613. _this.props.onClose && _this.props.onClose();
  2614. });
  2615. };
  2616. AtDrawer.prototype.animHide = function () {
  2617. var _this = this;
  2618. this.setState({
  2619. animShow: false
  2620. });
  2621. setTimeout(function () {
  2622. _this.onHide();
  2623. }, 300);
  2624. };
  2625. AtDrawer.prototype.animShow = function () {
  2626. var _this = this;
  2627. this.setState({
  2628. _show: true
  2629. });
  2630. setTimeout(function () {
  2631. _this.setState({
  2632. animShow: true
  2633. });
  2634. }, 200);
  2635. };
  2636. AtDrawer.prototype.onMaskClick = function () {
  2637. this.animHide();
  2638. };
  2639. AtDrawer.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  2640. var show = nextProps.show;
  2641. if (show !== this.state._show) {
  2642. show ? this.animShow() : this.animHide();
  2643. }
  2644. };
  2645. AtDrawer.prototype.render = function () {
  2646. var _this = this;
  2647. var _a = this.props,
  2648. mask = _a.mask,
  2649. width = _a.width,
  2650. right = _a.right,
  2651. items = _a.items;
  2652. var _b = this.state,
  2653. animShow = _b.animShow,
  2654. _show = _b._show;
  2655. var rootClassName = ['at-drawer'];
  2656. var maskStyle = {
  2657. display: mask ? 'block' : 'none',
  2658. opacity: animShow ? 1 : 0
  2659. };
  2660. var listStyle = {
  2661. width: width,
  2662. transition: animShow ? 'all 225ms cubic-bezier(0, 0, 0.2, 1)' : 'all 195ms cubic-bezier(0.4, 0, 0.6, 1)'
  2663. };
  2664. var classObject = {
  2665. 'at-drawer--show': animShow,
  2666. 'at-drawer--right': right,
  2667. 'at-drawer--left': !right
  2668. };
  2669. return _show ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2670. className: classnames(rootClassName, classObject, this.props.className)
  2671. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2672. className: 'at-drawer__mask',
  2673. style: maskStyle,
  2674. onClick: this.onMaskClick.bind(this)
  2675. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2676. className: 'at-drawer__content',
  2677. style: listStyle
  2678. }, !!items && items.length ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtList, null, items.map(function (name, index) {
  2679. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtListItem, {
  2680. key: name + "-" + index,
  2681. "data-index": index,
  2682. onClick: _this.onItemClick.bind(_this, index),
  2683. title: name,
  2684. arrow: 'right'
  2685. });
  2686. })) : this.props.children)) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, null);
  2687. };
  2688. return AtDrawer;
  2689. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  2690. AtDrawer.defaultProps = {
  2691. show: false,
  2692. mask: true,
  2693. width: '',
  2694. right: false,
  2695. items: []
  2696. };
  2697. AtDrawer.propTypes = {
  2698. show: PropTypes.bool,
  2699. mask: PropTypes.bool,
  2700. width: PropTypes.string,
  2701. items: PropTypes.arrayOf(PropTypes.string),
  2702. onItemClick: PropTypes.func,
  2703. onClose: PropTypes.func
  2704. };
  2705. var AtFloatLayout = /** @class */function (_super) {
  2706. __extends(AtFloatLayout, _super);
  2707. function AtFloatLayout(props) {
  2708. var _this = _super.call(this, props) || this;
  2709. _this.handleClose = function () {
  2710. if (typeof _this.props.onClose === 'function') {
  2711. // TODO: Fix typings
  2712. // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  2713. // @ts-ignore
  2714. _this.props.onClose();
  2715. }
  2716. };
  2717. _this.close = function () {
  2718. _this.setState({
  2719. _isOpened: false
  2720. }, _this.handleClose);
  2721. };
  2722. _this.handleTouchMove = function (e) {
  2723. e.stopPropagation();
  2724. };
  2725. var isOpened = props.isOpened;
  2726. _this.state = {
  2727. _isOpened: isOpened
  2728. };
  2729. return _this;
  2730. }
  2731. AtFloatLayout.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  2732. var isOpened = nextProps.isOpened;
  2733. if (this.props.isOpened !== isOpened) {
  2734. handleTouchScroll(isOpened);
  2735. }
  2736. if (isOpened !== this.state._isOpened) {
  2737. this.setState({
  2738. _isOpened: isOpened
  2739. });
  2740. }
  2741. };
  2742. AtFloatLayout.prototype.render = function () {
  2743. var _isOpened = this.state._isOpened;
  2744. var _a = this.props,
  2745. title = _a.title,
  2746. scrollY = _a.scrollY,
  2747. scrollX = _a.scrollX,
  2748. scrollTop = _a.scrollTop,
  2749. scrollLeft = _a.scrollLeft,
  2750. upperThreshold = _a.upperThreshold,
  2751. lowerThreshold = _a.lowerThreshold,
  2752. scrollWithAnimation = _a.scrollWithAnimation;
  2753. var rootClass = classnames('at-float-layout', {
  2754. 'at-float-layout--active': _isOpened
  2755. }, this.props.className);
  2756. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2757. className: rootClass,
  2758. onTouchMove: this.handleTouchMove
  2759. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2760. onClick: this.close,
  2761. className: 'at-float-layout__overlay'
  2762. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2763. className: 'at-float-layout__container layout'
  2764. }, title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2765. className: 'layout-header'
  2766. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  2767. className: 'layout-header__title'
  2768. }, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2769. className: 'layout-header__btn-close',
  2770. onClick: this.close
  2771. })) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  2772. className: 'layout-body'
  2773. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.ScrollView, {
  2774. scrollY: scrollY,
  2775. scrollX: scrollX,
  2776. scrollTop: scrollTop,
  2777. scrollLeft: scrollLeft,
  2778. upperThreshold: upperThreshold,
  2779. lowerThreshold: lowerThreshold,
  2780. scrollWithAnimation: scrollWithAnimation,
  2781. // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  2782. // @ts-ignore // TODO: Fix typings
  2783. onScroll: this.props.onScroll,
  2784. // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  2785. // @ts-ignore // TODO: Fix typings
  2786. onScrollToLower: this.props.onScrollToLower,
  2787. // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  2788. // @ts-ignore // TODO: Fix typings
  2789. onScrollToUpper: this.props.onScrollToUpper,
  2790. className: 'layout-body__content'
  2791. }, this.props.children))));
  2792. };
  2793. return AtFloatLayout;
  2794. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  2795. AtFloatLayout.defaultProps = {
  2796. title: '',
  2797. isOpened: false,
  2798. scrollY: true,
  2799. scrollX: false,
  2800. scrollWithAnimation: false
  2801. };
  2802. AtFloatLayout.propTypes = {
  2803. title: PropTypes.string,
  2804. isOpened: PropTypes.bool,
  2805. scrollY: PropTypes.bool,
  2806. scrollX: PropTypes.bool,
  2807. scrollTop: PropTypes.number,
  2808. scrollLeft: PropTypes.number,
  2809. upperThreshold: PropTypes.number,
  2810. lowerThreshold: PropTypes.number,
  2811. scrollWithAnimation: PropTypes.bool,
  2812. onClose: PropTypes.func,
  2813. onScroll: PropTypes.func,
  2814. onScrollToLower: PropTypes.func,
  2815. onScrollToUpper: PropTypes.func
  2816. };
  2817. var AtForm = /** @class */function (_super) {
  2818. __extends(AtForm, _super);
  2819. function AtForm() {
  2820. return _super !== null && _super.apply(this, arguments) || this;
  2821. }
  2822. AtForm.prototype.onSubmit = function () {
  2823. this.props.onSubmit && this.props.onSubmit(arguments);
  2824. };
  2825. AtForm.prototype.onReset = function () {
  2826. this.props.onReset && this.props.onReset(arguments);
  2827. };
  2828. AtForm.prototype.render = function () {
  2829. var _a = this.props,
  2830. customStyle = _a.customStyle,
  2831. className = _a.className,
  2832. reportSubmit = _a.reportSubmit;
  2833. var rootCls = classnames('at-form', className);
  2834. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Form, {
  2835. className: rootCls,
  2836. style: customStyle,
  2837. onSubmit: this.onSubmit.bind(this),
  2838. reportSubmit: reportSubmit,
  2839. onReset: this.onReset.bind(this)
  2840. }, this.props.children);
  2841. };
  2842. return AtForm;
  2843. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  2844. AtForm.defaultProps = {
  2845. customStyle: '',
  2846. className: '',
  2847. reportSubmit: false
  2848. };
  2849. AtForm.propTypes = {
  2850. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  2851. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  2852. reportSubmit: PropTypes.bool,
  2853. onSubmit: PropTypes.func,
  2854. onReset: PropTypes.func
  2855. };
  2856. /**
  2857. * The base implementation of `_.slice` without an iteratee call guard.
  2858. *
  2859. * @private
  2860. * @param {Array} array The array to slice.
  2861. * @param {number} [start=0] The start position.
  2862. * @param {number} [end=array.length] The end position.
  2863. * @returns {Array} Returns the slice of `array`.
  2864. */
  2865. function baseSlice(array, start, end) {
  2866. var index = -1,
  2867. length = array.length;
  2868. if (start < 0) {
  2869. start = -start > length ? 0 : length + start;
  2870. }
  2871. end = end > length ? length : end;
  2872. if (end < 0) {
  2873. end += length;
  2874. }
  2875. length = start > end ? 0 : end - start >>> 0;
  2876. start >>>= 0;
  2877. var result = Array(length);
  2878. while (++index < length) {
  2879. result[index] = array[index + start];
  2880. }
  2881. return result;
  2882. }
  2883. var _baseSlice = baseSlice;
  2884. /**
  2885. * Performs a
  2886. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  2887. * comparison between two values to determine if they are equivalent.
  2888. *
  2889. * @static
  2890. * @memberOf _
  2891. * @since 4.0.0
  2892. * @category Lang
  2893. * @param {*} value The value to compare.
  2894. * @param {*} other The other value to compare.
  2895. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  2896. * @example
  2897. *
  2898. * var object = { 'a': 1 };
  2899. * var other = { 'a': 1 };
  2900. *
  2901. * _.eq(object, object);
  2902. * // => true
  2903. *
  2904. * _.eq(object, other);
  2905. * // => false
  2906. *
  2907. * _.eq('a', 'a');
  2908. * // => true
  2909. *
  2910. * _.eq('a', Object('a'));
  2911. * // => false
  2912. *
  2913. * _.eq(NaN, NaN);
  2914. * // => true
  2915. */
  2916. function eq(value, other) {
  2917. return value === other || value !== value && other !== other;
  2918. }
  2919. var eq_1 = eq;
  2920. /** Detect free variable `global` from Node.js. */
  2921. var freeGlobal = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
  2922. var _freeGlobal = freeGlobal;
  2923. /** Detect free variable `self`. */
  2924. var freeSelf = (typeof self === "undefined" ? "undefined" : (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(self)) == 'object' && self && self.Object === Object && self;
  2925. /** Used as a reference to the global object. */
  2926. var root = _freeGlobal || freeSelf || Function('return this')();
  2927. var _root = root;
  2928. /** Built-in value references. */
  2929. var Symbol$1 = _root.Symbol;
  2930. var _Symbol = Symbol$1;
  2931. /** Used for built-in method references. */
  2932. var objectProto$8 = Object.prototype;
  2933. /** Used to check objects for own properties. */
  2934. var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
  2935. /**
  2936. * Used to resolve the
  2937. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2938. * of values.
  2939. */
  2940. var nativeObjectToString$1 = objectProto$8.toString;
  2941. /** Built-in value references. */
  2942. var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
  2943. /**
  2944. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  2945. *
  2946. * @private
  2947. * @param {*} value The value to query.
  2948. * @returns {string} Returns the raw `toStringTag`.
  2949. */
  2950. function getRawTag(value) {
  2951. var isOwn = hasOwnProperty$6.call(value, symToStringTag$1),
  2952. tag = value[symToStringTag$1];
  2953. try {
  2954. value[symToStringTag$1] = undefined;
  2955. var unmasked = true;
  2956. } catch (e) {}
  2957. var result = nativeObjectToString$1.call(value);
  2958. if (unmasked) {
  2959. if (isOwn) {
  2960. value[symToStringTag$1] = tag;
  2961. } else {
  2962. delete value[symToStringTag$1];
  2963. }
  2964. }
  2965. return result;
  2966. }
  2967. var _getRawTag = getRawTag;
  2968. /** Used for built-in method references. */
  2969. var objectProto$7 = Object.prototype;
  2970. /**
  2971. * Used to resolve the
  2972. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2973. * of values.
  2974. */
  2975. var nativeObjectToString = objectProto$7.toString;
  2976. /**
  2977. * Converts `value` to a string using `Object.prototype.toString`.
  2978. *
  2979. * @private
  2980. * @param {*} value The value to convert.
  2981. * @returns {string} Returns the converted string.
  2982. */
  2983. function objectToString$1(value) {
  2984. return nativeObjectToString.call(value);
  2985. }
  2986. var _objectToString = objectToString$1;
  2987. /** `Object#toString` result references. */
  2988. var nullTag = '[object Null]',
  2989. undefinedTag = '[object Undefined]';
  2990. /** Built-in value references. */
  2991. var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
  2992. /**
  2993. * The base implementation of `getTag` without fallbacks for buggy environments.
  2994. *
  2995. * @private
  2996. * @param {*} value The value to query.
  2997. * @returns {string} Returns the `toStringTag`.
  2998. */
  2999. function baseGetTag(value) {
  3000. if (value == null) {
  3001. return value === undefined ? undefinedTag : nullTag;
  3002. }
  3003. return symToStringTag && symToStringTag in Object(value) ? _getRawTag(value) : _objectToString(value);
  3004. }
  3005. var _baseGetTag = baseGetTag;
  3006. /**
  3007. * Checks if `value` is the
  3008. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  3009. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  3010. *
  3011. * @static
  3012. * @memberOf _
  3013. * @since 0.1.0
  3014. * @category Lang
  3015. * @param {*} value The value to check.
  3016. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  3017. * @example
  3018. *
  3019. * _.isObject({});
  3020. * // => true
  3021. *
  3022. * _.isObject([1, 2, 3]);
  3023. * // => true
  3024. *
  3025. * _.isObject(_.noop);
  3026. * // => true
  3027. *
  3028. * _.isObject(null);
  3029. * // => false
  3030. */
  3031. function isObject(value) {
  3032. var type = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
  3033. return value != null && (type == 'object' || type == 'function');
  3034. }
  3035. var isObject_1 = isObject;
  3036. /** `Object#toString` result references. */
  3037. var asyncTag = '[object AsyncFunction]',
  3038. funcTag$1 = '[object Function]',
  3039. genTag = '[object GeneratorFunction]',
  3040. proxyTag = '[object Proxy]';
  3041. /**
  3042. * Checks if `value` is classified as a `Function` object.
  3043. *
  3044. * @static
  3045. * @memberOf _
  3046. * @since 0.1.0
  3047. * @category Lang
  3048. * @param {*} value The value to check.
  3049. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  3050. * @example
  3051. *
  3052. * _.isFunction(_);
  3053. * // => true
  3054. *
  3055. * _.isFunction(/abc/);
  3056. * // => false
  3057. */
  3058. function isFunction(value) {
  3059. if (!isObject_1(value)) {
  3060. return false;
  3061. }
  3062. // The use of `Object#toString` avoids issues with the `typeof` operator
  3063. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  3064. var tag = _baseGetTag(value);
  3065. return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
  3066. }
  3067. var isFunction_1 = isFunction;
  3068. /** Used as references for various `Number` constants. */
  3069. var MAX_SAFE_INTEGER$1 = 9007199254740991;
  3070. /**
  3071. * Checks if `value` is a valid array-like length.
  3072. *
  3073. * **Note:** This method is loosely based on
  3074. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  3075. *
  3076. * @static
  3077. * @memberOf _
  3078. * @since 4.0.0
  3079. * @category Lang
  3080. * @param {*} value The value to check.
  3081. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  3082. * @example
  3083. *
  3084. * _.isLength(3);
  3085. * // => true
  3086. *
  3087. * _.isLength(Number.MIN_VALUE);
  3088. * // => false
  3089. *
  3090. * _.isLength(Infinity);
  3091. * // => false
  3092. *
  3093. * _.isLength('3');
  3094. * // => false
  3095. */
  3096. function isLength(value) {
  3097. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
  3098. }
  3099. var isLength_1 = isLength;
  3100. /**
  3101. * Checks if `value` is array-like. A value is considered array-like if it's
  3102. * not a function and has a `value.length` that's an integer greater than or
  3103. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  3104. *
  3105. * @static
  3106. * @memberOf _
  3107. * @since 4.0.0
  3108. * @category Lang
  3109. * @param {*} value The value to check.
  3110. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  3111. * @example
  3112. *
  3113. * _.isArrayLike([1, 2, 3]);
  3114. * // => true
  3115. *
  3116. * _.isArrayLike(document.body.children);
  3117. * // => true
  3118. *
  3119. * _.isArrayLike('abc');
  3120. * // => true
  3121. *
  3122. * _.isArrayLike(_.noop);
  3123. * // => false
  3124. */
  3125. function isArrayLike(value) {
  3126. return value != null && isLength_1(value.length) && !isFunction_1(value);
  3127. }
  3128. var isArrayLike_1 = isArrayLike;
  3129. /** Used as references for various `Number` constants. */
  3130. var MAX_SAFE_INTEGER = 9007199254740991;
  3131. /** Used to detect unsigned integer values. */
  3132. var reIsUint = /^(?:0|[1-9]\d*)$/;
  3133. /**
  3134. * Checks if `value` is a valid array-like index.
  3135. *
  3136. * @private
  3137. * @param {*} value The value to check.
  3138. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  3139. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  3140. */
  3141. function isIndex(value, length) {
  3142. var type = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
  3143. length = length == null ? MAX_SAFE_INTEGER : length;
  3144. return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  3145. }
  3146. var _isIndex = isIndex;
  3147. /**
  3148. * Checks if the given arguments are from an iteratee call.
  3149. *
  3150. * @private
  3151. * @param {*} value The potential iteratee value argument.
  3152. * @param {*} index The potential iteratee index or key argument.
  3153. * @param {*} object The potential iteratee object argument.
  3154. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  3155. * else `false`.
  3156. */
  3157. function isIterateeCall(value, index, object) {
  3158. if (!isObject_1(object)) {
  3159. return false;
  3160. }
  3161. var type = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(index);
  3162. if (type == 'number' ? isArrayLike_1(object) && _isIndex(index, object.length) : type == 'string' && index in object) {
  3163. return eq_1(object[index], value);
  3164. }
  3165. return false;
  3166. }
  3167. var _isIterateeCall = isIterateeCall;
  3168. /** Used to match a single whitespace character. */
  3169. var reWhitespace = /\s/;
  3170. /**
  3171. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  3172. * character of `string`.
  3173. *
  3174. * @private
  3175. * @param {string} string The string to inspect.
  3176. * @returns {number} Returns the index of the last non-whitespace character.
  3177. */
  3178. function trimmedEndIndex(string) {
  3179. var index = string.length;
  3180. while (index-- && reWhitespace.test(string.charAt(index))) {}
  3181. return index;
  3182. }
  3183. var _trimmedEndIndex = trimmedEndIndex;
  3184. /** Used to match leading whitespace. */
  3185. var reTrimStart = /^\s+/;
  3186. /**
  3187. * The base implementation of `_.trim`.
  3188. *
  3189. * @private
  3190. * @param {string} string The string to trim.
  3191. * @returns {string} Returns the trimmed string.
  3192. */
  3193. function baseTrim(string) {
  3194. return string ? string.slice(0, _trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string;
  3195. }
  3196. var _baseTrim = baseTrim;
  3197. /**
  3198. * Checks if `value` is object-like. A value is object-like if it's not `null`
  3199. * and has a `typeof` result of "object".
  3200. *
  3201. * @static
  3202. * @memberOf _
  3203. * @since 4.0.0
  3204. * @category Lang
  3205. * @param {*} value The value to check.
  3206. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  3207. * @example
  3208. *
  3209. * _.isObjectLike({});
  3210. * // => true
  3211. *
  3212. * _.isObjectLike([1, 2, 3]);
  3213. * // => true
  3214. *
  3215. * _.isObjectLike(_.noop);
  3216. * // => false
  3217. *
  3218. * _.isObjectLike(null);
  3219. * // => false
  3220. */
  3221. function isObjectLike(value) {
  3222. return value != null && (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) == 'object';
  3223. }
  3224. var isObjectLike_1 = isObjectLike;
  3225. /** `Object#toString` result references. */
  3226. var symbolTag = '[object Symbol]';
  3227. /**
  3228. * Checks if `value` is classified as a `Symbol` primitive or object.
  3229. *
  3230. * @static
  3231. * @memberOf _
  3232. * @since 4.0.0
  3233. * @category Lang
  3234. * @param {*} value The value to check.
  3235. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  3236. * @example
  3237. *
  3238. * _.isSymbol(Symbol.iterator);
  3239. * // => true
  3240. *
  3241. * _.isSymbol('abc');
  3242. * // => false
  3243. */
  3244. function isSymbol(value) {
  3245. return (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) == 'symbol' || isObjectLike_1(value) && _baseGetTag(value) == symbolTag;
  3246. }
  3247. var isSymbol_1 = isSymbol;
  3248. /** Used as references for various `Number` constants. */
  3249. var NAN = 0 / 0;
  3250. /** Used to detect bad signed hexadecimal string values. */
  3251. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  3252. /** Used to detect binary string values. */
  3253. var reIsBinary = /^0b[01]+$/i;
  3254. /** Used to detect octal string values. */
  3255. var reIsOctal = /^0o[0-7]+$/i;
  3256. /** Built-in method references without a dependency on `root`. */
  3257. var freeParseInt = parseInt;
  3258. /**
  3259. * Converts `value` to a number.
  3260. *
  3261. * @static
  3262. * @memberOf _
  3263. * @since 4.0.0
  3264. * @category Lang
  3265. * @param {*} value The value to process.
  3266. * @returns {number} Returns the number.
  3267. * @example
  3268. *
  3269. * _.toNumber(3.2);
  3270. * // => 3.2
  3271. *
  3272. * _.toNumber(Number.MIN_VALUE);
  3273. * // => 5e-324
  3274. *
  3275. * _.toNumber(Infinity);
  3276. * // => Infinity
  3277. *
  3278. * _.toNumber('3.2');
  3279. * // => 3.2
  3280. */
  3281. function toNumber(value) {
  3282. if (typeof value == 'number') {
  3283. return value;
  3284. }
  3285. if (isSymbol_1(value)) {
  3286. return NAN;
  3287. }
  3288. if (isObject_1(value)) {
  3289. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  3290. value = isObject_1(other) ? other + '' : other;
  3291. }
  3292. if (typeof value != 'string') {
  3293. return value === 0 ? value : +value;
  3294. }
  3295. value = _baseTrim(value);
  3296. var isBinary = reIsBinary.test(value);
  3297. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  3298. }
  3299. var toNumber_1 = toNumber;
  3300. /** Used as references for various `Number` constants. */
  3301. var INFINITY$1 = 1 / 0,
  3302. MAX_INTEGER = 1.7976931348623157e+308;
  3303. /**
  3304. * Converts `value` to a finite number.
  3305. *
  3306. * @static
  3307. * @memberOf _
  3308. * @since 4.12.0
  3309. * @category Lang
  3310. * @param {*} value The value to convert.
  3311. * @returns {number} Returns the converted number.
  3312. * @example
  3313. *
  3314. * _.toFinite(3.2);
  3315. * // => 3.2
  3316. *
  3317. * _.toFinite(Number.MIN_VALUE);
  3318. * // => 5e-324
  3319. *
  3320. * _.toFinite(Infinity);
  3321. * // => 1.7976931348623157e+308
  3322. *
  3323. * _.toFinite('3.2');
  3324. * // => 3.2
  3325. */
  3326. function toFinite(value) {
  3327. if (!value) {
  3328. return value === 0 ? value : 0;
  3329. }
  3330. value = toNumber_1(value);
  3331. if (value === INFINITY$1 || value === -INFINITY$1) {
  3332. var sign = value < 0 ? -1 : 1;
  3333. return sign * MAX_INTEGER;
  3334. }
  3335. return value === value ? value : 0;
  3336. }
  3337. var toFinite_1 = toFinite;
  3338. /**
  3339. * Converts `value` to an integer.
  3340. *
  3341. * **Note:** This method is loosely based on
  3342. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  3343. *
  3344. * @static
  3345. * @memberOf _
  3346. * @since 4.0.0
  3347. * @category Lang
  3348. * @param {*} value The value to convert.
  3349. * @returns {number} Returns the converted integer.
  3350. * @example
  3351. *
  3352. * _.toInteger(3.2);
  3353. * // => 3
  3354. *
  3355. * _.toInteger(Number.MIN_VALUE);
  3356. * // => 0
  3357. *
  3358. * _.toInteger(Infinity);
  3359. * // => 1.7976931348623157e+308
  3360. *
  3361. * _.toInteger('3.2');
  3362. * // => 3
  3363. */
  3364. function toInteger(value) {
  3365. var result = toFinite_1(value),
  3366. remainder = result % 1;
  3367. return result === result ? remainder ? result - remainder : result : 0;
  3368. }
  3369. var toInteger_1 = toInteger;
  3370. /* Built-in method references for those with the same name as other `lodash` methods. */
  3371. var nativeCeil = Math.ceil,
  3372. nativeMax$1 = Math.max;
  3373. /**
  3374. * Creates an array of elements split into groups the length of `size`.
  3375. * If `array` can't be split evenly, the final chunk will be the remaining
  3376. * elements.
  3377. *
  3378. * @static
  3379. * @memberOf _
  3380. * @since 3.0.0
  3381. * @category Array
  3382. * @param {Array} array The array to process.
  3383. * @param {number} [size=1] The length of each chunk
  3384. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  3385. * @returns {Array} Returns the new array of chunks.
  3386. * @example
  3387. *
  3388. * _.chunk(['a', 'b', 'c', 'd'], 2);
  3389. * // => [['a', 'b'], ['c', 'd']]
  3390. *
  3391. * _.chunk(['a', 'b', 'c', 'd'], 3);
  3392. * // => [['a', 'b', 'c'], ['d']]
  3393. */
  3394. function chunk(array, size, guard) {
  3395. if (guard ? _isIterateeCall(array, size, guard) : size === undefined) {
  3396. size = 1;
  3397. } else {
  3398. size = nativeMax$1(toInteger_1(size), 0);
  3399. }
  3400. var length = array == null ? 0 : array.length;
  3401. if (!length || size < 1) {
  3402. return [];
  3403. }
  3404. var index = 0,
  3405. resIndex = 0,
  3406. result = Array(nativeCeil(length / size));
  3407. while (index < length) {
  3408. result[resIndex++] = _baseSlice(array, index, index += size);
  3409. }
  3410. return result;
  3411. }
  3412. var chunk_1 = chunk;
  3413. var AtGrid = /** @class */function (_super) {
  3414. __extends(AtGrid, _super);
  3415. function AtGrid() {
  3416. var _this = _super !== null && _super.apply(this, arguments) || this;
  3417. _this.handleClick = function (item, index, row, event) {
  3418. var _a = _this.props,
  3419. onClick = _a.onClick,
  3420. _b = _a.columnNum,
  3421. columnNum = _b === void 0 ? 3 : _b;
  3422. if (typeof onClick === 'function') {
  3423. var clickIndex = row * columnNum + index;
  3424. onClick(item, clickIndex, event);
  3425. }
  3426. };
  3427. return _this;
  3428. }
  3429. AtGrid.prototype.render = function () {
  3430. var _this = this;
  3431. var _a = this.props,
  3432. data = _a.data,
  3433. mode = _a.mode,
  3434. _b = _a.columnNum,
  3435. columnNum = _b === void 0 ? 3 : _b,
  3436. hasBorder = _a.hasBorder;
  3437. if (Array.isArray(data) && data.length === 0) {
  3438. return null;
  3439. }
  3440. var gridGroup = chunk_1(data, columnNum);
  3441. var bodyClass = classnames(['at-grid__flex-item', 'at-grid-item', "at-grid-item--" + mode], {
  3442. 'at-grid-item--no-border': !hasBorder
  3443. });
  3444. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3445. className: classnames('at-grid', this.props.className)
  3446. }, gridGroup.map(function (item, i) {
  3447. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3448. className: 'at-grid__flex',
  3449. key: "at-grid-group-" + i
  3450. }, item.map(function (childItem, index) {
  3451. var _a;
  3452. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3453. key: "at-grid-item-" + index,
  3454. className: classnames(bodyClass, {
  3455. 'at-grid-item--last': index === columnNum - 1
  3456. }),
  3457. onClick: _this.handleClick.bind(_this, childItem, index, i),
  3458. style: {
  3459. flex: "0 0 " + 100 / columnNum + "%"
  3460. }
  3461. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3462. className: 'at-grid-item__content'
  3463. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3464. className: 'at-grid-item__content-inner'
  3465. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3466. className: 'content-inner__icon'
  3467. }, childItem.image && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Image, {
  3468. className: 'content-inner__img',
  3469. src: childItem.image,
  3470. mode: 'scaleToFill'
  3471. }), childItem.iconInfo && !childItem.image && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  3472. className: classnames(childItem.iconInfo.prefixClass || 'at-icon', (_a = {}, _a[(childItem.iconInfo.prefixClass || 'at-icon') + "-" + childItem.iconInfo.value] = childItem.iconInfo.value, _a), childItem.iconInfo.className),
  3473. style: mergeStyle({
  3474. color: childItem.iconInfo.color,
  3475. fontSize: (childItem.iconInfo.size || 24) + "px"
  3476. },
  3477. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  3478. childItem.iconInfo.customStyle)
  3479. })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  3480. className: 'content-inner__text'
  3481. }, childItem.value))));
  3482. }));
  3483. }));
  3484. };
  3485. return AtGrid;
  3486. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  3487. AtGrid.defaultProps = {
  3488. data: [],
  3489. columnNum: 3,
  3490. mode: 'square',
  3491. hasBorder: true
  3492. };
  3493. AtGrid.propTypes = {
  3494. mode: PropTypes.string,
  3495. onClick: PropTypes.func,
  3496. hasBorder: PropTypes.bool,
  3497. columnNum: PropTypes.number,
  3498. data: PropTypes.arrayOf(PropTypes.shape({
  3499. image: PropTypes.string,
  3500. value: PropTypes.string,
  3501. iconInfo: PropTypes.shape({
  3502. size: PropTypes.number,
  3503. value: PropTypes.string,
  3504. color: PropTypes.string,
  3505. prefixClass: PropTypes.string,
  3506. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  3507. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
  3508. })
  3509. }))
  3510. };
  3511. var AtIcon = /** @class */function (_super) {
  3512. __extends(AtIcon, _super);
  3513. function AtIcon() {
  3514. return _super !== null && _super.apply(this, arguments) || this;
  3515. }
  3516. AtIcon.prototype.handleClick = function () {
  3517. this.props.onClick && this.props.onClick(arguments);
  3518. };
  3519. AtIcon.prototype.render = function () {
  3520. var _a = this.props,
  3521. _b = _a.customStyle,
  3522. customStyle = _b === void 0 ? {} : _b,
  3523. className = _a.className,
  3524. prefixClass = _a.prefixClass,
  3525. value = _a.value,
  3526. size = _a.size,
  3527. color = _a.color;
  3528. var rootStyle = {
  3529. fontSize: "" + pxTransform(parseInt(String(size)) * 2),
  3530. color: color
  3531. };
  3532. var iconName = value ? prefixClass + "-" + value : '';
  3533. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  3534. className: classnames(prefixClass, iconName, className),
  3535. style: mergeStyle(rootStyle, customStyle),
  3536. onClick: this.handleClick.bind(this)
  3537. });
  3538. };
  3539. return AtIcon;
  3540. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  3541. AtIcon.defaultProps = {
  3542. customStyle: '',
  3543. className: '',
  3544. prefixClass: 'at-icon',
  3545. value: '',
  3546. color: '',
  3547. size: 24
  3548. };
  3549. AtIcon.propTypes = {
  3550. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  3551. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  3552. prefixClass: PropTypes.string,
  3553. value: PropTypes.string,
  3554. color: PropTypes.string,
  3555. size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  3556. onClick: PropTypes.func
  3557. };
  3558. function getInputProps(props) {
  3559. var actualProps = {
  3560. type: props.type,
  3561. maxLength: props.maxLength || props.maxlength,
  3562. disabled: props.disabled,
  3563. password: false
  3564. };
  3565. switch (actualProps.type) {
  3566. case 'phone':
  3567. actualProps.type = 'number';
  3568. actualProps.maxLength = 11;
  3569. break;
  3570. case 'password':
  3571. actualProps.type = 'text';
  3572. actualProps.password = true;
  3573. break;
  3574. }
  3575. if (!props.disabled && !props.editable) {
  3576. actualProps.disabled = true;
  3577. }
  3578. return actualProps;
  3579. }
  3580. var AtInput = /** @class */function (_super) {
  3581. __extends(AtInput, _super);
  3582. function AtInput() {
  3583. var _this = _super !== null && _super.apply(this, arguments) || this;
  3584. // TODO: 有待考证是否为合理方式处理 #840
  3585. _this.inputClearing = false;
  3586. _this.handleInput = function (event) {
  3587. var _a, _b;
  3588. return (_b = (_a = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, event.detail.value, event);
  3589. };
  3590. _this.handleFocus = function (event) {
  3591. if (typeof _this.props.onFocus === 'function') {
  3592. _this.props.onFocus(event.detail.value, event);
  3593. }
  3594. };
  3595. _this.handleBlur = function (event) {
  3596. var _a, _b;
  3597. if (typeof _this.props.onBlur === 'function') {
  3598. _this.props.onBlur(event.detail.value, event);
  3599. }
  3600. if (event.type === 'blur' && !_this.inputClearing) {
  3601. // fix # 583 AtInput 不触发 onChange 的问题
  3602. (_b = (_a = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, event.detail.value, event);
  3603. }
  3604. // 还原状态
  3605. _this.inputClearing = false;
  3606. };
  3607. _this.handleConfirm = function (event) {
  3608. if (typeof _this.props.onConfirm === 'function') {
  3609. _this.props.onConfirm(event.detail.value, event);
  3610. }
  3611. };
  3612. _this.handleClick = function (event) {
  3613. if (!_this.props.editable && typeof _this.props.onClick === 'function') {
  3614. _this.props.onClick(event);
  3615. }
  3616. };
  3617. _this.handleClearValue = function (event) {
  3618. var _a, _b;
  3619. _this.inputClearing = true;
  3620. (_b = (_a = _this.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, '', event);
  3621. };
  3622. _this.handleKeyboardHeightChange = function (event) {
  3623. if (typeof _this.props.onKeyboardHeightChange === 'function') {
  3624. _this.props.onKeyboardHeightChange(event);
  3625. }
  3626. };
  3627. _this.handleErrorClick = function (event) {
  3628. if (typeof _this.props.onErrorClick === 'function') {
  3629. _this.props.onErrorClick(event);
  3630. }
  3631. };
  3632. return _this;
  3633. }
  3634. AtInput.prototype.render = function () {
  3635. var _a = this.props,
  3636. className = _a.className,
  3637. customStyle = _a.customStyle,
  3638. name = _a.name,
  3639. cursorSpacing = _a.cursorSpacing,
  3640. confirmType = _a.confirmType,
  3641. cursor = _a.cursor,
  3642. selectionStart = _a.selectionStart,
  3643. selectionEnd = _a.selectionEnd,
  3644. adjustPosition = _a.adjustPosition,
  3645. border = _a.border,
  3646. title = _a.title,
  3647. error = _a.error,
  3648. clear = _a.clear,
  3649. placeholder = _a.placeholder,
  3650. placeholderStyle = _a.placeholderStyle,
  3651. placeholderClass = _a.placeholderClass,
  3652. _b = _a.autoFocus,
  3653. autoFocus = _b === void 0 ? false : _b,
  3654. _c = _a.focus,
  3655. focus = _c === void 0 ? false : _c,
  3656. value = _a.value,
  3657. required = _a.required;
  3658. var _d = getInputProps(this.props),
  3659. type = _d.type,
  3660. maxLength = _d.maxLength,
  3661. disabled = _d.disabled,
  3662. password = _d.password;
  3663. var rootCls = classnames('at-input', {
  3664. 'at-input--without-border': !border
  3665. }, className);
  3666. var containerCls = classnames('at-input__container', {
  3667. 'at-input--error': error,
  3668. 'at-input--disabled': disabled
  3669. });
  3670. // TODO: overlayCls 是否需要移除
  3671. var overlayCls = classnames('at-input__overlay', {
  3672. 'at-input__overlay--hidden': !disabled
  3673. });
  3674. var placeholderCls = classnames('placeholder', placeholderClass);
  3675. var id = name && {
  3676. id: name
  3677. };
  3678. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3679. className: rootCls,
  3680. style: customStyle
  3681. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3682. className: containerCls
  3683. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3684. className: overlayCls,
  3685. onClick: this.handleClick
  3686. }), title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Label, {
  3687. className: "at-input__title " + (required && 'at-input__title--required'),
  3688. for: name
  3689. }, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Input, _assign({
  3690. className: 'at-input__input'
  3691. }, id, {
  3692. name: name,
  3693. type: type,
  3694. disabled: disabled,
  3695. password: password,
  3696. placeholderStyle: placeholderStyle,
  3697. placeholderClass: placeholderCls,
  3698. placeholder: placeholder,
  3699. cursorSpacing: cursorSpacing,
  3700. maxlength: maxLength,
  3701. autoFocus: autoFocus
  3702. }, focus ? {
  3703. focus: focus
  3704. } : {}, {
  3705. value: value,
  3706. confirmType: confirmType,
  3707. cursor: cursor,
  3708. selectionStart: selectionStart,
  3709. selectionEnd: selectionEnd,
  3710. adjustPosition: adjustPosition,
  3711. onInput: this.handleInput,
  3712. onFocus: this.handleFocus,
  3713. onBlur: this.handleBlur,
  3714. onConfirm: this.handleConfirm,
  3715. // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  3716. // @ts-ignore
  3717. onKeyboardHeightChange: this.handleKeyboardHeightChange
  3718. })), clear && value && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3719. className: 'at-input__icon',
  3720. onTouchEnd: this.handleClearValue
  3721. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  3722. className: 'at-icon at-icon-close-circle at-input__icon-close'
  3723. })), error && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3724. className: 'at-input__icon',
  3725. onTouchStart: this.handleErrorClick
  3726. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  3727. className: 'at-icon at-icon-alert-circle at-input__icon-alert'
  3728. })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  3729. className: 'at-input__children'
  3730. }, this.props.children)));
  3731. };
  3732. return AtInput;
  3733. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  3734. AtInput.defaultProps = {
  3735. className: '',
  3736. customStyle: '',
  3737. value: '',
  3738. name: '',
  3739. placeholder: '',
  3740. placeholderStyle: '',
  3741. placeholderClass: '',
  3742. title: '',
  3743. cursorSpacing: 50,
  3744. confirmType: 'done',
  3745. cursor: 0,
  3746. selectionStart: -1,
  3747. selectionEnd: -1,
  3748. adjustPosition: true,
  3749. maxlength: 140,
  3750. maxLength: 140,
  3751. type: 'text',
  3752. disabled: false,
  3753. border: true,
  3754. editable: true,
  3755. error: false,
  3756. clear: false,
  3757. autoFocus: false,
  3758. focus: false,
  3759. required: false,
  3760. // eslint-disable-next-line @typescript-eslint/no-empty-function
  3761. onChange: function onChange() {}
  3762. };
  3763. AtInput.propTypes = {
  3764. className: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
  3765. customStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
  3766. value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  3767. name: PropTypes.string,
  3768. placeholder: PropTypes.string,
  3769. placeholderStyle: PropTypes.string,
  3770. placeholderClass: PropTypes.string,
  3771. title: PropTypes.string,
  3772. confirmType: PropTypes.string,
  3773. cursor: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  3774. selectionStart: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  3775. selectionEnd: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  3776. adjustPosition: PropTypes.bool,
  3777. cursorSpacing: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  3778. maxlength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  3779. maxLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  3780. type: PropTypes.string,
  3781. disabled: PropTypes.bool,
  3782. border: PropTypes.bool,
  3783. editable: PropTypes.bool,
  3784. error: PropTypes.bool,
  3785. clear: PropTypes.bool,
  3786. autoFocus: PropTypes.bool,
  3787. focus: PropTypes.bool,
  3788. onChange: PropTypes.func,
  3789. onFocus: PropTypes.func,
  3790. onBlur: PropTypes.func,
  3791. onConfirm: PropTypes.func,
  3792. onErrorClick: PropTypes.func,
  3793. onClick: PropTypes.func,
  3794. required: PropTypes.bool
  3795. };
  3796. /**
  3797. * A specialized version of `_.map` for arrays without support for iteratee
  3798. * shorthands.
  3799. *
  3800. * @private
  3801. * @param {Array} [array] The array to iterate over.
  3802. * @param {Function} iteratee The function invoked per iteration.
  3803. * @returns {Array} Returns the new mapped array.
  3804. */
  3805. function arrayMap(array, iteratee) {
  3806. var index = -1,
  3807. length = array == null ? 0 : array.length,
  3808. result = Array(length);
  3809. while (++index < length) {
  3810. result[index] = iteratee(array[index], index, array);
  3811. }
  3812. return result;
  3813. }
  3814. var _arrayMap = arrayMap;
  3815. /**
  3816. * Checks if `value` is classified as an `Array` object.
  3817. *
  3818. * @static
  3819. * @memberOf _
  3820. * @since 0.1.0
  3821. * @category Lang
  3822. * @param {*} value The value to check.
  3823. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  3824. * @example
  3825. *
  3826. * _.isArray([1, 2, 3]);
  3827. * // => true
  3828. *
  3829. * _.isArray(document.body.children);
  3830. * // => false
  3831. *
  3832. * _.isArray('abc');
  3833. * // => false
  3834. *
  3835. * _.isArray(_.noop);
  3836. * // => false
  3837. */
  3838. var isArray = Array.isArray;
  3839. var isArray_1 = isArray;
  3840. /** Used as references for various `Number` constants. */
  3841. var INFINITY = 1 / 0;
  3842. /** Used to convert symbols to primitives and strings. */
  3843. var symbolProto = _Symbol ? _Symbol.prototype : undefined,
  3844. symbolToString = symbolProto ? symbolProto.toString : undefined;
  3845. /**
  3846. * The base implementation of `_.toString` which doesn't convert nullish
  3847. * values to empty strings.
  3848. *
  3849. * @private
  3850. * @param {*} value The value to process.
  3851. * @returns {string} Returns the string.
  3852. */
  3853. function baseToString(value) {
  3854. // Exit early for strings to avoid a performance hit in some environments.
  3855. if (typeof value == 'string') {
  3856. return value;
  3857. }
  3858. if (isArray_1(value)) {
  3859. // Recursively convert values (susceptible to call stack limits).
  3860. return _arrayMap(value, baseToString) + '';
  3861. }
  3862. if (isSymbol_1(value)) {
  3863. return symbolToString ? symbolToString.call(value) : '';
  3864. }
  3865. var result = value + '';
  3866. return result == '0' && 1 / value == -INFINITY ? '-0' : result;
  3867. }
  3868. var _baseToString = baseToString;
  3869. /**
  3870. * Converts `value` to a string. An empty string is returned for `null`
  3871. * and `undefined` values. The sign of `-0` is preserved.
  3872. *
  3873. * @static
  3874. * @memberOf _
  3875. * @since 4.0.0
  3876. * @category Lang
  3877. * @param {*} value The value to convert.
  3878. * @returns {string} Returns the converted string.
  3879. * @example
  3880. *
  3881. * _.toString(null);
  3882. * // => ''
  3883. *
  3884. * _.toString(-0);
  3885. * // => '-0'
  3886. *
  3887. * _.toString([1, 2, 3]);
  3888. * // => '1,2,3'
  3889. */
  3890. function toString(value) {
  3891. return value == null ? '' : _baseToString(value);
  3892. }
  3893. var toString_1 = toString;
  3894. // TODO: Check all types
  3895. // 实现两数相加并保留小数点后最短尾数
  3896. function addNum(num1, num2) {
  3897. var sq1, sq2;
  3898. try {
  3899. sq1 = toString_1(num1).split('.')[1].length;
  3900. } catch (e) {
  3901. sq1 = 0;
  3902. }
  3903. try {
  3904. sq2 = toString_1(num2).split('.')[1].length;
  3905. } catch (e) {
  3906. sq2 = 0;
  3907. }
  3908. var m = Math.pow(10, Math.max(sq1, sq2));
  3909. return (Math.round(num1 * m) + Math.round(num2 * m)) / m;
  3910. }
  3911. // 格式化数字,处理01变成1,并且不处理1. 这种情况
  3912. function parseValue(num) {
  3913. if (num === '') return '0';
  3914. var numStr = toString_1(num);
  3915. if (numStr.indexOf('0') === 0 && numStr.indexOf('.') === -1) {
  3916. // 处理01变成1,并且不处理1.
  3917. return toString_1(parseFloat(num));
  3918. }
  3919. return toString_1(num);
  3920. }
  3921. var AtInputNumber = /** @class */function (_super) {
  3922. __extends(AtInputNumber, _super);
  3923. function AtInputNumber() {
  3924. var _this = _super !== null && _super.apply(this, arguments) || this;
  3925. _this.handleValue = function (value) {
  3926. var _a = _this.props,
  3927. _b = _a.max,
  3928. max = _b === void 0 ? 100 : _b,
  3929. _c = _a.min,
  3930. min = _c === void 0 ? 0 : _c;
  3931. var resultValue = value === '' ? min : value;
  3932. // 此处不能使用 Math.max,会是字符串变数字,并丢失 .
  3933. if (resultValue > max) {
  3934. resultValue = max;
  3935. _this.handleError({
  3936. type: 'OVER',
  3937. errorValue: resultValue
  3938. });
  3939. }
  3940. if (resultValue < min) {
  3941. resultValue = min;
  3942. _this.handleError({
  3943. type: 'LOW',
  3944. errorValue: resultValue
  3945. });
  3946. }
  3947. if (resultValue && !Number(resultValue)) {
  3948. resultValue = parseFloat(String(resultValue)) || min;
  3949. _this.handleError({
  3950. type: 'OVER',
  3951. errorValue: resultValue
  3952. });
  3953. }
  3954. resultValue = parseValue(String(resultValue));
  3955. return resultValue;
  3956. };
  3957. _this.handleInput = function (e) {
  3958. var value = e.target.value;
  3959. var disabled = _this.props.disabled;
  3960. if (disabled) return '';
  3961. var newValue = _this.handleValue(value);
  3962. _this.props.onChange(Number(newValue), e);
  3963. return newValue;
  3964. };
  3965. _this.handleBlur = function (event) {
  3966. return _this.props.onBlur && _this.props.onBlur(event);
  3967. };
  3968. _this.handleError = function (errorValue) {
  3969. if (!_this.props.onErrorInput) {
  3970. return;
  3971. }
  3972. _this.props.onErrorInput(errorValue);
  3973. };
  3974. return _this;
  3975. }
  3976. AtInputNumber.prototype.handleClick = function (clickType, e) {
  3977. var _a = this.props,
  3978. disabled = _a.disabled,
  3979. value = _a.value,
  3980. _b = _a.min,
  3981. min = _b === void 0 ? 0 : _b,
  3982. _c = _a.max,
  3983. max = _c === void 0 ? 100 : _c,
  3984. _d = _a.step,
  3985. step = _d === void 0 ? 1 : _d;
  3986. var lowThanMin = clickType === 'minus' && value <= min;
  3987. var overThanMax = clickType === 'plus' && value >= max;
  3988. if (lowThanMin || overThanMax || disabled) {
  3989. var deltaValue_1 = clickType === 'minus' ? -step : step;
  3990. var errorValue = addNum(Number(value), deltaValue_1);
  3991. if (disabled) {
  3992. this.handleError({
  3993. type: 'DISABLED',
  3994. errorValue: errorValue
  3995. });
  3996. } else {
  3997. this.handleError({
  3998. type: lowThanMin ? 'LOW' : 'OVER',
  3999. errorValue: errorValue
  4000. });
  4001. }
  4002. return;
  4003. }
  4004. var deltaValue = clickType === 'minus' ? -step : step;
  4005. var newValue = addNum(Number(value), deltaValue);
  4006. newValue = Number(this.handleValue(newValue));
  4007. this.props.onChange(newValue, e);
  4008. };
  4009. AtInputNumber.prototype.render = function () {
  4010. var _a = this.props,
  4011. customStyle = _a.customStyle,
  4012. className = _a.className,
  4013. width = _a.width,
  4014. disabled = _a.disabled,
  4015. value = _a.value,
  4016. type = _a.type,
  4017. _b = _a.min,
  4018. min = _b === void 0 ? 0 : _b,
  4019. _c = _a.max,
  4020. max = _c === void 0 ? 100 : _c,
  4021. size = _a.size,
  4022. disabledInput = _a.disabledInput;
  4023. var inputStyle = {
  4024. width: width ? "" + pxTransform(width) : ''
  4025. };
  4026. var inputValue = Number(this.handleValue(value));
  4027. var rootCls = classnames('at-input-number', {
  4028. 'at-input-number--lg': size === 'large'
  4029. }, className);
  4030. var minusBtnCls = classnames('at-input-number__btn', {
  4031. 'at-input-number--disabled': inputValue <= min || disabled
  4032. });
  4033. var plusBtnCls = classnames('at-input-number__btn', {
  4034. 'at-input-number--disabled': inputValue >= max || disabled
  4035. });
  4036. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4037. className: rootCls,
  4038. style: customStyle
  4039. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4040. className: minusBtnCls,
  4041. onClick: this.handleClick.bind(this, 'minus')
  4042. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4043. className: 'at-icon at-icon-subtract at-input-number__btn-subtract'
  4044. })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Input, {
  4045. className: 'at-input-number__input',
  4046. style: inputStyle,
  4047. type: type,
  4048. value: String(inputValue),
  4049. disabled: disabledInput || disabled,
  4050. onInput: this.handleInput,
  4051. onBlur: this.handleBlur
  4052. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4053. className: plusBtnCls,
  4054. onClick: this.handleClick.bind(this, 'plus')
  4055. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4056. className: 'at-icon at-icon-add at-input-number__btn-add'
  4057. })));
  4058. };
  4059. return AtInputNumber;
  4060. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4061. AtInputNumber.defaultProps = {
  4062. customStyle: {},
  4063. className: '',
  4064. disabled: false,
  4065. disabledInput: false,
  4066. value: 1,
  4067. type: 'number',
  4068. width: 0,
  4069. min: 0,
  4070. max: 100,
  4071. step: 1,
  4072. size: 'normal',
  4073. // eslint-disable-next-line @typescript-eslint/no-empty-function
  4074. onChange: function onChange() {}
  4075. };
  4076. AtInputNumber.propTypes = {
  4077. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  4078. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  4079. value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  4080. type: PropTypes.oneOf(['number', 'digit']),
  4081. disabled: PropTypes.bool,
  4082. width: PropTypes.number,
  4083. min: PropTypes.number,
  4084. max: PropTypes.number,
  4085. step: PropTypes.number,
  4086. size: PropTypes.oneOf(['normal', 'large']),
  4087. disabledInput: PropTypes.bool,
  4088. onChange: PropTypes.func,
  4089. onBlur: PropTypes.func,
  4090. onErrorInput: PropTypes.func
  4091. };
  4092. var AtModalAction = /** @class */function (_super) {
  4093. __extends(AtModalAction, _super);
  4094. function AtModalAction() {
  4095. return _super !== null && _super.apply(this, arguments) || this;
  4096. }
  4097. AtModalAction.prototype.render = function () {
  4098. var rootClass = classnames('at-modal__footer', {
  4099. 'at-modal__footer--simple': this.props.isSimple
  4100. }, this.props.className);
  4101. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4102. className: rootClass
  4103. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4104. className: 'at-modal__action'
  4105. }, this.props.children));
  4106. };
  4107. return AtModalAction;
  4108. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4109. AtModalAction.defaultProps = {
  4110. isSimple: false
  4111. };
  4112. AtModalAction.propTypes = {
  4113. isSimple: PropTypes.bool
  4114. };
  4115. var AtModalContent = /** @class */function (_super) {
  4116. __extends(AtModalContent, _super);
  4117. function AtModalContent() {
  4118. return _super !== null && _super.apply(this, arguments) || this;
  4119. }
  4120. AtModalContent.prototype.render = function () {
  4121. var rootClass = classnames('at-modal__content', this.props.className);
  4122. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.ScrollView, {
  4123. scrollY: true,
  4124. className: rootClass
  4125. }, this.props.children);
  4126. };
  4127. return AtModalContent;
  4128. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4129. var AtModalHeader = /** @class */function (_super) {
  4130. __extends(AtModalHeader, _super);
  4131. function AtModalHeader() {
  4132. return _super !== null && _super.apply(this, arguments) || this;
  4133. }
  4134. AtModalHeader.prototype.render = function () {
  4135. var rootClass = classnames('at-modal__header', this.props.className);
  4136. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4137. className: rootClass
  4138. }, this.props.children);
  4139. };
  4140. return AtModalHeader;
  4141. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4142. var AtModal = /** @class */function (_super) {
  4143. __extends(AtModal, _super);
  4144. function AtModal(props) {
  4145. var _this = _super.call(this, props) || this;
  4146. _this.handleClickOverlay = function () {
  4147. if (_this.props.closeOnClickOverlay) {
  4148. _this.setState({
  4149. _isOpened: false
  4150. }, _this.handleClose);
  4151. }
  4152. };
  4153. _this.handleClose = function (event) {
  4154. if (typeof _this.props.onClose === 'function') {
  4155. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  4156. _this.props.onClose(event);
  4157. }
  4158. };
  4159. _this.handleCancel = function (event) {
  4160. if (typeof _this.props.onCancel === 'function') {
  4161. _this.props.onCancel(event);
  4162. }
  4163. };
  4164. _this.handleConfirm = function (event) {
  4165. if (typeof _this.props.onConfirm === 'function') {
  4166. _this.props.onConfirm(event);
  4167. }
  4168. };
  4169. _this.handleTouchMove = function (e) {
  4170. e.stopPropagation();
  4171. };
  4172. var isOpened = props.isOpened;
  4173. _this.state = {
  4174. _isOpened: isOpened,
  4175. isWEB: _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv() === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEB
  4176. };
  4177. return _this;
  4178. }
  4179. AtModal.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  4180. var isOpened = nextProps.isOpened;
  4181. if (this.props.isOpened !== isOpened) {
  4182. handleTouchScroll(isOpened);
  4183. }
  4184. if (isOpened !== this.state._isOpened) {
  4185. this.setState({
  4186. _isOpened: isOpened
  4187. });
  4188. }
  4189. };
  4190. AtModal.prototype.render = function () {
  4191. var _a = this.state,
  4192. _isOpened = _a._isOpened,
  4193. isWEB = _a.isWEB;
  4194. var _b = this.props,
  4195. title = _b.title,
  4196. content = _b.content,
  4197. cancelText = _b.cancelText,
  4198. confirmText = _b.confirmText;
  4199. var rootClass = classnames('at-modal', {
  4200. 'at-modal--active': _isOpened
  4201. }, this.props.className);
  4202. if (title || content) {
  4203. var isRenderAction = cancelText || confirmText;
  4204. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4205. className: rootClass
  4206. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4207. onClick: this.handleClickOverlay,
  4208. className: 'at-modal__overlay'
  4209. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4210. className: 'at-modal__container'
  4211. }, title && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtModalHeader, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, null, title)), content && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtModalContent, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4212. className: 'content-simple'
  4213. }, isWEB ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text
  4214. // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  4215. // @ts-ignore
  4216. , {
  4217. // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  4218. // @ts-ignore
  4219. dangerouslySetInnerHTML: {
  4220. __html: content.replace(/\\n/g, '<br/>')
  4221. }
  4222. }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, null, content))), isRenderAction && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtModalAction, {
  4223. isSimple: true
  4224. }, cancelText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
  4225. onClick: this.handleCancel
  4226. }, cancelText), confirmText && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
  4227. onClick: this.handleConfirm
  4228. }, confirmText))));
  4229. }
  4230. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4231. onTouchMove: this.handleTouchMove,
  4232. className: rootClass
  4233. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4234. className: 'at-modal__overlay',
  4235. onClick: this.handleClickOverlay
  4236. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4237. className: 'at-modal__container'
  4238. }, this.props.children));
  4239. };
  4240. return AtModal;
  4241. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4242. AtModal.defaultProps = {
  4243. isOpened: false,
  4244. closeOnClickOverlay: true
  4245. };
  4246. AtModal.propTypes = {
  4247. title: PropTypes.string,
  4248. isOpened: PropTypes.bool,
  4249. onCancel: PropTypes.func,
  4250. onConfirm: PropTypes.func,
  4251. onClose: PropTypes.func,
  4252. content: PropTypes.string,
  4253. closeOnClickOverlay: PropTypes.bool,
  4254. cancelText: PropTypes.string,
  4255. confirmText: PropTypes.string
  4256. };
  4257. var AtNavBar = /** @class */function (_super) {
  4258. __extends(AtNavBar, _super);
  4259. function AtNavBar() {
  4260. return _super !== null && _super.apply(this, arguments) || this;
  4261. }
  4262. AtNavBar.prototype.handleClickLeftView = function (event) {
  4263. this.props.onClickLeftIcon && this.props.onClickLeftIcon(event);
  4264. };
  4265. AtNavBar.prototype.handleClickSt = function (event) {
  4266. this.props.onClickRgIconSt && this.props.onClickRgIconSt(event);
  4267. };
  4268. AtNavBar.prototype.handleClickNd = function (event) {
  4269. this.props.onClickRgIconNd && this.props.onClickRgIconNd(event);
  4270. };
  4271. AtNavBar.prototype.handleClickTitle = function (event) {
  4272. this.props.onClickTitle && this.props.onClickTitle(event);
  4273. };
  4274. AtNavBar.prototype.render = function () {
  4275. var _a, _b, _c;
  4276. var _d = this.props,
  4277. customStyle = _d.customStyle,
  4278. className = _d.className,
  4279. color = _d.color,
  4280. fixed = _d.fixed,
  4281. border = _d.border,
  4282. leftIconType = _d.leftIconType,
  4283. leftText = _d.leftText,
  4284. title = _d.title,
  4285. rightFirstIconType = _d.rightFirstIconType,
  4286. rightSecondIconType = _d.rightSecondIconType;
  4287. var linkStyle = {
  4288. color: color
  4289. };
  4290. var defaultIconInfo = {
  4291. customStyle: '',
  4292. className: '',
  4293. prefixClass: 'at-icon',
  4294. value: '',
  4295. color: '',
  4296. size: 24
  4297. };
  4298. var leftIconInfo = leftIconType instanceof Object ? _assign(_assign({}, defaultIconInfo), leftIconType) : _assign(_assign({}, defaultIconInfo), {
  4299. value: leftIconType
  4300. });
  4301. var leftIconClass = classnames(leftIconInfo.prefixClass, (_a = {}, _a[leftIconInfo.prefixClass + "-" + leftIconInfo.value] = leftIconInfo.value, _a), leftIconInfo.className);
  4302. var rightFirstIconInfo = rightFirstIconType instanceof Object ? _assign(_assign({}, defaultIconInfo), rightFirstIconType) : _assign(_assign({}, defaultIconInfo), {
  4303. value: rightFirstIconType
  4304. });
  4305. var rightFirstIconClass = classnames(rightFirstIconInfo.prefixClass, (_b = {}, _b[rightFirstIconInfo.prefixClass + "-" + rightFirstIconInfo.value] = rightFirstIconInfo.value, _b), rightFirstIconInfo.className);
  4306. var rightSecondIconInfo = rightSecondIconType instanceof Object ? _assign(_assign({}, defaultIconInfo), rightSecondIconType) : _assign(_assign({}, defaultIconInfo), {
  4307. value: rightSecondIconType
  4308. });
  4309. var rightSecondIconClass = classnames(rightSecondIconInfo.prefixClass, (_c = {}, _c[rightSecondIconInfo.prefixClass + "-" + rightSecondIconInfo.value] = rightSecondIconInfo.value, _c), rightSecondIconInfo.className);
  4310. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4311. className: classnames({
  4312. 'at-nav-bar': true,
  4313. 'at-nav-bar--fixed': fixed,
  4314. 'at-nav-bar--no-border': !border
  4315. }, className),
  4316. style: customStyle
  4317. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4318. className: 'at-nav-bar__left-view',
  4319. onClick: this.handleClickLeftView.bind(this),
  4320. style: linkStyle
  4321. }, leftIconType && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4322. className: leftIconClass,
  4323. style: mergeStyle({
  4324. color: leftIconInfo.color,
  4325. fontSize: "" + pxTransform(parseInt(leftIconInfo.size.toString()) * 2)
  4326. }, leftIconInfo.customStyle)
  4327. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4328. className: 'at-nav-bar__text'
  4329. }, leftText)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4330. className: 'at-nav-bar__title',
  4331. onClick: this.handleClickTitle.bind(this)
  4332. }, title || this.props.children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4333. className: 'at-nav-bar__right-view'
  4334. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4335. className: classnames({
  4336. 'at-nav-bar__container': true,
  4337. 'at-nav-bar__container--hide': !rightSecondIconType
  4338. }),
  4339. style: linkStyle,
  4340. onClick: this.handleClickNd.bind(this)
  4341. }, rightSecondIconType && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4342. className: rightSecondIconClass,
  4343. style: mergeStyle({
  4344. color: rightSecondIconInfo.color,
  4345. fontSize: "" + pxTransform(parseInt(rightSecondIconInfo.size.toString()) * 2)
  4346. }, rightSecondIconInfo.customStyle)
  4347. })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4348. className: classnames({
  4349. 'at-nav-bar__container': true,
  4350. 'at-nav-bar__container--hide': !rightFirstIconType
  4351. }),
  4352. style: linkStyle,
  4353. onClick: this.handleClickSt.bind(this)
  4354. }, rightFirstIconType && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4355. className: rightFirstIconClass,
  4356. style: mergeStyle({
  4357. color: rightFirstIconInfo.color,
  4358. fontSize: "" + pxTransform(parseInt(rightFirstIconInfo.size.toString()) * 2)
  4359. }, rightFirstIconInfo.customStyle)
  4360. }))));
  4361. };
  4362. return AtNavBar;
  4363. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4364. AtNavBar.defaultProps = {
  4365. customStyle: '',
  4366. className: '',
  4367. fixed: false,
  4368. border: true,
  4369. color: '',
  4370. leftIconType: '',
  4371. leftText: '',
  4372. title: '',
  4373. rightFirstIconType: '',
  4374. rightSecondIconType: ''
  4375. };
  4376. AtNavBar.propTypes = {
  4377. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  4378. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  4379. fixed: PropTypes.bool,
  4380. border: PropTypes.bool,
  4381. color: PropTypes.string,
  4382. leftIconType: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
  4383. leftText: PropTypes.string,
  4384. title: PropTypes.string,
  4385. rightFirstIconType: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
  4386. rightSecondIconType: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
  4387. onClickLeftIcon: PropTypes.func,
  4388. onClickRgIconSt: PropTypes.func,
  4389. onClickRgIconNd: PropTypes.func,
  4390. onClickTitle: PropTypes.func
  4391. };
  4392. var AtNoticebar = /** @class */function (_super) {
  4393. __extends(AtNoticebar, _super);
  4394. function AtNoticebar(props) {
  4395. var _this = _super.call(this, props) || this;
  4396. var animElemId = "J_" + Math.ceil(Math.random() * 10e5).toString(36);
  4397. _this.state = {
  4398. show: true,
  4399. animElemId: animElemId,
  4400. animationData: {
  4401. actions: [{}]
  4402. },
  4403. dura: 15,
  4404. isWEAPP: _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv() === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEAPP,
  4405. isALIPAY: _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv() === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).ALIPAY,
  4406. isWEB: _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv() === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEB
  4407. };
  4408. return _this;
  4409. }
  4410. AtNoticebar.prototype.onClose = function (event) {
  4411. this.setState({
  4412. show: false
  4413. });
  4414. this.props.onClose && this.props.onClose(event);
  4415. };
  4416. AtNoticebar.prototype.onGotoMore = function (event) {
  4417. this.props.onGotoMore && this.props.onGotoMore(event);
  4418. };
  4419. AtNoticebar.prototype.UNSAFE_componentWillReceiveProps = function () {
  4420. if (!this.timeout) {
  4421. this.interval && clearInterval(this.interval);
  4422. this.initAnimation();
  4423. }
  4424. };
  4425. AtNoticebar.prototype.componentDidMount = function () {
  4426. if (!this.props.marquee) return;
  4427. this.initAnimation();
  4428. };
  4429. AtNoticebar.prototype.initAnimation = function () {
  4430. var _this = this;
  4431. var _a = this.state,
  4432. isWEAPP = _a.isWEAPP,
  4433. isALIPAY = _a.isALIPAY;
  4434. // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  4435. // @ts-ignore
  4436. this.timeout = setTimeout(function () {
  4437. _this.timeout = null;
  4438. if (_this.state.isWEB) {
  4439. var _a = _this.props.speed,
  4440. speed = _a === void 0 ? 100 : _a;
  4441. var elem = document.querySelector("." + _this.state.animElemId);
  4442. if (!elem) return;
  4443. var width = elem.getBoundingClientRect().width;
  4444. var dura = width / +speed;
  4445. _this.setState({
  4446. dura: dura
  4447. });
  4448. } else if (isWEAPP || isALIPAY) {
  4449. var query = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().createSelectorQuery();
  4450. query.select("." + _this.state.animElemId).boundingClientRect().exec(function (res) {
  4451. var queryRes = res[0];
  4452. if (!queryRes) return;
  4453. var width = queryRes.width;
  4454. var _a = _this.props.speed,
  4455. speed = _a === void 0 ? 100 : _a;
  4456. var dura = width / +speed;
  4457. var animation = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().createAnimation({
  4458. duration: dura * 1000,
  4459. timingFunction: 'linear'
  4460. });
  4461. var resetAnimation = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().createAnimation({
  4462. duration: 0,
  4463. timingFunction: 'linear'
  4464. });
  4465. var resetOpacityAnimation = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().createAnimation({
  4466. duration: 0,
  4467. timingFunction: 'linear'
  4468. });
  4469. var animBody = function animBody() {
  4470. resetOpacityAnimation.opacity(0).step();
  4471. _this.setState({
  4472. animationData: resetOpacityAnimation.export()
  4473. });
  4474. setTimeout(function () {
  4475. resetAnimation.translateX(0).step();
  4476. _this.setState({
  4477. animationData: resetAnimation.export()
  4478. });
  4479. }, 300);
  4480. setTimeout(function () {
  4481. resetOpacityAnimation.opacity(1).step();
  4482. _this.setState({
  4483. animationData: resetOpacityAnimation.export()
  4484. });
  4485. }, 600);
  4486. setTimeout(function () {
  4487. animation.translateX(-width).step();
  4488. _this.setState({
  4489. animationData: animation.export()
  4490. });
  4491. }, 900);
  4492. };
  4493. animBody();
  4494. // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  4495. // @ts-ignore
  4496. _this.interval = setInterval(animBody, dura * 1000 + 1000);
  4497. });
  4498. }
  4499. }, 1000);
  4500. };
  4501. AtNoticebar.prototype.render = function () {
  4502. var _a = this.props,
  4503. single = _a.single,
  4504. icon = _a.icon,
  4505. marquee = _a.marquee,
  4506. customStyle = _a.customStyle,
  4507. className = _a.className,
  4508. _b = _a.moreText,
  4509. moreText = _b === void 0 ? '查看详情' : _b;
  4510. var _c = this.props,
  4511. showMore = _c.showMore,
  4512. close = _c.close;
  4513. var _d = this.state,
  4514. dura = _d.dura,
  4515. show = _d.show,
  4516. animElemId = _d.animElemId,
  4517. animationData = _d.animationData,
  4518. isWEAPP = _d.isWEAPP,
  4519. isALIPAY = _d.isALIPAY;
  4520. var rootClassName = ['at-noticebar'];
  4521. if (!single) showMore = false;
  4522. var style = {};
  4523. var innerClassName = ['at-noticebar__content-inner'];
  4524. if (marquee) {
  4525. close = false;
  4526. style['animation-duration'] = dura + "s";
  4527. innerClassName.push(animElemId);
  4528. }
  4529. var classObject = {
  4530. 'at-noticebar--marquee': marquee,
  4531. 'at-noticebar--weapp': marquee && (isWEAPP || isALIPAY),
  4532. 'at-noticebar--single': !marquee && single
  4533. };
  4534. var iconClass = ['at-icon'];
  4535. if (icon) iconClass.push("at-icon-" + icon);
  4536. return show && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4537. className: classnames(rootClassName, classObject, className),
  4538. style: customStyle
  4539. }, close && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4540. className: 'at-noticebar__close',
  4541. onClick: this.onClose.bind(this)
  4542. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4543. className: 'at-icon at-icon-close'
  4544. })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4545. className: 'at-noticebar__content'
  4546. }, icon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4547. className: 'at-noticebar__content-icon'
  4548. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4549. className: classnames(iconClass, iconClass)
  4550. })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4551. className: 'at-noticebar__content-text'
  4552. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4553. id: animElemId,
  4554. animation: animationData,
  4555. className: classnames(innerClassName),
  4556. style: style
  4557. }, this.props.children))), showMore && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4558. className: 'at-noticebar__more',
  4559. onClick: this.onGotoMore.bind(this)
  4560. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4561. className: 'text'
  4562. }, moreText), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4563. className: 'at-noticebar__more-icon'
  4564. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4565. className: 'at-icon at-icon-chevron-right'
  4566. }))));
  4567. };
  4568. return AtNoticebar;
  4569. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4570. AtNoticebar.defaultProps = {
  4571. close: false,
  4572. single: false,
  4573. marquee: false,
  4574. speed: 100,
  4575. moreText: '查看详情',
  4576. showMore: false,
  4577. icon: '',
  4578. customStyle: {}
  4579. };
  4580. AtNoticebar.propTypes = {
  4581. close: PropTypes.bool,
  4582. single: PropTypes.bool,
  4583. marquee: PropTypes.bool,
  4584. speed: PropTypes.number,
  4585. moreText: PropTypes.string,
  4586. showMore: PropTypes.bool,
  4587. icon: PropTypes.string,
  4588. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  4589. onClose: PropTypes.func,
  4590. onGotoMore: PropTypes.func
  4591. };
  4592. var MIN_MAXPAGE = 1;
  4593. var getMaxPage = function getMaxPage(maxPage) {
  4594. if (maxPage === void 0) {
  4595. maxPage = 0;
  4596. }
  4597. if (maxPage <= 0) return MIN_MAXPAGE;
  4598. return maxPage;
  4599. };
  4600. var createPickerRange = function createPickerRange(max) {
  4601. var range = new Array(max).fill(0).map(function (_val, index) {
  4602. return index + 1;
  4603. });
  4604. return range;
  4605. };
  4606. var AtPagination = /** @class */function (_super) {
  4607. __extends(AtPagination, _super);
  4608. function AtPagination(props) {
  4609. var _this = _super.call(this, props) || this;
  4610. var _a = _this.props,
  4611. current = _a.current,
  4612. _b = _a.pageSize,
  4613. pageSize = _b === void 0 ? 20 : _b,
  4614. total = _a.total;
  4615. var maxPage = getMaxPage(Math.ceil(total / pageSize));
  4616. _this.state = {
  4617. currentPage: current || 1,
  4618. maxPage: maxPage,
  4619. pickerRange: createPickerRange(maxPage)
  4620. };
  4621. return _this;
  4622. }
  4623. AtPagination.prototype.onPrev = function () {
  4624. var currentPage = this.state.currentPage;
  4625. var originCur = currentPage;
  4626. currentPage -= 1;
  4627. currentPage = Math.max(1, currentPage);
  4628. if (originCur === currentPage) return;
  4629. this.props.onPageChange && this.props.onPageChange({
  4630. type: 'prev',
  4631. current: currentPage
  4632. });
  4633. this.setState({
  4634. currentPage: currentPage
  4635. });
  4636. };
  4637. AtPagination.prototype.onNext = function () {
  4638. var currentPage = this.state.currentPage;
  4639. var originCur = currentPage;
  4640. var maxPage = this.state.maxPage;
  4641. currentPage += 1;
  4642. currentPage = Math.min(maxPage, currentPage);
  4643. if (originCur === currentPage) return;
  4644. this.props.onPageChange && this.props.onPageChange({
  4645. type: 'next',
  4646. current: currentPage
  4647. });
  4648. this.setState({
  4649. currentPage: currentPage
  4650. });
  4651. };
  4652. AtPagination.prototype.UNSAFE_componentWillReceiveProps = function (props) {
  4653. var total = props.total,
  4654. _a = props.pageSize,
  4655. pageSize = _a === void 0 ? 20 : _a,
  4656. current = props.current;
  4657. var maxPage = getMaxPage(Math.ceil(total / pageSize));
  4658. if (maxPage !== this.state.maxPage) {
  4659. this.setState({
  4660. maxPage: maxPage,
  4661. pickerRange: createPickerRange(maxPage)
  4662. });
  4663. }
  4664. if (typeof current === 'number' && current !== this.state.currentPage) {
  4665. this.setState({
  4666. currentPage: current
  4667. });
  4668. }
  4669. };
  4670. // onPickerChange (evt) {
  4671. // const { value } = evt.detail
  4672. // const current = +value + 1
  4673. // if (current === this.state.currentPage) return
  4674. // this.props.onPageChange && this.props.onPageChange({ type: 'pick', current })
  4675. // this.setState({
  4676. // currentPage: current,
  4677. // })
  4678. // }
  4679. AtPagination.prototype.render = function () {
  4680. var _a = this.props,
  4681. icon = _a.icon,
  4682. // pickerSelect,
  4683. customStyle = _a.customStyle;
  4684. var _b = this.state,
  4685. currentPage = _b.currentPage,
  4686. maxPage = _b.maxPage
  4687. // pickerRange,
  4688. ;
  4689. var rootClassName = ['at-pagination'];
  4690. var prevDisabled = maxPage === MIN_MAXPAGE || currentPage === 1;
  4691. var nextDisabled = maxPage === MIN_MAXPAGE || currentPage === maxPage;
  4692. var classObject = {
  4693. 'at-pagination--icon': icon
  4694. };
  4695. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4696. className: classnames(rootClassName, classObject, this.props.className),
  4697. style: customStyle
  4698. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4699. className: 'at-pagination__btn-prev'
  4700. }, icon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtButton, {
  4701. onClick: this.onPrev.bind(this),
  4702. size: 'small',
  4703. disabled: prevDisabled
  4704. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4705. className: 'at-icon at-icon-chevron-left'
  4706. })), !icon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtButton, {
  4707. onClick: this.onPrev.bind(this),
  4708. size: 'small',
  4709. disabled: prevDisabled
  4710. }, "\u4E0A\u4E00\u9875")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4711. className: 'at-pagination__number'
  4712. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4713. className: 'at-pagination__number-current'
  4714. }, currentPage), "/", maxPage), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4715. className: 'at-pagination__btn-next'
  4716. }, icon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtButton, {
  4717. onClick: this.onNext.bind(this),
  4718. size: 'small',
  4719. disabled: nextDisabled
  4720. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4721. className: 'at-icon at-icon-chevron-right'
  4722. })), !icon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtButton, {
  4723. onClick: this.onNext.bind(this),
  4724. size: 'small',
  4725. disabled: nextDisabled
  4726. }, "\u4E0B\u4E00\u9875")));
  4727. };
  4728. return AtPagination;
  4729. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4730. AtPagination.defaultProps = {
  4731. current: 1,
  4732. total: 0,
  4733. pageSize: 20,
  4734. icon: false,
  4735. customStyle: {}
  4736. };
  4737. AtPagination.propTypes = {
  4738. current: PropTypes.number,
  4739. total: PropTypes.number,
  4740. pageSize: PropTypes.number,
  4741. icon: PropTypes.bool,
  4742. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  4743. onPageChange: PropTypes.func
  4744. };
  4745. var AtProgress = /** @class */function (_super) {
  4746. __extends(AtProgress, _super);
  4747. function AtProgress() {
  4748. return _super !== null && _super.apply(this, arguments) || this;
  4749. }
  4750. AtProgress.prototype.render = function () {
  4751. var _a;
  4752. var color = this.props.color;
  4753. var percent = this.props.percent;
  4754. var _b = this.props,
  4755. strokeWidth = _b.strokeWidth,
  4756. status = _b.status,
  4757. isHidePercent = _b.isHidePercent;
  4758. if (typeof percent !== 'number') {
  4759. percent = 0;
  4760. }
  4761. if (percent < 0) {
  4762. percent = 0;
  4763. } else if (percent > 100) {
  4764. percent = 100;
  4765. }
  4766. var rootClass = classnames('at-progress', (_a = {}, _a["at-progress--" + status] = !!status, _a), this.props.className);
  4767. var iconClass = classnames('at-icon', {
  4768. 'at-icon-close-circle': status === 'error',
  4769. 'at-icon-check-circle': status === 'success'
  4770. });
  4771. var progressStyle = {
  4772. width: percent && +percent + "%",
  4773. height: strokeWidth && +strokeWidth + "px",
  4774. backgroundColor: color
  4775. };
  4776. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4777. className: rootClass
  4778. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4779. className: 'at-progress__outer'
  4780. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4781. className: 'at-progress__outer-inner'
  4782. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4783. className: 'at-progress__outer-inner-background',
  4784. style: progressStyle
  4785. }))), !isHidePercent && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4786. className: 'at-progress__content'
  4787. }, !status || status === 'progress' ? percent + "%" : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4788. className: iconClass
  4789. })));
  4790. };
  4791. return AtProgress;
  4792. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4793. AtProgress.propTypes = {
  4794. color: PropTypes.string,
  4795. status: PropTypes.string,
  4796. percent: PropTypes.number,
  4797. strokeWidth: PropTypes.number,
  4798. isHidePercent: PropTypes.bool
  4799. };
  4800. var AtRadio = /** @class */function (_super) {
  4801. __extends(AtRadio, _super);
  4802. function AtRadio() {
  4803. return _super !== null && _super.apply(this, arguments) || this;
  4804. }
  4805. AtRadio.prototype.handleClick = function (option, event) {
  4806. if (option.disabled) return;
  4807. this.props.onClick(option.value, event);
  4808. };
  4809. AtRadio.prototype.render = function () {
  4810. var _this = this;
  4811. var _a = this.props,
  4812. customStyle = _a.customStyle,
  4813. className = _a.className,
  4814. options = _a.options,
  4815. value = _a.value;
  4816. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4817. className: classnames('at-radio', className),
  4818. style: customStyle
  4819. }, options.map(function (option) {
  4820. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4821. key: option.value,
  4822. onClick: _this.handleClick.bind(_this, option),
  4823. className: classnames({
  4824. 'at-radio__option': true,
  4825. 'at-radio__option--disabled': option.disabled
  4826. })
  4827. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4828. className: 'at-radio__option-wrap'
  4829. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4830. className: 'at-radio__option-container'
  4831. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4832. className: 'at-radio__title'
  4833. }, option.label), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4834. className: classnames({
  4835. 'at-radio__icon': true,
  4836. 'at-radio__icon--checked': value === option.value
  4837. })
  4838. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4839. className: 'at-icon at-icon-check'
  4840. }))), option.desc && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4841. className: 'at-radio__desc'
  4842. }, option.desc)));
  4843. }));
  4844. };
  4845. return AtRadio;
  4846. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4847. AtRadio.defaultProps = {
  4848. customStyle: '',
  4849. className: '',
  4850. value: '',
  4851. options: [],
  4852. // eslint-disable-next-line @typescript-eslint/no-empty-function
  4853. onClick: function onClick() {}
  4854. };
  4855. AtRadio.propTypes = {
  4856. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  4857. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  4858. value: PropTypes.string,
  4859. options: PropTypes.array,
  4860. onClick: PropTypes.func
  4861. };
  4862. var AtRate = /** @class */function (_super) {
  4863. __extends(AtRate, _super);
  4864. function AtRate() {
  4865. return _super !== null && _super.apply(this, arguments) || this;
  4866. }
  4867. AtRate.prototype.handleClick = function (event) {
  4868. this.props.onChange && this.props.onChange(event);
  4869. };
  4870. AtRate.prototype.render = function () {
  4871. var _this = this;
  4872. var _a = this.props,
  4873. customStyle = _a.customStyle,
  4874. className = _a.className,
  4875. _b = _a.value,
  4876. value = _b === void 0 ? 0 : _b,
  4877. _c = _a.max,
  4878. max = _c === void 0 ? 5 : _c,
  4879. size = _a.size,
  4880. _d = _a.margin,
  4881. margin = _d === void 0 ? 5 : _d;
  4882. var iconStyle = {
  4883. marginRight: pxTransform(margin)
  4884. };
  4885. var starIconStyle = {
  4886. fontSize: size ? size + "px" : ''
  4887. };
  4888. // 生成星星颜色 className 数组,方便在jsx中直接map
  4889. var classNameArr = [];
  4890. var floorValue = Math.floor(value);
  4891. var ceilValue = Math.ceil(value);
  4892. for (var i = 0; i < max; i++) {
  4893. if (floorValue > i) {
  4894. classNameArr.push('at-rate__icon at-rate__icon--on');
  4895. } else if (ceilValue - 1 === i) {
  4896. classNameArr.push('at-rate__icon at-rate__icon--half');
  4897. } else {
  4898. classNameArr.push('at-rate__icon at-rate__icon--off');
  4899. }
  4900. }
  4901. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4902. className: classnames('at-rate', className),
  4903. style: customStyle
  4904. }, classNameArr.map(function (cls, i) {
  4905. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4906. className: cls,
  4907. key: "at-rate-star-" + i,
  4908. style: iconStyle,
  4909. onClick: _this.handleClick.bind(_this, i + 1)
  4910. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4911. className: 'at-icon at-icon-star-2',
  4912. style: starIconStyle
  4913. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4914. className: 'at-rate__left'
  4915. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  4916. className: 'at-icon at-icon-star-2',
  4917. style: starIconStyle
  4918. })));
  4919. }));
  4920. };
  4921. return AtRate;
  4922. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4923. AtRate.defaultProps = {
  4924. customStyle: '',
  4925. className: '',
  4926. size: 0,
  4927. value: 0,
  4928. max: 5,
  4929. margin: 5
  4930. };
  4931. AtRate.propTypes = {
  4932. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  4933. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  4934. size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  4935. value: PropTypes.number,
  4936. max: PropTypes.number,
  4937. margin: PropTypes.number,
  4938. onChange: PropTypes.func
  4939. };
  4940. var AtSegmentedControl = /** @class */function (_super) {
  4941. __extends(AtSegmentedControl, _super);
  4942. function AtSegmentedControl() {
  4943. return _super !== null && _super.apply(this, arguments) || this;
  4944. }
  4945. AtSegmentedControl.prototype.handleClick = function (index, event) {
  4946. if (this.props.disabled) return;
  4947. this.props.onClick(index, event);
  4948. };
  4949. AtSegmentedControl.prototype.render = function () {
  4950. var _this = this;
  4951. var _a = this.props,
  4952. _b = _a.customStyle,
  4953. customStyle = _b === void 0 ? '' : _b,
  4954. className = _a.className,
  4955. disabled = _a.disabled,
  4956. values = _a.values,
  4957. selectedColor = _a.selectedColor,
  4958. current = _a.current,
  4959. color = _a.color,
  4960. _c = _a.fontSize,
  4961. fontSize = _c === void 0 ? 28 : _c;
  4962. var rootStyle = {
  4963. borderColor: selectedColor
  4964. };
  4965. var itemStyle = {
  4966. color: selectedColor,
  4967. fontSize: pxTransform(fontSize),
  4968. borderColor: selectedColor,
  4969. backgroundColor: color
  4970. };
  4971. var selectedItemStyle = {
  4972. color: color,
  4973. fontSize: pxTransform(fontSize),
  4974. borderColor: selectedColor,
  4975. backgroundColor: selectedColor
  4976. };
  4977. var rootCls = classnames('at-segmented-control', {
  4978. 'at-segmented-control--disabled': disabled
  4979. }, className);
  4980. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4981. className: rootCls,
  4982. style: mergeStyle(rootStyle, customStyle)
  4983. }, values.map(function (value, i) {
  4984. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  4985. className: classnames('at-segmented-control__item', {
  4986. 'at-segmented-control__item--active': current === i
  4987. }),
  4988. style: current === i ? selectedItemStyle : itemStyle,
  4989. key: value,
  4990. onClick: _this.handleClick.bind(_this, i)
  4991. }, value);
  4992. }));
  4993. };
  4994. return AtSegmentedControl;
  4995. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  4996. AtSegmentedControl.defaultProps = {
  4997. customStyle: '',
  4998. className: '',
  4999. current: 0,
  5000. color: '',
  5001. fontSize: 28,
  5002. disabled: false,
  5003. selectedColor: '',
  5004. values: [],
  5005. // eslint-disable-next-line @typescript-eslint/no-empty-function
  5006. onClick: function onClick() {}
  5007. };
  5008. AtSegmentedControl.propTypes = {
  5009. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  5010. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  5011. current: PropTypes.number,
  5012. color: PropTypes.string,
  5013. fontSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  5014. disabled: PropTypes.bool,
  5015. values: PropTypes.array,
  5016. onClick: PropTypes.func
  5017. };
  5018. var AtSwitch = /** @class */function (_super) {
  5019. __extends(AtSwitch, _super);
  5020. function AtSwitch() {
  5021. var _this = _super !== null && _super.apply(this, arguments) || this;
  5022. _this.handleChange = function (event) {
  5023. var _a = event.detail,
  5024. value = _a.value,
  5025. checked = _a.checked;
  5026. var state = typeof value === 'undefined' ? checked : value;
  5027. _this.props.onChange && _this.props.onChange(state);
  5028. };
  5029. return _this;
  5030. }
  5031. AtSwitch.prototype.render = function () {
  5032. var _a = this.props,
  5033. customStyle = _a.customStyle,
  5034. className = _a.className,
  5035. disabled = _a.disabled,
  5036. border = _a.border,
  5037. title = _a.title,
  5038. checked = _a.checked,
  5039. color = _a.color;
  5040. var rootCls = classnames('at-switch', {
  5041. 'at-switch--without-border': !border
  5042. }, className);
  5043. var containerCls = classnames('at-switch__container', {
  5044. 'at-switch--disabled': disabled
  5045. });
  5046. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5047. className: rootCls,
  5048. style: customStyle
  5049. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5050. className: 'at-switch__title'
  5051. }, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5052. className: containerCls
  5053. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5054. className: 'at-switch__mask'
  5055. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Switch, {
  5056. className: 'at-switch__switch',
  5057. checked: checked,
  5058. color: color,
  5059. onChange: this.handleChange
  5060. })));
  5061. };
  5062. return AtSwitch;
  5063. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  5064. AtSwitch.defaultProps = {
  5065. customStyle: '',
  5066. className: '',
  5067. title: '',
  5068. color: '#6190e8',
  5069. border: true,
  5070. disabled: false,
  5071. checked: false
  5072. };
  5073. AtSwitch.propTypes = {
  5074. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  5075. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  5076. title: PropTypes.string,
  5077. color: PropTypes.string,
  5078. checked: PropTypes.bool,
  5079. border: PropTypes.bool,
  5080. disabled: PropTypes.bool,
  5081. onChange: PropTypes.func
  5082. };
  5083. var AtTabBar = /** @class */function (_super) {
  5084. __extends(AtTabBar, _super);
  5085. function AtTabBar() {
  5086. return _super !== null && _super.apply(this, arguments) || this;
  5087. }
  5088. // constructor () {
  5089. // super(...arguments)
  5090. // this.state = {
  5091. // isIPhoneX: false
  5092. // }
  5093. // }
  5094. // componentDidMount () {
  5095. // const curEnv = Taro.getEnv()
  5096. // if (
  5097. // curEnv === Taro.ENV_TYPE.WEAPP &&
  5098. // Taro.getSystemInfoSync().model.indexOf('iPhone X') >= 0
  5099. // ) {
  5100. // this.setState({ isIPhoneX: true })
  5101. // }
  5102. // }
  5103. AtTabBar.prototype.handleClick = function (index, event) {
  5104. this.props.onClick(index, event);
  5105. };
  5106. AtTabBar.prototype.render = function () {
  5107. var _this = this;
  5108. var _a = this.props,
  5109. _b = _a.customStyle,
  5110. customStyle = _b === void 0 ? '' : _b,
  5111. className = _a.className,
  5112. fixed = _a.fixed,
  5113. backgroundColor = _a.backgroundColor,
  5114. tabList = _a.tabList,
  5115. current = _a.current,
  5116. color = _a.color,
  5117. iconSize = _a.iconSize,
  5118. fontSize = _a.fontSize,
  5119. selectedColor = _a.selectedColor;
  5120. // const { isIPhoneX } = this.state
  5121. var defaultStyle = {
  5122. color: color || ''
  5123. };
  5124. var selectedStyle = {
  5125. color: selectedColor || ''
  5126. };
  5127. var titleStyle = {
  5128. fontSize: fontSize ? fontSize + "px" : ''
  5129. };
  5130. var rootStyle = {
  5131. backgroundColor: backgroundColor || ''
  5132. };
  5133. var imgStyle = {
  5134. width: iconSize + "px",
  5135. height: iconSize + "px"
  5136. };
  5137. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5138. className: classnames({
  5139. 'at-tab-bar': true,
  5140. 'at-tab-bar--fixed': fixed
  5141. // 'at-tab-bar--ipx': isIPhoneX
  5142. }, className),
  5143. style: mergeStyle(rootStyle, customStyle)
  5144. }, tabList.map(function (item, i) {
  5145. var _a;
  5146. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5147. className: classnames('at-tab-bar__item', {
  5148. 'at-tab-bar__item--active': current === i
  5149. }),
  5150. style: current === i ? selectedStyle : defaultStyle,
  5151. key: item.title,
  5152. onClick: _this.handleClick.bind(_this, i)
  5153. }, item.iconType ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtBadge, {
  5154. dot: !!item.dot,
  5155. value: item.text,
  5156. maxValue: Number(item.max)
  5157. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5158. className: 'at-tab-bar__icon'
  5159. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  5160. className: classnames("" + (item.iconPrefixClass || 'at-icon'), (_a = {}, _a[(item.iconPrefixClass || 'at-icon') + "-" + item.selectedIconType] = current === i && item.selectedIconType, _a[(item.iconPrefixClass || 'at-icon') + "-" + item.iconType] = !(current === i && item.selectedIconType), _a)),
  5161. style: {
  5162. color: current === i ? selectedColor : color,
  5163. fontSize: iconSize ? iconSize + "px" : ''
  5164. }
  5165. }))) : null, item.image ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtBadge, {
  5166. dot: !!item.dot,
  5167. value: item.text,
  5168. maxValue: Number(item.max)
  5169. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5170. className: 'at-tab-bar__icon'
  5171. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Image, {
  5172. className: classnames('at-tab-bar__inner-img', {
  5173. 'at-tab-bar__inner-img--inactive': current !== i
  5174. }),
  5175. mode: 'widthFix',
  5176. src: item.selectedImage || item.image,
  5177. style: imgStyle
  5178. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Image, {
  5179. className: classnames('at-tab-bar__inner-img', {
  5180. 'at-tab-bar__inner-img--inactive': current === i
  5181. }),
  5182. mode: 'widthFix',
  5183. src: item.image,
  5184. style: imgStyle
  5185. }))) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtBadge, {
  5186. dot: item.iconType || item.image ? false : !!item.dot,
  5187. value: item.iconType || item.image ? '' : item.text,
  5188. maxValue: item.iconType || item.image ? 0 : Number(item.max)
  5189. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5190. className: 'at-tab-bar__title',
  5191. style: titleStyle
  5192. }, item.title))));
  5193. }));
  5194. };
  5195. return AtTabBar;
  5196. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  5197. AtTabBar.defaultProps = {
  5198. customStyle: '',
  5199. className: '',
  5200. fixed: false,
  5201. current: 0,
  5202. tabList: [],
  5203. // eslint-disable-next-line @typescript-eslint/no-empty-function
  5204. onClick: function onClick() {}
  5205. };
  5206. AtTabBar.propTypes = {
  5207. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  5208. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  5209. fixed: PropTypes.bool,
  5210. backgroundColor: PropTypes.string,
  5211. current: PropTypes.number,
  5212. iconSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  5213. fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  5214. color: PropTypes.string,
  5215. selectedColor: PropTypes.string,
  5216. tabList: PropTypes.array,
  5217. onClick: PropTypes.func
  5218. };
  5219. var ENV$3 = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv();
  5220. var MIN_DISTANCE = 100;
  5221. var MAX_INTERVAL = 10;
  5222. var AtTabs = /** @class */function (_super) {
  5223. __extends(AtTabs, _super);
  5224. function AtTabs(props) {
  5225. var _this = _super.call(this, props) || this;
  5226. _this.updateState = function (idx) {
  5227. if (_this.props.scroll) {
  5228. // 标签栏滚动
  5229. switch (ENV$3) {
  5230. case (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEAPP:
  5231. case (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).ALIPAY:
  5232. case (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).SWAN:
  5233. {
  5234. var index = Math.max(idx - 1, 0);
  5235. _this.setState({
  5236. _scrollIntoView: "tab" + _this._tabId + index
  5237. });
  5238. break;
  5239. }
  5240. case (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEB:
  5241. {
  5242. var index = Math.max(idx - 1, 0);
  5243. var prevTabItem = _this.tabHeaderRef.children[index];
  5244. prevTabItem && _this.setState({
  5245. _scrollTop: prevTabItem.offsetTop,
  5246. _scrollLeft: prevTabItem.offsetLeft
  5247. });
  5248. break;
  5249. }
  5250. default:
  5251. {
  5252. console.warn('AtTab 组件在该环境还未适配');
  5253. break;
  5254. }
  5255. }
  5256. }
  5257. };
  5258. _this.state = {
  5259. _scrollLeft: 0,
  5260. _scrollTop: 0,
  5261. _scrollIntoView: ''
  5262. };
  5263. _this._tabId = isTest() ? 'tabs-AOTU2018' : uuid();
  5264. // 触摸时的原点
  5265. _this._touchDot = 0;
  5266. // 定时器
  5267. _this._timer = null;
  5268. // 滑动时间间隔
  5269. _this._interval = 0;
  5270. // 是否已经在滑动
  5271. _this._isMoving = false;
  5272. return _this;
  5273. }
  5274. AtTabs.prototype.handleClick = function (index, event) {
  5275. this.props.onClick(index, event);
  5276. };
  5277. AtTabs.prototype.handleTouchStart = function (e) {
  5278. var _this = this;
  5279. var _a = this.props,
  5280. swipeable = _a.swipeable,
  5281. tabDirection = _a.tabDirection;
  5282. if (!swipeable || tabDirection === 'vertical') return;
  5283. // 获取触摸时的原点
  5284. this._touchDot = e.touches[0].pageX;
  5285. // 使用js计时器记录时间
  5286. // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  5287. // @ts-ignore
  5288. this._timer = setInterval(function () {
  5289. _this._interval++;
  5290. }, 100);
  5291. };
  5292. AtTabs.prototype.handleTouchMove = function (e) {
  5293. var _a = this.props,
  5294. swipeable = _a.swipeable,
  5295. tabDirection = _a.tabDirection,
  5296. current = _a.current,
  5297. tabList = _a.tabList;
  5298. if (!swipeable || tabDirection === 'vertical') return;
  5299. var touchMove = e.touches[0].pageX;
  5300. var moveDistance = touchMove - this._touchDot;
  5301. var maxIndex = tabList.length;
  5302. if (!this._isMoving && this._interval < MAX_INTERVAL && this._touchDot > 20) {
  5303. // 向左滑动
  5304. if (current + 1 < maxIndex && moveDistance <= -MIN_DISTANCE) {
  5305. this._isMoving = true;
  5306. this.handleClick(current + 1, e);
  5307. // 向右滑动
  5308. } else if (current - 1 >= 0 && moveDistance >= MIN_DISTANCE) {
  5309. this._isMoving = true;
  5310. this.handleClick(current - 1, e);
  5311. }
  5312. }
  5313. };
  5314. AtTabs.prototype.handleTouchEnd = function () {
  5315. var _a = this.props,
  5316. swipeable = _a.swipeable,
  5317. tabDirection = _a.tabDirection;
  5318. if (!swipeable || tabDirection === 'vertical') return;
  5319. clearInterval(this._timer);
  5320. this._interval = 0;
  5321. this._isMoving = false;
  5322. };
  5323. AtTabs.prototype.getTabHeaderRef = function () {
  5324. if (ENV$3 === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEB) {
  5325. this.tabHeaderRef = document.getElementById(this._tabId);
  5326. }
  5327. };
  5328. AtTabs.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  5329. if (nextProps.scroll !== this.props.scroll) {
  5330. this.getTabHeaderRef();
  5331. }
  5332. if (nextProps.current !== this.props.current) {
  5333. this.updateState(nextProps.current);
  5334. }
  5335. };
  5336. AtTabs.prototype.componentDidMount = function () {
  5337. this.getTabHeaderRef();
  5338. this.updateState(this.props.current);
  5339. };
  5340. AtTabs.prototype.componentWillUnmount = function () {
  5341. this.tabHeaderRef = null;
  5342. };
  5343. AtTabs.prototype.render = function () {
  5344. var _a;
  5345. var _this = this;
  5346. var _b = this.props,
  5347. _c = _b.customStyle,
  5348. customStyle = _c === void 0 ? '' : _c,
  5349. className = _b.className,
  5350. height = _b.height,
  5351. tabDirection = _b.tabDirection,
  5352. animated = _b.animated,
  5353. tabList = _b.tabList,
  5354. scroll = _b.scroll,
  5355. current = _b.current;
  5356. var _d = this.state,
  5357. _scrollLeft = _d._scrollLeft,
  5358. _scrollTop = _d._scrollTop,
  5359. _scrollIntoView = _d._scrollIntoView;
  5360. var heightStyle = {
  5361. height: height
  5362. };
  5363. var underlineStyle = {
  5364. height: tabDirection === 'vertical' ? tabList.length * 100 + "%" : '1PX',
  5365. width: tabDirection === 'horizontal' ? tabList.length * 100 + "%" : '1PX'
  5366. };
  5367. var bodyStyle = {};
  5368. var transformStyle = "translate3d(0px, -" + current * 100 + "%, 0px)";
  5369. if (tabDirection === 'horizontal') {
  5370. transformStyle = "translate3d(-" + current * 100 + "%, 0px, 0px)";
  5371. }
  5372. Object.assign(bodyStyle, {
  5373. transform: transformStyle,
  5374. '-webkit-transform': transformStyle
  5375. });
  5376. if (!animated) {
  5377. bodyStyle.transition = 'unset';
  5378. }
  5379. var tabItems = tabList.map(function (item, idx) {
  5380. var itemCls = classnames({
  5381. 'at-tabs__item': true,
  5382. 'at-tabs__item--active': current === idx
  5383. });
  5384. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5385. className: itemCls,
  5386. id: "tab" + _this._tabId + idx,
  5387. key: "at-tabs-item-" + idx,
  5388. onClick: _this.handleClick.bind(_this, idx)
  5389. }, item.title, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5390. className: 'at-tabs__item-underline'
  5391. }));
  5392. });
  5393. var rootCls = classnames((_a = {
  5394. 'at-tabs': true,
  5395. 'at-tabs--scroll': scroll
  5396. }, _a["at-tabs--" + tabDirection] = true, _a["at-tabs--" + ENV$3] = true, _a), className);
  5397. var scrollX = tabDirection === 'horizontal';
  5398. var scrollY = tabDirection === 'vertical';
  5399. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5400. className: rootCls,
  5401. style: mergeStyle(heightStyle, customStyle)
  5402. }, scroll ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.ScrollView, {
  5403. id: this._tabId,
  5404. className: 'at-tabs__header',
  5405. style: heightStyle,
  5406. scrollX: scrollX,
  5407. scrollY: scrollY,
  5408. scrollWithAnimation: true,
  5409. scrollLeft: _scrollLeft,
  5410. scrollTop: _scrollTop,
  5411. scrollIntoView: _scrollIntoView
  5412. }, tabItems) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5413. id: this._tabId,
  5414. className: 'at-tabs__header'
  5415. }, tabItems), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5416. className: 'at-tabs__body',
  5417. onTouchStart: this.handleTouchStart.bind(this),
  5418. onTouchEnd: this.handleTouchEnd.bind(this),
  5419. onTouchMove: this.handleTouchMove.bind(this),
  5420. style: mergeStyle(bodyStyle, heightStyle)
  5421. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5422. className: 'at-tabs__underline',
  5423. style: underlineStyle
  5424. }), this.props.children));
  5425. };
  5426. return AtTabs;
  5427. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  5428. AtTabs.defaultProps = {
  5429. customStyle: '',
  5430. className: '',
  5431. tabDirection: 'horizontal',
  5432. height: '',
  5433. current: 0,
  5434. swipeable: true,
  5435. scroll: false,
  5436. animated: true,
  5437. tabList: [],
  5438. // eslint-disable-next-line @typescript-eslint/no-empty-function
  5439. onClick: function onClick() {}
  5440. };
  5441. AtTabs.propTypes = {
  5442. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  5443. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  5444. height: PropTypes.string,
  5445. tabDirection: PropTypes.oneOf(['horizontal', 'vertical']),
  5446. current: PropTypes.number,
  5447. swipeable: PropTypes.bool,
  5448. scroll: PropTypes.bool,
  5449. animated: PropTypes.bool,
  5450. tabList: PropTypes.array,
  5451. onClick: PropTypes.func
  5452. };
  5453. var AtTabsPane = /** @class */function (_super) {
  5454. __extends(AtTabsPane, _super);
  5455. function AtTabsPane() {
  5456. return _super !== null && _super.apply(this, arguments) || this;
  5457. }
  5458. AtTabsPane.prototype.render = function () {
  5459. var _a = this.props,
  5460. customStyle = _a.customStyle,
  5461. className = _a.className,
  5462. tabDirection = _a.tabDirection,
  5463. index = _a.index,
  5464. current = _a.current;
  5465. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5466. className: classnames({
  5467. 'at-tabs-pane': true,
  5468. 'at-tabs-pane--vertical': tabDirection === 'vertical',
  5469. 'at-tabs-pane--active': index === current,
  5470. 'at-tabs-pane--inactive': index !== current
  5471. }, className),
  5472. style: customStyle
  5473. }, this.props.children);
  5474. };
  5475. return AtTabsPane;
  5476. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  5477. AtTabsPane.defaultProps = {
  5478. customStyle: '',
  5479. className: '',
  5480. tabDirection: 'horizontal',
  5481. index: 0,
  5482. current: 0
  5483. };
  5484. AtTabsPane.propTypes = {
  5485. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  5486. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  5487. tabDirection: PropTypes.oneOf(['horizontal', 'vertical']),
  5488. index: PropTypes.number,
  5489. current: PropTypes.number
  5490. };
  5491. var SIZE_CLASS = {
  5492. normal: 'normal',
  5493. small: 'small'
  5494. };
  5495. var TYPE_CLASS = {
  5496. primary: 'primary'
  5497. };
  5498. var AtTag = /** @class */function (_super) {
  5499. __extends(AtTag, _super);
  5500. function AtTag() {
  5501. return _super !== null && _super.apply(this, arguments) || this;
  5502. }
  5503. AtTag.prototype.onClick = function (event) {
  5504. var _a = this.props,
  5505. _b = _a.name,
  5506. name = _b === void 0 ? '' : _b,
  5507. _c = _a.active,
  5508. active = _c === void 0 ? false : _c,
  5509. disabled = _a.disabled,
  5510. onClick = _a.onClick;
  5511. if (!disabled) {
  5512. typeof onClick === 'function' && onClick({
  5513. name: name,
  5514. active: active
  5515. }, event);
  5516. }
  5517. };
  5518. AtTag.prototype.render = function () {
  5519. var _a;
  5520. var _b = this.props,
  5521. _c = _b.size,
  5522. size = _c === void 0 ? 'normal' : _c,
  5523. _d = _b.type,
  5524. type = _d === void 0 ? '' : _d,
  5525. _e = _b.circle,
  5526. circle = _e === void 0 ? false : _e,
  5527. _f = _b.disabled,
  5528. disabled = _f === void 0 ? false : _f,
  5529. _g = _b.active,
  5530. active = _g === void 0 ? false : _g,
  5531. customStyle = _b.customStyle;
  5532. var rootClassName = ['at-tag'];
  5533. var classObject = (_a = {}, _a["at-tag--" + SIZE_CLASS[size]] = SIZE_CLASS[size], _a["at-tag--" + type] = TYPE_CLASS[type], _a['at-tag--disabled'] = disabled, _a['at-tag--active'] = active, _a['at-tag--circle'] = circle, _a);
  5534. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5535. className: classnames(rootClassName, classObject, this.props.className),
  5536. style: customStyle,
  5537. onClick: this.onClick.bind(this)
  5538. }, this.props.children);
  5539. };
  5540. return AtTag;
  5541. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  5542. AtTag.defaultProps = {
  5543. size: 'normal',
  5544. type: '',
  5545. name: '',
  5546. circle: false,
  5547. active: false,
  5548. disabled: false,
  5549. customStyle: {}
  5550. };
  5551. AtTag.propTypes = {
  5552. size: PropTypes.oneOf(['normal', 'small']),
  5553. type: PropTypes.oneOf(['', 'primary']),
  5554. name: PropTypes.string,
  5555. circle: PropTypes.bool,
  5556. active: PropTypes.bool,
  5557. disabled: PropTypes.bool,
  5558. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  5559. onClick: PropTypes.func
  5560. };
  5561. function getMaxLength(maxLength, textOverflowForbidden) {
  5562. if (!textOverflowForbidden) {
  5563. return maxLength + 500;
  5564. }
  5565. return maxLength;
  5566. }
  5567. var ENV$2 = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv();
  5568. var AtTextarea = /** @class */function (_super) {
  5569. __extends(AtTextarea, _super);
  5570. function AtTextarea() {
  5571. var _this = _super !== null && _super.apply(this, arguments) || this;
  5572. _this.handleInput = function (event) {
  5573. _this.props.onChange(event.detail.value, event);
  5574. };
  5575. _this.handleFocus = function (event) {
  5576. _this.props.onFocus && _this.props.onFocus(event);
  5577. };
  5578. _this.handleBlur = function (event) {
  5579. _this.props.onBlur && _this.props.onBlur(event);
  5580. };
  5581. _this.handleConfirm = function (event) {
  5582. _this.props.onConfirm && _this.props.onConfirm(event);
  5583. };
  5584. _this.handleLinechange = function (event) {
  5585. _this.props.onLinechange && _this.props.onLinechange(event);
  5586. };
  5587. return _this;
  5588. }
  5589. AtTextarea.prototype.render = function () {
  5590. var _a = this.props,
  5591. customStyle = _a.customStyle,
  5592. className = _a.className,
  5593. value = _a.value,
  5594. cursorSpacing = _a.cursorSpacing,
  5595. placeholder = _a.placeholder,
  5596. placeholderStyle = _a.placeholderStyle,
  5597. placeholderClass = _a.placeholderClass,
  5598. _b = _a.maxLength,
  5599. maxLength = _b === void 0 ? 200 : _b,
  5600. count = _a.count,
  5601. disabled = _a.disabled,
  5602. autoFocus = _a.autoFocus,
  5603. focus = _a.focus,
  5604. showConfirmBar = _a.showConfirmBar,
  5605. selectionStart = _a.selectionStart,
  5606. selectionEnd = _a.selectionEnd,
  5607. fixed = _a.fixed,
  5608. _c = _a.textOverflowForbidden,
  5609. textOverflowForbidden = _c === void 0 ? true : _c,
  5610. height = _a.height;
  5611. var _maxLength = parseInt(maxLength.toString());
  5612. var actualMaxLength = getMaxLength(_maxLength, textOverflowForbidden);
  5613. var textareaStyle = height ? "height:" + pxTransform(Number(height)) : '';
  5614. var rootCls = classnames('at-textarea', "at-textarea--" + ENV$2, {
  5615. 'at-textarea--error': _maxLength < value.length
  5616. }, className);
  5617. var placeholderCls = classnames('placeholder', placeholderClass);
  5618. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5619. className: rootCls,
  5620. style: customStyle
  5621. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Textarea, {
  5622. className: 'at-textarea__textarea',
  5623. style: textareaStyle,
  5624. placeholderStyle: placeholderStyle,
  5625. placeholderClass: placeholderCls,
  5626. cursorSpacing: cursorSpacing,
  5627. value: value,
  5628. maxlength: actualMaxLength,
  5629. placeholder: placeholder,
  5630. disabled: disabled,
  5631. autoFocus: autoFocus,
  5632. focus: focus,
  5633. showConfirmBar: showConfirmBar,
  5634. selectionStart: selectionStart,
  5635. selectionEnd: selectionEnd,
  5636. fixed: fixed,
  5637. onInput: this.handleInput,
  5638. onFocus: this.handleFocus,
  5639. onBlur: this.handleBlur,
  5640. onConfirm: this.handleConfirm,
  5641. onLineChange: this.handleLinechange
  5642. }), count && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5643. className: 'at-textarea__counter'
  5644. }, value.length, "/", _maxLength));
  5645. };
  5646. return AtTextarea;
  5647. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  5648. AtTextarea.defaultProps = {
  5649. customStyle: '',
  5650. className: '',
  5651. value: '',
  5652. cursorSpacing: 100,
  5653. maxLength: 200,
  5654. placeholder: '',
  5655. disabled: false,
  5656. autoFocus: false,
  5657. focus: false,
  5658. showConfirmBar: false,
  5659. selectionStart: -1,
  5660. selectionEnd: -1,
  5661. count: true,
  5662. fixed: false,
  5663. height: '',
  5664. textOverflowForbidden: true,
  5665. // eslint-disable-next-line @typescript-eslint/no-empty-function
  5666. onChange: function onChange() {}
  5667. };
  5668. AtTextarea.propTypes = {
  5669. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  5670. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  5671. value: PropTypes.string.isRequired,
  5672. cursorSpacing: PropTypes.number,
  5673. maxLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  5674. placeholderClass: PropTypes.string,
  5675. placeholderStyle: PropTypes.string,
  5676. placeholder: PropTypes.string,
  5677. disabled: PropTypes.bool,
  5678. autoFocus: PropTypes.bool,
  5679. focus: PropTypes.bool,
  5680. showConfirmBar: PropTypes.bool,
  5681. selectionStart: PropTypes.number,
  5682. selectionEnd: PropTypes.number,
  5683. count: PropTypes.bool,
  5684. textOverflowForbidden: PropTypes.bool,
  5685. fixed: PropTypes.bool,
  5686. height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
  5687. onLinechange: PropTypes.func,
  5688. onChange: PropTypes.func.isRequired,
  5689. onFocus: PropTypes.func,
  5690. onBlur: PropTypes.func,
  5691. onConfirm: PropTypes.func
  5692. };
  5693. var AtTimeline = /** @class */function (_super) {
  5694. __extends(AtTimeline, _super);
  5695. function AtTimeline() {
  5696. return _super !== null && _super.apply(this, arguments) || this;
  5697. }
  5698. AtTimeline.prototype.render = function () {
  5699. var _a = this.props,
  5700. pending = _a.pending,
  5701. items = _a.items,
  5702. customStyle = _a.customStyle;
  5703. var rootClassName = ['at-timeline'];
  5704. if (pending) rootClassName.push('at-timeline--pending');
  5705. var rootClassObject = {
  5706. 'at-timeline--pending': pending
  5707. };
  5708. var itemElems = items.map(function (item, index) {
  5709. var _a;
  5710. var _b = item.title,
  5711. title = _b === void 0 ? '' : _b,
  5712. color = item.color,
  5713. icon = item.icon,
  5714. _c = item.content,
  5715. content = _c === void 0 ? [] : _c;
  5716. var iconClass = classnames((_a = {
  5717. 'at-icon': true
  5718. }, _a["at-icon-" + icon] = icon, _a));
  5719. var itemRootClassName = ['at-timeline-item'];
  5720. if (color) itemRootClassName.push("at-timeline-item--" + color);
  5721. var dotClass = [];
  5722. if (icon) {
  5723. dotClass.push('at-timeline-item__icon');
  5724. } else {
  5725. dotClass.push('at-timeline-item__dot');
  5726. }
  5727. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5728. className: classnames(itemRootClassName),
  5729. key: "at-timeline-item-" + index
  5730. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5731. className: 'at-timeline-item__tail'
  5732. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5733. className: classnames(dotClass)
  5734. }, icon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  5735. className: iconClass
  5736. })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5737. className: 'at-timeline-item__content'
  5738. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5739. className: 'at-timeline-item__content-item'
  5740. }, title), content.map(function (sub, subIndex) {
  5741. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5742. className: 'at-timeline-item__content-item at-timeline-item__content--sub',
  5743. key: subIndex
  5744. }, sub);
  5745. })));
  5746. });
  5747. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5748. className: classnames(rootClassName, rootClassObject, this.props.className),
  5749. style: customStyle
  5750. }, itemElems);
  5751. };
  5752. return AtTimeline;
  5753. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  5754. AtTimeline.defaultProps = {
  5755. pending: false,
  5756. items: [],
  5757. customStyle: {}
  5758. };
  5759. AtTimeline.propTypes = {
  5760. pending: PropTypes.bool,
  5761. items: PropTypes.arrayOf(PropTypes.object),
  5762. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string])
  5763. };
  5764. var error = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAGwtJREFUeAHtnUusndV1x7mAIYABG/MUYGzLBCUtFHcCtB3YZgISGaCodOQ4QGGSoJAgV5FiOTAALBowY6tFASoUmYyS0EoRYPEonUUKRETYKNhWEnCwFZvWEIzB/f3v/T773HPP2Wt/79da0v/uc85+rfVfa93vsff5zswpLpUwcPz48aUMvAKsTMpLKC8Ey0bKc3h9JjhjpOTlKUfBpyPlEV4fBAdGyv283gPeUzkzM/NnSpeSGZgpebzBDUciXITR1yW4NilXU54P6pTDTPYueBO8lZRvkjgf8tolJwOeIBmJIyGuoMs6sD7B8oxD1N18LxO+DHaqJGH+ULcCXZ7PE8TwXnKESBNC5ZeNLm2v3oWCacLs9CNM2F2eIBP4ISlu4uM7wM3gr0FfeTqObb8BL4EdJMv/ULqMMNBXx4+YGPeSpFhJyw0JdA0xRNE1zLMCyaKL/8HLoBOEpNCFtI4USox/AIPmA/tT0ZHldaBk0ZFFNwAGKYMLCJLiNDx9K/gG+Br4EnCZzsBfqPo5eAb8J8nyxfSm/asZTIKQGItwn44U3wdX1+TK/2WedxLsptTaxehaxiHej653aP1DMrouonWSJSBdQ9E6yqVANlyT4FzKOkQ2bAU6BfusjgmbnqP3CUJi6AhxN/gXsLwiwvcw7tsgTYbZkiB6v6L55g2LjZfxQZosaflVPlsxr2F5b/Yx1GPg37FRRxiXrjFA0CwGm8D7oGzZx4BPg43gyrZyI90SHaWrdC5bxK04XtxWDlyvMQZw1lKwBRwEZcl+BvoJuBd09g6XdE9skC2yqSwR1+Jc22tc2sgAzjkN3AcOgTJE/x0fB2vaaG8ZOsk28AQo6ygr7uUD3QhxaQsDOORG8CtQVD5mgOfArWAwTpatic2yXRwUFfnihrbEx2D1wAnLwHbwBcgr6rsT3AXquhvUWp/BwXkJFzspi/Iq3+ium0udDED6DLgbHAB55Qgdt4Gr6tS9S3OJm4QjcZVX5CP5qvd3TFvhW4i+HrwB8sphOj4MtE3dJYIBcQUeAeIur8hn10dM503yMAC5p4LN4BjII/pPpv5adHPJwYC4SzjMe+SW734ATs0xvXeZxgCEXgx+CfLIH+n0ANC391xKYEBcJpyK2zwiX15cgio+BESuBXkc8Qn9dG/e91pVFEbiNuFYXGcV+XRtRar1f1jI0ymVAvxzkFVeoMOq/rPUDgvFNRDnWUWnXPKxn3JlcSWEXQJeBFllLx1uzzKXty2PAXEP5IOsIl/roRYuFgMQtQ5kXdk9Sp+t4GxrfK+vlgF8oOsT+UI+ySLy+bpqtev46BC0AXyWhVXavgK+0nHTe6e+fAJeBVlEvtdXElzGGYAY3WnKsnKra5OHgJ+/jpPZkvfyTeKjLNeRioEHWmJC82pAxgx4DGQRHY7XN6+9axDDgHwFsp42KyaGvfoOAaeDH4Ms4hd0MVHZsjY4OM+NF8XG6S0zpR51MPxs8AsQKzpM+y3BetxTySz4T6dc8mGWUy7FyLBuvmDwBeANECu+qFRJyDYzKE7PuvirWLmgGW1rnlWGgrdArKjt5TWr6dNVzIB8CrLGQb+TBEJ0WpXlyPE67f1rnBUHa1PDy7dAPo4VxU4/T7cwTBfkWa45fkb7s5pyns9bDwPyMZCvY0Ux1K8LdwzSrdynYxmg3VNgMF95rScU2zuLfJ34nCJKFEv9uQWMMVnWOR5trytdsyoZIE4ejUqPuUZ6Llf3BVu0Qh4jWkG9v/sWuwVFGFAMAMVCjHR7xR0LN4BYYz05ikRWj/oSM0qSGFFsdXPvFopre0HsxkM/repRgJdhCrETe7qlGOvWLmAU1raC2L03T5VBqI/RPwaIoadAjCjWuvF9EhTVdoLYLzvp9p7frepfbJdikWIDxN4CVsy1f2c3Sm4BMaIFIl/nKCWU+juIYgTELiZuaTUTGKI9NjEb0bTFwFfIW+3N9iinWAEx21KO0W5tezQf0QTF9GgebSq0RG18b9UId/7SZkAxA2Ljq12PFEJxXXfEPLeqvRlu+8hbNMwAMaYzFMWQJYrF9lyPoMxmS+Okvt3niA0HgE9vM0AcxV7jbrZHq6EFCutZuTFZ/SLt2pPVNXDjU5TPgGIIKJYsUUw2+yxgFNAmRG1BtqQ796nL96mPWDIDBFvsOptis7lNjUyux9pborta/oCFkoNk6MMppkDMHdO7G+EK5ZaBmKd8P9iIgj5p7xkg/h4ElihG6/8RHybdbmlG/SvArzt6H6rNGKjYSmKMIijba9UQVW4A2kkZEj160p94WKtnhjeZYgwo1kKiWL2xFnaYSPtjYn4wc2stCvkkg2eAeNSzgC1RzFa/749J9DO/luylQT+/XD/4cGwfAYo1oJiz5L5KtWd27Yk5ZGlBvf8EQaWe8MHHGVDMRcSlYre6PYAM/sMIJV4YV97fOwN1MEBsxvyITzW7OZh8MThoJMgn1K+qgwyfo34G8K0W6J4B2jT4J/BT0Jqf0UaXVUAxGBLF8OLS2WPQTaFZk7pqsrOgNeh2JfgO+BH4JvDfLczIKZxpS5GSYlx02tKmJInZq7Upo/nh5hCgH2v8YJyZsff6r9K6wEOnr4OPxnR9h/fXha322pQBuFJyaMFtmjyftm26REHFqmIxJNr6VF6sMti3Q7Mldd9rmpzx+dFrORhPjtQUOfxvxvv4+/kMiCMQSg7xuX9+r2bfoc8DUsqQb5WiJZMsAtYtNBHYut8hR6fvgpB4kgSiBOJikkP8/j4wTO1V6KPfSbSSWjG9yFIuZhuInju03BjoyZmZmSNGmyaqLb21R+cliPIjyZh3Ek5e4uOYfUxq1xpJYvFJQyHFhmI7v0CSVs13gZAcpnJJ/lmq64led4UUH6nzI8mIG+Al9sghCnXh3rpH7qDTEqDYDIliO//qOp1vC42e1D08wm2rXqKfnoihC/IY8STBexCVJTlazRm2PBLh+NtyBy2D7zAmOEL9RbknqKEj+l0H5MgYabXDq6YLgnqTHOIKey4CitGQ7MjFKyPqEGUtumzLNXjNnbCjV46vgr6+coRd20BIFOPZLxHodE9oVOq0hbg1C0RW0KCrJ8kUkvrMjWIUKFZDcs8UaqZ/zGivhUakbuf03u2sQWdPkjHXDIETxSoIyWtjtITfMtJKYGXdneFR2lmLXZ4kiWuGwgV23glColiP30NI4y2h0aj7GJzbzhSwtUL3wSfJkDhQrALFbEji9xEyyu7QSNQ9Z4dhu1tgw2CTZIi2K2ZBSHZHRSwj3BQaJam7JWqwljfClsElyRBtVhhi9y1J7IaKvzNDlt5PhkagTjsh868+mhrU2wBbBpMkOWztzY5nxSxQ7IbE2p4ym2nWY+YfrzeEq58NxnqfJEOw0YoUOHg8lB3UvRkcgwZaebTuXq0JDtLRSuxWknwIYqRTK+4YlOUfgDjo5eZN7FpjOFexP31nCJV3GAO0at9/2bmI7VkCSUnS+lOQHDb1MjnSWIGP/SAkd6RtVY5vd18/WjnhdecWByfYMPUjtkn/msqbwcGpjU5WaBv4yzDd2iRJdIvdsi6bb044OGll/15ZMTw9ByDU2tp+b//4WmgRPHT+SKLkAL5Jc8y9cHIvCMmusS5zb+lxRahXUrd6Yucefoi9nU0SdPfkmBKTcLM6ieVQccWC7rTeEOpB3b4FnXr+ATZ3LknQ2ZPDiEvFMgjJiW8ajl6DTD/3mpvQOncz1OpeddeuSfC4rodeBjFfkx3KNcekwLNieWEuQK71YIaNk2Yawmdw0/ojSQ4de323KhSXcLURhGTvvP601PqHJVfO6zSwN5CT9dSltrtbbdatjWECX3qQoCUn10NoebPR+r02Glq3TnCUNUkq/y+NTq0/utXtp5j54O09EBLd7j+xDmL9t3s7ZtK+t+GaRFsRdH4au06iRwpZ3OamLRk7yzrH+sSG3HP2qKMV07N+Sy/SLSe+0yNiCpmSI0kqWUxMkiPLBbknx3zPWzE9L0Gund93wTtrsAUd+vxB00mSMTkO4AtPjoUBacX0yZyA8EMgJGsXju+fQFiWaxJtArSO1CapGefsxH4x0+gKGsDjWhCSQ7PT0mJpqFVSd1kFOvZiSPipLUmSubLsOC6ckL1w0gQj4PKyJLZDxVJ908raAnx4wvj+0QgDcFh5kiRzeHKM8F70JZxajyZdo4v0lcZEkzdvGZ2GVJ3xmuRCuMl0d0vJoT5AfS3RHTa/5rBYmqu3YnulEmSFMZZ1MWN0H0b1SJLootiS6CRJkkN3q2KSwy/ILebn11uxvUIJcun8PgveWVm2oMNQP0iSJPb7JGaSjBw5suytCn9tdKjOmWy3FduXKkEs8nv9LcLJvOX/tKwjyUhy+JEjvzusnlZsL4tJkJhVY0uRQdWPHElynW7lSA59E9CPHNmjzIrt2QSx/kPFODm7aj3vkTdJPDlqDQwrti/Ubd7fgpCcXFGsVfd+TAaxWW8Bx97KLWXhsR8s57MC31wbCnzqfqtTrMXG8HMrikYjr57MQI5rEuuIron0n89PqyZTnuVTK7YXK0HOMEb81Kj3aoOBjKdbxmieHBZBGeqt2D4jJkGOZpjQm05hoKQk8SPHFH5zfmzF9hm6BrEeC39Wzsm92wQG4FvXJLHXGTQ9IX7NMYHPIh/BrH7kNSQfK0GOhVpQ15sHVRchs8y+cJo1STw5ynRAMpZi24j9YzrFcukGA8e7oWa/tFSC2Odh/bK5UWt09ECB2I2Hqa66s6VvJvot95SRckrrBtVRJYh1JX9mObr4KDmTIyXOkyRlorzSiu1P/QhSHtnBkQomRzq2J0nKRDmlH0HK4bHYKCUlR6pEmiT+bcGUkfxl1BHkiDH+EqPeqwMMZEwOrXMIlihJMn3pyhpwoPVWbB/RKZa1o1HOcMnBQI7k0HdJ1gNPkhx85+hixfZBJYjlDOv7Ijn06n+XPMmh1XbwFux4ktQTIlZsH4g5gliD1GNKh2bJmxypiZ4kKROVl1Zszx5BrFMs6yu5lVvRpQmKJkdqqydJykSlpRXbs0eQDwwVrjbqvTphoKzkSAn1JEmZqKy0Ynu/TrH2GNNfY9R7NQyUnRwpqUmS6OLdulZUF7+7lRIXV1qxvUeOtR4c91HcXMNtpeQAsTt0c208rGOOoXkQTj8CIVmjBPFHjxaIDPirPDlS9eqcK52zryVcxj16VATQ2B9enSMSmgjYJubMQU3ru8DjWhCS2a/j6hpE8u5cMfWvda42tWNfK2A2y65cXT+U8h1yrkn0eB+/JikeWFZMz+ZEmiDWM5WswYqr26ERmkqOlCJPkpSJQqUV07M5kSaIVm9DYg0W6turuqaTIyXTkyRlIndpxfTJnMDp/iOeETwrOUCld6si1JjXBH30bKdW6TRPwZa+gbP3QEh0GjsntPKfgU7JmFLCUeuSI1W1zbqlOraphK9sPwMt5em0F4RkY5uMrFMXSGltcqQ8dEHHVNemS7jaCEKyJ9UxvQbRe/0GRUjWhyr7WgeLjdytysqnX5NkYsyK5YW5QCBsCKUUdfsyqdCDxkoO0Knz+y7qXHeoKJZBSDYs0InWV4R6JHWrF3Ts6QfY27nkSF3RZd1TG6oq4WZ1Esuh4vKJ89NjV6gXdfdO7NizD7Gzs8mRuqIPNqS2lFkqhkFI5v0s2+g1iPRYeO41Xzvr3G1+6w6+g7lOXHNY1Po1yVSGrBiengMExx2h1KLO+smqqVp1oULJATp1zWHx2kebLJtD9YphEJI7pvanl9ZDvgj1pm7N1AE6XIFdvUuO1B19ti21MaaEh78FIVHsXxQciwZvhkag7vHgAB2sxKbeJkfqjiHYmNo6rYSDJ0BIrD2JswuG20IjUPc+OG2aEl37HFt6nxypT4Zka2pzWipmgWI3JNvS9lNLet8UGiGpu3XqAB2qwJbBJEfqliHaLNux+9YkdkPFTSlPwZIRdodGoe654AAdqMSGwSVH6pYh2q6YBSHZnfJjloyyJTQSdfpVqnPNgVraAN0HmxypS4bEAbaeB6xfUtuScmOWDLYSWHez7jIHamED7Bp8cqRuGQoX2HkXCIlifWXKS1RJh9dCI1K3M2qgFjVCZ0+OMX8MgRPFKgjJq2O02G8Z7Z7QiNQp666yR2pHC3T15Jjiij5zoxgF1tnQPVOomf4xg54PPgEhsW+LTZ+ithoM8OQw2O4rR9hlLVsoxs836JlcTccdICRHqAyvPE4eurZP0c+TI5LtHFxdGzl0I80Um0AxGpIduZVj1NtCIyd1D+eeoOKO6OfJkZHjjJy9Q/uzMk5RW3N0ewRYcltuhRhZq4/WFvjDtLF+qSe3Dnk7otMl4E8gRrRB0X/SLCFbXIDYTZt35vVRlf3QfwlQbIZEsX1qIT0YwLpFJgU2F5qkgs7o9LQUixBPjgn8w1tskjwxoXvjH6H/5gjfF1+qYJJFwHqgwwHanNM4KyMKoM8fgCWeHCOcjb+EvJgk+e54v6bfo/c5QDEZEsX0olJ0ZaBvh2ZK6h4oZbKSBkEna9+/J0cE1/AYShI9HX15xDC1NkGnB4Al3ypNKWb6EvjAmPGPalfapAUHQpfnA/p6cmTgFx71cDpdkI+KkuPrGYappSk6KVYViyHRrt5yY5UBN4VmTOri97NUTBf6XAUmPbVeF+5+QZ6RfzhT4H0T/Ah8B1yZcYhamqPXFmDJptKVYcbF4KAxsxZdVpU+ec4B0eUq8FOgpNB/lWfAJTmH824tZwDfrgLW4rZieHElpjBwTHa+UMnkPqgzYDBAfL4ALKnuLIeZ9WtUk05bxpW63bDFq52BUhkgAG8fD8IJ7xW7S0udeHwwJrhvwsTjH+kW2tnjff29M1AFA4o1YC1FKEbvq2L+eWMyiVbXf6XZDNk6r6O/cQYqYoA43GrEoqoVs/U8S4GJbgTWFuKjtPlKRZz4sM7ALAOKMaBYC4li9YZaKWPC7SGNkrpXKIvtdanVKp+sSwwotsCrSayFiu2124U2y8CBkFZJ3UO1K+cTDoIB4uuhiPhTjC5rhBAmvjtCwc9ps74RBX3S3jKgmAKKLUvubowENJsBb1gaUq+lfV+ga8xT/ZpYsZTEFEVQFJszjVqPAteDY0E15ypfpPDrkUa91f3JFUNAsWSJYvL6VliMIpstbZP66lYxW8GEK1E1A8RRzG4OhdsPqtYlenyUUVb/UloZonPGtdEDe0NnYIQBxQ6Iue5QLLbrbAWFLgbWNmOazLaZ/BNXI2T4S2dglAHi5vIM8XXxaN/WvMaA2Ax/i7bV7olpDSuuSFEGFCtAMWOJrjvWFp2v0v4oGHuO+DptW/tEjEpJ8sGjGVCMAMVKjLT/GhcrYu8yyOCfgXr2x0S7xBu2hQHFRhIjFKbozla7rjumEYmisfepZfVT08bxz4fNgGJDARIh3Vtnw6h14LMI49Tk0WGHgls/zoBiIjJ2FGPrxvt34j2KbwDaSRkj93fCKFeycgYIlvtjAoY2iq0NlStU5QQYEPMIFvEhYz1JqnRGB8ZWDCSxQGFKqx41lZtezHzMNPVkAz/dys10tzsSArGnVYqWx7pt7Yj2GKNNjU/LqkjRxZnf3RrhsM8v5Wsgn8eKYqnZTYhlOwSDTge/iGWAdroF7OskZTuiZePJx4mvKaJEMXR6y8woRx0M05frY7bHp0xpgchX3Muhv3WjyLcgdhFQMaHY6ffDQDDwAhCzbYBms6K2vnerdeFdTCH5FGSNgwuKzdqR3hCjJMlyJNEmyLUdMc/VNBiQL4F8GiuKlWEkR8odBut0K8s1iTaibQHd2E6QGurlCQbku8SH8mWsKEb6fVp1gqGxFxiuC/csd7dEqvbc+Nd3x7hs+1v5LPEdRbQoNvp5QR7rMAiYAVnWScSu9t6sj53D2zXLgHyV+IwiWhQT/bqVW8QNkKEVd62mx4q+WfYg8FOuIsRX2Fe+SXwU8y1Ams6KYqAfK+Rlcwsx2rsVu8Fxlk3+vAr8CY5lO6PgePJJ4huKaJHvu723qiBvZncIynM41qMn9XzWYV7MmazW10A+SHwhn2QRnTZ3c1duffTOzQRReS7o5Iy9wH96oW6HJfOJ+8QHFJnEb7xk9Rn06vxVt3WznL+mXtEPqazKOqe3z8eAuAYxP16T+ict5Vu/dZ+P9rleEJh1USkl/5OE/HJ/rLGIMT3rC7/63UIFuLjOKr74W1Y8wLweKRTz3K1JTpIjvgda9TvuZXHTxDjiEuiuY5bVcJqfEPmynY/maYLQMuaEUJ1ybQZZVmFpfkL0lG/1X1KGPkMcQ9wlHMY81Z+mC0S+kw/81nxVAQS5ehaw9ubklcN0fBhcVJWOfRtXXCWcibu8Ip+141m5fXPQuD0QrdV3/fRC3v9kdD1+BGwDV42P7+/nGBA3CUfiKq/IR/KVr4rXHViQvgxsB1p9zSvquxPcCc6t24a2zScOEi52UhblVb5p5sdr2kZsk/rghBtAzA+L0iwoH1P7HLgFDOYrv7I1sVm2i4OiIl/c2GRM+NxjDOAQOVk/UX0IlCFa2X0crBmbqjdvZVtio2wtQ8S9fDCYfy6dCwacsxT8EBwEZcl+BvoJuBes7hwpicLSPbFBtsimskRcaz3Evx7dleDAWYvBJlDWf0eGOiH7ePU02AiubCsn0i3R8ceU0rlsEbfieHFbOSiqV+/vLOA8raT/M9gElhclbEr/PXz+NnhnFDMzM+/zvnLBxsuY5JoxfJX3K0AVso9B/xX8Gzb+pYoJ2jJm7xMkJZogWsRrbaX+Prg6/bzi8iPG3wWUOCr3g4PgQFIeovwUHB0peXnKGeDMkVKLm7obdGFS6huVXwZKCpXngTpkN5NsBc+SGJ/VMWHTcwwmQVKiSRRdQN4KvgG+BnyvFiQEREeIn4NnwH+RGJ8H2vauanAJMupBkkX/mf8RKFn+HgyaD+xP5Tgv/hsoKZ4nKXSkG6R4QCRuJ1lW8lKnYEJn71Ql5uQt3qXjs+A/SIrf5R2kT/08QSZ4k2S5iY//CdwM/gr0lScdKX4DXgY7SIo3KF1GGOir40dMLPaSZNGmxnVgfYK6LvCLKT69ty60lRDCTpLiw+lNvcYTJGMMkDBX0GU0YZZnHKLu5rolO5oQv69bgS7P5wlS0HvJEeY6hklxLa91DXN+waGzdj9MB11DvAXeTOFHCJgoIJ4gBcgLdSVxtO1iBViZlJdSai1jdD1DK9Ba8xDSdQ9ezlsX0RrJ/4HR9RO9/gDsAe+pJBH+TOlSMgP/D3W7PKH+6NniAAAAAElFTkSuQmCC";
  5765. var success = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAAGfFJREFUeAHtnWusXmWVx3soFES0QAsFp+lQLuIFCHyZUjRDWz4pYIxA0SiUW4uGYRwlVRg6ZVRmxjBRHD/QSdPqSImXTjKSiKLggEIpycQBA8g9HO5QaAslU7BQOPP7H/bb8563736eZ99vayX/s/e7n9ta/7XW2ZdnX0ammBTCwNjY2AF0fBiYGy1nsZwJZvQt38v63mBa35LVKW+CHX3L7axvAZv7lptYfxKMajkyMvIKS5OcGRjJub/OdUciHITRx0U4NloeyXI6KFO2Mdjj4D5wf7S8j8R5mXWTlAxYgiQkjoSYTZOFYFGEOQm7KLv6Uwx4G7hdSxLmubIVaPJ4liAe70V7iF5CaPlBT5O6Fz+Kgr2Eud32MG53WYIM4YekmM/mxeAUcAxoK09j2PYA+G+wnmS5m6VJHwNtdXyfiWGrJMVcap4TQecQXRSdw6wTSBad/HdeOp0gJIVOpLWnUGJ8HHSaD+zvifYsG4CSRXsWXQDopHQuIEiKqXj6E+BccDrYB5jEM/Bnin4Brge/Ilneia/avpLOJAiJsRfu057icnBUSa7U3MUjEXT48hLon894jd/98x2a/5D0z4tonuT9oH/+RJeWdRh4dATNr5QhjzHIt4EOwd4qY8Cqx2h9gpAY2kNcCL4G5hRAuA5HlAQPR8teQjxCECkZChdsVPL0kqW3/FC0rQgfP03f14C12Kg9jEnTGCBo9gPLwQsgb3mYDq8DZ4Ky/nsndoF0i3SUrtI5bxG34ni/xMpZg2oYwFkHgJVgC8hLRuloLfgC+EA1lmUfVbqDzwPZMgryEnEtznV7jUkdGcA5U8Gl4FWQhzxGJ3J6ay/5yrbIRtmah4h7+UAXQkzqwgAOORHcA7LKVjpYBU6qi21l6YHN8yPbxUFWkS/mlaW7jRPDAE6YAVaDd0BaeZOGN4IzgK4YdVrgYBr4DBAn4iatyCfyjS4gmJTJAKSPgAvBZpBWXqbhClDbk+wyOR02FtzoH9CVQFylFflIviriatowtbu9DaKPBxtBWnmehl8FehbDJIABcQW+Ap4DaUU+Oz5gOKuShgHI3QPoP/5OkEZGafQl0PnDqDT8q424A18EoyCNyHfaI+2RVgdrN4QBCD0Y3ALSiK7/nwf2HNK1bUrBgLgES0DauRX58uAUQ1uTQQYgcgHQYVFS0bX5ZcD+Ww2SmtNvcQuWAnGdVOTTBTmp0r1uIE/kax7ibZBEdPVEE2F28l1S2MC1TubXAHGfRHTIJR/bP7EkvoKwWeC3IKn8kQadm8NIwm2RdeFecyn3JnUa9eVrvdTCxMcARC0ESe+f2kabvwM2g+sjuOBy+QB8GcgnSUQ+X1iwes3uHoLOAW8lYZW668Ghzba8fdrLJ+CnIInI93okwWSQAYi5DCQ5hn2d+rqN3aTGDOCjC8B2ECqKgctqbFK5qkGGZsWvCWUvqvcgS71MwaQBDOCrj4I/Rb4LXSgmuj37DgG6nv4foYxF9X7E0mbBG5AY/Sris31BUl+rfjfnryLCbmIZKtpNn99Puq03jwF8uAQkOeRSjOzbPEszaIzBBwLdmxMq2j1/JMOQ1rRGDODLD4MHQp1PPcXKgTUyoThVZCi4H4TKrVS0RzqLc0klPcun4DehQUA9xUy7kwQDdRyaZM/xE+rrDR8mLWQA3+4FfgxCRbHTzsMtDNMJeZJzju9Tv9tXMVqYFIMmycfgeyBUFEPtOnHHIJGgq0+hcuUgkfa73QwQGFeEBgf1FEvt+eeJMaHzHLp57aJ2h4JZF8cAvteTh4qBENF7uZovWKoZ8hB5g0qfbr7FZkEWBoiBTwHFQog0e8YdC3VvVcjtI7oHR+/JNTEGphALp4KQe/IUW828dwvFFwUaSTWbALS8mMwAMbEEhP5zXTi5dc1/YZie5wi9Zf3rNTfH1KuIAWJoOQgRxVoznidBUT0JGPqw07UVcW/DNoQBYuk7IEQUc/V/MhElV4ZYQ50bQHsu1TUk4JqmpmIErAMhsrLW9mHBAhDyDPmvqafvdZgYA14GFCvgZuATXSJe4O2wigooplfzPO+zgHK9t9VuV6/CSQ0eUzED/hf4RDFYr1cKoZDOO/SuI5/oOeUjG+wnU71CBoidI0DIs+6Kxfqcj6DMChAiZ1fIrw3dAgYIsrNCAo06K2phLoroXbk69vPJqloobEo0ngEC7TpfsFGumKz2XcAooCsMugXZJ3pflX1NtvGhWQ8DiKW9Qcj7txSb1V0pZXDdXOaT16hQ1ldl6+FB06JwBhRTQLHlk2refINWM0DI9zk+VzhbNkAnGSD+PuvLjihGy/+IDwOvDlBubSc9Z0aXxgAxuCYgDleXppAGQqF5wHcj2UvUsa+eluqZ7g2mGAOKNZcoVk8shR0Gmgo02eeT80pRyAbpPAME4hJfMFKumC3+3c0McmmAMndSp7qrB50PmW4RoFgDijmfXFooM4yu3dmrHi30oMuxhSpinRsDAwwo5oDvISvFbnGH/XR+FfDJdwd0t5/GQCkMEJght8YXc8cvg+tFX1s82fEc5e8rhQ0bxBgYYCCK0Wc9MaoYzv9FhHQa8nSX3Ws14DT7WS4DxOliT4KoeHmuWtHhPuBF9eyQjbkOap0ZAykZIEbvcsSpivSIbn63PtHZ36hXj5ya0h5rZgzkygBx+klPrKr4klwGpSM9zfWUenTIvbkMZp0YAzkxQKz65uoU09mfaqUTfULLJ2fmZJd1YwzkwgABe4YvaCm/INNgdKBZ80c9Az1EeX2e3spksTVuCwOKSaBP9blEsZ1+dp3Gp7l6j8rObQupZke7GCA+9WZPn5yW2mp6Xu/p/QnK2/Uq+tRsWcO6MaDYBIpRl6xPpTc97g/ecPVM2cWpOrdGxkBJDBCjyzwxrBjfP7E6NFrq6Xgr5Xsn7tgaGAMlMqAYBb47QJbGqeQ6ufadW/xsZGRkR1zHtt0YqAMDUYz+zKOLL9YnNyfj5gLfA1EnTW5lv4yBejJALM8HLlGsHz5M+7g9iL654Hqe43Ey024tGcaobasdA8Tq3Sj1uEMxxfoXhpW7EmRY/d62db0VWxoDDWHAF7NhH+JhV5N6d9QQokzNDjJAXKc6bRi2B/Hdsn4Xu6wnOsixmdxgBojZUdTf4DFh8WD5sAQ5ZbDSwO/rB37bzw4zwH9mPYb9cfCXDaDBd5i1yGkDRuoTBq6rVzsoTz6p4hzVCpvIAHHwHvBvA/Hye34fXld70G06UAzHiWL/oFj9KfQ9jXVHbGMr6AwDxIm+1fE7MEweYeN76koGuimJXTLpMGuPAUPcu5gpU24bqG8/O8YAkaWPH/0SnBxj+gfZHnZFKKaDgjff7ul/Ug5YgnjYsuIJBgKSo1f5hN5KDZe+f/KTEmSX/hg/27Xfoex1MG1XA1vpFAP43nVYNRg6K+tKjmIYbB9UeOD37J7+/XuQhb2NMcsNXCp7M6bMNreYAYLHd1jVb/1b/Ph5/4Y6rUcxfJdHp1250J8gw3ctEz35jt0matpaaxhImByyewVBeH/NCUh+mAURTw3sZgZ/zqu50aZezgwoOUDc1arB+NDvb+asQiHdoae+TuCSpyYNTM2DXLUp2wamTmpkP1rNAP5uZXLIaYrlKKZZxMrEfAhVTomt9m7Bza2OBjNuEgO4PGlyfGNSBw34gY03e2J+/I6S3jnIcR6bHvSUW3FLGFByYIprnmPQ0m9xznHV4MYG/PbF9HhOhCbIIw0w2FTMyEDK5KjtJV0PHb6YnthpQMwfPLubuFlTjw5W3BQGlBygdSfkcfxj68nAJX/Y1ZZavo/iHLKrsq20jgH8nzQ5vtV0ErD5EFd2KCfGbWRFtyu7ZFvTyTD94xnA8Z1Ljh4b2O7bMRygS14nuLKDsv/pdWjLdjGAbzubHPKkYtsT+yfoJH2ux+2+kxlPcyuuIwNKDvRKcrXqaq5W/UMdbcmgky+25ypBDvMM4OvE09yK68ZAiuTQpdy2JYfc4ovtw5QgvhPwR+vmYNMnPQMpk6Opl3J9RPli+xAlyAxPL5s85VbcEAZSJIcOq9qaHPKaL7ZnhCTIlob439R0MJAyOdp4WNXPki+2xxNkZn+LIeubh2yzTQ1iwJIj1lm+2J6pS10PAZdk/45brH5WUDQDOLbTl3Jd/MKNvr/pkoeUIM84amx3DWBl9WYAvyZNjm/W26L8tYMj1+O3zyhBNjkSZGv+KlmPZTCQIjkaf/tIGl7hSd+5iZNNSpBX4krZ/kKaQa1NtQzgt6R7jk4mh7ykGHfE/yuqoLeVxMnkRw+r9buNHsAAjrTkCOCpVwW+XI+av64E2RmXHWx/rNeRLevPAP6y5EjoJsW4I/53WoIkJLSu1S050nkmJEHsECsdt7VpZcmR3hVw5z3Ecp2kv5h+aGtZBgOWHNlYhr8XQZyMn6TbZd5sHFfWGq/aOUdG9uHQe5n36bj0YbtNFGZ0QFHNLTnyYVYx7oj/p3WS3rpbTbBpDvgYaOXHfrAr6Z6jczPkIekDj0G3mmygokt8z4uE6FJKHYw4AtzRZ8zbrF8LavtBl6TEYIslR1LSYurD5aHAJRu0B7nRVYOyY2L6r9Vm9NQnwR6NseU2tu9bK4VTKIMNSZOjszPkIfTC5zEx8dLbfKOeB/HeEx8yWA3qnIcOR8XosZDtN2F1Y5ME3ZM+Q97Wx2RjXJxqs+9hwS0hCTIr1dDlNzreM2RjkyRFcrT9SUCPq4OLfbG9WQnim+vQN+eaID47ZEPjkiRlcrT9ScC84tEX25uUIE96RjvaU16X4v9CkZ0ByjQmSSw5AryZrYovtp/USXprXhyHLVeAUKn1iTtG2Al5tuD3toZj74vjlCCtevUo9vwzCJVaJgnKW3J4wzt7BXje5gmUA8ZHoZLvHaWNmQuRQdjT2CRBd0uO7LHv7QGew15eHQVU6z5/0MQkseTwxnVuFeD6ZOCSSZ8/+IGrJmXLctOsxI7QuzF7EnS1PUe5sbHME/M/kDq6iiXxfbbXd7b/bi81+8tbAf8elf4lUK3Krm4pOdAxyYuk/6ml78oNdFUu1XwxPZETOKjVH/HEvtruSZQc4HcgVOz2kRzyA7KDPuI5PhSVW/8ZaGysXZKgU9LkuDqH2Oh8F/A+FfiuYB00iSgauB49pHjsryY1aOAPbKhNkqBL0uSwPUdOMQf384BLntxtKGr/0NWCsst3a9TADdhReZKgQ9LksD1HjrEG/74J5fET9ElD0ugc4JJbJjVo8A+MrCxJGNuSo+LYwQe3ugKdsnN2U5GNsz2N9GjitN0aNnQDtpSeJIxpyVFxvCiGgetNPhSP/cVQNSmIe+BIjSR/PbRhQzdiT2lJwliWHDWIE8UwcEn8Z9lo9e+ulpRdVQMbc1UBmwpPEsaw5MjVa+k7wxf/CFyyKrZ3Wi12taTs97GNG1yAXYUlCX1bctQoNvBH/zsL+LmbLI5Vl6qaD3lntyYTG3awOj22gwYXYFfuSUKflhw1ign8sT9QDMeJYn/y/Meg/lS4L651tH3pYJu2/Ma+3JKEviw5ahYY+GRpFMNxi/u8KtNSr8lxyZ3eThpcAcMzJwl9WHLUMAbwy52uwKbsWq/aVJrv6US7obnejhpcAftSJwltLTlq6Hv8cjhwnT5QPDY/SHUqur6ZoI7a/O3scY6wMXGS0MaSIyjCyq+kmAUuCf8WDr3k11n5XOQ2IjwkTZIkd+Xa7SO5ecrfEb7M758+nc0F+eyO/LrXukbCJKF6kFhylOh1PHKSxyuK9WSnDTTwndDET6iUaHwZQ8FFkj2JxxdjlhxlOK1vDByyyuOUO/qqh63Soe+SmL6rsHdYb82vha15JIklR8mhoBgFrm+AUDyWfOqCRtPBG2rtkItLtrfS4eAhS5JYclTgPXx2sSN+VaQYTzf5TcP16sEhT1C2ZwV2VzYk9qZJEkuOCjym2ASKUZesT60avZ7m6jkq2/3e+dQjNqMhdidJEkuOityKn84NiN/TUqtH53p213cL/IPU6b0dJfVYTWuIzSFJYslRkWMVk+Ah4BLFdrbYpYMLXCNEZWdWxEOlw2L71Q5uvlGpch0fHL+c5fBNr+iCzDTRk77j5nuhwz2ZB2poB3BzMtBn7J4Bz4FbwKKGmtMatfHBvcAlium9cjGYji5xjRSVfTKXwawTYyAjA8TjqQHxeknGYSaaM9g+wPXBdemzcaKFrRkD1TFALN6tgHTIC5Ttk6uGdLjcMWCvKP5prFy1sc6MgeEMEIhn94LRsVw+vHWGrQy2H9jiGFRFz4L9MgxjTY2B1AwQe+8DOg90iWK4mBil45WukaOy76S20BoaAxkYIP6+GxCfxT2qweD6GpXvYztvUeeYDHZaU2MgMQPE3LFAsecSxe67X41KPEJgAwa41KVBVKY3R4wEdmnVjIFMDCjWgC61++TSTAOFNEYDza7f49OE8iUh/VkdYyArA8TaeQHxqJidmnWsoPYMdCJ4x6PUJsqL3Z0FaWuV2syAYgy85IlFxeq8UnlgwNUepVS8plSlbLDOMUCMrQ2Iw9WlE4NSM8DmAOU+W7pyNmAnGCD2PhcQf4rRGZUQwsAXBij4GnWOqkRBG7S1DCimgGLLJxdWRgKa6erBRp+GlOvGsc48nluZQzoyMLGkW5/+CHyi2Kz2aioKHA92+jSl/LqO+M/MLJgBYmlVQLwpJo8vWJWw7lFkRYDCqnJWWI9WyxgYzgAxFHKvlWLtyuE9VLAVZfT0lp6D8Im+LHpEBSrakC1ggNg5EoScdygWsz0pmDdfKHQweB74RBM27817fOuv3QwoZoDvISjFnmLw4FqygWILwNvAJ7+iQj5Pc9WSCVMqTwYUK+DXvqCiXOcdC/IcO/e+UDDkjl/Zug5Ue4Uhd+utw7wZUIyAG0CIFHenbl6GYYXOR34bYg117Nb4vIhvaT/EyLWBsaSYq9d5R5xPUHQW0GONIfK1uH5se7cZIHi+HhJA1FGszWoUWyi8EPjuz6fK+E2Pdudvo7xbvLLExfkKjgBRjC0sXqMCRkDxc4Dvrl9xICNPLUAF67KBDBALp0cxwcIpiq1mv9kTAy5zmjhR+Aarn2qgP03lHBkgBj4NFAshclmOQ1fXFZZeE2ItdXSZLvvb7qoz1UbOwAC+vyiKARZeuSbDUPVqiqm6VPcjr8kTFa6olwWmTdEM4PorJ9zvXVMstWuKAIP2BDd5TZ+o8D1W20VC0VHWwP7lY/D9Cbd71xRD7fzkBobtC0Juj++x9GNWbMa9gYEfojK+nQZ+0nN2wFKxs29I342tg4EHgvsDyOhV+Q0rxbzoq7EsNl9x+RTc2nNywFIxc2DzLQ+wQIaCJHuSB6j/4YCurUoDGMCXHwF/AqGiWOlGcvT8h8E63EpyTrKd+jah2COwoUt8qFf0yJehohhp92FVnC8xXCfuSa5uidQfgm4SFkdkA7bjM92untTXqt/OE/JQn0GArmKEzpNQdVy0e/5o6BhWr1oG8NUxQJ/qSyKKCbuK2XMdZGjGPeS2lB7J2k2f32tvy3oygI/05pvXe04LWCoG2jFDnrdLIEb3bum+rCTyUyofkrcu1l82BvDJoWB9EkdSV75v9r1V2Wjzt4agRSD0Vnmqjouedf9bUM67V/1mdLaGfAC+DEKeHafaLpHPF3aWuCSGQ5SeJwl96GoXw6zomeX5ScayuvkxAPcngZD3VVFtksjXzXqeIz/a0vUEYXoycSUIecadartEx7BrQDWvm0xnbqNbwfVMsBYkOYek+rhv5eNmPAlYRy9Bnl4E8TxIKnon61Jg5BfkWHELlgF91iypyKcLClKtW91CpF4pFPLerWFOepiNS0C3r6fnGDLiMuJU3KYR+bKer+bJkadSu4JQ/bdaAXaCNDJKoy8Ce0dwSs+JO/AlMArSiHwnH9pePaUPvM0gV+8C1r05aUVfQf0KsJfXedl+t4K4Al8FaQ51aTYu8lk93pUbaHdjq0G0Zt81AaXzjLTyMg31kI6dzMdEAtzo5Fsciau0Ih/JVzYrHsNzYZshfQZYDZJePaHJLnmTtRvBZ8C0wpRtSMdwoMOoM4A4ETdpRT6Rb+wfUNW+xwnzQMiHRanmlK2UrgKdm0uRzZHt4iCryBcnVh0XNn4fAzhEM7j6RPWrIA95jE50jf7IvmFatSrbIhtlax4i7uUDu6OhrpGCc/TV06tAmmvzNBsqo2zVRNjnwQfqartPL+ke2SBbRkFeIq71z8S+auxzQl3KcdZ+YDlIel8XTbzyEDWuA2eCmXWxeVAP6RbpKF3TzlnQNFbErThu7SPRrb+ygPP2IXAuAsvBnMEgyuH3GH08Ah6OlrvWR0ZGtubQv7cLbNSJ8NED+FD0uwgfP03f/wrWYOOfWbZWiiCvlmQRRHo7im6lvhyU9dXdzYylhBEeBy+DLUDbtXwN7IjwJktBoqtpgiY1hfcDJYH2VloeBHRu1EuKsvZijzHmt8E6EuMtlq2XziRIz5Mkik4gPwHOBacD7WFM4hnQHuIX4HpwM4nxdnzV9pV0LkH6XUiy7M9vfVhUyfIx0Gk+sL8nOmy8Cygp/pOkeLVX0LWlBUTkcZJlLqs6BBNae2k3MjduocPAdeAGkuKJuEpd2m4JMsTbJMt8Np8NTgF6OURbedKe4gFwG1hPUmxkadLHQFsd32ditlWSRSfEC8GiCGWd4GdTPL61TrSVEMLtJIUuHJjEMGAJEkNM3GYSZjZl/QkzJ65uTbbrkmx/QjxbE70aoYYlSEY3RXuY4+imh2NZ1znM9IxdJ22+jQY6h7gf3NeD7SFgIoNYgmQgz9WUxNFtF4eBudHyEJaawxB68xmage6f89C6RPMhmh/pzY38H+v98ydafxE8CUa1JBFeYWmSMwP/D9ulVgFLdbgRAAAAAElFTkSuQmCC";
  5766. var loading = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAn1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8Kd3m4AAAANHRSTlMA6AN+QRH69xUI7Z7x2sWzcWYvphvj4MxiXVIiGAuH08K9ibepmI+Oc2tKHQ+helY5NykfkF5N9AAABmhJREFUeNrdnWlT4kAQhjt3CARIwg1yH3Lpqv3/f9tabsYJMUGCsM6b56NVVjGV6WP6pLvTijTb8bS2X29U581BaBEmLY9T1LrVpukSGhFn06n2W4SExvn4q2ecL6PxeSbrPwRBxN/iG0NSHyHs55kGB1KdVqTxBTjLnU6qo1csdx+ag8CIujXOxe+pf5QEIzPYNDo5OnlbITD2/WObM9AeHwiOYbDMEB/PgHRiwo3GaWpbKFkR6LvI4RTdF4Lk0JtyihXk/Xrnbe2kRKVHoLjjlImphwSKZXicxH4iVB4eNU6ywPHy01SME1nRTIJluOAEtgFpU/4xaHOC2YhgeRjbJble9Dplid0nXHSDEzQJGFNjyZyAGc1YUgVWXqfXqwH3dsy7XnVUf/iD1oQ/mUCfxKonvgn07ao0EnKCLPGkVxO6i6AZl8SeEDVLYuNPToLsd53cLhvZF35HSrwG/D55R5daeAathKkiLaNB0FiTsohJS/sUE9wo0QcmCxaEjcEC3BjkB/rsU0xg48L/GH2KSZ2wkWICm3VIi4kH/V4k0qccsyJsXm2OAc0zfnWEu9g+Fz20OWZL2Aw4pgYu77QoiRtMQ0eoYMC6lWxj8kjYVDThz0PHHt95LIvievBEpRq4LSGjLL6jJepWfPRP8umo7AgbV9iSJYGzFvXC6lc+n+eNYwICR7ywpgROj2MQOgTOcXBK4gNTJEwJgbPjGJBOmlx04QOvCZyNKIkgcEKOAc8yyEa0ZwJnWZKgIwVlUcBDjsHqMc2gXY5yCKJjOaqGiPoiBkHg7EtjSUQ/I3gJAVGjHGVcRJuySLswiV0CxxQ5HwJnxDHoySsSoVPwkg6iLv9jQOBEZdG/Rjkqm4mCshgSkXRvEDhmSeq3KCzLa1c48u2PASxaBPvodUXGPR6J46GexBLVHMKiRIRJRWTgSBOfBhNd1M+SqKwDzVfLg4i8D2h5irxaHrZDL4Vdww6oSPUroo57gkQaRB/7iSVdlDp2iEs6jQ3st6J046vYJR3yYTXHrh+QT90mQztbMvgwwA46ynBQiB10lAE6i2MgW2CTIdMasiFJBrG7yPo3mVYQhmRDgCQTPU3kEFcy9WYip3iTyVCXcR350/R0B7cOIlkwIKX9SHDIEo7ksdoEx2lRTQu2Ejhd5uSjmsR04dkKtYMhXQr4zKBh03RxpsuYkZSv5bITTHfrawHzWtwtqEh2Rkn5H8jOq6wifx8xApHVdmEAdl5lNsIMARstZWtSVufVjGDIbhYLOOaNQMhp3zs4aN0xeQ2VS/F3kMyVbHHNU8pjgiC36Vj3oWZ0nGkD70HN6DjTmK93gGZ0nB2VsAWa0SGHV2DP6Pjmpz7CSIkc8HL+4jmKh1O+HbljgIxBlEOQ8pUzQtL9+7FUUnG1FVbBlwwK07sAjsr8ktFtLxxjv5KiXDhMb8UxU0UDKpeON7Q8xY3JxQMne8wqp6sLjACtqzxEu8hQ1tBWd4h2sTG5T+oO0S44uHihqpgUHSXtyiHaSpX+Fx/ubdoqLmG5Zty6oeASlqsG4Osz5ZawXLmSYKSptoSl8JIIKSZKOcLXr+3oK7WEJblIBXmdzM9+y5xVuV0/XTZ0VGNlXHL90/FKjafCyrhbLOSq1H9/ZdxtVqRZyZVxLSqKQkvrrPoPdpAqtUYweUO50Ipb1RY76sffWXGbXrV51G8SECt+vVRcftrkotdL1XW0fZsl01f6BoUXBJ98ZXv8QLmovrL5RO64PaAc1F+irRs2J1gMKQuIteYn14sdI0etAyyadxecRHtMiQrQ6v8nm5N4hkU3xTI8TmI/0Z0I63xCbezSzXDHNT6hHtL96Hl8grN+o5vwtnb4BK9Hd8VacYpZ70A/5NCbcYqVRffmpcspnGin09Xou8jhFN0X+g/o2xqn0TbhlWK30ThNbavT3ZHqJY22DIYFTV+wFKcoqAzvpPAl7WN/Txex7x/bLMk1T/ensu1wJp3GJjBHlMvIDDaNvP/dVuj/o/d8zqXWjYxgYIZ716roesVy96E5CIyoW+Nc/J5Ov4O+Wzp8I5zlTqdf5BBM+QZMAwXaC4aGzz/CN5SpdPuznvCVTNaKLatwn1c+F8RfPatZwd7qVzt8IZ1qX6nk9xdcs1kVOjZPM1ebpppf4itWOGjOq42639Y8x7YdT2v79UZ13hyEFt2Fv6Loy9OZgJFyAAAAAElFTkSuQmCC";
  5767. var statusImg = {
  5768. error: error,
  5769. success: success,
  5770. loading: loading
  5771. };
  5772. var AtToast = /** @class */function (_super) {
  5773. __extends(AtToast, _super);
  5774. function AtToast(props) {
  5775. var _this = _super.call(this, props) || this;
  5776. _this.handleClick = function (event) {
  5777. var _a = _this.props,
  5778. onClick = _a.onClick,
  5779. status = _a.status;
  5780. if (status === 'loading') {
  5781. return;
  5782. }
  5783. if (onClick) {
  5784. return onClick(event);
  5785. }
  5786. _this.close();
  5787. };
  5788. var isOpened = props.isOpened,
  5789. duration = props.duration;
  5790. if (isOpened) {
  5791. _this.makeTimer(duration || 0);
  5792. }
  5793. _this._timer = null;
  5794. _this.state = {
  5795. _isOpened: isOpened
  5796. };
  5797. return _this;
  5798. }
  5799. AtToast.prototype.clearTimmer = function () {
  5800. if (this._timer) {
  5801. clearTimeout(this._timer);
  5802. this._timer = null;
  5803. }
  5804. };
  5805. AtToast.prototype.makeTimer = function (duration) {
  5806. var _this = this;
  5807. if (duration === 0) {
  5808. return;
  5809. }
  5810. // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
  5811. // @ts-ignore
  5812. this._timer = setTimeout(function () {
  5813. _this.close();
  5814. }, +duration);
  5815. };
  5816. AtToast.prototype.close = function () {
  5817. var _isOpened = this.state._isOpened;
  5818. if (_isOpened) {
  5819. this.setState({
  5820. _isOpened: false
  5821. }, this.handleClose // TODO: Fix dirty hack
  5822. );
  5823. this.clearTimmer();
  5824. }
  5825. };
  5826. AtToast.prototype.handleClose = function (event) {
  5827. // TODO: Fix dirty hack
  5828. if (typeof this.props.onClose === 'function') {
  5829. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  5830. this.props.onClose(event);
  5831. }
  5832. };
  5833. AtToast.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  5834. var isOpened = nextProps.isOpened,
  5835. duration = nextProps.duration;
  5836. if (!isOpened) {
  5837. this.close();
  5838. return;
  5839. }
  5840. if (!this.state._isOpened) {
  5841. this.setState({
  5842. _isOpened: true
  5843. });
  5844. } else {
  5845. this.clearTimmer();
  5846. }
  5847. this.makeTimer(duration || 0);
  5848. };
  5849. AtToast.prototype.render = function () {
  5850. var _a, _b;
  5851. var _isOpened = this.state._isOpened;
  5852. var _c = this.props,
  5853. customStyle = _c.customStyle,
  5854. text = _c.text,
  5855. icon = _c.icon,
  5856. status = _c.status,
  5857. image = _c.image,
  5858. hasMask = _c.hasMask;
  5859. /* eslint-disable @typescript-eslint/no-non-null-assertion */
  5860. var realImg = image || statusImg[status] || null;
  5861. var isRenderIcon = !!(icon && !(image || statusImg[status]));
  5862. /* eslint-enable @typescript-eslint/no-non-null-assertion */
  5863. var bodyClass = classnames('toast-body', (_a = {
  5864. 'at-toast__body--custom-image': image,
  5865. 'toast-body--text': !realImg && !icon
  5866. }, _a["at-toast__body--" + status] = !!status, _a));
  5867. var iconClass = classnames('at-icon', (_b = {}, _b["at-icon-" + icon] = icon, _b));
  5868. return _isOpened ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5869. className: classnames('at-toast', this.props.className)
  5870. }, hasMask && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5871. className: 'at-toast__overlay'
  5872. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5873. className: bodyClass,
  5874. style: customStyle,
  5875. onClick: this.handleClick
  5876. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5877. className: 'toast-body-content'
  5878. }, realImg ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5879. className: 'toast-body-content__img'
  5880. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Image, {
  5881. className: 'toast-body-content__img-item',
  5882. src: realImg,
  5883. mode: 'scaleToFill'
  5884. })) : null, isRenderIcon && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5885. className: 'toast-body-content__icon'
  5886. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  5887. className: iconClass
  5888. })), text && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5889. className: 'toast-body-content__info'
  5890. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, null, text))))) : null;
  5891. };
  5892. return AtToast;
  5893. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  5894. AtToast.defaultProps = {
  5895. duration: 3000,
  5896. isOpened: false
  5897. };
  5898. AtToast.propTypes = {
  5899. text: PropTypes.string,
  5900. icon: PropTypes.string,
  5901. hasMask: PropTypes.bool,
  5902. image: PropTypes.string,
  5903. isOpened: PropTypes.bool,
  5904. duration: PropTypes.number,
  5905. status: PropTypes.oneOf(['', 'error', 'loading', 'success']),
  5906. onClick: PropTypes.func,
  5907. onClose: PropTypes.func
  5908. };
  5909. var AtAccordion = /** @class */function (_super) {
  5910. __extends(AtAccordion, _super);
  5911. function AtAccordion(props) {
  5912. var _this = _super.call(this, props) || this;
  5913. _this.handleClick = function (event) {
  5914. var open = _this.props.open;
  5915. if (!_this.isCompleted) return;
  5916. _this.props.onClick && _this.props.onClick(!open, event);
  5917. };
  5918. _this.isCompleted = true;
  5919. _this.startOpen = false;
  5920. _this.state = {
  5921. wrapperHeight: 0
  5922. };
  5923. return _this;
  5924. }
  5925. AtAccordion.prototype.toggleWithAnimation = function () {
  5926. var _this = this;
  5927. var _a = this.props,
  5928. open = _a.open,
  5929. isAnimation = _a.isAnimation;
  5930. if (!this.isCompleted || !isAnimation) return;
  5931. this.isCompleted = false;
  5932. delayQuerySelector('.at-accordion__body', 0).then(function (rect) {
  5933. var height = parseInt(rect[0].height.toString());
  5934. var startHeight = open ? height : 0;
  5935. var endHeight = open ? 0 : height;
  5936. _this.startOpen = false;
  5937. _this.setState({
  5938. wrapperHeight: startHeight
  5939. }, function () {
  5940. setTimeout(function () {
  5941. _this.setState({
  5942. wrapperHeight: endHeight
  5943. }, function () {
  5944. setTimeout(function () {
  5945. _this.isCompleted = true;
  5946. _this.setState({});
  5947. }, 700);
  5948. });
  5949. }, 100);
  5950. });
  5951. });
  5952. };
  5953. AtAccordion.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  5954. if (nextProps.open !== this.props.open) {
  5955. this.startOpen = !!nextProps.open && !!nextProps.isAnimation;
  5956. this.toggleWithAnimation();
  5957. }
  5958. };
  5959. AtAccordion.prototype.render = function () {
  5960. var _a;
  5961. var _b = this.props,
  5962. customStyle = _b.customStyle,
  5963. className = _b.className,
  5964. title = _b.title,
  5965. icon = _b.icon,
  5966. hasBorder = _b.hasBorder,
  5967. open = _b.open,
  5968. note = _b.note;
  5969. var wrapperHeight = this.state.wrapperHeight;
  5970. var rootCls = classnames('at-accordion', className);
  5971. var prefixClass = icon && icon.prefixClass || 'at-icon';
  5972. var iconCls = classnames((_a = {}, _a[prefixClass] = true, _a[prefixClass + "-" + (icon && icon.value)] = icon && icon.value, _a['at-accordion__icon'] = true, _a));
  5973. var headerCls = classnames('at-accordion__header', {
  5974. 'at-accordion__header--noborder': !hasBorder
  5975. });
  5976. var arrowCls = classnames('at-accordion__arrow', {
  5977. 'at-accordion__arrow--folded': !!open
  5978. });
  5979. var contentCls = classnames('at-accordion__content', {
  5980. 'at-accordion__content--inactive': !open && this.isCompleted || this.startOpen
  5981. });
  5982. var iconStyle = {
  5983. color: icon && icon.color || '',
  5984. fontSize: icon && icon.size + "px" || ''
  5985. };
  5986. var contentStyle = {
  5987. height: wrapperHeight + "px"
  5988. };
  5989. if (this.isCompleted) {
  5990. contentStyle.height = '';
  5991. }
  5992. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5993. className: rootCls,
  5994. style: customStyle
  5995. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  5996. className: headerCls,
  5997. onClick: this.handleClick
  5998. }, icon && icon.value && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  5999. className: iconCls,
  6000. style: iconStyle
  6001. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6002. className: 'at-accordion__info'
  6003. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6004. className: 'at-accordion__info__title'
  6005. }, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6006. className: 'at-accordion__info__note'
  6007. }, note)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6008. className: arrowCls
  6009. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  6010. className: 'at-icon at-icon-chevron-down'
  6011. }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6012. style: contentStyle,
  6013. className: contentCls
  6014. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6015. className: 'at-accordion__body'
  6016. }, this.props.children)));
  6017. };
  6018. return AtAccordion;
  6019. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  6020. AtAccordion.defaultProps = {
  6021. open: false,
  6022. customStyle: '',
  6023. className: '',
  6024. title: '',
  6025. note: '',
  6026. icon: {
  6027. value: ''
  6028. },
  6029. hasBorder: true,
  6030. isAnimation: true
  6031. };
  6032. AtAccordion.propTypes = {
  6033. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  6034. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  6035. open: PropTypes.bool,
  6036. isAnimation: PropTypes.bool,
  6037. title: PropTypes.string,
  6038. note: PropTypes.string,
  6039. icon: PropTypes.object,
  6040. hasBorder: PropTypes.bool,
  6041. onClick: PropTypes.func
  6042. };
  6043. var AtSlider = /** @class */function (_super) {
  6044. __extends(AtSlider, _super);
  6045. function AtSlider(props) {
  6046. var _this = _super.call(this, props) || this;
  6047. var _a = props.value,
  6048. value = _a === void 0 ? 0 : _a,
  6049. _b = props.min,
  6050. min = _b === void 0 ? 0 : _b,
  6051. _c = props.max,
  6052. max = _c === void 0 ? 100 : _c;
  6053. _this.state = {
  6054. _value: AtSlider.clampNumber(value, min, max)
  6055. };
  6056. return _this;
  6057. }
  6058. AtSlider.clampNumber = function (value, lower, upper) {
  6059. return Math.max(lower, Math.min(upper, value));
  6060. };
  6061. AtSlider.prototype.handleChanging = function (e) {
  6062. var _value = this.state._value;
  6063. var value = e.detail.value;
  6064. if (value !== _value) {
  6065. this.setState({
  6066. _value: value
  6067. });
  6068. }
  6069. this.props.onChanging && this.props.onChanging(value);
  6070. };
  6071. AtSlider.prototype.handleChange = function (e) {
  6072. var value = e.detail.value;
  6073. this.setState({
  6074. _value: value
  6075. });
  6076. this.props.onChange && this.props.onChange(value);
  6077. };
  6078. AtSlider.prototype.UNSAFE_componentWillReceiveProps = function (props) {
  6079. var _a = props.value,
  6080. value = _a === void 0 ? 0 : _a,
  6081. _b = props.min,
  6082. min = _b === void 0 ? 0 : _b,
  6083. _c = props.max,
  6084. max = _c === void 0 ? 100 : _c;
  6085. this.setState({
  6086. _value: AtSlider.clampNumber(value, min, max)
  6087. });
  6088. };
  6089. AtSlider.prototype.render = function () {
  6090. var _value = this.state._value;
  6091. var _a = this.props,
  6092. customStyle = _a.customStyle,
  6093. className = _a.className,
  6094. min = _a.min,
  6095. max = _a.max,
  6096. step = _a.step,
  6097. disabled = _a.disabled,
  6098. activeColor = _a.activeColor,
  6099. backgroundColor = _a.backgroundColor,
  6100. blockSize = _a.blockSize,
  6101. blockColor = _a.blockColor,
  6102. showValue = _a.showValue;
  6103. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6104. className: classnames({
  6105. 'at-slider': true,
  6106. 'at-slider--disabled': disabled
  6107. }, className),
  6108. style: customStyle
  6109. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6110. className: 'at-slider__inner'
  6111. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Slider, {
  6112. min: min,
  6113. max: max,
  6114. step: step,
  6115. value: _value,
  6116. disabled: disabled,
  6117. activeColor: activeColor,
  6118. backgroundColor: backgroundColor,
  6119. blockSize: blockSize,
  6120. blockColor: blockColor,
  6121. onChanging: this.handleChanging.bind(this),
  6122. onChange: this.handleChange.bind(this)
  6123. })), showValue && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6124. className: 'at-slider__text'
  6125. }, "" + _value));
  6126. };
  6127. return AtSlider;
  6128. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  6129. AtSlider.defaultProps = {
  6130. customStyle: '',
  6131. className: '',
  6132. min: 0,
  6133. max: 100,
  6134. step: 1,
  6135. value: 0,
  6136. disabled: false,
  6137. activeColor: '#6190e8',
  6138. backgroundColor: '#e9e9e9',
  6139. blockSize: 28,
  6140. blockColor: '#ffffff',
  6141. showValue: false
  6142. };
  6143. AtSlider.propTypes = {
  6144. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  6145. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  6146. min: PropTypes.number,
  6147. max: PropTypes.number,
  6148. step: PropTypes.number,
  6149. value: PropTypes.number,
  6150. disabled: PropTypes.bool,
  6151. activeColor: PropTypes.string,
  6152. backgroundColor: PropTypes.string,
  6153. blockSize: PropTypes.number,
  6154. blockColor: PropTypes.string,
  6155. showValue: PropTypes.bool,
  6156. onChange: PropTypes.func,
  6157. onChanging: PropTypes.func
  6158. };
  6159. var AtSwipeActionOptions = /** @class */function (_super) {
  6160. __extends(AtSwipeActionOptions, _super);
  6161. function AtSwipeActionOptions() {
  6162. return _super !== null && _super.apply(this, arguments) || this;
  6163. }
  6164. AtSwipeActionOptions.prototype.render = function () {
  6165. var rootClass = classnames('at-swipe-action__options', this.props.className);
  6166. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6167. id: "swipeActionOptions-" + this.props.componentId,
  6168. className: rootClass,
  6169. style: this.props.customStyle
  6170. }, this.props.children);
  6171. };
  6172. return AtSwipeActionOptions;
  6173. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  6174. var AtSwipeAction = /** @class */function (_super) {
  6175. __extends(AtSwipeAction, _super);
  6176. function AtSwipeAction(props) {
  6177. var _this = _super.call(this, props) || this;
  6178. _this.handleOpened = function (event) {
  6179. var onOpened = _this.props.onOpened;
  6180. if (typeof onOpened === 'function') {
  6181. onOpened(event);
  6182. }
  6183. };
  6184. _this.handleClosed = function (event) {
  6185. var onClosed = _this.props.onClosed;
  6186. if (typeof onClosed === 'function') {
  6187. onClosed(event);
  6188. }
  6189. };
  6190. _this.handleClick = function (item, index, event) {
  6191. var _a = _this.props,
  6192. onClick = _a.onClick,
  6193. autoClose = _a.autoClose;
  6194. if (typeof onClick === 'function') {
  6195. onClick(item, index, event);
  6196. }
  6197. if (autoClose) {
  6198. _this._reset(false); // TODO: Check behavior
  6199. _this.handleClosed(event);
  6200. }
  6201. };
  6202. _this.onTouchEnd = function (e) {
  6203. var maxOffsetSize = _this.state.maxOffsetSize;
  6204. if (_this.moveX === -maxOffsetSize) {
  6205. _this._reset(true);
  6206. _this.handleOpened(e);
  6207. return;
  6208. }
  6209. if (_this.moveX === 0) {
  6210. _this._reset(false);
  6211. _this.handleClosed(e);
  6212. return;
  6213. }
  6214. if (_this.state._isOpened && _this.moveX < 0) {
  6215. _this._reset(false);
  6216. _this.handleClosed(e);
  6217. return;
  6218. }
  6219. if (Math.abs(_this.moveX) < maxOffsetSize * _this.moveRatio) {
  6220. _this._reset(false);
  6221. _this.handleClosed(e);
  6222. } else {
  6223. _this._reset(true);
  6224. _this.handleOpened(e);
  6225. }
  6226. };
  6227. _this.onChange = function (e) {
  6228. _this.moveX = e.detail.x;
  6229. };
  6230. var isOpened = props.isOpened,
  6231. moveRatio = props.moveRatio;
  6232. _this.state = {
  6233. componentId: uuid(),
  6234. // eslint-disable-next-line no-extra-boolean-cast
  6235. offsetSize: 0,
  6236. _isOpened: !!isOpened,
  6237. needAnimation: false,
  6238. eleWidth: 0,
  6239. maxOffsetSize: 0
  6240. };
  6241. _this.moveX = _this.state.offsetSize;
  6242. _this.moveRatio = moveRatio || 0.5;
  6243. return _this;
  6244. }
  6245. AtSwipeAction.prototype.componentDidMount = function () {
  6246. this.getAreaWidth();
  6247. };
  6248. // 当 eleWidth 发生变化时,需要重新计算 maxOffsetSize
  6249. AtSwipeAction.prototype.componentDidUpdate = function (_, prevState) {
  6250. var eleWidth = this.state.eleWidth;
  6251. if (prevState.eleWidth !== eleWidth) {
  6252. this.getMaxOffsetSize();
  6253. }
  6254. };
  6255. AtSwipeAction.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  6256. var isOpened = nextProps.isOpened;
  6257. var _a = this.state,
  6258. _isOpened = _a._isOpened,
  6259. maxOffsetSize = _a.maxOffsetSize;
  6260. if (isOpened !== _isOpened) {
  6261. this.moveX = isOpened ? 0 : maxOffsetSize;
  6262. this._reset(!!isOpened); // TODO: Check behavior
  6263. }
  6264. };
  6265. /**
  6266. * 获取滑动区域宽度
  6267. */
  6268. AtSwipeAction.prototype.getAreaWidth = function () {
  6269. return __awaiter(this, void 0, void 0, function () {
  6270. var systemInfo;
  6271. return __generator(this, function (_a) {
  6272. switch (_a.label) {
  6273. case 0:
  6274. return [4 /*yield*/, _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getSystemInfo()];
  6275. case 1:
  6276. systemInfo = _a.sent();
  6277. this.setState({
  6278. eleWidth: systemInfo.windowWidth
  6279. });
  6280. return [2 /*return*/];
  6281. }
  6282. });
  6283. });
  6284. };
  6285. /**
  6286. * 获取最大偏移量
  6287. */
  6288. AtSwipeAction.prototype.getMaxOffsetSize = function () {
  6289. return __awaiter(this, void 0, void 0, function () {
  6290. var componentId, actionOptionsRect, maxOffsetSize;
  6291. return __generator(this, function (_a) {
  6292. switch (_a.label) {
  6293. case 0:
  6294. componentId = this.state.componentId;
  6295. return [4 /*yield*/, delayGetClientRect({
  6296. selectorStr: "#swipeActionOptions-" + componentId
  6297. })];
  6298. case 1:
  6299. actionOptionsRect = _a.sent();
  6300. maxOffsetSize = actionOptionsRect[0].width;
  6301. this.setState({
  6302. maxOffsetSize: maxOffsetSize
  6303. });
  6304. return [2 /*return*/];
  6305. }
  6306. });
  6307. });
  6308. };
  6309. AtSwipeAction.prototype._reset = function (isOpened) {
  6310. var _this = this;
  6311. if (isOpened) {
  6312. var maxOffsetSize = this.state.maxOffsetSize;
  6313. if (false) {} else {
  6314. this.setState({
  6315. _isOpened: true,
  6316. offsetSize: -maxOffsetSize
  6317. });
  6318. }
  6319. } else {
  6320. this.setState({
  6321. offsetSize: this.moveX
  6322. }, function () {
  6323. _this.setState({
  6324. offsetSize: 0,
  6325. _isOpened: false
  6326. });
  6327. });
  6328. }
  6329. };
  6330. AtSwipeAction.prototype.render = function () {
  6331. var _this = this;
  6332. var _a = this.state,
  6333. componentId = _a.componentId,
  6334. maxOffsetSize = _a.maxOffsetSize,
  6335. eleWidth = _a.eleWidth,
  6336. offsetSize = _a.offsetSize;
  6337. var _b = this.props,
  6338. options = _b.options,
  6339. disabled = _b.disabled;
  6340. var rootClass = classnames('at-swipe-action', this.props.className);
  6341. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6342. id: "swipeAction-" + componentId,
  6343. className: rootClass,
  6344. style: {
  6345. width: eleWidth + "px"
  6346. }
  6347. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.MovableArea, {
  6348. className: 'at-swipe-action__area',
  6349. style: {
  6350. width: eleWidth + "px"
  6351. }
  6352. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.MovableView, {
  6353. className: 'at-swipe-action__content',
  6354. direction: 'horizontal',
  6355. damping: 50,
  6356. x: offsetSize,
  6357. onTouchEnd: this.onTouchEnd,
  6358. onChange: this.onChange,
  6359. disabled: disabled,
  6360. style: {
  6361. width: eleWidth + maxOffsetSize + "px"
  6362. }
  6363. }, this.props.children, Array.isArray(options) && options.length > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtSwipeActionOptions, {
  6364. options: options,
  6365. componentId: componentId,
  6366. customStyle: {
  6367. opacity: maxOffsetSize ? 1 : 0
  6368. }
  6369. }, options.map(function (item, key) {
  6370. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6371. key: item.text + "-" + key,
  6372. style: item.style,
  6373. onClick: function onClick(e) {
  6374. return _this.handleClick(item, key, e);
  6375. },
  6376. className: classnames('at-swipe-action__option', item.className)
  6377. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  6378. className: 'option__text'
  6379. }, item.text));
  6380. })) : null)));
  6381. };
  6382. return AtSwipeAction;
  6383. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  6384. AtSwipeAction.defaultProps = {
  6385. options: [],
  6386. isOpened: false,
  6387. disabled: false,
  6388. autoClose: false,
  6389. maxDistance: 0,
  6390. areaWidth: 0
  6391. };
  6392. AtSwipeAction.propTypes = {
  6393. isOpened: PropTypes.bool,
  6394. disabled: PropTypes.bool,
  6395. autoClose: PropTypes.bool,
  6396. options: PropTypes.arrayOf(PropTypes.shape({
  6397. text: PropTypes.string,
  6398. style: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  6399. className: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.array])
  6400. })),
  6401. onClick: PropTypes.func,
  6402. onOpened: PropTypes.func,
  6403. onClosed: PropTypes.func
  6404. };
  6405. var AtSearchBar = /** @class */function (_super) {
  6406. __extends(AtSearchBar, _super);
  6407. function AtSearchBar(props) {
  6408. var _this = _super.call(this, props) || this;
  6409. _this.handleFocus = function (event) {
  6410. _this.setState({
  6411. isFocus: true
  6412. });
  6413. _this.props.onFocus && _this.props.onFocus(event);
  6414. };
  6415. _this.handleBlur = function (event) {
  6416. _this.setState({
  6417. isFocus: false
  6418. });
  6419. _this.props.onBlur && _this.props.onBlur(event);
  6420. };
  6421. _this.handleChange = function (e) {
  6422. _this.props.onChange(e.detail.value, e);
  6423. };
  6424. _this.handleClear = function (event) {
  6425. if (_this.props.onClear) {
  6426. _this.props.onClear(event);
  6427. } else {
  6428. _this.props.onChange('', event);
  6429. }
  6430. };
  6431. _this.handleConfirm = function (event) {
  6432. _this.props.onConfirm && _this.props.onConfirm(event);
  6433. };
  6434. _this.handleActionClick = function (event) {
  6435. _this.props.onActionClick && _this.props.onActionClick(event);
  6436. };
  6437. _this.state = {
  6438. isFocus: !!props.focus
  6439. };
  6440. return _this;
  6441. }
  6442. AtSearchBar.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  6443. if (nextProps.focus !== this.props.focus) {
  6444. this.setState({
  6445. isFocus: !!nextProps.focus
  6446. });
  6447. }
  6448. };
  6449. AtSearchBar.prototype.render = function () {
  6450. var _a = this.props,
  6451. value = _a.value,
  6452. placeholder = _a.placeholder,
  6453. maxLength = _a.maxLength,
  6454. fixed = _a.fixed,
  6455. disabled = _a.disabled,
  6456. showActionButton = _a.showActionButton,
  6457. _b = _a.actionName,
  6458. actionName = _b === void 0 ? '搜索' : _b,
  6459. inputType = _a.inputType,
  6460. // 处理issue#464
  6461. className = _a.className,
  6462. customStyle = _a.customStyle,
  6463. enableNative = _a.enableNative;
  6464. var isFocus = this.state.isFocus;
  6465. var fontSize = 14;
  6466. var rootCls = classnames('at-search-bar', {
  6467. 'at-search-bar--fixed': fixed
  6468. }, className);
  6469. var placeholderWrapStyle = {};
  6470. var actionStyle = {};
  6471. if (isFocus || !isFocus && value) {
  6472. actionStyle.opacity = 1;
  6473. actionStyle.marginRight = "0";
  6474. placeholderWrapStyle.flexGrow = 0;
  6475. } else if (!isFocus && !value) {
  6476. placeholderWrapStyle.flexGrow = 1;
  6477. actionStyle.opacity = 0;
  6478. actionStyle.marginRight = "-" + ((actionName.length + 1) * fontSize + fontSize / 2 + 10) + "px";
  6479. }
  6480. if (showActionButton) {
  6481. actionStyle.opacity = 1;
  6482. actionStyle.marginRight = "0";
  6483. }
  6484. var clearIconStyle = {
  6485. display: 'flex'
  6486. };
  6487. var placeholderStyle = {
  6488. visibility: 'hidden'
  6489. };
  6490. if (!value.length) {
  6491. clearIconStyle.display = 'none';
  6492. placeholderStyle.visibility = 'visible';
  6493. }
  6494. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6495. className: rootCls,
  6496. style: customStyle
  6497. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6498. className: 'at-search-bar__input-cnt'
  6499. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6500. className: 'at-search-bar__placeholder-wrap',
  6501. style: placeholderWrapStyle
  6502. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  6503. className: 'at-icon at-icon-search'
  6504. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  6505. className: 'at-search-bar__placeholder',
  6506. style: placeholderStyle
  6507. }, isFocus ? '' : placeholder)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Input, {
  6508. className: 'at-search-bar__input',
  6509. type: inputType,
  6510. confirmType: 'search',
  6511. value: value,
  6512. focus: isFocus,
  6513. disabled: disabled,
  6514. maxlength: maxLength,
  6515. enableNative: enableNative,
  6516. onInput: this.handleChange,
  6517. onFocus: this.handleFocus,
  6518. onBlur: this.handleBlur,
  6519. onConfirm: this.handleConfirm
  6520. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6521. className: 'at-search-bar__clear',
  6522. style: clearIconStyle,
  6523. onTouchStart: this.handleClear
  6524. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  6525. className: 'at-icon at-icon-close-circle'
  6526. }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6527. className: 'at-search-bar__action',
  6528. style: actionStyle,
  6529. onClick: this.handleActionClick
  6530. }, actionName));
  6531. };
  6532. return AtSearchBar;
  6533. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  6534. AtSearchBar.defaultProps = {
  6535. value: '',
  6536. placeholder: '搜索',
  6537. maxLength: 140,
  6538. fixed: false,
  6539. focus: false,
  6540. disabled: false,
  6541. showActionButton: false,
  6542. actionName: '搜索',
  6543. inputType: 'text',
  6544. // eslint-disable-next-line @typescript-eslint/no-empty-function
  6545. onChange: function onChange() {},
  6546. enableNative: true
  6547. };
  6548. AtSearchBar.propTypes = {
  6549. value: PropTypes.string,
  6550. placeholder: PropTypes.string,
  6551. maxLength: PropTypes.number,
  6552. fixed: PropTypes.bool,
  6553. focus: PropTypes.bool,
  6554. disabled: PropTypes.bool,
  6555. showActionButton: PropTypes.bool,
  6556. actionName: PropTypes.string,
  6557. inputType: PropTypes.oneOf(['text', 'number', 'idcard', 'digit']),
  6558. onChange: PropTypes.func,
  6559. onFocus: PropTypes.func,
  6560. onBlur: PropTypes.func,
  6561. onConfirm: PropTypes.func,
  6562. onActionClick: PropTypes.func,
  6563. onClear: PropTypes.func,
  6564. enableNative: PropTypes.bool
  6565. };
  6566. var AtLoadMore = /** @class */function (_super) {
  6567. __extends(AtLoadMore, _super);
  6568. function AtLoadMore() {
  6569. return _super !== null && _super.apply(this, arguments) || this;
  6570. }
  6571. AtLoadMore.prototype.onClick = function () {
  6572. this.props.onClick && this.props.onClick(arguments);
  6573. };
  6574. AtLoadMore.prototype.render = function () {
  6575. var _a = this.props,
  6576. className = _a.className,
  6577. customStyle = _a.customStyle,
  6578. loadingText = _a.loadingText,
  6579. moreText = _a.moreText,
  6580. status = _a.status,
  6581. moreBtnStyle = _a.moreBtnStyle,
  6582. noMoreTextStyle = _a.noMoreTextStyle,
  6583. noMoreText = _a.noMoreText;
  6584. var component = null;
  6585. if (status === 'loading') {
  6586. component = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtActivityIndicator, {
  6587. mode: 'center',
  6588. content: loadingText
  6589. });
  6590. } else if (status === 'more') {
  6591. component = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6592. className: 'at-load-more__cnt'
  6593. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtButton, {
  6594. full: true,
  6595. onClick: this.onClick.bind(this),
  6596. customStyle: moreBtnStyle
  6597. }, moreText));
  6598. } else {
  6599. component = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  6600. className: 'at-load-more__tip',
  6601. style: noMoreTextStyle
  6602. }, noMoreText);
  6603. }
  6604. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6605. className: classnames('at-load-more', className),
  6606. style: customStyle
  6607. }, component);
  6608. };
  6609. return AtLoadMore;
  6610. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  6611. AtLoadMore.defaultProps = {
  6612. customStyle: '',
  6613. className: '',
  6614. noMoreTextStyle: '',
  6615. moreBtnStyle: '',
  6616. status: 'more',
  6617. loadingText: '加载中',
  6618. moreText: '查看更多',
  6619. noMoreText: '没有更多'
  6620. };
  6621. AtLoadMore.propTypes = {
  6622. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  6623. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  6624. noMoreTextStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  6625. moreBtnStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  6626. status: PropTypes.oneOf(['more', 'loading', 'noMore']),
  6627. loadingText: PropTypes.string,
  6628. moreText: PropTypes.string,
  6629. noMoreText: PropTypes.string,
  6630. onClick: PropTypes.func
  6631. };
  6632. var AtDivider = /** @class */function (_super) {
  6633. __extends(AtDivider, _super);
  6634. function AtDivider() {
  6635. return _super !== null && _super.apply(this, arguments) || this;
  6636. }
  6637. AtDivider.prototype.render = function () {
  6638. var _a = this.props,
  6639. className = _a.className,
  6640. customStyle = _a.customStyle,
  6641. content = _a.content,
  6642. height = _a.height,
  6643. fontColor = _a.fontColor,
  6644. fontSize = _a.fontSize,
  6645. lineColor = _a.lineColor;
  6646. var rootStyle = {
  6647. height: height ? "" + pxTransform(Number(height)) : ''
  6648. };
  6649. var fontStyle = {
  6650. color: fontColor,
  6651. 'fontSize': fontSize ? "" + pxTransform(Number(fontSize)) : ''
  6652. };
  6653. var lineStyle = {
  6654. backgroundColor: lineColor
  6655. };
  6656. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6657. className: classnames('at-divider', className),
  6658. style: mergeStyle(rootStyle, customStyle)
  6659. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6660. className: 'at-divider__content',
  6661. style: fontStyle
  6662. }, content === '' ? this.props.children : content), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6663. className: 'at-divider__line',
  6664. style: lineStyle
  6665. }));
  6666. };
  6667. return AtDivider;
  6668. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  6669. AtDivider.defaultProps = {
  6670. content: '',
  6671. height: 0,
  6672. fontColor: '',
  6673. fontSize: 0,
  6674. lineColor: ''
  6675. };
  6676. AtDivider.propTypes = {
  6677. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  6678. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  6679. content: PropTypes.string,
  6680. height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  6681. fontColor: PropTypes.string,
  6682. fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  6683. lineColor: PropTypes.string
  6684. };
  6685. var AtCountdownItem = /** @class */function (_super) {
  6686. __extends(AtCountdownItem, _super);
  6687. function AtCountdownItem() {
  6688. return _super !== null && _super.apply(this, arguments) || this;
  6689. }
  6690. AtCountdownItem.prototype.formatNum = function (num) {
  6691. return num <= 9 ? "0" + num : "" + num;
  6692. };
  6693. AtCountdownItem.prototype.render = function () {
  6694. var _a = this.props,
  6695. num = _a.num,
  6696. separator = _a.separator;
  6697. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6698. className: 'at-countdown__item'
  6699. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6700. className: 'at-countdown__time-box'
  6701. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  6702. className: 'at-countdown__time'
  6703. }, this.formatNum(num))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  6704. className: 'at-countdown__separator'
  6705. }, separator));
  6706. };
  6707. return AtCountdownItem;
  6708. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  6709. AtCountdownItem.defaultProps = {
  6710. num: 0,
  6711. separator: ':'
  6712. };
  6713. AtCountdownItem.propTypes = {
  6714. num: PropTypes.number.isRequired,
  6715. separator: PropTypes.string
  6716. };
  6717. var toSeconds = function toSeconds(day, hours, minutes, seconds) {
  6718. return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds;
  6719. };
  6720. var AtCountdown = /** @class */function (_super) {
  6721. __extends(AtCountdown, _super);
  6722. function AtCountdown(props) {
  6723. var _this = _super.call(this, props) || this;
  6724. var _a = _this.props,
  6725. _b = _a.day,
  6726. day = _b === void 0 ? 0 : _b,
  6727. _c = _a.hours,
  6728. hours = _c === void 0 ? 0 : _c,
  6729. _d = _a.minutes,
  6730. minutes = _d === void 0 ? 0 : _d,
  6731. _e = _a.seconds,
  6732. seconds = _e === void 0 ? 0 : _e;
  6733. _this.seconds = toSeconds(day, hours, minutes, seconds);
  6734. var _f = _this.calculateTime(),
  6735. _day = _f.day,
  6736. _hours = _f.hours,
  6737. _minutes = _f.minutes,
  6738. _seconds = _f.seconds;
  6739. _this.state = {
  6740. _day: _day,
  6741. _hours: _hours,
  6742. _minutes: _minutes,
  6743. _seconds: _seconds
  6744. };
  6745. return _this;
  6746. }
  6747. AtCountdown.prototype.setTimer = function () {
  6748. if (!this.timer) this.countdonwn();
  6749. };
  6750. AtCountdown.prototype.clearTimer = function () {
  6751. if (this.timer) {
  6752. clearTimeout(this.timer);
  6753. }
  6754. };
  6755. AtCountdown.prototype.calculateTime = function () {
  6756. var _a = __read([0, 0, 0, 0], 4),
  6757. day = _a[0],
  6758. hours = _a[1],
  6759. minutes = _a[2],
  6760. seconds = _a[3];
  6761. if (this.seconds > 0) {
  6762. day = this.props.isShowDay ? Math.floor(this.seconds / (60 * 60 * 24)) : 0;
  6763. hours = Math.floor(this.seconds / (60 * 60)) - day * 24;
  6764. minutes = Math.floor(this.seconds / 60) - day * 24 * 60 - hours * 60;
  6765. seconds = Math.floor(this.seconds) - day * 24 * 60 * 60 - hours * 60 * 60 - minutes * 60;
  6766. }
  6767. return {
  6768. day: day,
  6769. hours: hours,
  6770. minutes: minutes,
  6771. seconds: seconds
  6772. };
  6773. };
  6774. AtCountdown.prototype.countdonwn = function () {
  6775. var _this = this;
  6776. var _a = this.calculateTime(),
  6777. day = _a.day,
  6778. hours = _a.hours,
  6779. minutes = _a.minutes,
  6780. seconds = _a.seconds;
  6781. this.setState({
  6782. _day: day,
  6783. _hours: hours,
  6784. _minutes: minutes,
  6785. _seconds: seconds
  6786. });
  6787. this.seconds--;
  6788. if (this.seconds < 0) {
  6789. this.clearTimer();
  6790. this.props.onTimeUp && this.props.onTimeUp();
  6791. return;
  6792. }
  6793. this.timer = setTimeout(function () {
  6794. _this.countdonwn();
  6795. }, 1000);
  6796. };
  6797. AtCountdown.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  6798. if (JSON.stringify(this.props) === JSON.stringify(nextProps)) return;
  6799. var day = nextProps.day,
  6800. hours = nextProps.hours,
  6801. minutes = nextProps.minutes,
  6802. seconds = nextProps.seconds;
  6803. this.seconds = toSeconds(day, hours, minutes, seconds);
  6804. this.clearTimer();
  6805. this.setTimer();
  6806. };
  6807. AtCountdown.prototype.componentDidMount = function () {
  6808. this.setTimer();
  6809. };
  6810. AtCountdown.prototype.componentWillUnmount = function () {
  6811. this.clearTimer();
  6812. };
  6813. AtCountdown.prototype.componentDidHide = function () {
  6814. this.clearTimer();
  6815. };
  6816. AtCountdown.prototype.componentDidShow = function () {
  6817. this.setTimer();
  6818. };
  6819. AtCountdown.prototype.render = function () {
  6820. var _a = this.props,
  6821. className = _a.className,
  6822. customStyle = _a.customStyle,
  6823. format = _a.format,
  6824. isShowDay = _a.isShowDay,
  6825. isCard = _a.isCard,
  6826. isShowHour = _a.isShowHour;
  6827. var _b = this.state,
  6828. _day = _b._day,
  6829. _hours = _b._hours,
  6830. _minutes = _b._minutes,
  6831. _seconds = _b._seconds;
  6832. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6833. className: classnames({
  6834. 'at-countdown': true,
  6835. 'at-countdown--card': isCard
  6836. }, className),
  6837. style: customStyle
  6838. }, isShowDay && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtCountdownItem, {
  6839. num: _day,
  6840. separator: format.day
  6841. }), isShowHour && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtCountdownItem, {
  6842. num: _hours,
  6843. separator: format.hours
  6844. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtCountdownItem, {
  6845. num: _minutes,
  6846. separator: format.minutes
  6847. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtCountdownItem, {
  6848. num: _seconds,
  6849. separator: format.seconds
  6850. }));
  6851. };
  6852. return AtCountdown;
  6853. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  6854. AtCountdown.defaultProps = {
  6855. customStyle: '',
  6856. className: '',
  6857. isCard: false,
  6858. isShowDay: false,
  6859. isShowHour: true,
  6860. format: {
  6861. day: '天',
  6862. hours: '时',
  6863. minutes: '分',
  6864. seconds: '秒'
  6865. },
  6866. day: 0,
  6867. hours: 0,
  6868. minutes: 0,
  6869. seconds: 0
  6870. };
  6871. AtCountdown.propTypes = {
  6872. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  6873. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  6874. isCard: PropTypes.bool,
  6875. isShowDay: PropTypes.bool,
  6876. isShowHour: PropTypes.bool,
  6877. format: PropTypes.object,
  6878. day: PropTypes.number,
  6879. hours: PropTypes.number,
  6880. minutes: PropTypes.number,
  6881. seconds: PropTypes.number,
  6882. onTimeUp: PropTypes.func
  6883. };
  6884. var AtSteps = /** @class */function (_super) {
  6885. __extends(AtSteps, _super);
  6886. function AtSteps() {
  6887. return _super !== null && _super.apply(this, arguments) || this;
  6888. }
  6889. AtSteps.prototype.handleClick = function (current, event) {
  6890. this.props.onChange(current, event);
  6891. };
  6892. AtSteps.prototype.render = function () {
  6893. var _this = this;
  6894. var _a = this.props,
  6895. customStyle = _a.customStyle,
  6896. className = _a.className,
  6897. items = _a.items,
  6898. current = _a.current;
  6899. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6900. className: classnames('at-steps', className),
  6901. style: customStyle
  6902. }, !!items && items.map(function (item, i) {
  6903. var _a;
  6904. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6905. key: item.title,
  6906. className: classnames({
  6907. 'at-steps__item': true,
  6908. 'at-steps__item--active': i === current,
  6909. 'at-steps__item--inactive': i !== current
  6910. }),
  6911. onClick: _this.handleClick.bind(_this, i)
  6912. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6913. className: 'at-steps__circular-wrap'
  6914. }, i !== 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6915. className: 'at-steps__left-line'
  6916. }), item.status ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6917. className: classnames({
  6918. 'at-icon': true,
  6919. 'at-icon-check-circle': item.status === 'success',
  6920. 'at-icon-close-circle': item.status === 'error',
  6921. 'at-steps__single-icon': true,
  6922. 'at-steps__single-icon--success': item.status === 'success',
  6923. 'at-steps__single-icon--error': item.status === 'error'
  6924. })
  6925. }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6926. className: 'at-steps__circular'
  6927. }, item.icon ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  6928. className: classnames('at-icon', (_a = {}, _a["at-icon-" + item.icon.value] = item.icon.value, _a['at-steps__circle-icon'] = true, _a))
  6929. }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  6930. className: 'at-steps__num'
  6931. }, i + 1)), i !== items.length - 1 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6932. className: 'at-steps__right-line'
  6933. })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6934. className: 'at-steps__title'
  6935. }, item.title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6936. className: 'at-steps__desc'
  6937. }, item.desc));
  6938. }));
  6939. };
  6940. return AtSteps;
  6941. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  6942. AtSteps.defaultProps = {
  6943. customStyle: '',
  6944. className: '',
  6945. current: 0,
  6946. items: [],
  6947. // eslint-disable-next-line @typescript-eslint/no-empty-function
  6948. onChange: function onChange() {}
  6949. };
  6950. AtSteps.propTypes = {
  6951. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  6952. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  6953. current: PropTypes.number,
  6954. items: PropTypes.array,
  6955. onChange: PropTypes.func
  6956. };
  6957. var AtCurtain = /** @class */function (_super) {
  6958. __extends(AtCurtain, _super);
  6959. function AtCurtain() {
  6960. return _super !== null && _super.apply(this, arguments) || this;
  6961. }
  6962. AtCurtain.prototype.onClose = function (e) {
  6963. e.stopPropagation();
  6964. this.props.onClose(e);
  6965. };
  6966. AtCurtain.prototype._stopPropagation = function (e) {
  6967. e.stopPropagation();
  6968. };
  6969. AtCurtain.prototype.render = function () {
  6970. var _a;
  6971. var _b = this.props,
  6972. className = _b.className,
  6973. customStyle = _b.customStyle,
  6974. isOpened = _b.isOpened,
  6975. closeBtnPosition = _b.closeBtnPosition;
  6976. var curtainClass = classnames({
  6977. 'at-curtain': true,
  6978. 'at-curtain--closed': !isOpened
  6979. }, className);
  6980. var btnCloseClass = classnames((_a = {
  6981. 'at-curtain__btn-close': true
  6982. }, _a["at-curtain__btn-close--" + closeBtnPosition] = closeBtnPosition, _a));
  6983. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6984. className: curtainClass,
  6985. style: customStyle,
  6986. onClick: this._stopPropagation
  6987. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6988. className: 'at-curtain__container'
  6989. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6990. className: 'at-curtain__body'
  6991. }, this.props.children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  6992. className: btnCloseClass,
  6993. onClick: this.onClose.bind(this)
  6994. }))));
  6995. };
  6996. return AtCurtain;
  6997. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  6998. AtCurtain.defaultProps = {
  6999. customStyle: '',
  7000. className: '',
  7001. isOpened: false,
  7002. closeBtnPosition: 'bottom',
  7003. // eslint-disable-next-line @typescript-eslint/no-empty-function
  7004. onClose: function onClose() {}
  7005. };
  7006. AtCurtain.propTypes = {
  7007. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  7008. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  7009. isOpened: PropTypes.bool,
  7010. closeBtnPosition: PropTypes.string,
  7011. onClose: PropTypes.func
  7012. };
  7013. var AtMessage = /** @class */function (_super) {
  7014. __extends(AtMessage, _super);
  7015. function AtMessage(props) {
  7016. var _this = _super.call(this, props) || this;
  7017. _this.state = {
  7018. _isOpened: false,
  7019. _message: '',
  7020. _type: 'info',
  7021. _duration: 3000
  7022. };
  7023. _this._timer = null;
  7024. return _this;
  7025. }
  7026. AtMessage.prototype.bindMessageListener = function () {
  7027. var _this = this;
  7028. _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().eventCenter.on('atMessage', function (options) {
  7029. if (options === void 0) {
  7030. options = {};
  7031. }
  7032. var message = options.message,
  7033. type = options.type,
  7034. duration = options.duration;
  7035. var newState = {
  7036. _isOpened: true,
  7037. _message: message,
  7038. _type: type,
  7039. _duration: duration || _this.state._duration
  7040. };
  7041. _this.setState(newState, function () {
  7042. clearTimeout(_this._timer);
  7043. _this._timer = setTimeout(function () {
  7044. _this.setState({
  7045. _isOpened: false
  7046. });
  7047. }, _this.state._duration);
  7048. });
  7049. });
  7050. // 绑定函数
  7051. (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().atMessage) = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().eventCenter.trigger.bind((_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().eventCenter), 'atMessage');
  7052. };
  7053. AtMessage.prototype.componentDidShow = function () {
  7054. this.bindMessageListener();
  7055. };
  7056. AtMessage.prototype.componentDidMount = function () {
  7057. this.bindMessageListener();
  7058. };
  7059. AtMessage.prototype.componentDidHide = function () {
  7060. _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().eventCenter.off('atMessage');
  7061. };
  7062. AtMessage.prototype.componentWillUnmount = function () {
  7063. _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().eventCenter.off('atMessage');
  7064. };
  7065. AtMessage.prototype.render = function () {
  7066. var _a = this.props,
  7067. className = _a.className,
  7068. customStyle = _a.customStyle;
  7069. var _b = this.state,
  7070. _message = _b._message,
  7071. _isOpened = _b._isOpened,
  7072. _type = _b._type;
  7073. var rootCls = classnames({
  7074. 'at-message': true,
  7075. 'at-message--show': _isOpened,
  7076. 'at-message--hidden': !_isOpened
  7077. }, "at-message--" + _type, className);
  7078. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7079. className: rootCls,
  7080. style: customStyle
  7081. }, _message);
  7082. };
  7083. return AtMessage;
  7084. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  7085. AtMessage.defaultProps = {
  7086. customStyle: '',
  7087. className: ''
  7088. };
  7089. AtMessage.propTypes = {
  7090. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  7091. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
  7092. };
  7093. // 生成 jsx 二维矩阵
  7094. var generateMatrix = function generateMatrix(files, col, showAddBtn) {
  7095. var matrix = [];
  7096. var length = showAddBtn ? files.length + 1 : files.length;
  7097. var row = Math.ceil(length / col);
  7098. for (var i = 0; i < row; i++) {
  7099. if (i === row - 1) {
  7100. // 最后一行数据加上添加按钮
  7101. var lastArr = files.slice(i * col);
  7102. if (lastArr.length < col) {
  7103. if (showAddBtn) {
  7104. lastArr.push({
  7105. type: 'btn',
  7106. uuid: uuid()
  7107. });
  7108. }
  7109. // 填补剩下的空列
  7110. for (var j = lastArr.length; j < col; j++) {
  7111. lastArr.push({
  7112. type: 'blank',
  7113. uuid: uuid()
  7114. });
  7115. }
  7116. }
  7117. matrix.push(lastArr);
  7118. } else {
  7119. matrix.push(files.slice(i * col, (i + 1) * col));
  7120. }
  7121. }
  7122. return matrix;
  7123. };
  7124. var ENV$1 = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv();
  7125. var AtImagePicker = /** @class */function (_super) {
  7126. __extends(AtImagePicker, _super);
  7127. function AtImagePicker() {
  7128. var _this = _super !== null && _super.apply(this, arguments) || this;
  7129. _this.chooseFile = function () {
  7130. var _a = _this.props,
  7131. _b = _a.files,
  7132. files = _b === void 0 ? [] : _b,
  7133. multiple = _a.multiple,
  7134. count = _a.count,
  7135. sizeType = _a.sizeType,
  7136. sourceType = _a.sourceType;
  7137. var filePathName = ENV$1 === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).ALIPAY ? 'apFilePaths' : 'tempFiles';
  7138. // const count = multiple ? 99 : 1
  7139. var params = {};
  7140. if (multiple) {
  7141. params.count = 99;
  7142. }
  7143. if (count) {
  7144. params.count = count;
  7145. }
  7146. if (sizeType) {
  7147. params.sizeType = sizeType;
  7148. }
  7149. if (sourceType) {
  7150. params.sourceType = sourceType;
  7151. }
  7152. _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().chooseImage(params).then(function (res) {
  7153. var targetFiles = res.tempFilePaths.map(function (path, i) {
  7154. return {
  7155. url: path,
  7156. file: res[filePathName][i]
  7157. };
  7158. });
  7159. var newFiles = files.concat(targetFiles);
  7160. _this.props.onChange(newFiles, 'add');
  7161. }).catch(function (err) {
  7162. var _a, _b;
  7163. (_b = (_a = _this.props) === null || _a === void 0 ? void 0 : _a.onFail) === null || _b === void 0 ? void 0 : _b.call(_a, err);
  7164. });
  7165. };
  7166. _this.handleImageClick = function (idx) {
  7167. _this.props.onImageClick && _this.props.onImageClick(idx, _this.props.files[idx]);
  7168. };
  7169. _this.handleRemoveImg = function (idx, event) {
  7170. event.stopPropagation();
  7171. event.preventDefault();
  7172. var _a = _this.props.files,
  7173. files = _a === void 0 ? [] : _a;
  7174. if (ENV$1 === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEB) {
  7175. window.URL.revokeObjectURL(files[idx].url);
  7176. }
  7177. var newFiles = files.filter(function (_, i) {
  7178. return i !== idx;
  7179. });
  7180. _this.props.onChange(newFiles, 'remove', idx);
  7181. };
  7182. return _this;
  7183. }
  7184. AtImagePicker.prototype.render = function () {
  7185. var _this = this;
  7186. var _a = this.props,
  7187. className = _a.className,
  7188. customStyle = _a.customStyle,
  7189. files = _a.files,
  7190. mode = _a.mode,
  7191. _b = _a.length,
  7192. length = _b === void 0 ? 4 : _b,
  7193. _c = _a.showAddBtn,
  7194. showAddBtn = _c === void 0 ? true : _c;
  7195. var rowLength = length <= 0 ? 1 : length;
  7196. // 行数
  7197. var matrix = generateMatrix(files, rowLength, showAddBtn);
  7198. var rootCls = classnames('at-image-picker', className);
  7199. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7200. className: rootCls,
  7201. style: customStyle
  7202. }, matrix.map(function (row, i) {
  7203. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7204. className: 'at-image-picker__flex-box',
  7205. key: i + 1
  7206. }, row.map(function (item, j) {
  7207. return item.url ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7208. className: 'at-image-picker__flex-item',
  7209. key: i * length + j
  7210. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7211. className: 'at-image-picker__item'
  7212. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7213. className: 'at-image-picker__remove-btn',
  7214. onClick: _this.handleRemoveImg.bind(_this, i * length + j)
  7215. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Image, {
  7216. className: 'at-image-picker__preview-img',
  7217. mode: mode,
  7218. src: item.url,
  7219. onClick: _this.handleImageClick.bind(_this, i * length + j)
  7220. }))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7221. className: 'at-image-picker__flex-item',
  7222. key: 'empty_' + i * length + j
  7223. }, item.type === 'btn' && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7224. className: 'at-image-picker__item at-image-picker__choose-btn',
  7225. onClick: _this.chooseFile
  7226. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7227. className: 'add-bar'
  7228. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7229. className: 'add-bar'
  7230. })));
  7231. }));
  7232. }));
  7233. };
  7234. return AtImagePicker;
  7235. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  7236. AtImagePicker.defaultProps = {
  7237. className: '',
  7238. customStyle: '',
  7239. files: [],
  7240. mode: 'aspectFill',
  7241. showAddBtn: true,
  7242. multiple: false,
  7243. length: 4,
  7244. // eslint-disable-next-line @typescript-eslint/no-empty-function
  7245. onChange: function onChange() {}
  7246. };
  7247. AtImagePicker.propTypes = {
  7248. className: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
  7249. customStyle: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
  7250. files: PropTypes.array,
  7251. mode: PropTypes.oneOf(['scaleToFill', 'aspectFit', 'aspectFill', 'widthFix', 'top', 'bottom', 'center', 'left', 'right', 'top left', 'top right', 'bottom left', 'bottom right']),
  7252. showAddBtn: PropTypes.bool,
  7253. multiple: PropTypes.bool,
  7254. length: PropTypes.number,
  7255. onChange: PropTypes.func,
  7256. onImageClick: PropTypes.func,
  7257. onFail: PropTypes.func,
  7258. count: PropTypes.number,
  7259. sizeType: PropTypes.array,
  7260. sourceType: PropTypes.array
  7261. };
  7262. var AtRange = /** @class */function (_super) {
  7263. __extends(AtRange, _super);
  7264. function AtRange(props) {
  7265. var _this = _super.call(this, props) || this;
  7266. _this.handleClick = function (event) {
  7267. if (_this.currentSlider && !_this.props.disabled) {
  7268. var sliderValue = 0;
  7269. var detail = getEventDetail(event);
  7270. sliderValue = detail.x - _this.left;
  7271. _this.setSliderValue(_this.currentSlider, sliderValue, 'onChange');
  7272. }
  7273. };
  7274. var _a = props.min,
  7275. min = _a === void 0 ? 0 : _a,
  7276. _b = props.max,
  7277. max = _b === void 0 ? 100 : _b;
  7278. // range 宽度
  7279. _this.width = 0;
  7280. // range 到屏幕左边的距离
  7281. _this.left = 0;
  7282. _this.deltaValue = max - min;
  7283. _this.currentSlider = '';
  7284. _this.state = {
  7285. aX: 0,
  7286. bX: 0
  7287. };
  7288. return _this;
  7289. }
  7290. AtRange.prototype.handleTouchMove = function (sliderName, event) {
  7291. if (this.props.disabled) return;
  7292. event.stopPropagation();
  7293. var clientX = event.touches[0].clientX;
  7294. this.setSliderValue(sliderName, clientX - this.left, 'onChange');
  7295. };
  7296. AtRange.prototype.handleTouchEnd = function (sliderName) {
  7297. if (this.props.disabled) return;
  7298. this.currentSlider = sliderName;
  7299. this.triggerEvent('onAfterChange');
  7300. };
  7301. AtRange.prototype.setSliderValue = function (sliderName, targetValue, funcName) {
  7302. var _a, _b;
  7303. var _this = this;
  7304. var distance = Math.min(Math.max(targetValue, 0), this.width);
  7305. var sliderValue = Math.floor(distance / this.width * 100);
  7306. if (funcName) {
  7307. this.setState((_a = {}, _a[sliderName] = sliderValue, _a), function () {
  7308. return _this.triggerEvent(funcName);
  7309. });
  7310. } else {
  7311. this.setState((_b = {}, _b[sliderName] = sliderValue, _b));
  7312. }
  7313. };
  7314. AtRange.prototype.setValue = function (value) {
  7315. var _a = this.props.min,
  7316. min = _a === void 0 ? 0 : _a;
  7317. var aX = Math.round((value[0] - min) / this.deltaValue * 100); // fix issue #670
  7318. var bX = Math.round((value[1] - min) / this.deltaValue * 100); // fix issue #670
  7319. this.setState({
  7320. aX: aX,
  7321. bX: bX
  7322. });
  7323. };
  7324. AtRange.prototype.triggerEvent = function (funcName) {
  7325. var _a = this.props.min,
  7326. min = _a === void 0 ? 0 : _a;
  7327. var _b = this.state,
  7328. aX = _b.aX,
  7329. bX = _b.bX;
  7330. var a = Math.round(aX / 100 * this.deltaValue) + min; // fix issue #670
  7331. var b = Math.round(bX / 100 * this.deltaValue) + min; // fix issue #670
  7332. var result = [a, b].sort(function (x, y) {
  7333. return x - y;
  7334. });
  7335. if (funcName === 'onChange') {
  7336. this.props.onChange && this.props.onChange(result);
  7337. } else if (funcName === 'onAfterChange') {
  7338. this.props.onAfterChange && this.props.onAfterChange(result);
  7339. }
  7340. };
  7341. AtRange.prototype.updatePos = function () {
  7342. var _this = this;
  7343. delayQuerySelector('.at-range__container', 0).then(function (rect) {
  7344. var _a, _b;
  7345. _this.width = Math.round((_a = rect[0]) === null || _a === void 0 ? void 0 : _a.width);
  7346. _this.left = Math.round((_b = rect[0]) === null || _b === void 0 ? void 0 : _b.left);
  7347. });
  7348. };
  7349. AtRange.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  7350. var value = nextProps.value;
  7351. this.updatePos();
  7352. if (this.props.value[0] !== value[0] || this.props.value[1] !== value[1]) {
  7353. this.setValue(value);
  7354. }
  7355. };
  7356. AtRange.prototype.componentDidMount = function () {
  7357. var value = this.props.value;
  7358. this.updatePos();
  7359. this.setValue(value);
  7360. };
  7361. AtRange.prototype.render = function () {
  7362. var _a = this.props,
  7363. className = _a.className,
  7364. customStyle = _a.customStyle,
  7365. sliderStyle = _a.sliderStyle,
  7366. railStyle = _a.railStyle,
  7367. trackStyle = _a.trackStyle,
  7368. blockSize = _a.blockSize,
  7369. disabled = _a.disabled;
  7370. var rootCls = classnames('at-range', {
  7371. 'at-range--disabled': disabled
  7372. }, className);
  7373. var _b = this.state,
  7374. aX = _b.aX,
  7375. bX = _b.bX;
  7376. var sliderCommonStyle = {
  7377. width: blockSize ? blockSize + "PX" : '',
  7378. height: blockSize ? blockSize + "PX" : '',
  7379. marginLeft: blockSize ? -blockSize / 2 + "PX" : ''
  7380. };
  7381. var sliderAStyle = _assign(_assign({}, sliderCommonStyle), {
  7382. left: aX + "%"
  7383. });
  7384. var sliderBStyle = _assign(_assign({}, sliderCommonStyle), {
  7385. left: bX + "%"
  7386. });
  7387. var containerStyle = {
  7388. height: blockSize ? blockSize + "PX" : ''
  7389. };
  7390. var smallerX = Math.min(aX, bX);
  7391. var deltaX = Math.abs(aX - bX);
  7392. var atTrackStyle = {
  7393. left: smallerX + "%",
  7394. width: deltaX + "%"
  7395. };
  7396. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7397. className: rootCls,
  7398. style: customStyle,
  7399. onClick: this.handleClick
  7400. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7401. className: 'at-range__container',
  7402. style: containerStyle
  7403. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7404. className: 'at-range__rail',
  7405. style: railStyle
  7406. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7407. className: 'at-range__track',
  7408. style: mergeStyle(atTrackStyle, trackStyle)
  7409. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7410. className: 'at-range__slider',
  7411. style: mergeStyle(sliderAStyle, sliderStyle),
  7412. onTouchMove: this.handleTouchMove.bind(this, 'aX'),
  7413. onTouchEnd: this.handleTouchEnd.bind(this, 'aX')
  7414. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7415. className: 'at-range__slider',
  7416. style: mergeStyle(sliderBStyle, sliderStyle),
  7417. onTouchMove: this.handleTouchMove.bind(this, 'bX'),
  7418. onTouchEnd: this.handleTouchEnd.bind(this, 'bX')
  7419. })));
  7420. };
  7421. return AtRange;
  7422. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  7423. AtRange.defaultProps = {
  7424. customStyle: '',
  7425. className: '',
  7426. sliderStyle: '',
  7427. railStyle: '',
  7428. trackStyle: '',
  7429. value: [0, 0],
  7430. min: 0,
  7431. max: 100,
  7432. disabled: false,
  7433. blockSize: 0
  7434. };
  7435. AtRange.propTypes = {
  7436. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  7437. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  7438. sliderStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  7439. railStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  7440. trackStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  7441. value: PropTypes.array,
  7442. min: PropTypes.number,
  7443. max: PropTypes.number,
  7444. disabled: PropTypes.bool,
  7445. blockSize: PropTypes.number,
  7446. onChange: PropTypes.func,
  7447. onAfterChange: PropTypes.func
  7448. };
  7449. var ENV = _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv();
  7450. var AtIndexes = /** @class */function (_super) {
  7451. __extends(AtIndexes, _super);
  7452. function AtIndexes(props) {
  7453. var _this = _super.call(this, props) || this;
  7454. _this.handleClick = function (item) {
  7455. _this.props.onClick && _this.props.onClick(item);
  7456. };
  7457. _this.handleTouchMove = function (event) {
  7458. event.stopPropagation();
  7459. event.preventDefault();
  7460. var list = _this.props.list;
  7461. var pageY = event.touches[0].pageY;
  7462. var index = Math.floor((pageY - _this.startTop) / _this.itemHeight);
  7463. if (index >= 0 && index <= list.length && _this.currentIndex !== index) {
  7464. _this.currentIndex = index;
  7465. var key = index > 0 ? list[index - 1].key : 'top';
  7466. var touchView = "at-indexes__list-" + key;
  7467. _this.jumpTarget(touchView, index);
  7468. }
  7469. };
  7470. _this.handleTouchEnd = function () {
  7471. _this.currentIndex = -1;
  7472. };
  7473. _this.state = {
  7474. _scrollIntoView: '',
  7475. _scrollTop: 0,
  7476. _tipText: '',
  7477. _isShowToast: false,
  7478. isWEB: _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().getEnv() === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEB
  7479. };
  7480. // 右侧导航高度
  7481. _this.menuHeight = 0;
  7482. // 右侧导航距离顶部高度
  7483. _this.startTop = 0;
  7484. // 右侧导航元素高度
  7485. _this.itemHeight = 0;
  7486. // 当前索引
  7487. _this.currentIndex = -1;
  7488. _this.listId = isTest() ? 'indexes-list-AOTU2018' : "list-" + uuid();
  7489. return _this;
  7490. }
  7491. AtIndexes.prototype.jumpTarget = function (_scrollIntoView, idx) {
  7492. var _this = this;
  7493. var _a = this.props,
  7494. _b = _a.topKey,
  7495. topKey = _b === void 0 ? 'Top' : _b,
  7496. list = _a.list;
  7497. var _tipText = idx === 0 ? topKey : list[idx - 1].key;
  7498. if (ENV === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEB) {
  7499. delayQuerySelector('.at-indexes', 0).then(function (rect) {
  7500. var targetOffsetTop = _this.listRef.children[idx].offsetTop;
  7501. var _scrollTop = targetOffsetTop - rect[0].top;
  7502. _this.updateState({
  7503. _scrollTop: _scrollTop,
  7504. _scrollIntoView: _scrollIntoView,
  7505. _tipText: _tipText
  7506. });
  7507. });
  7508. return;
  7509. }
  7510. this.updateState({
  7511. _scrollIntoView: _scrollIntoView,
  7512. _tipText: _tipText
  7513. });
  7514. };
  7515. AtIndexes.prototype.__jumpTarget = function (key) {
  7516. var list = this.props.list;
  7517. // const index = _findIndex(list, ['key', key])
  7518. var index = list.findIndex(function (item) {
  7519. return item.key === key;
  7520. });
  7521. var targetView = "at-indexes__list-" + key;
  7522. this.jumpTarget(targetView, index + 1);
  7523. };
  7524. AtIndexes.prototype.updateState = function (state) {
  7525. var _this = this;
  7526. var _a = this.props,
  7527. isShowToast = _a.isShowToast,
  7528. isVibrate = _a.isVibrate;
  7529. var _scrollIntoView = state._scrollIntoView,
  7530. _tipText = state._tipText,
  7531. _scrollTop = state._scrollTop;
  7532. // TODO: Fix dirty hack
  7533. /* eslint-disable @typescript-eslint/no-non-null-assertion */
  7534. this.setState({
  7535. _scrollIntoView: _scrollIntoView,
  7536. _tipText: _tipText,
  7537. _scrollTop: _scrollTop,
  7538. _isShowToast: isShowToast
  7539. }, /* eslint-enable @typescript-eslint/no-non-null-assertion */
  7540. function () {
  7541. clearTimeout(_this.timeoutTimer);
  7542. _this.timeoutTimer = setTimeout(function () {
  7543. _this.setState({
  7544. _tipText: '',
  7545. _isShowToast: false
  7546. });
  7547. }, 3000);
  7548. });
  7549. if (isVibrate) {
  7550. _tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().vibrateShort();
  7551. }
  7552. };
  7553. AtIndexes.prototype.initData = function () {
  7554. var _this = this;
  7555. delayQuerySelector('.at-indexes__menu').then(function (rect) {
  7556. var len = _this.props.list.length;
  7557. _this.menuHeight = rect[0].height;
  7558. _this.startTop = rect[0].top;
  7559. _this.itemHeight = Math.floor(_this.menuHeight / (len + 1));
  7560. });
  7561. };
  7562. AtIndexes.prototype.handleScroll = function (e) {
  7563. if (e && e.detail) {
  7564. this.setState({
  7565. _scrollTop: e.detail.scrollTop
  7566. });
  7567. }
  7568. };
  7569. AtIndexes.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  7570. if (nextProps.list.length !== this.props.list.length) {
  7571. this.initData();
  7572. }
  7573. };
  7574. AtIndexes.prototype.componentDidMount = function () {
  7575. if (ENV === (_tarojs_taro__WEBPACK_IMPORTED_MODULE_1___default().ENV_TYPE).WEB) {
  7576. this.listRef = document.getElementById(this.listId);
  7577. }
  7578. this.initData();
  7579. };
  7580. AtIndexes.prototype.UNSAFE_componentWillMount = function () {
  7581. this.props.onScrollIntoView && this.props.onScrollIntoView(this.__jumpTarget.bind(this));
  7582. };
  7583. AtIndexes.prototype.render = function () {
  7584. var _this = this;
  7585. var _a = this.props,
  7586. className = _a.className,
  7587. customStyle = _a.customStyle,
  7588. animation = _a.animation,
  7589. topKey = _a.topKey,
  7590. list = _a.list;
  7591. var _b = this.state,
  7592. _scrollTop = _b._scrollTop,
  7593. _scrollIntoView = _b._scrollIntoView,
  7594. _tipText = _b._tipText,
  7595. _isShowToast = _b._isShowToast,
  7596. isWEB = _b.isWEB;
  7597. var toastStyle = {
  7598. minWidth: pxTransform(100)
  7599. };
  7600. var rootCls = classnames('at-indexes', className);
  7601. var menuList = list.map(function (dataList, i) {
  7602. var key = dataList.key;
  7603. var targetView = "at-indexes__list-" + key;
  7604. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7605. className: 'at-indexes__menu-item',
  7606. key: key,
  7607. onClick: _this.jumpTarget.bind(_this, targetView, i + 1)
  7608. }, key);
  7609. });
  7610. var indexesList = list.map(function (dataList) {
  7611. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7612. id: "at-indexes__list-" + dataList.key,
  7613. className: 'at-indexes__list',
  7614. key: dataList.key
  7615. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7616. className: 'at-indexes__list-title'
  7617. }, dataList.title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtList, null, dataList.items && dataList.items.map(function (item) {
  7618. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtListItem, {
  7619. key: item.name,
  7620. title: item.name,
  7621. onClick: _this.handleClick.bind(_this, item)
  7622. });
  7623. })));
  7624. });
  7625. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7626. className: rootCls,
  7627. style: customStyle
  7628. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtToast, {
  7629. customStyle: toastStyle,
  7630. isOpened: _isShowToast,
  7631. text: _tipText,
  7632. duration: 2000
  7633. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7634. className: 'at-indexes__menu',
  7635. onTouchMove: this.handleTouchMove,
  7636. onTouchEnd: this.handleTouchEnd
  7637. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7638. className: 'at-indexes__menu-item',
  7639. onClick: this.jumpTarget.bind(this, 'at-indexes__top', 0)
  7640. }, topKey), menuList), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.ScrollView, {
  7641. className: 'at-indexes__body',
  7642. id: this.listId,
  7643. scrollY: true,
  7644. scrollWithAnimation: animation,
  7645. // eslint-disable-next-line no-undefined
  7646. scrollTop: isWEB ? _scrollTop : undefined,
  7647. scrollIntoView: !isWEB ? _scrollIntoView : '',
  7648. onScroll: this.handleScroll.bind(this)
  7649. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  7650. className: 'at-indexes__content',
  7651. id: 'at-indexes__top'
  7652. }, this.props.children), indexesList));
  7653. };
  7654. return AtIndexes;
  7655. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  7656. AtIndexes.propTypes = {
  7657. customStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
  7658. className: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
  7659. animation: PropTypes.bool,
  7660. isVibrate: PropTypes.bool,
  7661. isShowToast: PropTypes.bool,
  7662. topKey: PropTypes.string,
  7663. list: PropTypes.array,
  7664. onClick: PropTypes.func,
  7665. onScrollIntoView: PropTypes.func
  7666. };
  7667. AtIndexes.defaultProps = {
  7668. customStyle: '',
  7669. className: '',
  7670. animation: false,
  7671. topKey: 'Top',
  7672. isVibrate: true,
  7673. isShowToast: true,
  7674. list: []
  7675. };
  7676. var dayjs_min = createCommonjsModule(function (module, exports) {
  7677. !function (t, e) {
  7678. module.exports = e();
  7679. }(commonjsGlobal, function () {
  7680. var t = 1e3,
  7681. e = 6e4,
  7682. n = 36e5,
  7683. r = "millisecond",
  7684. i = "second",
  7685. s = "minute",
  7686. u = "hour",
  7687. a = "day",
  7688. o = "week",
  7689. f = "month",
  7690. h = "quarter",
  7691. c = "year",
  7692. d = "date",
  7693. l = "Invalid Date",
  7694. $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
  7695. y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
  7696. M = {
  7697. name: "en",
  7698. weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
  7699. months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
  7700. ordinal: function ordinal(t) {
  7701. var e = ["th", "st", "nd", "rd"],
  7702. n = t % 100;
  7703. return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]";
  7704. }
  7705. },
  7706. m = function m(t, e, n) {
  7707. var r = String(t);
  7708. return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
  7709. },
  7710. v = {
  7711. s: m,
  7712. z: function z(t) {
  7713. var e = -t.utcOffset(),
  7714. n = Math.abs(e),
  7715. r = Math.floor(n / 60),
  7716. i = n % 60;
  7717. return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
  7718. },
  7719. m: function t(e, n) {
  7720. if (e.date() < n.date()) return -t(n, e);
  7721. var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
  7722. i = e.clone().add(r, f),
  7723. s = n - i < 0,
  7724. u = e.clone().add(r + (s ? -1 : 1), f);
  7725. return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
  7726. },
  7727. a: function a(t) {
  7728. return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
  7729. },
  7730. p: function p(t) {
  7731. return {
  7732. M: f,
  7733. y: c,
  7734. w: o,
  7735. d: a,
  7736. D: d,
  7737. h: u,
  7738. m: s,
  7739. s: i,
  7740. ms: r,
  7741. Q: h
  7742. }[t] || String(t || "").toLowerCase().replace(/s$/, "");
  7743. },
  7744. u: function u(t) {
  7745. return void 0 === t;
  7746. }
  7747. },
  7748. g = "en",
  7749. D = {};
  7750. D[g] = M;
  7751. var p = function p(t) {
  7752. return t instanceof _;
  7753. },
  7754. S = function t(e, n, r) {
  7755. var i;
  7756. if (!e) return g;
  7757. if ("string" == typeof e) {
  7758. var s = e.toLowerCase();
  7759. D[s] && (i = s), n && (D[s] = n, i = s);
  7760. var u = e.split("-");
  7761. if (!i && u.length > 1) return t(u[0]);
  7762. } else {
  7763. var a = e.name;
  7764. D[a] = e, i = a;
  7765. }
  7766. return !r && i && (g = i), i || !r && g;
  7767. },
  7768. w = function w(t, e) {
  7769. if (p(t)) return t.clone();
  7770. var n = "object" == (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(e) ? e : {};
  7771. return n.date = t, n.args = arguments, new _(n);
  7772. },
  7773. O = v;
  7774. O.l = S, O.i = p, O.w = function (t, e) {
  7775. return w(t, {
  7776. locale: e.$L,
  7777. utc: e.$u,
  7778. x: e.$x,
  7779. $offset: e.$offset
  7780. });
  7781. };
  7782. var _ = function () {
  7783. function M(t) {
  7784. this.$L = S(t.locale, null, !0), this.parse(t);
  7785. }
  7786. var m = M.prototype;
  7787. return m.parse = function (t) {
  7788. this.$d = function (t) {
  7789. var e = t.date,
  7790. n = t.utc;
  7791. if (null === e) return new Date(NaN);
  7792. if (O.u(e)) return new Date();
  7793. if (e instanceof Date) return new Date(e);
  7794. if ("string" == typeof e && !/Z$/i.test(e)) {
  7795. var r = e.match($);
  7796. if (r) {
  7797. var i = r[2] - 1 || 0,
  7798. s = (r[7] || "0").substring(0, 3);
  7799. return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
  7800. }
  7801. }
  7802. return new Date(e);
  7803. }(t), this.$x = t.x || {}, this.init();
  7804. }, m.init = function () {
  7805. var t = this.$d;
  7806. this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
  7807. }, m.$utils = function () {
  7808. return O;
  7809. }, m.isValid = function () {
  7810. return !(this.$d.toString() === l);
  7811. }, m.isSame = function (t, e) {
  7812. var n = w(t);
  7813. return this.startOf(e) <= n && n <= this.endOf(e);
  7814. }, m.isAfter = function (t, e) {
  7815. return w(t) < this.startOf(e);
  7816. }, m.isBefore = function (t, e) {
  7817. return this.endOf(e) < w(t);
  7818. }, m.$g = function (t, e, n) {
  7819. return O.u(t) ? this[e] : this.set(n, t);
  7820. }, m.unix = function () {
  7821. return Math.floor(this.valueOf() / 1e3);
  7822. }, m.valueOf = function () {
  7823. return this.$d.getTime();
  7824. }, m.startOf = function (t, e) {
  7825. var n = this,
  7826. r = !!O.u(e) || e,
  7827. h = O.p(t),
  7828. l = function l(t, e) {
  7829. var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
  7830. return r ? i : i.endOf(a);
  7831. },
  7832. $ = function $(t, e) {
  7833. return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
  7834. },
  7835. y = this.$W,
  7836. M = this.$M,
  7837. m = this.$D,
  7838. v = "set" + (this.$u ? "UTC" : "");
  7839. switch (h) {
  7840. case c:
  7841. return r ? l(1, 0) : l(31, 11);
  7842. case f:
  7843. return r ? l(1, M) : l(0, M + 1);
  7844. case o:
  7845. var g = this.$locale().weekStart || 0,
  7846. D = (y < g ? y + 7 : y) - g;
  7847. return l(r ? m - D : m + (6 - D), M);
  7848. case a:
  7849. case d:
  7850. return $(v + "Hours", 0);
  7851. case u:
  7852. return $(v + "Minutes", 1);
  7853. case s:
  7854. return $(v + "Seconds", 2);
  7855. case i:
  7856. return $(v + "Milliseconds", 3);
  7857. default:
  7858. return this.clone();
  7859. }
  7860. }, m.endOf = function (t) {
  7861. return this.startOf(t, !1);
  7862. }, m.$set = function (t, e) {
  7863. var n,
  7864. o = O.p(t),
  7865. h = "set" + (this.$u ? "UTC" : ""),
  7866. l = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o],
  7867. $ = o === a ? this.$D + (e - this.$W) : e;
  7868. if (o === f || o === c) {
  7869. var y = this.clone().set(d, 1);
  7870. y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
  7871. } else l && this.$d[l]($);
  7872. return this.init(), this;
  7873. }, m.set = function (t, e) {
  7874. return this.clone().$set(t, e);
  7875. }, m.get = function (t) {
  7876. return this[O.p(t)]();
  7877. }, m.add = function (r, h) {
  7878. var d,
  7879. l = this;
  7880. r = Number(r);
  7881. var $ = O.p(h),
  7882. y = function y(t) {
  7883. var e = w(l);
  7884. return O.w(e.date(e.date() + Math.round(t * r)), l);
  7885. };
  7886. if ($ === f) return this.set(f, this.$M + r);
  7887. if ($ === c) return this.set(c, this.$y + r);
  7888. if ($ === a) return y(1);
  7889. if ($ === o) return y(7);
  7890. var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1,
  7891. m = this.$d.getTime() + r * M;
  7892. return O.w(m, this);
  7893. }, m.subtract = function (t, e) {
  7894. return this.add(-1 * t, e);
  7895. }, m.format = function (t) {
  7896. var e = this,
  7897. n = this.$locale();
  7898. if (!this.isValid()) return n.invalidDate || l;
  7899. var r = t || "YYYY-MM-DDTHH:mm:ssZ",
  7900. i = O.z(this),
  7901. s = this.$H,
  7902. u = this.$m,
  7903. a = this.$M,
  7904. o = n.weekdays,
  7905. f = n.months,
  7906. h = function h(t, n, i, s) {
  7907. return t && (t[n] || t(e, r)) || i[n].slice(0, s);
  7908. },
  7909. c = function c(t) {
  7910. return O.s(s % 12 || 12, t, "0");
  7911. },
  7912. d = n.meridiem || function (t, e, n) {
  7913. var r = t < 12 ? "AM" : "PM";
  7914. return n ? r.toLowerCase() : r;
  7915. },
  7916. $ = {
  7917. YY: String(this.$y).slice(-2),
  7918. YYYY: this.$y,
  7919. M: a + 1,
  7920. MM: O.s(a + 1, 2, "0"),
  7921. MMM: h(n.monthsShort, a, f, 3),
  7922. MMMM: h(f, a),
  7923. D: this.$D,
  7924. DD: O.s(this.$D, 2, "0"),
  7925. d: String(this.$W),
  7926. dd: h(n.weekdaysMin, this.$W, o, 2),
  7927. ddd: h(n.weekdaysShort, this.$W, o, 3),
  7928. dddd: o[this.$W],
  7929. H: String(s),
  7930. HH: O.s(s, 2, "0"),
  7931. h: c(1),
  7932. hh: c(2),
  7933. a: d(s, u, !0),
  7934. A: d(s, u, !1),
  7935. m: String(u),
  7936. mm: O.s(u, 2, "0"),
  7937. s: String(this.$s),
  7938. ss: O.s(this.$s, 2, "0"),
  7939. SSS: O.s(this.$ms, 3, "0"),
  7940. Z: i
  7941. };
  7942. return r.replace(y, function (t, e) {
  7943. return e || $[t] || i.replace(":", "");
  7944. });
  7945. }, m.utcOffset = function () {
  7946. return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
  7947. }, m.diff = function (r, d, l) {
  7948. var $,
  7949. y = O.p(d),
  7950. M = w(r),
  7951. m = (M.utcOffset() - this.utcOffset()) * e,
  7952. v = this - M,
  7953. g = O.m(this, M);
  7954. return g = ($ = {}, $[c] = g / 12, $[f] = g, $[h] = g / 3, $[o] = (v - m) / 6048e5, $[a] = (v - m) / 864e5, $[u] = v / n, $[s] = v / e, $[i] = v / t, $)[y] || v, l ? g : O.a(g);
  7955. }, m.daysInMonth = function () {
  7956. return this.endOf(f).$D;
  7957. }, m.$locale = function () {
  7958. return D[this.$L];
  7959. }, m.locale = function (t, e) {
  7960. if (!t) return this.$L;
  7961. var n = this.clone(),
  7962. r = S(t, e, !0);
  7963. return r && (n.$L = r), n;
  7964. }, m.clone = function () {
  7965. return O.w(this.$d, this);
  7966. }, m.toDate = function () {
  7967. return new Date(this.valueOf());
  7968. }, m.toJSON = function () {
  7969. return this.isValid() ? this.toISOString() : null;
  7970. }, m.toISOString = function () {
  7971. return this.$d.toISOString();
  7972. }, m.toString = function () {
  7973. return this.$d.toUTCString();
  7974. }, M;
  7975. }(),
  7976. T = _.prototype;
  7977. return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
  7978. T[t[1]] = function (e) {
  7979. return this.$g(e, t[0], t[1]);
  7980. };
  7981. }), w.extend = function (t, e) {
  7982. return t.$i || (t(e, _, w), t.$i = !0), w;
  7983. }, w.locale = S, w.isDayjs = p, w.unix = function (t) {
  7984. return w(1e3 * t);
  7985. }, w.en = D[g], w.Ls = D, w.p = {}, w;
  7986. });
  7987. });
  7988. /** Built-in value references. */
  7989. var objectCreate = Object.create;
  7990. /**
  7991. * The base implementation of `_.create` without support for assigning
  7992. * properties to the created object.
  7993. *
  7994. * @private
  7995. * @param {Object} proto The object to inherit from.
  7996. * @returns {Object} Returns the new object.
  7997. */
  7998. var baseCreate = function () {
  7999. function object() {}
  8000. return function (proto) {
  8001. if (!isObject_1(proto)) {
  8002. return {};
  8003. }
  8004. if (objectCreate) {
  8005. return objectCreate(proto);
  8006. }
  8007. object.prototype = proto;
  8008. var result = new object();
  8009. object.prototype = undefined;
  8010. return result;
  8011. };
  8012. }();
  8013. var _baseCreate = baseCreate;
  8014. /**
  8015. * The function whose prototype chain sequence wrappers inherit from.
  8016. *
  8017. * @private
  8018. */
  8019. function baseLodash() {
  8020. // No operation performed.
  8021. }
  8022. var _baseLodash = baseLodash;
  8023. /**
  8024. * The base constructor for creating `lodash` wrapper objects.
  8025. *
  8026. * @private
  8027. * @param {*} value The value to wrap.
  8028. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  8029. */
  8030. function LodashWrapper(value, chainAll) {
  8031. this.__wrapped__ = value;
  8032. this.__actions__ = [];
  8033. this.__chain__ = !!chainAll;
  8034. this.__index__ = 0;
  8035. this.__values__ = undefined;
  8036. }
  8037. LodashWrapper.prototype = _baseCreate(_baseLodash.prototype);
  8038. LodashWrapper.prototype.constructor = LodashWrapper;
  8039. var _LodashWrapper = LodashWrapper;
  8040. /**
  8041. * Appends the elements of `values` to `array`.
  8042. *
  8043. * @private
  8044. * @param {Array} array The array to modify.
  8045. * @param {Array} values The values to append.
  8046. * @returns {Array} Returns `array`.
  8047. */
  8048. function arrayPush(array, values) {
  8049. var index = -1,
  8050. length = values.length,
  8051. offset = array.length;
  8052. while (++index < length) {
  8053. array[offset + index] = values[index];
  8054. }
  8055. return array;
  8056. }
  8057. var _arrayPush = arrayPush;
  8058. /** `Object#toString` result references. */
  8059. var argsTag$1 = '[object Arguments]';
  8060. /**
  8061. * The base implementation of `_.isArguments`.
  8062. *
  8063. * @private
  8064. * @param {*} value The value to check.
  8065. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  8066. */
  8067. function baseIsArguments(value) {
  8068. return isObjectLike_1(value) && _baseGetTag(value) == argsTag$1;
  8069. }
  8070. var _baseIsArguments = baseIsArguments;
  8071. /** Used for built-in method references. */
  8072. var objectProto$6 = Object.prototype;
  8073. /** Used to check objects for own properties. */
  8074. var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
  8075. /** Built-in value references. */
  8076. var propertyIsEnumerable = objectProto$6.propertyIsEnumerable;
  8077. /**
  8078. * Checks if `value` is likely an `arguments` object.
  8079. *
  8080. * @static
  8081. * @memberOf _
  8082. * @since 0.1.0
  8083. * @category Lang
  8084. * @param {*} value The value to check.
  8085. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  8086. * else `false`.
  8087. * @example
  8088. *
  8089. * _.isArguments(function() { return arguments; }());
  8090. * // => true
  8091. *
  8092. * _.isArguments([1, 2, 3]);
  8093. * // => false
  8094. */
  8095. var isArguments = _baseIsArguments(function () {
  8096. return arguments;
  8097. }()) ? _baseIsArguments : function (value) {
  8098. return isObjectLike_1(value) && hasOwnProperty$5.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
  8099. };
  8100. var isArguments_1 = isArguments;
  8101. /** Built-in value references. */
  8102. var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
  8103. /**
  8104. * Checks if `value` is a flattenable `arguments` object or array.
  8105. *
  8106. * @private
  8107. * @param {*} value The value to check.
  8108. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  8109. */
  8110. function isFlattenable(value) {
  8111. return isArray_1(value) || isArguments_1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
  8112. }
  8113. var _isFlattenable = isFlattenable;
  8114. /**
  8115. * The base implementation of `_.flatten` with support for restricting flattening.
  8116. *
  8117. * @private
  8118. * @param {Array} array The array to flatten.
  8119. * @param {number} depth The maximum recursion depth.
  8120. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  8121. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  8122. * @param {Array} [result=[]] The initial result value.
  8123. * @returns {Array} Returns the new flattened array.
  8124. */
  8125. function baseFlatten(array, depth, predicate, isStrict, result) {
  8126. var index = -1,
  8127. length = array.length;
  8128. predicate || (predicate = _isFlattenable);
  8129. result || (result = []);
  8130. while (++index < length) {
  8131. var value = array[index];
  8132. if (depth > 0 && predicate(value)) {
  8133. if (depth > 1) {
  8134. // Recursively flatten arrays (susceptible to call stack limits).
  8135. baseFlatten(value, depth - 1, predicate, isStrict, result);
  8136. } else {
  8137. _arrayPush(result, value);
  8138. }
  8139. } else if (!isStrict) {
  8140. result[result.length] = value;
  8141. }
  8142. }
  8143. return result;
  8144. }
  8145. var _baseFlatten = baseFlatten;
  8146. /**
  8147. * Flattens `array` a single level deep.
  8148. *
  8149. * @static
  8150. * @memberOf _
  8151. * @since 0.1.0
  8152. * @category Array
  8153. * @param {Array} array The array to flatten.
  8154. * @returns {Array} Returns the new flattened array.
  8155. * @example
  8156. *
  8157. * _.flatten([1, [2, [3, [4]], 5]]);
  8158. * // => [1, 2, [3, [4]], 5]
  8159. */
  8160. function flatten(array) {
  8161. var length = array == null ? 0 : array.length;
  8162. return length ? _baseFlatten(array, 1) : [];
  8163. }
  8164. var flatten_1 = flatten;
  8165. /**
  8166. * A faster alternative to `Function#apply`, this function invokes `func`
  8167. * with the `this` binding of `thisArg` and the arguments of `args`.
  8168. *
  8169. * @private
  8170. * @param {Function} func The function to invoke.
  8171. * @param {*} thisArg The `this` binding of `func`.
  8172. * @param {Array} args The arguments to invoke `func` with.
  8173. * @returns {*} Returns the result of `func`.
  8174. */
  8175. function apply(func, thisArg, args) {
  8176. switch (args.length) {
  8177. case 0:
  8178. return func.call(thisArg);
  8179. case 1:
  8180. return func.call(thisArg, args[0]);
  8181. case 2:
  8182. return func.call(thisArg, args[0], args[1]);
  8183. case 3:
  8184. return func.call(thisArg, args[0], args[1], args[2]);
  8185. }
  8186. return func.apply(thisArg, args);
  8187. }
  8188. var _apply = apply;
  8189. /* Built-in method references for those with the same name as other `lodash` methods. */
  8190. var nativeMax = Math.max;
  8191. /**
  8192. * A specialized version of `baseRest` which transforms the rest array.
  8193. *
  8194. * @private
  8195. * @param {Function} func The function to apply a rest parameter to.
  8196. * @param {number} [start=func.length-1] The start position of the rest parameter.
  8197. * @param {Function} transform The rest array transform.
  8198. * @returns {Function} Returns the new function.
  8199. */
  8200. function overRest(func, start, transform) {
  8201. start = nativeMax(start === undefined ? func.length - 1 : start, 0);
  8202. return function () {
  8203. var args = arguments,
  8204. index = -1,
  8205. length = nativeMax(args.length - start, 0),
  8206. array = Array(length);
  8207. while (++index < length) {
  8208. array[index] = args[start + index];
  8209. }
  8210. index = -1;
  8211. var otherArgs = Array(start + 1);
  8212. while (++index < start) {
  8213. otherArgs[index] = args[index];
  8214. }
  8215. otherArgs[start] = transform(array);
  8216. return _apply(func, this, otherArgs);
  8217. };
  8218. }
  8219. var _overRest = overRest;
  8220. /**
  8221. * Creates a function that returns `value`.
  8222. *
  8223. * @static
  8224. * @memberOf _
  8225. * @since 2.4.0
  8226. * @category Util
  8227. * @param {*} value The value to return from the new function.
  8228. * @returns {Function} Returns the new constant function.
  8229. * @example
  8230. *
  8231. * var objects = _.times(2, _.constant({ 'a': 1 }));
  8232. *
  8233. * console.log(objects);
  8234. * // => [{ 'a': 1 }, { 'a': 1 }]
  8235. *
  8236. * console.log(objects[0] === objects[1]);
  8237. * // => true
  8238. */
  8239. function constant(value) {
  8240. return function () {
  8241. return value;
  8242. };
  8243. }
  8244. var constant_1 = constant;
  8245. /** Used to detect overreaching core-js shims. */
  8246. var coreJsData = _root['__core-js_shared__'];
  8247. var _coreJsData = coreJsData;
  8248. /** Used to detect methods masquerading as native. */
  8249. var maskSrcKey = function () {
  8250. var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
  8251. return uid ? 'Symbol(src)_1.' + uid : '';
  8252. }();
  8253. /**
  8254. * Checks if `func` has its source masked.
  8255. *
  8256. * @private
  8257. * @param {Function} func The function to check.
  8258. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  8259. */
  8260. function isMasked(func) {
  8261. return !!maskSrcKey && maskSrcKey in func;
  8262. }
  8263. var _isMasked = isMasked;
  8264. /** Used for built-in method references. */
  8265. var funcProto$1 = Function.prototype;
  8266. /** Used to resolve the decompiled source of functions. */
  8267. var funcToString$1 = funcProto$1.toString;
  8268. /**
  8269. * Converts `func` to its source code.
  8270. *
  8271. * @private
  8272. * @param {Function} func The function to convert.
  8273. * @returns {string} Returns the source code.
  8274. */
  8275. function toSource(func) {
  8276. if (func != null) {
  8277. try {
  8278. return funcToString$1.call(func);
  8279. } catch (e) {}
  8280. try {
  8281. return func + '';
  8282. } catch (e) {}
  8283. }
  8284. return '';
  8285. }
  8286. var _toSource = toSource;
  8287. /**
  8288. * Used to match `RegExp`
  8289. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  8290. */
  8291. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  8292. /** Used to detect host constructors (Safari). */
  8293. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  8294. /** Used for built-in method references. */
  8295. var funcProto = Function.prototype,
  8296. objectProto$5 = Object.prototype;
  8297. /** Used to resolve the decompiled source of functions. */
  8298. var funcToString = funcProto.toString;
  8299. /** Used to check objects for own properties. */
  8300. var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
  8301. /** Used to detect if a method is native. */
  8302. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty$4).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  8303. /**
  8304. * The base implementation of `_.isNative` without bad shim checks.
  8305. *
  8306. * @private
  8307. * @param {*} value The value to check.
  8308. * @returns {boolean} Returns `true` if `value` is a native function,
  8309. * else `false`.
  8310. */
  8311. function baseIsNative(value) {
  8312. if (!isObject_1(value) || _isMasked(value)) {
  8313. return false;
  8314. }
  8315. var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
  8316. return pattern.test(_toSource(value));
  8317. }
  8318. var _baseIsNative = baseIsNative;
  8319. /**
  8320. * Gets the value at `key` of `object`.
  8321. *
  8322. * @private
  8323. * @param {Object} [object] The object to query.
  8324. * @param {string} key The key of the property to get.
  8325. * @returns {*} Returns the property value.
  8326. */
  8327. function getValue(object, key) {
  8328. return object == null ? undefined : object[key];
  8329. }
  8330. var _getValue = getValue;
  8331. /**
  8332. * Gets the native function at `key` of `object`.
  8333. *
  8334. * @private
  8335. * @param {Object} object The object to query.
  8336. * @param {string} key The key of the method to get.
  8337. * @returns {*} Returns the function if it's native, else `undefined`.
  8338. */
  8339. function getNative(object, key) {
  8340. var value = _getValue(object, key);
  8341. return _baseIsNative(value) ? value : undefined;
  8342. }
  8343. var _getNative = getNative;
  8344. var defineProperty = function () {
  8345. try {
  8346. var func = _getNative(Object, 'defineProperty');
  8347. func({}, '', {});
  8348. return func;
  8349. } catch (e) {}
  8350. }();
  8351. var _defineProperty = defineProperty;
  8352. /**
  8353. * This method returns the first argument it receives.
  8354. *
  8355. * @static
  8356. * @since 0.1.0
  8357. * @memberOf _
  8358. * @category Util
  8359. * @param {*} value Any value.
  8360. * @returns {*} Returns `value`.
  8361. * @example
  8362. *
  8363. * var object = { 'a': 1 };
  8364. *
  8365. * console.log(_.identity(object) === object);
  8366. * // => true
  8367. */
  8368. function identity(value) {
  8369. return value;
  8370. }
  8371. var identity_1 = identity;
  8372. /**
  8373. * The base implementation of `setToString` without support for hot loop shorting.
  8374. *
  8375. * @private
  8376. * @param {Function} func The function to modify.
  8377. * @param {Function} string The `toString` result.
  8378. * @returns {Function} Returns `func`.
  8379. */
  8380. var baseSetToString = !_defineProperty ? identity_1 : function (func, string) {
  8381. return _defineProperty(func, 'toString', {
  8382. 'configurable': true,
  8383. 'enumerable': false,
  8384. 'value': constant_1(string),
  8385. 'writable': true
  8386. });
  8387. };
  8388. var _baseSetToString = baseSetToString;
  8389. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  8390. var HOT_COUNT = 800,
  8391. HOT_SPAN = 16;
  8392. /* Built-in method references for those with the same name as other `lodash` methods. */
  8393. var nativeNow = Date.now;
  8394. /**
  8395. * Creates a function that'll short out and invoke `identity` instead
  8396. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  8397. * milliseconds.
  8398. *
  8399. * @private
  8400. * @param {Function} func The function to restrict.
  8401. * @returns {Function} Returns the new shortable function.
  8402. */
  8403. function shortOut(func) {
  8404. var count = 0,
  8405. lastCalled = 0;
  8406. return function () {
  8407. var stamp = nativeNow(),
  8408. remaining = HOT_SPAN - (stamp - lastCalled);
  8409. lastCalled = stamp;
  8410. if (remaining > 0) {
  8411. if (++count >= HOT_COUNT) {
  8412. return arguments[0];
  8413. }
  8414. } else {
  8415. count = 0;
  8416. }
  8417. return func.apply(undefined, arguments);
  8418. };
  8419. }
  8420. var _shortOut = shortOut;
  8421. /**
  8422. * Sets the `toString` method of `func` to return `string`.
  8423. *
  8424. * @private
  8425. * @param {Function} func The function to modify.
  8426. * @param {Function} string The `toString` result.
  8427. * @returns {Function} Returns `func`.
  8428. */
  8429. var setToString = _shortOut(_baseSetToString);
  8430. var _setToString = setToString;
  8431. /**
  8432. * A specialized version of `baseRest` which flattens the rest array.
  8433. *
  8434. * @private
  8435. * @param {Function} func The function to apply a rest parameter to.
  8436. * @returns {Function} Returns the new function.
  8437. */
  8438. function flatRest(func) {
  8439. return _setToString(_overRest(func, undefined, flatten_1), func + '');
  8440. }
  8441. var _flatRest = flatRest;
  8442. /* Built-in method references that are verified to be native. */
  8443. var WeakMap = _getNative(_root, 'WeakMap');
  8444. var _WeakMap = WeakMap;
  8445. /** Used to store function metadata. */
  8446. var metaMap = _WeakMap && new _WeakMap();
  8447. var _metaMap = metaMap;
  8448. /**
  8449. * This method returns `undefined`.
  8450. *
  8451. * @static
  8452. * @memberOf _
  8453. * @since 2.3.0
  8454. * @category Util
  8455. * @example
  8456. *
  8457. * _.times(2, _.noop);
  8458. * // => [undefined, undefined]
  8459. */
  8460. function noop() {
  8461. // No operation performed.
  8462. }
  8463. var noop_1 = noop;
  8464. /**
  8465. * Gets metadata for `func`.
  8466. *
  8467. * @private
  8468. * @param {Function} func The function to query.
  8469. * @returns {*} Returns the metadata for `func`.
  8470. */
  8471. var getData = !_metaMap ? noop_1 : function (func) {
  8472. return _metaMap.get(func);
  8473. };
  8474. var _getData = getData;
  8475. /** Used to lookup unminified function names. */
  8476. var realNames = {};
  8477. var _realNames = realNames;
  8478. /** Used for built-in method references. */
  8479. var objectProto$4 = Object.prototype;
  8480. /** Used to check objects for own properties. */
  8481. var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
  8482. /**
  8483. * Gets the name of `func`.
  8484. *
  8485. * @private
  8486. * @param {Function} func The function to query.
  8487. * @returns {string} Returns the function name.
  8488. */
  8489. function getFuncName(func) {
  8490. var result = func.name + '',
  8491. array = _realNames[result],
  8492. length = hasOwnProperty$3.call(_realNames, result) ? array.length : 0;
  8493. while (length--) {
  8494. var data = array[length],
  8495. otherFunc = data.func;
  8496. if (otherFunc == null || otherFunc == func) {
  8497. return data.name;
  8498. }
  8499. }
  8500. return result;
  8501. }
  8502. var _getFuncName = getFuncName;
  8503. /** Used as references for the maximum length and index of an array. */
  8504. var MAX_ARRAY_LENGTH = 4294967295;
  8505. /**
  8506. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  8507. *
  8508. * @private
  8509. * @constructor
  8510. * @param {*} value The value to wrap.
  8511. */
  8512. function LazyWrapper(value) {
  8513. this.__wrapped__ = value;
  8514. this.__actions__ = [];
  8515. this.__dir__ = 1;
  8516. this.__filtered__ = false;
  8517. this.__iteratees__ = [];
  8518. this.__takeCount__ = MAX_ARRAY_LENGTH;
  8519. this.__views__ = [];
  8520. }
  8521. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  8522. LazyWrapper.prototype = _baseCreate(_baseLodash.prototype);
  8523. LazyWrapper.prototype.constructor = LazyWrapper;
  8524. var _LazyWrapper = LazyWrapper;
  8525. /**
  8526. * Copies the values of `source` to `array`.
  8527. *
  8528. * @private
  8529. * @param {Array} source The array to copy values from.
  8530. * @param {Array} [array=[]] The array to copy values to.
  8531. * @returns {Array} Returns `array`.
  8532. */
  8533. function copyArray(source, array) {
  8534. var index = -1,
  8535. length = source.length;
  8536. array || (array = Array(length));
  8537. while (++index < length) {
  8538. array[index] = source[index];
  8539. }
  8540. return array;
  8541. }
  8542. var _copyArray = copyArray;
  8543. /**
  8544. * Creates a clone of `wrapper`.
  8545. *
  8546. * @private
  8547. * @param {Object} wrapper The wrapper to clone.
  8548. * @returns {Object} Returns the cloned wrapper.
  8549. */
  8550. function wrapperClone(wrapper) {
  8551. if (wrapper instanceof _LazyWrapper) {
  8552. return wrapper.clone();
  8553. }
  8554. var result = new _LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  8555. result.__actions__ = _copyArray(wrapper.__actions__);
  8556. result.__index__ = wrapper.__index__;
  8557. result.__values__ = wrapper.__values__;
  8558. return result;
  8559. }
  8560. var _wrapperClone = wrapperClone;
  8561. /** Used for built-in method references. */
  8562. var objectProto$3 = Object.prototype;
  8563. /** Used to check objects for own properties. */
  8564. var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
  8565. /**
  8566. * Creates a `lodash` object which wraps `value` to enable implicit method
  8567. * chain sequences. Methods that operate on and return arrays, collections,
  8568. * and functions can be chained together. Methods that retrieve a single value
  8569. * or may return a primitive value will automatically end the chain sequence
  8570. * and return the unwrapped value. Otherwise, the value must be unwrapped
  8571. * with `_#value`.
  8572. *
  8573. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  8574. * enabled using `_.chain`.
  8575. *
  8576. * The execution of chained methods is lazy, that is, it's deferred until
  8577. * `_#value` is implicitly or explicitly called.
  8578. *
  8579. * Lazy evaluation allows several methods to support shortcut fusion.
  8580. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  8581. * the creation of intermediate arrays and can greatly reduce the number of
  8582. * iteratee executions. Sections of a chain sequence qualify for shortcut
  8583. * fusion if the section is applied to an array and iteratees accept only
  8584. * one argument. The heuristic for whether a section qualifies for shortcut
  8585. * fusion is subject to change.
  8586. *
  8587. * Chaining is supported in custom builds as long as the `_#value` method is
  8588. * directly or indirectly included in the build.
  8589. *
  8590. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  8591. *
  8592. * The wrapper `Array` methods are:
  8593. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  8594. *
  8595. * The wrapper `String` methods are:
  8596. * `replace` and `split`
  8597. *
  8598. * The wrapper methods that support shortcut fusion are:
  8599. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  8600. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  8601. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  8602. *
  8603. * The chainable wrapper methods are:
  8604. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  8605. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  8606. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  8607. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  8608. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  8609. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  8610. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  8611. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  8612. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  8613. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  8614. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  8615. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  8616. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  8617. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  8618. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  8619. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  8620. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  8621. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  8622. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  8623. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  8624. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  8625. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  8626. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  8627. * `zipObject`, `zipObjectDeep`, and `zipWith`
  8628. *
  8629. * The wrapper methods that are **not** chainable by default are:
  8630. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  8631. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  8632. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  8633. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  8634. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  8635. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  8636. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  8637. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  8638. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  8639. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  8640. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  8641. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  8642. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  8643. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  8644. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  8645. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  8646. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  8647. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  8648. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  8649. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  8650. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  8651. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  8652. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  8653. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  8654. * `upperFirst`, `value`, and `words`
  8655. *
  8656. * @name _
  8657. * @constructor
  8658. * @category Seq
  8659. * @param {*} value The value to wrap in a `lodash` instance.
  8660. * @returns {Object} Returns the new `lodash` wrapper instance.
  8661. * @example
  8662. *
  8663. * function square(n) {
  8664. * return n * n;
  8665. * }
  8666. *
  8667. * var wrapped = _([1, 2, 3]);
  8668. *
  8669. * // Returns an unwrapped value.
  8670. * wrapped.reduce(_.add);
  8671. * // => 6
  8672. *
  8673. * // Returns a wrapped value.
  8674. * var squares = wrapped.map(square);
  8675. *
  8676. * _.isArray(squares);
  8677. * // => false
  8678. *
  8679. * _.isArray(squares.value());
  8680. * // => true
  8681. */
  8682. function lodash(value) {
  8683. if (isObjectLike_1(value) && !isArray_1(value) && !(value instanceof _LazyWrapper)) {
  8684. if (value instanceof _LodashWrapper) {
  8685. return value;
  8686. }
  8687. if (hasOwnProperty$2.call(value, '__wrapped__')) {
  8688. return _wrapperClone(value);
  8689. }
  8690. }
  8691. return new _LodashWrapper(value);
  8692. }
  8693. // Ensure wrappers are instances of `baseLodash`.
  8694. lodash.prototype = _baseLodash.prototype;
  8695. lodash.prototype.constructor = lodash;
  8696. var wrapperLodash = lodash;
  8697. /**
  8698. * Checks if `func` has a lazy counterpart.
  8699. *
  8700. * @private
  8701. * @param {Function} func The function to check.
  8702. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  8703. * else `false`.
  8704. */
  8705. function isLaziable(func) {
  8706. var funcName = _getFuncName(func),
  8707. other = wrapperLodash[funcName];
  8708. if (typeof other != 'function' || !(funcName in _LazyWrapper.prototype)) {
  8709. return false;
  8710. }
  8711. if (func === other) {
  8712. return true;
  8713. }
  8714. var data = _getData(other);
  8715. return !!data && func === data[0];
  8716. }
  8717. var _isLaziable = isLaziable;
  8718. /** Error message constants. */
  8719. var FUNC_ERROR_TEXT = 'Expected a function';
  8720. /** Used to compose bitmasks for function metadata. */
  8721. var WRAP_CURRY_FLAG = 8,
  8722. WRAP_PARTIAL_FLAG = 32,
  8723. WRAP_ARY_FLAG = 128,
  8724. WRAP_REARG_FLAG = 256;
  8725. /**
  8726. * Creates a `_.flow` or `_.flowRight` function.
  8727. *
  8728. * @private
  8729. * @param {boolean} [fromRight] Specify iterating from right to left.
  8730. * @returns {Function} Returns the new flow function.
  8731. */
  8732. function createFlow(fromRight) {
  8733. return _flatRest(function (funcs) {
  8734. var length = funcs.length,
  8735. index = length,
  8736. prereq = _LodashWrapper.prototype.thru;
  8737. if (fromRight) {
  8738. funcs.reverse();
  8739. }
  8740. while (index--) {
  8741. var func = funcs[index];
  8742. if (typeof func != 'function') {
  8743. throw new TypeError(FUNC_ERROR_TEXT);
  8744. }
  8745. if (prereq && !wrapper && _getFuncName(func) == 'wrapper') {
  8746. var wrapper = new _LodashWrapper([], true);
  8747. }
  8748. }
  8749. index = wrapper ? index : length;
  8750. while (++index < length) {
  8751. func = funcs[index];
  8752. var funcName = _getFuncName(func),
  8753. data = funcName == 'wrapper' ? _getData(func) : undefined;
  8754. if (data && _isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
  8755. wrapper = wrapper[_getFuncName(data[0])].apply(wrapper, data[3]);
  8756. } else {
  8757. wrapper = func.length == 1 && _isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
  8758. }
  8759. }
  8760. return function () {
  8761. var args = arguments,
  8762. value = args[0];
  8763. if (wrapper && args.length == 1 && isArray_1(value)) {
  8764. return wrapper.plant(value).value();
  8765. }
  8766. var index = 0,
  8767. result = length ? funcs[index].apply(this, args) : value;
  8768. while (++index < length) {
  8769. result = funcs[index].call(this, result);
  8770. }
  8771. return result;
  8772. };
  8773. });
  8774. }
  8775. var _createFlow = createFlow;
  8776. /**
  8777. * Creates a function that returns the result of invoking the given functions
  8778. * with the `this` binding of the created function, where each successive
  8779. * invocation is supplied the return value of the previous.
  8780. *
  8781. * @static
  8782. * @memberOf _
  8783. * @since 3.0.0
  8784. * @category Util
  8785. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  8786. * @returns {Function} Returns the new composite function.
  8787. * @see _.flowRight
  8788. * @example
  8789. *
  8790. * function square(n) {
  8791. * return n * n;
  8792. * }
  8793. *
  8794. * var addSquare = _.flow([_.add, square]);
  8795. * addSquare(1, 2);
  8796. * // => 9
  8797. */
  8798. var flow = _createFlow();
  8799. var flow_1 = flow;
  8800. var TYPE_PRE_MONTH = -1;
  8801. var TYPE_NOW_MONTH = 0;
  8802. var TYPE_NEXT_MONTH = 1;
  8803. /** Used for built-in method references. */
  8804. var objectProto$2 = Object.prototype;
  8805. /**
  8806. * Checks if `value` is likely a prototype object.
  8807. *
  8808. * @private
  8809. * @param {*} value The value to check.
  8810. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  8811. */
  8812. function isPrototype(value) {
  8813. var Ctor = value && value.constructor,
  8814. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$2;
  8815. return value === proto;
  8816. }
  8817. var _isPrototype = isPrototype;
  8818. /**
  8819. * Creates a unary function that invokes `func` with its argument transformed.
  8820. *
  8821. * @private
  8822. * @param {Function} func The function to wrap.
  8823. * @param {Function} transform The argument transform.
  8824. * @returns {Function} Returns the new function.
  8825. */
  8826. function overArg(func, transform) {
  8827. return function (arg) {
  8828. return func(transform(arg));
  8829. };
  8830. }
  8831. var _overArg = overArg;
  8832. /* Built-in method references for those with the same name as other `lodash` methods. */
  8833. var nativeKeys = _overArg(Object.keys, Object);
  8834. var _nativeKeys = nativeKeys;
  8835. /** Used for built-in method references. */
  8836. var objectProto$1 = Object.prototype;
  8837. /** Used to check objects for own properties. */
  8838. var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
  8839. /**
  8840. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  8841. *
  8842. * @private
  8843. * @param {Object} object The object to query.
  8844. * @returns {Array} Returns the array of property names.
  8845. */
  8846. function baseKeys(object) {
  8847. if (!_isPrototype(object)) {
  8848. return _nativeKeys(object);
  8849. }
  8850. var result = [];
  8851. for (var key in Object(object)) {
  8852. if (hasOwnProperty$1.call(object, key) && key != 'constructor') {
  8853. result.push(key);
  8854. }
  8855. }
  8856. return result;
  8857. }
  8858. var _baseKeys = baseKeys;
  8859. /* Built-in method references that are verified to be native. */
  8860. var DataView = _getNative(_root, 'DataView');
  8861. var _DataView = DataView;
  8862. /* Built-in method references that are verified to be native. */
  8863. var Map = _getNative(_root, 'Map');
  8864. var _Map = Map;
  8865. /* Built-in method references that are verified to be native. */
  8866. var Promise$1 = _getNative(_root, 'Promise');
  8867. var _Promise = Promise$1;
  8868. /* Built-in method references that are verified to be native. */
  8869. var Set$1 = _getNative(_root, 'Set');
  8870. var _Set = Set$1;
  8871. /** `Object#toString` result references. */
  8872. var mapTag$2 = '[object Map]',
  8873. objectTag$1 = '[object Object]',
  8874. promiseTag = '[object Promise]',
  8875. setTag$2 = '[object Set]',
  8876. weakMapTag$1 = '[object WeakMap]';
  8877. var dataViewTag$1 = '[object DataView]';
  8878. /** Used to detect maps, sets, and weakmaps. */
  8879. var dataViewCtorString = _toSource(_DataView),
  8880. mapCtorString = _toSource(_Map),
  8881. promiseCtorString = _toSource(_Promise),
  8882. setCtorString = _toSource(_Set),
  8883. weakMapCtorString = _toSource(_WeakMap);
  8884. /**
  8885. * Gets the `toStringTag` of `value`.
  8886. *
  8887. * @private
  8888. * @param {*} value The value to query.
  8889. * @returns {string} Returns the `toStringTag`.
  8890. */
  8891. var getTag = _baseGetTag;
  8892. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  8893. if (_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$1 || _Map && getTag(new _Map()) != mapTag$2 || _Promise && getTag(_Promise.resolve()) != promiseTag || _Set && getTag(new _Set()) != setTag$2 || _WeakMap && getTag(new _WeakMap()) != weakMapTag$1) {
  8894. getTag = function getTag(value) {
  8895. var result = _baseGetTag(value),
  8896. Ctor = result == objectTag$1 ? value.constructor : undefined,
  8897. ctorString = Ctor ? _toSource(Ctor) : '';
  8898. if (ctorString) {
  8899. switch (ctorString) {
  8900. case dataViewCtorString:
  8901. return dataViewTag$1;
  8902. case mapCtorString:
  8903. return mapTag$2;
  8904. case promiseCtorString:
  8905. return promiseTag;
  8906. case setCtorString:
  8907. return setTag$2;
  8908. case weakMapCtorString:
  8909. return weakMapTag$1;
  8910. }
  8911. }
  8912. return result;
  8913. };
  8914. }
  8915. var _getTag = getTag;
  8916. /**
  8917. * This method returns `false`.
  8918. *
  8919. * @static
  8920. * @memberOf _
  8921. * @since 4.13.0
  8922. * @category Util
  8923. * @returns {boolean} Returns `false`.
  8924. * @example
  8925. *
  8926. * _.times(2, _.stubFalse);
  8927. * // => [false, false]
  8928. */
  8929. function stubFalse() {
  8930. return false;
  8931. }
  8932. var stubFalse_1 = stubFalse;
  8933. var isBuffer_1 = createCommonjsModule(function (module, exports) {
  8934. /** Detect free variable `exports`. */
  8935. var freeExports = exports && !exports.nodeType && exports;
  8936. /** Detect free variable `module`. */
  8937. var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
  8938. /** Detect the popular CommonJS extension `module.exports`. */
  8939. var moduleExports = freeModule && freeModule.exports === freeExports;
  8940. /** Built-in value references. */
  8941. var Buffer = moduleExports ? _root.Buffer : undefined;
  8942. /* Built-in method references for those with the same name as other `lodash` methods. */
  8943. var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
  8944. /**
  8945. * Checks if `value` is a buffer.
  8946. *
  8947. * @static
  8948. * @memberOf _
  8949. * @since 4.3.0
  8950. * @category Lang
  8951. * @param {*} value The value to check.
  8952. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  8953. * @example
  8954. *
  8955. * _.isBuffer(new Buffer(2));
  8956. * // => true
  8957. *
  8958. * _.isBuffer(new Uint8Array(2));
  8959. * // => false
  8960. */
  8961. var isBuffer = nativeIsBuffer || stubFalse_1;
  8962. module.exports = isBuffer;
  8963. });
  8964. /** `Object#toString` result references. */
  8965. var argsTag = '[object Arguments]',
  8966. arrayTag = '[object Array]',
  8967. boolTag = '[object Boolean]',
  8968. dateTag = '[object Date]',
  8969. errorTag = '[object Error]',
  8970. funcTag = '[object Function]',
  8971. mapTag$1 = '[object Map]',
  8972. numberTag = '[object Number]',
  8973. objectTag = '[object Object]',
  8974. regexpTag = '[object RegExp]',
  8975. setTag$1 = '[object Set]',
  8976. stringTag = '[object String]',
  8977. weakMapTag = '[object WeakMap]';
  8978. var arrayBufferTag = '[object ArrayBuffer]',
  8979. dataViewTag = '[object DataView]',
  8980. float32Tag = '[object Float32Array]',
  8981. float64Tag = '[object Float64Array]',
  8982. int8Tag = '[object Int8Array]',
  8983. int16Tag = '[object Int16Array]',
  8984. int32Tag = '[object Int32Array]',
  8985. uint8Tag = '[object Uint8Array]',
  8986. uint8ClampedTag = '[object Uint8ClampedArray]',
  8987. uint16Tag = '[object Uint16Array]',
  8988. uint32Tag = '[object Uint32Array]';
  8989. /** Used to identify `toStringTag` values of typed arrays. */
  8990. var typedArrayTags = {};
  8991. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  8992. typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag$1] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
  8993. /**
  8994. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  8995. *
  8996. * @private
  8997. * @param {*} value The value to check.
  8998. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  8999. */
  9000. function baseIsTypedArray(value) {
  9001. return isObjectLike_1(value) && isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
  9002. }
  9003. var _baseIsTypedArray = baseIsTypedArray;
  9004. /**
  9005. * The base implementation of `_.unary` without support for storing metadata.
  9006. *
  9007. * @private
  9008. * @param {Function} func The function to cap arguments for.
  9009. * @returns {Function} Returns the new capped function.
  9010. */
  9011. function baseUnary(func) {
  9012. return function (value) {
  9013. return func(value);
  9014. };
  9015. }
  9016. var _baseUnary = baseUnary;
  9017. var _nodeUtil = createCommonjsModule(function (module, exports) {
  9018. /** Detect free variable `exports`. */
  9019. var freeExports = exports && !exports.nodeType && exports;
  9020. /** Detect free variable `module`. */
  9021. var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
  9022. /** Detect the popular CommonJS extension `module.exports`. */
  9023. var moduleExports = freeModule && freeModule.exports === freeExports;
  9024. /** Detect free variable `process` from Node.js. */
  9025. var freeProcess = moduleExports && _freeGlobal.process;
  9026. /** Used to access faster Node.js helpers. */
  9027. var nodeUtil = function () {
  9028. try {
  9029. // Use `util.types` for Node.js 10+.
  9030. var types = freeModule && freeModule.require && freeModule.require('util').types;
  9031. if (types) {
  9032. return types;
  9033. }
  9034. // Legacy `process.binding('util')` for Node.js < 10.
  9035. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  9036. } catch (e) {}
  9037. }();
  9038. module.exports = nodeUtil;
  9039. });
  9040. /* Node.js helper references. */
  9041. var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
  9042. /**
  9043. * Checks if `value` is classified as a typed array.
  9044. *
  9045. * @static
  9046. * @memberOf _
  9047. * @since 3.0.0
  9048. * @category Lang
  9049. * @param {*} value The value to check.
  9050. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  9051. * @example
  9052. *
  9053. * _.isTypedArray(new Uint8Array);
  9054. * // => true
  9055. *
  9056. * _.isTypedArray([]);
  9057. * // => false
  9058. */
  9059. var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
  9060. var isTypedArray_1 = isTypedArray;
  9061. /** `Object#toString` result references. */
  9062. var mapTag = '[object Map]',
  9063. setTag = '[object Set]';
  9064. /** Used for built-in method references. */
  9065. var objectProto = Object.prototype;
  9066. /** Used to check objects for own properties. */
  9067. var hasOwnProperty = objectProto.hasOwnProperty;
  9068. /**
  9069. * Checks if `value` is an empty object, collection, map, or set.
  9070. *
  9071. * Objects are considered empty if they have no own enumerable string keyed
  9072. * properties.
  9073. *
  9074. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  9075. * jQuery-like collections are considered empty if they have a `length` of `0`.
  9076. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  9077. *
  9078. * @static
  9079. * @memberOf _
  9080. * @since 0.1.0
  9081. * @category Lang
  9082. * @param {*} value The value to check.
  9083. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  9084. * @example
  9085. *
  9086. * _.isEmpty(null);
  9087. * // => true
  9088. *
  9089. * _.isEmpty(true);
  9090. * // => true
  9091. *
  9092. * _.isEmpty(1);
  9093. * // => true
  9094. *
  9095. * _.isEmpty([1, 2, 3]);
  9096. * // => false
  9097. *
  9098. * _.isEmpty({ 'a': 1 });
  9099. * // => false
  9100. */
  9101. function isEmpty(value) {
  9102. if (value == null) {
  9103. return true;
  9104. }
  9105. if (isArrayLike_1(value) && (isArray_1(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer_1(value) || isTypedArray_1(value) || isArguments_1(value))) {
  9106. return !value.length;
  9107. }
  9108. var tag = _getTag(value);
  9109. if (tag == mapTag || tag == setTag) {
  9110. return !value.size;
  9111. }
  9112. if (_isPrototype(value)) {
  9113. return !_baseKeys(value).length;
  9114. }
  9115. for (var key in value) {
  9116. if (hasOwnProperty.call(value, key)) {
  9117. return false;
  9118. }
  9119. }
  9120. return true;
  9121. }
  9122. var isEmpty_1 = isEmpty;
  9123. function handleActive(args, item) {
  9124. var selectedDate = args.selectedDate;
  9125. var _value = item._value;
  9126. var start = selectedDate.start,
  9127. end = selectedDate.end;
  9128. var dayjsEnd = dayjs_min(end);
  9129. var dayjsStart = start ? dayjs_min(start) : dayjsEnd;
  9130. item.isSelected = (_value === null || _value === void 0 ? void 0 : _value.isSame(dayjsEnd)) || (_value === null || _value === void 0 ? void 0 : _value.isSame(dayjsStart)) || (_value === null || _value === void 0 ? void 0 : _value.isAfter(dayjsStart)) && (_value === null || _value === void 0 ? void 0 : _value.isBefore(dayjsEnd));
  9131. item.isSelectedHead = _value === null || _value === void 0 ? void 0 : _value.isSame(dayjsStart);
  9132. item.isSelectedTail = _value === null || _value === void 0 ? void 0 : _value.isSame(dayjsEnd);
  9133. item.isToday = (_value === null || _value === void 0 ? void 0 : _value.diff(dayjs_min(Date.now()).startOf('day'), 'day')) === 0;
  9134. return item;
  9135. }
  9136. function handleMarks(args, item) {
  9137. var options = args.options;
  9138. var _value = item._value;
  9139. var marks = options.marks;
  9140. var markList = marks.filter(function (mark) {
  9141. return dayjs_min(mark.value).startOf('day').isSame(_value);
  9142. });
  9143. item.marks = markList.slice(0, 1);
  9144. return item;
  9145. }
  9146. // export function handleSelectedDates (args: PluginArg): Calendar.Item {
  9147. // const { item, options } = args
  9148. // const { _value } = item
  9149. // const { selectedDates } = options
  9150. // if (selectedDates.length === 0) return args
  9151. // _forEach(selectedDates, date => {
  9152. // const { isSelected, isHead, isTail } = item
  9153. // // 如果当前 Item 已经具备了 三种状态下 无需继续判断 跳出循环
  9154. // if (isSelected) {
  9155. // return false
  9156. // }
  9157. // const { start, end } = date
  9158. // const dayjsEnd = dayjs(end).startOf('day')
  9159. // const dayjsStart = dayjs(start).startOf('day')
  9160. // item.isSelected =
  9161. // item.isSelected ||
  9162. // (_value.isAfter(dayjsStart) && _value.isBefore(dayjsEnd))
  9163. // item.isHead = item.isHead || _value.isSame(dayjsStart)
  9164. // item.isTail = item.isTail || _value.isSame(dayjsEnd)
  9165. // })
  9166. // return item
  9167. // }
  9168. function handleDisabled(args, item) {
  9169. var options = args.options;
  9170. var _value = item._value;
  9171. var minDate = options.minDate,
  9172. maxDate = options.maxDate;
  9173. var dayjsMinDate = dayjs_min(minDate);
  9174. var dayjsMaxDate = dayjs_min(maxDate);
  9175. item.isDisabled = !!(minDate && (_value === null || _value === void 0 ? void 0 : _value.isBefore(dayjsMinDate))) || !!(maxDate && (_value === null || _value === void 0 ? void 0 : _value.isAfter(dayjsMaxDate)));
  9176. return item;
  9177. }
  9178. function handleValid(args, item) {
  9179. var options = args.options;
  9180. var _value = item._value;
  9181. var validDates = options.validDates;
  9182. if (!isEmpty_1(validDates)) {
  9183. var isInclude = validDates.some(function (date) {
  9184. return dayjs_min(date.value).startOf('day').isSame(_value);
  9185. });
  9186. item.isDisabled = !isInclude;
  9187. }
  9188. delete item._value;
  9189. return item;
  9190. }
  9191. var plugins = [handleActive, handleMarks, handleDisabled, handleValid];
  9192. var TOTAL = 7 * 6;
  9193. function getFullItem(item, options, selectedDate, isShowStatus) {
  9194. if (options.marks.find(function (x) {
  9195. return x.value === item.value;
  9196. })) {
  9197. item.marks = [{
  9198. value: item.value
  9199. }];
  9200. }
  9201. if (!isShowStatus) return item;
  9202. var bindedPlugins = plugins.map(function (fn) {
  9203. return fn.bind(null, {
  9204. options: options,
  9205. selectedDate: selectedDate
  9206. });
  9207. });
  9208. return flow_1(bindedPlugins)(item);
  9209. }
  9210. function generateCalendarGroup(options) {
  9211. return function (generateDate, selectedDate, isShowStatus) {
  9212. var date = dayjs_min(generateDate);
  9213. var format = options.format;
  9214. // 获取生成日期的第一天 和 最后一天
  9215. var firstDate = date.startOf('month');
  9216. var lastDate = date.endOf('month');
  9217. var preMonthDate = date.subtract(1, 'month');
  9218. var list = [];
  9219. var nowMonthDays = date.daysInMonth(); // 获取这个月有多少天
  9220. var preMonthLastDay = preMonthDate.endOf('month').day(); // 获取上个月最后一天是周几
  9221. // 生成上个月的日期
  9222. for (var i_1 = 1; i_1 <= preMonthLastDay + 1; i_1++) {
  9223. var thisDate = firstDate.subtract(i_1, 'day').startOf('day');
  9224. var item = {
  9225. marks: [],
  9226. _value: thisDate,
  9227. text: thisDate.date(),
  9228. type: TYPE_PRE_MONTH,
  9229. value: thisDate.format(format)
  9230. };
  9231. item = getFullItem(item, options, selectedDate, isShowStatus);
  9232. list.push(item);
  9233. }
  9234. list.reverse();
  9235. // 生成这个月的日期
  9236. for (var i_2 = 0; i_2 < nowMonthDays; i_2++) {
  9237. var thisDate = firstDate.add(i_2, 'day').startOf('day');
  9238. var item = {
  9239. marks: [],
  9240. _value: thisDate,
  9241. text: thisDate.date(),
  9242. type: TYPE_NOW_MONTH,
  9243. value: thisDate.format(format)
  9244. };
  9245. item = getFullItem(item, options, selectedDate, isShowStatus);
  9246. list.push(item);
  9247. }
  9248. // 生成下个月的日期
  9249. var i = 1;
  9250. while (list.length < TOTAL) {
  9251. var thisDate = lastDate.add(i++, 'day').startOf('day');
  9252. var item = {
  9253. marks: [],
  9254. _value: thisDate,
  9255. text: thisDate.date(),
  9256. type: TYPE_NEXT_MONTH,
  9257. value: thisDate.format(format)
  9258. };
  9259. item = getFullItem(item, options, selectedDate, isShowStatus);
  9260. list.push(item);
  9261. }
  9262. return {
  9263. list: list,
  9264. value: generateDate
  9265. };
  9266. };
  9267. }
  9268. var _a;
  9269. var MAP = (_a = {}, _a[TYPE_PRE_MONTH] = 'pre', _a[TYPE_NOW_MONTH] = 'now', _a[TYPE_NEXT_MONTH] = 'next', _a);
  9270. var AtCalendarList = /** @class */function (_super) {
  9271. __extends(AtCalendarList, _super);
  9272. function AtCalendarList() {
  9273. var _this = _super !== null && _super.apply(this, arguments) || this;
  9274. _this.handleClick = function (item) {
  9275. if (typeof _this.props.onClick === 'function') {
  9276. _this.props.onClick(item);
  9277. }
  9278. };
  9279. _this.handleLongClick = function (item) {
  9280. if (typeof _this.props.onLongClick === 'function') {
  9281. _this.props.onLongClick(item);
  9282. }
  9283. };
  9284. return _this;
  9285. }
  9286. AtCalendarList.prototype.render = function () {
  9287. var _this = this;
  9288. var list = this.props.list;
  9289. if (!list || list.length === 0) return null;
  9290. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9291. className: 'at-calendar__list flex'
  9292. }, list.map(function (item) {
  9293. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9294. key: "list-item-" + item.value,
  9295. onClick: _this.handleClick.bind(_this, item),
  9296. onLongPress: _this.handleLongClick.bind(_this, item),
  9297. className: classnames('flex__item', "flex__item--" + MAP[item.type], {
  9298. 'flex__item--today': item.isToday,
  9299. 'flex__item--active': item.isActive,
  9300. 'flex__item--selected': item.isSelected,
  9301. 'flex__item--selected-head': item.isSelectedHead,
  9302. 'flex__item--selected-tail': item.isSelectedTail,
  9303. 'flex__item--blur': item.isDisabled || item.type === TYPE_PRE_MONTH || item.type === TYPE_NEXT_MONTH
  9304. })
  9305. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9306. className: 'flex__item-container'
  9307. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9308. className: 'container-text'
  9309. }, item.text)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9310. className: 'flex__item-extra extra'
  9311. }, item.marks && item.marks.length > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9312. className: 'extra-marks'
  9313. }, item.marks.map(function (mark, key) {
  9314. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  9315. key: key,
  9316. className: 'mark'
  9317. }, mark.value);
  9318. })) : null));
  9319. }));
  9320. };
  9321. return AtCalendarList;
  9322. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  9323. var AtCalendarHeader = /** @class */function (_super) {
  9324. __extends(AtCalendarHeader, _super);
  9325. function AtCalendarHeader() {
  9326. return _super !== null && _super.apply(this, arguments) || this;
  9327. }
  9328. AtCalendarHeader.prototype.render = function () {
  9329. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9330. className: 'at-calendar__header header'
  9331. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9332. className: 'header__flex'
  9333. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9334. className: 'header__flex-item'
  9335. }, "\u65E5"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9336. className: 'header__flex-item'
  9337. }, "\u4E00"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9338. className: 'header__flex-item'
  9339. }, "\u4E8C"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9340. className: 'header__flex-item'
  9341. }, "\u4E09"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9342. className: 'header__flex-item'
  9343. }, "\u56DB"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9344. className: 'header__flex-item'
  9345. }, "\u4E94"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9346. className: 'header__flex-item'
  9347. }, "\u516D")));
  9348. };
  9349. return AtCalendarHeader;
  9350. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  9351. var ANIMTE_DURATION = 300;
  9352. var defaultProps$1 = {
  9353. marks: [],
  9354. selectedDate: {
  9355. end: Date.now(),
  9356. start: Date.now()
  9357. },
  9358. format: 'YYYY-MM-DD',
  9359. generateDate: Date.now()
  9360. };
  9361. var AtCalendarBody = /** @class */function (_super) {
  9362. __extends(AtCalendarBody, _super);
  9363. function AtCalendarBody(props) {
  9364. var _this = _super.call(this, props) || this;
  9365. _this.changeCount = 0;
  9366. _this.currentSwiperIndex = 1;
  9367. _this.startX = 0;
  9368. _this.swipeStartPoint = 0;
  9369. _this.isPreMonth = false;
  9370. _this.maxWidth = 0;
  9371. _this.isTouching = false;
  9372. _this.getGroups = function (generateDate, selectedDate) {
  9373. var dayjsDate = dayjs_min(generateDate);
  9374. var arr = [];
  9375. var preList = _this.generateFunc(dayjsDate.subtract(1, 'month').valueOf(), selectedDate);
  9376. var nowList = _this.generateFunc(generateDate, selectedDate, true);
  9377. var nextList = _this.generateFunc(dayjsDate.add(1, 'month').valueOf(), selectedDate);
  9378. var preListIndex = _this.currentSwiperIndex === 0 ? 2 : _this.currentSwiperIndex - 1;
  9379. var nextListIndex = _this.currentSwiperIndex === 2 ? 0 : _this.currentSwiperIndex + 1;
  9380. arr[preListIndex] = preList;
  9381. arr[nextListIndex] = nextList;
  9382. arr[_this.currentSwiperIndex] = nowList;
  9383. return arr;
  9384. };
  9385. _this.handleTouchStart = function (e) {
  9386. if (!_this.props.isSwiper) {
  9387. return;
  9388. }
  9389. _this.isTouching = true;
  9390. _this.startX = e.touches[0].clientX;
  9391. };
  9392. _this.handleTouchMove = function (e) {
  9393. if (!_this.props.isSwiper) {
  9394. return;
  9395. }
  9396. if (!_this.isTouching) return;
  9397. var clientX = e.touches[0].clientX;
  9398. var offsetSize = clientX - _this.startX;
  9399. _this.setState({
  9400. offsetSize: offsetSize
  9401. });
  9402. };
  9403. _this.animateMoveSlide = function (offset, callback) {
  9404. _this.setState({
  9405. isAnimate: true
  9406. }, function () {
  9407. _this.setState({
  9408. offsetSize: offset
  9409. });
  9410. setTimeout(function () {
  9411. _this.setState({
  9412. isAnimate: false
  9413. }, function () {
  9414. callback && callback();
  9415. });
  9416. }, ANIMTE_DURATION);
  9417. });
  9418. };
  9419. _this.handleTouchEnd = function () {
  9420. if (!_this.props.isSwiper) {
  9421. return;
  9422. }
  9423. var offsetSize = _this.state.offsetSize;
  9424. _this.isTouching = false;
  9425. var isRight = offsetSize > 0;
  9426. var breakpoint = _this.maxWidth / 2;
  9427. var absOffsetSize = Math.abs(offsetSize);
  9428. if (absOffsetSize > breakpoint) {
  9429. var res = isRight ? _this.maxWidth : -_this.maxWidth;
  9430. return _this.animateMoveSlide(res, function () {
  9431. _this.props.onSwipeMonth(isRight ? -1 : 1);
  9432. });
  9433. }
  9434. _this.animateMoveSlide(0);
  9435. };
  9436. _this.handleChange = function (e) {
  9437. var _a = e.detail,
  9438. current = _a.current,
  9439. source = _a.source;
  9440. if (source === 'touch') {
  9441. _this.currentSwiperIndex = current;
  9442. _this.changeCount += 1;
  9443. }
  9444. };
  9445. _this.handleAnimateFinish = function () {
  9446. if (_this.changeCount > 0) {
  9447. _this.props.onSwipeMonth(_this.isPreMonth ? -_this.changeCount : _this.changeCount);
  9448. _this.changeCount = 0;
  9449. }
  9450. };
  9451. _this.handleSwipeTouchStart = function (e) {
  9452. var _a = e.changedTouches[0],
  9453. clientY = _a.clientY,
  9454. clientX = _a.clientX;
  9455. _this.swipeStartPoint = _this.props.isVertical ? clientY : clientX;
  9456. };
  9457. _this.handleSwipeTouchEnd = function (e) {
  9458. var _a = e.changedTouches[0],
  9459. clientY = _a.clientY,
  9460. clientX = _a.clientX;
  9461. _this.isPreMonth = _this.props.isVertical ? clientY - _this.swipeStartPoint > 0 : clientX - _this.swipeStartPoint > 0;
  9462. };
  9463. var validDates = props.validDates,
  9464. marks = props.marks,
  9465. format = props.format,
  9466. minDate = props.minDate,
  9467. maxDate = props.maxDate,
  9468. generateDate = props.generateDate,
  9469. selectedDate = props.selectedDate,
  9470. selectedDates = props.selectedDates;
  9471. _this.generateFunc = generateCalendarGroup({
  9472. validDates: validDates,
  9473. format: format,
  9474. minDate: minDate,
  9475. maxDate: maxDate,
  9476. marks: marks,
  9477. selectedDates: selectedDates
  9478. });
  9479. var listGroup = _this.getGroups(generateDate, selectedDate);
  9480. _this.state = {
  9481. listGroup: listGroup,
  9482. offsetSize: 0,
  9483. isAnimate: false
  9484. };
  9485. return _this;
  9486. }
  9487. AtCalendarBody.prototype.componentDidMount = function () {
  9488. var _this = this;
  9489. delayQuerySelector('.at-calendar-slider__main').then(function (res) {
  9490. _this.maxWidth = res[0].width;
  9491. });
  9492. };
  9493. AtCalendarBody.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  9494. var validDates = nextProps.validDates,
  9495. marks = nextProps.marks,
  9496. format = nextProps.format,
  9497. minDate = nextProps.minDate,
  9498. maxDate = nextProps.maxDate,
  9499. generateDate = nextProps.generateDate,
  9500. selectedDate = nextProps.selectedDate,
  9501. selectedDates = nextProps.selectedDates;
  9502. this.generateFunc = generateCalendarGroup({
  9503. validDates: validDates,
  9504. format: format,
  9505. minDate: minDate,
  9506. maxDate: maxDate,
  9507. marks: marks,
  9508. selectedDates: selectedDates
  9509. });
  9510. var listGroup = this.getGroups(generateDate, selectedDate);
  9511. this.setState({
  9512. offsetSize: 0,
  9513. listGroup: listGroup
  9514. });
  9515. };
  9516. AtCalendarBody.prototype.render = function () {
  9517. var _this = this;
  9518. var isSwiper = this.props.isSwiper;
  9519. var _a = this.state,
  9520. isAnimate = _a.isAnimate,
  9521. offsetSize = _a.offsetSize,
  9522. listGroup = _a.listGroup;
  9523. if (!isSwiper) {
  9524. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9525. className: classnames('main', 'at-calendar-slider__main', "at-calendar-slider__main--" + "weapp")
  9526. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtCalendarHeader, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9527. className: 'main__body body'
  9528. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9529. className: 'body__slider body__slider--now'
  9530. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtCalendarList, {
  9531. list: listGroup[1].list,
  9532. onClick: this.props.onDayClick,
  9533. onLongClick: this.props.onLongClick
  9534. }))));
  9535. }
  9536. /* 需要 Taro 组件库维护 Swiper 使 小程序 和 H5 的表现保持一致 */
  9537. if (false) {}
  9538. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9539. className: classnames('main', 'at-calendar-slider__main', "at-calendar-slider__main--" + "weapp")
  9540. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtCalendarHeader, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Swiper, {
  9541. circular: true,
  9542. current: 1,
  9543. skipHiddenItemLayout: true,
  9544. className: classnames('main__body'),
  9545. onChange: this.handleChange,
  9546. vertical: this.props.isVertical,
  9547. onAnimationFinish: this.handleAnimateFinish,
  9548. onTouchEnd: this.handleSwipeTouchEnd,
  9549. onTouchStart: this.handleSwipeTouchStart
  9550. }, listGroup.map(function (item, key) {
  9551. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.SwiperItem, {
  9552. key: key,
  9553. itemId: key.toString()
  9554. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtCalendarList, {
  9555. list: item.list,
  9556. onClick: _this.props.onDayClick,
  9557. onLongClick: _this.props.onLongClick
  9558. }));
  9559. })));
  9560. };
  9561. AtCalendarBody.defaultProps = defaultProps$1;
  9562. return AtCalendarBody;
  9563. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  9564. var AtCalendarController = /** @class */function (_super) {
  9565. __extends(AtCalendarController, _super);
  9566. function AtCalendarController() {
  9567. return _super !== null && _super.apply(this, arguments) || this;
  9568. }
  9569. AtCalendarController.prototype.render = function () {
  9570. var _a = this.props,
  9571. generateDate = _a.generateDate,
  9572. minDate = _a.minDate,
  9573. maxDate = _a.maxDate,
  9574. monthFormat = _a.monthFormat,
  9575. hideArrow = _a.hideArrow;
  9576. var dayjsDate = dayjs_min(generateDate);
  9577. var dayjsMinDate = !!minDate && dayjs_min(minDate);
  9578. var dayjsMaxDate = !!maxDate && dayjs_min(maxDate);
  9579. var isMinMonth = dayjsMinDate && dayjsMinDate.startOf('month').isSame(dayjsDate);
  9580. var isMaxMonth = dayjsMaxDate && dayjsMaxDate.startOf('month').isSame(dayjsDate);
  9581. var minDateValue = dayjsMinDate ? dayjsMinDate.format('YYYY-MM') : '';
  9582. var maxDateValue = dayjsMaxDate ? dayjsMaxDate.format('YYYY-MM') : '';
  9583. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9584. className: 'at-calendar__controller controller'
  9585. }, hideArrow ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9586. className: classnames('controller__arrow controller__arrow--left', {
  9587. 'controller__arrow--disabled': isMinMonth
  9588. }),
  9589. onClick: this.props.onPreMonth.bind(this, isMinMonth)
  9590. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Picker, {
  9591. mode: 'date',
  9592. fields: 'month',
  9593. end: maxDateValue,
  9594. start: minDateValue,
  9595. onChange: this.props.onSelectDate,
  9596. value: dayjsDate.format('YYYY-MM')
  9597. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.Text, {
  9598. className: 'controller__info'
  9599. }, dayjsDate.format(monthFormat))), hideArrow ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9600. className: classnames('controller__arrow controller__arrow--right', {
  9601. 'controller__arrow--disabled': isMaxMonth
  9602. }),
  9603. onClick: this.props.onNextMonth.bind(this, isMaxMonth)
  9604. }));
  9605. };
  9606. return AtCalendarController;
  9607. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  9608. var defaultProps = {
  9609. validDates: [],
  9610. marks: [],
  9611. isSwiper: true,
  9612. hideArrow: false,
  9613. isVertical: false,
  9614. selectedDates: [],
  9615. isMultiSelect: false,
  9616. format: 'YYYY-MM-DD',
  9617. currentDate: Date.now(),
  9618. monthFormat: 'YYYY年MM月'
  9619. };
  9620. var AtCalendar = /** @class */function (_super) {
  9621. __extends(AtCalendar, _super);
  9622. function AtCalendar(props) {
  9623. var _this = _super.call(this, props) || this;
  9624. _this.getSingleSelectdState = function (value) {
  9625. var generateDate = _this.state.generateDate;
  9626. var stateValue = {
  9627. selectedDate: _this.getSelectedDate(value.valueOf())
  9628. };
  9629. var dayjsGenerateDate = value.startOf('month');
  9630. var generateDateValue = dayjsGenerateDate.valueOf();
  9631. if (generateDateValue !== generateDate) {
  9632. _this.triggerChangeDate(dayjsGenerateDate);
  9633. stateValue.generateDate = generateDateValue;
  9634. }
  9635. return stateValue;
  9636. };
  9637. _this.getMultiSelectedState = function (value) {
  9638. var selectedDate = _this.state.selectedDate;
  9639. var end = selectedDate.end,
  9640. start = selectedDate.start;
  9641. var valueUnix = value.valueOf();
  9642. var state = {
  9643. selectedDate: selectedDate
  9644. };
  9645. if (end) {
  9646. state.selectedDate = _this.getSelectedDate(valueUnix, 0);
  9647. } else {
  9648. state.selectedDate.end = Math.max(valueUnix, +start);
  9649. state.selectedDate.start = Math.min(valueUnix, +start);
  9650. }
  9651. return state;
  9652. };
  9653. _this.getSelectedDate = function (start, end) {
  9654. var stateValue = {
  9655. start: start,
  9656. end: start
  9657. };
  9658. if (typeof end !== 'undefined') {
  9659. stateValue.end = end;
  9660. }
  9661. return stateValue;
  9662. };
  9663. _this.triggerChangeDate = function (value) {
  9664. var format = _this.props.format;
  9665. if (typeof _this.props.onMonthChange !== 'function') return;
  9666. _this.props.onMonthChange(value.format(format));
  9667. };
  9668. _this.setMonth = function (vectorCount) {
  9669. var format = _this.props.format;
  9670. var generateDate = _this.state.generateDate;
  9671. var _generateDate = dayjs_min(generateDate).add(vectorCount, 'month');
  9672. _this.setState({
  9673. generateDate: _generateDate.valueOf()
  9674. });
  9675. if (vectorCount && typeof _this.props.onMonthChange === 'function') {
  9676. _this.props.onMonthChange(_generateDate.format(format));
  9677. }
  9678. };
  9679. _this.handleClickPreMonth = function (isMinMonth) {
  9680. if (isMinMonth === true) {
  9681. return;
  9682. }
  9683. _this.setMonth(-1);
  9684. if (typeof _this.props.onClickPreMonth === 'function') {
  9685. _this.props.onClickPreMonth();
  9686. }
  9687. };
  9688. _this.handleClickNextMonth = function (isMaxMonth) {
  9689. if (isMaxMonth === true) {
  9690. return;
  9691. }
  9692. _this.setMonth(1);
  9693. if (typeof _this.props.onClickNextMonth === 'function') {
  9694. _this.props.onClickNextMonth();
  9695. }
  9696. };
  9697. // picker 选择时间改变时触发
  9698. _this.handleSelectDate = function (e) {
  9699. var value = e.detail.value;
  9700. var _generateDate = dayjs_min(value);
  9701. var _generateDateValue = _generateDate.valueOf();
  9702. if (_this.state.generateDate === _generateDateValue) return;
  9703. _this.triggerChangeDate(_generateDate);
  9704. _this.setState({
  9705. generateDate: _generateDateValue
  9706. });
  9707. };
  9708. _this.handleDayClick = function (item) {
  9709. var isMultiSelect = _this.props.isMultiSelect;
  9710. var isDisabled = item.isDisabled,
  9711. value = item.value;
  9712. if (isDisabled) return;
  9713. var dayjsDate = dayjs_min(value);
  9714. var stateValue = {};
  9715. if (isMultiSelect) {
  9716. stateValue = _this.getMultiSelectedState(dayjsDate);
  9717. } else {
  9718. stateValue = _this.getSingleSelectdState(dayjsDate);
  9719. }
  9720. _this.setState(stateValue, function () {
  9721. _this.handleSelectedDate();
  9722. });
  9723. if (typeof _this.props.onDayClick === 'function') {
  9724. _this.props.onDayClick({
  9725. value: item.value
  9726. });
  9727. }
  9728. };
  9729. _this.handleSelectedDate = function () {
  9730. var selectDate = _this.state.selectedDate;
  9731. if (typeof _this.props.onSelectDate === 'function') {
  9732. var info = {
  9733. start: dayjs_min(selectDate.start).format(_this.props.format)
  9734. };
  9735. if (selectDate.end) {
  9736. info.end = dayjs_min(selectDate.end).format(_this.props.format);
  9737. }
  9738. _this.props.onSelectDate({
  9739. value: info
  9740. });
  9741. }
  9742. };
  9743. _this.handleDayLongClick = function (item) {
  9744. if (typeof _this.props.onDayLongClick === 'function') {
  9745. _this.props.onDayLongClick({
  9746. value: item.value
  9747. });
  9748. }
  9749. };
  9750. var _a = props,
  9751. currentDate = _a.currentDate,
  9752. isMultiSelect = _a.isMultiSelect;
  9753. _this.state = _this.getInitializeState(currentDate, isMultiSelect);
  9754. return _this;
  9755. }
  9756. AtCalendar.prototype.UNSAFE_componentWillReceiveProps = function (nextProps) {
  9757. var currentDate = nextProps.currentDate,
  9758. isMultiSelect = nextProps.isMultiSelect;
  9759. if (!currentDate || currentDate === this.props.currentDate) return;
  9760. if (isMultiSelect && this.props.isMultiSelect) {
  9761. var _a = currentDate,
  9762. start = _a.start,
  9763. end = _a.end;
  9764. var _b = this.props.currentDate,
  9765. preStart = _b.start,
  9766. preEnd = _b.end;
  9767. if (start === preStart && preEnd === end) {
  9768. return;
  9769. }
  9770. }
  9771. var stateValue = this.getInitializeState(currentDate, isMultiSelect);
  9772. this.setState(stateValue);
  9773. };
  9774. AtCalendar.prototype.getInitializeState = function (currentDate, isMultiSelect) {
  9775. var end;
  9776. var start;
  9777. var generateDateValue;
  9778. if (!currentDate) {
  9779. var dayjsStart = dayjs_min();
  9780. start = dayjsStart.startOf('day').valueOf();
  9781. generateDateValue = dayjsStart.startOf('month').valueOf();
  9782. return {
  9783. generateDate: generateDateValue,
  9784. selectedDate: {
  9785. start: ''
  9786. }
  9787. };
  9788. }
  9789. if (isMultiSelect) {
  9790. var _a = currentDate,
  9791. cStart = _a.start,
  9792. cEnd = _a.end;
  9793. var dayjsStart = dayjs_min(cStart);
  9794. start = dayjsStart.startOf('day').valueOf();
  9795. generateDateValue = dayjsStart.startOf('month').valueOf();
  9796. end = cEnd ? dayjs_min(cEnd).startOf('day').valueOf() : start;
  9797. } else {
  9798. var dayjsStart = dayjs_min(currentDate);
  9799. start = dayjsStart.startOf('day').valueOf();
  9800. generateDateValue = dayjsStart.startOf('month').valueOf();
  9801. end = start;
  9802. }
  9803. return {
  9804. generateDate: generateDateValue,
  9805. selectedDate: this.getSelectedDate(start, end)
  9806. };
  9807. };
  9808. AtCalendar.prototype.render = function () {
  9809. var _a = this.state,
  9810. generateDate = _a.generateDate,
  9811. selectedDate = _a.selectedDate;
  9812. var _b = this.props,
  9813. validDates = _b.validDates,
  9814. marks = _b.marks,
  9815. format = _b.format,
  9816. minDate = _b.minDate,
  9817. maxDate = _b.maxDate,
  9818. isSwiper = _b.isSwiper,
  9819. className = _b.className,
  9820. hideArrow = _b.hideArrow,
  9821. isVertical = _b.isVertical,
  9822. monthFormat = _b.monthFormat,
  9823. selectedDates = _b.selectedDates;
  9824. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9825. className: classnames('at-calendar', className)
  9826. }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtCalendarController, {
  9827. minDate: minDate,
  9828. maxDate: maxDate,
  9829. hideArrow: hideArrow,
  9830. monthFormat: monthFormat,
  9831. generateDate: generateDate,
  9832. onPreMonth: this.handleClickPreMonth,
  9833. onNextMonth: this.handleClickNextMonth,
  9834. onSelectDate: this.handleSelectDate
  9835. }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(AtCalendarBody, {
  9836. validDates: validDates,
  9837. marks: marks,
  9838. format: format,
  9839. minDate: minDate,
  9840. maxDate: maxDate,
  9841. isSwiper: isSwiper,
  9842. isVertical: isVertical,
  9843. selectedDate: selectedDate,
  9844. selectedDates: selectedDates,
  9845. generateDate: generateDate,
  9846. onDayClick: this.handleDayClick,
  9847. onSwipeMonth: this.setMonth,
  9848. onLongClick: this.handleDayLongClick
  9849. }));
  9850. };
  9851. AtCalendar.defaultProps = defaultProps;
  9852. return AtCalendar;
  9853. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  9854. var AtFab = /** @class */function (_super) {
  9855. __extends(AtFab, _super);
  9856. function AtFab() {
  9857. return _super !== null && _super.apply(this, arguments) || this;
  9858. }
  9859. AtFab.prototype.onClick = function (e) {
  9860. if (typeof this.props.onClick === 'function') {
  9861. this.props.onClick(e);
  9862. }
  9863. };
  9864. AtFab.prototype.render = function () {
  9865. var _a;
  9866. var _b = this.props,
  9867. size = _b.size,
  9868. className = _b.className,
  9869. children = _b.children;
  9870. var rootClass = classnames('at-fab', className, (_a = {}, _a["at-fab--" + size] = size, _a));
  9871. return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_tarojs_components__WEBPACK_IMPORTED_MODULE_3__.View, {
  9872. className: rootClass,
  9873. onClick: this.onClick.bind(this)
  9874. }, children);
  9875. };
  9876. return AtFab;
  9877. }((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
  9878. AtFab.propTypes = {
  9879. size: PropTypes.oneOf(['normal', 'small']),
  9880. onClick: PropTypes.func
  9881. };
  9882. AtFab.defaultProps = {
  9883. size: 'normal'
  9884. };
  9885. var objectToString = function objectToString(style) {
  9886. if (style && (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(style) === 'object') {
  9887. var styleStr_1 = '';
  9888. Object.keys(style).forEach(function (key) {
  9889. var lowerCaseKey = key.replace(/([A-Z])/g, '-$1').toLowerCase();
  9890. styleStr_1 += lowerCaseKey + ":" + style[key] + ";";
  9891. });
  9892. return styleStr_1;
  9893. } else if (style && typeof style === 'string') {
  9894. return style;
  9895. }
  9896. return '';
  9897. };
  9898. var AtComponent = /** @class */function (_super) {
  9899. __extends(AtComponent, _super);
  9900. function AtComponent() {
  9901. return _super !== null && _super.apply(this, arguments) || this;
  9902. }
  9903. /**
  9904. * 合并 style
  9905. * @param {Object|String} style1
  9906. * @param {Object|String} style2
  9907. * @returns {String}
  9908. */
  9909. AtComponent.prototype.mergeStyle = function (style1, style2) {
  9910. if (style1 && (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(style1) === 'object' && style2 && (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_typeof_js__WEBPACK_IMPORTED_MODULE_2__["default"])(style2) === 'object') {
  9911. return Object.assign({}, style1, style2);
  9912. }
  9913. return objectToString(style1) + objectToString(style2);
  9914. };
  9915. return AtComponent;
  9916. }(react__WEBPACK_IMPORTED_MODULE_0__.Component);
  9917. /***/ }),
  9918. /***/ "./src/features/trackTimeDuration/components/Clock.tsx":
  9919. /*!*************************************************************!*\
  9920. !*** ./src/features/trackTimeDuration/components/Clock.tsx ***!
  9921. \*************************************************************/
  9922. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  9923. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9924. /* harmony export */ "default": function() { return /* binding */ Component; }
  9925. /* harmony export */ });
  9926. /* harmony import */ var _components_Rings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/Rings */ "./src/components/Rings.weapp.tsx");
  9927. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  9928. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  9929. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
  9930. function Component() {
  9931. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.View, {
  9932. children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components_Rings__WEBPACK_IMPORTED_MODULE_0__["default"], {
  9933. radius: 50
  9934. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_2__.Text, {
  9935. children: "Clock Component"
  9936. })]
  9937. });
  9938. }
  9939. /***/ }),
  9940. /***/ "./src/features/trackTimeDuration/components/Console.tsx":
  9941. /*!***************************************************************!*\
  9942. !*** ./src/features/trackTimeDuration/components/Console.tsx ***!
  9943. \***************************************************************/
  9944. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  9945. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  9946. /* harmony export */ "default": function() { return /* binding */ Component; }
  9947. /* harmony export */ });
  9948. /* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
  9949. /* harmony import */ var _services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/services/trackTimeDuration */ "./src/services/trackTimeDuration.tsx");
  9950. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  9951. /* harmony import */ var _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/store/trackTimeMachine */ "./src/store/trackTimeMachine.tsx");
  9952. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
  9953. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
  9954. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  9955. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
  9956. function Component() {
  9957. // const [current,send] = useService(machine)
  9958. // const currentState = trackTimeService.getSnapshot();
  9959. // console.log(currentState.value);
  9960. // debugger
  9961. var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(''),
  9962. _useState2 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_useState, 2),
  9963. key = _useState2[0],
  9964. setKey = _useState2[1];
  9965. var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(''),
  9966. _useState4 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_useState3, 2),
  9967. value = _useState4[0],
  9968. setValue = _useState4[1];
  9969. (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
  9970. getStateDetail();
  9971. }, [_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__.machine.context.currentStatus]);
  9972. (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
  9973. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].onTransition(function (state) {
  9974. // console.log(state.value);
  9975. var value = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].getSnapshot().value;
  9976. // console.log('aaa:'+JSON.parse(JSON.stringify(value)));
  9977. if (state.value.FAST_SLEEP) {
  9978. setKey('FAST_SLEEP');
  9979. setValue(state.value.FAST_SLEEP);
  9980. }
  9981. if (state.value.FAST) {
  9982. setKey('FAST');
  9983. setValue(state.value.FAST);
  9984. }
  9985. if (state.value.SLEEP) {
  9986. setKey('SLEEP');
  9987. setValue(state.value.SLEEP);
  9988. }
  9989. });
  9990. }, []);
  9991. function getStateDetail() {
  9992. var state = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].getSnapshot().value;
  9993. if (state.FAST_SLEEP) {
  9994. setKey('FAST_SLEEP');
  9995. setValue(state.FAST_SLEEP);
  9996. }
  9997. if (state.FAST) {
  9998. setKey('FAST');
  9999. setValue(state.FAST);
  10000. }
  10001. if (state.SLEEP) {
  10002. setKey('SLEEP');
  10003. setValue(state.SLEEP);
  10004. }
  10005. }
  10006. function isMap(obj) {
  10007. return obj instanceof Map;
  10008. }
  10009. function startFast() {
  10010. var start_time = new Date().getTime();
  10011. var duration = 8 * 3600 * 1000;
  10012. var extra = {
  10013. set_time: start_time - 20 * 1000,
  10014. confirm_time: start_time + 50 * 1000
  10015. };
  10016. (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_0__.recordCheck)({
  10017. action: 'FAST_START',
  10018. real_check_time: start_time,
  10019. target_duration: duration,
  10020. extra: extra
  10021. }).then(function (res) {
  10022. console.log(res);
  10023. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({
  10024. type: 'START_FAST'
  10025. });
  10026. });
  10027. // dispatch(startFast());
  10028. }
  10029. function startSleep() {
  10030. var start_time = new Date().getTime();
  10031. var duration = 8 * 3600 * 1000;
  10032. var extra = {
  10033. set_time: start_time - 20 * 1000,
  10034. confirm_time: start_time + 50 * 1000
  10035. };
  10036. (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_0__.recordCheck)({
  10037. action: 'SLEEP_START',
  10038. real_check_time: start_time,
  10039. target_duration: duration,
  10040. extra: extra
  10041. }).then(function (res) {
  10042. console.log(res);
  10043. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({
  10044. type: 'START_SLEEP'
  10045. });
  10046. });
  10047. // dispatch(startSleep());
  10048. }
  10049. function endSleep() {
  10050. var start_time = new Date().getTime();
  10051. // const duration = 8 * 3600 * 1000;
  10052. var extra = {
  10053. set_time: start_time - 20 * 1000,
  10054. confirm_time: start_time + 50 * 1000
  10055. };
  10056. (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_0__.recordCheck)({
  10057. action: 'SLEEP_END',
  10058. real_check_time: start_time,
  10059. extra: extra
  10060. }).then(function (res) {
  10061. console.log(res);
  10062. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({
  10063. type: 'END_SLEEP'
  10064. });
  10065. });
  10066. }
  10067. function endFast() {
  10068. var start_time = new Date().getTime();
  10069. // const duration = 8 * 3600 * 1000;
  10070. var extra = {
  10071. set_time: start_time - 20 * 1000,
  10072. confirm_time: start_time + 50 * 1000
  10073. };
  10074. (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_0__.recordCheck)({
  10075. action: 'FAST_END',
  10076. real_check_time: start_time,
  10077. extra: extra
  10078. }).then(function (res) {
  10079. console.log(res);
  10080. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({
  10081. type: 'END_FAST'
  10082. });
  10083. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({
  10084. type: 'RESET'
  10085. });
  10086. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_1__["default"].send({
  10087. type: __webpack_require__.g.scenario
  10088. });
  10089. });
  10090. }
  10091. function mixedBtns() {
  10092. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
  10093. children: [(value == 'WAIT_FOR_START' || value == 'DONE') && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
  10094. onClick: startFast,
  10095. children: "Start Fast"
  10096. }), (value == 'ONGOING' /* ||value == 'ONGOING1' || value == 'ONGOING2'*/ || value == 'ONGOING3') && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
  10097. onClick: endFast,
  10098. children: "End Fast"
  10099. }), value == 'ONGOING1' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
  10100. onClick: startSleep,
  10101. children: "Start Sleep"
  10102. }), value == 'ONGOING2' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
  10103. onClick: endSleep,
  10104. children: "End Sleep"
  10105. })]
  10106. });
  10107. }
  10108. function fastBtns() {
  10109. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
  10110. children: value == 'ONGOING' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
  10111. onClick: endFast,
  10112. children: "End Fast"
  10113. }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
  10114. onClick: startFast,
  10115. children: "Start Fast"
  10116. })
  10117. });
  10118. }
  10119. function sleepBtns() {
  10120. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
  10121. children: value == 'ONGOING' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
  10122. onClick: endSleep,
  10123. children: "End Sleep"
  10124. }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
  10125. onClick: startSleep,
  10126. children: "Start Sleep"
  10127. })
  10128. });
  10129. }
  10130. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
  10131. children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.Text, {
  10132. children: "Console Component"
  10133. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_5__.View, {
  10134. children: [key === 'FAST_SLEEP' && mixedBtns(), key === 'FAST' && fastBtns(), key === 'SLEEP' && sleepBtns()]
  10135. })]
  10136. });
  10137. }
  10138. /***/ }),
  10139. /***/ "./src/features/trackTimeDuration/components/More.tsx":
  10140. /*!************************************************************!*\
  10141. !*** ./src/features/trackTimeDuration/components/More.tsx ***!
  10142. \************************************************************/
  10143. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  10144. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10145. /* harmony export */ "default": function() { return /* binding */ Component; }
  10146. /* harmony export */ });
  10147. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  10148. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
  10149. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_0__);
  10150. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
  10151. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  10152. /* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-i18next */ "webpack/container/remote/react-i18next");
  10153. /* harmony import */ var react_i18next__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_i18next__WEBPACK_IMPORTED_MODULE_2__);
  10154. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-redux */ "webpack/container/remote/react-redux");
  10155. /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_redux__WEBPACK_IMPORTED_MODULE_3__);
  10156. /* harmony import */ var _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/store/trackTimeMachine */ "./src/store/trackTimeMachine.tsx");
  10157. /* harmony import */ var _services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/services/trackTimeDuration */ "./src/services/trackTimeDuration.tsx");
  10158. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  10159. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__);
  10160. function Component() {
  10161. var _useTranslation = (0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.useTranslation)(),
  10162. t = _useTranslation.t;
  10163. var scenario = (0,react_redux__WEBPACK_IMPORTED_MODULE_3__.useSelector)(function (state) {
  10164. return state.scenario;
  10165. });
  10166. (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
  10167. var value = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].getSnapshot().value;
  10168. }, [_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__.machine.context.currentStatus]);
  10169. (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
  10170. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].onTransition(function (state) {
  10171. var value = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].getSnapshot().value;
  10172. });
  10173. }, []);
  10174. function waitActionSheet() {
  10175. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showActionSheet({
  10176. itemList: [t('feature.track_time_duration.action_sheet.change_schedule'), t('feature.track_time_duration.action_sheet.switch_scenario')]
  10177. }).then(function (res) {
  10178. console.log(res.tapIndex);
  10179. switch (res.tapIndex) {
  10180. case 0:
  10181. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({
  10182. url: '/pages/SetSchedule'
  10183. });
  10184. break;
  10185. case 1:
  10186. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().navigateTo({
  10187. url: '/pages/ChooseScenario'
  10188. });
  10189. break;
  10190. }
  10191. }).catch(function (err) {
  10192. console.log(err.errMsg);
  10193. });
  10194. }
  10195. function endFastActionSheet() {
  10196. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showActionSheet({
  10197. itemList: [t('feature.track_time_duration.action_sheet.end_fast')]
  10198. }).then(function (res) {
  10199. console.log(res.tapIndex);
  10200. switch (res.tapIndex) {
  10201. case 0:
  10202. {
  10203. var start_time = new Date().getTime();
  10204. // const duration = 8 * 3600 * 1000;
  10205. var extra = {
  10206. set_time: start_time - 20 * 1000,
  10207. confirm_time: start_time + 50 * 1000
  10208. };
  10209. (0,_services_trackTimeDuration__WEBPACK_IMPORTED_MODULE_5__.recordCheck)({
  10210. action: 'FAST_END',
  10211. real_check_time: start_time,
  10212. extra: extra
  10213. }).then(function (res) {
  10214. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].send({
  10215. type: 'END_FAST'
  10216. });
  10217. console.log(res);
  10218. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].send({
  10219. type: 'RESET'
  10220. });
  10221. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].send({
  10222. type: __webpack_require__.g.scenario
  10223. });
  10224. });
  10225. }
  10226. break;
  10227. }
  10228. }).catch(function (err) {
  10229. console.log(err.errMsg);
  10230. });
  10231. }
  10232. function ongoingActionSheet() {
  10233. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showActionSheet({
  10234. itemList: [t('feature.track_time_duration.action_sheet.give_up'), t('feature.track_time_duration.action_sheet.switch_scenario')]
  10235. }).then(function (res) {
  10236. console.log(res.tapIndex);
  10237. }).catch(function (err) {
  10238. console.log(err.errMsg);
  10239. });
  10240. }
  10241. function checkActionSheetData() {
  10242. var state = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_4__["default"].getSnapshot().value;
  10243. debugger;
  10244. if (state.FAST_SLEEP === 'WAIT_FOR_START' || state.FAST === 'WAIT_FOR_START' || state.SLEEP === 'WAIT_FOR_START') {
  10245. waitActionSheet();
  10246. } else if (state.FAST_SLEEP === 'ONGOING1' || state.FAST_SLEEP === 'ONGOING2') {
  10247. endFastActionSheet();
  10248. } else if (state.FAST_SLEEP === 'ONGOING3') {
  10249. _tarojs_taro__WEBPACK_IMPORTED_MODULE_0___default().showToast({
  10250. title: '暂无更多操作',
  10251. icon: 'none',
  10252. duration: 2000
  10253. });
  10254. }
  10255. }
  10256. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
  10257. children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10258. onClick: checkActionSheetData,
  10259. children: "More Component"
  10260. })
  10261. });
  10262. }
  10263. /***/ }),
  10264. /***/ "./src/features/trackTimeDuration/components/Schedule.tsx":
  10265. /*!****************************************************************!*\
  10266. !*** ./src/features/trackTimeDuration/components/Schedule.tsx ***!
  10267. \****************************************************************/
  10268. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  10269. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10270. /* harmony export */ "default": function() { return /* binding */ Component; }
  10271. /* harmony export */ });
  10272. /* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ "./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
  10273. /* harmony import */ var _tarojs_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @tarojs/components */ "./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");
  10274. /* harmony import */ var _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/store/trackTimeMachine */ "./src/store/trackTimeMachine.tsx");
  10275. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "webpack/container/remote/react");
  10276. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
  10277. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tarojs/taro */ "webpack/container/remote/@tarojs/taro");
  10278. /* harmony import */ var _tarojs_taro__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_tarojs_taro__WEBPACK_IMPORTED_MODULE_2__);
  10279. /* harmony import */ var _utils_time_format__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/time_format */ "./src/utils/time_format.ts");
  10280. /* harmony import */ var taro_ui__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! taro-ui */ "./node_modules/taro-ui/dist/index.esm.js");
  10281. /* harmony import */ var taro_ui_dist_style_components_float_layout_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! taro-ui/dist/style/components/float-layout.scss */ "./node_modules/taro-ui/dist/style/components/float-layout.scss");
  10282. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "webpack/container/remote/react/jsx-runtime");
  10283. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
  10284. function Component(props) {
  10285. var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),
  10286. _useState2 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_useState, 2),
  10287. checkData = _useState2[0],
  10288. setCheckData = _useState2[1];
  10289. var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
  10290. _useState4 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_useState3, 2),
  10291. key = _useState4[0],
  10292. setKey = _useState4[1];
  10293. var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''),
  10294. _useState6 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_useState5, 2),
  10295. value = _useState6[0],
  10296. setValue = _useState6[1];
  10297. var _useState7 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
  10298. _useState8 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_useState7, 2),
  10299. isOpen = _useState8[0],
  10300. setIsOpen = _useState8[1];
  10301. var _useState9 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
  10302. _useState10 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_useState9, 2),
  10303. isLatest = _useState10[0],
  10304. setIsLatest = _useState10[1];
  10305. var _useState11 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),
  10306. _useState12 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_useState11, 2),
  10307. timerId = _useState12[0],
  10308. setTimerId = _useState12[1];
  10309. var _useState13 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0),
  10310. _useState14 = (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_useState13, 2),
  10311. counter = _useState14[0],
  10312. setCounter = _useState14[1];
  10313. (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
  10314. getStateDetail();
  10315. }, [_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__.machine.context.currentStatus]);
  10316. (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
  10317. if (_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__.machine.context.checkData) {
  10318. setCheckData(_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__.machine.context.checkData);
  10319. }
  10320. getStateDetail();
  10321. }, [_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__.machine.context.checkData]);
  10322. (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
  10323. _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__["default"].onTransition(function (state) {
  10324. getStateDetail();
  10325. });
  10326. }, []);
  10327. (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
  10328. return function () {
  10329. // 在组件卸载时清除定时器
  10330. if (timerId) {
  10331. clearInterval(timerId);
  10332. }
  10333. };
  10334. }, [timerId]);
  10335. var startTimer = function startTimer() {
  10336. // 避免重复启动定时器
  10337. if (timerId) {
  10338. return;
  10339. }
  10340. var id = setInterval(function () {
  10341. setCounter(function (prevCounter) {
  10342. return prevCounter + 1;
  10343. });
  10344. }, 1000);
  10345. setTimerId(id);
  10346. };
  10347. var stopTimer = function stopTimer() {
  10348. if (timerId) {
  10349. clearInterval(timerId);
  10350. setTimerId(null);
  10351. }
  10352. };
  10353. function getStateDetail() {
  10354. if (props.type == 'latest') {
  10355. if (_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__.machine.context.checkData) {
  10356. setKey(_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__.machine.context.checkData.latest_record.scenario);
  10357. setValue(_store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__.machine.context.checkData.latest_record.status);
  10358. }
  10359. return;
  10360. }
  10361. var state = _store_trackTimeMachine__WEBPACK_IMPORTED_MODULE_0__["default"].getSnapshot().value;
  10362. if (state.FAST_SLEEP) {
  10363. setKey('FAST_SLEEP');
  10364. setValue(state.FAST_SLEEP);
  10365. }
  10366. if (state.FAST) {
  10367. setKey('FAST');
  10368. setValue(state.FAST);
  10369. }
  10370. if (state.SLEEP) {
  10371. setKey('SLEEP');
  10372. setValue(state.SLEEP);
  10373. }
  10374. }
  10375. function editSchedule() {
  10376. _tarojs_taro__WEBPACK_IMPORTED_MODULE_2___default().navigateTo({
  10377. url: '/pages/SetSchedule'
  10378. });
  10379. }
  10380. function showStage() {
  10381. startTimer();
  10382. setIsLatest(false);
  10383. setIsOpen(true);
  10384. }
  10385. function showLatest() {
  10386. startTimer();
  10387. setIsLatest(true);
  10388. setIsOpen(true);
  10389. }
  10390. function getStepATime(obj) {
  10391. // if (obj.status == 'WAIT_FOR_START') return TimeFormatter.calculateTimeDifference(obj.sleep.)
  10392. if (obj.status == 'COMPLETED' && obj.sleep.status == 'NOT_STARTED') {
  10393. return '未知';
  10394. }
  10395. return obj.status == 'ONGOING1' ? _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.calculateTimeDifference(obj.fast.real_start_time, new Date().getTime()) : obj.sleep.real_start_time ? _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.calculateTimeDifference(obj.sleep.real_start_time, obj.fast.real_start_time ? obj.fast.real_start_time : obj.fast.target_start_time) : _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.calculateTimeDifference(obj.sleep.target_end_time, obj.fast.real_start_time ? obj.fast.real_start_time : obj.fast.target_start_time);
  10396. }
  10397. function getStepBTime(obj) {
  10398. if (obj.status == 'ONGOING1') return 'Next up';
  10399. if (obj.status == 'ONGOING2') return _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.calculateTimeDifference(obj.sleep.real_start_time, new Date().getTime());
  10400. if (obj.status == 'WAIT_FOR_START') return _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.calculateTimeDifference(obj.sleep.target_end_time, obj.sleep.target_start_time);
  10401. if (obj.sleep.status == 'NOT_COMPLETED' || obj.sleep.status == 'NOT_STARTED') return '未知';
  10402. return _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.calculateTimeDifference(obj.sleep.real_end_time, obj.sleep.real_start_time);
  10403. }
  10404. function getStepCTime(obj) {
  10405. if (obj.status == 'ONGOING1') return 'Final stage';
  10406. if (obj.status == 'ONGOING2') return 'Next up';
  10407. if (obj.status == 'ONGOING3') return _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.calculateTimeDifference(obj.sleep.real_end_time, new Date().getTime());
  10408. if (obj.status == 'WAIT_FOR_START') return _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.calculateTimeDifference(obj.fast.target_end_time, obj.sleep.target_end_time);
  10409. if (obj.sleep.status == 'NOT_COMPLETED' || obj.sleep.status == 'NOT_STARTED') return '未知';
  10410. return _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.calculateTimeDifference(obj.fast.real_end_time, obj.sleep.real_end_time);
  10411. }
  10412. function layoutContent() {
  10413. //当前断食阶段
  10414. var obj = isLatest ? checkData.latest_record : checkData.current_record;
  10415. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
  10416. style: {
  10417. flexDirection: 'column',
  10418. display: 'flex'
  10419. },
  10420. children: [obj.status == 'WAIT_FOR_START' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10421. children: "\u65AD\u98DF\u9636\u6BB5\u76EE\u6807"
  10422. }) : obj.status == 'COMPLETED' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10423. children: "\u65AD\u98DF\u9636\u6BB5"
  10424. }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10425. children: "\u5F53\u524D\u65AD\u98DF\u9636\u6BB5"
  10426. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
  10427. style: {
  10428. flexDirection: 'row',
  10429. display: 'flex'
  10430. },
  10431. children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10432. children: "\u9636\u6BB5A"
  10433. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10434. style: {
  10435. color: obj.status == 'ONGOING1' ? '#AAFF00' : '',
  10436. marginLeft: 20,
  10437. marginRight: 20
  10438. },
  10439. children: " \u7761\u524D\u65AD\u98DF"
  10440. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10441. style: {
  10442. color: obj.status == 'ONGOING1' ? '#AAFF00' : ''
  10443. },
  10444. children: [" ", getStepATime(obj)]
  10445. })]
  10446. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
  10447. style: {
  10448. flexDirection: 'row',
  10449. display: 'flex'
  10450. },
  10451. children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10452. children: "\u9636\u6BB5B"
  10453. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10454. style: {
  10455. color: obj.status == 'ONGOING2' ? '#AAFF00' : '',
  10456. marginLeft: 20,
  10457. marginRight: 20
  10458. },
  10459. children: " \u7761\u7720\u4E2D\u65AD\u98DF"
  10460. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10461. style: {
  10462. color: obj.status == 'ONGOING2' ? '#AAFF00' : ''
  10463. },
  10464. children: getStepBTime(obj)
  10465. })]
  10466. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
  10467. style: {
  10468. flexDirection: 'row',
  10469. display: 'flex'
  10470. },
  10471. children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10472. children: "\u9636\u6BB5C"
  10473. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10474. style: {
  10475. color: obj.status == 'ONGOING3' ? '#AAFF00' : '',
  10476. marginLeft: 20,
  10477. marginRight: 20
  10478. },
  10479. children: " \u8D77\u5E8A\u540E\u65AD\u98DF"
  10480. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10481. style: {
  10482. color: obj.status == 'ONGOING3' ? '#AAFF00' : ''
  10483. },
  10484. children: getStepCTime(obj)
  10485. })]
  10486. })]
  10487. });
  10488. }
  10489. //🚫❌⭕️✅
  10490. function statusString(isFast, isStart) {
  10491. if (props.type == 'latest') {
  10492. if (isFast) {
  10493. if (checkData.latest_record.fast.status == 'COMPLETED') {
  10494. return '✅';
  10495. }
  10496. } else {
  10497. if (checkData.latest_record.sleep.status == 'COMPLETED') {
  10498. return '✅';
  10499. } else if (checkData.latest_record.sleep.status == 'NOT_STARTED') {
  10500. return '🚫';
  10501. } else if (checkData.latest_record.sleep.status == 'NOT_COMPLETED') {
  10502. return isStart ? '✅' : '🚫';
  10503. }
  10504. }
  10505. }
  10506. if (value == 'WAIT_FOR_START') {
  10507. return '⭕️';
  10508. } else if (value == 'ONGOING1') {
  10509. if (isFast && isStart) {
  10510. return '✅';
  10511. }
  10512. } else if (value == 'ONGOING2') {
  10513. if (isStart) {
  10514. return '✅';
  10515. }
  10516. } else if (value == 'ONGOING3') {
  10517. if (isFast && !isStart) {
  10518. return '⭕️';
  10519. } else {
  10520. return '✅';
  10521. }
  10522. }
  10523. return '⭕️';
  10524. }
  10525. function scheduleItems() {
  10526. if (!checkData) {
  10527. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {});
  10528. }
  10529. var obj = props.type == 'latest' ? checkData.latest_record : checkData.current_record;
  10530. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
  10531. children: obj && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
  10532. style: {
  10533. flexDirection: 'column',
  10534. display: 'flex'
  10535. },
  10536. children: [obj.fast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10537. children: [statusString(true, true), "\u5F00\u59CB\u65AD\u98DF\uFF1A", formateTime(obj.fast, false)]
  10538. }), obj.sleep && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10539. children: [statusString(false, true), "\u5F00\u59CB\u7761\u7720\uFF1A", formateTime(obj.sleep, false)]
  10540. }), obj.sleep && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10541. children: [statusString(false, false), "\u7ED3\u675F\u7761\u7720\uFF1A", formateTime(obj.sleep, true)]
  10542. }), obj.fast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10543. children: [statusString(true, false), "\u7ED3\u675F\u65AD\u98DF\uFF1A", formateTime(obj.fast, true)]
  10544. })]
  10545. })
  10546. });
  10547. }
  10548. function formateTime(obj, isEnd) {
  10549. if (isEnd) {
  10550. if (obj.real_end_time) {
  10551. return _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.formatTimestamp(obj.real_end_time);
  10552. } else {
  10553. return _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.formatTimestamp(obj.target_end_time);
  10554. }
  10555. } else {
  10556. if (obj.real_start_time) {
  10557. return _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.formatTimestamp(obj.real_start_time);
  10558. } else {
  10559. return _utils_time_format__WEBPACK_IMPORTED_MODULE_6__.TimeFormatter.formatTimestamp(obj.target_start_time);
  10560. }
  10561. }
  10562. }
  10563. return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.View, {
  10564. style: {
  10565. flexDirection: 'column',
  10566. display: 'flex',
  10567. alignItems: 'center'
  10568. },
  10569. children: [props.type == 'latest' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10570. style: {
  10571. color: 'red'
  10572. },
  10573. children: "Latest"
  10574. }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10575. children: value == 'WAIT_FOR_START' ? 'Schedule' : 'Log in Progress'
  10576. }), scheduleItems(), value == 'WAIT_FOR_START' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10577. onClick: editSchedule,
  10578. children: "\u8C03\u6574\u65E5\u7A0B"
  10579. }), props.type == 'latest' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10580. onClick: showLatest,
  10581. children: "Durations by stage"
  10582. }), props.type != 'latest' && (value == 'WAIT_FOR_START' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10583. onClick: showStage,
  10584. children: "Duration goals by stage"
  10585. }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10586. onClick: showStage,
  10587. children: "Current stage"
  10588. })), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(taro_ui__WEBPACK_IMPORTED_MODULE_8__.AtFloatLayout, {
  10589. isOpened: isOpen,
  10590. onClose: function onClose() {
  10591. stopTimer();
  10592. setIsOpen(false);
  10593. },
  10594. title: "\u8FD9\u662F\u4E2A\u6807\u9898",
  10595. children: checkData && layoutContent()
  10596. }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_tarojs_components__WEBPACK_IMPORTED_MODULE_7__.Text, {
  10597. style: {
  10598. opacity: 0
  10599. },
  10600. children: counter
  10601. })]
  10602. });
  10603. }
  10604. /***/ }),
  10605. /***/ "./src/pages/Clock.tsx":
  10606. /*!*****************************!*\
  10607. !*** ./src/pages/Clock.tsx ***!
  10608. \*****************************/
  10609. /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
  10610. /* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tarojs/runtime */ "webpack/container/remote/@tarojs/runtime");
  10611. /* harmony import */ var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__);
  10612. /* harmony import */ var _node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_Clock_tsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./Clock.tsx */ "./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/Clock.tsx");
  10613. var config = {};
  10614. var inst = Page((0,_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__.createPageConfig)(_node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_Clock_tsx__WEBPACK_IMPORTED_MODULE_1__["default"], 'pages/Clock', {root:{cn:[]}}, config || {}))
  10615. /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_babel_loader_lib_index_js_ruleSet_1_rules_5_use_0_Clock_tsx__WEBPACK_IMPORTED_MODULE_1__["default"]);
  10616. /***/ }),
  10617. /***/ "./src/store/trackTimeMachine.tsx":
  10618. /*!****************************************!*\
  10619. !*** ./src/store/trackTimeMachine.tsx ***!
  10620. \****************************************/
  10621. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  10622. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10623. /* harmony export */ machine: function() { return /* binding */ machine; }
  10624. /* harmony export */ });
  10625. /* unused harmony exports setSpecifiedState, setSpecifiedStatus */
  10626. /* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ "./node_modules/@babel/runtime/helpers/esm/objectSpread2.js");
  10627. /* harmony import */ var xstate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! xstate */ "webpack/container/remote/xstate");
  10628. /* harmony import */ var xstate__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(xstate__WEBPACK_IMPORTED_MODULE_0__);
  10629. var machine = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.createMachine)({
  10630. id: "trackTime",
  10631. initial: "choose",
  10632. context: {
  10633. currentStatus: '',
  10634. checkData: null
  10635. },
  10636. on: {
  10637. RESET: {
  10638. target: '.choose',
  10639. actions: (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)(function (_) {
  10640. return {
  10641. currentStatus: ''
  10642. };
  10643. })
  10644. }
  10645. },
  10646. states: {
  10647. choose: {
  10648. on: {
  10649. SLEEP: {
  10650. target: "SLEEP"
  10651. },
  10652. FAST_SLEEP: {
  10653. target: "FAST_SLEEP"
  10654. },
  10655. FAST: {
  10656. target: "FAST"
  10657. }
  10658. }
  10659. },
  10660. SLEEP: {
  10661. initial: "WAIT_FOR_START",
  10662. states: {
  10663. WAIT_FOR_START: {
  10664. on: {
  10665. START_SLEEP: {
  10666. target: "ONGOING"
  10667. }
  10668. }
  10669. },
  10670. ONGOING: {
  10671. on: {
  10672. END_SLEEP: {
  10673. target: "COMPLETED"
  10674. }
  10675. }
  10676. },
  10677. COMPLETED: {}
  10678. }
  10679. },
  10680. FAST_SLEEP: {
  10681. initial: "WAIT_FOR_START",
  10682. states: {
  10683. WAIT_FOR_START: {
  10684. on: {
  10685. START_FAST: {
  10686. target: "ONGOING1"
  10687. }
  10688. }
  10689. },
  10690. ONGOING1: {
  10691. on: {
  10692. START_SLEEP: {
  10693. target: "ONGOING2"
  10694. },
  10695. END_FAST: {
  10696. target: "COMPLETED"
  10697. }
  10698. }
  10699. },
  10700. ONGOING2: {
  10701. on: {
  10702. END_FAST: {
  10703. target: "COMPLETED"
  10704. },
  10705. END_SLEEP: {
  10706. target: "ONGOING3"
  10707. }
  10708. }
  10709. },
  10710. COMPLETED: {},
  10711. ONGOING3: {
  10712. on: {
  10713. END_FAST: {
  10714. target: "COMPLETED"
  10715. }
  10716. }
  10717. }
  10718. }
  10719. },
  10720. FAST: {
  10721. initial: "WAIT_FOR_START",
  10722. states: {
  10723. WAIT_FOR_START: {
  10724. on: {
  10725. START_FAST: {
  10726. target: "ONGOING"
  10727. }
  10728. }
  10729. },
  10730. ONGOING: {
  10731. on: {
  10732. END_FAST: {
  10733. target: "COMPLETED"
  10734. }
  10735. }
  10736. },
  10737. COMPLETED: {}
  10738. }
  10739. }
  10740. },
  10741. schema: {
  10742. events: {}
  10743. },
  10744. predictableActionArguments: true,
  10745. preserveActionOrder: true
  10746. }, {
  10747. actions: {
  10748. apple: (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)({}),
  10749. setCurrentStatus: (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)(function (context, event) {
  10750. return {
  10751. currentStatus: event.type
  10752. };
  10753. })
  10754. },
  10755. services: {},
  10756. guards: {},
  10757. delays: {}
  10758. });
  10759. var setSpecifiedState = function setSpecifiedState(currentState, specifiedState) {
  10760. return (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)({
  10761. myMachine: (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["default"])({}, currentState.myMachine), {}, {
  10762. value: specifiedState
  10763. })
  10764. });
  10765. };
  10766. var setSpecifiedStatus = function setSpecifiedStatus(currentState, specifiedState) {
  10767. return (0,xstate__WEBPACK_IMPORTED_MODULE_0__.assign)({
  10768. machine: {
  10769. currentState: currentState,
  10770. specifiedState: specifiedState
  10771. }
  10772. });
  10773. };
  10774. var service = (0,xstate__WEBPACK_IMPORTED_MODULE_0__.interpret)(machine).start();
  10775. // const service = machine.withContext(initialContext).start();
  10776. /* harmony default export */ __webpack_exports__["default"] = (service);
  10777. /***/ }),
  10778. /***/ "./src/utils/time_format.ts":
  10779. /*!**********************************!*\
  10780. !*** ./src/utils/time_format.ts ***!
  10781. \**********************************/
  10782. /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
  10783. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10784. /* harmony export */ TimeFormatter: function() { return /* binding */ TimeFormatter; }
  10785. /* harmony export */ });
  10786. /* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
  10787. /* harmony import */ var _Users_Work_hola_node_modules_babel_runtime_helpers_esm_createClass_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/createClass.js */ "./node_modules/@babel/runtime/helpers/esm/createClass.js");
  10788. var TimeFormatter = /*#__PURE__*/function () {
  10789. function TimeFormatter() {
  10790. (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_classCallCheck_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, TimeFormatter);
  10791. }
  10792. (0,_Users_Work_hola_node_modules_babel_runtime_helpers_esm_createClass_js__WEBPACK_IMPORTED_MODULE_1__["default"])(TimeFormatter, null, [{
  10793. key: "formatTimestamp",
  10794. value:
  10795. //格式化时间
  10796. function formatTimestamp(timestamp) {
  10797. var currentDate = new Date();
  10798. var inputDate = new Date(timestamp);
  10799. // 判断是否是今天
  10800. if (inputDate.getDate() === currentDate.getDate() && inputDate.getMonth() === currentDate.getMonth() && inputDate.getFullYear() === currentDate.getFullYear()) {
  10801. return "\u4ECA\u5929 ".concat(TimeFormatter.formatTime(inputDate));
  10802. }
  10803. // 判断是否是昨天
  10804. var yesterday = new Date();
  10805. yesterday.setDate(currentDate.getDate() - 1);
  10806. if (inputDate.getDate() === yesterday.getDate() && inputDate.getMonth() === yesterday.getMonth() && inputDate.getFullYear() === yesterday.getFullYear()) {
  10807. return "\u6628\u5929 ".concat(TimeFormatter.formatTime(inputDate));
  10808. }
  10809. // 判断是否是明天
  10810. var tomorrow = new Date();
  10811. tomorrow.setDate(currentDate.getDate() + 1);
  10812. if (inputDate.getDate() === tomorrow.getDate() && inputDate.getMonth() === tomorrow.getMonth() && inputDate.getFullYear() === tomorrow.getFullYear()) {
  10813. return "\u660E\u5929 ".concat(TimeFormatter.formatTime(inputDate));
  10814. }
  10815. // 返回 YYYY-MM-DD HH:mm
  10816. return "".concat(inputDate.getFullYear(), "-").concat(TimeFormatter.formatNumber(inputDate.getMonth() + 1), "-").concat(TimeFormatter.formatNumber(inputDate.getDate()), " ").concat(TimeFormatter.formatTime(inputDate));
  10817. }
  10818. }, {
  10819. key: "formatTime",
  10820. value: function formatTime(date) {
  10821. return "".concat(TimeFormatter.formatNumber(date.getHours()), ":").concat(TimeFormatter.formatNumber(date.getMinutes()));
  10822. }
  10823. }, {
  10824. key: "formatNumber",
  10825. value: function formatNumber(num) {
  10826. return num.toString().padStart(2, '0');
  10827. }
  10828. //计算时间间隔
  10829. }, {
  10830. key: "calculateTimeDifference",
  10831. value: function calculateTimeDifference(startTimestamp, endTimestamp) {
  10832. var diff = Math.abs(endTimestamp - startTimestamp);
  10833. // 计算小时、分钟和秒数
  10834. var hours = Math.floor(diff / (1000 * 60 * 60));
  10835. var minutes = Math.floor(diff % (1000 * 60 * 60) / (1000 * 60));
  10836. var seconds = Math.floor(diff % (1000 * 60) / 1000);
  10837. // 根据间隔的大小返回不同的格式
  10838. if (diff < 60000) {
  10839. return "".concat(seconds, "\u79D2");
  10840. } else if (diff < 3600000) {
  10841. return "".concat(minutes, "\u5206").concat(seconds, "\u79D2");
  10842. } else {
  10843. return "".concat(hours, "\u5C0F\u65F6").concat(minutes, "\u5206").concat(seconds, "\u79D2");
  10844. }
  10845. }
  10846. }]);
  10847. return TimeFormatter;
  10848. }();
  10849. /***/ }),
  10850. /***/ "./node_modules/taro-ui/dist/style/components/float-layout.scss":
  10851. /*!**********************************************************************!*\
  10852. !*** ./node_modules/taro-ui/dist/style/components/float-layout.scss ***!
  10853. \**********************************************************************/
  10854. /***/ (function() {
  10855. // extracted by mini-css-extract-plugin
  10856. /***/ }),
  10857. /***/ "./node_modules/@babel/runtime/helpers/esm/classCallCheck.js":
  10858. /*!*******************************************************************!*\
  10859. !*** ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***!
  10860. \*******************************************************************/
  10861. /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
  10862. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10863. /* harmony export */ "default": function() { return /* binding */ _classCallCheck; }
  10864. /* harmony export */ });
  10865. function _classCallCheck(instance, Constructor) {
  10866. if (!(instance instanceof Constructor)) {
  10867. throw new TypeError("Cannot call a class as a function");
  10868. }
  10869. }
  10870. /***/ }),
  10871. /***/ "./node_modules/@babel/runtime/helpers/esm/createClass.js":
  10872. /*!****************************************************************!*\
  10873. !*** ./node_modules/@babel/runtime/helpers/esm/createClass.js ***!
  10874. \****************************************************************/
  10875. /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
  10876. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10877. /* harmony export */ "default": function() { return /* binding */ _createClass; }
  10878. /* harmony export */ });
  10879. /* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
  10880. function _defineProperties(target, props) {
  10881. for (var i = 0; i < props.length; i++) {
  10882. var descriptor = props[i];
  10883. descriptor.enumerable = descriptor.enumerable || false;
  10884. descriptor.configurable = true;
  10885. if ("value" in descriptor) descriptor.writable = true;
  10886. Object.defineProperty(target, (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(descriptor.key), descriptor);
  10887. }
  10888. }
  10889. function _createClass(Constructor, protoProps, staticProps) {
  10890. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  10891. if (staticProps) _defineProperties(Constructor, staticProps);
  10892. Object.defineProperty(Constructor, "prototype", {
  10893. writable: false
  10894. });
  10895. return Constructor;
  10896. }
  10897. /***/ })
  10898. },
  10899. /******/ function(__webpack_require__) { // webpackRuntimeModules
  10900. /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
  10901. /******/ __webpack_require__.O(0, ["taro","vendors","common"], function() { return __webpack_exec__("./src/pages/Clock.tsx"); });
  10902. /******/ var __webpack_exports__ = __webpack_require__.O();
  10903. /******/ }
  10904. ]);
  10905. //# sourceMappingURL=Clock.js.map