tui-calendar.js 1.1 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452
  1. /*!
  2. * TOAST UI Calendar
  3. * @version 1.14.1 | Wed Sep 01 2021
  4. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  5. * @license MIT
  6. */
  7. (function webpackUniversalModuleDefinition(root, factory) {
  8. if(typeof exports === 'object' && typeof module === 'object')
  9. module.exports = factory(require("tui-code-snippet"), require("tui-date-picker"));
  10. else if(typeof define === 'function' && define.amd)
  11. define(["tui-code-snippet", "tui-date-picker"], factory);
  12. else if(typeof exports === 'object')
  13. exports["Calendar"] = factory(require("tui-code-snippet"), require("tui-date-picker"));
  14. else
  15. root["tui"] = root["tui"] || {}, root["tui"]["Calendar"] = factory((root["tui"] && root["tui"]["util"]), (root["tui"] && root["tui"]["DatePicker"]));
  16. })(window, function(__WEBPACK_EXTERNAL_MODULE_tui_code_snippet__, __WEBPACK_EXTERNAL_MODULE_tui_date_picker__) {
  17. return /******/ (function(modules) { // webpackBootstrap
  18. /******/ // The module cache
  19. /******/ var installedModules = {};
  20. /******/
  21. /******/ // The require function
  22. /******/ function __webpack_require__(moduleId) {
  23. /******/
  24. /******/ // Check if module is in cache
  25. /******/ if(installedModules[moduleId]) {
  26. /******/ return installedModules[moduleId].exports;
  27. /******/ }
  28. /******/ // Create a new module (and put it into the cache)
  29. /******/ var module = installedModules[moduleId] = {
  30. /******/ i: moduleId,
  31. /******/ l: false,
  32. /******/ exports: {}
  33. /******/ };
  34. /******/
  35. /******/ // Execute the module function
  36. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  37. /******/
  38. /******/ // Flag the module as loaded
  39. /******/ module.l = true;
  40. /******/
  41. /******/ // Return the exports of the module
  42. /******/ return module.exports;
  43. /******/ }
  44. /******/
  45. /******/
  46. /******/ // expose the modules object (__webpack_modules__)
  47. /******/ __webpack_require__.m = modules;
  48. /******/
  49. /******/ // expose the module cache
  50. /******/ __webpack_require__.c = installedModules;
  51. /******/
  52. /******/ // define getter function for harmony exports
  53. /******/ __webpack_require__.d = function(exports, name, getter) {
  54. /******/ if(!__webpack_require__.o(exports, name)) {
  55. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  56. /******/ }
  57. /******/ };
  58. /******/
  59. /******/ // define __esModule on exports
  60. /******/ __webpack_require__.r = function(exports) {
  61. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  62. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  63. /******/ }
  64. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  65. /******/ };
  66. /******/
  67. /******/ // create a fake namespace object
  68. /******/ // mode & 1: value is a module id, require it
  69. /******/ // mode & 2: merge all properties of value into the ns
  70. /******/ // mode & 4: return value when already ns object
  71. /******/ // mode & 8|1: behave like require
  72. /******/ __webpack_require__.t = function(value, mode) {
  73. /******/ if(mode & 1) value = __webpack_require__(value);
  74. /******/ if(mode & 8) return value;
  75. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  76. /******/ var ns = Object.create(null);
  77. /******/ __webpack_require__.r(ns);
  78. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  79. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  80. /******/ return ns;
  81. /******/ };
  82. /******/
  83. /******/ // getDefaultExport function for compatibility with non-harmony modules
  84. /******/ __webpack_require__.n = function(module) {
  85. /******/ var getter = module && module.__esModule ?
  86. /******/ function getDefault() { return module['default']; } :
  87. /******/ function getModuleExports() { return module; };
  88. /******/ __webpack_require__.d(getter, 'a', getter);
  89. /******/ return getter;
  90. /******/ };
  91. /******/
  92. /******/ // Object.prototype.hasOwnProperty.call
  93. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  94. /******/
  95. /******/ // __webpack_public_path__
  96. /******/ __webpack_require__.p = "/dist";
  97. /******/
  98. /******/
  99. /******/ // Load entry module and return exports
  100. /******/ return __webpack_require__(__webpack_require__.s = "./src/index.js");
  101. /******/ })
  102. /************************************************************************/
  103. /******/ ({
  104. /***/ "./node_modules/dompurify/dist/purify.js":
  105. /*!***********************************************!*\
  106. !*** ./node_modules/dompurify/dist/purify.js ***!
  107. \***********************************************/
  108. /*! no static exports found */
  109. /***/ (function(module, exports, __webpack_require__) {
  110. /*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */
  111. (function (global, factory) {
  112. true ? module.exports = factory() :
  113. undefined;
  114. }(this, function () { 'use strict';
  115. function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  116. var hasOwnProperty = Object.hasOwnProperty,
  117. setPrototypeOf = Object.setPrototypeOf,
  118. isFrozen = Object.isFrozen,
  119. getPrototypeOf = Object.getPrototypeOf,
  120. getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  121. var freeze = Object.freeze,
  122. seal = Object.seal,
  123. create = Object.create; // eslint-disable-line import/no-mutable-exports
  124. var _ref = typeof Reflect !== 'undefined' && Reflect,
  125. apply = _ref.apply,
  126. construct = _ref.construct;
  127. if (!apply) {
  128. apply = function apply(fun, thisValue, args) {
  129. return fun.apply(thisValue, args);
  130. };
  131. }
  132. if (!freeze) {
  133. freeze = function freeze(x) {
  134. return x;
  135. };
  136. }
  137. if (!seal) {
  138. seal = function seal(x) {
  139. return x;
  140. };
  141. }
  142. if (!construct) {
  143. construct = function construct(Func, args) {
  144. return new (Function.prototype.bind.apply(Func, [null].concat(_toConsumableArray(args))))();
  145. };
  146. }
  147. var arrayForEach = unapply(Array.prototype.forEach);
  148. var arrayPop = unapply(Array.prototype.pop);
  149. var arrayPush = unapply(Array.prototype.push);
  150. var stringToLowerCase = unapply(String.prototype.toLowerCase);
  151. var stringMatch = unapply(String.prototype.match);
  152. var stringReplace = unapply(String.prototype.replace);
  153. var stringIndexOf = unapply(String.prototype.indexOf);
  154. var stringTrim = unapply(String.prototype.trim);
  155. var regExpTest = unapply(RegExp.prototype.test);
  156. var typeErrorCreate = unconstruct(TypeError);
  157. function unapply(func) {
  158. return function (thisArg) {
  159. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  160. args[_key - 1] = arguments[_key];
  161. }
  162. return apply(func, thisArg, args);
  163. };
  164. }
  165. function unconstruct(func) {
  166. return function () {
  167. for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  168. args[_key2] = arguments[_key2];
  169. }
  170. return construct(func, args);
  171. };
  172. }
  173. /* Add properties to a lookup table */
  174. function addToSet(set, array) {
  175. if (setPrototypeOf) {
  176. // Make 'in' and truthy checks like Boolean(set.constructor)
  177. // independent of any properties defined on Object.prototype.
  178. // Prevent prototype setters from intercepting set as a this value.
  179. setPrototypeOf(set, null);
  180. }
  181. var l = array.length;
  182. while (l--) {
  183. var element = array[l];
  184. if (typeof element === 'string') {
  185. var lcElement = stringToLowerCase(element);
  186. if (lcElement !== element) {
  187. // Config presets (e.g. tags.js, attrs.js) are immutable.
  188. if (!isFrozen(array)) {
  189. array[l] = lcElement;
  190. }
  191. element = lcElement;
  192. }
  193. }
  194. set[element] = true;
  195. }
  196. return set;
  197. }
  198. /* Shallow clone an object */
  199. function clone(object) {
  200. var newObject = create(null);
  201. var property = void 0;
  202. for (property in object) {
  203. if (apply(hasOwnProperty, object, [property])) {
  204. newObject[property] = object[property];
  205. }
  206. }
  207. return newObject;
  208. }
  209. /* IE10 doesn't support __lookupGetter__ so lets'
  210. * simulate it. It also automatically checks
  211. * if the prop is function or getter and behaves
  212. * accordingly. */
  213. function lookupGetter(object, prop) {
  214. while (object !== null) {
  215. var desc = getOwnPropertyDescriptor(object, prop);
  216. if (desc) {
  217. if (desc.get) {
  218. return unapply(desc.get);
  219. }
  220. if (typeof desc.value === 'function') {
  221. return unapply(desc.value);
  222. }
  223. }
  224. object = getPrototypeOf(object);
  225. }
  226. function fallbackValue(element) {
  227. console.warn('fallback value for', element);
  228. return null;
  229. }
  230. return fallbackValue;
  231. }
  232. var html = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
  233. // SVG
  234. var svg = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
  235. var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
  236. // List of SVG elements that are disallowed by default.
  237. // We still need to know them so that we can do namespace
  238. // checks properly in case one wants to add them to
  239. // allow-list.
  240. var svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'feimage', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
  241. var mathMl = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']);
  242. // Similarly to SVG, we want to know all MathML elements,
  243. // even those that we disallow by default.
  244. var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
  245. var text = freeze(['#text']);
  246. var html$1 = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);
  247. var svg$1 = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
  248. var mathMl$1 = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
  249. var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
  250. // eslint-disable-next-line unicorn/better-regex
  251. var MUSTACHE_EXPR = seal(/\{\{[\s\S]*|[\s\S]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
  252. var ERB_EXPR = seal(/<%[\s\S]*|[\s\S]*%>/gm);
  253. var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape
  254. var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
  255. var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
  256. );
  257. var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
  258. var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
  259. );
  260. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  261. function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  262. var getGlobal = function getGlobal() {
  263. return typeof window === 'undefined' ? null : window;
  264. };
  265. /**
  266. * Creates a no-op policy for internal use only.
  267. * Don't export this function outside this module!
  268. * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.
  269. * @param {Document} document The document object (to determine policy name suffix)
  270. * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types
  271. * are not supported).
  272. */
  273. var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {
  274. if ((typeof trustedTypes === 'undefined' ? 'undefined' : _typeof(trustedTypes)) !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
  275. return null;
  276. }
  277. // Allow the callers to control the unique policy name
  278. // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
  279. // Policy creation with duplicate names throws in Trusted Types.
  280. var suffix = null;
  281. var ATTR_NAME = 'data-tt-policy-suffix';
  282. if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {
  283. suffix = document.currentScript.getAttribute(ATTR_NAME);
  284. }
  285. var policyName = 'dompurify' + (suffix ? '#' + suffix : '');
  286. try {
  287. return trustedTypes.createPolicy(policyName, {
  288. createHTML: function createHTML(html$$1) {
  289. return html$$1;
  290. }
  291. });
  292. } catch (_) {
  293. // Policy creation failed (most likely another DOMPurify script has
  294. // already run). Skip creating the policy, as this will only cause errors
  295. // if TT are enforced.
  296. console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
  297. return null;
  298. }
  299. };
  300. function createDOMPurify() {
  301. var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
  302. var DOMPurify = function DOMPurify(root) {
  303. return createDOMPurify(root);
  304. };
  305. /**
  306. * Version label, exposed for easier checks
  307. * if DOMPurify is up to date or not
  308. */
  309. DOMPurify.version = '2.3.1';
  310. /**
  311. * Array of elements that DOMPurify removed during sanitation.
  312. * Empty if nothing was removed.
  313. */
  314. DOMPurify.removed = [];
  315. if (!window || !window.document || window.document.nodeType !== 9) {
  316. // Not running in a browser, provide a factory function
  317. // so that you can pass your own Window
  318. DOMPurify.isSupported = false;
  319. return DOMPurify;
  320. }
  321. var originalDocument = window.document;
  322. var document = window.document;
  323. var DocumentFragment = window.DocumentFragment,
  324. HTMLTemplateElement = window.HTMLTemplateElement,
  325. Node = window.Node,
  326. Element = window.Element,
  327. NodeFilter = window.NodeFilter,
  328. _window$NamedNodeMap = window.NamedNodeMap,
  329. NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,
  330. Text = window.Text,
  331. Comment = window.Comment,
  332. DOMParser = window.DOMParser,
  333. trustedTypes = window.trustedTypes;
  334. var ElementPrototype = Element.prototype;
  335. var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
  336. var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
  337. var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
  338. var getParentNode = lookupGetter(ElementPrototype, 'parentNode');
  339. // As per issue #47, the web-components registry is inherited by a
  340. // new document created via createHTMLDocument. As per the spec
  341. // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
  342. // a new empty registry is used when creating a template contents owner
  343. // document, so we use that as our parent document to ensure nothing
  344. // is inherited.
  345. if (typeof HTMLTemplateElement === 'function') {
  346. var template = document.createElement('template');
  347. if (template.content && template.content.ownerDocument) {
  348. document = template.content.ownerDocument;
  349. }
  350. }
  351. var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
  352. var emptyHTML = trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML('') : '';
  353. var _document = document,
  354. implementation = _document.implementation,
  355. createNodeIterator = _document.createNodeIterator,
  356. createDocumentFragment = _document.createDocumentFragment,
  357. getElementsByTagName = _document.getElementsByTagName;
  358. var importNode = originalDocument.importNode;
  359. var documentMode = {};
  360. try {
  361. documentMode = clone(document).documentMode ? document.documentMode : {};
  362. } catch (_) {}
  363. var hooks = {};
  364. /**
  365. * Expose whether this browser supports running the full DOMPurify.
  366. */
  367. DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9;
  368. var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR,
  369. ERB_EXPR$$1 = ERB_EXPR,
  370. DATA_ATTR$$1 = DATA_ATTR,
  371. ARIA_ATTR$$1 = ARIA_ATTR,
  372. IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA,
  373. ATTR_WHITESPACE$$1 = ATTR_WHITESPACE;
  374. var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI;
  375. /**
  376. * We consider the elements and attributes below to be safe. Ideally
  377. * don't add any new ones but feel free to remove unwanted ones.
  378. */
  379. /* allowed element names */
  380. var ALLOWED_TAGS = null;
  381. var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(html), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(text)));
  382. /* Allowed attribute names */
  383. var ALLOWED_ATTR = null;
  384. var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml)));
  385. /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
  386. var FORBID_TAGS = null;
  387. /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
  388. var FORBID_ATTR = null;
  389. /* Decide if ARIA attributes are okay */
  390. var ALLOW_ARIA_ATTR = true;
  391. /* Decide if custom data attributes are okay */
  392. var ALLOW_DATA_ATTR = true;
  393. /* Decide if unknown protocols are okay */
  394. var ALLOW_UNKNOWN_PROTOCOLS = false;
  395. /* Output should be safe for common template engines.
  396. * This means, DOMPurify removes data attributes, mustaches and ERB
  397. */
  398. var SAFE_FOR_TEMPLATES = false;
  399. /* Decide if document with <html>... should be returned */
  400. var WHOLE_DOCUMENT = false;
  401. /* Track whether config is already set on this instance of DOMPurify. */
  402. var SET_CONFIG = false;
  403. /* Decide if all elements (e.g. style, script) must be children of
  404. * document.body. By default, browsers might move them to document.head */
  405. var FORCE_BODY = false;
  406. /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
  407. * string (or a TrustedHTML object if Trusted Types are supported).
  408. * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
  409. */
  410. var RETURN_DOM = false;
  411. /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
  412. * string (or a TrustedHTML object if Trusted Types are supported) */
  413. var RETURN_DOM_FRAGMENT = false;
  414. /* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM
  415. * `Node` is imported into the current `Document`. If this flag is not enabled the
  416. * `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by
  417. * DOMPurify.
  418. *
  419. * This defaults to `true` starting DOMPurify 2.2.0. Note that setting it to `false`
  420. * might cause XSS from attacks hidden in closed shadowroots in case the browser
  421. * supports Declarative Shadow: DOM https://web.dev/declarative-shadow-dom/
  422. */
  423. var RETURN_DOM_IMPORT = true;
  424. /* Try to return a Trusted Type object instead of a string, return a string in
  425. * case Trusted Types are not supported */
  426. var RETURN_TRUSTED_TYPE = false;
  427. /* Output should be free from DOM clobbering attacks? */
  428. var SANITIZE_DOM = true;
  429. /* Keep element content when removing element? */
  430. var KEEP_CONTENT = true;
  431. /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
  432. * of importing it into a new Document and returning a sanitized copy */
  433. var IN_PLACE = false;
  434. /* Allow usage of profiles like html, svg and mathMl */
  435. var USE_PROFILES = {};
  436. /* Tags to ignore content of when KEEP_CONTENT is true */
  437. var FORBID_CONTENTS = null;
  438. var DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
  439. /* Tags that are safe for data: URIs */
  440. var DATA_URI_TAGS = null;
  441. var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
  442. /* Attributes safe for values like "javascript:" */
  443. var URI_SAFE_ATTRIBUTES = null;
  444. var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
  445. var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
  446. var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
  447. var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
  448. /* Document namespace */
  449. var NAMESPACE = HTML_NAMESPACE;
  450. var IS_EMPTY_INPUT = false;
  451. /* Keep a reference to config to pass to hooks */
  452. var CONFIG = null;
  453. /* Ideally, do not touch anything below this line */
  454. /* ______________________________________________ */
  455. var formElement = document.createElement('form');
  456. /**
  457. * _parseConfig
  458. *
  459. * @param {Object} cfg optional config literal
  460. */
  461. // eslint-disable-next-line complexity
  462. var _parseConfig = function _parseConfig(cfg) {
  463. if (CONFIG && CONFIG === cfg) {
  464. return;
  465. }
  466. /* Shield configuration object from tampering */
  467. if (!cfg || (typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') {
  468. cfg = {};
  469. }
  470. /* Shield configuration object from prototype pollution */
  471. cfg = clone(cfg);
  472. /* Set configuration parameters */
  473. ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;
  474. ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;
  475. URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES;
  476. DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS;
  477. FORBID_CONTENTS = 'FORBID_CONTENTS' in cfg ? addToSet({}, cfg.FORBID_CONTENTS) : DEFAULT_FORBID_CONTENTS;
  478. FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};
  479. FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};
  480. USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;
  481. ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
  482. ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
  483. ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
  484. SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
  485. WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
  486. RETURN_DOM = cfg.RETURN_DOM || false; // Default false
  487. RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
  488. RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT !== false; // Default true
  489. RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
  490. FORCE_BODY = cfg.FORCE_BODY || false; // Default false
  491. SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
  492. KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
  493. IN_PLACE = cfg.IN_PLACE || false; // Default false
  494. IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1;
  495. NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
  496. if (SAFE_FOR_TEMPLATES) {
  497. ALLOW_DATA_ATTR = false;
  498. }
  499. if (RETURN_DOM_FRAGMENT) {
  500. RETURN_DOM = true;
  501. }
  502. /* Parse profile info */
  503. if (USE_PROFILES) {
  504. ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(text)));
  505. ALLOWED_ATTR = [];
  506. if (USE_PROFILES.html === true) {
  507. addToSet(ALLOWED_TAGS, html);
  508. addToSet(ALLOWED_ATTR, html$1);
  509. }
  510. if (USE_PROFILES.svg === true) {
  511. addToSet(ALLOWED_TAGS, svg);
  512. addToSet(ALLOWED_ATTR, svg$1);
  513. addToSet(ALLOWED_ATTR, xml);
  514. }
  515. if (USE_PROFILES.svgFilters === true) {
  516. addToSet(ALLOWED_TAGS, svgFilters);
  517. addToSet(ALLOWED_ATTR, svg$1);
  518. addToSet(ALLOWED_ATTR, xml);
  519. }
  520. if (USE_PROFILES.mathMl === true) {
  521. addToSet(ALLOWED_TAGS, mathMl);
  522. addToSet(ALLOWED_ATTR, mathMl$1);
  523. addToSet(ALLOWED_ATTR, xml);
  524. }
  525. }
  526. /* Merge configuration parameters */
  527. if (cfg.ADD_TAGS) {
  528. if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
  529. ALLOWED_TAGS = clone(ALLOWED_TAGS);
  530. }
  531. addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);
  532. }
  533. if (cfg.ADD_ATTR) {
  534. if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
  535. ALLOWED_ATTR = clone(ALLOWED_ATTR);
  536. }
  537. addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);
  538. }
  539. if (cfg.ADD_URI_SAFE_ATTR) {
  540. addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);
  541. }
  542. if (cfg.FORBID_CONTENTS) {
  543. if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
  544. FORBID_CONTENTS = clone(FORBID_CONTENTS);
  545. }
  546. addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS);
  547. }
  548. /* Add #text in case KEEP_CONTENT is set to true */
  549. if (KEEP_CONTENT) {
  550. ALLOWED_TAGS['#text'] = true;
  551. }
  552. /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
  553. if (WHOLE_DOCUMENT) {
  554. addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
  555. }
  556. /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
  557. if (ALLOWED_TAGS.table) {
  558. addToSet(ALLOWED_TAGS, ['tbody']);
  559. delete FORBID_TAGS.tbody;
  560. }
  561. // Prevent further manipulation of configuration.
  562. // Not available in IE8, Safari 5, etc.
  563. if (freeze) {
  564. freeze(cfg);
  565. }
  566. CONFIG = cfg;
  567. };
  568. var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
  569. var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);
  570. /* Keep track of all possible SVG and MathML tags
  571. * so that we can perform the namespace checks
  572. * correctly. */
  573. var ALL_SVG_TAGS = addToSet({}, svg);
  574. addToSet(ALL_SVG_TAGS, svgFilters);
  575. addToSet(ALL_SVG_TAGS, svgDisallowed);
  576. var ALL_MATHML_TAGS = addToSet({}, mathMl);
  577. addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
  578. /**
  579. *
  580. *
  581. * @param {Element} element a DOM element whose namespace is being checked
  582. * @returns {boolean} Return false if the element has a
  583. * namespace that a spec-compliant parser would never
  584. * return. Return true otherwise.
  585. */
  586. var _checkValidNamespace = function _checkValidNamespace(element) {
  587. var parent = getParentNode(element);
  588. // In JSDOM, if we're inside shadow DOM, then parentNode
  589. // can be null. We just simulate parent in this case.
  590. if (!parent || !parent.tagName) {
  591. parent = {
  592. namespaceURI: HTML_NAMESPACE,
  593. tagName: 'template'
  594. };
  595. }
  596. var tagName = stringToLowerCase(element.tagName);
  597. var parentTagName = stringToLowerCase(parent.tagName);
  598. if (element.namespaceURI === SVG_NAMESPACE) {
  599. // The only way to switch from HTML namespace to SVG
  600. // is via <svg>. If it happens via any other tag, then
  601. // it should be killed.
  602. if (parent.namespaceURI === HTML_NAMESPACE) {
  603. return tagName === 'svg';
  604. }
  605. // The only way to switch from MathML to SVG is via
  606. // svg if parent is either <annotation-xml> or MathML
  607. // text integration points.
  608. if (parent.namespaceURI === MATHML_NAMESPACE) {
  609. return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
  610. }
  611. // We only allow elements that are defined in SVG
  612. // spec. All others are disallowed in SVG namespace.
  613. return Boolean(ALL_SVG_TAGS[tagName]);
  614. }
  615. if (element.namespaceURI === MATHML_NAMESPACE) {
  616. // The only way to switch from HTML namespace to MathML
  617. // is via <math>. If it happens via any other tag, then
  618. // it should be killed.
  619. if (parent.namespaceURI === HTML_NAMESPACE) {
  620. return tagName === 'math';
  621. }
  622. // The only way to switch from SVG to MathML is via
  623. // <math> and HTML integration points
  624. if (parent.namespaceURI === SVG_NAMESPACE) {
  625. return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
  626. }
  627. // We only allow elements that are defined in MathML
  628. // spec. All others are disallowed in MathML namespace.
  629. return Boolean(ALL_MATHML_TAGS[tagName]);
  630. }
  631. if (element.namespaceURI === HTML_NAMESPACE) {
  632. // The only way to switch from SVG to HTML is via
  633. // HTML integration points, and from MathML to HTML
  634. // is via MathML text integration points
  635. if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
  636. return false;
  637. }
  638. if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
  639. return false;
  640. }
  641. // Certain elements are allowed in both SVG and HTML
  642. // namespace. We need to specify them explicitly
  643. // so that they don't get erronously deleted from
  644. // HTML namespace.
  645. var commonSvgAndHTMLElements = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
  646. // We disallow tags that are specific for MathML
  647. // or SVG and should never appear in HTML namespace
  648. return !ALL_MATHML_TAGS[tagName] && (commonSvgAndHTMLElements[tagName] || !ALL_SVG_TAGS[tagName]);
  649. }
  650. // The code should never reach this place (this means
  651. // that the element somehow got namespace that is not
  652. // HTML, SVG or MathML). Return false just in case.
  653. return false;
  654. };
  655. /**
  656. * _forceRemove
  657. *
  658. * @param {Node} node a DOM node
  659. */
  660. var _forceRemove = function _forceRemove(node) {
  661. arrayPush(DOMPurify.removed, { element: node });
  662. try {
  663. // eslint-disable-next-line unicorn/prefer-dom-node-remove
  664. node.parentNode.removeChild(node);
  665. } catch (_) {
  666. try {
  667. node.outerHTML = emptyHTML;
  668. } catch (_) {
  669. node.remove();
  670. }
  671. }
  672. };
  673. /**
  674. * _removeAttribute
  675. *
  676. * @param {String} name an Attribute name
  677. * @param {Node} node a DOM node
  678. */
  679. var _removeAttribute = function _removeAttribute(name, node) {
  680. try {
  681. arrayPush(DOMPurify.removed, {
  682. attribute: node.getAttributeNode(name),
  683. from: node
  684. });
  685. } catch (_) {
  686. arrayPush(DOMPurify.removed, {
  687. attribute: null,
  688. from: node
  689. });
  690. }
  691. node.removeAttribute(name);
  692. // We void attribute values for unremovable "is"" attributes
  693. if (name === 'is' && !ALLOWED_ATTR[name]) {
  694. if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
  695. try {
  696. _forceRemove(node);
  697. } catch (_) {}
  698. } else {
  699. try {
  700. node.setAttribute(name, '');
  701. } catch (_) {}
  702. }
  703. }
  704. };
  705. /**
  706. * _initDocument
  707. *
  708. * @param {String} dirty a string of dirty markup
  709. * @return {Document} a DOM, filled with the dirty markup
  710. */
  711. var _initDocument = function _initDocument(dirty) {
  712. /* Create a HTML document */
  713. var doc = void 0;
  714. var leadingWhitespace = void 0;
  715. if (FORCE_BODY) {
  716. dirty = '<remove></remove>' + dirty;
  717. } else {
  718. /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
  719. var matches = stringMatch(dirty, /^[\r\n\t ]+/);
  720. leadingWhitespace = matches && matches[0];
  721. }
  722. var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
  723. /*
  724. * Use the DOMParser API by default, fallback later if needs be
  725. * DOMParser not work for svg when has multiple root element.
  726. */
  727. if (NAMESPACE === HTML_NAMESPACE) {
  728. try {
  729. doc = new DOMParser().parseFromString(dirtyPayload, 'text/html');
  730. } catch (_) {}
  731. }
  732. /* Use createHTMLDocument in case DOMParser is not available */
  733. if (!doc || !doc.documentElement) {
  734. doc = implementation.createDocument(NAMESPACE, 'template', null);
  735. try {
  736. doc.documentElement.innerHTML = IS_EMPTY_INPUT ? '' : dirtyPayload;
  737. } catch (_) {
  738. // Syntax error if dirtyPayload is invalid xml
  739. }
  740. }
  741. var body = doc.body || doc.documentElement;
  742. if (dirty && leadingWhitespace) {
  743. body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
  744. }
  745. /* Work on whole document or just its body */
  746. if (NAMESPACE === HTML_NAMESPACE) {
  747. return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
  748. }
  749. return WHOLE_DOCUMENT ? doc.documentElement : body;
  750. };
  751. /**
  752. * _createIterator
  753. *
  754. * @param {Document} root document/fragment to create iterator for
  755. * @return {Iterator} iterator instance
  756. */
  757. var _createIterator = function _createIterator(root) {
  758. return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);
  759. };
  760. /**
  761. * _isClobbered
  762. *
  763. * @param {Node} elm element to check for clobbering attacks
  764. * @return {Boolean} true if clobbered, false if safe
  765. */
  766. var _isClobbered = function _isClobbered(elm) {
  767. if (elm instanceof Text || elm instanceof Comment) {
  768. return false;
  769. }
  770. if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function') {
  771. return true;
  772. }
  773. return false;
  774. };
  775. /**
  776. * _isNode
  777. *
  778. * @param {Node} obj object to check whether it's a DOM node
  779. * @return {Boolean} true is object is a DOM node
  780. */
  781. var _isNode = function _isNode(object) {
  782. return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? object instanceof Node : object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';
  783. };
  784. /**
  785. * _executeHook
  786. * Execute user configurable hooks
  787. *
  788. * @param {String} entryPoint Name of the hook's entry point
  789. * @param {Node} currentNode node to work on with the hook
  790. * @param {Object} data additional hook parameters
  791. */
  792. var _executeHook = function _executeHook(entryPoint, currentNode, data) {
  793. if (!hooks[entryPoint]) {
  794. return;
  795. }
  796. arrayForEach(hooks[entryPoint], function (hook) {
  797. hook.call(DOMPurify, currentNode, data, CONFIG);
  798. });
  799. };
  800. /**
  801. * _sanitizeElements
  802. *
  803. * @protect nodeName
  804. * @protect textContent
  805. * @protect removeChild
  806. *
  807. * @param {Node} currentNode to check for permission to exist
  808. * @return {Boolean} true if node was killed, false if left alive
  809. */
  810. var _sanitizeElements = function _sanitizeElements(currentNode) {
  811. var content = void 0;
  812. /* Execute a hook if present */
  813. _executeHook('beforeSanitizeElements', currentNode, null);
  814. /* Check if element is clobbered or can clobber */
  815. if (_isClobbered(currentNode)) {
  816. _forceRemove(currentNode);
  817. return true;
  818. }
  819. /* Check if tagname contains Unicode */
  820. if (stringMatch(currentNode.nodeName, /[\u0080-\uFFFF]/)) {
  821. _forceRemove(currentNode);
  822. return true;
  823. }
  824. /* Now let's check the element's type and name */
  825. var tagName = stringToLowerCase(currentNode.nodeName);
  826. /* Execute a hook if present */
  827. _executeHook('uponSanitizeElement', currentNode, {
  828. tagName: tagName,
  829. allowedTags: ALLOWED_TAGS
  830. });
  831. /* Detect mXSS attempts abusing namespace confusion */
  832. if (!_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
  833. _forceRemove(currentNode);
  834. return true;
  835. }
  836. /* Mitigate a problem with templates inside select */
  837. if (tagName === 'select' && regExpTest(/<template/i, currentNode.innerHTML)) {
  838. _forceRemove(currentNode);
  839. return true;
  840. }
  841. /* Remove element if anything forbids its presence */
  842. if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
  843. /* Keep content except for bad-listed elements */
  844. if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
  845. var parentNode = getParentNode(currentNode) || currentNode.parentNode;
  846. var childNodes = getChildNodes(currentNode) || currentNode.childNodes;
  847. if (childNodes && parentNode) {
  848. var childCount = childNodes.length;
  849. for (var i = childCount - 1; i >= 0; --i) {
  850. parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
  851. }
  852. }
  853. }
  854. _forceRemove(currentNode);
  855. return true;
  856. }
  857. /* Check whether element has a valid namespace */
  858. if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
  859. _forceRemove(currentNode);
  860. return true;
  861. }
  862. if ((tagName === 'noscript' || tagName === 'noembed') && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
  863. _forceRemove(currentNode);
  864. return true;
  865. }
  866. /* Sanitize element content to be template-safe */
  867. if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
  868. /* Get the element's text content */
  869. content = currentNode.textContent;
  870. content = stringReplace(content, MUSTACHE_EXPR$$1, ' ');
  871. content = stringReplace(content, ERB_EXPR$$1, ' ');
  872. if (currentNode.textContent !== content) {
  873. arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
  874. currentNode.textContent = content;
  875. }
  876. }
  877. /* Execute a hook if present */
  878. _executeHook('afterSanitizeElements', currentNode, null);
  879. return false;
  880. };
  881. /**
  882. * _isValidAttribute
  883. *
  884. * @param {string} lcTag Lowercase tag name of containing element.
  885. * @param {string} lcName Lowercase attribute name.
  886. * @param {string} value Attribute value.
  887. * @return {Boolean} Returns true if `value` is valid, otherwise false.
  888. */
  889. // eslint-disable-next-line complexity
  890. var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
  891. /* Make sure attribute cannot clobber */
  892. if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
  893. return false;
  894. }
  895. /* Allow valid data-* attributes: At least one character after "-"
  896. (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
  897. XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
  898. We don't need to check the value; it's always URI safe. */
  899. if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR$$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$$1, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
  900. return false;
  901. /* Check value is safe. First, is attr inert? If so, is safe */
  902. } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if (!value) ; else {
  903. return false;
  904. }
  905. return true;
  906. };
  907. /**
  908. * _sanitizeAttributes
  909. *
  910. * @protect attributes
  911. * @protect nodeName
  912. * @protect removeAttribute
  913. * @protect setAttribute
  914. *
  915. * @param {Node} currentNode to sanitize
  916. */
  917. var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
  918. var attr = void 0;
  919. var value = void 0;
  920. var lcName = void 0;
  921. var l = void 0;
  922. /* Execute a hook if present */
  923. _executeHook('beforeSanitizeAttributes', currentNode, null);
  924. var attributes = currentNode.attributes;
  925. /* Check if we have attributes; if not we might have a text node */
  926. if (!attributes) {
  927. return;
  928. }
  929. var hookEvent = {
  930. attrName: '',
  931. attrValue: '',
  932. keepAttr: true,
  933. allowedAttributes: ALLOWED_ATTR
  934. };
  935. l = attributes.length;
  936. /* Go backwards over all attributes; safely remove bad ones */
  937. while (l--) {
  938. attr = attributes[l];
  939. var _attr = attr,
  940. name = _attr.name,
  941. namespaceURI = _attr.namespaceURI;
  942. value = stringTrim(attr.value);
  943. lcName = stringToLowerCase(name);
  944. /* Execute a hook if present */
  945. hookEvent.attrName = lcName;
  946. hookEvent.attrValue = value;
  947. hookEvent.keepAttr = true;
  948. hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
  949. _executeHook('uponSanitizeAttribute', currentNode, hookEvent);
  950. value = hookEvent.attrValue;
  951. /* Did the hooks approve of the attribute? */
  952. if (hookEvent.forceKeepAttr) {
  953. continue;
  954. }
  955. /* Remove attribute */
  956. _removeAttribute(name, currentNode);
  957. /* Did the hooks approve of the attribute? */
  958. if (!hookEvent.keepAttr) {
  959. continue;
  960. }
  961. /* Work around a security issue in jQuery 3.0 */
  962. if (regExpTest(/\/>/i, value)) {
  963. _removeAttribute(name, currentNode);
  964. continue;
  965. }
  966. /* Sanitize attribute content to be template-safe */
  967. if (SAFE_FOR_TEMPLATES) {
  968. value = stringReplace(value, MUSTACHE_EXPR$$1, ' ');
  969. value = stringReplace(value, ERB_EXPR$$1, ' ');
  970. }
  971. /* Is `value` valid for this attribute? */
  972. var lcTag = currentNode.nodeName.toLowerCase();
  973. if (!_isValidAttribute(lcTag, lcName, value)) {
  974. continue;
  975. }
  976. /* Handle invalid data-* attribute set by try-catching it */
  977. try {
  978. if (namespaceURI) {
  979. currentNode.setAttributeNS(namespaceURI, name, value);
  980. } else {
  981. /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
  982. currentNode.setAttribute(name, value);
  983. }
  984. arrayPop(DOMPurify.removed);
  985. } catch (_) {}
  986. }
  987. /* Execute a hook if present */
  988. _executeHook('afterSanitizeAttributes', currentNode, null);
  989. };
  990. /**
  991. * _sanitizeShadowDOM
  992. *
  993. * @param {DocumentFragment} fragment to iterate over recursively
  994. */
  995. var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
  996. var shadowNode = void 0;
  997. var shadowIterator = _createIterator(fragment);
  998. /* Execute a hook if present */
  999. _executeHook('beforeSanitizeShadowDOM', fragment, null);
  1000. while (shadowNode = shadowIterator.nextNode()) {
  1001. /* Execute a hook if present */
  1002. _executeHook('uponSanitizeShadowNode', shadowNode, null);
  1003. /* Sanitize tags and elements */
  1004. if (_sanitizeElements(shadowNode)) {
  1005. continue;
  1006. }
  1007. /* Deep shadow DOM detected */
  1008. if (shadowNode.content instanceof DocumentFragment) {
  1009. _sanitizeShadowDOM(shadowNode.content);
  1010. }
  1011. /* Check attributes, sanitize if necessary */
  1012. _sanitizeAttributes(shadowNode);
  1013. }
  1014. /* Execute a hook if present */
  1015. _executeHook('afterSanitizeShadowDOM', fragment, null);
  1016. };
  1017. /**
  1018. * Sanitize
  1019. * Public method providing core sanitation functionality
  1020. *
  1021. * @param {String|Node} dirty string or DOM node
  1022. * @param {Object} configuration object
  1023. */
  1024. // eslint-disable-next-line complexity
  1025. DOMPurify.sanitize = function (dirty, cfg) {
  1026. var body = void 0;
  1027. var importedNode = void 0;
  1028. var currentNode = void 0;
  1029. var oldNode = void 0;
  1030. var returnNode = void 0;
  1031. /* Make sure we have a string to sanitize.
  1032. DO NOT return early, as this will return the wrong type if
  1033. the user has requested a DOM object rather than a string */
  1034. IS_EMPTY_INPUT = !dirty;
  1035. if (IS_EMPTY_INPUT) {
  1036. dirty = '<!-->';
  1037. }
  1038. /* Stringify, in case dirty is an object */
  1039. if (typeof dirty !== 'string' && !_isNode(dirty)) {
  1040. // eslint-disable-next-line no-negated-condition
  1041. if (typeof dirty.toString !== 'function') {
  1042. throw typeErrorCreate('toString is not a function');
  1043. } else {
  1044. dirty = dirty.toString();
  1045. if (typeof dirty !== 'string') {
  1046. throw typeErrorCreate('dirty is not a string, aborting');
  1047. }
  1048. }
  1049. }
  1050. /* Check we can run. Otherwise fall back or ignore */
  1051. if (!DOMPurify.isSupported) {
  1052. if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {
  1053. if (typeof dirty === 'string') {
  1054. return window.toStaticHTML(dirty);
  1055. }
  1056. if (_isNode(dirty)) {
  1057. return window.toStaticHTML(dirty.outerHTML);
  1058. }
  1059. }
  1060. return dirty;
  1061. }
  1062. /* Assign config vars */
  1063. if (!SET_CONFIG) {
  1064. _parseConfig(cfg);
  1065. }
  1066. /* Clean up removed elements */
  1067. DOMPurify.removed = [];
  1068. /* Check if dirty is correctly typed for IN_PLACE */
  1069. if (typeof dirty === 'string') {
  1070. IN_PLACE = false;
  1071. }
  1072. if (IN_PLACE) ; else if (dirty instanceof Node) {
  1073. /* If dirty is a DOM element, append to an empty document to avoid
  1074. elements being stripped by the parser */
  1075. body = _initDocument('<!---->');
  1076. importedNode = body.ownerDocument.importNode(dirty, true);
  1077. if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {
  1078. /* Node is already a body, use as is */
  1079. body = importedNode;
  1080. } else if (importedNode.nodeName === 'HTML') {
  1081. body = importedNode;
  1082. } else {
  1083. // eslint-disable-next-line unicorn/prefer-dom-node-append
  1084. body.appendChild(importedNode);
  1085. }
  1086. } else {
  1087. /* Exit directly if we have nothing to do */
  1088. if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
  1089. // eslint-disable-next-line unicorn/prefer-includes
  1090. dirty.indexOf('<') === -1) {
  1091. return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
  1092. }
  1093. /* Initialize the document to work on */
  1094. body = _initDocument(dirty);
  1095. /* Check we have a DOM node from the data */
  1096. if (!body) {
  1097. return RETURN_DOM ? null : emptyHTML;
  1098. }
  1099. }
  1100. /* Remove first element node (ours) if FORCE_BODY is set */
  1101. if (body && FORCE_BODY) {
  1102. _forceRemove(body.firstChild);
  1103. }
  1104. /* Get node iterator */
  1105. var nodeIterator = _createIterator(IN_PLACE ? dirty : body);
  1106. /* Now start iterating over the created document */
  1107. while (currentNode = nodeIterator.nextNode()) {
  1108. /* Fix IE's strange behavior with manipulated textNodes #89 */
  1109. if (currentNode.nodeType === 3 && currentNode === oldNode) {
  1110. continue;
  1111. }
  1112. /* Sanitize tags and elements */
  1113. if (_sanitizeElements(currentNode)) {
  1114. continue;
  1115. }
  1116. /* Shadow DOM detected, sanitize it */
  1117. if (currentNode.content instanceof DocumentFragment) {
  1118. _sanitizeShadowDOM(currentNode.content);
  1119. }
  1120. /* Check attributes, sanitize if necessary */
  1121. _sanitizeAttributes(currentNode);
  1122. oldNode = currentNode;
  1123. }
  1124. oldNode = null;
  1125. /* If we sanitized `dirty` in-place, return it. */
  1126. if (IN_PLACE) {
  1127. return dirty;
  1128. }
  1129. /* Return sanitized string or DOM */
  1130. if (RETURN_DOM) {
  1131. if (RETURN_DOM_FRAGMENT) {
  1132. returnNode = createDocumentFragment.call(body.ownerDocument);
  1133. while (body.firstChild) {
  1134. // eslint-disable-next-line unicorn/prefer-dom-node-append
  1135. returnNode.appendChild(body.firstChild);
  1136. }
  1137. } else {
  1138. returnNode = body;
  1139. }
  1140. if (RETURN_DOM_IMPORT) {
  1141. /*
  1142. AdoptNode() is not used because internal state is not reset
  1143. (e.g. the past names map of a HTMLFormElement), this is safe
  1144. in theory but we would rather not risk another attack vector.
  1145. The state that is cloned by importNode() is explicitly defined
  1146. by the specs.
  1147. */
  1148. returnNode = importNode.call(originalDocument, returnNode, true);
  1149. }
  1150. return returnNode;
  1151. }
  1152. var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
  1153. /* Sanitize final string template-safe */
  1154. if (SAFE_FOR_TEMPLATES) {
  1155. serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$$1, ' ');
  1156. serializedHTML = stringReplace(serializedHTML, ERB_EXPR$$1, ' ');
  1157. }
  1158. return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
  1159. };
  1160. /**
  1161. * Public method to set the configuration once
  1162. * setConfig
  1163. *
  1164. * @param {Object} cfg configuration object
  1165. */
  1166. DOMPurify.setConfig = function (cfg) {
  1167. _parseConfig(cfg);
  1168. SET_CONFIG = true;
  1169. };
  1170. /**
  1171. * Public method to remove the configuration
  1172. * clearConfig
  1173. *
  1174. */
  1175. DOMPurify.clearConfig = function () {
  1176. CONFIG = null;
  1177. SET_CONFIG = false;
  1178. };
  1179. /**
  1180. * Public method to check if an attribute value is valid.
  1181. * Uses last set config, if any. Otherwise, uses config defaults.
  1182. * isValidAttribute
  1183. *
  1184. * @param {string} tag Tag name of containing element.
  1185. * @param {string} attr Attribute name.
  1186. * @param {string} value Attribute value.
  1187. * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
  1188. */
  1189. DOMPurify.isValidAttribute = function (tag, attr, value) {
  1190. /* Initialize shared config vars if necessary. */
  1191. if (!CONFIG) {
  1192. _parseConfig({});
  1193. }
  1194. var lcTag = stringToLowerCase(tag);
  1195. var lcName = stringToLowerCase(attr);
  1196. return _isValidAttribute(lcTag, lcName, value);
  1197. };
  1198. /**
  1199. * AddHook
  1200. * Public method to add DOMPurify hooks
  1201. *
  1202. * @param {String} entryPoint entry point for the hook to add
  1203. * @param {Function} hookFunction function to execute
  1204. */
  1205. DOMPurify.addHook = function (entryPoint, hookFunction) {
  1206. if (typeof hookFunction !== 'function') {
  1207. return;
  1208. }
  1209. hooks[entryPoint] = hooks[entryPoint] || [];
  1210. arrayPush(hooks[entryPoint], hookFunction);
  1211. };
  1212. /**
  1213. * RemoveHook
  1214. * Public method to remove a DOMPurify hook at a given entryPoint
  1215. * (pops it from the stack of hooks if more are present)
  1216. *
  1217. * @param {String} entryPoint entry point for the hook to remove
  1218. */
  1219. DOMPurify.removeHook = function (entryPoint) {
  1220. if (hooks[entryPoint]) {
  1221. arrayPop(hooks[entryPoint]);
  1222. }
  1223. };
  1224. /**
  1225. * RemoveHooks
  1226. * Public method to remove all DOMPurify hooks at a given entryPoint
  1227. *
  1228. * @param {String} entryPoint entry point for the hooks to remove
  1229. */
  1230. DOMPurify.removeHooks = function (entryPoint) {
  1231. if (hooks[entryPoint]) {
  1232. hooks[entryPoint] = [];
  1233. }
  1234. };
  1235. /**
  1236. * RemoveAllHooks
  1237. * Public method to remove all DOMPurify hooks
  1238. *
  1239. */
  1240. DOMPurify.removeAllHooks = function () {
  1241. hooks = {};
  1242. };
  1243. return DOMPurify;
  1244. }
  1245. var purify = createDOMPurify();
  1246. return purify;
  1247. }));
  1248. //# sourceMappingURL=purify.js.map
  1249. /***/ }),
  1250. /***/ "./node_modules/handlebars-template-loader/runtime/index.js":
  1251. /*!******************************************************************!*\
  1252. !*** ./node_modules/handlebars-template-loader/runtime/index.js ***!
  1253. \******************************************************************/
  1254. /*! no static exports found */
  1255. /***/ (function(module, exports, __webpack_require__) {
  1256. module.exports = __webpack_require__(/*! handlebars/runtime */ "./node_modules/handlebars/dist/cjs/handlebars.runtime.js");
  1257. /***/ }),
  1258. /***/ "./node_modules/handlebars/dist/cjs/handlebars.runtime.js":
  1259. /*!****************************************************************!*\
  1260. !*** ./node_modules/handlebars/dist/cjs/handlebars.runtime.js ***!
  1261. \****************************************************************/
  1262. /*! no static exports found */
  1263. /***/ (function(module, exports, __webpack_require__) {
  1264. "use strict";
  1265. exports.__esModule = true;
  1266. // istanbul ignore next
  1267. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  1268. // istanbul ignore next
  1269. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
  1270. var _handlebarsBase = __webpack_require__(/*! ./handlebars/base */ "./node_modules/handlebars/dist/cjs/handlebars/base.js");
  1271. var base = _interopRequireWildcard(_handlebarsBase);
  1272. // Each of these augment the Handlebars object. No need to setup here.
  1273. // (This is done to easily share code between commonjs and browse envs)
  1274. var _handlebarsSafeString = __webpack_require__(/*! ./handlebars/safe-string */ "./node_modules/handlebars/dist/cjs/handlebars/safe-string.js");
  1275. var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
  1276. var _handlebarsException = __webpack_require__(/*! ./handlebars/exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
  1277. var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
  1278. var _handlebarsUtils = __webpack_require__(/*! ./handlebars/utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
  1279. var Utils = _interopRequireWildcard(_handlebarsUtils);
  1280. var _handlebarsRuntime = __webpack_require__(/*! ./handlebars/runtime */ "./node_modules/handlebars/dist/cjs/handlebars/runtime.js");
  1281. var runtime = _interopRequireWildcard(_handlebarsRuntime);
  1282. var _handlebarsNoConflict = __webpack_require__(/*! ./handlebars/no-conflict */ "./node_modules/handlebars/dist/cjs/handlebars/no-conflict.js");
  1283. var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
  1284. // For compatibility and usage outside of module systems, make the Handlebars object a namespace
  1285. function create() {
  1286. var hb = new base.HandlebarsEnvironment();
  1287. Utils.extend(hb, base);
  1288. hb.SafeString = _handlebarsSafeString2['default'];
  1289. hb.Exception = _handlebarsException2['default'];
  1290. hb.Utils = Utils;
  1291. hb.escapeExpression = Utils.escapeExpression;
  1292. hb.VM = runtime;
  1293. hb.template = function (spec) {
  1294. return runtime.template(spec, hb);
  1295. };
  1296. return hb;
  1297. }
  1298. var inst = create();
  1299. inst.create = create;
  1300. _handlebarsNoConflict2['default'](inst);
  1301. inst['default'] = inst;
  1302. exports['default'] = inst;
  1303. module.exports = exports['default'];
  1304. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL2xpYi9oYW5kbGViYXJzLnJ1bnRpbWUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OEJBQXNCLG1CQUFtQjs7SUFBN0IsSUFBSTs7Ozs7b0NBSU8sMEJBQTBCOzs7O21DQUMzQix3QkFBd0I7Ozs7K0JBQ3ZCLG9CQUFvQjs7SUFBL0IsS0FBSzs7aUNBQ1Esc0JBQXNCOztJQUFuQyxPQUFPOztvQ0FFSSwwQkFBMEI7Ozs7O0FBR2pELFNBQVMsTUFBTSxHQUFHO0FBQ2hCLE1BQUksRUFBRSxHQUFHLElBQUksSUFBSSxDQUFDLHFCQUFxQixFQUFFLENBQUM7O0FBRTFDLE9BQUssQ0FBQyxNQUFNLENBQUMsRUFBRSxFQUFFLElBQUksQ0FBQyxDQUFDO0FBQ3ZCLElBQUUsQ0FBQyxVQUFVLG9DQUFhLENBQUM7QUFDM0IsSUFBRSxDQUFDLFNBQVMsbUNBQVksQ0FBQztBQUN6QixJQUFFLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQztBQUNqQixJQUFFLENBQUMsZ0JBQWdCLEdBQUcsS0FBSyxDQUFDLGdCQUFnQixDQUFDOztBQUU3QyxJQUFFLENBQUMsRUFBRSxHQUFHLE9BQU8sQ0FBQztBQUNoQixJQUFFLENBQUMsUUFBUSxHQUFHLFVBQVMsSUFBSSxFQUFFO0FBQzNCLFdBQU8sT0FBTyxDQUFDLFFBQVEsQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLENBQUM7R0FDbkMsQ0FBQzs7QUFFRixTQUFPLEVBQUUsQ0FBQztDQUNYOztBQUVELElBQUksSUFBSSxHQUFHLE1BQU0sRUFBRSxDQUFDO0FBQ3BCLElBQUksQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDOztBQUVyQixrQ0FBVyxJQUFJLENBQUMsQ0FBQzs7QUFFakIsSUFBSSxDQUFDLFNBQVMsQ0FBQyxHQUFHLElBQUksQ0FBQzs7cUJBRVIsSUFBSSIsImZpbGUiOiJoYW5kbGViYXJzLnJ1bnRpbWUuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyBiYXNlIGZyb20gJy4vaGFuZGxlYmFycy9iYXNlJztcblxuLy8gRWFjaCBvZiB0aGVzZSBhdWdtZW50IHRoZSBIYW5kbGViYXJzIG9iamVjdC4gTm8gbmVlZCB0byBzZXR1cCBoZXJlLlxuLy8gKFRoaXMgaXMgZG9uZSB0byBlYXNpbHkgc2hhcmUgY29kZSBiZXR3ZWVuIGNvbW1vbmpzIGFuZCBicm93c2UgZW52cylcbmltcG9ydCBTYWZlU3RyaW5nIGZyb20gJy4vaGFuZGxlYmFycy9zYWZlLXN0cmluZyc7XG5pbXBvcnQgRXhjZXB0aW9uIGZyb20gJy4vaGFuZGxlYmFycy9leGNlcHRpb24nO1xuaW1wb3J0ICogYXMgVXRpbHMgZnJvbSAnLi9oYW5kbGViYXJzL3V0aWxzJztcbmltcG9ydCAqIGFzIHJ1bnRpbWUgZnJvbSAnLi9oYW5kbGViYXJzL3J1bnRpbWUnO1xuXG5pbXBvcnQgbm9Db25mbGljdCBmcm9tICcuL2hhbmRsZWJhcnMvbm8tY29uZmxpY3QnO1xuXG4vLyBGb3IgY29tcGF0aWJpbGl0eSBhbmQgdXNhZ2Ugb3V0c2lkZSBvZiBtb2R1bGUgc3lzdGVtcywgbWFrZSB0aGUgSGFuZGxlYmFycyBvYmplY3QgYSBuYW1lc3BhY2VcbmZ1bmN0aW9uIGNyZWF0ZSgpIHtcbiAgbGV0IGhiID0gbmV3IGJhc2UuSGFuZGxlYmFyc0Vudmlyb25tZW50KCk7XG5cbiAgVXRpbHMuZXh0ZW5kKGhiLCBiYXNlKTtcbiAgaGIuU2FmZVN0cmluZyA9IFNhZmVTdHJpbmc7XG4gIGhiLkV4Y2VwdGlvbiA9IEV4Y2VwdGlvbjtcbiAgaGIuVXRpbHMgPSBVdGlscztcbiAgaGIuZXNjYXBlRXhwcmVzc2lvbiA9IFV0aWxzLmVzY2FwZUV4cHJlc3Npb247XG5cbiAgaGIuVk0gPSBydW50aW1lO1xuICBoYi50ZW1wbGF0ZSA9IGZ1bmN0aW9uKHNwZWMpIHtcbiAgICByZXR1cm4gcnVudGltZS50ZW1wbGF0ZShzcGVjLCBoYik7XG4gIH07XG5cbiAgcmV0dXJuIGhiO1xufVxuXG5sZXQgaW5zdCA9IGNyZWF0ZSgpO1xuaW5zdC5jcmVhdGUgPSBjcmVhdGU7XG5cbm5vQ29uZmxpY3QoaW5zdCk7XG5cbmluc3RbJ2RlZmF1bHQnXSA9IGluc3Q7XG5cbmV4cG9ydCBkZWZhdWx0IGluc3Q7XG4iXX0=
  1305. /***/ }),
  1306. /***/ "./node_modules/handlebars/dist/cjs/handlebars/base.js":
  1307. /*!*************************************************************!*\
  1308. !*** ./node_modules/handlebars/dist/cjs/handlebars/base.js ***!
  1309. \*************************************************************/
  1310. /*! no static exports found */
  1311. /***/ (function(module, exports, __webpack_require__) {
  1312. "use strict";
  1313. exports.__esModule = true;
  1314. exports.HandlebarsEnvironment = HandlebarsEnvironment;
  1315. // istanbul ignore next
  1316. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  1317. var _utils = __webpack_require__(/*! ./utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
  1318. var _exception = __webpack_require__(/*! ./exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
  1319. var _exception2 = _interopRequireDefault(_exception);
  1320. var _helpers = __webpack_require__(/*! ./helpers */ "./node_modules/handlebars/dist/cjs/handlebars/helpers.js");
  1321. var _decorators = __webpack_require__(/*! ./decorators */ "./node_modules/handlebars/dist/cjs/handlebars/decorators.js");
  1322. var _logger = __webpack_require__(/*! ./logger */ "./node_modules/handlebars/dist/cjs/handlebars/logger.js");
  1323. var _logger2 = _interopRequireDefault(_logger);
  1324. var _internalProtoAccess = __webpack_require__(/*! ./internal/proto-access */ "./node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js");
  1325. var VERSION = '4.7.7';
  1326. exports.VERSION = VERSION;
  1327. var COMPILER_REVISION = 8;
  1328. exports.COMPILER_REVISION = COMPILER_REVISION;
  1329. var LAST_COMPATIBLE_COMPILER_REVISION = 7;
  1330. exports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION;
  1331. var REVISION_CHANGES = {
  1332. 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
  1333. 2: '== 1.0.0-rc.3',
  1334. 3: '== 1.0.0-rc.4',
  1335. 4: '== 1.x.x',
  1336. 5: '== 2.0.0-alpha.x',
  1337. 6: '>= 2.0.0-beta.1',
  1338. 7: '>= 4.0.0 <4.3.0',
  1339. 8: '>= 4.3.0'
  1340. };
  1341. exports.REVISION_CHANGES = REVISION_CHANGES;
  1342. var objectType = '[object Object]';
  1343. function HandlebarsEnvironment(helpers, partials, decorators) {
  1344. this.helpers = helpers || {};
  1345. this.partials = partials || {};
  1346. this.decorators = decorators || {};
  1347. _helpers.registerDefaultHelpers(this);
  1348. _decorators.registerDefaultDecorators(this);
  1349. }
  1350. HandlebarsEnvironment.prototype = {
  1351. constructor: HandlebarsEnvironment,
  1352. logger: _logger2['default'],
  1353. log: _logger2['default'].log,
  1354. registerHelper: function registerHelper(name, fn) {
  1355. if (_utils.toString.call(name) === objectType) {
  1356. if (fn) {
  1357. throw new _exception2['default']('Arg not supported with multiple helpers');
  1358. }
  1359. _utils.extend(this.helpers, name);
  1360. } else {
  1361. this.helpers[name] = fn;
  1362. }
  1363. },
  1364. unregisterHelper: function unregisterHelper(name) {
  1365. delete this.helpers[name];
  1366. },
  1367. registerPartial: function registerPartial(name, partial) {
  1368. if (_utils.toString.call(name) === objectType) {
  1369. _utils.extend(this.partials, name);
  1370. } else {
  1371. if (typeof partial === 'undefined') {
  1372. throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
  1373. }
  1374. this.partials[name] = partial;
  1375. }
  1376. },
  1377. unregisterPartial: function unregisterPartial(name) {
  1378. delete this.partials[name];
  1379. },
  1380. registerDecorator: function registerDecorator(name, fn) {
  1381. if (_utils.toString.call(name) === objectType) {
  1382. if (fn) {
  1383. throw new _exception2['default']('Arg not supported with multiple decorators');
  1384. }
  1385. _utils.extend(this.decorators, name);
  1386. } else {
  1387. this.decorators[name] = fn;
  1388. }
  1389. },
  1390. unregisterDecorator: function unregisterDecorator(name) {
  1391. delete this.decorators[name];
  1392. },
  1393. /**
  1394. * Reset the memory of illegal property accesses that have already been logged.
  1395. * @deprecated should only be used in handlebars test-cases
  1396. */
  1397. resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
  1398. _internalProtoAccess.resetLoggedProperties();
  1399. }
  1400. };
  1401. var log = _logger2['default'].log;
  1402. exports.log = log;
  1403. exports.createFrame = _utils.createFrame;
  1404. exports.logger = _logger2['default'];
  1405. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2Jhc2UuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7cUJBQThDLFNBQVM7O3lCQUNqQyxhQUFhOzs7O3VCQUNJLFdBQVc7OzBCQUNSLGNBQWM7O3NCQUNyQyxVQUFVOzs7O21DQUNTLHlCQUF5Qjs7QUFFeEQsSUFBTSxPQUFPLEdBQUcsT0FBTyxDQUFDOztBQUN4QixJQUFNLGlCQUFpQixHQUFHLENBQUMsQ0FBQzs7QUFDNUIsSUFBTSxpQ0FBaUMsR0FBRyxDQUFDLENBQUM7OztBQUU1QyxJQUFNLGdCQUFnQixHQUFHO0FBQzlCLEdBQUMsRUFBRSxhQUFhO0FBQ2hCLEdBQUMsRUFBRSxlQUFlO0FBQ2xCLEdBQUMsRUFBRSxlQUFlO0FBQ2xCLEdBQUMsRUFBRSxVQUFVO0FBQ2IsR0FBQyxFQUFFLGtCQUFrQjtBQUNyQixHQUFDLEVBQUUsaUJBQWlCO0FBQ3BCLEdBQUMsRUFBRSxpQkFBaUI7QUFDcEIsR0FBQyxFQUFFLFVBQVU7Q0FDZCxDQUFDOzs7QUFFRixJQUFNLFVBQVUsR0FBRyxpQkFBaUIsQ0FBQzs7QUFFOUIsU0FBUyxxQkFBcUIsQ0FBQyxPQUFPLEVBQUUsUUFBUSxFQUFFLFVBQVUsRUFBRTtBQUNuRSxNQUFJLENBQUMsT0FBTyxHQUFHLE9BQU8sSUFBSSxFQUFFLENBQUM7QUFDN0IsTUFBSSxDQUFDLFFBQVEsR0FBRyxRQUFRLElBQUksRUFBRSxDQUFDO0FBQy9CLE1BQUksQ0FBQyxVQUFVLEdBQUcsVUFBVSxJQUFJLEVBQUUsQ0FBQzs7QUFFbkMsa0NBQXVCLElBQUksQ0FBQyxDQUFDO0FBQzdCLHdDQUEwQixJQUFJLENBQUMsQ0FBQztDQUNqQzs7QUFFRCxxQkFBcUIsQ0FBQyxTQUFTLEdBQUc7QUFDaEMsYUFBVyxFQUFFLHFCQUFxQjs7QUFFbEMsUUFBTSxxQkFBUTtBQUNkLEtBQUcsRUFBRSxvQkFBTyxHQUFHOztBQUVmLGdCQUFjLEVBQUUsd0JBQVMsSUFBSSxFQUFFLEVBQUUsRUFBRTtBQUNqQyxRQUFJLGdCQUFTLElBQUksQ0FBQyxJQUFJLENBQUMsS0FBSyxVQUFVLEVBQUU7QUFDdEMsVUFBSSxFQUFFLEVBQUU7QUFDTixjQUFNLDJCQUFjLHlDQUF5QyxDQUFDLENBQUM7T0FDaEU7QUFDRCxvQkFBTyxJQUFJLENBQUMsT0FBTyxFQUFFLElBQUksQ0FBQyxDQUFDO0tBQzVCLE1BQU07QUFDTCxVQUFJLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQztLQUN6QjtHQUNGO0FBQ0Qsa0JBQWdCLEVBQUUsMEJBQVMsSUFBSSxFQUFFO0FBQy9CLFdBQU8sSUFBSSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQztHQUMzQjs7QUFFRCxpQkFBZSxFQUFFLHlCQUFTLElBQUksRUFBRSxPQUFPLEVBQUU7QUFDdkMsUUFBSSxnQkFBUyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssVUFBVSxFQUFFO0FBQ3RDLG9CQUFPLElBQUksQ0FBQyxRQUFRLEVBQUUsSUFBSSxDQUFDLENBQUM7S0FDN0IsTUFBTTtBQUNMLFVBQUksT0FBTyxPQUFPLEtBQUssV0FBVyxFQUFFO0FBQ2xDLGNBQU0seUVBQ3dDLElBQUksb0JBQ2pELENBQUM7T0FDSDtBQUNELFVBQUksQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLEdBQUcsT0FBTyxDQUFDO0tBQy9CO0dBQ0Y7QUFDRCxtQkFBaUIsRUFBRSwyQkFBUyxJQUFJLEVBQUU7QUFDaEMsV0FBTyxJQUFJLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxDQUFDO0dBQzVCOztBQUVELG1CQUFpQixFQUFFLDJCQUFTLElBQUksRUFBRSxFQUFFLEVBQUU7QUFDcEMsUUFBSSxnQkFBUyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssVUFBVSxFQUFFO0FBQ3RDLFVBQUksRUFBRSxFQUFFO0FBQ04sY0FBTSwyQkFBYyw0Q0FBNEMsQ0FBQyxDQUFDO09BQ25FO0FBQ0Qsb0JBQU8sSUFBSSxDQUFDLFVBQVUsRUFBRSxJQUFJLENBQUMsQ0FBQztLQUMvQixNQUFNO0FBQ0wsVUFBSSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUM7S0FDNUI7R0FDRjtBQUNELHFCQUFtQixFQUFFLDZCQUFTLElBQUksRUFBRTtBQUNsQyxXQUFPLElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLENBQUM7R0FDOUI7Ozs7O0FBS0QsNkJBQTJCLEVBQUEsdUNBQUc7QUFDNUIsZ0RBQXVCLENBQUM7R0FDekI7Q0FDRixDQUFDOztBQUVLLElBQUksR0FBRyxHQUFHLG9CQUFPLEdBQUcsQ0FBQzs7O1FBRW5CLFdBQVc7UUFBRSxNQUFNIiwiZmlsZSI6ImJhc2UuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjcmVhdGVGcmFtZSwgZXh0ZW5kLCB0b1N0cmluZyB9IGZyb20gJy4vdXRpbHMnO1xuaW1wb3J0IEV4Y2VwdGlvbiBmcm9tICcuL2V4Y2VwdGlvbic7XG5pbXBvcnQgeyByZWdpc3RlckRlZmF1bHRIZWxwZXJzIH0gZnJvbSAnLi9oZWxwZXJzJztcbmltcG9ydCB7IHJlZ2lzdGVyRGVmYXVsdERlY29yYXRvcnMgfSBmcm9tICcuL2RlY29yYXRvcnMnO1xuaW1wb3J0IGxvZ2dlciBmcm9tICcuL2xvZ2dlcic7XG5pbXBvcnQgeyByZXNldExvZ2dlZFByb3BlcnRpZXMgfSBmcm9tICcuL2ludGVybmFsL3Byb3RvLWFjY2Vzcyc7XG5cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gJzQuNy43JztcbmV4cG9ydCBjb25zdCBDT01QSUxFUl9SRVZJU0lPTiA9IDg7XG5leHBvcnQgY29uc3QgTEFTVF9DT01QQVRJQkxFX0NPTVBJTEVSX1JFVklTSU9OID0gNztcblxuZXhwb3J0IGNvbnN0IFJFVklTSU9OX0NIQU5HRVMgPSB7XG4gIDE6ICc8PSAxLjAucmMuMicsIC8vIDEuMC5yYy4yIGlzIGFjdHVhbGx5IHJldjIgYnV0IGRvZXNuJ3QgcmVwb3J0IGl0XG4gIDI6ICc9PSAxLjAuMC1yYy4zJyxcbiAgMzogJz09IDEuMC4wLXJjLjQnLFxuICA0OiAnPT0gMS54LngnLFxuICA1OiAnPT0gMi4wLjAtYWxwaGEueCcsXG4gIDY6ICc+PSAyLjAuMC1iZXRhLjEnLFxuICA3OiAnPj0gNC4wLjAgPDQuMy4wJyxcbiAgODogJz49IDQuMy4wJ1xufTtcblxuY29uc3Qgb2JqZWN0VHlwZSA9ICdbb2JqZWN0IE9iamVjdF0nO1xuXG5leHBvcnQgZnVuY3Rpb24gSGFuZGxlYmFyc0Vudmlyb25tZW50KGhlbHBlcnMsIHBhcnRpYWxzLCBkZWNvcmF0b3JzKSB7XG4gIHRoaXMuaGVscGVycyA9IGhlbHBlcnMgfHwge307XG4gIHRoaXMucGFydGlhbHMgPSBwYXJ0aWFscyB8fCB7fTtcbiAgdGhpcy5kZWNvcmF0b3JzID0gZGVjb3JhdG9ycyB8fCB7fTtcblxuICByZWdpc3RlckRlZmF1bHRIZWxwZXJzKHRoaXMpO1xuICByZWdpc3RlckRlZmF1bHREZWNvcmF0b3JzKHRoaXMpO1xufVxuXG5IYW5kbGViYXJzRW52aXJvbm1lbnQucHJvdG90eXBlID0ge1xuICBjb25zdHJ1Y3RvcjogSGFuZGxlYmFyc0Vudmlyb25tZW50LFxuXG4gIGxvZ2dlcjogbG9nZ2VyLFxuICBsb2c6IGxvZ2dlci5sb2csXG5cbiAgcmVnaXN0ZXJIZWxwZXI6IGZ1bmN0aW9uKG5hbWUsIGZuKSB7XG4gICAgaWYgKHRvU3RyaW5nLmNhbGwobmFtZSkgPT09IG9iamVjdFR5cGUpIHtcbiAgICAgIGlmIChmbikge1xuICAgICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCdBcmcgbm90IHN1cHBvcnRlZCB3aXRoIG11bHRpcGxlIGhlbHBlcnMnKTtcbiAgICAgIH1cbiAgICAgIGV4dGVuZCh0aGlzLmhlbHBlcnMsIG5hbWUpO1xuICAgIH0gZWxzZSB7XG4gICAgICB0aGlzLmhlbHBlcnNbbmFtZV0gPSBmbjtcbiAgICB9XG4gIH0sXG4gIHVucmVnaXN0ZXJIZWxwZXI6IGZ1bmN0aW9uKG5hbWUpIHtcbiAgICBkZWxldGUgdGhpcy5oZWxwZXJzW25hbWVdO1xuICB9LFxuXG4gIHJlZ2lzdGVyUGFydGlhbDogZnVuY3Rpb24obmFtZSwgcGFydGlhbCkge1xuICAgIGlmICh0b1N0cmluZy5jYWxsKG5hbWUpID09PSBvYmplY3RUeXBlKSB7XG4gICAgICBleHRlbmQodGhpcy5wYXJ0aWFscywgbmFtZSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmICh0eXBlb2YgcGFydGlhbCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbihcbiAgICAgICAgICBgQXR0ZW1wdGluZyB0byByZWdpc3RlciBhIHBhcnRpYWwgY2FsbGVkIFwiJHtuYW1lfVwiIGFzIHVuZGVmaW5lZGBcbiAgICAgICAgKTtcbiAgICAgIH1cbiAgICAgIHRoaXMucGFydGlhbHNbbmFtZV0gPSBwYXJ0aWFsO1xuICAgIH1cbiAgfSxcbiAgdW5yZWdpc3RlclBhcnRpYWw6IGZ1bmN0aW9uKG5hbWUpIHtcbiAgICBkZWxldGUgdGhpcy5wYXJ0aWFsc1tuYW1lXTtcbiAgfSxcblxuICByZWdpc3RlckRlY29yYXRvcjogZnVuY3Rpb24obmFtZSwgZm4pIHtcbiAgICBpZiAodG9TdHJpbmcuY2FsbChuYW1lKSA9PT0gb2JqZWN0VHlwZSkge1xuICAgICAgaWYgKGZuKSB7XG4gICAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oJ0FyZyBub3Qgc3VwcG9ydGVkIHdpdGggbXVsdGlwbGUgZGVjb3JhdG9ycycpO1xuICAgICAgfVxuICAgICAgZXh0ZW5kKHRoaXMuZGVjb3JhdG9ycywgbmFtZSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHRoaXMuZGVjb3JhdG9yc1tuYW1lXSA9IGZuO1xuICAgIH1cbiAgfSxcbiAgdW5yZWdpc3RlckRlY29yYXRvcjogZnVuY3Rpb24obmFtZSkge1xuICAgIGRlbGV0ZSB0aGlzLmRlY29yYXRvcnNbbmFtZV07XG4gIH0sXG4gIC8qKlxuICAgKiBSZXNldCB0aGUgbWVtb3J5IG9mIGlsbGVnYWwgcHJvcGVydHkgYWNjZXNzZXMgdGhhdCBoYXZlIGFscmVhZHkgYmVlbiBsb2dnZWQuXG4gICAqIEBkZXByZWNhdGVkIHNob3VsZCBvbmx5IGJlIHVzZWQgaW4gaGFuZGxlYmFycyB0ZXN0LWNhc2VzXG4gICAqL1xuICByZXNldExvZ2dlZFByb3BlcnR5QWNjZXNzZXMoKSB7XG4gICAgcmVzZXRMb2dnZWRQcm9wZXJ0aWVzKCk7XG4gIH1cbn07XG5cbmV4cG9ydCBsZXQgbG9nID0gbG9nZ2VyLmxvZztcblxuZXhwb3J0IHsgY3JlYXRlRnJhbWUsIGxvZ2dlciB9O1xuIl19
  1406. /***/ }),
  1407. /***/ "./node_modules/handlebars/dist/cjs/handlebars/decorators.js":
  1408. /*!*******************************************************************!*\
  1409. !*** ./node_modules/handlebars/dist/cjs/handlebars/decorators.js ***!
  1410. \*******************************************************************/
  1411. /*! no static exports found */
  1412. /***/ (function(module, exports, __webpack_require__) {
  1413. "use strict";
  1414. exports.__esModule = true;
  1415. exports.registerDefaultDecorators = registerDefaultDecorators;
  1416. // istanbul ignore next
  1417. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  1418. var _decoratorsInline = __webpack_require__(/*! ./decorators/inline */ "./node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js");
  1419. var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
  1420. function registerDefaultDecorators(instance) {
  1421. _decoratorsInline2['default'](instance);
  1422. }
  1423. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2RlY29yYXRvcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Z0NBQTJCLHFCQUFxQjs7OztBQUV6QyxTQUFTLHlCQUF5QixDQUFDLFFBQVEsRUFBRTtBQUNsRCxnQ0FBZSxRQUFRLENBQUMsQ0FBQztDQUMxQiIsImZpbGUiOiJkZWNvcmF0b3JzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHJlZ2lzdGVySW5saW5lIGZyb20gJy4vZGVjb3JhdG9ycy9pbmxpbmUnO1xuXG5leHBvcnQgZnVuY3Rpb24gcmVnaXN0ZXJEZWZhdWx0RGVjb3JhdG9ycyhpbnN0YW5jZSkge1xuICByZWdpc3RlcklubGluZShpbnN0YW5jZSk7XG59XG4iXX0=
  1424. /***/ }),
  1425. /***/ "./node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js":
  1426. /*!**************************************************************************!*\
  1427. !*** ./node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js ***!
  1428. \**************************************************************************/
  1429. /*! no static exports found */
  1430. /***/ (function(module, exports, __webpack_require__) {
  1431. "use strict";
  1432. exports.__esModule = true;
  1433. var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
  1434. exports['default'] = function (instance) {
  1435. instance.registerDecorator('inline', function (fn, props, container, options) {
  1436. var ret = fn;
  1437. if (!props.partials) {
  1438. props.partials = {};
  1439. ret = function (context, options) {
  1440. // Create a new partials stack frame prior to exec.
  1441. var original = container.partials;
  1442. container.partials = _utils.extend({}, original, props.partials);
  1443. var ret = fn(context, options);
  1444. container.partials = original;
  1445. return ret;
  1446. };
  1447. }
  1448. props.partials[options.args[0]] = options.fn;
  1449. return ret;
  1450. });
  1451. };
  1452. module.exports = exports['default'];
  1453. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2RlY29yYXRvcnMvaW5saW5lLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQXVCLFVBQVU7O3FCQUVsQixVQUFTLFFBQVEsRUFBRTtBQUNoQyxVQUFRLENBQUMsaUJBQWlCLENBQUMsUUFBUSxFQUFFLFVBQVMsRUFBRSxFQUFFLEtBQUssRUFBRSxTQUFTLEVBQUUsT0FBTyxFQUFFO0FBQzNFLFFBQUksR0FBRyxHQUFHLEVBQUUsQ0FBQztBQUNiLFFBQUksQ0FBQyxLQUFLLENBQUMsUUFBUSxFQUFFO0FBQ25CLFdBQUssQ0FBQyxRQUFRLEdBQUcsRUFBRSxDQUFDO0FBQ3BCLFNBQUcsR0FBRyxVQUFTLE9BQU8sRUFBRSxPQUFPLEVBQUU7O0FBRS9CLFlBQUksUUFBUSxHQUFHLFNBQVMsQ0FBQyxRQUFRLENBQUM7QUFDbEMsaUJBQVMsQ0FBQyxRQUFRLEdBQUcsY0FBTyxFQUFFLEVBQUUsUUFBUSxFQUFFLEtBQUssQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUMxRCxZQUFJLEdBQUcsR0FBRyxFQUFFLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0FBQy9CLGlCQUFTLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztBQUM5QixlQUFPLEdBQUcsQ0FBQztPQUNaLENBQUM7S0FDSDs7QUFFRCxTQUFLLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsR0FBRyxPQUFPLENBQUMsRUFBRSxDQUFDOztBQUU3QyxXQUFPLEdBQUcsQ0FBQztHQUNaLENBQUMsQ0FBQztDQUNKIiwiZmlsZSI6ImlubGluZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGV4dGVuZCB9IGZyb20gJy4uL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgaW5zdGFuY2UucmVnaXN0ZXJEZWNvcmF0b3IoJ2lubGluZScsIGZ1bmN0aW9uKGZuLCBwcm9wcywgY29udGFpbmVyLCBvcHRpb25zKSB7XG4gICAgbGV0IHJldCA9IGZuO1xuICAgIGlmICghcHJvcHMucGFydGlhbHMpIHtcbiAgICAgIHByb3BzLnBhcnRpYWxzID0ge307XG4gICAgICByZXQgPSBmdW5jdGlvbihjb250ZXh0LCBvcHRpb25zKSB7XG4gICAgICAgIC8vIENyZWF0ZSBhIG5ldyBwYXJ0aWFscyBzdGFjayBmcmFtZSBwcmlvciB0byBleGVjLlxuICAgICAgICBsZXQgb3JpZ2luYWwgPSBjb250YWluZXIucGFydGlhbHM7XG4gICAgICAgIGNvbnRhaW5lci5wYXJ0aWFscyA9IGV4dGVuZCh7fSwgb3JpZ2luYWwsIHByb3BzLnBhcnRpYWxzKTtcbiAgICAgICAgbGV0IHJldCA9IGZuKGNvbnRleHQsIG9wdGlvbnMpO1xuICAgICAgICBjb250YWluZXIucGFydGlhbHMgPSBvcmlnaW5hbDtcbiAgICAgICAgcmV0dXJuIHJldDtcbiAgICAgIH07XG4gICAgfVxuXG4gICAgcHJvcHMucGFydGlhbHNbb3B0aW9ucy5hcmdzWzBdXSA9IG9wdGlvbnMuZm47XG5cbiAgICByZXR1cm4gcmV0O1xuICB9KTtcbn1cbiJdfQ==
  1454. /***/ }),
  1455. /***/ "./node_modules/handlebars/dist/cjs/handlebars/exception.js":
  1456. /*!******************************************************************!*\
  1457. !*** ./node_modules/handlebars/dist/cjs/handlebars/exception.js ***!
  1458. \******************************************************************/
  1459. /*! no static exports found */
  1460. /***/ (function(module, exports, __webpack_require__) {
  1461. "use strict";
  1462. exports.__esModule = true;
  1463. var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
  1464. function Exception(message, node) {
  1465. var loc = node && node.loc,
  1466. line = undefined,
  1467. endLineNumber = undefined,
  1468. column = undefined,
  1469. endColumn = undefined;
  1470. if (loc) {
  1471. line = loc.start.line;
  1472. endLineNumber = loc.end.line;
  1473. column = loc.start.column;
  1474. endColumn = loc.end.column;
  1475. message += ' - ' + line + ':' + column;
  1476. }
  1477. var tmp = Error.prototype.constructor.call(this, message);
  1478. // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
  1479. for (var idx = 0; idx < errorProps.length; idx++) {
  1480. this[errorProps[idx]] = tmp[errorProps[idx]];
  1481. }
  1482. /* istanbul ignore else */
  1483. if (Error.captureStackTrace) {
  1484. Error.captureStackTrace(this, Exception);
  1485. }
  1486. try {
  1487. if (loc) {
  1488. this.lineNumber = line;
  1489. this.endLineNumber = endLineNumber;
  1490. // Work around issue under safari where we can't directly set the column value
  1491. /* istanbul ignore next */
  1492. if (Object.defineProperty) {
  1493. Object.defineProperty(this, 'column', {
  1494. value: column,
  1495. enumerable: true
  1496. });
  1497. Object.defineProperty(this, 'endColumn', {
  1498. value: endColumn,
  1499. enumerable: true
  1500. });
  1501. } else {
  1502. this.column = column;
  1503. this.endColumn = endColumn;
  1504. }
  1505. }
  1506. } catch (nop) {
  1507. /* Ignore if the browser is very particular */
  1508. }
  1509. }
  1510. Exception.prototype = new Error();
  1511. exports['default'] = Exception;
  1512. module.exports = exports['default'];
  1513. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2V4Y2VwdGlvbi5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxJQUFNLFVBQVUsR0FBRyxDQUNqQixhQUFhLEVBQ2IsVUFBVSxFQUNWLFlBQVksRUFDWixlQUFlLEVBQ2YsU0FBUyxFQUNULE1BQU0sRUFDTixRQUFRLEVBQ1IsT0FBTyxDQUNSLENBQUM7O0FBRUYsU0FBUyxTQUFTLENBQUMsT0FBTyxFQUFFLElBQUksRUFBRTtBQUNoQyxNQUFJLEdBQUcsR0FBRyxJQUFJLElBQUksSUFBSSxDQUFDLEdBQUc7TUFDeEIsSUFBSSxZQUFBO01BQ0osYUFBYSxZQUFBO01BQ2IsTUFBTSxZQUFBO01BQ04sU0FBUyxZQUFBLENBQUM7O0FBRVosTUFBSSxHQUFHLEVBQUU7QUFDUCxRQUFJLEdBQUcsR0FBRyxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUM7QUFDdEIsaUJBQWEsR0FBRyxHQUFHLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQztBQUM3QixVQUFNLEdBQUcsR0FBRyxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUM7QUFDMUIsYUFBUyxHQUFHLEdBQUcsQ0FBQyxHQUFHLENBQUMsTUFBTSxDQUFDOztBQUUzQixXQUFPLElBQUksS0FBSyxHQUFHLElBQUksR0FBRyxHQUFHLEdBQUcsTUFBTSxDQUFDO0dBQ3hDOztBQUVELE1BQUksR0FBRyxHQUFHLEtBQUssQ0FBQyxTQUFTLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsT0FBTyxDQUFDLENBQUM7OztBQUcxRCxPQUFLLElBQUksR0FBRyxHQUFHLENBQUMsRUFBRSxHQUFHLEdBQUcsVUFBVSxDQUFDLE1BQU0sRUFBRSxHQUFHLEVBQUUsRUFBRTtBQUNoRCxRQUFJLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEdBQUcsR0FBRyxDQUFDLFVBQVUsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO0dBQzlDOzs7QUFHRCxNQUFJLEtBQUssQ0FBQyxpQkFBaUIsRUFBRTtBQUMzQixTQUFLLENBQUMsaUJBQWlCLENBQUMsSUFBSSxFQUFFLFNBQVMsQ0FBQyxDQUFDO0dBQzFDOztBQUVELE1BQUk7QUFDRixRQUFJLEdBQUcsRUFBRTtBQUNQLFVBQUksQ0FBQyxVQUFVLEdBQUcsSUFBSSxDQUFDO0FBQ3ZCLFVBQUksQ0FBQyxhQUFhLEdBQUcsYUFBYSxDQUFDOzs7O0FBSW5DLFVBQUksTUFBTSxDQUFDLGNBQWMsRUFBRTtBQUN6QixjQUFNLENBQUMsY0FBYyxDQUFDLElBQUksRUFBRSxRQUFRLEVBQUU7QUFDcEMsZUFBSyxFQUFFLE1BQU07QUFDYixvQkFBVSxFQUFFLElBQUk7U0FDakIsQ0FBQyxDQUFDO0FBQ0gsY0FBTSxDQUFDLGNBQWMsQ0FBQyxJQUFJLEVBQUUsV0FBVyxFQUFFO0FBQ3ZDLGVBQUssRUFBRSxTQUFTO0FBQ2hCLG9CQUFVLEVBQUUsSUFBSTtTQUNqQixDQUFDLENBQUM7T0FDSixNQUFNO0FBQ0wsWUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7QUFDckIsWUFBSSxDQUFDLFNBQVMsR0FBRyxTQUFTLENBQUM7T0FDNUI7S0FDRjtHQUNGLENBQUMsT0FBTyxHQUFHLEVBQUU7O0dBRWI7Q0FDRjs7QUFFRCxTQUFTLENBQUMsU0FBUyxHQUFHLElBQUksS0FBSyxFQUFFLENBQUM7O3FCQUVuQixTQUFTIiwiZmlsZSI6ImV4Y2VwdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbImNvbnN0IGVycm9yUHJvcHMgPSBbXG4gICdkZXNjcmlwdGlvbicsXG4gICdmaWxlTmFtZScsXG4gICdsaW5lTnVtYmVyJyxcbiAgJ2VuZExpbmVOdW1iZXInLFxuICAnbWVzc2FnZScsXG4gICduYW1lJyxcbiAgJ251bWJlcicsXG4gICdzdGFjaydcbl07XG5cbmZ1bmN0aW9uIEV4Y2VwdGlvbihtZXNzYWdlLCBub2RlKSB7XG4gIGxldCBsb2MgPSBub2RlICYmIG5vZGUubG9jLFxuICAgIGxpbmUsXG4gICAgZW5kTGluZU51bWJlcixcbiAgICBjb2x1bW4sXG4gICAgZW5kQ29sdW1uO1xuXG4gIGlmIChsb2MpIHtcbiAgICBsaW5lID0gbG9jLnN0YXJ0LmxpbmU7XG4gICAgZW5kTGluZU51bWJlciA9IGxvYy5lbmQubGluZTtcbiAgICBjb2x1bW4gPSBsb2Muc3RhcnQuY29sdW1uO1xuICAgIGVuZENvbHVtbiA9IGxvYy5lbmQuY29sdW1uO1xuXG4gICAgbWVzc2FnZSArPSAnIC0gJyArIGxpbmUgKyAnOicgKyBjb2x1bW47XG4gIH1cblxuICBsZXQgdG1wID0gRXJyb3IucHJvdG90eXBlLmNvbnN0cnVjdG9yLmNhbGwodGhpcywgbWVzc2FnZSk7XG5cbiAgLy8gVW5mb3J0dW5hdGVseSBlcnJvcnMgYXJlIG5vdCBlbnVtZXJhYmxlIGluIENocm9tZSAoYXQgbGVhc3QpLCBzbyBgZm9yIHByb3AgaW4gdG1wYCBkb2Vzbid0IHdvcmsuXG4gIGZvciAobGV0IGlkeCA9IDA7IGlkeCA8IGVycm9yUHJvcHMubGVuZ3RoOyBpZHgrKykge1xuICAgIHRoaXNbZXJyb3JQcm9wc1tpZHhdXSA9IHRtcFtlcnJvclByb3BzW2lkeF1dO1xuICB9XG5cbiAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgaWYgKEVycm9yLmNhcHR1cmVTdGFja1RyYWNlKSB7XG4gICAgRXJyb3IuY2FwdHVyZVN0YWNrVHJhY2UodGhpcywgRXhjZXB0aW9uKTtcbiAgfVxuXG4gIHRyeSB7XG4gICAgaWYgKGxvYykge1xuICAgICAgdGhpcy5saW5lTnVtYmVyID0gbGluZTtcbiAgICAgIHRoaXMuZW5kTGluZU51bWJlciA9IGVuZExpbmVOdW1iZXI7XG5cbiAgICAgIC8vIFdvcmsgYXJvdW5kIGlzc3VlIHVuZGVyIHNhZmFyaSB3aGVyZSB3ZSBjYW4ndCBkaXJlY3RseSBzZXQgdGhlIGNvbHVtbiB2YWx1ZVxuICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgIGlmIChPYmplY3QuZGVmaW5lUHJvcGVydHkpIHtcbiAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRoaXMsICdjb2x1bW4nLCB7XG4gICAgICAgICAgdmFsdWU6IGNvbHVtbixcbiAgICAgICAgICBlbnVtZXJhYmxlOiB0cnVlXG4gICAgICAgIH0pO1xuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGhpcywgJ2VuZENvbHVtbicsIHtcbiAgICAgICAgICB2YWx1ZTogZW5kQ29sdW1uLFxuICAgICAgICAgIGVudW1lcmFibGU6IHRydWVcbiAgICAgICAgfSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLmNvbHVtbiA9IGNvbHVtbjtcbiAgICAgICAgdGhpcy5lbmRDb2x1bW4gPSBlbmRDb2x1bW47XG4gICAgICB9XG4gICAgfVxuICB9IGNhdGNoIChub3ApIHtcbiAgICAvKiBJZ25vcmUgaWYgdGhlIGJyb3dzZXIgaXMgdmVyeSBwYXJ0aWN1bGFyICovXG4gIH1cbn1cblxuRXhjZXB0aW9uLnByb3RvdHlwZSA9IG5ldyBFcnJvcigpO1xuXG5leHBvcnQgZGVmYXVsdCBFeGNlcHRpb247XG4iXX0=
  1514. /***/ }),
  1515. /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers.js":
  1516. /*!****************************************************************!*\
  1517. !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers.js ***!
  1518. \****************************************************************/
  1519. /*! no static exports found */
  1520. /***/ (function(module, exports, __webpack_require__) {
  1521. "use strict";
  1522. exports.__esModule = true;
  1523. exports.registerDefaultHelpers = registerDefaultHelpers;
  1524. exports.moveHelperToHooks = moveHelperToHooks;
  1525. // istanbul ignore next
  1526. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  1527. var _helpersBlockHelperMissing = __webpack_require__(/*! ./helpers/block-helper-missing */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js");
  1528. var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
  1529. var _helpersEach = __webpack_require__(/*! ./helpers/each */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js");
  1530. var _helpersEach2 = _interopRequireDefault(_helpersEach);
  1531. var _helpersHelperMissing = __webpack_require__(/*! ./helpers/helper-missing */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js");
  1532. var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
  1533. var _helpersIf = __webpack_require__(/*! ./helpers/if */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/if.js");
  1534. var _helpersIf2 = _interopRequireDefault(_helpersIf);
  1535. var _helpersLog = __webpack_require__(/*! ./helpers/log */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/log.js");
  1536. var _helpersLog2 = _interopRequireDefault(_helpersLog);
  1537. var _helpersLookup = __webpack_require__(/*! ./helpers/lookup */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js");
  1538. var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
  1539. var _helpersWith = __webpack_require__(/*! ./helpers/with */ "./node_modules/handlebars/dist/cjs/handlebars/helpers/with.js");
  1540. var _helpersWith2 = _interopRequireDefault(_helpersWith);
  1541. function registerDefaultHelpers(instance) {
  1542. _helpersBlockHelperMissing2['default'](instance);
  1543. _helpersEach2['default'](instance);
  1544. _helpersHelperMissing2['default'](instance);
  1545. _helpersIf2['default'](instance);
  1546. _helpersLog2['default'](instance);
  1547. _helpersLookup2['default'](instance);
  1548. _helpersWith2['default'](instance);
  1549. }
  1550. function moveHelperToHooks(instance, helperName, keepHelper) {
  1551. if (instance.helpers[helperName]) {
  1552. instance.hooks[helperName] = instance.helpers[helperName];
  1553. if (!keepHelper) {
  1554. delete instance.helpers[helperName];
  1555. }
  1556. }
  1557. }
  1558. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O3lDQUF1QyxnQ0FBZ0M7Ozs7MkJBQzlDLGdCQUFnQjs7OztvQ0FDUCwwQkFBMEI7Ozs7eUJBQ3JDLGNBQWM7Ozs7MEJBQ2IsZUFBZTs7Ozs2QkFDWixrQkFBa0I7Ozs7MkJBQ3BCLGdCQUFnQjs7OztBQUVsQyxTQUFTLHNCQUFzQixDQUFDLFFBQVEsRUFBRTtBQUMvQyx5Q0FBMkIsUUFBUSxDQUFDLENBQUM7QUFDckMsMkJBQWEsUUFBUSxDQUFDLENBQUM7QUFDdkIsb0NBQXNCLFFBQVEsQ0FBQyxDQUFDO0FBQ2hDLHlCQUFXLFFBQVEsQ0FBQyxDQUFDO0FBQ3JCLDBCQUFZLFFBQVEsQ0FBQyxDQUFDO0FBQ3RCLDZCQUFlLFFBQVEsQ0FBQyxDQUFDO0FBQ3pCLDJCQUFhLFFBQVEsQ0FBQyxDQUFDO0NBQ3hCOztBQUVNLFNBQVMsaUJBQWlCLENBQUMsUUFBUSxFQUFFLFVBQVUsRUFBRSxVQUFVLEVBQUU7QUFDbEUsTUFBSSxRQUFRLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxFQUFFO0FBQ2hDLFlBQVEsQ0FBQyxLQUFLLENBQUMsVUFBVSxDQUFDLEdBQUcsUUFBUSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztBQUMxRCxRQUFJLENBQUMsVUFBVSxFQUFFO0FBQ2YsYUFBTyxRQUFRLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0tBQ3JDO0dBQ0Y7Q0FDRiIsImZpbGUiOiJoZWxwZXJzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHJlZ2lzdGVyQmxvY2tIZWxwZXJNaXNzaW5nIGZyb20gJy4vaGVscGVycy9ibG9jay1oZWxwZXItbWlzc2luZyc7XG5pbXBvcnQgcmVnaXN0ZXJFYWNoIGZyb20gJy4vaGVscGVycy9lYWNoJztcbmltcG9ydCByZWdpc3RlckhlbHBlck1pc3NpbmcgZnJvbSAnLi9oZWxwZXJzL2hlbHBlci1taXNzaW5nJztcbmltcG9ydCByZWdpc3RlcklmIGZyb20gJy4vaGVscGVycy9pZic7XG5pbXBvcnQgcmVnaXN0ZXJMb2cgZnJvbSAnLi9oZWxwZXJzL2xvZyc7XG5pbXBvcnQgcmVnaXN0ZXJMb29rdXAgZnJvbSAnLi9oZWxwZXJzL2xvb2t1cCc7XG5pbXBvcnQgcmVnaXN0ZXJXaXRoIGZyb20gJy4vaGVscGVycy93aXRoJztcblxuZXhwb3J0IGZ1bmN0aW9uIHJlZ2lzdGVyRGVmYXVsdEhlbHBlcnMoaW5zdGFuY2UpIHtcbiAgcmVnaXN0ZXJCbG9ja0hlbHBlck1pc3NpbmcoaW5zdGFuY2UpO1xuICByZWdpc3RlckVhY2goaW5zdGFuY2UpO1xuICByZWdpc3RlckhlbHBlck1pc3NpbmcoaW5zdGFuY2UpO1xuICByZWdpc3RlcklmKGluc3RhbmNlKTtcbiAgcmVnaXN0ZXJMb2coaW5zdGFuY2UpO1xuICByZWdpc3Rlckxvb2t1cChpbnN0YW5jZSk7XG4gIHJlZ2lzdGVyV2l0aChpbnN0YW5jZSk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBtb3ZlSGVscGVyVG9Ib29rcyhpbnN0YW5jZSwgaGVscGVyTmFtZSwga2VlcEhlbHBlcikge1xuICBpZiAoaW5zdGFuY2UuaGVscGVyc1toZWxwZXJOYW1lXSkge1xuICAgIGluc3RhbmNlLmhvb2tzW2hlbHBlck5hbWVdID0gaW5zdGFuY2UuaGVscGVyc1toZWxwZXJOYW1lXTtcbiAgICBpZiAoIWtlZXBIZWxwZXIpIHtcbiAgICAgIGRlbGV0ZSBpbnN0YW5jZS5oZWxwZXJzW2hlbHBlck5hbWVdO1xuICAgIH1cbiAgfVxufVxuIl19
  1559. /***/ }),
  1560. /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js":
  1561. /*!*************************************************************************************!*\
  1562. !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js ***!
  1563. \*************************************************************************************/
  1564. /*! no static exports found */
  1565. /***/ (function(module, exports, __webpack_require__) {
  1566. "use strict";
  1567. exports.__esModule = true;
  1568. var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
  1569. exports['default'] = function (instance) {
  1570. instance.registerHelper('blockHelperMissing', function (context, options) {
  1571. var inverse = options.inverse,
  1572. fn = options.fn;
  1573. if (context === true) {
  1574. return fn(this);
  1575. } else if (context === false || context == null) {
  1576. return inverse(this);
  1577. } else if (_utils.isArray(context)) {
  1578. if (context.length > 0) {
  1579. if (options.ids) {
  1580. options.ids = [options.name];
  1581. }
  1582. return instance.helpers.each(context, options);
  1583. } else {
  1584. return inverse(this);
  1585. }
  1586. } else {
  1587. if (options.data && options.ids) {
  1588. var data = _utils.createFrame(options.data);
  1589. data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
  1590. options = { data: data };
  1591. }
  1592. return fn(context, options);
  1593. }
  1594. });
  1595. };
  1596. module.exports = exports['default'];
  1597. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvYmxvY2staGVscGVyLW1pc3NpbmcuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztxQkFBd0QsVUFBVTs7cUJBRW5ELFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFVBQVEsQ0FBQyxjQUFjLENBQUMsb0JBQW9CLEVBQUUsVUFBUyxPQUFPLEVBQUUsT0FBTyxFQUFFO0FBQ3ZFLFFBQUksT0FBTyxHQUFHLE9BQU8sQ0FBQyxPQUFPO1FBQzNCLEVBQUUsR0FBRyxPQUFPLENBQUMsRUFBRSxDQUFDOztBQUVsQixRQUFJLE9BQU8sS0FBSyxJQUFJLEVBQUU7QUFDcEIsYUFBTyxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUM7S0FDakIsTUFBTSxJQUFJLE9BQU8sS0FBSyxLQUFLLElBQUksT0FBTyxJQUFJLElBQUksRUFBRTtBQUMvQyxhQUFPLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQztLQUN0QixNQUFNLElBQUksZUFBUSxPQUFPLENBQUMsRUFBRTtBQUMzQixVQUFJLE9BQU8sQ0FBQyxNQUFNLEdBQUcsQ0FBQyxFQUFFO0FBQ3RCLFlBQUksT0FBTyxDQUFDLEdBQUcsRUFBRTtBQUNmLGlCQUFPLENBQUMsR0FBRyxHQUFHLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO1NBQzlCOztBQUVELGVBQU8sUUFBUSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO09BQ2hELE1BQU07QUFDTCxlQUFPLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQztPQUN0QjtLQUNGLE1BQU07QUFDTCxVQUFJLE9BQU8sQ0FBQyxJQUFJLElBQUksT0FBTyxDQUFDLEdBQUcsRUFBRTtBQUMvQixZQUFJLElBQUksR0FBRyxtQkFBWSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDckMsWUFBSSxDQUFDLFdBQVcsR0FBRyx5QkFDakIsT0FBTyxDQUFDLElBQUksQ0FBQyxXQUFXLEVBQ3hCLE9BQU8sQ0FBQyxJQUFJLENBQ2IsQ0FBQztBQUNGLGVBQU8sR0FBRyxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsQ0FBQztPQUMxQjs7QUFFRCxhQUFPLEVBQUUsQ0FBQyxPQUFPLEVBQUUsT0FBTyxDQUFDLENBQUM7S0FDN0I7R0FDRixDQUFDLENBQUM7Q0FDSiIsImZpbGUiOiJibG9jay1oZWxwZXItbWlzc2luZy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGFwcGVuZENvbnRleHRQYXRoLCBjcmVhdGVGcmFtZSwgaXNBcnJheSB9IGZyb20gJy4uL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgaW5zdGFuY2UucmVnaXN0ZXJIZWxwZXIoJ2Jsb2NrSGVscGVyTWlzc2luZycsIGZ1bmN0aW9uKGNvbnRleHQsIG9wdGlvbnMpIHtcbiAgICBsZXQgaW52ZXJzZSA9IG9wdGlvbnMuaW52ZXJzZSxcbiAgICAgIGZuID0gb3B0aW9ucy5mbjtcblxuICAgIGlmIChjb250ZXh0ID09PSB0cnVlKSB7XG4gICAgICByZXR1cm4gZm4odGhpcyk7XG4gICAgfSBlbHNlIGlmIChjb250ZXh0ID09PSBmYWxzZSB8fCBjb250ZXh0ID09IG51bGwpIHtcbiAgICAgIHJldHVybiBpbnZlcnNlKHRoaXMpO1xuICAgIH0gZWxzZSBpZiAoaXNBcnJheShjb250ZXh0KSkge1xuICAgICAgaWYgKGNvbnRleHQubGVuZ3RoID4gMCkge1xuICAgICAgICBpZiAob3B0aW9ucy5pZHMpIHtcbiAgICAgICAgICBvcHRpb25zLmlkcyA9IFtvcHRpb25zLm5hbWVdO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGluc3RhbmNlLmhlbHBlcnMuZWFjaChjb250ZXh0LCBvcHRpb25zKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiBpbnZlcnNlKHRoaXMpO1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAob3B0aW9ucy5kYXRhICYmIG9wdGlvbnMuaWRzKSB7XG4gICAgICAgIGxldCBkYXRhID0gY3JlYXRlRnJhbWUob3B0aW9ucy5kYXRhKTtcbiAgICAgICAgZGF0YS5jb250ZXh0UGF0aCA9IGFwcGVuZENvbnRleHRQYXRoKFxuICAgICAgICAgIG9wdGlvbnMuZGF0YS5jb250ZXh0UGF0aCxcbiAgICAgICAgICBvcHRpb25zLm5hbWVcbiAgICAgICAgKTtcbiAgICAgICAgb3B0aW9ucyA9IHsgZGF0YTogZGF0YSB9O1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gZm4oY29udGV4dCwgb3B0aW9ucyk7XG4gICAgfVxuICB9KTtcbn1cbiJdfQ==
  1598. /***/ }),
  1599. /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js":
  1600. /*!*********************************************************************!*\
  1601. !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js ***!
  1602. \*********************************************************************/
  1603. /*! no static exports found */
  1604. /***/ (function(module, exports, __webpack_require__) {
  1605. "use strict";
  1606. /* WEBPACK VAR INJECTION */(function(global) {
  1607. exports.__esModule = true;
  1608. // istanbul ignore next
  1609. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  1610. var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
  1611. var _exception = __webpack_require__(/*! ../exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
  1612. var _exception2 = _interopRequireDefault(_exception);
  1613. exports['default'] = function (instance) {
  1614. instance.registerHelper('each', function (context, options) {
  1615. if (!options) {
  1616. throw new _exception2['default']('Must pass iterator to #each');
  1617. }
  1618. var fn = options.fn,
  1619. inverse = options.inverse,
  1620. i = 0,
  1621. ret = '',
  1622. data = undefined,
  1623. contextPath = undefined;
  1624. if (options.data && options.ids) {
  1625. contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
  1626. }
  1627. if (_utils.isFunction(context)) {
  1628. context = context.call(this);
  1629. }
  1630. if (options.data) {
  1631. data = _utils.createFrame(options.data);
  1632. }
  1633. function execIteration(field, index, last) {
  1634. if (data) {
  1635. data.key = field;
  1636. data.index = index;
  1637. data.first = index === 0;
  1638. data.last = !!last;
  1639. if (contextPath) {
  1640. data.contextPath = contextPath + field;
  1641. }
  1642. }
  1643. ret = ret + fn(context[field], {
  1644. data: data,
  1645. blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
  1646. });
  1647. }
  1648. if (context && typeof context === 'object') {
  1649. if (_utils.isArray(context)) {
  1650. for (var j = context.length; i < j; i++) {
  1651. if (i in context) {
  1652. execIteration(i, i, i === context.length - 1);
  1653. }
  1654. }
  1655. } else if (global.Symbol && context[global.Symbol.iterator]) {
  1656. var newContext = [];
  1657. var iterator = context[global.Symbol.iterator]();
  1658. for (var it = iterator.next(); !it.done; it = iterator.next()) {
  1659. newContext.push(it.value);
  1660. }
  1661. context = newContext;
  1662. for (var j = context.length; i < j; i++) {
  1663. execIteration(i, i, i === context.length - 1);
  1664. }
  1665. } else {
  1666. (function () {
  1667. var priorKey = undefined;
  1668. Object.keys(context).forEach(function (key) {
  1669. // We're running the iterations one step out of sync so we can detect
  1670. // the last iteration without have to scan the object twice and create
  1671. // an itermediate keys array.
  1672. if (priorKey !== undefined) {
  1673. execIteration(priorKey, i - 1);
  1674. }
  1675. priorKey = key;
  1676. i++;
  1677. });
  1678. if (priorKey !== undefined) {
  1679. execIteration(priorKey, i - 1, true);
  1680. }
  1681. })();
  1682. }
  1683. }
  1684. if (i === 0) {
  1685. ret = inverse(this);
  1686. }
  1687. return ret;
  1688. });
  1689. };
  1690. module.exports = exports['default'];
  1691. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvZWFjaC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O3FCQU1PLFVBQVU7O3lCQUNLLGNBQWM7Ozs7cUJBRXJCLFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFVBQVEsQ0FBQyxjQUFjLENBQUMsTUFBTSxFQUFFLFVBQVMsT0FBTyxFQUFFLE9BQU8sRUFBRTtBQUN6RCxRQUFJLENBQUMsT0FBTyxFQUFFO0FBQ1osWUFBTSwyQkFBYyw2QkFBNkIsQ0FBQyxDQUFDO0tBQ3BEOztBQUVELFFBQUksRUFBRSxHQUFHLE9BQU8sQ0FBQyxFQUFFO1FBQ2pCLE9BQU8sR0FBRyxPQUFPLENBQUMsT0FBTztRQUN6QixDQUFDLEdBQUcsQ0FBQztRQUNMLEdBQUcsR0FBRyxFQUFFO1FBQ1IsSUFBSSxZQUFBO1FBQ0osV0FBVyxZQUFBLENBQUM7O0FBRWQsUUFBSSxPQUFPLENBQUMsSUFBSSxJQUFJLE9BQU8sQ0FBQyxHQUFHLEVBQUU7QUFDL0IsaUJBQVcsR0FDVCx5QkFBa0IsT0FBTyxDQUFDLElBQUksQ0FBQyxXQUFXLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxHQUFHLEdBQUcsQ0FBQztLQUNyRTs7QUFFRCxRQUFJLGtCQUFXLE9BQU8sQ0FBQyxFQUFFO0FBQ3ZCLGFBQU8sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQzlCOztBQUVELFFBQUksT0FBTyxDQUFDLElBQUksRUFBRTtBQUNoQixVQUFJLEdBQUcsbUJBQVksT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQ2xDOztBQUVELGFBQVMsYUFBYSxDQUFDLEtBQUssRUFBRSxLQUFLLEVBQUUsSUFBSSxFQUFFO0FBQ3pDLFVBQUksSUFBSSxFQUFFO0FBQ1IsWUFBSSxDQUFDLEdBQUcsR0FBRyxLQUFLLENBQUM7QUFDakIsWUFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7QUFDbkIsWUFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLEtBQUssQ0FBQyxDQUFDO0FBQ3pCLFlBQUksQ0FBQyxJQUFJLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQzs7QUFFbkIsWUFBSSxXQUFXLEVBQUU7QUFDZixjQUFJLENBQUMsV0FBVyxHQUFHLFdBQVcsR0FBRyxLQUFLLENBQUM7U0FDeEM7T0FDRjs7QUFFRCxTQUFHLEdBQ0QsR0FBRyxHQUNILEVBQUUsQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLEVBQUU7QUFDakIsWUFBSSxFQUFFLElBQUk7QUFDVixtQkFBVyxFQUFFLG1CQUNYLENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQyxFQUFFLEtBQUssQ0FBQyxFQUN2QixDQUFDLFdBQVcsR0FBRyxLQUFLLEVBQUUsSUFBSSxDQUFDLENBQzVCO09BQ0YsQ0FBQyxDQUFDO0tBQ047O0FBRUQsUUFBSSxPQUFPLElBQUksT0FBTyxPQUFPLEtBQUssUUFBUSxFQUFFO0FBQzFDLFVBQUksZUFBUSxPQUFPLENBQUMsRUFBRTtBQUNwQixhQUFLLElBQUksQ0FBQyxHQUFHLE9BQU8sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtBQUN2QyxjQUFJLENBQUMsSUFBSSxPQUFPLEVBQUU7QUFDaEIseUJBQWEsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBSyxPQUFPLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQyxDQUFDO1dBQy9DO1NBQ0Y7T0FDRixNQUFNLElBQUksTUFBTSxDQUFDLE1BQU0sSUFBSSxPQUFPLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxRQUFRLENBQUMsRUFBRTtBQUMzRCxZQUFNLFVBQVUsR0FBRyxFQUFFLENBQUM7QUFDdEIsWUFBTSxRQUFRLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLEVBQUUsQ0FBQztBQUNuRCxhQUFLLElBQUksRUFBRSxHQUFHLFFBQVEsQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLEVBQUUsQ0FBQyxJQUFJLEVBQUUsRUFBRSxHQUFHLFFBQVEsQ0FBQyxJQUFJLEVBQUUsRUFBRTtBQUM3RCxvQkFBVSxDQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsS0FBSyxDQUFDLENBQUM7U0FDM0I7QUFDRCxlQUFPLEdBQUcsVUFBVSxDQUFDO0FBQ3JCLGFBQUssSUFBSSxDQUFDLEdBQUcsT0FBTyxDQUFDLE1BQU0sRUFBRSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsRUFBRSxFQUFFO0FBQ3ZDLHVCQUFhLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQUssT0FBTyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQztTQUMvQztPQUNGLE1BQU07O0FBQ0wsY0FBSSxRQUFRLFlBQUEsQ0FBQzs7QUFFYixnQkFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQyxPQUFPLENBQUMsVUFBQSxHQUFHLEVBQUk7Ozs7QUFJbEMsZ0JBQUksUUFBUSxLQUFLLFNBQVMsRUFBRTtBQUMxQiwyQkFBYSxDQUFDLFFBQVEsRUFBRSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7YUFDaEM7QUFDRCxvQkFBUSxHQUFHLEdBQUcsQ0FBQztBQUNmLGFBQUMsRUFBRSxDQUFDO1dBQ0wsQ0FBQyxDQUFDO0FBQ0gsY0FBSSxRQUFRLEtBQUssU0FBUyxFQUFFO0FBQzFCLHlCQUFhLENBQUMsUUFBUSxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUUsSUFBSSxDQUFDLENBQUM7V0FDdEM7O09BQ0Y7S0FDRjs7QUFFRCxRQUFJLENBQUMsS0FBSyxDQUFDLEVBQUU7QUFDWCxTQUFHLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQ3JCOztBQUVELFdBQU8sR0FBRyxDQUFDO0dBQ1osQ0FBQyxDQUFDO0NBQ0oiLCJmaWxlIjoiZWFjaC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7XG4gIGFwcGVuZENvbnRleHRQYXRoLFxuICBibG9ja1BhcmFtcyxcbiAgY3JlYXRlRnJhbWUsXG4gIGlzQXJyYXksXG4gIGlzRnVuY3Rpb25cbn0gZnJvbSAnLi4vdXRpbHMnO1xuaW1wb3J0IEV4Y2VwdGlvbiBmcm9tICcuLi9leGNlcHRpb24nO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbihpbnN0YW5jZSkge1xuICBpbnN0YW5jZS5yZWdpc3RlckhlbHBlcignZWFjaCcsIGZ1bmN0aW9uKGNvbnRleHQsIG9wdGlvbnMpIHtcbiAgICBpZiAoIW9wdGlvbnMpIHtcbiAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oJ011c3QgcGFzcyBpdGVyYXRvciB0byAjZWFjaCcpO1xuICAgIH1cblxuICAgIGxldCBmbiA9IG9wdGlvbnMuZm4sXG4gICAgICBpbnZlcnNlID0gb3B0aW9ucy5pbnZlcnNlLFxuICAgICAgaSA9IDAsXG4gICAgICByZXQgPSAnJyxcbiAgICAgIGRhdGEsXG4gICAgICBjb250ZXh0UGF0aDtcblxuICAgIGlmIChvcHRpb25zLmRhdGEgJiYgb3B0aW9ucy5pZHMpIHtcbiAgICAgIGNvbnRleHRQYXRoID1cbiAgICAgICAgYXBwZW5kQ29udGV4dFBhdGgob3B0aW9ucy5kYXRhLmNvbnRleHRQYXRoLCBvcHRpb25zLmlkc1swXSkgKyAnLic7XG4gICAgfVxuXG4gICAgaWYgKGlzRnVuY3Rpb24oY29udGV4dCkpIHtcbiAgICAgIGNvbnRleHQgPSBjb250ZXh0LmNhbGwodGhpcyk7XG4gICAgfVxuXG4gICAgaWYgKG9wdGlvbnMuZGF0YSkge1xuICAgICAgZGF0YSA9IGNyZWF0ZUZyYW1lKG9wdGlvbnMuZGF0YSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZXhlY0l0ZXJhdGlvbihmaWVsZCwgaW5kZXgsIGxhc3QpIHtcbiAgICAgIGlmIChkYXRhKSB7XG4gICAgICAgIGRhdGEua2V5ID0gZmllbGQ7XG4gICAgICAgIGRhdGEuaW5kZXggPSBpbmRleDtcbiAgICAgICAgZGF0YS5maXJzdCA9IGluZGV4ID09PSAwO1xuICAgICAgICBkYXRhLmxhc3QgPSAhIWxhc3Q7XG5cbiAgICAgICAgaWYgKGNvbnRleHRQYXRoKSB7XG4gICAgICAgICAgZGF0YS5jb250ZXh0UGF0aCA9IGNvbnRleHRQYXRoICsgZmllbGQ7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgcmV0ID1cbiAgICAgICAgcmV0ICtcbiAgICAgICAgZm4oY29udGV4dFtmaWVsZF0sIHtcbiAgICAgICAgICBkYXRhOiBkYXRhLFxuICAgICAgICAgIGJsb2NrUGFyYW1zOiBibG9ja1BhcmFtcyhcbiAgICAgICAgICAgIFtjb250ZXh0W2ZpZWxkXSwgZmllbGRdLFxuICAgICAgICAgICAgW2NvbnRleHRQYXRoICsgZmllbGQsIG51bGxdXG4gICAgICAgICAgKVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBpZiAoY29udGV4dCAmJiB0eXBlb2YgY29udGV4dCA9PT0gJ29iamVjdCcpIHtcbiAgICAgIGlmIChpc0FycmF5KGNvbnRleHQpKSB7XG4gICAgICAgIGZvciAobGV0IGogPSBjb250ZXh0Lmxlbmd0aDsgaSA8IGo7IGkrKykge1xuICAgICAgICAgIGlmIChpIGluIGNvbnRleHQpIHtcbiAgICAgICAgICAgIGV4ZWNJdGVyYXRpb24oaSwgaSwgaSA9PT0gY29udGV4dC5sZW5ndGggLSAxKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSBpZiAoZ2xvYmFsLlN5bWJvbCAmJiBjb250ZXh0W2dsb2JhbC5TeW1ib2wuaXRlcmF0b3JdKSB7XG4gICAgICAgIGNvbnN0IG5ld0NvbnRleHQgPSBbXTtcbiAgICAgICAgY29uc3QgaXRlcmF0b3IgPSBjb250ZXh0W2dsb2JhbC5TeW1ib2wuaXRlcmF0b3JdKCk7XG4gICAgICAgIGZvciAobGV0IGl0ID0gaXRlcmF0b3IubmV4dCgpOyAhaXQuZG9uZTsgaXQgPSBpdGVyYXRvci5uZXh0KCkpIHtcbiAgICAgICAgICBuZXdDb250ZXh0LnB1c2goaXQudmFsdWUpO1xuICAgICAgICB9XG4gICAgICAgIGNvbnRleHQgPSBuZXdDb250ZXh0O1xuICAgICAgICBmb3IgKGxldCBqID0gY29udGV4dC5sZW5ndGg7IGkgPCBqOyBpKyspIHtcbiAgICAgICAgICBleGVjSXRlcmF0aW9uKGksIGksIGkgPT09IGNvbnRleHQubGVuZ3RoIC0gMSk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGxldCBwcmlvcktleTtcblxuICAgICAgICBPYmplY3Qua2V5cyhjb250ZXh0KS5mb3JFYWNoKGtleSA9PiB7XG4gICAgICAgICAgLy8gV2UncmUgcnVubmluZyB0aGUgaXRlcmF0aW9ucyBvbmUgc3RlcCBvdXQgb2Ygc3luYyBzbyB3ZSBjYW4gZGV0ZWN0XG4gICAgICAgICAgLy8gdGhlIGxhc3QgaXRlcmF0aW9uIHdpdGhvdXQgaGF2ZSB0byBzY2FuIHRoZSBvYmplY3QgdHdpY2UgYW5kIGNyZWF0ZVxuICAgICAgICAgIC8vIGFuIGl0ZXJtZWRpYXRlIGtleXMgYXJyYXkuXG4gICAgICAgICAgaWYgKHByaW9yS2V5ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGV4ZWNJdGVyYXRpb24ocHJpb3JLZXksIGkgLSAxKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcHJpb3JLZXkgPSBrZXk7XG4gICAgICAgICAgaSsrO1xuICAgICAgICB9KTtcbiAgICAgICAgaWYgKHByaW9yS2V5ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBleGVjSXRlcmF0aW9uKHByaW9yS2V5LCBpIC0gMSwgdHJ1ZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoaSA9PT0gMCkge1xuICAgICAgcmV0ID0gaW52ZXJzZSh0aGlzKTtcbiAgICB9XG5cbiAgICByZXR1cm4gcmV0O1xuICB9KTtcbn1cbiJdfQ==
  1692. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  1693. /***/ }),
  1694. /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js":
  1695. /*!*******************************************************************************!*\
  1696. !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js ***!
  1697. \*******************************************************************************/
  1698. /*! no static exports found */
  1699. /***/ (function(module, exports, __webpack_require__) {
  1700. "use strict";
  1701. exports.__esModule = true;
  1702. // istanbul ignore next
  1703. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  1704. var _exception = __webpack_require__(/*! ../exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
  1705. var _exception2 = _interopRequireDefault(_exception);
  1706. exports['default'] = function (instance) {
  1707. instance.registerHelper('helperMissing', function () /* [args, ]options */{
  1708. if (arguments.length === 1) {
  1709. // A missing field in a {{foo}} construct.
  1710. return undefined;
  1711. } else {
  1712. // Someone is actually trying to call something, blow up.
  1713. throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
  1714. }
  1715. });
  1716. };
  1717. module.exports = exports['default'];
  1718. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvaGVscGVyLW1pc3NpbmcuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozt5QkFBc0IsY0FBYzs7OztxQkFFckIsVUFBUyxRQUFRLEVBQUU7QUFDaEMsVUFBUSxDQUFDLGNBQWMsQ0FBQyxlQUFlLEVBQUUsaUNBQWdDO0FBQ3ZFLFFBQUksU0FBUyxDQUFDLE1BQU0sS0FBSyxDQUFDLEVBQUU7O0FBRTFCLGFBQU8sU0FBUyxDQUFDO0tBQ2xCLE1BQU07O0FBRUwsWUFBTSwyQkFDSixtQkFBbUIsR0FBRyxTQUFTLENBQUMsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQyxJQUFJLEdBQUcsR0FBRyxDQUNqRSxDQUFDO0tBQ0g7R0FDRixDQUFDLENBQUM7Q0FDSiIsImZpbGUiOiJoZWxwZXItbWlzc2luZy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBFeGNlcHRpb24gZnJvbSAnLi4vZXhjZXB0aW9uJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgaW5zdGFuY2UucmVnaXN0ZXJIZWxwZXIoJ2hlbHBlck1pc3NpbmcnLCBmdW5jdGlvbigvKiBbYXJncywgXW9wdGlvbnMgKi8pIHtcbiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgLy8gQSBtaXNzaW5nIGZpZWxkIGluIGEge3tmb299fSBjb25zdHJ1Y3QuXG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH0gZWxzZSB7XG4gICAgICAvLyBTb21lb25lIGlzIGFjdHVhbGx5IHRyeWluZyB0byBjYWxsIHNvbWV0aGluZywgYmxvdyB1cC5cbiAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oXG4gICAgICAgICdNaXNzaW5nIGhlbHBlcjogXCInICsgYXJndW1lbnRzW2FyZ3VtZW50cy5sZW5ndGggLSAxXS5uYW1lICsgJ1wiJ1xuICAgICAgKTtcbiAgICB9XG4gIH0pO1xufVxuIl19
  1719. /***/ }),
  1720. /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/if.js":
  1721. /*!*******************************************************************!*\
  1722. !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/if.js ***!
  1723. \*******************************************************************/
  1724. /*! no static exports found */
  1725. /***/ (function(module, exports, __webpack_require__) {
  1726. "use strict";
  1727. exports.__esModule = true;
  1728. // istanbul ignore next
  1729. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  1730. var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
  1731. var _exception = __webpack_require__(/*! ../exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
  1732. var _exception2 = _interopRequireDefault(_exception);
  1733. exports['default'] = function (instance) {
  1734. instance.registerHelper('if', function (conditional, options) {
  1735. if (arguments.length != 2) {
  1736. throw new _exception2['default']('#if requires exactly one argument');
  1737. }
  1738. if (_utils.isFunction(conditional)) {
  1739. conditional = conditional.call(this);
  1740. }
  1741. // Default behavior is to render the positive path if the value is truthy and not empty.
  1742. // The `includeZero` option may be set to treat the condtional as purely not empty based on the
  1743. // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
  1744. if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
  1745. return options.inverse(this);
  1746. } else {
  1747. return options.fn(this);
  1748. }
  1749. });
  1750. instance.registerHelper('unless', function (conditional, options) {
  1751. if (arguments.length != 2) {
  1752. throw new _exception2['default']('#unless requires exactly one argument');
  1753. }
  1754. return instance.helpers['if'].call(this, conditional, {
  1755. fn: options.inverse,
  1756. inverse: options.fn,
  1757. hash: options.hash
  1758. });
  1759. });
  1760. };
  1761. module.exports = exports['default'];
  1762. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvaWYuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztxQkFBb0MsVUFBVTs7eUJBQ3hCLGNBQWM7Ozs7cUJBRXJCLFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFVBQVEsQ0FBQyxjQUFjLENBQUMsSUFBSSxFQUFFLFVBQVMsV0FBVyxFQUFFLE9BQU8sRUFBRTtBQUMzRCxRQUFJLFNBQVMsQ0FBQyxNQUFNLElBQUksQ0FBQyxFQUFFO0FBQ3pCLFlBQU0sMkJBQWMsbUNBQW1DLENBQUMsQ0FBQztLQUMxRDtBQUNELFFBQUksa0JBQVcsV0FBVyxDQUFDLEVBQUU7QUFDM0IsaUJBQVcsR0FBRyxXQUFXLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQ3RDOzs7OztBQUtELFFBQUksQUFBQyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsV0FBVyxJQUFJLENBQUMsV0FBVyxJQUFLLGVBQVEsV0FBVyxDQUFDLEVBQUU7QUFDdkUsYUFBTyxPQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0tBQzlCLE1BQU07QUFDTCxhQUFPLE9BQU8sQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUM7S0FDekI7R0FDRixDQUFDLENBQUM7O0FBRUgsVUFBUSxDQUFDLGNBQWMsQ0FBQyxRQUFRLEVBQUUsVUFBUyxXQUFXLEVBQUUsT0FBTyxFQUFFO0FBQy9ELFFBQUksU0FBUyxDQUFDLE1BQU0sSUFBSSxDQUFDLEVBQUU7QUFDekIsWUFBTSwyQkFBYyx1Q0FBdUMsQ0FBQyxDQUFDO0tBQzlEO0FBQ0QsV0FBTyxRQUFRLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsV0FBVyxFQUFFO0FBQ3BELFFBQUUsRUFBRSxPQUFPLENBQUMsT0FBTztBQUNuQixhQUFPLEVBQUUsT0FBTyxDQUFDLEVBQUU7QUFDbkIsVUFBSSxFQUFFLE9BQU8sQ0FBQyxJQUFJO0tBQ25CLENBQUMsQ0FBQztHQUNKLENBQUMsQ0FBQztDQUNKIiwiZmlsZSI6ImlmLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgaXNFbXB0eSwgaXNGdW5jdGlvbiB9IGZyb20gJy4uL3V0aWxzJztcbmltcG9ydCBFeGNlcHRpb24gZnJvbSAnLi4vZXhjZXB0aW9uJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgaW5zdGFuY2UucmVnaXN0ZXJIZWxwZXIoJ2lmJywgZnVuY3Rpb24oY29uZGl0aW9uYWwsIG9wdGlvbnMpIHtcbiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCAhPSAyKSB7XG4gICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCcjaWYgcmVxdWlyZXMgZXhhY3RseSBvbmUgYXJndW1lbnQnKTtcbiAgICB9XG4gICAgaWYgKGlzRnVuY3Rpb24oY29uZGl0aW9uYWwpKSB7XG4gICAgICBjb25kaXRpb25hbCA9IGNvbmRpdGlvbmFsLmNhbGwodGhpcyk7XG4gICAgfVxuXG4gICAgLy8gRGVmYXVsdCBiZWhhdmlvciBpcyB0byByZW5kZXIgdGhlIHBvc2l0aXZlIHBhdGggaWYgdGhlIHZhbHVlIGlzIHRydXRoeSBhbmQgbm90IGVtcHR5LlxuICAgIC8vIFRoZSBgaW5jbHVkZVplcm9gIG9wdGlvbiBtYXkgYmUgc2V0IHRvIHRyZWF0IHRoZSBjb25kdGlvbmFsIGFzIHB1cmVseSBub3QgZW1wdHkgYmFzZWQgb24gdGhlXG4gICAgLy8gYmVoYXZpb3Igb2YgaXNFbXB0eS4gRWZmZWN0aXZlbHkgdGhpcyBkZXRlcm1pbmVzIGlmIDAgaXMgaGFuZGxlZCBieSB0aGUgcG9zaXRpdmUgcGF0aCBvciBuZWdhdGl2ZS5cbiAgICBpZiAoKCFvcHRpb25zLmhhc2guaW5jbHVkZVplcm8gJiYgIWNvbmRpdGlvbmFsKSB8fCBpc0VtcHR5KGNvbmRpdGlvbmFsKSkge1xuICAgICAgcmV0dXJuIG9wdGlvbnMuaW52ZXJzZSh0aGlzKTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIG9wdGlvbnMuZm4odGhpcyk7XG4gICAgfVxuICB9KTtcblxuICBpbnN0YW5jZS5yZWdpc3RlckhlbHBlcigndW5sZXNzJywgZnVuY3Rpb24oY29uZGl0aW9uYWwsIG9wdGlvbnMpIHtcbiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCAhPSAyKSB7XG4gICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCcjdW5sZXNzIHJlcXVpcmVzIGV4YWN0bHkgb25lIGFyZ3VtZW50Jyk7XG4gICAgfVxuICAgIHJldHVybiBpbnN0YW5jZS5oZWxwZXJzWydpZiddLmNhbGwodGhpcywgY29uZGl0aW9uYWwsIHtcbiAgICAgIGZuOiBvcHRpb25zLmludmVyc2UsXG4gICAgICBpbnZlcnNlOiBvcHRpb25zLmZuLFxuICAgICAgaGFzaDogb3B0aW9ucy5oYXNoXG4gICAgfSk7XG4gIH0pO1xufVxuIl19
  1763. /***/ }),
  1764. /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/log.js":
  1765. /*!********************************************************************!*\
  1766. !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/log.js ***!
  1767. \********************************************************************/
  1768. /*! no static exports found */
  1769. /***/ (function(module, exports, __webpack_require__) {
  1770. "use strict";
  1771. exports.__esModule = true;
  1772. exports['default'] = function (instance) {
  1773. instance.registerHelper('log', function () /* message, options */{
  1774. var args = [undefined],
  1775. options = arguments[arguments.length - 1];
  1776. for (var i = 0; i < arguments.length - 1; i++) {
  1777. args.push(arguments[i]);
  1778. }
  1779. var level = 1;
  1780. if (options.hash.level != null) {
  1781. level = options.hash.level;
  1782. } else if (options.data && options.data.level != null) {
  1783. level = options.data.level;
  1784. }
  1785. args[0] = level;
  1786. instance.log.apply(instance, args);
  1787. });
  1788. };
  1789. module.exports = exports['default'];
  1790. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvbG9nLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQWUsVUFBUyxRQUFRLEVBQUU7QUFDaEMsVUFBUSxDQUFDLGNBQWMsQ0FBQyxLQUFLLEVBQUUsa0NBQWlDO0FBQzlELFFBQUksSUFBSSxHQUFHLENBQUMsU0FBUyxDQUFDO1FBQ3BCLE9BQU8sR0FBRyxTQUFTLENBQUMsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQztBQUM1QyxTQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLEVBQUU7QUFDN0MsVUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztLQUN6Qjs7QUFFRCxRQUFJLEtBQUssR0FBRyxDQUFDLENBQUM7QUFDZCxRQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsS0FBSyxJQUFJLElBQUksRUFBRTtBQUM5QixXQUFLLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUM7S0FDNUIsTUFBTSxJQUFJLE9BQU8sQ0FBQyxJQUFJLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxLQUFLLElBQUksSUFBSSxFQUFFO0FBQ3JELFdBQUssR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQztLQUM1QjtBQUNELFFBQUksQ0FBQyxDQUFDLENBQUMsR0FBRyxLQUFLLENBQUM7O0FBRWhCLFlBQVEsQ0FBQyxHQUFHLE1BQUEsQ0FBWixRQUFRLEVBQVEsSUFBSSxDQUFDLENBQUM7R0FDdkIsQ0FBQyxDQUFDO0NBQ0oiLCJmaWxlIjoibG9nLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgaW5zdGFuY2UucmVnaXN0ZXJIZWxwZXIoJ2xvZycsIGZ1bmN0aW9uKC8qIG1lc3NhZ2UsIG9wdGlvbnMgKi8pIHtcbiAgICBsZXQgYXJncyA9IFt1bmRlZmluZWRdLFxuICAgICAgb3B0aW9ucyA9IGFyZ3VtZW50c1thcmd1bWVudHMubGVuZ3RoIC0gMV07XG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcmd1bWVudHMubGVuZ3RoIC0gMTsgaSsrKSB7XG4gICAgICBhcmdzLnB1c2goYXJndW1lbnRzW2ldKTtcbiAgICB9XG5cbiAgICBsZXQgbGV2ZWwgPSAxO1xuICAgIGlmIChvcHRpb25zLmhhc2gubGV2ZWwgIT0gbnVsbCkge1xuICAgICAgbGV2ZWwgPSBvcHRpb25zLmhhc2gubGV2ZWw7XG4gICAgfSBlbHNlIGlmIChvcHRpb25zLmRhdGEgJiYgb3B0aW9ucy5kYXRhLmxldmVsICE9IG51bGwpIHtcbiAgICAgIGxldmVsID0gb3B0aW9ucy5kYXRhLmxldmVsO1xuICAgIH1cbiAgICBhcmdzWzBdID0gbGV2ZWw7XG5cbiAgICBpbnN0YW5jZS5sb2coLi4uYXJncyk7XG4gIH0pO1xufVxuIl19
  1791. /***/ }),
  1792. /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js":
  1793. /*!***********************************************************************!*\
  1794. !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js ***!
  1795. \***********************************************************************/
  1796. /*! no static exports found */
  1797. /***/ (function(module, exports, __webpack_require__) {
  1798. "use strict";
  1799. exports.__esModule = true;
  1800. exports['default'] = function (instance) {
  1801. instance.registerHelper('lookup', function (obj, field, options) {
  1802. if (!obj) {
  1803. // Note for 5.0: Change to "obj == null" in 5.0
  1804. return obj;
  1805. }
  1806. return options.lookupProperty(obj, field);
  1807. });
  1808. };
  1809. module.exports = exports['default'];
  1810. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvbG9va3VwLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQWUsVUFBUyxRQUFRLEVBQUU7QUFDaEMsVUFBUSxDQUFDLGNBQWMsQ0FBQyxRQUFRLEVBQUUsVUFBUyxHQUFHLEVBQUUsS0FBSyxFQUFFLE9BQU8sRUFBRTtBQUM5RCxRQUFJLENBQUMsR0FBRyxFQUFFOztBQUVSLGFBQU8sR0FBRyxDQUFDO0tBQ1o7QUFDRCxXQUFPLE9BQU8sQ0FBQyxjQUFjLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxDQUFDO0dBQzNDLENBQUMsQ0FBQztDQUNKIiwiZmlsZSI6Imxvb2t1cC5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uKGluc3RhbmNlKSB7XG4gIGluc3RhbmNlLnJlZ2lzdGVySGVscGVyKCdsb29rdXAnLCBmdW5jdGlvbihvYmosIGZpZWxkLCBvcHRpb25zKSB7XG4gICAgaWYgKCFvYmopIHtcbiAgICAgIC8vIE5vdGUgZm9yIDUuMDogQ2hhbmdlIHRvIFwib2JqID09IG51bGxcIiBpbiA1LjBcbiAgICAgIHJldHVybiBvYmo7XG4gICAgfVxuICAgIHJldHVybiBvcHRpb25zLmxvb2t1cFByb3BlcnR5KG9iaiwgZmllbGQpO1xuICB9KTtcbn1cbiJdfQ==
  1811. /***/ }),
  1812. /***/ "./node_modules/handlebars/dist/cjs/handlebars/helpers/with.js":
  1813. /*!*********************************************************************!*\
  1814. !*** ./node_modules/handlebars/dist/cjs/handlebars/helpers/with.js ***!
  1815. \*********************************************************************/
  1816. /*! no static exports found */
  1817. /***/ (function(module, exports, __webpack_require__) {
  1818. "use strict";
  1819. exports.__esModule = true;
  1820. // istanbul ignore next
  1821. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  1822. var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
  1823. var _exception = __webpack_require__(/*! ../exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
  1824. var _exception2 = _interopRequireDefault(_exception);
  1825. exports['default'] = function (instance) {
  1826. instance.registerHelper('with', function (context, options) {
  1827. if (arguments.length != 2) {
  1828. throw new _exception2['default']('#with requires exactly one argument');
  1829. }
  1830. if (_utils.isFunction(context)) {
  1831. context = context.call(this);
  1832. }
  1833. var fn = options.fn;
  1834. if (!_utils.isEmpty(context)) {
  1835. var data = options.data;
  1836. if (options.data && options.ids) {
  1837. data = _utils.createFrame(options.data);
  1838. data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
  1839. }
  1840. return fn(context, {
  1841. data: data,
  1842. blockParams: _utils.blockParams([context], [data && data.contextPath])
  1843. });
  1844. } else {
  1845. return options.inverse(this);
  1846. }
  1847. });
  1848. };
  1849. module.exports = exports['default'];
  1850. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2hlbHBlcnMvd2l0aC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O3FCQU1PLFVBQVU7O3lCQUNLLGNBQWM7Ozs7cUJBRXJCLFVBQVMsUUFBUSxFQUFFO0FBQ2hDLFVBQVEsQ0FBQyxjQUFjLENBQUMsTUFBTSxFQUFFLFVBQVMsT0FBTyxFQUFFLE9BQU8sRUFBRTtBQUN6RCxRQUFJLFNBQVMsQ0FBQyxNQUFNLElBQUksQ0FBQyxFQUFFO0FBQ3pCLFlBQU0sMkJBQWMscUNBQXFDLENBQUMsQ0FBQztLQUM1RDtBQUNELFFBQUksa0JBQVcsT0FBTyxDQUFDLEVBQUU7QUFDdkIsYUFBTyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7S0FDOUI7O0FBRUQsUUFBSSxFQUFFLEdBQUcsT0FBTyxDQUFDLEVBQUUsQ0FBQzs7QUFFcEIsUUFBSSxDQUFDLGVBQVEsT0FBTyxDQUFDLEVBQUU7QUFDckIsVUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQztBQUN4QixVQUFJLE9BQU8sQ0FBQyxJQUFJLElBQUksT0FBTyxDQUFDLEdBQUcsRUFBRTtBQUMvQixZQUFJLEdBQUcsbUJBQVksT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ2pDLFlBQUksQ0FBQyxXQUFXLEdBQUcseUJBQ2pCLE9BQU8sQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUN4QixPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUNmLENBQUM7T0FDSDs7QUFFRCxhQUFPLEVBQUUsQ0FBQyxPQUFPLEVBQUU7QUFDakIsWUFBSSxFQUFFLElBQUk7QUFDVixtQkFBVyxFQUFFLG1CQUFZLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxJQUFJLElBQUksSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFDO09BQ2hFLENBQUMsQ0FBQztLQUNKLE1BQU07QUFDTCxhQUFPLE9BQU8sQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7S0FDOUI7R0FDRixDQUFDLENBQUM7Q0FDSiIsImZpbGUiOiJ3aXRoLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgYXBwZW5kQ29udGV4dFBhdGgsXG4gIGJsb2NrUGFyYW1zLFxuICBjcmVhdGVGcmFtZSxcbiAgaXNFbXB0eSxcbiAgaXNGdW5jdGlvblxufSBmcm9tICcuLi91dGlscyc7XG5pbXBvcnQgRXhjZXB0aW9uIGZyb20gJy4uL2V4Y2VwdGlvbic7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uKGluc3RhbmNlKSB7XG4gIGluc3RhbmNlLnJlZ2lzdGVySGVscGVyKCd3aXRoJywgZnVuY3Rpb24oY29udGV4dCwgb3B0aW9ucykge1xuICAgIGlmIChhcmd1bWVudHMubGVuZ3RoICE9IDIpIHtcbiAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oJyN3aXRoIHJlcXVpcmVzIGV4YWN0bHkgb25lIGFyZ3VtZW50Jyk7XG4gICAgfVxuICAgIGlmIChpc0Z1bmN0aW9uKGNvbnRleHQpKSB7XG4gICAgICBjb250ZXh0ID0gY29udGV4dC5jYWxsKHRoaXMpO1xuICAgIH1cblxuICAgIGxldCBmbiA9IG9wdGlvbnMuZm47XG5cbiAgICBpZiAoIWlzRW1wdHkoY29udGV4dCkpIHtcbiAgICAgIGxldCBkYXRhID0gb3B0aW9ucy5kYXRhO1xuICAgICAgaWYgKG9wdGlvbnMuZGF0YSAmJiBvcHRpb25zLmlkcykge1xuICAgICAgICBkYXRhID0gY3JlYXRlRnJhbWUob3B0aW9ucy5kYXRhKTtcbiAgICAgICAgZGF0YS5jb250ZXh0UGF0aCA9IGFwcGVuZENvbnRleHRQYXRoKFxuICAgICAgICAgIG9wdGlvbnMuZGF0YS5jb250ZXh0UGF0aCxcbiAgICAgICAgICBvcHRpb25zLmlkc1swXVxuICAgICAgICApO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gZm4oY29udGV4dCwge1xuICAgICAgICBkYXRhOiBkYXRhLFxuICAgICAgICBibG9ja1BhcmFtczogYmxvY2tQYXJhbXMoW2NvbnRleHRdLCBbZGF0YSAmJiBkYXRhLmNvbnRleHRQYXRoXSlcbiAgICAgIH0pO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gb3B0aW9ucy5pbnZlcnNlKHRoaXMpO1xuICAgIH1cbiAgfSk7XG59XG4iXX0=
  1851. /***/ }),
  1852. /***/ "./node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js":
  1853. /*!******************************************************************************************!*\
  1854. !*** ./node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js ***!
  1855. \******************************************************************************************/
  1856. /*! no static exports found */
  1857. /***/ (function(module, exports, __webpack_require__) {
  1858. "use strict";
  1859. exports.__esModule = true;
  1860. exports.createNewLookupObject = createNewLookupObject;
  1861. var _utils = __webpack_require__(/*! ../utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
  1862. /**
  1863. * Create a new object with "null"-prototype to avoid truthy results on prototype properties.
  1864. * The resulting object can be used with "object[property]" to check if a property exists
  1865. * @param {...object} sources a varargs parameter of source objects that will be merged
  1866. * @returns {object}
  1867. */
  1868. function createNewLookupObject() {
  1869. for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {
  1870. sources[_key] = arguments[_key];
  1871. }
  1872. return _utils.extend.apply(undefined, [Object.create(null)].concat(sources));
  1873. }
  1874. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2ludGVybmFsL2NyZWF0ZS1uZXctbG9va3VwLW9iamVjdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztxQkFBdUIsVUFBVTs7Ozs7Ozs7O0FBUTFCLFNBQVMscUJBQXFCLEdBQWE7b0NBQVQsT0FBTztBQUFQLFdBQU87OztBQUM5QyxTQUFPLGdDQUFPLE1BQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLFNBQUssT0FBTyxFQUFDLENBQUM7Q0FDaEQiLCJmaWxlIjoiY3JlYXRlLW5ldy1sb29rdXAtb2JqZWN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZXh0ZW5kIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vKipcbiAqIENyZWF0ZSBhIG5ldyBvYmplY3Qgd2l0aCBcIm51bGxcIi1wcm90b3R5cGUgdG8gYXZvaWQgdHJ1dGh5IHJlc3VsdHMgb24gcHJvdG90eXBlIHByb3BlcnRpZXMuXG4gKiBUaGUgcmVzdWx0aW5nIG9iamVjdCBjYW4gYmUgdXNlZCB3aXRoIFwib2JqZWN0W3Byb3BlcnR5XVwiIHRvIGNoZWNrIGlmIGEgcHJvcGVydHkgZXhpc3RzXG4gKiBAcGFyYW0gey4uLm9iamVjdH0gc291cmNlcyBhIHZhcmFyZ3MgcGFyYW1ldGVyIG9mIHNvdXJjZSBvYmplY3RzIHRoYXQgd2lsbCBiZSBtZXJnZWRcbiAqIEByZXR1cm5zIHtvYmplY3R9XG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBjcmVhdGVOZXdMb29rdXBPYmplY3QoLi4uc291cmNlcykge1xuICByZXR1cm4gZXh0ZW5kKE9iamVjdC5jcmVhdGUobnVsbCksIC4uLnNvdXJjZXMpO1xufVxuIl19
  1875. /***/ }),
  1876. /***/ "./node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js":
  1877. /*!******************************************************************************!*\
  1878. !*** ./node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js ***!
  1879. \******************************************************************************/
  1880. /*! no static exports found */
  1881. /***/ (function(module, exports, __webpack_require__) {
  1882. "use strict";
  1883. exports.__esModule = true;
  1884. exports.createProtoAccessControl = createProtoAccessControl;
  1885. exports.resultIsAllowed = resultIsAllowed;
  1886. exports.resetLoggedProperties = resetLoggedProperties;
  1887. // istanbul ignore next
  1888. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
  1889. var _createNewLookupObject = __webpack_require__(/*! ./create-new-lookup-object */ "./node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js");
  1890. var _logger = __webpack_require__(/*! ../logger */ "./node_modules/handlebars/dist/cjs/handlebars/logger.js");
  1891. var logger = _interopRequireWildcard(_logger);
  1892. var loggedProperties = Object.create(null);
  1893. function createProtoAccessControl(runtimeOptions) {
  1894. var defaultMethodWhiteList = Object.create(null);
  1895. defaultMethodWhiteList['constructor'] = false;
  1896. defaultMethodWhiteList['__defineGetter__'] = false;
  1897. defaultMethodWhiteList['__defineSetter__'] = false;
  1898. defaultMethodWhiteList['__lookupGetter__'] = false;
  1899. var defaultPropertyWhiteList = Object.create(null);
  1900. // eslint-disable-next-line no-proto
  1901. defaultPropertyWhiteList['__proto__'] = false;
  1902. return {
  1903. properties: {
  1904. whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
  1905. defaultValue: runtimeOptions.allowProtoPropertiesByDefault
  1906. },
  1907. methods: {
  1908. whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
  1909. defaultValue: runtimeOptions.allowProtoMethodsByDefault
  1910. }
  1911. };
  1912. }
  1913. function resultIsAllowed(result, protoAccessControl, propertyName) {
  1914. if (typeof result === 'function') {
  1915. return checkWhiteList(protoAccessControl.methods, propertyName);
  1916. } else {
  1917. return checkWhiteList(protoAccessControl.properties, propertyName);
  1918. }
  1919. }
  1920. function checkWhiteList(protoAccessControlForType, propertyName) {
  1921. if (protoAccessControlForType.whitelist[propertyName] !== undefined) {
  1922. return protoAccessControlForType.whitelist[propertyName] === true;
  1923. }
  1924. if (protoAccessControlForType.defaultValue !== undefined) {
  1925. return protoAccessControlForType.defaultValue;
  1926. }
  1927. logUnexpecedPropertyAccessOnce(propertyName);
  1928. return false;
  1929. }
  1930. function logUnexpecedPropertyAccessOnce(propertyName) {
  1931. if (loggedProperties[propertyName] !== true) {
  1932. loggedProperties[propertyName] = true;
  1933. logger.log('error', 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\n' + 'You can add a runtime option to disable the check or this warning:\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
  1934. }
  1935. }
  1936. function resetLoggedProperties() {
  1937. Object.keys(loggedProperties).forEach(function (propertyName) {
  1938. delete loggedProperties[propertyName];
  1939. });
  1940. }
  1941. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2ludGVybmFsL3Byb3RvLWFjY2Vzcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O3FDQUFzQyw0QkFBNEI7O3NCQUMxQyxXQUFXOztJQUF2QixNQUFNOztBQUVsQixJQUFNLGdCQUFnQixHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUM7O0FBRXRDLFNBQVMsd0JBQXdCLENBQUMsY0FBYyxFQUFFO0FBQ3ZELE1BQUksc0JBQXNCLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUNqRCx3QkFBc0IsQ0FBQyxhQUFhLENBQUMsR0FBRyxLQUFLLENBQUM7QUFDOUMsd0JBQXNCLENBQUMsa0JBQWtCLENBQUMsR0FBRyxLQUFLLENBQUM7QUFDbkQsd0JBQXNCLENBQUMsa0JBQWtCLENBQUMsR0FBRyxLQUFLLENBQUM7QUFDbkQsd0JBQXNCLENBQUMsa0JBQWtCLENBQUMsR0FBRyxLQUFLLENBQUM7O0FBRW5ELE1BQUksd0JBQXdCLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQzs7QUFFbkQsMEJBQXdCLENBQUMsV0FBVyxDQUFDLEdBQUcsS0FBSyxDQUFDOztBQUU5QyxTQUFPO0FBQ0wsY0FBVSxFQUFFO0FBQ1YsZUFBUyxFQUFFLDZDQUNULHdCQUF3QixFQUN4QixjQUFjLENBQUMsc0JBQXNCLENBQ3RDO0FBQ0Qsa0JBQVksRUFBRSxjQUFjLENBQUMsNkJBQTZCO0tBQzNEO0FBQ0QsV0FBTyxFQUFFO0FBQ1AsZUFBUyxFQUFFLDZDQUNULHNCQUFzQixFQUN0QixjQUFjLENBQUMsbUJBQW1CLENBQ25DO0FBQ0Qsa0JBQVksRUFBRSxjQUFjLENBQUMsMEJBQTBCO0tBQ3hEO0dBQ0YsQ0FBQztDQUNIOztBQUVNLFNBQVMsZUFBZSxDQUFDLE1BQU0sRUFBRSxrQkFBa0IsRUFBRSxZQUFZLEVBQUU7QUFDeEUsTUFBSSxPQUFPLE1BQU0sS0FBSyxVQUFVLEVBQUU7QUFDaEMsV0FBTyxjQUFjLENBQUMsa0JBQWtCLENBQUMsT0FBTyxFQUFFLFlBQVksQ0FBQyxDQUFDO0dBQ2pFLE1BQU07QUFDTCxXQUFPLGNBQWMsQ0FBQyxrQkFBa0IsQ0FBQyxVQUFVLEVBQUUsWUFBWSxDQUFDLENBQUM7R0FDcEU7Q0FDRjs7QUFFRCxTQUFTLGNBQWMsQ0FBQyx5QkFBeUIsRUFBRSxZQUFZLEVBQUU7QUFDL0QsTUFBSSx5QkFBeUIsQ0FBQyxTQUFTLENBQUMsWUFBWSxDQUFDLEtBQUssU0FBUyxFQUFFO0FBQ25FLFdBQU8seUJBQXlCLENBQUMsU0FBUyxDQUFDLFlBQVksQ0FBQyxLQUFLLElBQUksQ0FBQztHQUNuRTtBQUNELE1BQUkseUJBQXlCLENBQUMsWUFBWSxLQUFLLFNBQVMsRUFBRTtBQUN4RCxXQUFPLHlCQUF5QixDQUFDLFlBQVksQ0FBQztHQUMvQztBQUNELGdDQUE4QixDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQzdDLFNBQU8sS0FBSyxDQUFDO0NBQ2Q7O0FBRUQsU0FBUyw4QkFBOEIsQ0FBQyxZQUFZLEVBQUU7QUFDcEQsTUFBSSxnQkFBZ0IsQ0FBQyxZQUFZLENBQUMsS0FBSyxJQUFJLEVBQUU7QUFDM0Msb0JBQWdCLENBQUMsWUFBWSxDQUFDLEdBQUcsSUFBSSxDQUFDO0FBQ3RDLFVBQU0sQ0FBQyxHQUFHLENBQ1IsT0FBTyxFQUNQLGlFQUErRCxZQUFZLG9JQUNILG9IQUMyQyxDQUNwSCxDQUFDO0dBQ0g7Q0FDRjs7QUFFTSxTQUFTLHFCQUFxQixHQUFHO0FBQ3RDLFFBQU0sQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxPQUFPLENBQUMsVUFBQSxZQUFZLEVBQUk7QUFDcEQsV0FBTyxnQkFBZ0IsQ0FBQyxZQUFZLENBQUMsQ0FBQztHQUN2QyxDQUFDLENBQUM7Q0FDSiIsImZpbGUiOiJwcm90by1hY2Nlc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjcmVhdGVOZXdMb29rdXBPYmplY3QgfSBmcm9tICcuL2NyZWF0ZS1uZXctbG9va3VwLW9iamVjdCc7XG5pbXBvcnQgKiBhcyBsb2dnZXIgZnJvbSAnLi4vbG9nZ2VyJztcblxuY29uc3QgbG9nZ2VkUHJvcGVydGllcyA9IE9iamVjdC5jcmVhdGUobnVsbCk7XG5cbmV4cG9ydCBmdW5jdGlvbiBjcmVhdGVQcm90b0FjY2Vzc0NvbnRyb2wocnVudGltZU9wdGlvbnMpIHtcbiAgbGV0IGRlZmF1bHRNZXRob2RXaGl0ZUxpc3QgPSBPYmplY3QuY3JlYXRlKG51bGwpO1xuICBkZWZhdWx0TWV0aG9kV2hpdGVMaXN0Wydjb25zdHJ1Y3RvciddID0gZmFsc2U7XG4gIGRlZmF1bHRNZXRob2RXaGl0ZUxpc3RbJ19fZGVmaW5lR2V0dGVyX18nXSA9IGZhbHNlO1xuICBkZWZhdWx0TWV0aG9kV2hpdGVMaXN0WydfX2RlZmluZVNldHRlcl9fJ10gPSBmYWxzZTtcbiAgZGVmYXVsdE1ldGhvZFdoaXRlTGlzdFsnX19sb29rdXBHZXR0ZXJfXyddID0gZmFsc2U7XG5cbiAgbGV0IGRlZmF1bHRQcm9wZXJ0eVdoaXRlTGlzdCA9IE9iamVjdC5jcmVhdGUobnVsbCk7XG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1wcm90b1xuICBkZWZhdWx0UHJvcGVydHlXaGl0ZUxpc3RbJ19fcHJvdG9fXyddID0gZmFsc2U7XG5cbiAgcmV0dXJuIHtcbiAgICBwcm9wZXJ0aWVzOiB7XG4gICAgICB3aGl0ZWxpc3Q6IGNyZWF0ZU5ld0xvb2t1cE9iamVjdChcbiAgICAgICAgZGVmYXVsdFByb3BlcnR5V2hpdGVMaXN0LFxuICAgICAgICBydW50aW1lT3B0aW9ucy5hbGxvd2VkUHJvdG9Qcm9wZXJ0aWVzXG4gICAgICApLFxuICAgICAgZGVmYXVsdFZhbHVlOiBydW50aW1lT3B0aW9ucy5hbGxvd1Byb3RvUHJvcGVydGllc0J5RGVmYXVsdFxuICAgIH0sXG4gICAgbWV0aG9kczoge1xuICAgICAgd2hpdGVsaXN0OiBjcmVhdGVOZXdMb29rdXBPYmplY3QoXG4gICAgICAgIGRlZmF1bHRNZXRob2RXaGl0ZUxpc3QsXG4gICAgICAgIHJ1bnRpbWVPcHRpb25zLmFsbG93ZWRQcm90b01ldGhvZHNcbiAgICAgICksXG4gICAgICBkZWZhdWx0VmFsdWU6IHJ1bnRpbWVPcHRpb25zLmFsbG93UHJvdG9NZXRob2RzQnlEZWZhdWx0XG4gICAgfVxuICB9O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gcmVzdWx0SXNBbGxvd2VkKHJlc3VsdCwgcHJvdG9BY2Nlc3NDb250cm9sLCBwcm9wZXJ0eU5hbWUpIHtcbiAgaWYgKHR5cGVvZiByZXN1bHQgPT09ICdmdW5jdGlvbicpIHtcbiAgICByZXR1cm4gY2hlY2tXaGl0ZUxpc3QocHJvdG9BY2Nlc3NDb250cm9sLm1ldGhvZHMsIHByb3BlcnR5TmFtZSk7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIGNoZWNrV2hpdGVMaXN0KHByb3RvQWNjZXNzQ29udHJvbC5wcm9wZXJ0aWVzLCBwcm9wZXJ0eU5hbWUpO1xuICB9XG59XG5cbmZ1bmN0aW9uIGNoZWNrV2hpdGVMaXN0KHByb3RvQWNjZXNzQ29udHJvbEZvclR5cGUsIHByb3BlcnR5TmFtZSkge1xuICBpZiAocHJvdG9BY2Nlc3NDb250cm9sRm9yVHlwZS53aGl0ZWxpc3RbcHJvcGVydHlOYW1lXSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgcmV0dXJuIHByb3RvQWNjZXNzQ29udHJvbEZvclR5cGUud2hpdGVsaXN0W3Byb3BlcnR5TmFtZV0gPT09IHRydWU7XG4gIH1cbiAgaWYgKHByb3RvQWNjZXNzQ29udHJvbEZvclR5cGUuZGVmYXVsdFZhbHVlICE9PSB1bmRlZmluZWQpIHtcbiAgICByZXR1cm4gcHJvdG9BY2Nlc3NDb250cm9sRm9yVHlwZS5kZWZhdWx0VmFsdWU7XG4gIH1cbiAgbG9nVW5leHBlY2VkUHJvcGVydHlBY2Nlc3NPbmNlKHByb3BlcnR5TmFtZSk7XG4gIHJldHVybiBmYWxzZTtcbn1cblxuZnVuY3Rpb24gbG9nVW5leHBlY2VkUHJvcGVydHlBY2Nlc3NPbmNlKHByb3BlcnR5TmFtZSkge1xuICBpZiAobG9nZ2VkUHJvcGVydGllc1twcm9wZXJ0eU5hbWVdICE9PSB0cnVlKSB7XG4gICAgbG9nZ2VkUHJvcGVydGllc1twcm9wZXJ0eU5hbWVdID0gdHJ1ZTtcbiAgICBsb2dnZXIubG9nKFxuICAgICAgJ2Vycm9yJyxcbiAgICAgIGBIYW5kbGViYXJzOiBBY2Nlc3MgaGFzIGJlZW4gZGVuaWVkIHRvIHJlc29sdmUgdGhlIHByb3BlcnR5IFwiJHtwcm9wZXJ0eU5hbWV9XCIgYmVjYXVzZSBpdCBpcyBub3QgYW4gXCJvd24gcHJvcGVydHlcIiBvZiBpdHMgcGFyZW50LlxcbmAgK1xuICAgICAgICBgWW91IGNhbiBhZGQgYSBydW50aW1lIG9wdGlvbiB0byBkaXNhYmxlIHRoZSBjaGVjayBvciB0aGlzIHdhcm5pbmc6XFxuYCArXG4gICAgICAgIGBTZWUgaHR0cHM6Ly9oYW5kbGViYXJzanMuY29tL2FwaS1yZWZlcmVuY2UvcnVudGltZS1vcHRpb25zLmh0bWwjb3B0aW9ucy10by1jb250cm9sLXByb3RvdHlwZS1hY2Nlc3MgZm9yIGRldGFpbHNgXG4gICAgKTtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gcmVzZXRMb2dnZWRQcm9wZXJ0aWVzKCkge1xuICBPYmplY3Qua2V5cyhsb2dnZWRQcm9wZXJ0aWVzKS5mb3JFYWNoKHByb3BlcnR5TmFtZSA9PiB7XG4gICAgZGVsZXRlIGxvZ2dlZFByb3BlcnRpZXNbcHJvcGVydHlOYW1lXTtcbiAgfSk7XG59XG4iXX0=
  1942. /***/ }),
  1943. /***/ "./node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js":
  1944. /*!****************************************************************************!*\
  1945. !*** ./node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js ***!
  1946. \****************************************************************************/
  1947. /*! no static exports found */
  1948. /***/ (function(module, exports, __webpack_require__) {
  1949. "use strict";
  1950. exports.__esModule = true;
  1951. exports.wrapHelper = wrapHelper;
  1952. function wrapHelper(helper, transformOptionsFn) {
  1953. if (typeof helper !== 'function') {
  1954. // This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639
  1955. // We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function.
  1956. return helper;
  1957. }
  1958. var wrapper = function wrapper() /* dynamic arguments */{
  1959. var options = arguments[arguments.length - 1];
  1960. arguments[arguments.length - 1] = transformOptionsFn(options);
  1961. return helper.apply(this, arguments);
  1962. };
  1963. return wrapper;
  1964. }
  1965. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2ludGVybmFsL3dyYXBIZWxwZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBTyxTQUFTLFVBQVUsQ0FBQyxNQUFNLEVBQUUsa0JBQWtCLEVBQUU7QUFDckQsTUFBSSxPQUFPLE1BQU0sS0FBSyxVQUFVLEVBQUU7OztBQUdoQyxXQUFPLE1BQU0sQ0FBQztHQUNmO0FBQ0QsTUFBSSxPQUFPLEdBQUcsU0FBVixPQUFPLDBCQUFxQztBQUM5QyxRQUFNLE9BQU8sR0FBRyxTQUFTLENBQUMsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQztBQUNoRCxhQUFTLENBQUMsU0FBUyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsR0FBRyxrQkFBa0IsQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUM5RCxXQUFPLE1BQU0sQ0FBQyxLQUFLLENBQUMsSUFBSSxFQUFFLFNBQVMsQ0FBQyxDQUFDO0dBQ3RDLENBQUM7QUFDRixTQUFPLE9BQU8sQ0FBQztDQUNoQiIsImZpbGUiOiJ3cmFwSGVscGVyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIHdyYXBIZWxwZXIoaGVscGVyLCB0cmFuc2Zvcm1PcHRpb25zRm4pIHtcbiAgaWYgKHR5cGVvZiBoZWxwZXIgIT09ICdmdW5jdGlvbicpIHtcbiAgICAvLyBUaGlzIHNob3VsZCBub3QgaGFwcGVuLCBidXQgYXBwYXJlbnRseSBpdCBkb2VzIGluIGh0dHBzOi8vZ2l0aHViLmNvbS93eWNhdHMvaGFuZGxlYmFycy5qcy9pc3N1ZXMvMTYzOVxuICAgIC8vIFdlIHRyeSB0byBtYWtlIHRoZSB3cmFwcGVyIGxlYXN0LWludmFzaXZlIGJ5IG5vdCB3cmFwcGluZyBpdCwgaWYgdGhlIGhlbHBlciBpcyBub3QgYSBmdW5jdGlvbi5cbiAgICByZXR1cm4gaGVscGVyO1xuICB9XG4gIGxldCB3cmFwcGVyID0gZnVuY3Rpb24oLyogZHluYW1pYyBhcmd1bWVudHMgKi8pIHtcbiAgICBjb25zdCBvcHRpb25zID0gYXJndW1lbnRzW2FyZ3VtZW50cy5sZW5ndGggLSAxXTtcbiAgICBhcmd1bWVudHNbYXJndW1lbnRzLmxlbmd0aCAtIDFdID0gdHJhbnNmb3JtT3B0aW9uc0ZuKG9wdGlvbnMpO1xuICAgIHJldHVybiBoZWxwZXIuYXBwbHkodGhpcywgYXJndW1lbnRzKTtcbiAgfTtcbiAgcmV0dXJuIHdyYXBwZXI7XG59XG4iXX0=
  1966. /***/ }),
  1967. /***/ "./node_modules/handlebars/dist/cjs/handlebars/logger.js":
  1968. /*!***************************************************************!*\
  1969. !*** ./node_modules/handlebars/dist/cjs/handlebars/logger.js ***!
  1970. \***************************************************************/
  1971. /*! no static exports found */
  1972. /***/ (function(module, exports, __webpack_require__) {
  1973. "use strict";
  1974. exports.__esModule = true;
  1975. var _utils = __webpack_require__(/*! ./utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
  1976. var logger = {
  1977. methodMap: ['debug', 'info', 'warn', 'error'],
  1978. level: 'info',
  1979. // Maps a given level value to the `methodMap` indexes above.
  1980. lookupLevel: function lookupLevel(level) {
  1981. if (typeof level === 'string') {
  1982. var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
  1983. if (levelMap >= 0) {
  1984. level = levelMap;
  1985. } else {
  1986. level = parseInt(level, 10);
  1987. }
  1988. }
  1989. return level;
  1990. },
  1991. // Can be overridden in the host environment
  1992. log: function log(level) {
  1993. level = logger.lookupLevel(level);
  1994. if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
  1995. var method = logger.methodMap[level];
  1996. // eslint-disable-next-line no-console
  1997. if (!console[method]) {
  1998. method = 'log';
  1999. }
  2000. for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  2001. message[_key - 1] = arguments[_key];
  2002. }
  2003. console[method].apply(console, message); // eslint-disable-line no-console
  2004. }
  2005. }
  2006. };
  2007. exports['default'] = logger;
  2008. module.exports = exports['default'];
  2009. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL2xvZ2dlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O3FCQUF3QixTQUFTOztBQUVqQyxJQUFJLE1BQU0sR0FBRztBQUNYLFdBQVMsRUFBRSxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxFQUFFLE9BQU8sQ0FBQztBQUM3QyxPQUFLLEVBQUUsTUFBTTs7O0FBR2IsYUFBVyxFQUFFLHFCQUFTLEtBQUssRUFBRTtBQUMzQixRQUFJLE9BQU8sS0FBSyxLQUFLLFFBQVEsRUFBRTtBQUM3QixVQUFJLFFBQVEsR0FBRyxlQUFRLE1BQU0sQ0FBQyxTQUFTLEVBQUUsS0FBSyxDQUFDLFdBQVcsRUFBRSxDQUFDLENBQUM7QUFDOUQsVUFBSSxRQUFRLElBQUksQ0FBQyxFQUFFO0FBQ2pCLGFBQUssR0FBRyxRQUFRLENBQUM7T0FDbEIsTUFBTTtBQUNMLGFBQUssR0FBRyxRQUFRLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxDQUFDO09BQzdCO0tBQ0Y7O0FBRUQsV0FBTyxLQUFLLENBQUM7R0FDZDs7O0FBR0QsS0FBRyxFQUFFLGFBQVMsS0FBSyxFQUFjO0FBQy9CLFNBQUssR0FBRyxNQUFNLENBQUMsV0FBVyxDQUFDLEtBQUssQ0FBQyxDQUFDOztBQUVsQyxRQUNFLE9BQU8sT0FBTyxLQUFLLFdBQVcsSUFDOUIsTUFBTSxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLElBQUksS0FBSyxFQUN6QztBQUNBLFVBQUksTUFBTSxHQUFHLE1BQU0sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLENBQUM7O0FBRXJDLFVBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLEVBQUU7QUFDcEIsY0FBTSxHQUFHLEtBQUssQ0FBQztPQUNoQjs7d0NBWG1CLE9BQU87QUFBUCxlQUFPOzs7QUFZM0IsYUFBTyxDQUFDLE1BQU0sT0FBQyxDQUFmLE9BQU8sRUFBWSxPQUFPLENBQUMsQ0FBQztLQUM3QjtHQUNGO0NBQ0YsQ0FBQzs7cUJBRWEsTUFBTSIsImZpbGUiOiJsb2dnZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBpbmRleE9mIH0gZnJvbSAnLi91dGlscyc7XG5cbmxldCBsb2dnZXIgPSB7XG4gIG1ldGhvZE1hcDogWydkZWJ1ZycsICdpbmZvJywgJ3dhcm4nLCAnZXJyb3InXSxcbiAgbGV2ZWw6ICdpbmZvJyxcblxuICAvLyBNYXBzIGEgZ2l2ZW4gbGV2ZWwgdmFsdWUgdG8gdGhlIGBtZXRob2RNYXBgIGluZGV4ZXMgYWJvdmUuXG4gIGxvb2t1cExldmVsOiBmdW5jdGlvbihsZXZlbCkge1xuICAgIGlmICh0eXBlb2YgbGV2ZWwgPT09ICdzdHJpbmcnKSB7XG4gICAgICBsZXQgbGV2ZWxNYXAgPSBpbmRleE9mKGxvZ2dlci5tZXRob2RNYXAsIGxldmVsLnRvTG93ZXJDYXNlKCkpO1xuICAgICAgaWYgKGxldmVsTWFwID49IDApIHtcbiAgICAgICAgbGV2ZWwgPSBsZXZlbE1hcDtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGxldmVsID0gcGFyc2VJbnQobGV2ZWwsIDEwKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gbGV2ZWw7XG4gIH0sXG5cbiAgLy8gQ2FuIGJlIG92ZXJyaWRkZW4gaW4gdGhlIGhvc3QgZW52aXJvbm1lbnRcbiAgbG9nOiBmdW5jdGlvbihsZXZlbCwgLi4ubWVzc2FnZSkge1xuICAgIGxldmVsID0gbG9nZ2VyLmxvb2t1cExldmVsKGxldmVsKTtcblxuICAgIGlmIChcbiAgICAgIHR5cGVvZiBjb25zb2xlICE9PSAndW5kZWZpbmVkJyAmJlxuICAgICAgbG9nZ2VyLmxvb2t1cExldmVsKGxvZ2dlci5sZXZlbCkgPD0gbGV2ZWxcbiAgICApIHtcbiAgICAgIGxldCBtZXRob2QgPSBsb2dnZXIubWV0aG9kTWFwW2xldmVsXTtcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1jb25zb2xlXG4gICAgICBpZiAoIWNvbnNvbGVbbWV0aG9kXSkge1xuICAgICAgICBtZXRob2QgPSAnbG9nJztcbiAgICAgIH1cbiAgICAgIGNvbnNvbGVbbWV0aG9kXSguLi5tZXNzYWdlKTsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby1jb25zb2xlXG4gICAgfVxuICB9XG59O1xuXG5leHBvcnQgZGVmYXVsdCBsb2dnZXI7XG4iXX0=
  2010. /***/ }),
  2011. /***/ "./node_modules/handlebars/dist/cjs/handlebars/no-conflict.js":
  2012. /*!********************************************************************!*\
  2013. !*** ./node_modules/handlebars/dist/cjs/handlebars/no-conflict.js ***!
  2014. \********************************************************************/
  2015. /*! no static exports found */
  2016. /***/ (function(module, exports, __webpack_require__) {
  2017. "use strict";
  2018. /* WEBPACK VAR INJECTION */(function(global) {
  2019. exports.__esModule = true;
  2020. exports['default'] = function (Handlebars) {
  2021. /* istanbul ignore next */
  2022. var root = typeof global !== 'undefined' ? global : window,
  2023. $Handlebars = root.Handlebars;
  2024. /* istanbul ignore next */
  2025. Handlebars.noConflict = function () {
  2026. if (root.Handlebars === Handlebars) {
  2027. root.Handlebars = $Handlebars;
  2028. }
  2029. return Handlebars;
  2030. };
  2031. };
  2032. module.exports = exports['default'];
  2033. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL25vLWNvbmZsaWN0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7cUJBQWUsVUFBUyxVQUFVLEVBQUU7O0FBRWxDLE1BQUksSUFBSSxHQUFHLE9BQU8sTUFBTSxLQUFLLFdBQVcsR0FBRyxNQUFNLEdBQUcsTUFBTTtNQUN4RCxXQUFXLEdBQUcsSUFBSSxDQUFDLFVBQVUsQ0FBQzs7QUFFaEMsWUFBVSxDQUFDLFVBQVUsR0FBRyxZQUFXO0FBQ2pDLFFBQUksSUFBSSxDQUFDLFVBQVUsS0FBSyxVQUFVLEVBQUU7QUFDbEMsVUFBSSxDQUFDLFVBQVUsR0FBRyxXQUFXLENBQUM7S0FDL0I7QUFDRCxXQUFPLFVBQVUsQ0FBQztHQUNuQixDQUFDO0NBQ0giLCJmaWxlIjoibm8tY29uZmxpY3QuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbihIYW5kbGViYXJzKSB7XG4gIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gIGxldCByb290ID0gdHlwZW9mIGdsb2JhbCAhPT0gJ3VuZGVmaW5lZCcgPyBnbG9iYWwgOiB3aW5kb3csXG4gICAgJEhhbmRsZWJhcnMgPSByb290LkhhbmRsZWJhcnM7XG4gIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gIEhhbmRsZWJhcnMubm9Db25mbGljdCA9IGZ1bmN0aW9uKCkge1xuICAgIGlmIChyb290LkhhbmRsZWJhcnMgPT09IEhhbmRsZWJhcnMpIHtcbiAgICAgIHJvb3QuSGFuZGxlYmFycyA9ICRIYW5kbGViYXJzO1xuICAgIH1cbiAgICByZXR1cm4gSGFuZGxlYmFycztcbiAgfTtcbn1cbiJdfQ==
  2034. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  2035. /***/ }),
  2036. /***/ "./node_modules/handlebars/dist/cjs/handlebars/runtime.js":
  2037. /*!****************************************************************!*\
  2038. !*** ./node_modules/handlebars/dist/cjs/handlebars/runtime.js ***!
  2039. \****************************************************************/
  2040. /*! no static exports found */
  2041. /***/ (function(module, exports, __webpack_require__) {
  2042. "use strict";
  2043. exports.__esModule = true;
  2044. exports.checkRevision = checkRevision;
  2045. exports.template = template;
  2046. exports.wrapProgram = wrapProgram;
  2047. exports.resolvePartial = resolvePartial;
  2048. exports.invokePartial = invokePartial;
  2049. exports.noop = noop;
  2050. // istanbul ignore next
  2051. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
  2052. // istanbul ignore next
  2053. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }
  2054. var _utils = __webpack_require__(/*! ./utils */ "./node_modules/handlebars/dist/cjs/handlebars/utils.js");
  2055. var Utils = _interopRequireWildcard(_utils);
  2056. var _exception = __webpack_require__(/*! ./exception */ "./node_modules/handlebars/dist/cjs/handlebars/exception.js");
  2057. var _exception2 = _interopRequireDefault(_exception);
  2058. var _base = __webpack_require__(/*! ./base */ "./node_modules/handlebars/dist/cjs/handlebars/base.js");
  2059. var _helpers = __webpack_require__(/*! ./helpers */ "./node_modules/handlebars/dist/cjs/handlebars/helpers.js");
  2060. var _internalWrapHelper = __webpack_require__(/*! ./internal/wrapHelper */ "./node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js");
  2061. var _internalProtoAccess = __webpack_require__(/*! ./internal/proto-access */ "./node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js");
  2062. function checkRevision(compilerInfo) {
  2063. var compilerRevision = compilerInfo && compilerInfo[0] || 1,
  2064. currentRevision = _base.COMPILER_REVISION;
  2065. if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) {
  2066. return;
  2067. }
  2068. if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) {
  2069. var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
  2070. compilerVersions = _base.REVISION_CHANGES[compilerRevision];
  2071. throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');
  2072. } else {
  2073. // Use the embedded version info since the runtime doesn't know about this revision yet
  2074. throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');
  2075. }
  2076. }
  2077. function template(templateSpec, env) {
  2078. /* istanbul ignore next */
  2079. if (!env) {
  2080. throw new _exception2['default']('No environment passed to template');
  2081. }
  2082. if (!templateSpec || !templateSpec.main) {
  2083. throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
  2084. }
  2085. templateSpec.main.decorator = templateSpec.main_d;
  2086. // Note: Using env.VM references rather than local var references throughout this section to allow
  2087. // for external users to override these as pseudo-supported APIs.
  2088. env.VM.checkRevision(templateSpec.compiler);
  2089. // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0)
  2090. var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7;
  2091. function invokePartialWrapper(partial, context, options) {
  2092. if (options.hash) {
  2093. context = Utils.extend({}, context, options.hash);
  2094. if (options.ids) {
  2095. options.ids[0] = true;
  2096. }
  2097. }
  2098. partial = env.VM.resolvePartial.call(this, partial, context, options);
  2099. var extendedOptions = Utils.extend({}, options, {
  2100. hooks: this.hooks,
  2101. protoAccessControl: this.protoAccessControl
  2102. });
  2103. var result = env.VM.invokePartial.call(this, partial, context, extendedOptions);
  2104. if (result == null && env.compile) {
  2105. options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
  2106. result = options.partials[options.name](context, extendedOptions);
  2107. }
  2108. if (result != null) {
  2109. if (options.indent) {
  2110. var lines = result.split('\n');
  2111. for (var i = 0, l = lines.length; i < l; i++) {
  2112. if (!lines[i] && i + 1 === l) {
  2113. break;
  2114. }
  2115. lines[i] = options.indent + lines[i];
  2116. }
  2117. result = lines.join('\n');
  2118. }
  2119. return result;
  2120. } else {
  2121. throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
  2122. }
  2123. }
  2124. // Just add water
  2125. var container = {
  2126. strict: function strict(obj, name, loc) {
  2127. if (!obj || !(name in obj)) {
  2128. throw new _exception2['default']('"' + name + '" not defined in ' + obj, {
  2129. loc: loc
  2130. });
  2131. }
  2132. return container.lookupProperty(obj, name);
  2133. },
  2134. lookupProperty: function lookupProperty(parent, propertyName) {
  2135. var result = parent[propertyName];
  2136. if (result == null) {
  2137. return result;
  2138. }
  2139. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  2140. return result;
  2141. }
  2142. if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
  2143. return result;
  2144. }
  2145. return undefined;
  2146. },
  2147. lookup: function lookup(depths, name) {
  2148. var len = depths.length;
  2149. for (var i = 0; i < len; i++) {
  2150. var result = depths[i] && container.lookupProperty(depths[i], name);
  2151. if (result != null) {
  2152. return depths[i][name];
  2153. }
  2154. }
  2155. },
  2156. lambda: function lambda(current, context) {
  2157. return typeof current === 'function' ? current.call(context) : current;
  2158. },
  2159. escapeExpression: Utils.escapeExpression,
  2160. invokePartial: invokePartialWrapper,
  2161. fn: function fn(i) {
  2162. var ret = templateSpec[i];
  2163. ret.decorator = templateSpec[i + '_d'];
  2164. return ret;
  2165. },
  2166. programs: [],
  2167. program: function program(i, data, declaredBlockParams, blockParams, depths) {
  2168. var programWrapper = this.programs[i],
  2169. fn = this.fn(i);
  2170. if (data || depths || blockParams || declaredBlockParams) {
  2171. programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
  2172. } else if (!programWrapper) {
  2173. programWrapper = this.programs[i] = wrapProgram(this, i, fn);
  2174. }
  2175. return programWrapper;
  2176. },
  2177. data: function data(value, depth) {
  2178. while (value && depth--) {
  2179. value = value._parent;
  2180. }
  2181. return value;
  2182. },
  2183. mergeIfNeeded: function mergeIfNeeded(param, common) {
  2184. var obj = param || common;
  2185. if (param && common && param !== common) {
  2186. obj = Utils.extend({}, common, param);
  2187. }
  2188. return obj;
  2189. },
  2190. // An empty object to use as replacement for null-contexts
  2191. nullContext: Object.seal({}),
  2192. noop: env.VM.noop,
  2193. compilerInfo: templateSpec.compiler
  2194. };
  2195. function ret(context) {
  2196. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  2197. var data = options.data;
  2198. ret._setup(options);
  2199. if (!options.partial && templateSpec.useData) {
  2200. data = initData(context, data);
  2201. }
  2202. var depths = undefined,
  2203. blockParams = templateSpec.useBlockParams ? [] : undefined;
  2204. if (templateSpec.useDepths) {
  2205. if (options.depths) {
  2206. depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
  2207. } else {
  2208. depths = [context];
  2209. }
  2210. }
  2211. function main(context /*, options*/) {
  2212. return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
  2213. }
  2214. main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
  2215. return main(context, options);
  2216. }
  2217. ret.isTop = true;
  2218. ret._setup = function (options) {
  2219. if (!options.partial) {
  2220. var mergedHelpers = Utils.extend({}, env.helpers, options.helpers);
  2221. wrapHelpersToPassLookupProperty(mergedHelpers, container);
  2222. container.helpers = mergedHelpers;
  2223. if (templateSpec.usePartial) {
  2224. // Use mergeIfNeeded here to prevent compiling global partials multiple times
  2225. container.partials = container.mergeIfNeeded(options.partials, env.partials);
  2226. }
  2227. if (templateSpec.usePartial || templateSpec.useDecorators) {
  2228. container.decorators = Utils.extend({}, env.decorators, options.decorators);
  2229. }
  2230. container.hooks = {};
  2231. container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
  2232. var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
  2233. _helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
  2234. _helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
  2235. } else {
  2236. container.protoAccessControl = options.protoAccessControl; // internal option
  2237. container.helpers = options.helpers;
  2238. container.partials = options.partials;
  2239. container.decorators = options.decorators;
  2240. container.hooks = options.hooks;
  2241. }
  2242. };
  2243. ret._child = function (i, data, blockParams, depths) {
  2244. if (templateSpec.useBlockParams && !blockParams) {
  2245. throw new _exception2['default']('must pass block params');
  2246. }
  2247. if (templateSpec.useDepths && !depths) {
  2248. throw new _exception2['default']('must pass parent depths');
  2249. }
  2250. return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
  2251. };
  2252. return ret;
  2253. }
  2254. function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
  2255. function prog(context) {
  2256. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  2257. var currentDepths = depths;
  2258. if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) {
  2259. currentDepths = [context].concat(depths);
  2260. }
  2261. return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
  2262. }
  2263. prog = executeDecorators(fn, prog, container, depths, data, blockParams);
  2264. prog.program = i;
  2265. prog.depth = depths ? depths.length : 0;
  2266. prog.blockParams = declaredBlockParams || 0;
  2267. return prog;
  2268. }
  2269. /**
  2270. * This is currently part of the official API, therefore implementation details should not be changed.
  2271. */
  2272. function resolvePartial(partial, context, options) {
  2273. if (!partial) {
  2274. if (options.name === '@partial-block') {
  2275. partial = options.data['partial-block'];
  2276. } else {
  2277. partial = options.partials[options.name];
  2278. }
  2279. } else if (!partial.call && !options.name) {
  2280. // This is a dynamic partial that returned a string
  2281. options.name = partial;
  2282. partial = options.partials[partial];
  2283. }
  2284. return partial;
  2285. }
  2286. function invokePartial(partial, context, options) {
  2287. // Use the current closure context to save the partial-block if this partial
  2288. var currentPartialBlock = options.data && options.data['partial-block'];
  2289. options.partial = true;
  2290. if (options.ids) {
  2291. options.data.contextPath = options.ids[0] || options.data.contextPath;
  2292. }
  2293. var partialBlock = undefined;
  2294. if (options.fn && options.fn !== noop) {
  2295. (function () {
  2296. options.data = _base.createFrame(options.data);
  2297. // Wrapper function to get access to currentPartialBlock from the closure
  2298. var fn = options.fn;
  2299. partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {
  2300. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  2301. // Restore the partial-block from the closure for the execution of the block
  2302. // i.e. the part inside the block of the partial call.
  2303. options.data = _base.createFrame(options.data);
  2304. options.data['partial-block'] = currentPartialBlock;
  2305. return fn(context, options);
  2306. };
  2307. if (fn.partials) {
  2308. options.partials = Utils.extend({}, options.partials, fn.partials);
  2309. }
  2310. })();
  2311. }
  2312. if (partial === undefined && partialBlock) {
  2313. partial = partialBlock;
  2314. }
  2315. if (partial === undefined) {
  2316. throw new _exception2['default']('The partial ' + options.name + ' could not be found');
  2317. } else if (partial instanceof Function) {
  2318. return partial(context, options);
  2319. }
  2320. }
  2321. function noop() {
  2322. return '';
  2323. }
  2324. function initData(context, data) {
  2325. if (!data || !('root' in data)) {
  2326. data = data ? _base.createFrame(data) : {};
  2327. data.root = context;
  2328. }
  2329. return data;
  2330. }
  2331. function executeDecorators(fn, prog, container, depths, data, blockParams) {
  2332. if (fn.decorator) {
  2333. var props = {};
  2334. prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
  2335. Utils.extend(prog, props);
  2336. }
  2337. return prog;
  2338. }
  2339. function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
  2340. Object.keys(mergedHelpers).forEach(function (helperName) {
  2341. var helper = mergedHelpers[helperName];
  2342. mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
  2343. });
  2344. }
  2345. function passLookupPropertyOption(helper, container) {
  2346. var lookupProperty = container.lookupProperty;
  2347. return _internalWrapHelper.wrapHelper(helper, function (options) {
  2348. return Utils.extend({ lookupProperty: lookupProperty }, options);
  2349. });
  2350. }
  2351. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL3J1bnRpbWUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7cUJBQXVCLFNBQVM7O0lBQXBCLEtBQUs7O3lCQUNLLGFBQWE7Ozs7b0JBTTVCLFFBQVE7O3VCQUNtQixXQUFXOztrQ0FDbEIsdUJBQXVCOzttQ0FJM0MseUJBQXlCOztBQUV6QixTQUFTLGFBQWEsQ0FBQyxZQUFZLEVBQUU7QUFDMUMsTUFBTSxnQkFBZ0IsR0FBRyxBQUFDLFlBQVksSUFBSSxZQUFZLENBQUMsQ0FBQyxDQUFDLElBQUssQ0FBQztNQUM3RCxlQUFlLDBCQUFvQixDQUFDOztBQUV0QyxNQUNFLGdCQUFnQiwyQ0FBcUMsSUFDckQsZ0JBQWdCLDJCQUFxQixFQUNyQztBQUNBLFdBQU87R0FDUjs7QUFFRCxNQUFJLGdCQUFnQiwwQ0FBb0MsRUFBRTtBQUN4RCxRQUFNLGVBQWUsR0FBRyx1QkFBaUIsZUFBZSxDQUFDO1FBQ3ZELGdCQUFnQixHQUFHLHVCQUFpQixnQkFBZ0IsQ0FBQyxDQUFDO0FBQ3hELFVBQU0sMkJBQ0oseUZBQXlGLEdBQ3ZGLHFEQUFxRCxHQUNyRCxlQUFlLEdBQ2YsbURBQW1ELEdBQ25ELGdCQUFnQixHQUNoQixJQUFJLENBQ1AsQ0FBQztHQUNILE1BQU07O0FBRUwsVUFBTSwyQkFDSix3RkFBd0YsR0FDdEYsaURBQWlELEdBQ2pELFlBQVksQ0FBQyxDQUFDLENBQUMsR0FDZixJQUFJLENBQ1AsQ0FBQztHQUNIO0NBQ0Y7O0FBRU0sU0FBUyxRQUFRLENBQUMsWUFBWSxFQUFFLEdBQUcsRUFBRTs7QUFFMUMsTUFBSSxDQUFDLEdBQUcsRUFBRTtBQUNSLFVBQU0sMkJBQWMsbUNBQW1DLENBQUMsQ0FBQztHQUMxRDtBQUNELE1BQUksQ0FBQyxZQUFZLElBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxFQUFFO0FBQ3ZDLFVBQU0sMkJBQWMsMkJBQTJCLEdBQUcsT0FBTyxZQUFZLENBQUMsQ0FBQztHQUN4RTs7QUFFRCxjQUFZLENBQUMsSUFBSSxDQUFDLFNBQVMsR0FBRyxZQUFZLENBQUMsTUFBTSxDQUFDOzs7O0FBSWxELEtBQUcsQ0FBQyxFQUFFLENBQUMsYUFBYSxDQUFDLFlBQVksQ0FBQyxRQUFRLENBQUMsQ0FBQzs7O0FBRzVDLE1BQU0sb0NBQW9DLEdBQ3hDLFlBQVksQ0FBQyxRQUFRLElBQUksWUFBWSxDQUFDLFFBQVEsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUM7O0FBRTFELFdBQVMsb0JBQW9CLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxPQUFPLEVBQUU7QUFDdkQsUUFBSSxPQUFPLENBQUMsSUFBSSxFQUFFO0FBQ2hCLGFBQU8sR0FBRyxLQUFLLENBQUMsTUFBTSxDQUFDLEVBQUUsRUFBRSxPQUFPLEVBQUUsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ2xELFVBQUksT0FBTyxDQUFDLEdBQUcsRUFBRTtBQUNmLGVBQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLEdBQUcsSUFBSSxDQUFDO09BQ3ZCO0tBQ0Y7QUFDRCxXQUFPLEdBQUcsR0FBRyxDQUFDLEVBQUUsQ0FBQyxjQUFjLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRSxPQUFPLEVBQUUsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDOztBQUV0RSxRQUFJLGVBQWUsR0FBRyxLQUFLLENBQUMsTUFBTSxDQUFDLEVBQUUsRUFBRSxPQUFPLEVBQUU7QUFDOUMsV0FBSyxFQUFFLElBQUksQ0FBQyxLQUFLO0FBQ2pCLHdCQUFrQixFQUFFLElBQUksQ0FBQyxrQkFBa0I7S0FDNUMsQ0FBQyxDQUFDOztBQUVILFFBQUksTUFBTSxHQUFHLEdBQUcsQ0FBQyxFQUFFLENBQUMsYUFBYSxDQUFDLElBQUksQ0FDcEMsSUFBSSxFQUNKLE9BQU8sRUFDUCxPQUFPLEVBQ1AsZUFBZSxDQUNoQixDQUFDOztBQUVGLFFBQUksTUFBTSxJQUFJLElBQUksSUFBSSxHQUFHLENBQUMsT0FBTyxFQUFFO0FBQ2pDLGFBQU8sQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQzFDLE9BQU8sRUFDUCxZQUFZLENBQUMsZUFBZSxFQUM1QixHQUFHLENBQ0osQ0FBQztBQUNGLFlBQU0sR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxPQUFPLEVBQUUsZUFBZSxDQUFDLENBQUM7S0FDbkU7QUFDRCxRQUFJLE1BQU0sSUFBSSxJQUFJLEVBQUU7QUFDbEIsVUFBSSxPQUFPLENBQUMsTUFBTSxFQUFFO0FBQ2xCLFlBQUksS0FBSyxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDL0IsYUFBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtBQUM1QyxjQUFJLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxFQUFFO0FBQzVCLGtCQUFNO1dBQ1A7O0FBRUQsZUFBSyxDQUFDLENBQUMsQ0FBQyxHQUFHLE9BQU8sQ0FBQyxNQUFNLEdBQUcsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDO1NBQ3RDO0FBQ0QsY0FBTSxHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7T0FDM0I7QUFDRCxhQUFPLE1BQU0sQ0FBQztLQUNmLE1BQU07QUFDTCxZQUFNLDJCQUNKLGNBQWMsR0FDWixPQUFPLENBQUMsSUFBSSxHQUNaLDBEQUEwRCxDQUM3RCxDQUFDO0tBQ0g7R0FDRjs7O0FBR0QsTUFBSSxTQUFTLEdBQUc7QUFDZCxVQUFNLEVBQUUsZ0JBQVMsR0FBRyxFQUFFLElBQUksRUFBRSxHQUFHLEVBQUU7QUFDL0IsVUFBSSxDQUFDLEdBQUcsSUFBSSxFQUFFLElBQUksSUFBSSxHQUFHLENBQUEsQUFBQyxFQUFFO0FBQzFCLGNBQU0sMkJBQWMsR0FBRyxHQUFHLElBQUksR0FBRyxtQkFBbUIsR0FBRyxHQUFHLEVBQUU7QUFDMUQsYUFBRyxFQUFFLEdBQUc7U0FDVCxDQUFDLENBQUM7T0FDSjtBQUNELGFBQU8sU0FBUyxDQUFDLGNBQWMsQ0FBQyxHQUFHLEVBQUUsSUFBSSxDQUFDLENBQUM7S0FDNUM7QUFDRCxrQkFBYyxFQUFFLHdCQUFTLE1BQU0sRUFBRSxZQUFZLEVBQUU7QUFDN0MsVUFBSSxNQUFNLEdBQUcsTUFBTSxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQ2xDLFVBQUksTUFBTSxJQUFJLElBQUksRUFBRTtBQUNsQixlQUFPLE1BQU0sQ0FBQztPQUNmO0FBQ0QsVUFBSSxNQUFNLENBQUMsU0FBUyxDQUFDLGNBQWMsQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLFlBQVksQ0FBQyxFQUFFO0FBQzlELGVBQU8sTUFBTSxDQUFDO09BQ2Y7O0FBRUQsVUFBSSxxQ0FBZ0IsTUFBTSxFQUFFLFNBQVMsQ0FBQyxrQkFBa0IsRUFBRSxZQUFZLENBQUMsRUFBRTtBQUN2RSxlQUFPLE1BQU0sQ0FBQztPQUNmO0FBQ0QsYUFBTyxTQUFTLENBQUM7S0FDbEI7QUFDRCxVQUFNLEVBQUUsZ0JBQVMsTUFBTSxFQUFFLElBQUksRUFBRTtBQUM3QixVQUFNLEdBQUcsR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDO0FBQzFCLFdBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxHQUFHLEVBQUUsQ0FBQyxFQUFFLEVBQUU7QUFDNUIsWUFBSSxNQUFNLEdBQUcsTUFBTSxDQUFDLENBQUMsQ0FBQyxJQUFJLFNBQVMsQ0FBQyxjQUFjLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQyxDQUFDO0FBQ3BFLFlBQUksTUFBTSxJQUFJLElBQUksRUFBRTtBQUNsQixpQkFBTyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUM7U0FDeEI7T0FDRjtLQUNGO0FBQ0QsVUFBTSxFQUFFLGdCQUFTLE9BQU8sRUFBRSxPQUFPLEVBQUU7QUFDakMsYUFBTyxPQUFPLE9BQU8sS0FBSyxVQUFVLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsR0FBRyxPQUFPLENBQUM7S0FDeEU7O0FBRUQsb0JBQWdCLEVBQUUsS0FBSyxDQUFDLGdCQUFnQjtBQUN4QyxpQkFBYSxFQUFFLG9CQUFvQjs7QUFFbkMsTUFBRSxFQUFFLFlBQVMsQ0FBQyxFQUFFO0FBQ2QsVUFBSSxHQUFHLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzFCLFNBQUcsQ0FBQyxTQUFTLEdBQUcsWUFBWSxDQUFDLENBQUMsR0FBRyxJQUFJLENBQUMsQ0FBQztBQUN2QyxhQUFPLEdBQUcsQ0FBQztLQUNaOztBQUVELFlBQVEsRUFBRSxFQUFFO0FBQ1osV0FBTyxFQUFFLGlCQUFTLENBQUMsRUFBRSxJQUFJLEVBQUUsbUJBQW1CLEVBQUUsV0FBVyxFQUFFLE1BQU0sRUFBRTtBQUNuRSxVQUFJLGNBQWMsR0FBRyxJQUFJLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQztVQUNuQyxFQUFFLEdBQUcsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQixVQUFJLElBQUksSUFBSSxNQUFNLElBQUksV0FBVyxJQUFJLG1CQUFtQixFQUFFO0FBQ3hELHNCQUFjLEdBQUcsV0FBVyxDQUMxQixJQUFJLEVBQ0osQ0FBQyxFQUNELEVBQUUsRUFDRixJQUFJLEVBQ0osbUJBQW1CLEVBQ25CLFdBQVcsRUFDWCxNQUFNLENBQ1AsQ0FBQztPQUNILE1BQU0sSUFBSSxDQUFDLGNBQWMsRUFBRTtBQUMxQixzQkFBYyxHQUFHLElBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQyxDQUFDLEdBQUcsV0FBVyxDQUFDLElBQUksRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUM7T0FDOUQ7QUFDRCxhQUFPLGNBQWMsQ0FBQztLQUN2Qjs7QUFFRCxRQUFJLEVBQUUsY0FBUyxLQUFLLEVBQUUsS0FBSyxFQUFFO0FBQzNCLGFBQU8sS0FBSyxJQUFJLEtBQUssRUFBRSxFQUFFO0FBQ3ZCLGFBQUssR0FBRyxLQUFLLENBQUMsT0FBTyxDQUFDO09BQ3ZCO0FBQ0QsYUFBTyxLQUFLLENBQUM7S0FDZDtBQUNELGlCQUFhLEVBQUUsdUJBQVMsS0FBSyxFQUFFLE1BQU0sRUFBRTtBQUNyQyxVQUFJLEdBQUcsR0FBRyxLQUFLLElBQUksTUFBTSxDQUFDOztBQUUxQixVQUFJLEtBQUssSUFBSSxNQUFNLElBQUksS0FBSyxLQUFLLE1BQU0sRUFBRTtBQUN2QyxXQUFHLEdBQUcsS0FBSyxDQUFDLE1BQU0sQ0FBQyxFQUFFLEVBQUUsTUFBTSxFQUFFLEtBQUssQ0FBQyxDQUFDO09BQ3ZDOztBQUVELGFBQU8sR0FBRyxDQUFDO0tBQ1o7O0FBRUQsZUFBVyxFQUFFLE1BQU0sQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDOztBQUU1QixRQUFJLEVBQUUsR0FBRyxDQUFDLEVBQUUsQ0FBQyxJQUFJO0FBQ2pCLGdCQUFZLEVBQUUsWUFBWSxDQUFDLFFBQVE7R0FDcEMsQ0FBQzs7QUFFRixXQUFTLEdBQUcsQ0FBQyxPQUFPLEVBQWdCO1FBQWQsT0FBTyx5REFBRyxFQUFFOztBQUNoQyxRQUFJLElBQUksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDOztBQUV4QixPQUFHLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBQ3BCLFFBQUksQ0FBQyxPQUFPLENBQUMsT0FBTyxJQUFJLFlBQVksQ0FBQyxPQUFPLEVBQUU7QUFDNUMsVUFBSSxHQUFHLFFBQVEsQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLENBQUM7S0FDaEM7QUFDRCxRQUFJLE1BQU0sWUFBQTtRQUNSLFdBQVcsR0FBRyxZQUFZLENBQUMsY0FBYyxHQUFHLEVBQUUsR0FBRyxTQUFTLENBQUM7QUFDN0QsUUFBSSxZQUFZLENBQUMsU0FBUyxFQUFFO0FBQzFCLFVBQUksT0FBTyxDQUFDLE1BQU0sRUFBRTtBQUNsQixjQUFNLEdBQ0osT0FBTyxJQUFJLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDLEdBQ3hCLENBQUMsT0FBTyxDQUFDLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsR0FDaEMsT0FBTyxDQUFDLE1BQU0sQ0FBQztPQUN0QixNQUFNO0FBQ0wsY0FBTSxHQUFHLENBQUMsT0FBTyxDQUFDLENBQUM7T0FDcEI7S0FDRjs7QUFFRCxhQUFTLElBQUksQ0FBQyxPQUFPLGdCQUFnQjtBQUNuQyxhQUNFLEVBQUUsR0FDRixZQUFZLENBQUMsSUFBSSxDQUNmLFNBQVMsRUFDVCxPQUFPLEVBQ1AsU0FBUyxDQUFDLE9BQU8sRUFDakIsU0FBUyxDQUFDLFFBQVEsRUFDbEIsSUFBSSxFQUNKLFdBQVcsRUFDWCxNQUFNLENBQ1AsQ0FDRDtLQUNIOztBQUVELFFBQUksR0FBRyxpQkFBaUIsQ0FDdEIsWUFBWSxDQUFDLElBQUksRUFDakIsSUFBSSxFQUNKLFNBQVMsRUFDVCxPQUFPLENBQUMsTUFBTSxJQUFJLEVBQUUsRUFDcEIsSUFBSSxFQUNKLFdBQVcsQ0FDWixDQUFDO0FBQ0YsV0FBTyxJQUFJLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0dBQy9COztBQUVELEtBQUcsQ0FBQyxLQUFLLEdBQUcsSUFBSSxDQUFDOztBQUVqQixLQUFHLENBQUMsTUFBTSxHQUFHLFVBQVMsT0FBTyxFQUFFO0FBQzdCLFFBQUksQ0FBQyxPQUFPLENBQUMsT0FBTyxFQUFFO0FBQ3BCLFVBQUksYUFBYSxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUMsRUFBRSxFQUFFLEdBQUcsQ0FBQyxPQUFPLEVBQUUsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBQ25FLHFDQUErQixDQUFDLGFBQWEsRUFBRSxTQUFTLENBQUMsQ0FBQztBQUMxRCxlQUFTLENBQUMsT0FBTyxHQUFHLGFBQWEsQ0FBQzs7QUFFbEMsVUFBSSxZQUFZLENBQUMsVUFBVSxFQUFFOztBQUUzQixpQkFBUyxDQUFDLFFBQVEsR0FBRyxTQUFTLENBQUMsYUFBYSxDQUMxQyxPQUFPLENBQUMsUUFBUSxFQUNoQixHQUFHLENBQUMsUUFBUSxDQUNiLENBQUM7T0FDSDtBQUNELFVBQUksWUFBWSxDQUFDLFVBQVUsSUFBSSxZQUFZLENBQUMsYUFBYSxFQUFFO0FBQ3pELGlCQUFTLENBQUMsVUFBVSxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQ2pDLEVBQUUsRUFDRixHQUFHLENBQUMsVUFBVSxFQUNkLE9BQU8sQ0FBQyxVQUFVLENBQ25CLENBQUM7T0FDSDs7QUFFRCxlQUFTLENBQUMsS0FBSyxHQUFHLEVBQUUsQ0FBQztBQUNyQixlQUFTLENBQUMsa0JBQWtCLEdBQUcsOENBQXlCLE9BQU8sQ0FBQyxDQUFDOztBQUVqRSxVQUFJLG1CQUFtQixHQUNyQixPQUFPLENBQUMseUJBQXlCLElBQ2pDLG9DQUFvQyxDQUFDO0FBQ3ZDLGlDQUFrQixTQUFTLEVBQUUsZUFBZSxFQUFFLG1CQUFtQixDQUFDLENBQUM7QUFDbkUsaUNBQWtCLFNBQVMsRUFBRSxvQkFBb0IsRUFBRSxtQkFBbUIsQ0FBQyxDQUFDO0tBQ3pFLE1BQU07QUFDTCxlQUFTLENBQUMsa0JBQWtCLEdBQUcsT0FBTyxDQUFDLGtCQUFrQixDQUFDO0FBQzFELGVBQVMsQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQztBQUNwQyxlQUFTLENBQUMsUUFBUSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUM7QUFDdEMsZUFBUyxDQUFDLFVBQVUsR0FBRyxPQUFPLENBQUMsVUFBVSxDQUFDO0FBQzFDLGVBQVMsQ0FBQyxLQUFLLEdBQUcsT0FBTyxDQUFDLEtBQUssQ0FBQztLQUNqQztHQUNGLENBQUM7O0FBRUYsS0FBRyxDQUFDLE1BQU0sR0FBRyxVQUFTLENBQUMsRUFBRSxJQUFJLEVBQUUsV0FBVyxFQUFFLE1BQU0sRUFBRTtBQUNsRCxRQUFJLFlBQVksQ0FBQyxjQUFjLElBQUksQ0FBQyxXQUFXLEVBQUU7QUFDL0MsWUFBTSwyQkFBYyx3QkFBd0IsQ0FBQyxDQUFDO0tBQy9DO0FBQ0QsUUFBSSxZQUFZLENBQUMsU0FBUyxJQUFJLENBQUMsTUFBTSxFQUFFO0FBQ3JDLFlBQU0sMkJBQWMseUJBQXlCLENBQUMsQ0FBQztLQUNoRDs7QUFFRCxXQUFPLFdBQVcsQ0FDaEIsU0FBUyxFQUNULENBQUMsRUFDRCxZQUFZLENBQUMsQ0FBQyxDQUFDLEVBQ2YsSUFBSSxFQUNKLENBQUMsRUFDRCxXQUFXLEVBQ1gsTUFBTSxDQUNQLENBQUM7R0FDSCxDQUFDO0FBQ0YsU0FBTyxHQUFHLENBQUM7Q0FDWjs7QUFFTSxTQUFTLFdBQVcsQ0FDekIsU0FBUyxFQUNULENBQUMsRUFDRCxFQUFFLEVBQ0YsSUFBSSxFQUNKLG1CQUFtQixFQUNuQixXQUFXLEVBQ1gsTUFBTSxFQUNOO0FBQ0EsV0FBUyxJQUFJLENBQUMsT0FBTyxFQUFnQjtRQUFkLE9BQU8seURBQUcsRUFBRTs7QUFDakMsUUFBSSxhQUFhLEdBQUcsTUFBTSxDQUFDO0FBQzNCLFFBQ0UsTUFBTSxJQUNOLE9BQU8sSUFBSSxNQUFNLENBQUMsQ0FBQyxDQUFDLElBQ3BCLEVBQUUsT0FBTyxLQUFLLFNBQVMsQ0FBQyxXQUFXLElBQUksTUFBTSxDQUFDLENBQUMsQ0FBQyxLQUFLLElBQUksQ0FBQSxBQUFDLEVBQzFEO0FBQ0EsbUJBQWEsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsQ0FBQztLQUMxQzs7QUFFRCxXQUFPLEVBQUUsQ0FDUCxTQUFTLEVBQ1QsT0FBTyxFQUNQLFNBQVMsQ0FBQyxPQUFPLEVBQ2pCLFNBQVMsQ0FBQyxRQUFRLEVBQ2xCLE9BQU8sQ0FBQyxJQUFJLElBQUksSUFBSSxFQUNwQixXQUFXLElBQUksQ0FBQyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxFQUN4RCxhQUFhLENBQ2QsQ0FBQztHQUNIOztBQUVELE1BQUksR0FBRyxpQkFBaUIsQ0FBQyxFQUFFLEVBQUUsSUFBSSxFQUFFLFNBQVMsRUFBRSxNQUFNLEVBQUUsSUFBSSxFQUFFLFdBQVcsQ0FBQyxDQUFDOztBQUV6RSxNQUFJLENBQUMsT0FBTyxHQUFHLENBQUMsQ0FBQztBQUNqQixNQUFJLENBQUMsS0FBSyxHQUFHLE1BQU0sR0FBRyxNQUFNLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQztBQUN4QyxNQUFJLENBQUMsV0FBVyxHQUFHLG1CQUFtQixJQUFJLENBQUMsQ0FBQztBQUM1QyxTQUFPLElBQUksQ0FBQztDQUNiOzs7Ozs7QUFLTSxTQUFTLGNBQWMsQ0FBQyxPQUFPLEVBQUUsT0FBTyxFQUFFLE9BQU8sRUFBRTtBQUN4RCxNQUFJLENBQUMsT0FBTyxFQUFFO0FBQ1osUUFBSSxPQUFPLENBQUMsSUFBSSxLQUFLLGdCQUFnQixFQUFFO0FBQ3JDLGFBQU8sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLGVBQWUsQ0FBQyxDQUFDO0tBQ3pDLE1BQU07QUFDTCxhQUFPLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7S0FDMUM7R0FDRixNQUFNLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksRUFBRTs7QUFFekMsV0FBTyxDQUFDLElBQUksR0FBRyxPQUFPLENBQUM7QUFDdkIsV0FBTyxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFDLENBQUM7R0FDckM7QUFDRCxTQUFPLE9BQU8sQ0FBQztDQUNoQjs7QUFFTSxTQUFTLGFBQWEsQ0FBQyxPQUFPLEVBQUUsT0FBTyxFQUFFLE9BQU8sRUFBRTs7QUFFdkQsTUFBTSxtQkFBbUIsR0FBRyxPQUFPLENBQUMsSUFBSSxJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsZUFBZSxDQUFDLENBQUM7QUFDMUUsU0FBTyxDQUFDLE9BQU8sR0FBRyxJQUFJLENBQUM7QUFDdkIsTUFBSSxPQUFPLENBQUMsR0FBRyxFQUFFO0FBQ2YsV0FBTyxDQUFDLElBQUksQ0FBQyxXQUFXLEdBQUcsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsSUFBSSxPQUFPLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQztHQUN2RTs7QUFFRCxNQUFJLFlBQVksWUFBQSxDQUFDO0FBQ2pCLE1BQUksT0FBTyxDQUFDLEVBQUUsSUFBSSxPQUFPLENBQUMsRUFBRSxLQUFLLElBQUksRUFBRTs7QUFDckMsYUFBTyxDQUFDLElBQUksR0FBRyxrQkFBWSxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUM7O0FBRXpDLFVBQUksRUFBRSxHQUFHLE9BQU8sQ0FBQyxFQUFFLENBQUM7QUFDcEIsa0JBQVksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLGVBQWUsQ0FBQyxHQUFHLFNBQVMsbUJBQW1CLENBQ3pFLE9BQU8sRUFFUDtZQURBLE9BQU8seURBQUcsRUFBRTs7OztBQUlaLGVBQU8sQ0FBQyxJQUFJLEdBQUcsa0JBQVksT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ3pDLGVBQU8sQ0FBQyxJQUFJLENBQUMsZUFBZSxDQUFDLEdBQUcsbUJBQW1CLENBQUM7QUFDcEQsZUFBTyxFQUFFLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO09BQzdCLENBQUM7QUFDRixVQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUU7QUFDZixlQUFPLENBQUMsUUFBUSxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUMsRUFBRSxFQUFFLE9BQU8sQ0FBQyxRQUFRLEVBQUUsRUFBRSxDQUFDLFFBQVEsQ0FBQyxDQUFDO09BQ3BFOztHQUNGOztBQUVELE1BQUksT0FBTyxLQUFLLFNBQVMsSUFBSSxZQUFZLEVBQUU7QUFDekMsV0FBTyxHQUFHLFlBQVksQ0FBQztHQUN4Qjs7QUFFRCxNQUFJLE9BQU8sS0FBSyxTQUFTLEVBQUU7QUFDekIsVUFBTSwyQkFBYyxjQUFjLEdBQUcsT0FBTyxDQUFDLElBQUksR0FBRyxxQkFBcUIsQ0FBQyxDQUFDO0dBQzVFLE1BQU0sSUFBSSxPQUFPLFlBQVksUUFBUSxFQUFFO0FBQ3RDLFdBQU8sT0FBTyxDQUFDLE9BQU8sRUFBRSxPQUFPLENBQUMsQ0FBQztHQUNsQztDQUNGOztBQUVNLFNBQVMsSUFBSSxHQUFHO0FBQ3JCLFNBQU8sRUFBRSxDQUFDO0NBQ1g7O0FBRUQsU0FBUyxRQUFRLENBQUMsT0FBTyxFQUFFLElBQUksRUFBRTtBQUMvQixNQUFJLENBQUMsSUFBSSxJQUFJLEVBQUUsTUFBTSxJQUFJLElBQUksQ0FBQSxBQUFDLEVBQUU7QUFDOUIsUUFBSSxHQUFHLElBQUksR0FBRyxrQkFBWSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUM7QUFDckMsUUFBSSxDQUFDLElBQUksR0FBRyxPQUFPLENBQUM7R0FDckI7QUFDRCxTQUFPLElBQUksQ0FBQztDQUNiOztBQUVELFNBQVMsaUJBQWlCLENBQUMsRUFBRSxFQUFFLElBQUksRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLElBQUksRUFBRSxXQUFXLEVBQUU7QUFDekUsTUFBSSxFQUFFLENBQUMsU0FBUyxFQUFFO0FBQ2hCLFFBQUksS0FBSyxHQUFHLEVBQUUsQ0FBQztBQUNmLFFBQUksR0FBRyxFQUFFLENBQUMsU0FBUyxDQUNqQixJQUFJLEVBQ0osS0FBSyxFQUNMLFNBQVMsRUFDVCxNQUFNLElBQUksTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUNuQixJQUFJLEVBQ0osV0FBVyxFQUNYLE1BQU0sQ0FDUCxDQUFDO0FBQ0YsU0FBSyxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsS0FBSyxDQUFDLENBQUM7R0FDM0I7QUFDRCxTQUFPLElBQUksQ0FBQztDQUNiOztBQUVELFNBQVMsK0JBQStCLENBQUMsYUFBYSxFQUFFLFNBQVMsRUFBRTtBQUNqRSxRQUFNLENBQUMsSUFBSSxDQUFDLGFBQWEsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxVQUFBLFVBQVUsRUFBSTtBQUMvQyxRQUFJLE1BQU0sR0FBRyxhQUFhLENBQUMsVUFBVSxDQUFDLENBQUM7QUFDdkMsaUJBQWEsQ0FBQyxVQUFVLENBQUMsR0FBRyx3QkFBd0IsQ0FBQyxNQUFNLEVBQUUsU0FBUyxDQUFDLENBQUM7R0FDekUsQ0FBQyxDQUFDO0NBQ0o7O0FBRUQsU0FBUyx3QkFBd0IsQ0FBQyxNQUFNLEVBQUUsU0FBUyxFQUFFO0FBQ25ELE1BQU0sY0FBYyxHQUFHLFNBQVMsQ0FBQyxjQUFjLENBQUM7QUFDaEQsU0FBTywrQkFBVyxNQUFNLEVBQUUsVUFBQSxPQUFPLEVBQUk7QUFDbkMsV0FBTyxLQUFLLENBQUMsTUFBTSxDQUFDLEVBQUUsY0FBYyxFQUFkLGNBQWMsRUFBRSxFQUFFLE9BQU8sQ0FBQyxDQUFDO0dBQ2xELENBQUMsQ0FBQztDQUNKIiwiZmlsZSI6InJ1bnRpbWUuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyBVdGlscyBmcm9tICcuL3V0aWxzJztcbmltcG9ydCBFeGNlcHRpb24gZnJvbSAnLi9leGNlcHRpb24nO1xuaW1wb3J0IHtcbiAgQ09NUElMRVJfUkVWSVNJT04sXG4gIGNyZWF0ZUZyYW1lLFxuICBMQVNUX0NPTVBBVElCTEVfQ09NUElMRVJfUkVWSVNJT04sXG4gIFJFVklTSU9OX0NIQU5HRVNcbn0gZnJvbSAnLi9iYXNlJztcbmltcG9ydCB7IG1vdmVIZWxwZXJUb0hvb2tzIH0gZnJvbSAnLi9oZWxwZXJzJztcbmltcG9ydCB7IHdyYXBIZWxwZXIgfSBmcm9tICcuL2ludGVybmFsL3dyYXBIZWxwZXInO1xuaW1wb3J0IHtcbiAgY3JlYXRlUHJvdG9BY2Nlc3NDb250cm9sLFxuICByZXN1bHRJc0FsbG93ZWRcbn0gZnJvbSAnLi9pbnRlcm5hbC9wcm90by1hY2Nlc3MnO1xuXG5leHBvcnQgZnVuY3Rpb24gY2hlY2tSZXZpc2lvbihjb21waWxlckluZm8pIHtcbiAgY29uc3QgY29tcGlsZXJSZXZpc2lvbiA9IChjb21waWxlckluZm8gJiYgY29tcGlsZXJJbmZvWzBdKSB8fCAxLFxuICAgIGN1cnJlbnRSZXZpc2lvbiA9IENPTVBJTEVSX1JFVklTSU9OO1xuXG4gIGlmIChcbiAgICBjb21waWxlclJldmlzaW9uID49IExBU1RfQ09NUEFUSUJMRV9DT01QSUxFUl9SRVZJU0lPTiAmJlxuICAgIGNvbXBpbGVyUmV2aXNpb24gPD0gQ09NUElMRVJfUkVWSVNJT05cbiAgKSB7XG4gICAgcmV0dXJuO1xuICB9XG5cbiAgaWYgKGNvbXBpbGVyUmV2aXNpb24gPCBMQVNUX0NPTVBBVElCTEVfQ09NUElMRVJfUkVWSVNJT04pIHtcbiAgICBjb25zdCBydW50aW1lVmVyc2lvbnMgPSBSRVZJU0lPTl9DSEFOR0VTW2N1cnJlbnRSZXZpc2lvbl0sXG4gICAgICBjb21waWxlclZlcnNpb25zID0gUkVWSVNJT05fQ0hBTkdFU1tjb21waWxlclJldmlzaW9uXTtcbiAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKFxuICAgICAgJ1RlbXBsYXRlIHdhcyBwcmVjb21waWxlZCB3aXRoIGFuIG9sZGVyIHZlcnNpb24gb2YgSGFuZGxlYmFycyB0aGFuIHRoZSBjdXJyZW50IHJ1bnRpbWUuICcgK1xuICAgICAgICAnUGxlYXNlIHVwZGF0ZSB5b3VyIHByZWNvbXBpbGVyIHRvIGEgbmV3ZXIgdmVyc2lvbiAoJyArXG4gICAgICAgIHJ1bnRpbWVWZXJzaW9ucyArXG4gICAgICAgICcpIG9yIGRvd25ncmFkZSB5b3VyIHJ1bnRpbWUgdG8gYW4gb2xkZXIgdmVyc2lvbiAoJyArXG4gICAgICAgIGNvbXBpbGVyVmVyc2lvbnMgK1xuICAgICAgICAnKS4nXG4gICAgKTtcbiAgfSBlbHNlIHtcbiAgICAvLyBVc2UgdGhlIGVtYmVkZGVkIHZlcnNpb24gaW5mbyBzaW5jZSB0aGUgcnVudGltZSBkb2Vzbid0IGtub3cgYWJvdXQgdGhpcyByZXZpc2lvbiB5ZXRcbiAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKFxuICAgICAgJ1RlbXBsYXRlIHdhcyBwcmVjb21waWxlZCB3aXRoIGEgbmV3ZXIgdmVyc2lvbiBvZiBIYW5kbGViYXJzIHRoYW4gdGhlIGN1cnJlbnQgcnVudGltZS4gJyArXG4gICAgICAgICdQbGVhc2UgdXBkYXRlIHlvdXIgcnVudGltZSB0byBhIG5ld2VyIHZlcnNpb24gKCcgK1xuICAgICAgICBjb21waWxlckluZm9bMV0gK1xuICAgICAgICAnKS4nXG4gICAgKTtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gdGVtcGxhdGUodGVtcGxhdGVTcGVjLCBlbnYpIHtcbiAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgaWYgKCFlbnYpIHtcbiAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCdObyBlbnZpcm9ubWVudCBwYXNzZWQgdG8gdGVtcGxhdGUnKTtcbiAgfVxuICBpZiAoIXRlbXBsYXRlU3BlYyB8fCAhdGVtcGxhdGVTcGVjLm1haW4pIHtcbiAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKCdVbmtub3duIHRlbXBsYXRlIG9iamVjdDogJyArIHR5cGVvZiB0ZW1wbGF0ZVNwZWMpO1xuICB9XG5cbiAgdGVtcGxhdGVTcGVjLm1haW4uZGVjb3JhdG9yID0gdGVtcGxhdGVTcGVjLm1haW5fZDtcblxuICAvLyBOb3RlOiBVc2luZyBlbnYuVk0gcmVmZXJlbmNlcyByYXRoZXIgdGhhbiBsb2NhbCB2YXIgcmVmZXJlbmNlcyB0aHJvdWdob3V0IHRoaXMgc2VjdGlvbiB0byBhbGxvd1xuICAvLyBmb3IgZXh0ZXJuYWwgdXNlcnMgdG8gb3ZlcnJpZGUgdGhlc2UgYXMgcHNldWRvLXN1cHBvcnRlZCBBUElzLlxuICBlbnYuVk0uY2hlY2tSZXZpc2lvbih0ZW1wbGF0ZVNwZWMuY29tcGlsZXIpO1xuXG4gIC8vIGJhY2t3YXJkcyBjb21wYXRpYmlsaXR5IGZvciBwcmVjb21waWxlZCB0ZW1wbGF0ZXMgd2l0aCBjb21waWxlci12ZXJzaW9uIDcgKDw0LjMuMClcbiAgY29uc3QgdGVtcGxhdGVXYXNQcmVjb21waWxlZFdpdGhDb21waWxlclY3ID1cbiAgICB0ZW1wbGF0ZVNwZWMuY29tcGlsZXIgJiYgdGVtcGxhdGVTcGVjLmNvbXBpbGVyWzBdID09PSA3O1xuXG4gIGZ1bmN0aW9uIGludm9rZVBhcnRpYWxXcmFwcGVyKHBhcnRpYWwsIGNvbnRleHQsIG9wdGlvbnMpIHtcbiAgICBpZiAob3B0aW9ucy5oYXNoKSB7XG4gICAgICBjb250ZXh0ID0gVXRpbHMuZXh0ZW5kKHt9LCBjb250ZXh0LCBvcHRpb25zLmhhc2gpO1xuICAgICAgaWYgKG9wdGlvbnMuaWRzKSB7XG4gICAgICAgIG9wdGlvbnMuaWRzWzBdID0gdHJ1ZTtcbiAgICAgIH1cbiAgICB9XG4gICAgcGFydGlhbCA9IGVudi5WTS5yZXNvbHZlUGFydGlhbC5jYWxsKHRoaXMsIHBhcnRpYWwsIGNvbnRleHQsIG9wdGlvbnMpO1xuXG4gICAgbGV0IGV4dGVuZGVkT3B0aW9ucyA9IFV0aWxzLmV4dGVuZCh7fSwgb3B0aW9ucywge1xuICAgICAgaG9va3M6IHRoaXMuaG9va3MsXG4gICAgICBwcm90b0FjY2Vzc0NvbnRyb2w6IHRoaXMucHJvdG9BY2Nlc3NDb250cm9sXG4gICAgfSk7XG5cbiAgICBsZXQgcmVzdWx0ID0gZW52LlZNLmludm9rZVBhcnRpYWwuY2FsbChcbiAgICAgIHRoaXMsXG4gICAgICBwYXJ0aWFsLFxuICAgICAgY29udGV4dCxcbiAgICAgIGV4dGVuZGVkT3B0aW9uc1xuICAgICk7XG5cbiAgICBpZiAocmVzdWx0ID09IG51bGwgJiYgZW52LmNvbXBpbGUpIHtcbiAgICAgIG9wdGlvbnMucGFydGlhbHNbb3B0aW9ucy5uYW1lXSA9IGVudi5jb21waWxlKFxuICAgICAgICBwYXJ0aWFsLFxuICAgICAgICB0ZW1wbGF0ZVNwZWMuY29tcGlsZXJPcHRpb25zLFxuICAgICAgICBlbnZcbiAgICAgICk7XG4gICAgICByZXN1bHQgPSBvcHRpb25zLnBhcnRpYWxzW29wdGlvbnMubmFtZV0oY29udGV4dCwgZXh0ZW5kZWRPcHRpb25zKTtcbiAgICB9XG4gICAgaWYgKHJlc3VsdCAhPSBudWxsKSB7XG4gICAgICBpZiAob3B0aW9ucy5pbmRlbnQpIHtcbiAgICAgICAgbGV0IGxpbmVzID0gcmVzdWx0LnNwbGl0KCdcXG4nKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGwgPSBsaW5lcy5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgICBpZiAoIWxpbmVzW2ldICYmIGkgKyAxID09PSBsKSB7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBsaW5lc1tpXSA9IG9wdGlvbnMuaW5kZW50ICsgbGluZXNbaV07XG4gICAgICAgIH1cbiAgICAgICAgcmVzdWx0ID0gbGluZXMuam9pbignXFxuJyk7XG4gICAgICB9XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH0gZWxzZSB7XG4gICAgICB0aHJvdyBuZXcgRXhjZXB0aW9uKFxuICAgICAgICAnVGhlIHBhcnRpYWwgJyArXG4gICAgICAgICAgb3B0aW9ucy5uYW1lICtcbiAgICAgICAgICAnIGNvdWxkIG5vdCBiZSBjb21waWxlZCB3aGVuIHJ1bm5pbmcgaW4gcnVudGltZS1vbmx5IG1vZGUnXG4gICAgICApO1xuICAgIH1cbiAgfVxuXG4gIC8vIEp1c3QgYWRkIHdhdGVyXG4gIGxldCBjb250YWluZXIgPSB7XG4gICAgc3RyaWN0OiBmdW5jdGlvbihvYmosIG5hbWUsIGxvYykge1xuICAgICAgaWYgKCFvYmogfHwgIShuYW1lIGluIG9iaikpIHtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbignXCInICsgbmFtZSArICdcIiBub3QgZGVmaW5lZCBpbiAnICsgb2JqLCB7XG4gICAgICAgICAgbG9jOiBsb2NcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgICByZXR1cm4gY29udGFpbmVyLmxvb2t1cFByb3BlcnR5KG9iaiwgbmFtZSk7XG4gICAgfSxcbiAgICBsb29rdXBQcm9wZXJ0eTogZnVuY3Rpb24ocGFyZW50LCBwcm9wZXJ0eU5hbWUpIHtcbiAgICAgIGxldCByZXN1bHQgPSBwYXJlbnRbcHJvcGVydHlOYW1lXTtcbiAgICAgIGlmIChyZXN1bHQgPT0gbnVsbCkge1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgfVxuICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChwYXJlbnQsIHByb3BlcnR5TmFtZSkpIHtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgIH1cblxuICAgICAgaWYgKHJlc3VsdElzQWxsb3dlZChyZXN1bHQsIGNvbnRhaW5lci5wcm90b0FjY2Vzc0NvbnRyb2wsIHByb3BlcnR5TmFtZSkpIHtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgIH1cbiAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfSxcbiAgICBsb29rdXA6IGZ1bmN0aW9uKGRlcHRocywgbmFtZSkge1xuICAgICAgY29uc3QgbGVuID0gZGVwdGhzLmxlbmd0aDtcbiAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IGRlcHRoc1tpXSAmJiBjb250YWluZXIubG9va3VwUHJvcGVydHkoZGVwdGhzW2ldLCBuYW1lKTtcbiAgICAgICAgaWYgKHJlc3VsdCAhPSBudWxsKSB7XG4gICAgICAgICAgcmV0dXJuIGRlcHRoc1tpXVtuYW1lXTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG4gICAgbGFtYmRhOiBmdW5jdGlvbihjdXJyZW50LCBjb250ZXh0KSB7XG4gICAgICByZXR1cm4gdHlwZW9mIGN1cnJlbnQgPT09ICdmdW5jdGlvbicgPyBjdXJyZW50LmNhbGwoY29udGV4dCkgOiBjdXJyZW50O1xuICAgIH0sXG5cbiAgICBlc2NhcGVFeHByZXNzaW9uOiBVdGlscy5lc2NhcGVFeHByZXNzaW9uLFxuICAgIGludm9rZVBhcnRpYWw6IGludm9rZVBhcnRpYWxXcmFwcGVyLFxuXG4gICAgZm46IGZ1bmN0aW9uKGkpIHtcbiAgICAgIGxldCByZXQgPSB0ZW1wbGF0ZVNwZWNbaV07XG4gICAgICByZXQuZGVjb3JhdG9yID0gdGVtcGxhdGVTcGVjW2kgKyAnX2QnXTtcbiAgICAgIHJldHVybiByZXQ7XG4gICAgfSxcblxuICAgIHByb2dyYW1zOiBbXSxcbiAgICBwcm9ncmFtOiBmdW5jdGlvbihpLCBkYXRhLCBkZWNsYXJlZEJsb2NrUGFyYW1zLCBibG9ja1BhcmFtcywgZGVwdGhzKSB7XG4gICAgICBsZXQgcHJvZ3JhbVdyYXBwZXIgPSB0aGlzLnByb2dyYW1zW2ldLFxuICAgICAgICBmbiA9IHRoaXMuZm4oaSk7XG4gICAgICBpZiAoZGF0YSB8fCBkZXB0aHMgfHwgYmxvY2tQYXJhbXMgfHwgZGVjbGFyZWRCbG9ja1BhcmFtcykge1xuICAgICAgICBwcm9ncmFtV3JhcHBlciA9IHdyYXBQcm9ncmFtKFxuICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgaSxcbiAgICAgICAgICBmbixcbiAgICAgICAgICBkYXRhLFxuICAgICAgICAgIGRlY2xhcmVkQmxvY2tQYXJhbXMsXG4gICAgICAgICAgYmxvY2tQYXJhbXMsXG4gICAgICAgICAgZGVwdGhzXG4gICAgICAgICk7XG4gICAgICB9IGVsc2UgaWYgKCFwcm9ncmFtV3JhcHBlcikge1xuICAgICAgICBwcm9ncmFtV3JhcHBlciA9IHRoaXMucHJvZ3JhbXNbaV0gPSB3cmFwUHJvZ3JhbSh0aGlzLCBpLCBmbik7XG4gICAgICB9XG4gICAgICByZXR1cm4gcHJvZ3JhbVdyYXBwZXI7XG4gICAgfSxcblxuICAgIGRhdGE6IGZ1bmN0aW9uKHZhbHVlLCBkZXB0aCkge1xuICAgICAgd2hpbGUgKHZhbHVlICYmIGRlcHRoLS0pIHtcbiAgICAgICAgdmFsdWUgPSB2YWx1ZS5fcGFyZW50O1xuICAgICAgfVxuICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH0sXG4gICAgbWVyZ2VJZk5lZWRlZDogZnVuY3Rpb24ocGFyYW0sIGNvbW1vbikge1xuICAgICAgbGV0IG9iaiA9IHBhcmFtIHx8IGNvbW1vbjtcblxuICAgICAgaWYgKHBhcmFtICYmIGNvbW1vbiAmJiBwYXJhbSAhPT0gY29tbW9uKSB7XG4gICAgICAgIG9iaiA9IFV0aWxzLmV4dGVuZCh7fSwgY29tbW9uLCBwYXJhbSk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBvYmo7XG4gICAgfSxcbiAgICAvLyBBbiBlbXB0eSBvYmplY3QgdG8gdXNlIGFzIHJlcGxhY2VtZW50IGZvciBudWxsLWNvbnRleHRzXG4gICAgbnVsbENvbnRleHQ6IE9iamVjdC5zZWFsKHt9KSxcblxuICAgIG5vb3A6IGVudi5WTS5ub29wLFxuICAgIGNvbXBpbGVySW5mbzogdGVtcGxhdGVTcGVjLmNvbXBpbGVyXG4gIH07XG5cbiAgZnVuY3Rpb24gcmV0KGNvbnRleHQsIG9wdGlvbnMgPSB7fSkge1xuICAgIGxldCBkYXRhID0gb3B0aW9ucy5kYXRhO1xuXG4gICAgcmV0Ll9zZXR1cChvcHRpb25zKTtcbiAgICBpZiAoIW9wdGlvbnMucGFydGlhbCAmJiB0ZW1wbGF0ZVNwZWMudXNlRGF0YSkge1xuICAgICAgZGF0YSA9IGluaXREYXRhKGNvbnRleHQsIGRhdGEpO1xuICAgIH1cbiAgICBsZXQgZGVwdGhzLFxuICAgICAgYmxvY2tQYXJhbXMgPSB0ZW1wbGF0ZVNwZWMudXNlQmxvY2tQYXJhbXMgPyBbXSA6IHVuZGVmaW5lZDtcbiAgICBpZiAodGVtcGxhdGVTcGVjLnVzZURlcHRocykge1xuICAgICAgaWYgKG9wdGlvbnMuZGVwdGhzKSB7XG4gICAgICAgIGRlcHRocyA9XG4gICAgICAgICAgY29udGV4dCAhPSBvcHRpb25zLmRlcHRoc1swXVxuICAgICAgICAgICAgPyBbY29udGV4dF0uY29uY2F0KG9wdGlvbnMuZGVwdGhzKVxuICAgICAgICAgICAgOiBvcHRpb25zLmRlcHRocztcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGRlcHRocyA9IFtjb250ZXh0XTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtYWluKGNvbnRleHQgLyosIG9wdGlvbnMqLykge1xuICAgICAgcmV0dXJuIChcbiAgICAgICAgJycgK1xuICAgICAgICB0ZW1wbGF0ZVNwZWMubWFpbihcbiAgICAgICAgICBjb250YWluZXIsXG4gICAgICAgICAgY29udGV4dCxcbiAgICAgICAgICBjb250YWluZXIuaGVscGVycyxcbiAgICAgICAgICBjb250YWluZXIucGFydGlhbHMsXG4gICAgICAgICAgZGF0YSxcbiAgICAgICAgICBibG9ja1BhcmFtcyxcbiAgICAgICAgICBkZXB0aHNcbiAgICAgICAgKVxuICAgICAgKTtcbiAgICB9XG5cbiAgICBtYWluID0gZXhlY3V0ZURlY29yYXRvcnMoXG4gICAgICB0ZW1wbGF0ZVNwZWMubWFpbixcbiAgICAgIG1haW4sXG4gICAgICBjb250YWluZXIsXG4gICAgICBvcHRpb25zLmRlcHRocyB8fCBbXSxcbiAgICAgIGRhdGEsXG4gICAgICBibG9ja1BhcmFtc1xuICAgICk7XG4gICAgcmV0dXJuIG1haW4oY29udGV4dCwgb3B0aW9ucyk7XG4gIH1cblxuICByZXQuaXNUb3AgPSB0cnVlO1xuXG4gIHJldC5fc2V0dXAgPSBmdW5jdGlvbihvcHRpb25zKSB7XG4gICAgaWYgKCFvcHRpb25zLnBhcnRpYWwpIHtcbiAgICAgIGxldCBtZXJnZWRIZWxwZXJzID0gVXRpbHMuZXh0ZW5kKHt9LCBlbnYuaGVscGVycywgb3B0aW9ucy5oZWxwZXJzKTtcbiAgICAgIHdyYXBIZWxwZXJzVG9QYXNzTG9va3VwUHJvcGVydHkobWVyZ2VkSGVscGVycywgY29udGFpbmVyKTtcbiAgICAgIGNvbnRhaW5lci5oZWxwZXJzID0gbWVyZ2VkSGVscGVycztcblxuICAgICAgaWYgKHRlbXBsYXRlU3BlYy51c2VQYXJ0aWFsKSB7XG4gICAgICAgIC8vIFVzZSBtZXJnZUlmTmVlZGVkIGhlcmUgdG8gcHJldmVudCBjb21waWxpbmcgZ2xvYmFsIHBhcnRpYWxzIG11bHRpcGxlIHRpbWVzXG4gICAgICAgIGNvbnRhaW5lci5wYXJ0aWFscyA9IGNvbnRhaW5lci5tZXJnZUlmTmVlZGVkKFxuICAgICAgICAgIG9wdGlvbnMucGFydGlhbHMsXG4gICAgICAgICAgZW52LnBhcnRpYWxzXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgICBpZiAodGVtcGxhdGVTcGVjLnVzZVBhcnRpYWwgfHwgdGVtcGxhdGVTcGVjLnVzZURlY29yYXRvcnMpIHtcbiAgICAgICAgY29udGFpbmVyLmRlY29yYXRvcnMgPSBVdGlscy5leHRlbmQoXG4gICAgICAgICAge30sXG4gICAgICAgICAgZW52LmRlY29yYXRvcnMsXG4gICAgICAgICAgb3B0aW9ucy5kZWNvcmF0b3JzXG4gICAgICAgICk7XG4gICAgICB9XG5cbiAgICAgIGNvbnRhaW5lci5ob29rcyA9IHt9O1xuICAgICAgY29udGFpbmVyLnByb3RvQWNjZXNzQ29udHJvbCA9IGNyZWF0ZVByb3RvQWNjZXNzQ29udHJvbChvcHRpb25zKTtcblxuICAgICAgbGV0IGtlZXBIZWxwZXJJbkhlbHBlcnMgPVxuICAgICAgICBvcHRpb25zLmFsbG93Q2FsbHNUb0hlbHBlck1pc3NpbmcgfHxcbiAgICAgICAgdGVtcGxhdGVXYXNQcmVjb21waWxlZFdpdGhDb21waWxlclY3O1xuICAgICAgbW92ZUhlbHBlclRvSG9va3MoY29udGFpbmVyLCAnaGVscGVyTWlzc2luZycsIGtlZXBIZWxwZXJJbkhlbHBlcnMpO1xuICAgICAgbW92ZUhlbHBlclRvSG9va3MoY29udGFpbmVyLCAnYmxvY2tIZWxwZXJNaXNzaW5nJywga2VlcEhlbHBlckluSGVscGVycyk7XG4gICAgfSBlbHNlIHtcbiAgICAgIGNvbnRhaW5lci5wcm90b0FjY2Vzc0NvbnRyb2wgPSBvcHRpb25zLnByb3RvQWNjZXNzQ29udHJvbDsgLy8gaW50ZXJuYWwgb3B0aW9uXG4gICAgICBjb250YWluZXIuaGVscGVycyA9IG9wdGlvbnMuaGVscGVycztcbiAgICAgIGNvbnRhaW5lci5wYXJ0aWFscyA9IG9wdGlvbnMucGFydGlhbHM7XG4gICAgICBjb250YWluZXIuZGVjb3JhdG9ycyA9IG9wdGlvbnMuZGVjb3JhdG9ycztcbiAgICAgIGNvbnRhaW5lci5ob29rcyA9IG9wdGlvbnMuaG9va3M7XG4gICAgfVxuICB9O1xuXG4gIHJldC5fY2hpbGQgPSBmdW5jdGlvbihpLCBkYXRhLCBibG9ja1BhcmFtcywgZGVwdGhzKSB7XG4gICAgaWYgKHRlbXBsYXRlU3BlYy51c2VCbG9ja1BhcmFtcyAmJiAhYmxvY2tQYXJhbXMpIHtcbiAgICAgIHRocm93IG5ldyBFeGNlcHRpb24oJ211c3QgcGFzcyBibG9jayBwYXJhbXMnKTtcbiAgICB9XG4gICAgaWYgKHRlbXBsYXRlU3BlYy51c2VEZXB0aHMgJiYgIWRlcHRocykge1xuICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbignbXVzdCBwYXNzIHBhcmVudCBkZXB0aHMnKTtcbiAgICB9XG5cbiAgICByZXR1cm4gd3JhcFByb2dyYW0oXG4gICAgICBjb250YWluZXIsXG4gICAgICBpLFxuICAgICAgdGVtcGxhdGVTcGVjW2ldLFxuICAgICAgZGF0YSxcbiAgICAgIDAsXG4gICAgICBibG9ja1BhcmFtcyxcbiAgICAgIGRlcHRoc1xuICAgICk7XG4gIH07XG4gIHJldHVybiByZXQ7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiB3cmFwUHJvZ3JhbShcbiAgY29udGFpbmVyLFxuICBpLFxuICBmbixcbiAgZGF0YSxcbiAgZGVjbGFyZWRCbG9ja1BhcmFtcyxcbiAgYmxvY2tQYXJhbXMsXG4gIGRlcHRoc1xuKSB7XG4gIGZ1bmN0aW9uIHByb2coY29udGV4dCwgb3B0aW9ucyA9IHt9KSB7XG4gICAgbGV0IGN1cnJlbnREZXB0aHMgPSBkZXB0aHM7XG4gICAgaWYgKFxuICAgICAgZGVwdGhzICYmXG4gICAgICBjb250ZXh0ICE9IGRlcHRoc1swXSAmJlxuICAgICAgIShjb250ZXh0ID09PSBjb250YWluZXIubnVsbENvbnRleHQgJiYgZGVwdGhzWzBdID09PSBudWxsKVxuICAgICkge1xuICAgICAgY3VycmVudERlcHRocyA9IFtjb250ZXh0XS5jb25jYXQoZGVwdGhzKTtcbiAgICB9XG5cbiAgICByZXR1cm4gZm4oXG4gICAgICBjb250YWluZXIsXG4gICAgICBjb250ZXh0LFxuICAgICAgY29udGFpbmVyLmhlbHBlcnMsXG4gICAgICBjb250YWluZXIucGFydGlhbHMsXG4gICAgICBvcHRpb25zLmRhdGEgfHwgZGF0YSxcbiAgICAgIGJsb2NrUGFyYW1zICYmIFtvcHRpb25zLmJsb2NrUGFyYW1zXS5jb25jYXQoYmxvY2tQYXJhbXMpLFxuICAgICAgY3VycmVudERlcHRoc1xuICAgICk7XG4gIH1cblxuICBwcm9nID0gZXhlY3V0ZURlY29yYXRvcnMoZm4sIHByb2csIGNvbnRhaW5lciwgZGVwdGhzLCBkYXRhLCBibG9ja1BhcmFtcyk7XG5cbiAgcHJvZy5wcm9ncmFtID0gaTtcbiAgcHJvZy5kZXB0aCA9IGRlcHRocyA/IGRlcHRocy5sZW5ndGggOiAwO1xuICBwcm9nLmJsb2NrUGFyYW1zID0gZGVjbGFyZWRCbG9ja1BhcmFtcyB8fCAwO1xuICByZXR1cm4gcHJvZztcbn1cblxuLyoqXG4gKiBUaGlzIGlzIGN1cnJlbnRseSBwYXJ0IG9mIHRoZSBvZmZpY2lhbCBBUEksIHRoZXJlZm9yZSBpbXBsZW1lbnRhdGlvbiBkZXRhaWxzIHNob3VsZCBub3QgYmUgY2hhbmdlZC5cbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIHJlc29sdmVQYXJ0aWFsKHBhcnRpYWwsIGNvbnRleHQsIG9wdGlvbnMpIHtcbiAgaWYgKCFwYXJ0aWFsKSB7XG4gICAgaWYgKG9wdGlvbnMubmFtZSA9PT0gJ0BwYXJ0aWFsLWJsb2NrJykge1xuICAgICAgcGFydGlhbCA9IG9wdGlvbnMuZGF0YVsncGFydGlhbC1ibG9jayddO1xuICAgIH0gZWxzZSB7XG4gICAgICBwYXJ0aWFsID0gb3B0aW9ucy5wYXJ0aWFsc1tvcHRpb25zLm5hbWVdO1xuICAgIH1cbiAgfSBlbHNlIGlmICghcGFydGlhbC5jYWxsICYmICFvcHRpb25zLm5hbWUpIHtcbiAgICAvLyBUaGlzIGlzIGEgZHluYW1pYyBwYXJ0aWFsIHRoYXQgcmV0dXJuZWQgYSBzdHJpbmdcbiAgICBvcHRpb25zLm5hbWUgPSBwYXJ0aWFsO1xuICAgIHBhcnRpYWwgPSBvcHRpb25zLnBhcnRpYWxzW3BhcnRpYWxdO1xuICB9XG4gIHJldHVybiBwYXJ0aWFsO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gaW52b2tlUGFydGlhbChwYXJ0aWFsLCBjb250ZXh0LCBvcHRpb25zKSB7XG4gIC8vIFVzZSB0aGUgY3VycmVudCBjbG9zdXJlIGNvbnRleHQgdG8gc2F2ZSB0aGUgcGFydGlhbC1ibG9jayBpZiB0aGlzIHBhcnRpYWxcbiAgY29uc3QgY3VycmVudFBhcnRpYWxCbG9jayA9IG9wdGlvbnMuZGF0YSAmJiBvcHRpb25zLmRhdGFbJ3BhcnRpYWwtYmxvY2snXTtcbiAgb3B0aW9ucy5wYXJ0aWFsID0gdHJ1ZTtcbiAgaWYgKG9wdGlvbnMuaWRzKSB7XG4gICAgb3B0aW9ucy5kYXRhLmNvbnRleHRQYXRoID0gb3B0aW9ucy5pZHNbMF0gfHwgb3B0aW9ucy5kYXRhLmNvbnRleHRQYXRoO1xuICB9XG5cbiAgbGV0IHBhcnRpYWxCbG9jaztcbiAgaWYgKG9wdGlvbnMuZm4gJiYgb3B0aW9ucy5mbiAhPT0gbm9vcCkge1xuICAgIG9wdGlvbnMuZGF0YSA9IGNyZWF0ZUZyYW1lKG9wdGlvbnMuZGF0YSk7XG4gICAgLy8gV3JhcHBlciBmdW5jdGlvbiB0byBnZXQgYWNjZXNzIHRvIGN1cnJlbnRQYXJ0aWFsQmxvY2sgZnJvbSB0aGUgY2xvc3VyZVxuICAgIGxldCBmbiA9IG9wdGlvbnMuZm47XG4gICAgcGFydGlhbEJsb2NrID0gb3B0aW9ucy5kYXRhWydwYXJ0aWFsLWJsb2NrJ10gPSBmdW5jdGlvbiBwYXJ0aWFsQmxvY2tXcmFwcGVyKFxuICAgICAgY29udGV4dCxcbiAgICAgIG9wdGlvbnMgPSB7fVxuICAgICkge1xuICAgICAgLy8gUmVzdG9yZSB0aGUgcGFydGlhbC1ibG9jayBmcm9tIHRoZSBjbG9zdXJlIGZvciB0aGUgZXhlY3V0aW9uIG9mIHRoZSBibG9ja1xuICAgICAgLy8gaS5lLiB0aGUgcGFydCBpbnNpZGUgdGhlIGJsb2NrIG9mIHRoZSBwYXJ0aWFsIGNhbGwuXG4gICAgICBvcHRpb25zLmRhdGEgPSBjcmVhdGVGcmFtZShvcHRpb25zLmRhdGEpO1xuICAgICAgb3B0aW9ucy5kYXRhWydwYXJ0aWFsLWJsb2NrJ10gPSBjdXJyZW50UGFydGlhbEJsb2NrO1xuICAgICAgcmV0dXJuIGZuKGNvbnRleHQsIG9wdGlvbnMpO1xuICAgIH07XG4gICAgaWYgKGZuLnBhcnRpYWxzKSB7XG4gICAgICBvcHRpb25zLnBhcnRpYWxzID0gVXRpbHMuZXh0ZW5kKHt9LCBvcHRpb25zLnBhcnRpYWxzLCBmbi5wYXJ0aWFscyk7XG4gICAgfVxuICB9XG5cbiAgaWYgKHBhcnRpYWwgPT09IHVuZGVmaW5lZCAmJiBwYXJ0aWFsQmxvY2spIHtcbiAgICBwYXJ0aWFsID0gcGFydGlhbEJsb2NrO1xuICB9XG5cbiAgaWYgKHBhcnRpYWwgPT09IHVuZGVmaW5lZCkge1xuICAgIHRocm93IG5ldyBFeGNlcHRpb24oJ1RoZSBwYXJ0aWFsICcgKyBvcHRpb25zLm5hbWUgKyAnIGNvdWxkIG5vdCBiZSBmb3VuZCcpO1xuICB9IGVsc2UgaWYgKHBhcnRpYWwgaW5zdGFuY2VvZiBGdW5jdGlvbikge1xuICAgIHJldHVybiBwYXJ0aWFsKGNvbnRleHQsIG9wdGlvbnMpO1xuICB9XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBub29wKCkge1xuICByZXR1cm4gJyc7XG59XG5cbmZ1bmN0aW9uIGluaXREYXRhKGNvbnRleHQsIGRhdGEpIHtcbiAgaWYgKCFkYXRhIHx8ICEoJ3Jvb3QnIGluIGRhdGEpKSB7XG4gICAgZGF0YSA9IGRhdGEgPyBjcmVhdGVGcmFtZShkYXRhKSA6IHt9O1xuICAgIGRhdGEucm9vdCA9IGNvbnRleHQ7XG4gIH1cbiAgcmV0dXJuIGRhdGE7XG59XG5cbmZ1bmN0aW9uIGV4ZWN1dGVEZWNvcmF0b3JzKGZuLCBwcm9nLCBjb250YWluZXIsIGRlcHRocywgZGF0YSwgYmxvY2tQYXJhbXMpIHtcbiAgaWYgKGZuLmRlY29yYXRvcikge1xuICAgIGxldCBwcm9wcyA9IHt9O1xuICAgIHByb2cgPSBmbi5kZWNvcmF0b3IoXG4gICAgICBwcm9nLFxuICAgICAgcHJvcHMsXG4gICAgICBjb250YWluZXIsXG4gICAgICBkZXB0aHMgJiYgZGVwdGhzWzBdLFxuICAgICAgZGF0YSxcbiAgICAgIGJsb2NrUGFyYW1zLFxuICAgICAgZGVwdGhzXG4gICAgKTtcbiAgICBVdGlscy5leHRlbmQocHJvZywgcHJvcHMpO1xuICB9XG4gIHJldHVybiBwcm9nO1xufVxuXG5mdW5jdGlvbiB3cmFwSGVscGVyc1RvUGFzc0xvb2t1cFByb3BlcnR5KG1lcmdlZEhlbHBlcnMsIGNvbnRhaW5lcikge1xuICBPYmplY3Qua2V5cyhtZXJnZWRIZWxwZXJzKS5mb3JFYWNoKGhlbHBlck5hbWUgPT4ge1xuICAgIGxldCBoZWxwZXIgPSBtZXJnZWRIZWxwZXJzW2hlbHBlck5hbWVdO1xuICAgIG1lcmdlZEhlbHBlcnNbaGVscGVyTmFtZV0gPSBwYXNzTG9va3VwUHJvcGVydHlPcHRpb24oaGVscGVyLCBjb250YWluZXIpO1xuICB9KTtcbn1cblxuZnVuY3Rpb24gcGFzc0xvb2t1cFByb3BlcnR5T3B0aW9uKGhlbHBlciwgY29udGFpbmVyKSB7XG4gIGNvbnN0IGxvb2t1cFByb3BlcnR5ID0gY29udGFpbmVyLmxvb2t1cFByb3BlcnR5O1xuICByZXR1cm4gd3JhcEhlbHBlcihoZWxwZXIsIG9wdGlvbnMgPT4ge1xuICAgIHJldHVybiBVdGlscy5leHRlbmQoeyBsb29rdXBQcm9wZXJ0eSB9LCBvcHRpb25zKTtcbiAgfSk7XG59XG4iXX0=
  2352. /***/ }),
  2353. /***/ "./node_modules/handlebars/dist/cjs/handlebars/safe-string.js":
  2354. /*!********************************************************************!*\
  2355. !*** ./node_modules/handlebars/dist/cjs/handlebars/safe-string.js ***!
  2356. \********************************************************************/
  2357. /*! no static exports found */
  2358. /***/ (function(module, exports, __webpack_require__) {
  2359. "use strict";
  2360. // Build out our basic SafeString type
  2361. exports.__esModule = true;
  2362. function SafeString(string) {
  2363. this.string = string;
  2364. }
  2365. SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
  2366. return '' + this.string;
  2367. };
  2368. exports['default'] = SafeString;
  2369. module.exports = exports['default'];
  2370. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL3NhZmUtc3RyaW5nLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFDQSxTQUFTLFVBQVUsQ0FBQyxNQUFNLEVBQUU7QUFDMUIsTUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7Q0FDdEI7O0FBRUQsVUFBVSxDQUFDLFNBQVMsQ0FBQyxRQUFRLEdBQUcsVUFBVSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEdBQUcsWUFBVztBQUN2RSxTQUFPLEVBQUUsR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDO0NBQ3pCLENBQUM7O3FCQUVhLFVBQVUiLCJmaWxlIjoic2FmZS1zdHJpbmcuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBCdWlsZCBvdXQgb3VyIGJhc2ljIFNhZmVTdHJpbmcgdHlwZVxuZnVuY3Rpb24gU2FmZVN0cmluZyhzdHJpbmcpIHtcbiAgdGhpcy5zdHJpbmcgPSBzdHJpbmc7XG59XG5cblNhZmVTdHJpbmcucHJvdG90eXBlLnRvU3RyaW5nID0gU2FmZVN0cmluZy5wcm90b3R5cGUudG9IVE1MID0gZnVuY3Rpb24oKSB7XG4gIHJldHVybiAnJyArIHRoaXMuc3RyaW5nO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgU2FmZVN0cmluZztcbiJdfQ==
  2371. /***/ }),
  2372. /***/ "./node_modules/handlebars/dist/cjs/handlebars/utils.js":
  2373. /*!**************************************************************!*\
  2374. !*** ./node_modules/handlebars/dist/cjs/handlebars/utils.js ***!
  2375. \**************************************************************/
  2376. /*! no static exports found */
  2377. /***/ (function(module, exports, __webpack_require__) {
  2378. "use strict";
  2379. exports.__esModule = true;
  2380. exports.extend = extend;
  2381. exports.indexOf = indexOf;
  2382. exports.escapeExpression = escapeExpression;
  2383. exports.isEmpty = isEmpty;
  2384. exports.createFrame = createFrame;
  2385. exports.blockParams = blockParams;
  2386. exports.appendContextPath = appendContextPath;
  2387. var escape = {
  2388. '&': '&amp;',
  2389. '<': '&lt;',
  2390. '>': '&gt;',
  2391. '"': '&quot;',
  2392. "'": '&#x27;',
  2393. '`': '&#x60;',
  2394. '=': '&#x3D;'
  2395. };
  2396. var badChars = /[&<>"'`=]/g,
  2397. possible = /[&<>"'`=]/;
  2398. function escapeChar(chr) {
  2399. return escape[chr];
  2400. }
  2401. function extend(obj /* , ...source */) {
  2402. for (var i = 1; i < arguments.length; i++) {
  2403. for (var key in arguments[i]) {
  2404. if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
  2405. obj[key] = arguments[i][key];
  2406. }
  2407. }
  2408. }
  2409. return obj;
  2410. }
  2411. var toString = Object.prototype.toString;
  2412. exports.toString = toString;
  2413. // Sourced from lodash
  2414. // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
  2415. /* eslint-disable func-style */
  2416. var isFunction = function isFunction(value) {
  2417. return typeof value === 'function';
  2418. };
  2419. // fallback for older versions of Chrome and Safari
  2420. /* istanbul ignore next */
  2421. if (isFunction(/x/)) {
  2422. exports.isFunction = isFunction = function (value) {
  2423. return typeof value === 'function' && toString.call(value) === '[object Function]';
  2424. };
  2425. }
  2426. exports.isFunction = isFunction;
  2427. /* eslint-enable func-style */
  2428. /* istanbul ignore next */
  2429. var isArray = Array.isArray || function (value) {
  2430. return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
  2431. };
  2432. exports.isArray = isArray;
  2433. // Older IE versions do not directly support indexOf so we must implement our own, sadly.
  2434. function indexOf(array, value) {
  2435. for (var i = 0, len = array.length; i < len; i++) {
  2436. if (array[i] === value) {
  2437. return i;
  2438. }
  2439. }
  2440. return -1;
  2441. }
  2442. function escapeExpression(string) {
  2443. if (typeof string !== 'string') {
  2444. // don't escape SafeStrings, since they're already safe
  2445. if (string && string.toHTML) {
  2446. return string.toHTML();
  2447. } else if (string == null) {
  2448. return '';
  2449. } else if (!string) {
  2450. return string + '';
  2451. }
  2452. // Force a string conversion as this will be done by the append regardless and
  2453. // the regex test will do this transparently behind the scenes, causing issues if
  2454. // an object's to string has escaped characters in it.
  2455. string = '' + string;
  2456. }
  2457. if (!possible.test(string)) {
  2458. return string;
  2459. }
  2460. return string.replace(badChars, escapeChar);
  2461. }
  2462. function isEmpty(value) {
  2463. if (!value && value !== 0) {
  2464. return true;
  2465. } else if (isArray(value) && value.length === 0) {
  2466. return true;
  2467. } else {
  2468. return false;
  2469. }
  2470. }
  2471. function createFrame(object) {
  2472. var frame = extend({}, object);
  2473. frame._parent = object;
  2474. return frame;
  2475. }
  2476. function blockParams(params, ids) {
  2477. params.path = ids;
  2478. return params;
  2479. }
  2480. function appendContextPath(contextPath, id) {
  2481. return (contextPath ? contextPath + '.' : '') + id;
  2482. }
  2483. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9oYW5kbGViYXJzL3V0aWxzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSxJQUFNLE1BQU0sR0FBRztBQUNiLEtBQUcsRUFBRSxPQUFPO0FBQ1osS0FBRyxFQUFFLE1BQU07QUFDWCxLQUFHLEVBQUUsTUFBTTtBQUNYLEtBQUcsRUFBRSxRQUFRO0FBQ2IsS0FBRyxFQUFFLFFBQVE7QUFDYixLQUFHLEVBQUUsUUFBUTtBQUNiLEtBQUcsRUFBRSxRQUFRO0NBQ2QsQ0FBQzs7QUFFRixJQUFNLFFBQVEsR0FBRyxZQUFZO0lBQzNCLFFBQVEsR0FBRyxXQUFXLENBQUM7O0FBRXpCLFNBQVMsVUFBVSxDQUFDLEdBQUcsRUFBRTtBQUN2QixTQUFPLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztDQUNwQjs7QUFFTSxTQUFTLE1BQU0sQ0FBQyxHQUFHLG9CQUFvQjtBQUM1QyxPQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsU0FBUyxDQUFDLE1BQU0sRUFBRSxDQUFDLEVBQUUsRUFBRTtBQUN6QyxTQUFLLElBQUksR0FBRyxJQUFJLFNBQVMsQ0FBQyxDQUFDLENBQUMsRUFBRTtBQUM1QixVQUFJLE1BQU0sQ0FBQyxTQUFTLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDLEVBQUU7QUFDM0QsV0FBRyxDQUFDLEdBQUcsQ0FBQyxHQUFHLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQztPQUM5QjtLQUNGO0dBQ0Y7O0FBRUQsU0FBTyxHQUFHLENBQUM7Q0FDWjs7QUFFTSxJQUFJLFFBQVEsR0FBRyxNQUFNLENBQUMsU0FBUyxDQUFDLFFBQVEsQ0FBQzs7Ozs7O0FBS2hELElBQUksVUFBVSxHQUFHLG9CQUFTLEtBQUssRUFBRTtBQUMvQixTQUFPLE9BQU8sS0FBSyxLQUFLLFVBQVUsQ0FBQztDQUNwQyxDQUFDOzs7QUFHRixJQUFJLFVBQVUsQ0FBQyxHQUFHLENBQUMsRUFBRTtBQUNuQixVQU9PLFVBQVUsR0FQakIsVUFBVSxHQUFHLFVBQVMsS0FBSyxFQUFFO0FBQzNCLFdBQ0UsT0FBTyxLQUFLLEtBQUssVUFBVSxJQUMzQixRQUFRLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxLQUFLLG1CQUFtQixDQUM1QztHQUNILENBQUM7Q0FDSDtRQUNRLFVBQVUsR0FBVixVQUFVOzs7OztBQUlaLElBQU0sT0FBTyxHQUNsQixLQUFLLENBQUMsT0FBTyxJQUNiLFVBQVMsS0FBSyxFQUFFO0FBQ2QsU0FBTyxLQUFLLElBQUksT0FBTyxLQUFLLEtBQUssUUFBUSxHQUNyQyxRQUFRLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxLQUFLLGdCQUFnQixHQUN6QyxLQUFLLENBQUM7Q0FDWCxDQUFDOzs7OztBQUdHLFNBQVMsT0FBTyxDQUFDLEtBQUssRUFBRSxLQUFLLEVBQUU7QUFDcEMsT0FBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsR0FBRyxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLEdBQUcsRUFBRSxDQUFDLEVBQUUsRUFBRTtBQUNoRCxRQUFJLEtBQUssQ0FBQyxDQUFDLENBQUMsS0FBSyxLQUFLLEVBQUU7QUFDdEIsYUFBTyxDQUFDLENBQUM7S0FDVjtHQUNGO0FBQ0QsU0FBTyxDQUFDLENBQUMsQ0FBQztDQUNYOztBQUVNLFNBQVMsZ0JBQWdCLENBQUMsTUFBTSxFQUFFO0FBQ3ZDLE1BQUksT0FBTyxNQUFNLEtBQUssUUFBUSxFQUFFOztBQUU5QixRQUFJLE1BQU0sSUFBSSxNQUFNLENBQUMsTUFBTSxFQUFFO0FBQzNCLGFBQU8sTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFDO0tBQ3hCLE1BQU0sSUFBSSxNQUFNLElBQUksSUFBSSxFQUFFO0FBQ3pCLGFBQU8sRUFBRSxDQUFDO0tBQ1gsTUFBTSxJQUFJLENBQUMsTUFBTSxFQUFFO0FBQ2xCLGFBQU8sTUFBTSxHQUFHLEVBQUUsQ0FBQztLQUNwQjs7Ozs7QUFLRCxVQUFNLEdBQUcsRUFBRSxHQUFHLE1BQU0sQ0FBQztHQUN0Qjs7QUFFRCxNQUFJLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsRUFBRTtBQUMxQixXQUFPLE1BQU0sQ0FBQztHQUNmO0FBQ0QsU0FBTyxNQUFNLENBQUMsT0FBTyxDQUFDLFFBQVEsRUFBRSxVQUFVLENBQUMsQ0FBQztDQUM3Qzs7QUFFTSxTQUFTLE9BQU8sQ0FBQyxLQUFLLEVBQUU7QUFDN0IsTUFBSSxDQUFDLEtBQUssSUFBSSxLQUFLLEtBQUssQ0FBQyxFQUFFO0FBQ3pCLFdBQU8sSUFBSSxDQUFDO0dBQ2IsTUFBTSxJQUFJLE9BQU8sQ0FBQyxLQUFLLENBQUMsSUFBSSxLQUFLLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRTtBQUMvQyxXQUFPLElBQUksQ0FBQztHQUNiLE1BQU07QUFDTCxXQUFPLEtBQUssQ0FBQztHQUNkO0NBQ0Y7O0FBRU0sU0FBUyxXQUFXLENBQUMsTUFBTSxFQUFFO0FBQ2xDLE1BQUksS0FBSyxHQUFHLE1BQU0sQ0FBQyxFQUFFLEVBQUUsTUFBTSxDQUFDLENBQUM7QUFDL0IsT0FBSyxDQUFDLE9BQU8sR0FBRyxNQUFNLENBQUM7QUFDdkIsU0FBTyxLQUFLLENBQUM7Q0FDZDs7QUFFTSxTQUFTLFdBQVcsQ0FBQyxNQUFNLEVBQUUsR0FBRyxFQUFFO0FBQ3ZDLFFBQU0sQ0FBQyxJQUFJLEdBQUcsR0FBRyxDQUFDO0FBQ2xCLFNBQU8sTUFBTSxDQUFDO0NBQ2Y7O0FBRU0sU0FBUyxpQkFBaUIsQ0FBQyxXQUFXLEVBQUUsRUFBRSxFQUFFO0FBQ2pELFNBQU8sQ0FBQyxXQUFXLEdBQUcsV0FBVyxHQUFHLEdBQUcsR0FBRyxFQUFFLENBQUEsR0FBSSxFQUFFLENBQUM7Q0FDcEQiLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBlc2NhcGUgPSB7XG4gICcmJzogJyZhbXA7JyxcbiAgJzwnOiAnJmx0OycsXG4gICc+JzogJyZndDsnLFxuICAnXCInOiAnJnF1b3Q7JyxcbiAgXCInXCI6ICcmI3gyNzsnLFxuICAnYCc6ICcmI3g2MDsnLFxuICAnPSc6ICcmI3gzRDsnXG59O1xuXG5jb25zdCBiYWRDaGFycyA9IC9bJjw+XCInYD1dL2csXG4gIHBvc3NpYmxlID0gL1smPD5cIidgPV0vO1xuXG5mdW5jdGlvbiBlc2NhcGVDaGFyKGNocikge1xuICByZXR1cm4gZXNjYXBlW2Nocl07XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBleHRlbmQob2JqIC8qICwgLi4uc291cmNlICovKSB7XG4gIGZvciAobGV0IGkgPSAxOyBpIDwgYXJndW1lbnRzLmxlbmd0aDsgaSsrKSB7XG4gICAgZm9yIChsZXQga2V5IGluIGFyZ3VtZW50c1tpXSkge1xuICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChhcmd1bWVudHNbaV0sIGtleSkpIHtcbiAgICAgICAgb2JqW2tleV0gPSBhcmd1bWVudHNbaV1ba2V5XTtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICByZXR1cm4gb2JqO1xufVxuXG5leHBvcnQgbGV0IHRvU3RyaW5nID0gT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZztcblxuLy8gU291cmNlZCBmcm9tIGxvZGFzaFxuLy8gaHR0cHM6Ly9naXRodWIuY29tL2Jlc3RpZWpzL2xvZGFzaC9ibG9iL21hc3Rlci9MSUNFTlNFLnR4dFxuLyogZXNsaW50LWRpc2FibGUgZnVuYy1zdHlsZSAqL1xubGV0IGlzRnVuY3Rpb24gPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdHlwZW9mIHZhbHVlID09PSAnZnVuY3Rpb24nO1xufTtcbi8vIGZhbGxiYWNrIGZvciBvbGRlciB2ZXJzaW9ucyBvZiBDaHJvbWUgYW5kIFNhZmFyaVxuLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbmlmIChpc0Z1bmN0aW9uKC94LykpIHtcbiAgaXNGdW5jdGlvbiA9IGZ1bmN0aW9uKHZhbHVlKSB7XG4gICAgcmV0dXJuIChcbiAgICAgIHR5cGVvZiB2YWx1ZSA9PT0gJ2Z1bmN0aW9uJyAmJlxuICAgICAgdG9TdHJpbmcuY2FsbCh2YWx1ZSkgPT09ICdbb2JqZWN0IEZ1bmN0aW9uXSdcbiAgICApO1xuICB9O1xufVxuZXhwb3J0IHsgaXNGdW5jdGlvbiB9O1xuLyogZXNsaW50LWVuYWJsZSBmdW5jLXN0eWxlICovXG5cbi8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG5leHBvcnQgY29uc3QgaXNBcnJheSA9XG4gIEFycmF5LmlzQXJyYXkgfHxcbiAgZnVuY3Rpb24odmFsdWUpIHtcbiAgICByZXR1cm4gdmFsdWUgJiYgdHlwZW9mIHZhbHVlID09PSAnb2JqZWN0J1xuICAgICAgPyB0b1N0cmluZy5jYWxsKHZhbHVlKSA9PT0gJ1tvYmplY3QgQXJyYXldJ1xuICAgICAgOiBmYWxzZTtcbiAgfTtcblxuLy8gT2xkZXIgSUUgdmVyc2lvbnMgZG8gbm90IGRpcmVjdGx5IHN1cHBvcnQgaW5kZXhPZiBzbyB3ZSBtdXN0IGltcGxlbWVudCBvdXIgb3duLCBzYWRseS5cbmV4cG9ydCBmdW5jdGlvbiBpbmRleE9mKGFycmF5LCB2YWx1ZSkge1xuICBmb3IgKGxldCBpID0gMCwgbGVuID0gYXJyYXkubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcbiAgICBpZiAoYXJyYXlbaV0gPT09IHZhbHVlKSB7XG4gICAgICByZXR1cm4gaTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIC0xO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZXNjYXBlRXhwcmVzc2lvbihzdHJpbmcpIHtcbiAgaWYgKHR5cGVvZiBzdHJpbmcgIT09ICdzdHJpbmcnKSB7XG4gICAgLy8gZG9uJ3QgZXNjYXBlIFNhZmVTdHJpbmdzLCBzaW5jZSB0aGV5J3JlIGFscmVhZHkgc2FmZVxuICAgIGlmIChzdHJpbmcgJiYgc3RyaW5nLnRvSFRNTCkge1xuICAgICAgcmV0dXJuIHN0cmluZy50b0hUTUwoKTtcbiAgICB9IGVsc2UgaWYgKHN0cmluZyA9PSBudWxsKSB7XG4gICAgICByZXR1cm4gJyc7XG4gICAgfSBlbHNlIGlmICghc3RyaW5nKSB7XG4gICAgICByZXR1cm4gc3RyaW5nICsgJyc7XG4gICAgfVxuXG4gICAgLy8gRm9yY2UgYSBzdHJpbmcgY29udmVyc2lvbiBhcyB0aGlzIHdpbGwgYmUgZG9uZSBieSB0aGUgYXBwZW5kIHJlZ2FyZGxlc3MgYW5kXG4gICAgLy8gdGhlIHJlZ2V4IHRlc3Qgd2lsbCBkbyB0aGlzIHRyYW5zcGFyZW50bHkgYmVoaW5kIHRoZSBzY2VuZXMsIGNhdXNpbmcgaXNzdWVzIGlmXG4gICAgLy8gYW4gb2JqZWN0J3MgdG8gc3RyaW5nIGhhcyBlc2NhcGVkIGNoYXJhY3RlcnMgaW4gaXQuXG4gICAgc3RyaW5nID0gJycgKyBzdHJpbmc7XG4gIH1cblxuICBpZiAoIXBvc3NpYmxlLnRlc3Qoc3RyaW5nKSkge1xuICAgIHJldHVybiBzdHJpbmc7XG4gIH1cbiAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKGJhZENoYXJzLCBlc2NhcGVDaGFyKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGlzRW1wdHkodmFsdWUpIHtcbiAgaWYgKCF2YWx1ZSAmJiB2YWx1ZSAhPT0gMCkge1xuICAgIHJldHVybiB0cnVlO1xuICB9IGVsc2UgaWYgKGlzQXJyYXkodmFsdWUpICYmIHZhbHVlLmxlbmd0aCA9PT0gMCkge1xuICAgIHJldHVybiB0cnVlO1xuICB9IGVsc2Uge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gY3JlYXRlRnJhbWUob2JqZWN0KSB7XG4gIGxldCBmcmFtZSA9IGV4dGVuZCh7fSwgb2JqZWN0KTtcbiAgZnJhbWUuX3BhcmVudCA9IG9iamVjdDtcbiAgcmV0dXJuIGZyYW1lO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gYmxvY2tQYXJhbXMocGFyYW1zLCBpZHMpIHtcbiAgcGFyYW1zLnBhdGggPSBpZHM7XG4gIHJldHVybiBwYXJhbXM7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBhcHBlbmRDb250ZXh0UGF0aChjb250ZXh0UGF0aCwgaWQpIHtcbiAgcmV0dXJuIChjb250ZXh0UGF0aCA/IGNvbnRleHRQYXRoICsgJy4nIDogJycpICsgaWQ7XG59XG4iXX0=
  2484. /***/ }),
  2485. /***/ "./node_modules/handlebars/runtime.js":
  2486. /*!********************************************!*\
  2487. !*** ./node_modules/handlebars/runtime.js ***!
  2488. \********************************************/
  2489. /*! no static exports found */
  2490. /***/ (function(module, exports, __webpack_require__) {
  2491. // Create a simple path alias to allow browserify to resolve
  2492. // the runtime on a supported path.
  2493. module.exports = __webpack_require__(/*! ./dist/cjs/handlebars.runtime */ "./node_modules/handlebars/dist/cjs/handlebars.runtime.js")['default'];
  2494. /***/ }),
  2495. /***/ "./node_modules/webpack/buildin/global.js":
  2496. /*!***********************************!*\
  2497. !*** (webpack)/buildin/global.js ***!
  2498. \***********************************/
  2499. /*! no static exports found */
  2500. /***/ (function(module, exports) {
  2501. var g;
  2502. // This works in non-strict mode
  2503. g = (function() {
  2504. return this;
  2505. })();
  2506. try {
  2507. // This works if eval is allowed (see CSP)
  2508. g = g || new Function("return this")();
  2509. } catch (e) {
  2510. // This works if the window reference is available
  2511. if (typeof window === "object") g = window;
  2512. }
  2513. // g can still be undefined, but nothing to do about it...
  2514. // We return undefined, instead of nothing here, so it's
  2515. // easier to handle this case. if(!global) { ...}
  2516. module.exports = g;
  2517. /***/ }),
  2518. /***/ "./src/css/main.styl":
  2519. /*!***************************!*\
  2520. !*** ./src/css/main.styl ***!
  2521. \***************************/
  2522. /*! no static exports found */
  2523. /***/ (function(module, exports, __webpack_require__) {
  2524. // extracted by mini-css-extract-plugin
  2525. /***/ }),
  2526. /***/ "./src/index.js":
  2527. /*!**********************!*\
  2528. !*** ./src/index.js ***!
  2529. \**********************/
  2530. /*! no static exports found */
  2531. /***/ (function(module, exports, __webpack_require__) {
  2532. "use strict";
  2533. /* WEBPACK VAR INJECTION */(function(global) {/**
  2534. * @fileoverview The entry file of fullcalendar
  2535. * @author NHN FE Development Lab
  2536. */
  2537. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  2538. var Calendar = __webpack_require__(/*! ./js/factory/calendar */ "./src/js/factory/calendar.js");
  2539. __webpack_require__(/*! ./css/main.styl */ "./src/css/main.styl");
  2540. __webpack_require__(/*! ./js/view/template/helper */ "./src/js/view/template/helper.js");
  2541. // for jquery
  2542. if (global.jQuery) {
  2543. global.jQuery.fn.tuiCalendar = function() {
  2544. var options, instance;
  2545. var el = this.get(0);
  2546. var args = Array.prototype.slice.apply(arguments);
  2547. if (el) {
  2548. options = util.pick(args, 0) || {};
  2549. instance = global.jQuery.data(el, 'tuiCalendar');
  2550. if (instance) {
  2551. if (typeof options === 'string' && instance[options]) {
  2552. return instance[options].apply(instance, args.slice(1));
  2553. }
  2554. } else {
  2555. instance = new Calendar(el, options);
  2556. global.jQuery.data(el, 'tuiCalendar', instance);
  2557. }
  2558. }
  2559. return this;
  2560. };
  2561. }
  2562. module.exports = Calendar;
  2563. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  2564. /***/ }),
  2565. /***/ "./src/js/common/array.js":
  2566. /*!********************************!*\
  2567. !*** ./src/js/common/array.js ***!
  2568. \********************************/
  2569. /*! no static exports found */
  2570. /***/ (function(module, exports, __webpack_require__) {
  2571. "use strict";
  2572. /**
  2573. * @fileoverview Utility module for array sort, binary search.
  2574. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  2575. */
  2576. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  2577. var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
  2578. /**
  2579. * A module for sorting array.
  2580. * @module array
  2581. */
  2582. /**********
  2583. * Search
  2584. **********/
  2585. /**
  2586. * search item index using binary search algorithm.
  2587. *
  2588. * the array must be sorted.
  2589. * @param {array} arr array to search.
  2590. * @param {(string|number|boolean)} search value to search.
  2591. * @param {function} [fn] iteratee for retrieve each element's value to search.
  2592. * @param {function} [compare] compare function for specific sort status. default is string ascending.
  2593. * @returns {number} The number of item index searched. return negative number when no exist that item.
  2594. * It can use insert index after Math.abs()
  2595. * @example
  2596. *
  2597. * var arr = [1, 3, 7, 11, 15, 23];
  2598. *
  2599. * function sortNumber(a, b) {
  2600. * return a - b;
  2601. * }
  2602. *
  2603. * bsearch(arr, 15, null, sortNumber); // 4
  2604. * bsearch(arr, 21, null, sortNumber); // -5
  2605. *
  2606. * arr.splice(Math.abs(bsearch(arr, 21, null, sortNumber)), 0, 21);
  2607. * // [1, 2, 7, 11, 15, 21, 23]
  2608. */
  2609. function bsearch(arr, search, fn, compare) {
  2610. var minIndex = 0,
  2611. maxIndex = arr.length - 1,
  2612. currentIndex,
  2613. value,
  2614. comp;
  2615. compare = compare || stringASC;
  2616. while (minIndex <= maxIndex) {
  2617. currentIndex = (minIndex + maxIndex) / 2 | 0; // Math.floor
  2618. value = fn ? fn(arr[currentIndex]) : arr[currentIndex];
  2619. comp = compare(value, search);
  2620. if (comp < 0) {
  2621. minIndex = currentIndex + 1;
  2622. } else if (comp > 0) {
  2623. maxIndex = currentIndex - 1;
  2624. } else {
  2625. return currentIndex;
  2626. }
  2627. }
  2628. return ~maxIndex;
  2629. }
  2630. /**********
  2631. * Compare Functions
  2632. **********/
  2633. /**
  2634. * compare function for array sort.
  2635. *
  2636. * sort array by ascending.
  2637. * @param {boolean} a The boolean to compare
  2638. * @param {boolean} b The boolean to compare.
  2639. * @returns {number} Result of comparison.
  2640. */
  2641. function booleanASC(a, b) {
  2642. if (a !== b) {
  2643. return a ? -1 : 1;
  2644. }
  2645. return 0;
  2646. }
  2647. /**
  2648. * compare function for array sort.
  2649. *
  2650. * sort array by descending.
  2651. * @param {boolean} a The boolean to compare
  2652. * @param {boolean} b The boolean to compare.
  2653. * @returns {number} Result of comparison.
  2654. */
  2655. function booleanDESC(a, b) {
  2656. if (a !== b) {
  2657. return a ? 1 : -1;
  2658. }
  2659. return 0;
  2660. }
  2661. /**
  2662. * compare function for array sort.
  2663. *
  2664. * sort array by number ascending.
  2665. * @param {number} _a The number to compare.
  2666. * @param {number} _b The number to compare.
  2667. * @returns {number} Result of comparison.
  2668. */
  2669. function numberASC(_a, _b) {
  2670. var a = Number(_a),
  2671. b = Number(_b);
  2672. return a - b;
  2673. }
  2674. /**
  2675. * compare function for array sort.
  2676. *
  2677. * sort array by number descending.
  2678. * @param {number} _a The number to compare.
  2679. * @param {number} _b The number to compare.
  2680. * @returns {number} Result of comparison.
  2681. */
  2682. function numberDESC(_a, _b) {
  2683. var a = Number(_a),
  2684. b = Number(_b);
  2685. return b - a;
  2686. }
  2687. /**
  2688. * compare function for array sort.
  2689. *
  2690. * sort array by string ascending
  2691. * @param {string} _a The string to compare.
  2692. * @param {string} _b The string to compare.
  2693. * @returns {number} Result of comparison.
  2694. */
  2695. function stringASC(_a, _b) {
  2696. var a = String(_a),
  2697. b = String(_b);
  2698. if (a > b) {
  2699. return 1;
  2700. }
  2701. if (a < b) {
  2702. return -1;
  2703. }
  2704. return 0;
  2705. }
  2706. /**
  2707. * compare function for array sort.
  2708. *
  2709. * sort array by string descending
  2710. * @param {string} _a The string to compare.
  2711. * @param {string} _b The string to compare.
  2712. * @returns {number} Result of comparison.
  2713. */
  2714. function stringDESC(_a, _b) {
  2715. var a = String(_a),
  2716. b = String(_b);
  2717. if (a > b) {
  2718. return -1;
  2719. }
  2720. if (a < b) {
  2721. return 1;
  2722. }
  2723. return 0;
  2724. }
  2725. /**
  2726. * compare function for array sort.
  2727. *
  2728. * sort array by string ascending with ignore case.
  2729. * @param {string} _a The string to compare.
  2730. * @param {string} _b The string to compare.
  2731. * @returns {number} Result of comparison.
  2732. */
  2733. function stringASCIgnoreCase(_a, _b) {
  2734. var a = String(_a).toLowerCase(),
  2735. b = String(_b).toLowerCase();
  2736. if (a > b) {
  2737. return 1;
  2738. }
  2739. if (a < b) {
  2740. return -1;
  2741. }
  2742. return 0;
  2743. }
  2744. /**
  2745. * compare function for array sort.
  2746. *
  2747. * sort array by string descending with ignore case.
  2748. * @param {string} _a The string to compare.
  2749. * @param {string} _b The string to compare.
  2750. * @returns {number} Result of comparison.
  2751. */
  2752. function stringDESCIgnoreCase(_a, _b) {
  2753. var a = String(_a).toLowerCase(),
  2754. b = String(_b).toLowerCase();
  2755. if (a > b) {
  2756. return -1;
  2757. }
  2758. if (a < b) {
  2759. return 1;
  2760. }
  2761. return 0;
  2762. }
  2763. /**
  2764. * Compare schedule models for sort.
  2765. *
  2766. * 1. all day schedule first.
  2767. * 2. early start.
  2768. * 3. longest duration.
  2769. * 4. early created.
  2770. * @param {Schedule|ScheduleViewModel} a The object schedule instance.
  2771. * @param {Schedule|ScheduleViewModel} b The object schedule instance.
  2772. * @returns {number} Result of comparison.
  2773. */
  2774. function scheduleASC(a, b) {
  2775. var durationA, durationB;
  2776. var allDayCompare, startsCompare;
  2777. var modelA = a.valueOf();
  2778. var modelB = b.valueOf();
  2779. allDayCompare = booleanASC(modelA.isAllDay || a.hasMultiDates, modelB.isAllDay || b.hasMultiDates);
  2780. if (allDayCompare) {
  2781. return allDayCompare;
  2782. }
  2783. startsCompare = datetime.compare(a.getStarts(), b.getStarts());
  2784. if (startsCompare) {
  2785. return startsCompare;
  2786. }
  2787. durationA = a.duration();
  2788. durationB = b.duration();
  2789. if (durationA < durationB) {
  2790. return 1;
  2791. }
  2792. if (durationA > durationB) {
  2793. return -1;
  2794. }
  2795. return util.stamp(modelA) - util.stamp(modelB);
  2796. }
  2797. module.exports = {
  2798. bsearch: bsearch,
  2799. compare: {
  2800. schedule: {
  2801. asc: scheduleASC
  2802. },
  2803. bool: {
  2804. asc: booleanASC,
  2805. desc: booleanDESC
  2806. },
  2807. num: {
  2808. asc: numberASC,
  2809. desc: numberDESC
  2810. },
  2811. str: {
  2812. asc: stringASC,
  2813. desc: stringDESC,
  2814. ascIgnoreCase: stringASCIgnoreCase,
  2815. descIgnoreCase: stringDESCIgnoreCase
  2816. }
  2817. }
  2818. };
  2819. /***/ }),
  2820. /***/ "./src/js/common/autoScroll.js":
  2821. /*!*************************************!*\
  2822. !*** ./src/js/common/autoScroll.js ***!
  2823. \*************************************/
  2824. /*! no static exports found */
  2825. /***/ (function(module, exports, __webpack_require__) {
  2826. "use strict";
  2827. /* WEBPACK VAR INJECTION */(function(global) {/**
  2828. * @fileoverview Add autoscroll feature to elements that prevented text selection.
  2829. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  2830. */
  2831. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  2832. var domevent = __webpack_require__(/*! ../common/domevent */ "./src/js/common/domevent.js");
  2833. var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js");
  2834. var Point = __webpack_require__(/*! ../common/point */ "./src/js/common/point.js");
  2835. var SCROLL_INTERVAL = 30;
  2836. var SCROLL_MAX = 15;
  2837. var SCROLL_CLICK_INCREASED = 2; // In IE, the offset of the actual UI pixel when the scroll bar is clicked is offset.
  2838. /**
  2839. * Add autoscroll feature to elements that prevented text selection.
  2840. * @constructor
  2841. * @param {HTMLElement} container - HTMLElement to add autoscroll features.
  2842. */
  2843. function AutoScroll(container) {
  2844. /**
  2845. * @type {HTMLElement}
  2846. */
  2847. this.container = container;
  2848. /**
  2849. * @type {AutoScroll.DIRECTION}
  2850. */
  2851. this._direction = AutoScroll.DIRECTION.INSIDE;
  2852. /**
  2853. * @type {number}
  2854. */
  2855. this._offset = 0;
  2856. /**
  2857. * interval to scrolling
  2858. * @type {number}
  2859. */
  2860. this._intervalID = 0;
  2861. domevent.on(container, {
  2862. 'mousedown': this._onMouseDown
  2863. }, this);
  2864. }
  2865. /**
  2866. * @enum
  2867. */
  2868. AutoScroll.DIRECTION = {
  2869. INSIDE: 0,
  2870. TOP: 1,
  2871. RIGHT: 2,
  2872. BOTTOM: 3,
  2873. LEFT: 4
  2874. };
  2875. /**
  2876. * Instance destroy method.
  2877. */
  2878. AutoScroll.prototype.destroy = function() {
  2879. domevent.off(this.container, {
  2880. 'mousedown': this._onMouseDown,
  2881. 'mousemove': this._onMouseMove,
  2882. 'mouseup': this._onMouseUp
  2883. }, this);
  2884. window.clearInterval(this._intervalID);
  2885. this._intervalID = this._direction = this.container = null;
  2886. };
  2887. /**
  2888. * Normalize ClientRect and calculate each position of edges.
  2889. * @param {ClientRect} clientRect - ClientRect object of element.
  2890. * @returns {object} edges.
  2891. */
  2892. AutoScroll.prototype._getEdgePositions = function(clientRect) {
  2893. return {
  2894. top: clientRect.top,
  2895. right: clientRect.left + clientRect.width,
  2896. bottom: clientRect.bottom,
  2897. left: clientRect.left
  2898. };
  2899. };
  2900. /**
  2901. * Get element real size ("real size" -> size without scrollbar)
  2902. * @param {HTMLElement} el - element want to know real size ("real size" -> size without scrollbar)
  2903. * @returns {number[]} real size [width, height]
  2904. */
  2905. AutoScroll.prototype.getRealSize = function(el) {
  2906. var computed = domutil.getComputedStyle(el),
  2907. border,
  2908. padding;
  2909. border = parseFloat(computed.getPropertyValue('border-top-width')) +
  2910. parseFloat(computed.getPropertyValue('border-bottom-width'));
  2911. padding = parseFloat(computed.getPropertyValue('padding-top')) +
  2912. parseFloat(computed.getPropertyValue('padding-bottom'));
  2913. return [el.clientWidth + border + padding, el.clientHeight + border + padding];
  2914. };
  2915. /**
  2916. * Check supplied element has scrollbar.
  2917. * @param {HTMLElement} el - element want to know has scrollbar.
  2918. * @returns {boolean[]} has scrollbar? [horizontal, vertical]
  2919. */
  2920. AutoScroll.prototype.hasScrollbar = function(el) {
  2921. var realSize = this.getRealSize(el);
  2922. return [
  2923. el.offsetWidth > Math.ceil(realSize[0]),
  2924. el.offsetHeight > Math.ceil(realSize[1])
  2925. ];
  2926. };
  2927. /**
  2928. * @param {HTMLElement} el - element want to know.
  2929. * @param {MouseEvent} mouseEvent - mouse event object.
  2930. * @returns {boolean} mouse pointer is on the scrollbar?
  2931. */
  2932. AutoScroll.prototype.isOnScrollbar = function(el, mouseEvent) {
  2933. var realSize = this.getRealSize(el),
  2934. pos = domevent.getMousePosition(mouseEvent, el),
  2935. mouseInScrollbar = false;
  2936. mouseInScrollbar = (realSize[0] - SCROLL_CLICK_INCREASED < pos[0] ||
  2937. realSize[1] - SCROLL_CLICK_INCREASED < pos[1]);
  2938. return mouseInScrollbar;
  2939. };
  2940. /**
  2941. * MouseDown event handler
  2942. * @param {MouseEvent} mouseDownEvent - mouse down event
  2943. */
  2944. AutoScroll.prototype._onMouseDown = function(mouseDownEvent) {
  2945. // only primary button can start drag.
  2946. if (domevent.getMouseButton(mouseDownEvent) !== 0) {
  2947. return;
  2948. }
  2949. // deactivate autoscroll feature when mouse is on the scrollbar. (IE)
  2950. if (util.browser.msie && this.isOnScrollbar(this.container, mouseDownEvent)) {
  2951. return;
  2952. }
  2953. window.clearInterval(this._intervalID);
  2954. this._intervalID = window.setInterval(this._onTick.bind(this), SCROLL_INTERVAL);
  2955. domevent.on(global, {
  2956. 'mousemove': this._onMouseMove,
  2957. 'mouseup': this._onMouseUp
  2958. }, this);
  2959. };
  2960. /**
  2961. * MouseMove event handler
  2962. * @param {MouseEvent} mouseEvent - mouse move event object.
  2963. */
  2964. AutoScroll.prototype._onMouseMove = function(mouseEvent) {
  2965. var edge = this._getEdgePositions(this.container.getBoundingClientRect()),
  2966. pos = Point.n(domevent.getMousePosition(mouseEvent));
  2967. if (pos.y >= edge.top && pos.y <= edge.bottom &&
  2968. pos.x >= edge.left && pos.x <= edge.right) {
  2969. this._direction = AutoScroll.DIRECTION.INSIDE;
  2970. return;
  2971. }
  2972. if (pos.y < edge.top) {
  2973. this._direction = AutoScroll.DIRECTION.TOP;
  2974. this._offset = edge.top - pos.y;
  2975. return;
  2976. }
  2977. if (pos.y > edge.bottom) {
  2978. this._direction = AutoScroll.DIRECTION.BOTTOM;
  2979. this._offset = pos.y - edge.bottom;
  2980. return;
  2981. }
  2982. if (pos.x < edge.left) {
  2983. this._direction = AutoScroll.DIRECTION.LEFT;
  2984. this._offset = edge.left - pos.x;
  2985. return;
  2986. }
  2987. this._direction = AutoScroll.DIRECTION.RIGHT;
  2988. this._offset = pos.x - edge.right;
  2989. };
  2990. /**
  2991. * MouseUp event handler.
  2992. */
  2993. AutoScroll.prototype._onMouseUp = function() {
  2994. window.clearInterval(this._intervalID);
  2995. this._intervalID = 0;
  2996. this._direction = AutoScroll.DIRECTION.INSIDE;
  2997. this._offset = 0;
  2998. domevent.off(global, {
  2999. 'mousemove': this._onMouseMove,
  3000. 'mouseup': this._onMouseUp
  3001. }, this);
  3002. };
  3003. /**
  3004. * Interval tick event handler
  3005. */
  3006. AutoScroll.prototype._onTick = function() {
  3007. var direction = this._direction,
  3008. container,
  3009. factor;
  3010. if (!direction) {
  3011. return;
  3012. }
  3013. container = this.container;
  3014. factor = Math.min(this._offset, SCROLL_MAX);
  3015. switch (direction) {
  3016. case AutoScroll.DIRECTION.TOP:
  3017. container.scrollTop -= factor;
  3018. break;
  3019. case AutoScroll.DIRECTION.RIGHT:
  3020. container.scrollLeft += factor;
  3021. break;
  3022. case AutoScroll.DIRECTION.BOTTOM:
  3023. container.scrollTop += factor;
  3024. break;
  3025. default:
  3026. container.scrollLeft -= factor;
  3027. break;
  3028. }
  3029. };
  3030. module.exports = AutoScroll;
  3031. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  3032. /***/ }),
  3033. /***/ "./src/js/common/collection.js":
  3034. /*!*************************************!*\
  3035. !*** ./src/js/common/collection.js ***!
  3036. \*************************************/
  3037. /*! no static exports found */
  3038. /***/ (function(module, exports, __webpack_require__) {
  3039. "use strict";
  3040. /**
  3041. * @fileoverview Common collections.
  3042. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  3043. */
  3044. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  3045. var forEachProp = util.forEachOwnProperties,
  3046. forEachArr = util.forEachArray,
  3047. isFunc = util.isFunction,
  3048. isObj = util.isObject;
  3049. var aps = Array.prototype.slice;
  3050. /**
  3051. * Common collection.
  3052. *
  3053. * It need function for get model's unique id.
  3054. *
  3055. * if the function is not supplied then it use default function {@link Collection#getItemID}
  3056. * @constructor
  3057. * @param {function} [getItemIDFn] function for get model's id.
  3058. */
  3059. function Collection(getItemIDFn) {
  3060. /**
  3061. * @type {object.<string, *>}
  3062. */
  3063. this.items = {};
  3064. /**
  3065. * @type {number}
  3066. */
  3067. this.length = 0;
  3068. if (isFunc(getItemIDFn)) {
  3069. /**
  3070. * @type {function}
  3071. */
  3072. this.getItemID = getItemIDFn;
  3073. }
  3074. }
  3075. /**********
  3076. * static props
  3077. **********/
  3078. /**
  3079. * Combind supplied function filters and condition.
  3080. * @param {...function} filters - function filters
  3081. * @returns {function} combined filter
  3082. */
  3083. Collection.and = function(filters) {
  3084. var cnt;
  3085. filters = aps.call(arguments);
  3086. cnt = filters.length;
  3087. return function(item) {
  3088. var i = 0;
  3089. for (; i < cnt; i += 1) {
  3090. if (!filters[i].call(null, item)) {
  3091. return false;
  3092. }
  3093. }
  3094. return true;
  3095. };
  3096. };
  3097. /**********
  3098. * prototype props
  3099. **********/
  3100. /**
  3101. * get model's unique id.
  3102. * @param {object} item model instance.
  3103. * @returns {number} model unique id.
  3104. */
  3105. Collection.prototype.getItemID = function(item) {
  3106. return String(item._id);
  3107. };
  3108. /**
  3109. * add models.
  3110. * @param {...*} item models to add this collection.
  3111. */
  3112. Collection.prototype.add = function(item) {
  3113. var self = this,
  3114. id,
  3115. ownItems;
  3116. if (arguments.length > 1) {
  3117. forEachArr(aps.call(arguments), function(o) {
  3118. self.add(o);
  3119. });
  3120. return;
  3121. }
  3122. id = this.getItemID(item);
  3123. ownItems = this.items;
  3124. if (!ownItems[id]) {
  3125. this.length += 1;
  3126. }
  3127. ownItems[id] = item;
  3128. };
  3129. /**
  3130. * remove models.
  3131. * @param {...(object|string|number)} id model instance or unique id to delete.
  3132. * @returns {array} deleted model list.
  3133. */
  3134. Collection.prototype.remove = function(id) {
  3135. var self = this,
  3136. removed = [],
  3137. ownItems,
  3138. itemToRemove;
  3139. if (!this.length) {
  3140. return removed;
  3141. }
  3142. if (arguments.length > 1) {
  3143. removed = util.map(aps.call(arguments), function(_id) {
  3144. return self.remove(_id);
  3145. });
  3146. return removed;
  3147. }
  3148. ownItems = this.items;
  3149. if (isObj(id)) {
  3150. id = this.getItemID(id);
  3151. }
  3152. if (!ownItems[id]) {
  3153. return removed;
  3154. }
  3155. this.length -= 1;
  3156. itemToRemove = ownItems[id];
  3157. delete ownItems[id];
  3158. return itemToRemove;
  3159. };
  3160. /**
  3161. * remove all models in collection.
  3162. */
  3163. Collection.prototype.clear = function() {
  3164. this.items = {};
  3165. this.length = 0;
  3166. };
  3167. /**
  3168. * check collection has specific model.
  3169. * @param {(object|string|number|function)} id model instance or id or filter function to check
  3170. * @returns {boolean} is has model?
  3171. */
  3172. Collection.prototype.has = function(id) {
  3173. var isFilter,
  3174. has;
  3175. if (!this.length) {
  3176. return false;
  3177. }
  3178. isFilter = isFunc(id);
  3179. has = false;
  3180. if (isFilter) {
  3181. this.each(function(item) {
  3182. if (id(item) === true) {
  3183. has = true;
  3184. return false; // returning false can stop this loop
  3185. }
  3186. return true;
  3187. });
  3188. } else {
  3189. id = isObj(id) ? this.getItemID(id) : id;
  3190. has = util.isExisty(this.items[id]);
  3191. }
  3192. return has;
  3193. };
  3194. /**
  3195. * invoke callback when model exist in collection.
  3196. * @param {(string|number)} id model unique id.
  3197. * @param {function} fn the callback.
  3198. * @param {*} [context] callback context.
  3199. */
  3200. Collection.prototype.doWhenHas = function(id, fn, context) {
  3201. var item = this.items[id];
  3202. if (!util.isExisty(item)) {
  3203. return;
  3204. }
  3205. fn.call(context || this, item);
  3206. };
  3207. /**
  3208. * Search model. and return new collection.
  3209. * @param {function} filter filter function.
  3210. * @returns {Collection} new collection with filtered models.
  3211. * @example
  3212. * collection.find(function(item) {
  3213. * return item.edited === true;
  3214. * });
  3215. *
  3216. * function filter1(item) {
  3217. * return item.edited === false;
  3218. * }
  3219. *
  3220. * function filter2(item) {
  3221. * return item.disabled === false;
  3222. * }
  3223. *
  3224. * collection.find(Collection.and(filter1, filter2));
  3225. */
  3226. Collection.prototype.find = function(filter) {
  3227. var result = new Collection();
  3228. if (this.hasOwnProperty('getItemID')) {
  3229. result.getItemID = this.getItemID;
  3230. }
  3231. this.each(function(item) {
  3232. if (filter(item) === true) {
  3233. result.add(item);
  3234. }
  3235. });
  3236. return result;
  3237. };
  3238. /**
  3239. * Group element by specific key values.
  3240. *
  3241. * if key parameter is function then invoke it and use returned value.
  3242. * @param {(string|number|function|array)} key key property or getter function.
  3243. * if string[] supplied, create each collection before grouping.
  3244. * @param {function} [groupFunc] - function that return each group's key
  3245. * @returns {object.<string, Collection>} grouped object
  3246. * @example
  3247. *
  3248. * // pass `string`, `number`, `boolean` type value then group by property value.
  3249. * collection.groupBy('gender'); // group by 'gender' property value.
  3250. * collection.groupBy(50); // group by '50' property value.
  3251. *
  3252. * // pass `function` then group by return value. each invocation `function` is called with `(item)`.
  3253. * collection.groupBy(function(item) {
  3254. * if (item.score > 60) {
  3255. * return 'pass';
  3256. * }
  3257. * return 'fail';
  3258. * });
  3259. *
  3260. * // pass `array` with first arguments then create each collection before grouping.
  3261. * collection.groupBy(['go', 'ruby', 'javascript']);
  3262. * // result: { 'go': empty Collection, 'ruby': empty Collection, 'javascript': empty Collection }
  3263. *
  3264. * // can pass `function` with `array` then group each elements.
  3265. * collection.groupBy(['go', 'ruby', 'javascript'], function(item) {
  3266. * if (item.isFast) {
  3267. * return 'go';
  3268. * }
  3269. *
  3270. * return item.name;
  3271. * });
  3272. */
  3273. Collection.prototype.groupBy = function(key, groupFunc) {
  3274. var result = {},
  3275. collection,
  3276. baseValue,
  3277. keyIsFunc = isFunc(key),
  3278. getItemIDFn = this.getItemID;
  3279. if (util.isArray(key)) {
  3280. util.forEachArray(key, function(k) {
  3281. result[String(k)] = new Collection(getItemIDFn);
  3282. });
  3283. if (!groupFunc) {
  3284. return result;
  3285. }
  3286. key = groupFunc;
  3287. keyIsFunc = true;
  3288. }
  3289. this.each(function(item) {
  3290. if (keyIsFunc) {
  3291. baseValue = key(item);
  3292. } else {
  3293. baseValue = item[key];
  3294. if (isFunc(baseValue)) {
  3295. baseValue = baseValue.apply(item);
  3296. }
  3297. }
  3298. collection = result[baseValue];
  3299. if (!collection) {
  3300. collection = result[baseValue] = new Collection(getItemIDFn);
  3301. }
  3302. collection.add(item);
  3303. });
  3304. return result;
  3305. };
  3306. /**
  3307. * Return single item in collection.
  3308. *
  3309. * Returned item is inserted in this collection firstly.
  3310. * @param {function} [filter] - function filter
  3311. * @returns {object} item.
  3312. */
  3313. Collection.prototype.single = function(filter) {
  3314. var result,
  3315. useFilter = util.isFunction(filter);
  3316. this.each(function(item) {
  3317. if (!useFilter) {
  3318. result = item;
  3319. return false; // returning false can stop this loop
  3320. }
  3321. if (filter(item)) {
  3322. result = item;
  3323. return false; // returning false can stop this loop
  3324. }
  3325. return true;
  3326. }, this);
  3327. return result;
  3328. };
  3329. /**
  3330. * sort a basis of supplied compare function.
  3331. * @param {function} compareFunction compareFunction
  3332. * @returns {array} sorted array.
  3333. */
  3334. Collection.prototype.sort = function(compareFunction) {
  3335. var arr = [];
  3336. this.each(function(item) {
  3337. arr.push(item);
  3338. });
  3339. if (isFunc(compareFunction)) {
  3340. arr = arr.sort(compareFunction);
  3341. }
  3342. return arr;
  3343. };
  3344. /**
  3345. * iterate each model element.
  3346. *
  3347. * when iteratee return false then break the loop.
  3348. * @param {function} iteratee iteratee(item, index, items)
  3349. * @param {*} [context] context
  3350. */
  3351. Collection.prototype.each = function(iteratee, context) {
  3352. forEachProp(this.items, iteratee, context || this);
  3353. };
  3354. /**
  3355. * return new array with collection items.
  3356. * @returns {array} new array.
  3357. */
  3358. Collection.prototype.toArray = function() {
  3359. if (!this.length) {
  3360. return [];
  3361. }
  3362. return util.map(this.items, function(item) {
  3363. return item;
  3364. });
  3365. };
  3366. module.exports = Collection;
  3367. /***/ }),
  3368. /***/ "./src/js/common/common.js":
  3369. /*!*********************************!*\
  3370. !*** ./src/js/common/common.js ***!
  3371. \*********************************/
  3372. /*! no static exports found */
  3373. /***/ (function(module, exports, __webpack_require__) {
  3374. "use strict";
  3375. /**
  3376. * @fileoverview common/general utilities.
  3377. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  3378. */
  3379. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  3380. var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js"),
  3381. Collection = __webpack_require__(/*! ../common/collection */ "./src/js/common/collection.js");
  3382. var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
  3383. /**
  3384. * Default schedule id getter for collection
  3385. * @param {Schedule} schedule - schedule instance
  3386. * @returns {string} schedule id
  3387. */
  3388. function scheduleIDGetter(schedule) {
  3389. return schedule.cid();
  3390. }
  3391. module.exports = {
  3392. /**
  3393. * @returns {Collection} new collection for schedule models.
  3394. */
  3395. createScheduleCollection: function() {
  3396. return new Collection(scheduleIDGetter);
  3397. },
  3398. /**
  3399. * Get ratio value.
  3400. *
  3401. * a : b = y : X;
  3402. *
  3403. * =
  3404. *
  3405. * X = (b * y) / a;
  3406. * @param {number} a - a
  3407. * @param {number} b - b
  3408. * @param {number} y - y
  3409. * @returns {number} ratio value
  3410. */
  3411. ratio: function(a, b, y) {
  3412. // a : b = y : x;
  3413. return (b * y) / a;
  3414. },
  3415. /**
  3416. * Find nearest value from supplied params.
  3417. * @param {number} value - value to find.
  3418. * @param {array} nearest - nearest array.
  3419. * @returns {number} nearest value
  3420. */
  3421. nearest: function(value, nearest) {
  3422. var diff = util.map(nearest, function(v) {
  3423. return Math.abs(value - v);
  3424. }),
  3425. nearestIndex = util.inArray(Math.min.apply(null, diff), diff);
  3426. return nearest[nearestIndex];
  3427. },
  3428. /**
  3429. * Mixin method.
  3430. *
  3431. * (extend methods except property name 'mixin')
  3432. * @param {object} from - mixin object.
  3433. * @param {object} to - object to mixin.
  3434. */
  3435. mixin: function(from, to) {
  3436. util.extend(to.prototype, from);
  3437. },
  3438. /**
  3439. * Limit supplied value base on `minArr`, `maxArr`
  3440. * @param {number} value - value
  3441. * @param {array} minArr - min
  3442. * @param {array} maxArr - max
  3443. * @returns {number} limited value
  3444. */
  3445. limit: function(value, minArr, maxArr) {
  3446. var v = Math.max.apply(null, [value].concat(minArr));
  3447. v = Math.min.apply(null, [v].concat(maxArr));
  3448. return v;
  3449. },
  3450. /**
  3451. * Limit supplied date base on `min`, `max`
  3452. * @param {TZDate} date - date
  3453. * @param {TZDate} min - min
  3454. * @param {TZDate} max - max
  3455. * @returns {TZDate} limited value
  3456. */
  3457. limitDate: function(date, min, max) {
  3458. if (date < min) {
  3459. return min;
  3460. }
  3461. if (date > max) {
  3462. return max;
  3463. }
  3464. return date;
  3465. },
  3466. /**
  3467. * Max value with TZDate type for timezone calculation
  3468. * @param {TZDate} d1 - date 1
  3469. * @param {TZDate} d2 - date 2
  3470. * @returns {TZDate}
  3471. */
  3472. maxDate: function(d1, d2) {
  3473. if (d1 > d2) {
  3474. return d1;
  3475. }
  3476. return d2;
  3477. },
  3478. stripTags: function(str) {
  3479. return str.replace(/<([^>]+)>/ig, '');
  3480. },
  3481. /**
  3482. * Get first value in 2-dimentional array.
  3483. * @param {Array.<Array>} arr2d - 2-dimentional array
  3484. * @returns {*} first value in 2d array
  3485. */
  3486. firstIn2dArray: function(arr2d) {
  3487. return util.pick(arr2d, '0', '0');
  3488. },
  3489. /**
  3490. * Get last value in 2-dimentional array.
  3491. * @param {Array.<Array>} arr2d - 2-dimentional array
  3492. * @returns {*} last value in 2d array
  3493. */
  3494. lastIn2dArray: function(arr2d) {
  3495. var lastRow = arr2d.length - 1,
  3496. lastCol = arr2d[lastRow].length - 1;
  3497. return util.pick(arr2d, lastRow, lastCol);
  3498. },
  3499. /**
  3500. * Set 'title' attribute for all elements that have exceeded content in
  3501. * container
  3502. * @param {string} selector - CSS selector {@see domutil#find}
  3503. * @param {HTMLElement} container - container element
  3504. * @param {boolean} force - force to apply
  3505. */
  3506. setAutoEllipsis: function(selector, container, force) {
  3507. util.forEach(domutil.find(selector, container, true), function(el) {
  3508. if (force || el.offsetWidth < el.scrollWidth) {
  3509. el.setAttribute('title', domutil.getData(el, 'title'));
  3510. }
  3511. });
  3512. },
  3513. /**
  3514. * Set the value at path of object.
  3515. * @param {object} object - the object to modify
  3516. * @param {string} path -the path of property to set
  3517. * @param {*} value - the value to set
  3518. */
  3519. set: function(object, path, value) {
  3520. var names = path.split('.');
  3521. var store = object;
  3522. util.forEach(names, function(name, index) {
  3523. store[name] = store[name] || {};
  3524. if (index === names.length - 1) {
  3525. store[name] = value;
  3526. } else {
  3527. store = store[name];
  3528. }
  3529. });
  3530. },
  3531. /**
  3532. * shift a array
  3533. * @param {Array.<any>} array - array
  3534. * @param {number} shift - positive or negative integer to shift
  3535. * @returns {Array.<any>} shifted array
  3536. */
  3537. shiftArray: function(array, shift) {
  3538. var length = Math.abs(shift);
  3539. var i;
  3540. if (shift > 0) {
  3541. for (i = 0; i < length; i += 1) {
  3542. array.push(array.shift());
  3543. }
  3544. } else if (shift < 0) {
  3545. for (i = 0; i < length; i += 1) {
  3546. array.unshift(array.pop());
  3547. }
  3548. }
  3549. return array;
  3550. },
  3551. /**
  3552. * take elements from array between start and end.
  3553. * @param {Array.<any>} array - array
  3554. * @param {number} start - start index
  3555. * @param {number} end - end index
  3556. * @returns {Array.<any>}
  3557. */
  3558. takeArray: function(array, start, end) {
  3559. var length = array.length;
  3560. var rightCount = length - end;
  3561. var leftCount = start;
  3562. // remove right
  3563. array.splice(end, rightCount);
  3564. // remove left
  3565. array.splice(0, leftCount);
  3566. return array;
  3567. },
  3568. /**
  3569. * shift hours
  3570. * @param {number} hours - hours
  3571. * @param {number} shift - positive or negative integer to shift
  3572. * @returns {number} shifted hours
  3573. */
  3574. shiftHours: function(hours, shift) {
  3575. if (shift > 0) {
  3576. hours = (hours + shift) % 24;
  3577. } else if (shift < 0) {
  3578. hours += shift;
  3579. hours = hours > 0 ? hours : 24 + hours;
  3580. }
  3581. return hours;
  3582. },
  3583. /**
  3584. * Parse css value into number and units
  3585. * @param {string} cssValue - css value like '72px'
  3586. * @returns {Array} [number, unit]
  3587. */
  3588. parseUnit: function(cssValue) {
  3589. var number = parseFloat(cssValue, 10);
  3590. var unit = cssValue.match(/[\d.\-+]*\s*(.*)/)[1] || '';
  3591. return [number, unit];
  3592. },
  3593. find: function(array, iteratee, contextopt) {
  3594. var found;
  3595. util.forEach(array, function(item) {
  3596. if (iteratee) {
  3597. found = iteratee(item);
  3598. }
  3599. if (found) {
  3600. found = item;
  3601. return false;
  3602. }
  3603. return true;
  3604. }, contextopt);
  3605. return found;
  3606. },
  3607. getScheduleChanges: function(schedule, propNames, data) {
  3608. var changes = {};
  3609. var dateProps = ['start', 'end'];
  3610. util.forEach(propNames, function(propName) {
  3611. if (dateProps.indexOf(propName) > -1) {
  3612. if (datetime.compare(schedule[propName], data[propName])) {
  3613. changes[propName] = data[propName];
  3614. }
  3615. } else if (!util.isUndefined(data[propName]) && schedule[propName] !== data[propName]) {
  3616. changes[propName] = data[propName];
  3617. }
  3618. });
  3619. return util.isEmpty(changes) ? null : changes;
  3620. }
  3621. };
  3622. /***/ }),
  3623. /***/ "./src/js/common/datetime.js":
  3624. /*!***********************************!*\
  3625. !*** ./src/js/common/datetime.js ***!
  3626. \***********************************/
  3627. /*! no static exports found */
  3628. /***/ (function(module, exports, __webpack_require__) {
  3629. "use strict";
  3630. /* WEBPACK VAR INJECTION */(function(global) {/**
  3631. * @fileoverview datetime utility module
  3632. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  3633. */
  3634. var TZDate = __webpack_require__(/*! ./timezone */ "./src/js/common/timezone.js").Date,
  3635. dw = __webpack_require__(/*! ../common/dw */ "./src/js/common/dw.js");
  3636. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  3637. /* eslint-disable no-useless-escape */
  3638. var dateFormatRx = /^(\d{4}[-|\/]*\d{2}[-|\/]*\d{2})\s?(\d{2}:\d{2}:\d{2})?$/;
  3639. var datetime, tokenFunc;
  3640. var memo = {
  3641. millisecondsTo: {},
  3642. millisecondsFrom: {}
  3643. };
  3644. tokenFunc = {
  3645. /**
  3646. * @param {TZDate} date date object.
  3647. * @returns {string} YYYYMMDD
  3648. */
  3649. 'YYYYMMDD': function(date) {
  3650. return [
  3651. date.getFullYear(),
  3652. datetime.leadingZero(date.getMonth() + 1, 2),
  3653. datetime.leadingZero(date.getDate(), 2)
  3654. ].join('');
  3655. },
  3656. /**
  3657. * @param {TZDate} date date object
  3658. * @returns {string} four digit year number
  3659. */
  3660. 'YYYY': function(date) {
  3661. return String(date.getFullYear());
  3662. },
  3663. /**
  3664. * @param {TZDate} date date object
  3665. * @returns {string} two digit month number
  3666. */
  3667. 'MM': function(date) {
  3668. return datetime.leadingZero(date.getMonth() + 1, 2);
  3669. },
  3670. /**
  3671. * @param {TZDate} date date object
  3672. * @returns {string} two digit date number
  3673. */
  3674. 'DD': function(date) {
  3675. return datetime.leadingZero(date.getDate(), 2);
  3676. },
  3677. /**
  3678. * @param {TZDate} date date object
  3679. * @returns {string} HH:mm
  3680. */
  3681. 'HH:mm': function(date) {
  3682. var hour = date.getHours(),
  3683. minutes = date.getMinutes();
  3684. return datetime.leadingZero(hour, 2) + ':' +
  3685. datetime.leadingZero(minutes, 2);
  3686. },
  3687. /**
  3688. * @param {TZDate} date date object
  3689. * @returns {string} hh:mm
  3690. */
  3691. 'hh:mm': function(date) {
  3692. var hour = date.getHours();
  3693. var minutes = date.getMinutes();
  3694. if (hour > 12) {
  3695. hour = hour % 12;
  3696. }
  3697. return datetime.leadingZero(hour, 2) + ':' +
  3698. datetime.leadingZero(minutes, 2);
  3699. },
  3700. /**
  3701. * @param {TZDate} date date object
  3702. * @returns {string} tt
  3703. */
  3704. 'tt': function(date) {
  3705. var hour = date.getHours();
  3706. return hour < 12 ? 'am' : 'pm';
  3707. }
  3708. };
  3709. datetime = {
  3710. /**
  3711. * The number of milliseconds one day.
  3712. * @type {number}
  3713. */
  3714. MILLISECONDS_PER_DAY: 86400000,
  3715. /**
  3716. * The number of milliseconds one hour.
  3717. * @type {number}
  3718. */
  3719. MILLISECONDS_PER_HOUR: 3600000,
  3720. /**
  3721. * The number of milliseconds one minutes.
  3722. * @type {number}
  3723. */
  3724. MILLISECONDS_PER_MINUTES: 60000,
  3725. /**
  3726. * The number of milliseconds 20 minutes for schedule min duration
  3727. * @type {number}
  3728. */
  3729. MILLISECONDS_SCHEDULE_MIN_DURATION: 20 * 60000,
  3730. /**
  3731. * convert milliseconds
  3732. * @param {string} type - type of value.
  3733. * @param {number} value - value to convert.
  3734. * @param {function} iteratee - iteratee function to use reduce.
  3735. * @returns {number} converted value.
  3736. */
  3737. _convMilliseconds: function(type, value, iteratee) {
  3738. var conv = [24, 60, 60, 1000],
  3739. index = {
  3740. day: 0,
  3741. hour: 1,
  3742. minutes: 2,
  3743. seconds: 3
  3744. };
  3745. if (!(type in index) || global.isNaN(value)) {
  3746. return false;
  3747. }
  3748. return util.reduce([value].concat(conv.slice(index[type])), iteratee);
  3749. },
  3750. /**
  3751. * Convert milliseconds value to other type
  3752. * @param {type} type convert to type want to. support "day", "hour",
  3753. * "minutes", "seconds" only.
  3754. * @param {value} value - value to convert.
  3755. * @returns {number} converted value.
  3756. */
  3757. millisecondsTo: function(type, value) {
  3758. var cache = memo.millisecondsTo,
  3759. key = type + value;
  3760. if (cache[key]) {
  3761. return cache[key];
  3762. }
  3763. cache[key] = datetime._convMilliseconds(type, value, function(m, v) {
  3764. return m / v;
  3765. });
  3766. return cache[key];
  3767. },
  3768. /**
  3769. * Convert value to milliseconds
  3770. * @param {type} type - type of supplied value. support "hour", "minutes", "seconds" only.
  3771. * @param {value} value - value to convert.
  3772. * @returns {number} converted value.
  3773. */
  3774. millisecondsFrom: function(type, value) {
  3775. var cache = memo.millisecondsFrom,
  3776. key = type + value;
  3777. if (cache[key]) {
  3778. return cache[key];
  3779. }
  3780. cache[key] = datetime._convMilliseconds(type, value, function(m, v) {
  3781. return m * v;
  3782. });
  3783. return cache[key];
  3784. },
  3785. /**
  3786. * Convert hours to minutes
  3787. * @param {number} hours - hours
  3788. * @returns {number} minutes
  3789. */
  3790. minutesFromHours: function(hours) {
  3791. return hours * 60;
  3792. },
  3793. /**
  3794. * Make date array from supplied paramters.
  3795. * @param {TZDate} start Start date.
  3796. * @param {TZDate} end End date.
  3797. * @param {number} step The number of milliseconds to use increment.
  3798. * @returns {TZDate[]} TZDate array.
  3799. */
  3800. range: function(start, end, step) {
  3801. var startTime = start.getTime();
  3802. var endTime = end.getTime();
  3803. var cursor = startTime;
  3804. var date = dw(new TZDate(start));
  3805. var result = [];
  3806. while (cursor <= endTime && endTime >= date.d.getTime()) {
  3807. result.push(datetime.start(date.d));
  3808. cursor = cursor + step;
  3809. date.addDate(1);
  3810. }
  3811. return result;
  3812. },
  3813. /**
  3814. * Clone supplied date.
  3815. * @param {TZDate} date date object to clone.
  3816. * @returns {TZDate} Cloned date object
  3817. */
  3818. clone: function(date) {
  3819. return new TZDate(date);
  3820. },
  3821. /**
  3822. * Compare two dates.
  3823. *
  3824. * when first date is latest then seconds then return -1.
  3825. *
  3826. * return +1 reverse, and return 0 is same.
  3827. * @param {TZDate} d1 Date object to compare.
  3828. * @param {TZDate} d2 Date object to compare.
  3829. * @returns {number} result of compare
  3830. */
  3831. compare: function(d1, d2) {
  3832. var _d1 = d1.getTime(),
  3833. _d2 = d2.getTime();
  3834. if (_d1 < _d2) {
  3835. return -1;
  3836. }
  3837. if (_d1 > _d2) {
  3838. return 1;
  3839. }
  3840. return 0;
  3841. },
  3842. /**
  3843. * @param {TZDate} d1 - date one
  3844. * @param {TZDate} d2 - date two
  3845. * @returns {boolean} is two date are same year, month?
  3846. */
  3847. isSameMonth: function(d1, d2) {
  3848. return (d1.getFullYear() === d2.getFullYear() &&
  3849. d1.getMonth() === d2.getMonth());
  3850. },
  3851. /**
  3852. * @param {TZDate} d1 - date one
  3853. * @param {TZDate} d2 - date two
  3854. * @returns {boolean} is two date are same year, month, date?
  3855. */
  3856. isSameDate: function(d1, d2) {
  3857. var sameMonth = datetime.isSameMonth(d1, d2);
  3858. return sameMonth && (d1.getDate() === d2.getDate());
  3859. },
  3860. /**
  3861. * Check supplied parameter is valid date object.
  3862. * @param {*} d Object to validate.
  3863. * @returns {boolean} return true when parameter is valid date object.
  3864. */
  3865. isValid: function(d) {
  3866. if (d instanceof TZDate) {
  3867. return !window.isNaN(d.getTime());
  3868. }
  3869. return false;
  3870. },
  3871. /**
  3872. * convert non local date to UTC date.
  3873. * @param {TZDate} d Date to convert UTC.
  3874. * @returns {TZDate} The UTC Date.
  3875. */
  3876. toUTC: function(d) {
  3877. var l = d.getTime(),
  3878. offset = datetime.millisecondsFrom('minutes', new Date().getTimezoneOffset());
  3879. return new TZDate(l + offset);
  3880. },
  3881. /**
  3882. * pad left zero characters.
  3883. * @param {number} number number value to pad zero.
  3884. * @param {number} length pad length to want.
  3885. * @returns {string} padded string.
  3886. */
  3887. leadingZero: function(number, length) {
  3888. var zero = '',
  3889. i = 0;
  3890. if (String(number).length > length) {
  3891. return String(number);
  3892. }
  3893. for (; i < (length - 1); i += 1) {
  3894. zero += '0';
  3895. }
  3896. return (zero + number).slice(length * -1);
  3897. },
  3898. /**
  3899. * Convert date string to date object.
  3900. *
  3901. * Only listed below formats avaliable.
  3902. *
  3903. * - YYYYMMDD
  3904. * - YYYY/MM/DD
  3905. * - YYYY-MM-DD
  3906. * - YYYY/MM/DD HH:mm:SS
  3907. * - YYYY-MM-DD HH:mm:SS
  3908. *
  3909. * @param {string} str Formatted string.
  3910. * @param {number} [fixMonth=-1] - number for fix month calculating.
  3911. * @returns {(TZDate|boolean)} Converted Date object. when supplied str is not available then return false.
  3912. */
  3913. parse: function(str, fixMonth) {
  3914. var separator,
  3915. matches = str.match(dateFormatRx),
  3916. ymd,
  3917. hms;
  3918. if (util.isUndefined(fixMonth)) {
  3919. fixMonth = -1;
  3920. }
  3921. if (!matches) {
  3922. return false;
  3923. }
  3924. if (str.length > 8) {
  3925. // YYYY/MM/DD
  3926. // YYYY-MM-DD
  3927. // YYYY/MM/DD HH:mm:SS
  3928. // YYYY-MM-DD HH:mm:SS
  3929. separator = ~str.indexOf('/') ? '/' : '-';
  3930. matches = matches.splice(1);
  3931. ymd = matches[0].split(separator);
  3932. hms = matches[1] ? matches[1].split(':') : [0, 0, 0];
  3933. } else {
  3934. // YYYYMMDD
  3935. matches = matches[0];
  3936. ymd = [matches.substr(0, 4), matches.substr(4, 2), matches.substr(6, 2)];
  3937. hms = [0, 0, 0];
  3938. }
  3939. return new TZDate().setWithRaw(
  3940. Number(ymd[0]),
  3941. Number(ymd[1]) + fixMonth,
  3942. Number(ymd[2]),
  3943. Number(hms[0]),
  3944. Number(hms[1]),
  3945. Number(hms[2]),
  3946. 0
  3947. );
  3948. },
  3949. /**
  3950. * Return date object from Date.
  3951. * @param {TZDate} date date
  3952. * @returns {object} Date object.
  3953. */
  3954. raw: function(date) {
  3955. return {
  3956. y: date.getFullYear(),
  3957. M: date.getMonth(),
  3958. d: date.getDate(),
  3959. h: date.getHours(),
  3960. m: date.getMinutes(),
  3961. s: date.getSeconds(),
  3962. ms: date.getMilliseconds()
  3963. };
  3964. },
  3965. /**
  3966. * Return 00:00:00 supplied date.
  3967. * @param {TZDate} date date. if undefined, use now.
  3968. * @returns {TZDate} start date.
  3969. */
  3970. start: function(date) {
  3971. var d = date ? new TZDate(date) : new TZDate();
  3972. d.setHours(0, 0, 0, 0);
  3973. return d;
  3974. },
  3975. /**
  3976. * Return 23:59:59 supplied date.
  3977. * @param {TZDate} date date. if undefined, use now.
  3978. * @returns {TZDate} end date.
  3979. */
  3980. end: function(date) {
  3981. var d = date ? new TZDate(date) : new TZDate();
  3982. d.setHours(23, 59, 59, 0);
  3983. return d;
  3984. },
  3985. /**
  3986. * Return formatted string as basis of supplied string.
  3987. *
  3988. * Supported Token Lists.
  3989. *
  3990. * - YYYY => 1988
  3991. * - MM => 01 ~ 12
  3992. * - DD => 01 ~ 31
  3993. * - YYYYMMDD => 19880925
  3994. * @param {TZDate} date String want to formatted.
  3995. * @param {string} format format str.
  3996. * @returns {string} Formatted date string.
  3997. */
  3998. format: function(date, format) {
  3999. var result = format;
  4000. util.forEachOwnProperties(tokenFunc, function(converter, token) {
  4001. result = result.replace(token, converter(date));
  4002. });
  4003. return result;
  4004. },
  4005. /**
  4006. * Get start date of specific month
  4007. * @param {TZDate} date - date to get start date
  4008. * @returns {TZDate} start date of supplied month
  4009. */
  4010. startDateOfMonth: function(date) {
  4011. var startDate = new TZDate(date);
  4012. startDate.setDate(1);
  4013. startDate.setHours(0, 0, 0, 0);
  4014. return startDate;
  4015. },
  4016. /**
  4017. * Get end date of specific month
  4018. * @param {TZDate} date - date to get end date
  4019. * @returns {TZDate} end date of supplied month
  4020. */
  4021. endDateOfMonth: function(date) {
  4022. var endDate = datetime.startDateOfMonth(date);
  4023. endDate.setMonth(endDate.getMonth() + 1);
  4024. endDate.setDate(endDate.getDate() - 1);
  4025. endDate.setHours(23, 59, 59);
  4026. return endDate;
  4027. },
  4028. /**
  4029. * Return 2-dimensional array month calendar
  4030. *
  4031. * dates that different month with given date are negative values
  4032. * @param {TZDate} month - date want to calculate month calendar
  4033. * @param {object} options - options
  4034. * @param {number} [options.startDayOfWeek=0] - start day of week
  4035. * @param {boolean} options.isAlways6Week - whether the number of weeks are always 6
  4036. * @param {number} options.visibleWeeksCount visible weeks count
  4037. * @param {boolean} options.workweek - only show work week
  4038. * @param {function} [iteratee] - iteratee for customizing calendar object
  4039. * @returns {Array.<TZDate[]>} calendar 2d array
  4040. */
  4041. arr2dCalendar: function(month, options, iteratee) {
  4042. var weekArr,
  4043. start, end,
  4044. startIndex, endIndex,
  4045. totalDate, afterDates,
  4046. cursor, week,
  4047. calendar = [],
  4048. startDayOfWeek = options.startDayOfWeek,
  4049. isAlways6Week = util.isUndefined(options.isAlways6Week) || options.isAlways6Week,
  4050. visibleWeeksCount = options.visibleWeeksCount,
  4051. workweek = options.workweek;
  4052. if (visibleWeeksCount) {
  4053. start = new TZDate(month);
  4054. end = dw(new TZDate(month));
  4055. end.addDate(7 * (visibleWeeksCount - 1));
  4056. end = end.d;
  4057. } else {
  4058. start = datetime.startDateOfMonth(month);
  4059. end = datetime.endDateOfMonth(month);
  4060. }
  4061. // create day number array by startDayOfWeek number
  4062. // 4 -> [4, 5, 6, 0, 1, 2, 3]
  4063. // 2 -> [2, 3, 4, 5, 6, 0, 1]
  4064. weekArr = util.range(startDayOfWeek, 7).concat(util.range(7)).slice(0, 7);
  4065. startIndex = util.inArray(start.getDay(), weekArr);
  4066. endIndex = util.inArray(end.getDay(), weekArr);
  4067. // free dates after last date of this month
  4068. afterDates = 7 - (endIndex + 1);
  4069. if (visibleWeeksCount) {
  4070. totalDate = 7 * visibleWeeksCount;
  4071. } else {
  4072. totalDate = isAlways6Week ? (7 * 6) : (startIndex + end.getDate() + afterDates);
  4073. }
  4074. cursor = datetime.start(start).addDate(-startIndex);
  4075. // iteratee all dates to render
  4076. util.forEachArray(util.range(totalDate), function(i) {
  4077. var date;
  4078. if (!(i % 7)) {
  4079. // group each date by week
  4080. week = calendar[i / 7] = [];
  4081. }
  4082. date = datetime.start(cursor);
  4083. date = iteratee ? iteratee(date) : date;
  4084. if (!workweek || !datetime.isWeekend(date.getDay())) {
  4085. week.push(date);
  4086. }
  4087. // add date
  4088. cursor.setDate(cursor.getDate() + 1);
  4089. });
  4090. return calendar;
  4091. },
  4092. /**
  4093. * Calculate grid left(%), width(%) by narrowWeekend, startDayOfWeek, workweek
  4094. *
  4095. * @param {number} days - day length of week
  4096. * @param {boolean} narrowWeekend - narrow weekend
  4097. * @param {number} startDayOfWeek - start day of week
  4098. * @param {boolean} workweek - only show work week
  4099. * @returns {Array} day, left, width
  4100. */
  4101. getGridLeftAndWidth: function(days, narrowWeekend, startDayOfWeek, workweek) {
  4102. var limitDaysToApplyNarrowWeekend = 5;
  4103. var uniformWidth = 100 / days;
  4104. var wideWidth = days > limitDaysToApplyNarrowWeekend ? 100 / (days - 1) : uniformWidth;
  4105. var accumulatedWidth = 0;
  4106. var dates = util.range(startDayOfWeek, 7).concat(util.range(days)).slice(0, 7);
  4107. if (workweek) {
  4108. dates = util.filter(dates, function(day) {
  4109. return !datetime.isWeekend(day);
  4110. });
  4111. }
  4112. narrowWeekend = workweek ? false : narrowWeekend;
  4113. return util.map(dates, function(day) {
  4114. var model;
  4115. var width = narrowWeekend ? wideWidth : uniformWidth;
  4116. if (days > limitDaysToApplyNarrowWeekend && narrowWeekend && datetime.isWeekend(day)) {
  4117. width = wideWidth / 2;
  4118. }
  4119. model = {
  4120. day: day,
  4121. width: width,
  4122. left: accumulatedWidth
  4123. };
  4124. accumulatedWidth += width;
  4125. return model;
  4126. });
  4127. },
  4128. /**
  4129. * Get that day is weekend
  4130. * @param {number} day number
  4131. * @returns {boolean} true if weekend or false
  4132. */
  4133. isWeekend: function(day) {
  4134. return day === 0 || day === 6;
  4135. },
  4136. /**
  4137. * Whether date is between supplied dates with date value?
  4138. * @param {TZDate} d - target date
  4139. * @param {TZDate} d1 - from date
  4140. * @param {TZDate} d2 - to date
  4141. * @returns {boolean} is between?
  4142. */
  4143. isBetweenWithDate: function(d, d1, d2) {
  4144. var format = 'YYYYMMDD';
  4145. d = parseInt(datetime.format(d, format), 10);
  4146. d1 = parseInt(datetime.format(d1, format), 10);
  4147. d2 = parseInt(datetime.format(d2, format), 10);
  4148. return d1 <= d && d <= d2;
  4149. },
  4150. isStartOfDay: function(d) {
  4151. return !datetime.compare(datetime.start(d), d);
  4152. },
  4153. convertStartDayToLastDay: function(d) {
  4154. var date = new TZDate(d);
  4155. if (datetime.isStartOfDay(d)) {
  4156. date.setDate(date.getDate() - 1);
  4157. date.setHours(23, 59, 59);
  4158. }
  4159. return date;
  4160. },
  4161. getStartOfNextDay: function(d) {
  4162. var date = datetime.start(d);
  4163. date.setHours(24);
  4164. return date;
  4165. },
  4166. getDateDifference: function(d1, d2) {
  4167. var time1 = new TZDate(d1.getFullYear(), d1.getMonth(), d1.getDate()).getTime();
  4168. var time2 = new TZDate(d2.getFullYear(), d2.getMonth(), d2.getDate()).getTime();
  4169. return Math.round((time1 - time2) / datetime.MILLISECONDS_PER_DAY);
  4170. },
  4171. getHourDifference: function(d1, d2) {
  4172. var time1 = new TZDate(d1).getTime();
  4173. var time2 = new TZDate(d2).getTime();
  4174. return Math.round((time1 - time2) / datetime.MILLISECONDS_PER_HOUR);
  4175. },
  4176. hasMultiDates: function(start, end) {
  4177. var diffDays = datetime.getDateDifference(start, end);
  4178. var diffHours = Math.abs(datetime.getHourDifference(start, end));
  4179. var withinDay = Math.abs(diffDays) === 1 && diffHours < 24 && datetime.isStartOfDay(end);
  4180. return !datetime.isSameDate(start, end) && !withinDay;
  4181. },
  4182. renderEnd: function(start, end) {
  4183. var diffDays = datetime.getDateDifference(start, end);
  4184. return Math.abs(diffDays) >= 1 && datetime.isStartOfDay(end) ?
  4185. datetime.convertStartDayToLastDay(end) :
  4186. datetime.end(end);
  4187. }
  4188. };
  4189. module.exports = datetime;
  4190. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  4191. /***/ }),
  4192. /***/ "./src/js/common/dirty.js":
  4193. /*!********************************!*\
  4194. !*** ./src/js/common/dirty.js ***!
  4195. \********************************/
  4196. /*! no static exports found */
  4197. /***/ (function(module, exports, __webpack_require__) {
  4198. "use strict";
  4199. /**
  4200. * @fileoverview Dirty flagging module for objects.
  4201. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  4202. */
  4203. var common = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  4204. var existy = common.isExisty,
  4205. pick = common.pick,
  4206. isFunc = common.isFunction;
  4207. /**
  4208. * Mixin module for dirty flagging on specific objects.
  4209. * @mixin
  4210. * @example
  4211. * var obj = { hello: 'good', test: '123' };
  4212. * dirty.mixin(obj);
  4213. *
  4214. * obj.set('hello', 'world');
  4215. * obj.isDirty(); // true
  4216. * obj.isPropChanged('hello'); // true
  4217. * obj.isPropChanged('test'); // false
  4218. * obj.dirty(false);
  4219. *
  4220. * obj.isDirty(); // false
  4221. * obj.isPropChanged('hello'); // false
  4222. */
  4223. var dirty = {
  4224. /**
  4225. * Set property value with dirty flagging.
  4226. * @param {string} propName Property name.
  4227. * @param {*} value Proprty value.
  4228. */
  4229. set: function(propName, value) {
  4230. var originValue = this[propName];
  4231. if (originValue === value) {
  4232. return;
  4233. }
  4234. this[propName] = value;
  4235. if (!this._changed) {
  4236. /**
  4237. * Save changed properties.
  4238. * @memberof dirty
  4239. * @name _changed
  4240. * @type {Object}
  4241. */
  4242. this._changed = {};
  4243. }
  4244. this._changed[propName] = true;
  4245. /**
  4246. * Dirty flag
  4247. * @type {Boolean}
  4248. * @name _dirty
  4249. * @memberof dirty
  4250. */
  4251. this._dirty = true;
  4252. },
  4253. /**
  4254. * Check dirty flag.
  4255. * @returns {boolean} Property is changed.
  4256. */
  4257. isDirty: function() {
  4258. return !!this._dirty;
  4259. },
  4260. /**
  4261. * Set dirty flag manually.
  4262. * @param {Boolean} [toDirty=true] This will set dirty flag directly.
  4263. */
  4264. dirty: function(toDirty) {
  4265. toDirty = existy(toDirty) ? toDirty : true;
  4266. /* istanbul ignore else */
  4267. if (!toDirty) {
  4268. this._changed = {};
  4269. }
  4270. this._dirty = toDirty;
  4271. },
  4272. /**
  4273. * Delete property safety.
  4274. * @param {String} propName The name of property.
  4275. */
  4276. deleteProp: function(propName) {
  4277. delete this[propName];
  4278. if (this._changed) {
  4279. delete this._changed[propName];
  4280. }
  4281. },
  4282. /**
  4283. * Check the changes with specific property.
  4284. * @param {String} propName The name of property you want.
  4285. * @returns {boolean} Is property changed?
  4286. */
  4287. isPropChanged: function(propName) {
  4288. if (!this._changed) {
  4289. return false;
  4290. }
  4291. return this._changed[propName] === true;
  4292. },
  4293. /**
  4294. * Mixin to specific objects.
  4295. * @param {Object} target The object to mix this module.
  4296. * @memberof module:util/dirty
  4297. * @example
  4298. * function Animal() {}
  4299. * dirty.mixin(Animal.prototype);
  4300. */
  4301. mixin: function(target) {
  4302. var methodFilterR = /(^_|mixin|wrap)/;
  4303. common.forEachOwnProperties(dirty, function(o, k) {
  4304. if (!methodFilterR.test(k)) {
  4305. target[k] = dirty[k];
  4306. }
  4307. });
  4308. },
  4309. /**
  4310. * Wrapper method for dirty flagging.
  4311. *
  4312. * This method invoke after invoked specific method that added by you.
  4313. *
  4314. * The method want to add are must exist before add.
  4315. * @param {object} target Target object to method wrap.
  4316. * @param {(string|object)} methodName
  4317. * Method name to wrap or methodName: flag objects.
  4318. * @param {boolean} [flag=true]
  4319. * this will used to flagging by dirty flagger after invoke the methods added by you.
  4320. * @memberof module:util/dirty
  4321. * @example
  4322. * function Animal(name) {
  4323. * this.name = name;
  4324. * }
  4325. * Animal.prototype.growl = jasmine.createSpy('growl');
  4326. * Animal.prototype.test = function() {
  4327. * return this.name;
  4328. * };
  4329. *
  4330. * dirty.mixin(Animal.prototype);
  4331. * // single
  4332. * dirty.wrap(Animal.prototype, 'growl', true);
  4333. * // multiple
  4334. * dirty.wrap(Animap.prototype, {
  4335. * growl: true,
  4336. * test: false
  4337. * });
  4338. *
  4339. */
  4340. wrap: function(target, methodName, flag) {
  4341. var wrap = dirty.wrap,
  4342. fn;
  4343. if (common.isObject(methodName)) {
  4344. common.forEachOwnProperties(methodName, function(_flag, _name) {
  4345. wrap(target, _name, _flag);
  4346. });
  4347. return;
  4348. }
  4349. flag = existy(flag) ? flag : true;
  4350. if (!target._wrapper) {
  4351. /**
  4352. * @param {function} _fn Original method to wrap.
  4353. * @param {boolean} flagToSet The boolean value to using dirty flagging.
  4354. * @returns {*} The result value of original method.
  4355. * @name _wrapper
  4356. * @memberof dirty
  4357. */
  4358. target._wrapper = function(_fn, flagToSet) {
  4359. return function() {
  4360. var args = Array.prototype.slice.call(arguments);
  4361. var result = _fn.apply(this, args); // eslint-disable-line
  4362. this._dirty = flagToSet; // eslint-disable-line
  4363. return result;
  4364. };
  4365. };
  4366. }
  4367. if (existy(pick(target, methodName)) &&
  4368. isFunc(target[methodName]) &&
  4369. !existy(pick(target, methodName, '_wrapped'))) {
  4370. fn = target[methodName];
  4371. target[methodName] = target._wrapper(fn, flag);
  4372. target[methodName]._wrapped = true;
  4373. }
  4374. }
  4375. };
  4376. module.exports = dirty;
  4377. /***/ }),
  4378. /***/ "./src/js/common/domevent.js":
  4379. /*!***********************************!*\
  4380. !*** ./src/js/common/domevent.js ***!
  4381. \***********************************/
  4382. /*! no static exports found */
  4383. /***/ (function(module, exports, __webpack_require__) {
  4384. "use strict";
  4385. /* eslint complexity: 0 */
  4386. /**
  4387. * @fileoverview Utility module for handling DOM events.
  4388. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  4389. */
  4390. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  4391. var eventKey = '_evt',
  4392. DRAG_START = ['touchstart', 'mousedown'];
  4393. var domevent = {
  4394. /**
  4395. * Bind dom events.
  4396. * @param {HTMLElement} obj HTMLElement to bind events.
  4397. * @param {(string|object)} types Space splitted events names or eventName:handler object.
  4398. * @param {*} fn handler function or context for handler method.
  4399. * @param {*} [context] context object for handler method.
  4400. */
  4401. on: function(obj, types, fn, context) {
  4402. if (util.isString(types)) {
  4403. util.forEach(types.split(' '), function(type) {
  4404. domevent._on(obj, type, fn, context);
  4405. });
  4406. return;
  4407. }
  4408. util.forEachOwnProperties(types, function(handler, type) {
  4409. domevent._on(obj, type, handler, fn);
  4410. });
  4411. },
  4412. /**
  4413. * DOM event binding.
  4414. * @param {HTMLElement} obj HTMLElement to bind events.
  4415. * @param {String} type The name of events.
  4416. * @param {*} fn handler function
  4417. * @param {*} [context] context object for handler method.
  4418. * @private
  4419. */
  4420. _on: function(obj, type, fn, context) {
  4421. var id,
  4422. handler,
  4423. originHandler;
  4424. id = type + util.stamp(fn) + (context ? '_' + util.stamp(context) : '');
  4425. if (obj[eventKey] && obj[eventKey][id]) {
  4426. return;
  4427. }
  4428. handler = function(e) {
  4429. fn.call(context || obj, e || window.event);
  4430. };
  4431. originHandler = handler;
  4432. if ('addEventListener' in obj) {
  4433. if (type === 'mouseenter' || type === 'mouseleave') {
  4434. handler = function(e) {
  4435. e = e || window.event;
  4436. if (!domevent._checkMouse(obj, e)) {
  4437. return;
  4438. }
  4439. originHandler(e);
  4440. };
  4441. obj.addEventListener((type === 'mouseenter') ?
  4442. 'mouseover' : 'mouseout', handler, false);
  4443. } else {
  4444. if (type === 'mousewheel') {
  4445. obj.addEventListener('DOMMouseScroll', handler, false);
  4446. }
  4447. obj.addEventListener(type, handler, false);
  4448. }
  4449. } else if ('attachEvent' in obj) {
  4450. obj.attachEvent('on' + type, handler);
  4451. }
  4452. obj[eventKey] = obj[eventKey] || {};
  4453. obj[eventKey][id] = handler;
  4454. },
  4455. /**
  4456. * Unbind DOM Event handler.
  4457. * @param {HTMLElement} obj HTMLElement to unbind.
  4458. * @param {(string|object)} types Space splitted events names or eventName:handler object.
  4459. * @param {*} fn handler function or context for handler method.
  4460. * @param {*} [context] context object for handler method.
  4461. */
  4462. off: function(obj, types, fn, context) {
  4463. if (util.isString(types)) {
  4464. util.forEach(types.split(' '), function(type) {
  4465. domevent._off(obj, type, fn, context);
  4466. });
  4467. return;
  4468. }
  4469. util.forEachOwnProperties(types, function(handler, type) {
  4470. domevent._off(obj, type, handler, fn);
  4471. });
  4472. },
  4473. /**
  4474. * Unbind DOM event handler.
  4475. * @param {HTMLElement} obj HTMLElement to unbind.
  4476. * @param {String} type The name of event to unbind.
  4477. * @param {function()} fn Event handler that supplied when binding.
  4478. * @param {*} context context object that supplied when binding.
  4479. * @private
  4480. */
  4481. _off: function(obj, type, fn, context) {
  4482. var id = type + util.stamp(fn) + (context ? '_' + util.stamp(context) : ''),
  4483. handler = obj[eventKey] && obj[eventKey][id];
  4484. if (!handler) {
  4485. return;
  4486. }
  4487. if ('removeEventListener' in obj) {
  4488. if (type === 'mouseenter' || type === 'mouseleave') {
  4489. obj.removeEventListener((type === 'mouseenter') ?
  4490. 'mouseover' : 'mouseout', handler, false);
  4491. } else {
  4492. if (type === 'mousewheel') {
  4493. obj.removeEventListener('DOMMouseScroll', handler, false);
  4494. }
  4495. obj.removeEventListener(type, handler, false);
  4496. }
  4497. } else if ('detachEvent' in obj) {
  4498. try {
  4499. obj.detachEvent('on' + type, handler);
  4500. } catch (e) {} //eslint-disable-line
  4501. }
  4502. delete obj[eventKey][id];
  4503. if (util.keys(obj[eventKey]).length) {
  4504. return;
  4505. }
  4506. delete obj[eventKey];
  4507. },
  4508. /**
  4509. * Bind DOM event. this event will unbind after invokes.
  4510. * @param {HTMLElement} obj HTMLElement to bind events.
  4511. * @param {(string|object)} types Space splitted events names or eventName:handler object.
  4512. * @param {*} fn handler function or context for handler method.
  4513. * @param {*} [context] context object for handler method.
  4514. */
  4515. once: function(obj, types, fn, context) {
  4516. var self = this;
  4517. if (util.isObject(types)) {
  4518. util.forEachOwnProperties(types, function(handler, type) {
  4519. domevent.once(obj, type, handler, fn);
  4520. });
  4521. return;
  4522. }
  4523. /**
  4524. * Handler for temporary usage for once implementation
  4525. */
  4526. function onceHandler() {
  4527. fn.apply(context || obj, arguments);
  4528. self._off(obj, types, onceHandler, context);
  4529. }
  4530. domevent.on(obj, types, onceHandler, context);
  4531. },
  4532. /**
  4533. * Cancel event bubbling.
  4534. * @param {Event} e Event object.
  4535. */
  4536. stopPropagation: function(e) {
  4537. if (e.stopPropagation) {
  4538. e.stopPropagation();
  4539. } else {
  4540. e.cancelBubble = true;
  4541. }
  4542. },
  4543. /**
  4544. * Cancel browser default actions.
  4545. * @param {Event} e Event object.
  4546. */
  4547. preventDefault: function(e) {
  4548. if (e.preventDefault) {
  4549. e.preventDefault();
  4550. } else {
  4551. e.returnValue = false;
  4552. }
  4553. },
  4554. /**
  4555. * Syntatic sugar of stopPropagation and preventDefault
  4556. * @param {Event} e Event object.
  4557. */
  4558. stop: function(e) {
  4559. domevent.preventDefault(e);
  4560. domevent.stopPropagation(e);
  4561. },
  4562. /**
  4563. * Stop scroll events.
  4564. * @param {HTMLElement} el HTML element to prevent scroll.
  4565. */
  4566. disableScrollPropagation: function(el) {
  4567. domevent.on(el, 'mousewheel MozMousePixelScroll', domevent.stopPropagation);
  4568. },
  4569. /**
  4570. * Stop all events related with click.
  4571. * @param {HTMLElement} el HTML element to prevent all event related with click.
  4572. */
  4573. disableClickPropagation: function(el) {
  4574. domevent.on(el, DRAG_START.join(' ') + ' click dblclick', domevent.stopPropagation);
  4575. },
  4576. /**
  4577. * Get mouse position from mouse event.
  4578. *
  4579. * If supplied relatveElement parameter then return relative position based on element.
  4580. * @param {Event} mouseEvent Mouse event object
  4581. * @param {HTMLElement} relativeElement HTML element that calculate relative position.
  4582. * @returns {number[]} mouse position.
  4583. */
  4584. getMousePosition: function(mouseEvent, relativeElement) {
  4585. var rect;
  4586. if (!relativeElement) {
  4587. return [mouseEvent.clientX, mouseEvent.clientY];
  4588. }
  4589. rect = relativeElement.getBoundingClientRect();
  4590. return [
  4591. mouseEvent.clientX - rect.left - relativeElement.clientLeft,
  4592. mouseEvent.clientY - rect.top - relativeElement.clientTop
  4593. ];
  4594. },
  4595. /**
  4596. * Normalize mouse wheel event that different each browsers.
  4597. * @param {MouseEvent} e Mouse wheel event.
  4598. * @returns {Number} delta
  4599. */
  4600. getWheelDelta: function(e) {
  4601. var delta = 0;
  4602. if (e.wheelDelta) {
  4603. delta = e.wheelDelta / 120;
  4604. }
  4605. if (e.detail) {
  4606. delta = -e.detail / 3;
  4607. }
  4608. return delta;
  4609. },
  4610. /**
  4611. * prevent firing mouseleave event when mouse entered child elements.
  4612. * @param {HTMLElement} el HTML element
  4613. * @param {MouseEvent} e Mouse event
  4614. * @returns {Boolean} leave?
  4615. * @private
  4616. */
  4617. _checkMouse: function(el, e) {
  4618. var related = e.relatedTarget;
  4619. if (!related) {
  4620. return true;
  4621. }
  4622. try {
  4623. while (related && (related !== el)) {
  4624. related = related.parentNode;
  4625. }
  4626. } catch (err) {
  4627. return false;
  4628. }
  4629. return (related !== el);
  4630. },
  4631. /**
  4632. * Trigger specific events to html element.
  4633. * @param {HTMLElement} obj HTMLElement
  4634. * @param {string} type Event type name
  4635. * @param {object} [eventData] Event data
  4636. */
  4637. trigger: function(obj, type, eventData) {
  4638. var rMouseEvent = /(mouse|click)/;
  4639. if (util.isUndefined(eventData) && rMouseEvent.exec(type)) {
  4640. eventData = domevent.mouseEvent(type);
  4641. }
  4642. if (obj.dispatchEvent) {
  4643. obj.dispatchEvent(eventData);
  4644. } else if (obj.fireEvent) {
  4645. obj.fireEvent('on' + type, eventData);
  4646. }
  4647. },
  4648. /**
  4649. * Create virtual mouse event.
  4650. *
  4651. * Tested at
  4652. *
  4653. * - IE7 ~ IE11
  4654. * - Chrome
  4655. * - Firefox
  4656. * - Safari
  4657. * @param {string} type Event type
  4658. * @param {object} [eventObj] Event data
  4659. * @returns {MouseEvent} Virtual mouse event.
  4660. */
  4661. mouseEvent: function(type, eventObj) {
  4662. var evt,
  4663. e;
  4664. e = util.extend({
  4665. bubbles: true,
  4666. cancelable: (type !== 'mousemove'),
  4667. view: window,
  4668. wheelDelta: 0,
  4669. detail: 0,
  4670. screenX: 0,
  4671. screenY: 0,
  4672. clientX: 0,
  4673. clientY: 0,
  4674. ctrlKey: false,
  4675. altKey: false,
  4676. shiftKey: false,
  4677. metaKey: false,
  4678. button: 0,
  4679. relatedTarget: undefined // eslint-disable-line
  4680. }, eventObj);
  4681. if (typeof document.createEvent === 'function') {
  4682. evt = document.createEvent('MouseEvents');
  4683. evt.initMouseEvent(type,
  4684. e.bubbles, e.cancelable, e.view, e.detail,
  4685. e.screenX, e.screenY, e.clientX, e.clientY,
  4686. e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
  4687. e.button, document.body.parentNode
  4688. );
  4689. } else if (document.createEventObject) {
  4690. evt = document.createEventObject();
  4691. util.forEach(e, function(value, propName) {
  4692. evt[propName] = value;
  4693. }, this);
  4694. evt.button = {0: 1,
  4695. 1: 4,
  4696. 2: 2}[evt.button] || evt.button;
  4697. }
  4698. return evt;
  4699. },
  4700. /**
  4701. * Normalize mouse event's button attributes.
  4702. *
  4703. * Can detect which button is clicked by this method.
  4704. *
  4705. * Meaning of return numbers
  4706. *
  4707. * - 0: primary mouse button
  4708. * - 1: wheel button or center button
  4709. * - 2: secondary mouse button
  4710. * @param {MouseEvent} mouseEvent - The mouse event object want to know.
  4711. * @returns {number} - The value of meaning which button is clicked?
  4712. */
  4713. getMouseButton: function(mouseEvent) {
  4714. var button,
  4715. primary = '0,1,3,5,7',
  4716. secondary = '2,6',
  4717. wheel = '4';
  4718. /* istanbul ignore else */
  4719. if (document.implementation.hasFeature('MouseEvents', '2.0')) {
  4720. return mouseEvent.button;
  4721. }
  4722. button = String(mouseEvent.button);
  4723. if (primary.indexOf(button) > -1) {
  4724. return 0;
  4725. }
  4726. if (secondary.indexOf(button) > -1) {
  4727. return 2;
  4728. }
  4729. if (~wheel.indexOf(button)) {
  4730. return 1;
  4731. }
  4732. return -1;
  4733. },
  4734. /**
  4735. * Get target from event object
  4736. *
  4737. * @param {Event} event - The event object
  4738. * @returns {object} - The event target object
  4739. */
  4740. getEventTarget: function(event) {
  4741. return event.target || event.srcElement;
  4742. }
  4743. };
  4744. module.exports = domevent;
  4745. /***/ }),
  4746. /***/ "./src/js/common/domutil.js":
  4747. /*!**********************************!*\
  4748. !*** ./src/js/common/domutil.js ***!
  4749. \**********************************/
  4750. /*! no static exports found */
  4751. /***/ (function(module, exports, __webpack_require__) {
  4752. "use strict";
  4753. /* eslint complexity: 0, no-shadow: 0, max-nested-callbacks: 0 */
  4754. /**
  4755. * @fileoverview Utility modules for manipulate DOM elements.
  4756. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  4757. */
  4758. var domevent = __webpack_require__(/*! ./domevent */ "./src/js/common/domevent.js");
  4759. var Collection = __webpack_require__(/*! ./collection */ "./src/js/common/collection.js");
  4760. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  4761. var posKey = '_pos',
  4762. domutil;
  4763. var CSS_AUTO_REGEX = /^auto$|^$|%/;
  4764. /**
  4765. * Trim leading, trailing whitespace
  4766. * @param {string} str - string to trim
  4767. * @returns {string} trimmed string
  4768. */
  4769. function trim(str) {
  4770. return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  4771. }
  4772. domutil = {
  4773. /**
  4774. * Create DOM element and return it.
  4775. * @param {string} tagName Tag name to append.
  4776. * @param {HTMLElement} [container] HTML element will be parent to created element.
  4777. * if not supplied, will use **document.body**
  4778. * @param {string} [className] Design class names to appling created element.
  4779. * @returns {HTMLElement} HTML element created.
  4780. */
  4781. appendHTMLElement: function(tagName, container, className) {
  4782. var el;
  4783. className = className || '';
  4784. el = document.createElement(tagName);
  4785. el.className = className;
  4786. if (container) {
  4787. container.appendChild(el);
  4788. } else {
  4789. document.body.appendChild(el);
  4790. }
  4791. return el;
  4792. },
  4793. /**
  4794. * Remove element from parent node.
  4795. * @param {HTMLElement} el - element to remove.
  4796. */
  4797. remove: function(el) {
  4798. if (el && el.parentNode) {
  4799. el.parentNode.removeChild(el);
  4800. }
  4801. },
  4802. /**
  4803. * Get element by id
  4804. * @param {string} id element id attribute
  4805. * @returns {HTMLElement} element
  4806. */
  4807. get: function(id) {
  4808. return document.getElementById(id);
  4809. },
  4810. /**
  4811. * Check supplied element is matched selector.
  4812. * @param {HTMLElement} el - element to check
  4813. * @param {string} selector - selector string to check
  4814. * @returns {boolean} match?
  4815. */
  4816. _matcher: function(el, selector) {
  4817. var cssClassSelector = /^\./,
  4818. idSelector = /^#/;
  4819. if (cssClassSelector.test(selector)) {
  4820. return domutil.hasClass(el, selector.replace('.', ''));
  4821. }
  4822. if (idSelector.test(selector)) {
  4823. return el.id === selector.replace('#', '');
  4824. }
  4825. return el.nodeName.toLowerCase() === selector.toLowerCase();
  4826. },
  4827. /**
  4828. * Find DOM element by specific selectors.
  4829. * below three selector only supported.
  4830. *
  4831. * 1. css selector
  4832. * 2. id selector
  4833. * 3. nodeName selector
  4834. * @param {string} selector selector
  4835. * @param {(HTMLElement|string)} [root] You can assign root element to find
  4836. * if not supplied, document.body will use.
  4837. * @param {boolean|function} [multiple=false] - set true then return all
  4838. * elements that meet condition, if set function then use it filter function.
  4839. * @returns {HTMLElement} HTML element finded.
  4840. */
  4841. find: function(selector, root, multiple) {
  4842. var result = [],
  4843. found = false,
  4844. isFirst = util.isUndefined(multiple) || multiple === false,
  4845. isFilter = util.isFunction(multiple);
  4846. if (util.isString(root)) {
  4847. root = domutil.get(root);
  4848. }
  4849. root = root || window.document.body;
  4850. /**
  4851. * Function for recursive find specific node
  4852. * @param {HTMLElement} el - element to search
  4853. * @param {string} selector - selector
  4854. */
  4855. function recurse(el, selector) {
  4856. var childNodes = el.childNodes,
  4857. i = 0,
  4858. len = childNodes.length,
  4859. cursor;
  4860. for (; i < len; i += 1) {
  4861. cursor = childNodes[i];
  4862. if (cursor.nodeName === '#text') {
  4863. continue;
  4864. }
  4865. if (domutil._matcher(cursor, selector)) {
  4866. if ((isFilter && multiple(cursor)) || !isFilter) {
  4867. result.push(cursor);
  4868. }
  4869. if (isFirst) {
  4870. found = true;
  4871. break;
  4872. }
  4873. } else if (cursor.childNodes.length > 0) {
  4874. recurse(cursor, selector);
  4875. if (found) {
  4876. break;
  4877. }
  4878. }
  4879. }
  4880. }
  4881. recurse(root, selector);
  4882. return isFirst ? (result[0] || null) : result;
  4883. },
  4884. /**
  4885. * Find parent element recursively.
  4886. * @param {HTMLElement} el - base element to start find.
  4887. * @param {string} selector - selector string for find
  4888. * @param {boolean} excludeEl - exclude the base element to find
  4889. * @returns {HTMLElement} - element finded or null.
  4890. */
  4891. closest: function(el, selector, excludeEl) {
  4892. var parent;
  4893. if (!el) {
  4894. return null;
  4895. }
  4896. parent = el.parentNode;
  4897. if (!excludeEl && domutil._matcher(el, selector)) {
  4898. return el;
  4899. }
  4900. while (parent && parent !== window.document.body) {
  4901. if (domutil._matcher(parent, selector)) {
  4902. return parent;
  4903. }
  4904. parent = parent.parentNode;
  4905. }
  4906. return null;
  4907. },
  4908. /**
  4909. * Return texts inside element.
  4910. * @param {HTMLElement} el target element
  4911. * @returns {string} text inside node
  4912. */
  4913. text: function(el) {
  4914. var ret = '',
  4915. i = 0,
  4916. nodeType = el.nodeType;
  4917. if (nodeType) {
  4918. if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
  4919. // nodes that available contain other nodes
  4920. if (typeof el.textContent === 'string') {
  4921. return el.textContent;
  4922. }
  4923. for (el = el.firstChild; el; el = el.nextSibling) {
  4924. ret += domutil.text(el);
  4925. }
  4926. } else if (nodeType === 3 || nodeType === 4) {
  4927. // TEXT, CDATA SECTION
  4928. return el.nodeValue;
  4929. }
  4930. } else {
  4931. for (; el[i]; i += 1) {
  4932. ret += domutil.text(el[i]);
  4933. }
  4934. }
  4935. return ret;
  4936. },
  4937. /**
  4938. * Set data attribute to target element
  4939. * @param {HTMLElement} el - element to set data attribute
  4940. * @param {string} key - key
  4941. * @param {string|number} data - data value
  4942. */
  4943. setData: function(el, key, data) {
  4944. if ('dataset' in el) {
  4945. el.dataset[key] = data;
  4946. return;
  4947. }
  4948. el.setAttribute('data-' + key, data);
  4949. },
  4950. /**
  4951. * Get data value from data-attribute
  4952. * @param {HTMLElement} el - target element
  4953. * @param {string} key - key
  4954. * @returns {string} value
  4955. */
  4956. getData: function(el, key) {
  4957. if ('dataset' in el) {
  4958. return el.dataset[key];
  4959. }
  4960. return el.getAttribute('data-' + key);
  4961. },
  4962. /**
  4963. * Check element has specific design class name.
  4964. * @param {HTMLElement} el target element
  4965. * @param {string} name css class
  4966. * @returns {boolean} return true when element has that css class name
  4967. */
  4968. hasClass: function(el, name) {
  4969. var className;
  4970. if (!util.isUndefined(el.classList)) {
  4971. return el.classList.contains(name);
  4972. }
  4973. className = domutil.getClass(el);
  4974. return className.length > 0 && new RegExp('(^|\\s)' + name + '(\\s|$)').test(className);
  4975. },
  4976. /**
  4977. * Add design class to HTML element.
  4978. * @param {HTMLElement} el target element
  4979. * @param {string} name css class name
  4980. */
  4981. addClass: function(el, name) {
  4982. var className;
  4983. if (!util.isUndefined(el.classList)) {
  4984. util.forEachArray(name.split(' '), function(value) {
  4985. el.classList.add(value);
  4986. });
  4987. } else if (!domutil.hasClass(el, name)) {
  4988. className = domutil.getClass(el);
  4989. domutil.setClass(el, (className ? className + ' ' : '') + name);
  4990. }
  4991. },
  4992. /**
  4993. *
  4994. * Overwrite design class to HTML element.
  4995. * @param {HTMLElement} el target element
  4996. * @param {string} name css class name
  4997. */
  4998. setClass: function(el, name) {
  4999. if (util.isUndefined(el.className.baseVal)) {
  5000. el.className = name;
  5001. } else {
  5002. el.className.baseVal = name;
  5003. }
  5004. },
  5005. /**
  5006. * Element에 cssClass속성을 제거하는 메서드
  5007. * Remove specific design class from HTML element.
  5008. * @param {HTMLElement} el target element
  5009. * @param {string} name class name to remove
  5010. */
  5011. removeClass: function(el, name) {
  5012. var removed = '';
  5013. if (!util.isUndefined(el.classList)) {
  5014. el.classList.remove(name);
  5015. } else {
  5016. removed = (' ' + domutil.getClass(el) + ' ').replace(' ' + name + ' ', ' ');
  5017. domutil.setClass(el, trim(removed));
  5018. }
  5019. },
  5020. /**
  5021. * Get HTML element's design classes.
  5022. * @param {HTMLElement} el target element
  5023. * @returns {string} element css class name
  5024. */
  5025. getClass: function(el) {
  5026. if (!el || !el.className) {
  5027. return '';
  5028. }
  5029. return util.isUndefined(el.className.baseVal) ? el.className : el.className.baseVal;
  5030. },
  5031. /**
  5032. * Get specific CSS style value from HTML element.
  5033. * @param {HTMLElement} el target element
  5034. * @param {string} style css attribute name
  5035. * @returns {(string|null)} css style value
  5036. */
  5037. getStyle: function(el, style) {
  5038. var value = el.style[style] || (el.currentStyle && el.currentStyle[style]),
  5039. css;
  5040. if ((!value || value === 'auto') && document.defaultView) {
  5041. css = document.defaultView.getComputedStyle(el, null);
  5042. value = css ? css[style] : null;
  5043. }
  5044. return value === 'auto' ? null : value;
  5045. },
  5046. /**
  5047. * get element's computed style values.
  5048. *
  5049. * in lower IE8. use polyfill function that return object. it has only one function 'getPropertyValue'
  5050. * @param {HTMLElement} el - element want to get style.
  5051. * @returns {object} virtual CSSStyleDeclaration object.
  5052. */
  5053. getComputedStyle: function(el) {
  5054. var defaultView = document.defaultView;
  5055. if (!defaultView || !defaultView.getComputedStyle) {
  5056. return {
  5057. getPropertyValue: function(prop) {
  5058. /* eslint-disable no-useless-escape */
  5059. var re = /(\-([a-z]){1})/g;
  5060. if (prop === 'float') {
  5061. prop = 'styleFloat';
  5062. }
  5063. if (re.test(prop)) {
  5064. prop = prop.replace(re, function() {
  5065. return arguments[2].toUpperCase();
  5066. });
  5067. }
  5068. return el.currentStyle[prop] || null;
  5069. }
  5070. };
  5071. }
  5072. return document.defaultView.getComputedStyle(el);
  5073. },
  5074. /**
  5075. * Set position CSS style.
  5076. * @param {HTMLElement} el target element
  5077. * @param {number} [x=0] left pixel value.
  5078. * @param {number} [y=0] top pixel value.
  5079. */
  5080. setPosition: function(el, x, y) {
  5081. x = util.isUndefined(x) ? 0 : x;
  5082. y = util.isUndefined(y) ? 0 : y;
  5083. el[posKey] = [x, y];
  5084. el.style.left = util.isNumber(x) ? (x + 'px') : x;
  5085. el.style.top = util.isNumber(y) ? (y + 'px') : y;
  5086. },
  5087. /**
  5088. * Set position CSS style with left, top, right, bottom
  5089. * @param {HTMLElement} el target element
  5090. * @param {object} ltrb object of left, top, right, bottom
  5091. * @param {number} [ltrb.left] left pixel value.
  5092. * @param {number} [ltrb.top] top pixel value.
  5093. * @param {number} [ltrb.right] right pixel value.
  5094. * @param {number} [ltrb.bottom] bottom pixel value.
  5095. */
  5096. setLTRB: function(el, ltrb) {
  5097. var props = ['left', 'top', 'right', 'bottom'];
  5098. var value;
  5099. props.forEach(function(prop) {
  5100. value = util.isUndefined(ltrb[prop]) ? '' : ltrb[prop];
  5101. el.style[prop] = util.isNumber(value) ? (value + 'px') : value;
  5102. });
  5103. },
  5104. /**
  5105. * Get position from HTML element.
  5106. * @param {HTMLElement} el target element
  5107. * @param {boolean} [clear=false] clear cache before calculating position.
  5108. * @returns {number[]} point
  5109. */
  5110. getPosition: function(el, clear) {
  5111. var left,
  5112. top,
  5113. bound;
  5114. if (clear) {
  5115. el[posKey] = null;
  5116. }
  5117. if (el[posKey]) {
  5118. return el[posKey];
  5119. }
  5120. left = 0;
  5121. top = 0;
  5122. if ((CSS_AUTO_REGEX.test(el.style.left) || CSS_AUTO_REGEX.test(el.style.top)) &&
  5123. 'getBoundingClientRect' in el) {
  5124. // When the element's left or top is 'auto'
  5125. bound = el.getBoundingClientRect();
  5126. left = bound.left;
  5127. top = bound.top;
  5128. } else {
  5129. left = parseFloat(el.style.left || 0);
  5130. top = parseFloat(el.style.top || 0);
  5131. }
  5132. return [left, top];
  5133. },
  5134. /**
  5135. * Return element's size
  5136. * @param {HTMLElement} el target element
  5137. * @returns {number[]} width, height
  5138. */
  5139. getSize: function(el) {
  5140. var bound,
  5141. width = domutil.getStyle(el, 'width'),
  5142. height = domutil.getStyle(el, 'height');
  5143. if ((CSS_AUTO_REGEX.test(width) || CSS_AUTO_REGEX.test(height) ||
  5144. util.isNull(width) || util.isNull(height)) &&
  5145. 'getBoundingClientRect' in el) {
  5146. bound = el.getBoundingClientRect();
  5147. width = bound.width || el.offsetWidth;
  5148. height = bound.height || el.offsetHeight;
  5149. } else {
  5150. width = parseFloat(width || 0);
  5151. height = parseFloat(height || 0);
  5152. }
  5153. return [width, height];
  5154. },
  5155. /**
  5156. * Fallback of getBoundingClientRect
  5157. * @param {HTMLElement} el - element
  5158. * @returns {object} rect
  5159. */
  5160. getBCRect: function(el) {
  5161. var rect = el.getBoundingClientRect();
  5162. rect = util.extend({
  5163. width: el.offsetWidth,
  5164. height: el.offsetHeight
  5165. }, rect);
  5166. return rect;
  5167. },
  5168. /**
  5169. * Check specific CSS style is available.
  5170. * @param {array} props property name to testing
  5171. * @returns {(string|boolean)} return true when property is available
  5172. * @example
  5173. * var props = ['transform', '-webkit-transform'];
  5174. * domutil.testProp(props); // 'transform'
  5175. */
  5176. testProp: function(props) {
  5177. var style = document.documentElement.style,
  5178. i = 0,
  5179. len = props.length;
  5180. for (; i < len; i += 1) {
  5181. if (props[i] in style) {
  5182. return props[i];
  5183. }
  5184. }
  5185. return false;
  5186. },
  5187. /**
  5188. * Get form data
  5189. * @param {HTMLFormElement} formElement - form element to extract data
  5190. * @returns {object} form data
  5191. */
  5192. getFormData: function(formElement) {
  5193. var groupedByName = new Collection(function() {
  5194. return this.length;
  5195. }),
  5196. noDisabledFilter = function(el) {
  5197. return !el.disabled;
  5198. },
  5199. output = {};
  5200. groupedByName.add.apply(
  5201. groupedByName,
  5202. domutil.find('input', formElement, noDisabledFilter)
  5203. .concat(domutil.find('select', formElement, noDisabledFilter))
  5204. .concat(domutil.find('textarea', formElement, noDisabledFilter))
  5205. );
  5206. groupedByName = groupedByName.groupBy(function(el) {
  5207. return (el && el.getAttribute('name')) || '_other';
  5208. });
  5209. util.forEach(groupedByName, function(elements, name) {
  5210. if (name === '_other') {
  5211. return;
  5212. }
  5213. elements.each(function(el) {
  5214. var nodeName = el.nodeName.toLowerCase(),
  5215. type = el.type,
  5216. result = [];
  5217. if (type === 'radio') {
  5218. result = [elements.find(function(el) {
  5219. return el.checked;
  5220. }).toArray().pop()];
  5221. } else if (type === 'checkbox') {
  5222. result = elements.find(function(el) {
  5223. return el.checked;
  5224. }).toArray();
  5225. } else if (nodeName === 'select') {
  5226. elements.find(function(el) {
  5227. return !!el.childNodes.length;
  5228. }).each(function(el) {
  5229. result = result.concat(
  5230. domutil.find('option', el, function(opt) {
  5231. return opt.selected;
  5232. })
  5233. );
  5234. });
  5235. } else {
  5236. result = elements.find(function(el) {
  5237. return el.value !== '';
  5238. }).toArray();
  5239. }
  5240. result = util.map(result, function(el) {
  5241. return el.value;
  5242. });
  5243. if (!result.length) {
  5244. result = '';
  5245. } else if (result.length === 1) {
  5246. result = result[0];
  5247. }
  5248. output[name] = result;
  5249. });
  5250. });
  5251. return output;
  5252. }
  5253. };
  5254. /* eslint-disable */
  5255. var userSelectProperty = domutil.testProp([
  5256. 'userSelect',
  5257. 'WebkitUserSelect',
  5258. 'OUserSelect',
  5259. 'MozUserSelect',
  5260. 'msUserSelect'
  5261. ]);
  5262. var supportSelectStart = 'onselectstart' in document;
  5263. var prevSelectStyle = '';
  5264. /* eslint-enable */
  5265. /**
  5266. * Disable browser's text selection behaviors.
  5267. * @method
  5268. */
  5269. domutil.disableTextSelection = (function() {
  5270. if (supportSelectStart) {
  5271. return function(dom, onSelectstartHandler) {
  5272. domevent.on(dom, 'selectstart', onSelectstartHandler || domevent.preventDefault);
  5273. };
  5274. }
  5275. return function(dom) {
  5276. var style = dom.style;
  5277. prevSelectStyle = style[userSelectProperty];
  5278. style[userSelectProperty] = 'none';
  5279. };
  5280. })();
  5281. /**
  5282. * Enable browser's text selection behaviors.
  5283. * @method
  5284. */
  5285. domutil.enableTextSelection = (function() {
  5286. if (supportSelectStart) {
  5287. return function(dom, onSelectstartHandler) {
  5288. domevent.off(window, 'selectstart', onSelectstartHandler || domevent.preventDefault);
  5289. };
  5290. }
  5291. return function() {
  5292. document.documentElement.style[userSelectProperty] = prevSelectStyle;
  5293. };
  5294. })();
  5295. /**
  5296. * Disable browser's image drag behaviors.
  5297. */
  5298. domutil.disableImageDrag = function() {
  5299. domevent.on(window, 'dragstart', domevent.preventDefault);
  5300. };
  5301. /**
  5302. * Enable browser's image drag behaviors.
  5303. */
  5304. domutil.enableImageDrag = function() {
  5305. domevent.off(window, 'dragstart', domevent.preventDefault);
  5306. };
  5307. module.exports = domutil;
  5308. /***/ }),
  5309. /***/ "./src/js/common/dw.js":
  5310. /*!*****************************!*\
  5311. !*** ./src/js/common/dw.js ***!
  5312. \*****************************/
  5313. /*! no static exports found */
  5314. /***/ (function(module, exports, __webpack_require__) {
  5315. "use strict";
  5316. /**
  5317. * @fileoverview Wrapper module for easy calc date object
  5318. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  5319. */
  5320. var TZDate = __webpack_require__(/*! ./timezone */ "./src/js/common/timezone.js").Date;
  5321. /**
  5322. * @constructor
  5323. * @param {TZDate} date to wrapping DW class
  5324. */
  5325. function DW(date) {
  5326. if (!(this instanceof DW)) {
  5327. return new DW(date);
  5328. }
  5329. if (!(date instanceof TZDate)) {
  5330. date = new TZDate(date);
  5331. }
  5332. /**
  5333. * @type {TZDate}
  5334. */
  5335. this.d = date;
  5336. }
  5337. /**
  5338. * Return d property when supplied object is DW. else return itself
  5339. * @param {*} obj - object
  5340. * @returns {TZDate} date
  5341. */
  5342. DW.prototype.safe = function(obj) {
  5343. if (obj.constructor === DW) {
  5344. return obj.d;
  5345. }
  5346. return obj;
  5347. };
  5348. /**
  5349. * Clone DW object
  5350. * @returns {DW} cloned dwrap object
  5351. */
  5352. DW.prototype.clone = function() {
  5353. return new DW(new TZDate(this.d));
  5354. };
  5355. /**
  5356. * Add days
  5357. * @param {number} day - day to add
  5358. * @returns {DW} wrapper object
  5359. */
  5360. DW.prototype.addDate = function(day) {
  5361. this.d.setDate(this.d.getDate() + day);
  5362. return this;
  5363. };
  5364. /**
  5365. * Add month.
  5366. * @param {number} m - month to add
  5367. * @returns {DW} wrapper object
  5368. */
  5369. DW.prototype.addMonth = function(m) {
  5370. var currentMonth = this.d.getMonth();
  5371. var currentDay = this.d.getDate();
  5372. var leapYear = this._isLeapYear();
  5373. var targetMonth = currentMonth + m;
  5374. var clone = this.clone();
  5375. var targetDaysOfMonth = currentDay;
  5376. if (m) {
  5377. if (targetMonth === 1) {
  5378. targetDaysOfMonth = leapYear ? 29 : 28;
  5379. } else {
  5380. if (m > 0) {
  5381. clone.d.setMonth(targetMonth + 1, 0);
  5382. } else {
  5383. clone.d.setMonth(currentMonth, 0);
  5384. }
  5385. targetDaysOfMonth = clone.d.getDate();
  5386. }
  5387. }
  5388. this.d.setMonth(targetMonth, Math.min(currentDay, targetDaysOfMonth));
  5389. return this;
  5390. };
  5391. /**
  5392. * Is leap year or not
  5393. * @returns {boolean}
  5394. */
  5395. DW.prototype._isLeapYear = function() {
  5396. var year = this.d.getFullYear();
  5397. return ((year % 4 === 0) && (year % 100 !== 0)) || !(year % 400);
  5398. };
  5399. /**
  5400. * Set hour, minutes, seconds, milliseconds
  5401. * @param {number} h - hours
  5402. * @param {number} m - minutes
  5403. * @param {number} s - seconds
  5404. * @param {number} ms - milliseconds
  5405. * @returns {DW} wrapper object
  5406. */
  5407. DW.prototype.setHours = function(h, m, s, ms) {
  5408. this.d.setHours(h, m, s, ms);
  5409. return this;
  5410. };
  5411. /**
  5412. * Whether date is between supplied dates?
  5413. * @param {TZDate|DW} d1 - from date
  5414. * @param {TZDate|DW} d2 - to date
  5415. * @returns {boolean} is between?
  5416. */
  5417. DW.prototype.isBetween = function(d1, d2) {
  5418. var safe = this.safe;
  5419. return safe(d1) <= this.d && this.d <= safe(d2);
  5420. };
  5421. module.exports = DW;
  5422. /***/ }),
  5423. /***/ "./src/js/common/floatingLayer.js":
  5424. /*!****************************************!*\
  5425. !*** ./src/js/common/floatingLayer.js ***!
  5426. \****************************************/
  5427. /*! no static exports found */
  5428. /***/ (function(module, exports, __webpack_require__) {
  5429. "use strict";
  5430. /**
  5431. * @fileoverview Floating layer module
  5432. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  5433. */
  5434. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  5435. var config = __webpack_require__(/*! ../config */ "./src/js/config.js"),
  5436. domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js"),
  5437. View = __webpack_require__(/*! ../view/view */ "./src/js/view/view.js");
  5438. /**
  5439. * @constructor
  5440. * @extends {View}
  5441. * @param {object} options - options for floating layer module
  5442. * @param {HTMLElement} container - parent continer for floating layer
  5443. */
  5444. function FloatingLayer(options, container) {
  5445. var sibling = container[FloatingLayer.PROP_KEY],
  5446. layerContainer;
  5447. if (!sibling) {
  5448. sibling = container[FloatingLayer.PROP_KEY] = [];
  5449. }
  5450. sibling.push(this);
  5451. /**
  5452. * @type {Collection}
  5453. */
  5454. this.sibling = sibling;
  5455. /**
  5456. * @type {number}
  5457. */
  5458. this.zIndex = this.getLargestZIndex() || FloatingLayer.INIT_ZINDEX;
  5459. layerContainer = document.createElement('div');
  5460. layerContainer.style.display = 'none';
  5461. layerContainer.style.position = 'absolute';
  5462. domutil.addClass(layerContainer, config.classname('floating-layer'));
  5463. container.appendChild(layerContainer);
  5464. View.call(this, layerContainer);
  5465. /**
  5466. * @type {HTMLElement}
  5467. */
  5468. this.parent = container;
  5469. }
  5470. util.inherit(FloatingLayer, View);
  5471. /**
  5472. * @const
  5473. */
  5474. FloatingLayer.PROP_KEY = '__fe_floating_layer';
  5475. /**
  5476. * @const
  5477. */
  5478. FloatingLayer.INIT_ZINDEX = 999;
  5479. /**
  5480. * Destroy floating layer instance. if there no instnace in parent container
  5481. *
  5482. * remove instance cache property in container element
  5483. */
  5484. FloatingLayer.prototype.destroy = function() {
  5485. var parent = this.parent,
  5486. sibling = this.sibling,
  5487. i = 0, cnt = sibling.length;
  5488. for (; i < cnt; i += 1) {
  5489. if (sibling[i] === this) {
  5490. sibling.splice(i, 1);
  5491. break;
  5492. }
  5493. }
  5494. if (!sibling.length) {
  5495. try {
  5496. delete parent[FloatingLayer.PROP_KEY];
  5497. } catch (e) {
  5498. parent[FloatingLayer.PROP_KEY] = null;
  5499. }
  5500. parent.style.position = '';
  5501. }
  5502. domutil.remove(this.container);
  5503. this.sibling = null;
  5504. View.prototype.destroy.call(this);
  5505. };
  5506. /**
  5507. * @returns {boolean} whether layer is visible?
  5508. */
  5509. FloatingLayer.prototype.isVisible = function() {
  5510. return this.container.style.display !== 'none';
  5511. };
  5512. /**
  5513. * Set layer position
  5514. * @param {number} x - x coordinate of layer
  5515. * @param {number} y - y coordinate of layer
  5516. */
  5517. FloatingLayer.prototype.setPosition = function(x, y) {
  5518. domutil.setPosition(this.container, x, y);
  5519. };
  5520. /**
  5521. * Set layer left, top, right, bottom position
  5522. * @param {object} ltrb object of left, top, right, bottom
  5523. * @param {number} [ltrb.left] left pixel value.
  5524. * @param {number} [ltrb.top] top pixel value.
  5525. * @param {number} [ltrb.right] right pixel value.
  5526. * @param {number} [ltrb.bottom] bottom pixel value.
  5527. */
  5528. FloatingLayer.prototype.setLTRB = function(ltrb) {
  5529. domutil.setLTRB(this.container, ltrb);
  5530. };
  5531. /**
  5532. * Set layer size
  5533. * @param {number|string} w - layer width
  5534. * @param {number|string} h - layer height
  5535. */
  5536. FloatingLayer.prototype.setSize = function(w, h) {
  5537. var container = this.container;
  5538. w = util.isNumber(w) ? w + 'px' : w;
  5539. h = util.isNumber(h) ? h + 'px' : h;
  5540. container.style.width = w;
  5541. container.style.height = h;
  5542. };
  5543. /**
  5544. * Set layer content
  5545. * @param {string} html - html string
  5546. */
  5547. FloatingLayer.prototype.setContent = function(html) {
  5548. this.container.innerHTML = html;
  5549. };
  5550. /**
  5551. * Get largest z-index from sibling layers
  5552. * @returns {number} largest z-index value
  5553. */
  5554. FloatingLayer.prototype.getLargestZIndex = function() {
  5555. var zIndexes = util.map(this.sibling, function(layer) {
  5556. return layer.zIndex;
  5557. });
  5558. return Math.max.apply(null, zIndexes);
  5559. };
  5560. /**
  5561. * Set focus to layer
  5562. */
  5563. FloatingLayer.prototype.focus = function() {
  5564. var zIndexForShow = this.getLargestZIndex() + 1;
  5565. this.container.style.zIndex = this.zIndex = zIndexForShow;
  5566. };
  5567. /**
  5568. * Show layer
  5569. */
  5570. FloatingLayer.prototype.show = function() {
  5571. this.focus();
  5572. this.container.style.display = 'block';
  5573. };
  5574. /**
  5575. * Hide layer
  5576. */
  5577. FloatingLayer.prototype.hide = function() {
  5578. this.container.style.display = 'none';
  5579. };
  5580. module.exports = FloatingLayer;
  5581. /***/ }),
  5582. /***/ "./src/js/common/intlUtil.js":
  5583. /*!***********************************!*\
  5584. !*** ./src/js/common/intlUtil.js ***!
  5585. \***********************************/
  5586. /*! no static exports found */
  5587. /***/ (function(module, exports, __webpack_require__) {
  5588. "use strict";
  5589. /* WEBPACK VAR INJECTION */(function(global) {
  5590. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  5591. var intlFormatter = {};
  5592. var intlUtil;
  5593. var typeToPos = {
  5594. year: 0,
  5595. month: 1,
  5596. day: 2,
  5597. hour: 3,
  5598. minute: 4,
  5599. second: 5
  5600. };
  5601. /**
  5602. * Extract date tokens (y, M, d, h, m, s) using the formatToParts() method.
  5603. * @param {Intl.DateTimeFormat} dtf - Intl.DateTimeFormat instance
  5604. * @param {Date} date - date object
  5605. * @returns {Array.<number>} An array of objects only containing the formatted date
  5606. */
  5607. function parseOffset(dtf, date) {
  5608. var formatted = dtf.formatToParts(date);
  5609. var filled = [];
  5610. var formattedLength = formatted.length;
  5611. var i, pos;
  5612. for (i = 0; i < formattedLength; i += 1) {
  5613. pos = typeToPos[formatted[i].type];
  5614. if (!util.isUndefined(pos)) {
  5615. filled[pos] = parseInt(formatted[i].value, 10);
  5616. }
  5617. }
  5618. return filled;
  5619. }
  5620. /**
  5621. * The time zone offset is calculated from the difference between the current time and the time in a specific time zone.
  5622. * @param {Array.<number>} parts - An array of objects only containing the formatted date (e.g. [2020, 12, 14, 10, 15, 19])
  5623. * @param {Date} date - date object
  5624. * @returns {number} offset
  5625. */
  5626. function calculateOffset(parts, date) {
  5627. var y = parts[0];
  5628. var M = parts[1];
  5629. var d = parts[2];
  5630. var h = parts[3];
  5631. var m = parts[4];
  5632. var s = parts[5];
  5633. var utc = new Date(Date.UTC(y, M - 1, d, h, m, s));
  5634. var offset = (utc - date) / 60 / 1000;
  5635. return Math.round(offset);
  5636. }
  5637. /**
  5638. * Check if browser supports Intl.DateTimeFormat.prototype.formatToParts API
  5639. * @returns {boolean} supported
  5640. */
  5641. function supportIntl() {
  5642. /**
  5643. * IE9 and IE10 do not support Intl.DateTimeFormat
  5644. * IE11 does not support IANA timezone names
  5645. * http://kangax.github.io/compat-table/esintl/#test-DateTimeFormat_accepts_IANA_timezone_names
  5646. */
  5647. return global.Intl && global.Intl.DateTimeFormat &&
  5648. util.isFunction(Intl.DateTimeFormat.prototype.formatToParts);
  5649. }
  5650. /**
  5651. * Return DateTimeFormat instance by timezone
  5652. * @param {string} timezoneName - timezone
  5653. * @returns {DateTimeFormat} Intl.DateTimeFormat instance
  5654. */
  5655. function getIntlFormatter(timezoneName) {
  5656. if (!intlFormatter[timezoneName]) {
  5657. intlFormatter[timezoneName] = new Intl.DateTimeFormat('en-US', {
  5658. hourCycle: 'h23',
  5659. year: 'numeric',
  5660. month: 'numeric',
  5661. day: 'numeric',
  5662. hour: 'numeric',
  5663. minute: 'numeric',
  5664. second: 'numeric',
  5665. timeZone: timezoneName
  5666. });
  5667. }
  5668. return intlFormatter[timezoneName];
  5669. }
  5670. /**
  5671. * Get offset of the time by timezone
  5672. * @param {string} timezoneName - recognize the time zone names of the IANA time zone database, such as 'Asia/Seoul', 'America/New_York'
  5673. * @param {number} timestamp - timestamp
  5674. * @returns {number} offset
  5675. */
  5676. function offsetCalculator(timezoneName, timestamp) {
  5677. var formatter = getIntlFormatter(timezoneName);
  5678. var date = new Date(timestamp);
  5679. return -calculateOffset(parseOffset(formatter, date), date);
  5680. }
  5681. intlUtil = {
  5682. supportIntl: supportIntl,
  5683. offsetCalculator: offsetCalculator
  5684. };
  5685. module.exports = intlUtil;
  5686. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  5687. /***/ }),
  5688. /***/ "./src/js/common/model.js":
  5689. /*!********************************!*\
  5690. !*** ./src/js/common/model.js ***!
  5691. \********************************/
  5692. /*! no static exports found */
  5693. /***/ (function(module, exports, __webpack_require__) {
  5694. "use strict";
  5695. /**
  5696. * @fileoverview Mixin module for models.
  5697. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  5698. */
  5699. var TZDate = __webpack_require__(/*! ../common/timezone */ "./src/js/common/timezone.js").Date;
  5700. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  5701. var spaceRx = /^\s*|\s*$/g,
  5702. model;
  5703. var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
  5704. /**
  5705. * Mixin module for models.
  5706. * @mixin
  5707. */
  5708. model = {
  5709. /**
  5710. * string trim
  5711. * @param {string} str string to trim
  5712. * @returns {string} trimed string
  5713. */
  5714. trim: function(str) {
  5715. return str.replace(spaceRx, '');
  5716. },
  5717. /**
  5718. * The collections of validator functions.
  5719. */
  5720. validators: {
  5721. /**
  5722. * check all of supplied fields(property) is not undefined or empty string.
  5723. * @param {object} instance model instance.
  5724. * @param {string[]} fields property names to check.
  5725. * @returns {boolean} return true when supplied fields are not undefined or empty string.
  5726. */
  5727. required: function(instance, fields) {
  5728. var valid = true,
  5729. isValid = function(obj) {
  5730. return !util.isUndefined(obj) && model.trim(obj) !== '';
  5731. };
  5732. util.forEach(fields, function(fieldName) {
  5733. valid = isValid(instance[fieldName]);
  5734. return valid;
  5735. });
  5736. return valid;
  5737. },
  5738. /**
  5739. * check supplied fields are valid dates and valid date ranges.
  5740. * @param {object} instance model instance.
  5741. * @param {Date[]} fields array of date range (start, end)
  5742. * @returns {boolean} is valid date range?
  5743. */
  5744. dateRange: function(instance, fields) {
  5745. var start, end;
  5746. if (!util.isExisty(instance) || fields.length !== 2) {
  5747. return true;
  5748. }
  5749. start = new TZDate(instance[fields[0]]);
  5750. end = new TZDate(instance[fields[1]]);
  5751. if (!datetime.isValid(start) || !datetime.isValid(end)) {
  5752. return false;
  5753. }
  5754. if (datetime.compare(start, end) === 1) {
  5755. return false;
  5756. }
  5757. return true;
  5758. }
  5759. },
  5760. /**
  5761. * Check validate for model instance.
  5762. *
  5763. * The validate are works on a basis of constructor's "schema" property.
  5764. *
  5765. * You can customize validators add some method to model#validators.
  5766. * @returns {Boolean} model is valid?
  5767. */
  5768. isValid: function() {
  5769. var self = this,
  5770. schema = this.constructor.schema,
  5771. validators = model.validators,
  5772. validator,
  5773. valid = true;
  5774. if (!schema) {
  5775. return true;
  5776. }
  5777. util.forEach(schema, function(values, validatorName) {
  5778. validator = validators[validatorName];
  5779. if (validator) {
  5780. valid = validator(self, values);
  5781. return valid; // returning false can stop this loop
  5782. }
  5783. return true;
  5784. });
  5785. return valid;
  5786. },
  5787. /**
  5788. * Make data object form instance.
  5789. *
  5790. * It return object fill with all owned properties but exclude functions.
  5791. * @returns {object} Data object
  5792. */
  5793. parameterize: function() {
  5794. var param = {},
  5795. isFunc = util.isFunction;
  5796. util.forEach(this, function(value, propName) {
  5797. if (!isFunc(value)) {
  5798. param[propName] = value;
  5799. }
  5800. });
  5801. return param;
  5802. },
  5803. /**
  5804. * Mixin model module to supplied target.
  5805. * @param {Object} target The object of want to mixed.
  5806. * @example
  5807. * function Man() {
  5808. * this.name = 'john';
  5809. * }
  5810. * model.mixin(Man.prototype);
  5811. */
  5812. mixin: function(target) {
  5813. util.forEach(model, function(method, name) {
  5814. if (name !== 'mixin') {
  5815. target[name] = method;
  5816. }
  5817. });
  5818. }
  5819. };
  5820. module.exports = model;
  5821. /***/ }),
  5822. /***/ "./src/js/common/point.js":
  5823. /*!********************************!*\
  5824. !*** ./src/js/common/point.js ***!
  5825. \********************************/
  5826. /*! no static exports found */
  5827. /***/ (function(module, exports, __webpack_require__) {
  5828. "use strict";
  5829. /**
  5830. * @fileoverview
  5831. * Class for represent two dimensional x, y coordinates.
  5832. *
  5833. * It suppliy a group of functions for manipulate coordinates.
  5834. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  5835. * @example
  5836. * var p = point(10, 10);
  5837. * var r1 = p.add(Point(5, 5));
  5838. * console.log(p.toString()) // "Point(10, 10)"
  5839. * console.log(r1.toString()) // "Point(15, 15)"
  5840. *
  5841. * var p2 = new Point(10, 10);
  5842. * p2._add(point(5, 5));
  5843. * console.log(p2.toString()) // "Point(15, 15)"
  5844. */
  5845. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  5846. /**
  5847. * Class for represent two dimentional x, y coordinates.
  5848. * @constructor
  5849. * @param {number} x The number of X coordinates.
  5850. * @param {number} y The number of Y coordinates.
  5851. * @param {boolean} [useRound=false] set true when each coordinates are rounded before initialize.
  5852. * @example
  5853. * var t = new Point(13, 5);
  5854. */
  5855. function Point(x, y, useRound) {
  5856. /**
  5857. * @type {number}
  5858. */
  5859. this.x = (useRound ? Math.round(x) : x);
  5860. /**
  5861. * @type {number}
  5862. */
  5863. this.y = (useRound ? Math.round(y) : y);
  5864. }
  5865. /**********
  5866. * static props
  5867. **********/
  5868. /**
  5869. * Calculate point ratio.
  5870. * @param {Point} point The instance of point.
  5871. * @param {number} factor From factor
  5872. * @param {number} toFactor To factor
  5873. * @returns {Point} Point instance calculated.
  5874. */
  5875. Point.getRatio = function(point, factor, toFactor) {
  5876. if (factor === toFactor) {
  5877. return point.clone();
  5878. }
  5879. return point.multiplyBy(toFactor)._divideBy(factor);
  5880. };
  5881. /**
  5882. * Syntatic sugar of new Point()
  5883. * @param {(Point|number|number[])} x X coordinate value.
  5884. * @param {(number|boolean)} [y] Y coordinate value or boolean value for coordinates round.
  5885. * @param {boolean} [useRound] Set true then round initial coordinate values.
  5886. * @returns {Point} The instance of point.
  5887. * @example
  5888. * var p1 = point(10, 15);
  5889. * var p2 = point([10, 15]);
  5890. */
  5891. Point.n = function(x, y, useRound) {
  5892. if (x instanceof Point) {
  5893. return x;
  5894. }
  5895. if (util.isArray(x)) {
  5896. return new Point(x[0], x[1], y);
  5897. }
  5898. return new Point(x, y, useRound);
  5899. };
  5900. /**********
  5901. * prototype props
  5902. **********/
  5903. /**
  5904. * Clone points
  5905. * @returns {Point} The point instance cloned.
  5906. */
  5907. Point.prototype.clone = function() {
  5908. return new Point(this.x, this.y);
  5909. };
  5910. /**
  5911. * Add points.
  5912. * @param {Point} point The point instance to add.
  5913. * @returns {Point} Point calculated.
  5914. */
  5915. Point.prototype.add = function(point) {
  5916. return this.clone()._add(Point.n(point));
  5917. };
  5918. /**
  5919. * Add self points.
  5920. * @param {Point} point The point instance to add.
  5921. * @returns {Point} Point calculated.
  5922. */
  5923. Point.prototype._add = function(point) {
  5924. this.x += point.x;
  5925. this.y += point.y;
  5926. return this;
  5927. };
  5928. /**
  5929. * Subtract points.
  5930. * @param {Point} point The point instance to subtract.
  5931. * @returns {Point} Point calculated.
  5932. */
  5933. Point.prototype.subtract = function(point) {
  5934. return this.clone()._subtract(Point.n(point));
  5935. };
  5936. /**
  5937. * Subtract points. (manipulate self)
  5938. * @param {Point} point The point instance to subtract.
  5939. * @returns {Point} Point calculated.
  5940. */
  5941. Point.prototype._subtract = function(point) {
  5942. this.x -= point.x;
  5943. this.y -= point.y;
  5944. return this;
  5945. };
  5946. /**
  5947. * Divide points.
  5948. * @param {number} num The number to divide.
  5949. * @returns {Point} Point calculated.
  5950. */
  5951. Point.prototype.divideBy = function(num) {
  5952. return this.clone()._divideBy(num);
  5953. };
  5954. /**
  5955. * Divide points. (manipulate self)
  5956. * @param {number} num The number to divide.
  5957. * @returns {Point} Point calculated.
  5958. */
  5959. Point.prototype._divideBy = function(num) {
  5960. this.x /= num;
  5961. this.y /= num;
  5962. return this;
  5963. };
  5964. /**
  5965. * Multiply coordinates.
  5966. * @param {number} num Thyen number to multiply
  5967. * @returns {Point} Point calculated.
  5968. */
  5969. Point.prototype.multiplyBy = function(num) {
  5970. return this.clone()._multiplyBy(num);
  5971. };
  5972. /**
  5973. * Multiply self coordinates.
  5974. * @param {number} num The number to multiply.
  5975. * @returns {Point} Point calculated.
  5976. */
  5977. Point.prototype._multiplyBy = function(num) {
  5978. this.x *= num;
  5979. this.y *= num;
  5980. return this;
  5981. };
  5982. /**
  5983. * Round coordinates.
  5984. * @returns {Point} Point calculated.
  5985. */
  5986. Point.prototype.round = function() {
  5987. return this.clone()._round();
  5988. };
  5989. /**
  5990. * Round self coordinates.
  5991. * @returns {Point} Point calculated.
  5992. */
  5993. Point.prototype._round = function() {
  5994. this.x = Math.round(this.x);
  5995. this.y = Math.round(this.y);
  5996. return this;
  5997. };
  5998. /**
  5999. * Reverse values between positive and negative.
  6000. * @returns {Point} Point calculated.
  6001. */
  6002. Point.prototype.reverse = function() {
  6003. return this.clone()._reverse();
  6004. };
  6005. /**
  6006. * Reverse self values between positive and negative.
  6007. * @returns {Point} Point calculated.
  6008. */
  6009. Point.prototype._reverse = function() {
  6010. this.x *= -1;
  6011. this.y *= -1;
  6012. return this;
  6013. };
  6014. /**
  6015. * Floor coordinates.
  6016. * @returns {Point} Point calculated.
  6017. */
  6018. Point.prototype.floor = function() {
  6019. return this.clone()._floor();
  6020. };
  6021. /**
  6022. * Floor self coordinates.
  6023. * @returns {Point} Point calculated.
  6024. */
  6025. Point.prototype._floor = function() {
  6026. this.x = Math.floor(this.x);
  6027. this.y = Math.floor(this.y);
  6028. return this;
  6029. };
  6030. /**
  6031. * Ceil coordinates.
  6032. * @returns {Point} Point calculated.
  6033. */
  6034. Point.prototype.ceil = function() {
  6035. return this.clone()._ceil();
  6036. };
  6037. /**
  6038. * Ceil self coodinates.
  6039. * @returns {Point} Point calculated.
  6040. */
  6041. Point.prototype._ceil = function() {
  6042. this.x = Math.ceil(this.x);
  6043. this.y = Math.ceil(this.y);
  6044. return this;
  6045. };
  6046. /**
  6047. * Rotate point.
  6048. * @param {number} deg The number of rotate degree.
  6049. * @param {Point} [center=this] Center point instance to use rotate center. use own when not supplied.
  6050. * @param {number} [cos] Cosine values for rotate. it useful when multi point rotate.
  6051. * @param {number} [sin] Sine values for rotate. it useful when multi point rotate.
  6052. * @returns {Point} The point instance rotated.
  6053. */
  6054. Point.prototype.rotate = function(deg, center, cos, sin) {
  6055. return this.clone()._rotate(deg, center, cos, sin);
  6056. };
  6057. /**
  6058. * Rotate self.
  6059. * @param {number} deg The number of rotate degree.
  6060. * @param {Point} [center=this] Center point instance to use rotate center. use own when not supplied.
  6061. * @param {number} [cos] Cosine values for rotate. it useful when multi point rotate.
  6062. * @param {number} [sin] Sine values for rotate. it useful when multi point rotate.
  6063. * @returns {Point} The point instance rotated.
  6064. */
  6065. Point.prototype._rotate = function(deg, center, cos, sin) {
  6066. var rad = deg * (Math.PI / 180),
  6067. x,
  6068. y;
  6069. cos = cos || parseFloat(Math.cos(rad).toFixed(8));
  6070. sin = sin || parseFloat(Math.sin(rad).toFixed(8));
  6071. this._subtract(center);
  6072. x = this.x;
  6073. y = this.y;
  6074. this.x = (x * cos) - (y * sin);
  6075. this.y = (x * sin) + (y * cos);
  6076. this._add(center);
  6077. return this;
  6078. };
  6079. /**
  6080. * Calculate distance between two points.
  6081. * @param {Point} point Point instance.
  6082. * @returns {number} The number of distance between two points.
  6083. */
  6084. Point.prototype.distanceTo = function(point) {
  6085. var x,
  6086. y;
  6087. point = Point.n(point);
  6088. x = point.x - this.x;
  6089. y = point.y - this.y;
  6090. return Math.sqrt((x * x) + (y * y));
  6091. };
  6092. /**
  6093. * Check point equals.
  6094. * @param {Point} point Point instance to compare
  6095. * @returns {boolean} equality
  6096. */
  6097. Point.prototype.equals = function(point) {
  6098. point = Point.n(point);
  6099. return point.x === this.x && point.y === this.y;
  6100. };
  6101. /**
  6102. * Return formatted string. 'Point(x, y)'
  6103. * @returns {string} string
  6104. */
  6105. Point.prototype.toString = function() {
  6106. return 'Point(' + this.x + ', ' + this.y + ')';
  6107. };
  6108. /**
  6109. * Return coodinates to array. [x, y]
  6110. * @returns {number[]} coordinate array.
  6111. */
  6112. Point.prototype.toArray = function() {
  6113. return [this.x, this.y];
  6114. };
  6115. module.exports = Point;
  6116. /***/ }),
  6117. /***/ "./src/js/common/reqAnimFrame.js":
  6118. /*!***************************************!*\
  6119. !*** ./src/js/common/reqAnimFrame.js ***!
  6120. \***************************************/
  6121. /*! no static exports found */
  6122. /***/ (function(module, exports, __webpack_require__) {
  6123. "use strict";
  6124. /* WEBPACK VAR INJECTION */(function(global) {/**
  6125. * @fileoverview RequestAnimFrame
  6126. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  6127. */
  6128. var requestFn,
  6129. cancelFn;
  6130. /**
  6131. * Get name with vendor prefix
  6132. * @param {string} name - name to prepend prefix
  6133. * @returns {string} vendor prefixed name
  6134. */
  6135. function getPrefixed(name) {
  6136. return global['webkit' + name] || global['moz' + name] || global['ms' + name];
  6137. }
  6138. requestFn = global.requestAnimationFrame ||
  6139. getPrefixed('RequestAnimationFrame') ||
  6140. function(fn, context) {
  6141. fn.call(context);
  6142. };
  6143. cancelFn = global.cancelAnimationFrame ||
  6144. getPrefixed('CancelAnimationFrame') ||
  6145. getPrefixed('CancelRequestAnimationFrame') ||
  6146. function() {};
  6147. /**
  6148. * @module module:reqAnimFrame
  6149. */
  6150. module.exports = {
  6151. /**
  6152. * Shim of requestAnimationFrame
  6153. * @param {function} fn callback function
  6154. * @param {*} context context for callback
  6155. * @returns {number} Unique id
  6156. */
  6157. requestAnimFrame: function(fn, context) {
  6158. return requestFn.call(global, fn.bind(context));
  6159. },
  6160. /**
  6161. * Shim of cancelAnimationFrame
  6162. * @param {number} id requestAnimationFrame id
  6163. */
  6164. cancelAnimFrame: function(id) {
  6165. if (!id) {
  6166. return;
  6167. }
  6168. cancelFn.call(global, id);
  6169. }
  6170. };
  6171. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  6172. /***/ }),
  6173. /***/ "./src/js/common/timezone.js":
  6174. /*!***********************************!*\
  6175. !*** ./src/js/common/timezone.js ***!
  6176. \***********************************/
  6177. /*! no static exports found */
  6178. /***/ (function(module, exports, __webpack_require__) {
  6179. "use strict";
  6180. /**
  6181. * @fileoverview timezone
  6182. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  6183. */
  6184. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  6185. var intlUtil = __webpack_require__(/*! ./intlUtil */ "./src/js/common/intlUtil.js");
  6186. var MIN_TO_MS = 60 * 1000;
  6187. var nativeOffsetMs = getTimezoneOffset();
  6188. var customOffsetMs = nativeOffsetMs;
  6189. var timezoneOffsetCallback = null;
  6190. var setByTimezoneOption = false;
  6191. var offsetCalculator = null;
  6192. var primaryOffset, primaryTimezoneName;
  6193. var getterMethods = [
  6194. 'getDate',
  6195. 'getDay',
  6196. 'getFullYear',
  6197. 'getHours',
  6198. 'getMilliseconds',
  6199. 'getMinutes',
  6200. 'getMonth',
  6201. 'getSeconds'
  6202. ];
  6203. var setterMethods = [
  6204. 'setDate',
  6205. 'setFullYear',
  6206. 'setHours',
  6207. 'setMilliseconds',
  6208. 'setMinutes',
  6209. 'setMonth',
  6210. 'setSeconds'
  6211. ];
  6212. var STANDARD_TO_DST = 1;
  6213. var DST_TO_STANDARD = -1;
  6214. /**
  6215. * Get the timezone offset by timestampe
  6216. * @param {number} timestamp - timestamp
  6217. * @returns {number} timezone offset
  6218. * @private
  6219. */
  6220. function getTimezoneOffset(timestamp) {
  6221. timestamp = !util.isUndefined(timestamp) ? timestamp : Date.now();
  6222. return new Date(timestamp).getTimezoneOffset() * MIN_TO_MS;
  6223. }
  6224. /**
  6225. * Get the custome timezone offset by timestampe
  6226. * @param {number} timestamp - timestamp
  6227. * @returns {number} timezone offset
  6228. * @private
  6229. */
  6230. function getCustomTimezoneOffset(timestamp) {
  6231. if (!setByTimezoneOption && timezoneOffsetCallback) {
  6232. return timezoneOffsetCallback(timestamp) * MIN_TO_MS;
  6233. }
  6234. return customOffsetMs;
  6235. }
  6236. /**
  6237. * Convert to local time
  6238. * @param {number} time - time
  6239. * @returns {number} local time
  6240. */
  6241. function getLocalTime(time) {
  6242. var customTimezoneOffset, localTime;
  6243. if (!setByTimezoneOption) {
  6244. return time;
  6245. }
  6246. customTimezoneOffset = getCustomTimezoneOffset(time);
  6247. localTime = time - customTimezoneOffset + nativeOffsetMs;
  6248. return localTime;
  6249. }
  6250. /**
  6251. * Create a Date instance with multiple arguments
  6252. * @param {Array} args - arguments
  6253. * @returns {Date}
  6254. * @private
  6255. */
  6256. function createDateWithMultipleArgs(args) {
  6257. var utc = Date.UTC.apply(null, args);
  6258. return new Date(utc + getTimezoneOffset(utc));
  6259. }
  6260. /**
  6261. * To convert a Date to TZDate as it is.
  6262. * @param {TZDate|number|null} arg - date
  6263. * @returns {Date}
  6264. */
  6265. function createDateWithUTCTime(arg) {
  6266. var time;
  6267. if (arg instanceof TZDate) {
  6268. time = arg.getUTCTime();
  6269. } else if (typeof arg === 'number') {
  6270. time = arg;
  6271. } else if (arg === null) {
  6272. time = 0;
  6273. } else {
  6274. throw new Error('Invalid Type');
  6275. }
  6276. return new Date(time);
  6277. }
  6278. /**
  6279. * Convert time to local time. Those times are only from API and not from inner source code.
  6280. * @param {Date|string} arg - date
  6281. * @returns {Date}
  6282. */
  6283. function createDateAsLocalTime(arg) {
  6284. var time;
  6285. if (arg instanceof Date) {
  6286. time = arg.getTime();
  6287. } else if (typeof arg === 'string') {
  6288. time = Date.parse(arg);
  6289. } else {
  6290. throw new Error('Invalid Type');
  6291. }
  6292. time = getLocalTime(time);
  6293. return new Date(time);
  6294. }
  6295. /**
  6296. * is it for local time? These type can be used from Calendar API.
  6297. * @param {Date|string} arg - date
  6298. * @returns {boolean}
  6299. */
  6300. function useLocalTimeConverter(arg) {
  6301. return arg instanceof Date || typeof arg === 'string';
  6302. }
  6303. /**
  6304. * Timezone Date Class
  6305. * @param {number|TZDate|Date|string} date - date to be converted
  6306. * @constructor
  6307. */
  6308. function TZDate(date) {
  6309. var nativeDate;
  6310. if (util.isUndefined(date)) {
  6311. date = Date.now();
  6312. }
  6313. if (arguments.length > 1) {
  6314. nativeDate = createDateWithMultipleArgs(arguments);
  6315. } else if (useLocalTimeConverter(date)) {
  6316. nativeDate = createDateAsLocalTime(date);
  6317. } else {
  6318. nativeDate = createDateWithUTCTime(date);
  6319. }
  6320. this._date = nativeDate;
  6321. }
  6322. /**
  6323. * Get milliseconds which is converted by timezone
  6324. * @returns {number} milliseconds
  6325. */
  6326. TZDate.prototype.getTime = function() {
  6327. var time = this._date.getTime();
  6328. return time + getCustomTimezoneOffset(time) - getTimezoneOffset(time);
  6329. };
  6330. /**
  6331. * Get UTC milliseconds
  6332. * @returns {number} milliseconds
  6333. */
  6334. TZDate.prototype.getUTCTime = function() {
  6335. return this._date.getTime();
  6336. };
  6337. /**
  6338. * toUTCString
  6339. * @returns {string}
  6340. */
  6341. TZDate.prototype.toUTCString = function() {
  6342. return this._date.toUTCString();
  6343. };
  6344. /**
  6345. * to Date
  6346. * @returns {Date}
  6347. */
  6348. TZDate.prototype.toDate = function() {
  6349. return this._date;
  6350. };
  6351. TZDate.prototype.valueOf = function() {
  6352. return this.getTime();
  6353. };
  6354. TZDate.prototype.addDate = function(day) {
  6355. this.setDate(this.getDate() + day);
  6356. return this;
  6357. };
  6358. TZDate.prototype.addMinutes = function(minutes) {
  6359. this.setMinutes(this.getMinutes() + minutes);
  6360. return this;
  6361. };
  6362. TZDate.prototype.addMilliseconds = function(milliseconds) {
  6363. this.setMilliseconds(this.getMilliseconds() + milliseconds);
  6364. return this;
  6365. };
  6366. /* eslint-disable max-params*/
  6367. TZDate.prototype.setWithRaw = function(y, M, d, h, m, s, ms) {
  6368. this.setFullYear(y, M, d);
  6369. this.setHours(h, m, s, ms);
  6370. return this;
  6371. };
  6372. /**
  6373. * @returns {TZDate} local time
  6374. */
  6375. TZDate.prototype.toLocalTime = function() {
  6376. var time = this.getTime();
  6377. var utcTime = this.getUTCTime();
  6378. var diff = time - utcTime;
  6379. return new TZDate(utcTime - diff);
  6380. };
  6381. getterMethods.forEach(function(methodName) {
  6382. TZDate.prototype[methodName] = function() {
  6383. return this._date[methodName].apply(this._date, arguments);
  6384. };
  6385. });
  6386. setterMethods.forEach(function(methodName) {
  6387. TZDate.prototype[methodName] = function() {
  6388. this._date[methodName].apply(this._date, arguments);
  6389. return this.getTime();
  6390. };
  6391. });
  6392. /**
  6393. * Set offset
  6394. * @param {number} offset - timezone offset based on minutes
  6395. */
  6396. function setOffset(offset) {
  6397. customOffsetMs = offset * MIN_TO_MS;
  6398. }
  6399. /**
  6400. * Set primary offset
  6401. * @param {number} offset - offset
  6402. */
  6403. function setPrimaryOffset(offset) {
  6404. primaryOffset = offset;
  6405. setOffset(offset);
  6406. }
  6407. /**
  6408. * Return primary offset
  6409. * @returns {number} offset
  6410. */
  6411. function getPrimaryOffset() {
  6412. return util.isNumber(primaryOffset) ? primaryOffset : new Date().getTimezoneOffset();
  6413. }
  6414. /**
  6415. * Set primary timezone name
  6416. * @param {string} timezoneName - timezone name (time zone names of the IANA time zone database, such as 'Asia/Seoul', 'America/New_York')
  6417. */
  6418. function setPrimaryTimezoneCode(timezoneName) {
  6419. primaryTimezoneName = timezoneName;
  6420. }
  6421. /**
  6422. * Get offset by timezoneName
  6423. * @param {string} timezoneName - timezone name (time zone names of the IANA time zone database, such as 'Asia/Seoul', 'America/New_York')
  6424. * @param {number} timestamp - timestamp
  6425. * @returns {number} timezone offset
  6426. */
  6427. function getOffsetByTimezoneName(timezoneName, timestamp) {
  6428. var offset = getPrimaryOffset();
  6429. var calculator;
  6430. if (!timezoneName) {
  6431. return offset;
  6432. }
  6433. calculator = getOffsetCalculator(timezoneName);
  6434. return calculator ? calculator(timezoneName, timestamp) : offset;
  6435. }
  6436. /**
  6437. * Set a calculator function to get timezone offset by timestamp
  6438. * @param {function} calculator - offset calculator
  6439. */
  6440. function setOffsetCalculator(calculator) {
  6441. offsetCalculator = calculator;
  6442. }
  6443. /**
  6444. * Return a function to calculate timezone offset by timestamp
  6445. * @param {string} timezoneName - timezone name
  6446. * @returns {function | null} offset calculator
  6447. */
  6448. function getOffsetCalculator(timezoneName) {
  6449. if (util.isFunction(offsetCalculator)) {
  6450. return offsetCalculator;
  6451. }
  6452. if (intlUtil.supportIntl(timezoneName)) {
  6453. return intlUtil.offsetCalculator;
  6454. }
  6455. return null;
  6456. }
  6457. /**
  6458. * Set timezone and offset by timezone option
  6459. * @param {Timezone} timezoneObj - {@link Timezone}
  6460. */
  6461. function setPrimaryTimezoneByOption(timezoneObj) {
  6462. var timezoneName, offset;
  6463. if (!(timezoneObj && timezoneObj.timezoneName)) {
  6464. return;
  6465. }
  6466. timezoneName = timezoneObj.timezoneName;
  6467. setByTimezoneOption = true;
  6468. setPrimaryTimezoneCode(timezoneName);
  6469. offset = getOffsetByTimezoneName(timezoneName, Date.now());
  6470. if (offset === nativeOffsetMs / MIN_TO_MS) {
  6471. setByTimezoneOption = false;
  6472. }
  6473. setPrimaryOffset(offset);
  6474. }
  6475. /**
  6476. * Get primary timezone name
  6477. * @returns {string} primary timezone name (time zone names of the IANA time zone database, such as 'Asia/Seoul', 'America/New_York')
  6478. */
  6479. function getPrimaryTimezoneName() {
  6480. return primaryTimezoneName;
  6481. }
  6482. /**
  6483. * Compare the start and end times to see if the time zone is changing.
  6484. * @param {number} startTime - start timestamp
  6485. * @param {number} endTime - end timestamp
  6486. * @returns {object} whether to change the offset and offset difference value
  6487. */
  6488. function isDifferentOffsetStartAndEndTime(startTime, endTime) {
  6489. var offset1 = getOffsetByTimezoneName(primaryTimezoneName, startTime);
  6490. var offset2 = getOffsetByTimezoneName(primaryTimezoneName, endTime);
  6491. var result = 0;
  6492. if (offset1 > offset2) {
  6493. result = STANDARD_TO_DST;
  6494. } else if (offset1 < offset2) {
  6495. result = DST_TO_STANDARD;
  6496. }
  6497. return {
  6498. isOffsetChanged: result,
  6499. offsetDiff: offset1 - offset2
  6500. };
  6501. }
  6502. module.exports = {
  6503. Date: TZDate,
  6504. setOffset: setOffset,
  6505. /**
  6506. * Set offset
  6507. * @param {number} offset - timezone offset based on minutes
  6508. */
  6509. setOffsetByTimezoneOption: function(offset) {
  6510. this.setOffset(-offset);
  6511. primaryOffset = -offset;
  6512. setByTimezoneOption = true;
  6513. },
  6514. /**
  6515. * Get offset in case of `setByTimezoneOption`. Or return 0.
  6516. * @returns {number} timezone offset offset minutes
  6517. */
  6518. getOffset: function() {
  6519. if (setByTimezoneOption) {
  6520. return customOffsetMs / MIN_TO_MS;
  6521. }
  6522. return 0;
  6523. },
  6524. /**
  6525. * Set a callback function to get timezone offset by timestamp
  6526. * @param {function} callback - callback function
  6527. */
  6528. setOffsetCallback: function(callback) {
  6529. timezoneOffsetCallback = callback;
  6530. },
  6531. /**
  6532. * (Use this method only for testing)
  6533. * Reset system timezone and custom timezone
  6534. */
  6535. restoreOffset: function() {
  6536. customOffsetMs = getTimezoneOffset();
  6537. },
  6538. getNativeOffsetMs: function() {
  6539. return nativeOffsetMs;
  6540. },
  6541. /**
  6542. * Check to use custom timezone option
  6543. * @returns {boolean} use custom timezone option
  6544. */
  6545. hasPrimaryTimezoneCustomSetting: function() {
  6546. return setByTimezoneOption;
  6547. },
  6548. resetCustomSetting: function() {
  6549. setByTimezoneOption = false;
  6550. },
  6551. setOffsetCalculator: setOffsetCalculator,
  6552. setPrimaryTimezoneByOption: setPrimaryTimezoneByOption,
  6553. getPrimaryOffset: getPrimaryOffset,
  6554. getOffsetByTimezoneName: getOffsetByTimezoneName,
  6555. getPrimaryTimezoneName: getPrimaryTimezoneName,
  6556. isNativeOsUsingDSTTimezone: function() {
  6557. var year = new Date().getFullYear();
  6558. var jan = new Date(year, 0, 1).getTimezoneOffset();
  6559. var jul = new Date(year, 6, 1).getTimezoneOffset();
  6560. return jan !== jul;
  6561. },
  6562. isPrimaryUsingDSTTimezone: function() {
  6563. var year = new Date().getFullYear();
  6564. var jan = new Date(year, 0, 1);
  6565. var jul = new Date(year, 6, 1);
  6566. return (
  6567. getOffsetByTimezoneName(primaryTimezoneName, jan) !==
  6568. getOffsetByTimezoneName(primaryTimezoneName, jul)
  6569. );
  6570. },
  6571. isDifferentOffsetStartAndEndTime: isDifferentOffsetStartAndEndTime,
  6572. setPrimaryTimezoneCode: setPrimaryTimezoneCode
  6573. };
  6574. /***/ }),
  6575. /***/ "./src/js/common/vlayout.js":
  6576. /*!**********************************!*\
  6577. !*** ./src/js/common/vlayout.js ***!
  6578. \**********************************/
  6579. /*! no static exports found */
  6580. /***/ (function(module, exports, __webpack_require__) {
  6581. "use strict";
  6582. /**
  6583. * @fileoverview Layout module that supplied split height, resize height features.
  6584. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  6585. */
  6586. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  6587. var config = __webpack_require__(/*! ../config */ "./src/js/config.js"),
  6588. common = __webpack_require__(/*! ./common */ "./src/js/common/common.js"),
  6589. domutil = __webpack_require__(/*! ./domutil */ "./src/js/common/domutil.js"),
  6590. domevent = __webpack_require__(/*! ./domevent */ "./src/js/common/domevent.js"),
  6591. View = __webpack_require__(/*! ../view/view */ "./src/js/view/view.js"),
  6592. VPanel = __webpack_require__(/*! ./vpanel */ "./src/js/common/vpanel.js"),
  6593. Drag = __webpack_require__(/*! ../handler/drag */ "./src/js/handler/drag.js");
  6594. var mAbs = Math.abs;
  6595. /**
  6596. * @typedef PanelOptions
  6597. * @type {object}
  6598. * @property {number} [minHeight=0] - minimum height of panel
  6599. * @property {number} [height=0] - current panel height
  6600. * @property {boolean} [splitter=false] - is this panel uses splitter?
  6601. * @property {boolean} [autoHeight=false] - is this panel uses remain height of container?
  6602. * @property {string} [className=''] - className string for add created element
  6603. */
  6604. /**
  6605. * @constructor
  6606. * @extends {View}
  6607. * @param {object} options - options for VLayout module
  6608. * @param {PanelOptions[]} [options.panels] - panels to add layout when initialize
  6609. * @param {number[]} [options.panelHeights] - panel height list
  6610. * @param {HTMLElement} container - container element
  6611. * @param {Theme} theme - theme instance
  6612. */
  6613. function VLayout(options, container, theme) {
  6614. var opt, tempHeights;
  6615. if (!(this instanceof VLayout)) {
  6616. return new VLayout(options, container);
  6617. }
  6618. View.call(this, container);
  6619. domutil.addClass(container, config.classname('vlayout-container'));
  6620. /**
  6621. * @type {object}
  6622. */
  6623. opt = this.options = util.extend({
  6624. panels: [],
  6625. panelHeights: []
  6626. }, options);
  6627. /**
  6628. * @type {VPanel[]}
  6629. */
  6630. this.panels = [];
  6631. /**
  6632. * @type {Drag}
  6633. */
  6634. this._drag = new Drag({
  6635. distance: 10,
  6636. exclude: function(target) {
  6637. return !domutil.hasClass(target, config.classname('splitter'));
  6638. }
  6639. }, container);
  6640. this._drag.on({
  6641. dragStart: this._onDragStart,
  6642. drag: this._onDrag,
  6643. dragEnd: this._onDragEnd
  6644. }, this);
  6645. /**
  6646. * @type {object}
  6647. */
  6648. this._dragData = null;
  6649. /**
  6650. * @type {Theme}
  6651. */
  6652. this.theme = theme;
  6653. if (opt.panels.length) {
  6654. if (opt.panelHeights.length) {
  6655. tempHeights = opt.panelHeights.slice();
  6656. util.forEach(opt.panels, function(panelOpt) {
  6657. if (!panelOpt.isSplitter && !panelOpt.autoHeight) {
  6658. panelOpt.height = tempHeights.shift();
  6659. }
  6660. });
  6661. }
  6662. this.addPanels(opt.panels, this.container);
  6663. }
  6664. this.refresh();
  6665. }
  6666. util.inherit(VLayout, View);
  6667. /**
  6668. * Get current panels height in layout
  6669. * @returns {number[]} height of panels with `autoHeight` false
  6670. */
  6671. VLayout.prototype.getLayoutData = function() {
  6672. var heightList = [];
  6673. util.forEach(this.panels, function(panel) {
  6674. if (panel.isSplitter() || panel.options.autoHeight) {
  6675. return;
  6676. }
  6677. heightList.push(panel.getHeight());
  6678. });
  6679. return heightList;
  6680. };
  6681. /**
  6682. * Set panels height in layout
  6683. * @param {number[]} heightList of panels with `autoHeight` false
  6684. */
  6685. VLayout.prototype.setLayoutData = function(heightList) {
  6686. if (!heightList.length) {
  6687. return;
  6688. }
  6689. util.forEach(this.panels, function(panel) {
  6690. if (panel.isSplitter() || panel.options.autoHeight) {
  6691. return;
  6692. }
  6693. panel.setHeight(null, heightList.shift());
  6694. });
  6695. this.refresh();
  6696. };
  6697. /**
  6698. * Get next panel instance by specific panel
  6699. * @param {VPanel} panel - panel instance
  6700. * @returns {VPanel} next panel
  6701. */
  6702. VLayout.prototype.nextPanel = function(panel) {
  6703. return this.panels[panel.index + 1];
  6704. };
  6705. /**
  6706. * Get previous panel instance by specific panel
  6707. * @param {VPanel} panel - panel instance
  6708. * @returns {VPanel} previous panel
  6709. */
  6710. VLayout.prototype.prevPanel = function(panel) {
  6711. return this.panels[panel.index - 1];
  6712. };
  6713. /**
  6714. * Initialize resizing guide element
  6715. * @param {HTMLElement} element - element to use guide element after cloned
  6716. * @param {number} top - top pixel value for guide element
  6717. * @returns {HTMLElement} cloned element == guide element
  6718. */
  6719. VLayout.prototype._initializeGuideElement = function(element, top) {
  6720. var cloned = element.cloneNode(true);
  6721. domutil.addClass(cloned, config.classname('splitter-guide'));
  6722. this._refreshGuideElement(cloned, top);
  6723. this.container.appendChild(cloned);
  6724. return cloned;
  6725. };
  6726. /**
  6727. * Refresh guide element position
  6728. * @param {HTMLElement} element - guide element
  6729. * @param {number} top - top pixel value for guide element
  6730. */
  6731. VLayout.prototype._refreshGuideElement = function(element, top) {
  6732. element.style.top = top + 'px';
  6733. };
  6734. /**
  6735. * Clear guide element position
  6736. * @param {HTMLElement} element - guide element
  6737. */
  6738. VLayout.prototype._clearGuideElement = function(element) {
  6739. domutil.remove(element);
  6740. };
  6741. /**
  6742. * Resize overall panels size
  6743. * @param {VPanel} splPanel - splitter panel instance
  6744. * @param {number} startY - dragstart Y position
  6745. * @param {number} mouseY - dragend Y position
  6746. */
  6747. VLayout.prototype._resize = function(splPanel, startY, mouseY) {
  6748. var diffY = startY - mouseY,
  6749. resizedHeight = mAbs(diffY),
  6750. resizeMap = [],
  6751. toDown = mouseY > startY,
  6752. backwardMethod = toDown ? 'prevPanel' : 'nextPanel',
  6753. forwardMethod = toDown ? 'nextPanel' : 'prevPanel',
  6754. cursor, resizeInfo;
  6755. cursor = this[backwardMethod](splPanel);
  6756. resizeInfo = cursor.getResizeInfoByGrowth(resizedHeight);
  6757. resizeMap.push([cursor, resizeInfo[0]]);
  6758. for (cursor = this[forwardMethod](cursor);
  6759. util.isExisty(cursor);
  6760. cursor = this[forwardMethod](cursor)) {
  6761. if (cursor.isSplitter()) {
  6762. continue;
  6763. }
  6764. resizeInfo = cursor.getResizeInfoByGrowth(-resizedHeight);
  6765. resizeMap.push([cursor, resizeInfo[0]]);
  6766. resizedHeight -= resizeInfo[1];
  6767. }
  6768. util.forEach(resizeMap, function(pair) {
  6769. pair[0].setHeight(null, pair[1], true);
  6770. pair[0].fire('resize');
  6771. });
  6772. };
  6773. /**
  6774. * Get summation of splitter and panel's minimum height upper and below of supplied splitter
  6775. * @param {VPanel} splPanel - splitter panel instance
  6776. * @returns {number[]} upper and below splitter's height and panel minimum height summation.
  6777. */
  6778. VLayout.prototype._getMouseYAdditionalLimit = function(splPanel) {
  6779. var upper = 0,
  6780. below = 0,
  6781. cursor,
  6782. func = function(panel) {
  6783. if (panel.isSplitter()) {
  6784. return panel.getHeight();
  6785. }
  6786. return panel.options.minHeight;
  6787. };
  6788. for (cursor = this.prevPanel(splPanel);
  6789. util.isExisty(cursor);
  6790. cursor = this.prevPanel(cursor)) {
  6791. upper += func(cursor);
  6792. }
  6793. for (cursor = this.nextPanel(splPanel);
  6794. util.isExisty(cursor);
  6795. cursor = this.nextPanel(cursor)) {
  6796. below += func(cursor);
  6797. }
  6798. return [upper, below];
  6799. };
  6800. /**********
  6801. * Drag Handlers
  6802. **********/
  6803. /**
  6804. * Drag start schedule handler
  6805. * @param {object} e - drag start schedule data
  6806. */
  6807. VLayout.prototype._onDragStart = function(e) {
  6808. var oEvent = e.originEvent,
  6809. target = e.target,
  6810. splIndex = domutil.getData(target, 'panelIndex'),
  6811. splPanel = this.panels[splIndex],
  6812. splHeight = splPanel.getHeight(),
  6813. splOffsetY = domevent.getMousePosition(oEvent, target)[1],
  6814. mouseY = domevent.getMousePosition(oEvent, this.container)[1],
  6815. guideElement = this._initializeGuideElement(target, mouseY);
  6816. splPanel.addClass(config.classname('splitter-focused'));
  6817. this._dragData = {
  6818. splPanel: splPanel,
  6819. splOffsetY: splOffsetY,
  6820. guideElement: guideElement,
  6821. startY: mouseY - splOffsetY,
  6822. minY: 0,
  6823. maxY: this.getViewBound().height - splHeight
  6824. };
  6825. if (!util.browser.msie) {
  6826. domutil.addClass(document.body, config.classname('resizing'));
  6827. }
  6828. };
  6829. /**
  6830. * Drag schedule handler
  6831. * @param {object} e - drag schedule data
  6832. */
  6833. VLayout.prototype._onDrag = function(e) {
  6834. var dragData = this._dragData,
  6835. mouseY = domevent.getMousePosition(e.originEvent, this.container)[1];
  6836. mouseY = common.limit(mouseY - dragData.splOffsetY, [dragData.minY], [dragData.maxY]);
  6837. this._refreshGuideElement(dragData.guideElement, mouseY);
  6838. };
  6839. /**
  6840. * Drag end schedule handler
  6841. * @fires VLayout#resize
  6842. * @param {object} e - dragend schedule data
  6843. */
  6844. VLayout.prototype._onDragEnd = function(e) {
  6845. var dragData = this._dragData,
  6846. asideMinMax = this._getMouseYAdditionalLimit(dragData.splPanel),
  6847. mouseY = domevent.getMousePosition(e.originEvent, this.container)[1];
  6848. // mouseY value can't exceed summation of splitter height and panel's minimum height based on target splitter.
  6849. mouseY = common.limit(
  6850. mouseY - dragData.splOffsetY,
  6851. [dragData.minY + asideMinMax[0]],
  6852. [dragData.maxY - asideMinMax[1]]
  6853. );
  6854. this._resize(dragData.splPanel, dragData.startY, mouseY);
  6855. /**
  6856. * @event VLayout#resize
  6857. * @type {object}
  6858. * @property {number[]} layoutData - layout data after resized
  6859. */
  6860. this.fire('resize', {
  6861. layoutData: this.getLayoutData()
  6862. });
  6863. this._dragData = null;
  6864. this._clearGuideElement(dragData.guideElement);
  6865. dragData.splPanel.removeClass(config.classname('splitter-focused'));
  6866. domutil.removeClass(document.body, config.classname('resizing'));
  6867. };
  6868. /**********
  6869. * Methods
  6870. **********/
  6871. /**
  6872. * refresh each panels
  6873. */
  6874. VLayout.prototype.refresh = function() {
  6875. var panelToFillHeight = [];
  6876. var layoutHeight = this.getViewBound().height;
  6877. var usedHeight = 0;
  6878. var remainHeight;
  6879. if (!layoutHeight) {
  6880. return;
  6881. }
  6882. util.forEach(this.panels, function(panel) {
  6883. if (panel.options.autoHeight) {
  6884. panelToFillHeight.push(panel);
  6885. } else {
  6886. usedHeight += panel.getHeight();
  6887. }
  6888. });
  6889. remainHeight = (layoutHeight - usedHeight) / panelToFillHeight.length;
  6890. util.forEach(panelToFillHeight, function(panel) {
  6891. panel.setHeight(null, remainHeight);
  6892. });
  6893. };
  6894. /**
  6895. * add panel
  6896. * @param {PanelOptions} options - options for panel
  6897. * @param {container} [container] - container element
  6898. */
  6899. VLayout.prototype.addPanel = function(options, container) {
  6900. var element = document.createElement('div'),
  6901. panels = this.panels,
  6902. index = panels.length;
  6903. options = util.extend({
  6904. index: index
  6905. }, options);
  6906. panels.push(new VPanel(options, element, this.theme));
  6907. container.appendChild(element);
  6908. };
  6909. /**
  6910. * Add multiple panel
  6911. * @param {PanelOptions[]} options - panel options list
  6912. * @param {HTMLElement} container - container element
  6913. */
  6914. VLayout.prototype.addPanels = function(options, container) {
  6915. var self = this,
  6916. frag = document.createDocumentFragment();
  6917. util.forEach(options, function(option) {
  6918. self.addPanel(option, frag);
  6919. });
  6920. container.appendChild(frag);
  6921. };
  6922. /**
  6923. * Get a panel by name
  6924. * @param {string} name - panel's name
  6925. * @returns {VPanel}
  6926. */
  6927. VLayout.prototype.getPanelByName = function(name) {
  6928. var found;
  6929. util.forEach(this.panels, function(panel) {
  6930. if (panel.name === name) {
  6931. found = panel;
  6932. }
  6933. });
  6934. return found;
  6935. };
  6936. module.exports = VLayout;
  6937. /***/ }),
  6938. /***/ "./src/js/common/vpanel.js":
  6939. /*!*********************************!*\
  6940. !*** ./src/js/common/vpanel.js ***!
  6941. \*********************************/
  6942. /*! no static exports found */
  6943. /***/ (function(module, exports, __webpack_require__) {
  6944. "use strict";
  6945. /**
  6946. * @fileoverview Panel class for VLayout module
  6947. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  6948. */
  6949. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  6950. var config = __webpack_require__(/*! ../config */ "./src/js/config.js"),
  6951. common = __webpack_require__(/*! ./common */ "./src/js/common/common.js"),
  6952. domutil = __webpack_require__(/*! ./domutil */ "./src/js/common/domutil.js"),
  6953. View = __webpack_require__(/*! ../view/view */ "./src/js/view/view.js");
  6954. /**
  6955. * @constructor
  6956. * @extends {View}
  6957. * @param {object} options - options for VPanel
  6958. * @param {number} options.index - index of panel in vlayout
  6959. * @param {number} [options.minHeight=0] - minimum height of panel
  6960. * @param {number} [options.height] - initial height of panel
  6961. * @param {boolean} [options.isSplitter=false] - set true then this panel works splitter
  6962. * @param {boolean} [options.autoHeight=false] - set true then this panel use remain height after other panel resized.
  6963. * @param {string} [options.className] - additional class name to add element
  6964. * @param {HTMLElement} container - container element
  6965. * @param {Theme} theme - theme instance
  6966. */
  6967. function VPanel(options, container, theme) {
  6968. View.call(this, container);
  6969. /**
  6970. * @type {object}
  6971. */
  6972. this.options = util.extend({
  6973. index: 0,
  6974. name: '0',
  6975. minHeight: 0,
  6976. maxHeight: null,
  6977. height: null,
  6978. isSplitter: false,
  6979. autoHeight: false,
  6980. className: ''
  6981. }, options);
  6982. /**
  6983. * @type {number}
  6984. */
  6985. this.index = this.options.index;
  6986. /**
  6987. * @type {string}
  6988. */
  6989. this.name = this.options.name || String(this.index);
  6990. this.isHeightForcedSet = false;
  6991. /**
  6992. * @type {Theme}
  6993. */
  6994. this.theme = theme;
  6995. this._initPanel(this.options, container);
  6996. }
  6997. util.inherit(VPanel, View);
  6998. /**
  6999. * whether this panel is splitter?
  7000. * @returns {boolean} panel is splitter?
  7001. */
  7002. VPanel.prototype.isSplitter = function() {
  7003. return this.options.isSplitter;
  7004. };
  7005. /**
  7006. * set max height of panel
  7007. * @param {number} maxHeight - maxHeight
  7008. */
  7009. VPanel.prototype.setMaxHeight = function(maxHeight) {
  7010. if (!this.options.autoHeight) {
  7011. this.options.maxHeight = maxHeight;
  7012. }
  7013. };
  7014. /**
  7015. * set forced height flag
  7016. * @param {boolean} set - enable or not
  7017. */
  7018. VPanel.prototype.setHeightForcedSet = function(set) {
  7019. this.isHeightForcedSet = set;
  7020. };
  7021. /**
  7022. * get forced height flag
  7023. * @returns {boolean} set - enable or not
  7024. */
  7025. VPanel.prototype.getHeightForcedSet = function() {
  7026. return this.isHeightForcedSet;
  7027. };
  7028. /**
  7029. * set height of html element
  7030. * @param {HTMLElement} [container] - container element
  7031. * @param {number} newHeight - height
  7032. * @param {boolean} force - whether ignore max-length
  7033. */
  7034. VPanel.prototype.setHeight = function(container, newHeight, force) {
  7035. var maxHeight = this.options.maxHeight;
  7036. var minHeight = this.options.minHeight;
  7037. var autoHeight = this.options.autoHeight;
  7038. container = container || this.container;
  7039. // 한번 force 호출이 일어난 이후에는 force 호출만 허용한다
  7040. if (!force && this.isHeightForcedSet && !autoHeight) {
  7041. return;
  7042. }
  7043. if (force) {
  7044. this.isHeightForcedSet = true;
  7045. } else if (maxHeight) {
  7046. newHeight = Math.min(newHeight, maxHeight);
  7047. }
  7048. newHeight = Math.max(minHeight, newHeight);
  7049. container.style.height = newHeight + 'px';
  7050. };
  7051. /**
  7052. * Calculate new height of panel and remains by supplied height growth
  7053. * @param {number} growth - growth value
  7054. * @returns {number[]} newHeight, remainHeight
  7055. */
  7056. VPanel.prototype.getResizeInfoByGrowth = function(growth) {
  7057. var height = this.getHeight(),
  7058. newHeight = height + growth,
  7059. resizeTo = Math.max(0, newHeight, this.options.minHeight);
  7060. return [resizeTo, height - resizeTo];
  7061. };
  7062. /**
  7063. * get outer height of panel element
  7064. * @returns {number} outer height of panel element
  7065. */
  7066. VPanel.prototype.getHeight = function() {
  7067. return domutil.getSize(this.container)[1];
  7068. };
  7069. /**
  7070. * add design class to panel element
  7071. * @param {string} className - classname string
  7072. */
  7073. VPanel.prototype.addClass = function(className) {
  7074. domutil.addClass(this.container, className);
  7075. };
  7076. /**
  7077. * remove design class to panel element
  7078. * @param {string} className - classname string
  7079. */
  7080. VPanel.prototype.removeClass = function(className) {
  7081. domutil.removeClass(this.container, className);
  7082. };
  7083. /**
  7084. * initialize panel element
  7085. * @param {PanelOptions} options - options for panel
  7086. * @param {HTMLDivElement} container - panel element
  7087. */
  7088. VPanel.prototype._initPanel = function(options, container) {
  7089. var height;
  7090. domutil.setData(container, 'panelIndex', options.index);
  7091. if (options.isSplitter) {
  7092. domutil.addClass(container, config.classname('splitter'));
  7093. this.applyTheme();
  7094. return;
  7095. }
  7096. if (options.className) {
  7097. domutil.addClass(container, options.className);
  7098. }
  7099. if (options.autoHeight) {
  7100. domutil.setData(container, 'autoHeight', true);
  7101. } else {
  7102. height = common.limit(options.height || 0,
  7103. [options.minHeight],
  7104. [options.maxHeight || options.height]
  7105. );
  7106. options.height = height;
  7107. this.setHeight(container, height);
  7108. }
  7109. };
  7110. VPanel.prototype.applyTheme = function() {
  7111. var style = this.container.style;
  7112. var theme = this.theme;
  7113. if (!theme) {
  7114. return;
  7115. }
  7116. style.borderTop = theme.week.vpanelSplitter.border || theme.common.border;
  7117. style.borderBottom = theme.week.vpanelSplitter.border || theme.common.border;
  7118. style.height = theme.week.vpanelSplitter.height;
  7119. };
  7120. module.exports = VPanel;
  7121. /***/ }),
  7122. /***/ "./src/js/config.js":
  7123. /*!**************************!*\
  7124. !*** ./src/js/config.js ***!
  7125. \**************************/
  7126. /*! no static exports found */
  7127. /***/ (function(module, exports, __webpack_require__) {
  7128. "use strict";
  7129. /**
  7130. * @fileoverview Global configuration object module. This @echo syntax will change preprocess context. See gulpfile.js
  7131. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  7132. */
  7133. var cssPrefix = 'tui-full-calendar-',
  7134. alldayGetViewID = new RegExp('^' + cssPrefix + 'weekday[\\s]tui-view-(\\d+)'),
  7135. alldayCheckPermission = new RegExp('^' + cssPrefix + 'schedule(-title)?$'),
  7136. timeGetViewID = new RegExp('^' + cssPrefix + 'time-date[\\s]tui-view-(\\d+)');
  7137. var config = {
  7138. throwError: function(msg) {
  7139. throw new Error(msg);
  7140. },
  7141. cssPrefix: cssPrefix,
  7142. classname: function(str) {
  7143. str = str || '';
  7144. if (str.charAt(0) === '.') {
  7145. return '.' + config.cssPrefix + str.slice(1);
  7146. }
  7147. return config.cssPrefix + str;
  7148. },
  7149. allday: {
  7150. getViewIDRegExp: alldayGetViewID,
  7151. checkCondRegExp: alldayCheckPermission
  7152. },
  7153. daygrid: {
  7154. getViewIDRegExp: alldayGetViewID,
  7155. checkCondRegExp: alldayCheckPermission
  7156. },
  7157. time: {
  7158. getViewIDRegExp: timeGetViewID
  7159. }
  7160. };
  7161. module.exports = config;
  7162. /***/ }),
  7163. /***/ "./src/js/controller/base.js":
  7164. /*!***********************************!*\
  7165. !*** ./src/js/controller/base.js ***!
  7166. \***********************************/
  7167. /*! no static exports found */
  7168. /***/ (function(module, exports, __webpack_require__) {
  7169. "use strict";
  7170. /**
  7171. * @fileoverview Base calendar controller
  7172. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  7173. */
  7174. var DOMPurify = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.js");
  7175. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  7176. var Schedule = __webpack_require__(/*! ../model/schedule */ "./src/js/model/schedule.js");
  7177. var ScheduleViewModel = __webpack_require__(/*! ../model/viewModel/scheduleViewModel */ "./src/js/model/viewModel/scheduleViewModel.js");
  7178. var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
  7179. var common = __webpack_require__(/*! ../common/common */ "./src/js/common/common.js");
  7180. var Theme = __webpack_require__(/*! ../theme/theme */ "./src/js/theme/theme.js");
  7181. var tz = __webpack_require__(/*! ../common/timezone */ "./src/js/common/timezone.js");
  7182. var TZDate = tz.Date;
  7183. var SCHEDULE_VULNERABLE_OPTIONS = ['title', 'body', 'location', 'state', 'category', 'dueDateClass'];
  7184. /**
  7185. * Sanitize option values having possible vulnerabilities
  7186. * @param {object} options options.
  7187. * @returns {object} sanitized options.
  7188. */
  7189. function sanitizeOptions(options) {
  7190. util.forEachArray(SCHEDULE_VULNERABLE_OPTIONS, function(prop) {
  7191. if (options[prop]) {
  7192. options[prop] = DOMPurify.sanitize(options[prop]);
  7193. }
  7194. });
  7195. return options;
  7196. }
  7197. /**
  7198. * Get range date by custom timezone or native timezone
  7199. * @param {Schedule} schedule The instance of schedule.
  7200. * @returns {RangeDate} start and end date
  7201. */
  7202. function getRangeDateByOffset(schedule) {
  7203. var scheduleStart = schedule.getStarts();
  7204. var scheduleEnd = schedule.getEnds();
  7205. var start = datetime.start(scheduleStart);
  7206. var equalStartEnd = datetime.compare(scheduleStart, scheduleEnd) === 0;
  7207. var endDate = equalStartEnd ? scheduleEnd : datetime.convertStartDayToLastDay(scheduleEnd);
  7208. var end = datetime.end(endDate);
  7209. var nativeOffsetMs = tz.getNativeOffsetMs();
  7210. var startOffset = scheduleStart.toDate().getTimezoneOffset();
  7211. var MIN_TO_MS = 60 * 1000;
  7212. var offsetDiffMs = 0;
  7213. var primaryTimezoneName = tz.getPrimaryTimezoneName();
  7214. var primaryOffset = tz.getPrimaryOffset();
  7215. var timezoneOffset = tz.getOffsetByTimezoneName(primaryTimezoneName, scheduleStart.getTime());
  7216. if (tz.isNativeOsUsingDSTTimezone() && nativeOffsetMs !== startOffset) {
  7217. // When using a custom time zone, the native time zone offset is fixed and rendered.
  7218. // So, The fixed and rendered time should be recalculated as the original time zone offset.
  7219. offsetDiffMs = (startOffset * MIN_TO_MS) - nativeOffsetMs;
  7220. }
  7221. if (tz.isPrimaryUsingDSTTimezone() && primaryOffset !== timezoneOffset) {
  7222. // The custom time zone is a time zone where two offsets including DST are applied.
  7223. // The first rendered schedule is calculated and drawn with the offset calculated at the access time(system OS local time).
  7224. // It should be recalculated with the original time zone offset.
  7225. offsetDiffMs = (primaryOffset - timezoneOffset) * MIN_TO_MS;
  7226. }
  7227. start = datetime.start(scheduleStart.getUTCTime() + offsetDiffMs);
  7228. end = datetime.end(
  7229. datetime.convertStartDayToLastDay(new TZDate(scheduleEnd.getUTCTime() + offsetDiffMs))
  7230. );
  7231. return {
  7232. start: start,
  7233. end: end
  7234. };
  7235. }
  7236. /**
  7237. * @constructor
  7238. * @param {object} options - options for base controller
  7239. * @param {function} [options.groupFunc] - function for group each models {@see Collection#groupBy}
  7240. * @param {themeConfig} [options.theme] - theme object
  7241. * @mixes util.CustomEvents
  7242. */
  7243. function Base(options) {
  7244. options = options || {};
  7245. /**
  7246. * function for group each schedule models.
  7247. * @type {function}
  7248. * @param {ScheduleViewModel} viewModel - view model instance
  7249. * @returns {string} group key
  7250. */
  7251. this.groupFunc =
  7252. options.groupFunc ||
  7253. function(viewModel) {
  7254. var model = viewModel.model;
  7255. if (viewModel.model.isAllDay) {
  7256. return 'allday';
  7257. }
  7258. if (
  7259. model.category === 'time' &&
  7260. model.end - model.start > datetime.MILLISECONDS_PER_DAY
  7261. ) {
  7262. return 'allday';
  7263. }
  7264. return model.category;
  7265. };
  7266. /**
  7267. * schedules collection.
  7268. * @type {Collection}
  7269. */
  7270. this.schedules = common.createScheduleCollection();
  7271. /**
  7272. * Matrix for multidate schedules.
  7273. * @type {object.<string, array>}
  7274. */
  7275. this.dateMatrix = {};
  7276. /**
  7277. * Theme
  7278. * @type {Theme}
  7279. */
  7280. this.theme = new Theme(options.theme);
  7281. /**
  7282. * Calendar list
  7283. * @type {Array.<Calendar>}
  7284. */
  7285. this.calendars = [];
  7286. }
  7287. /**
  7288. * Calculate contain dates in schedule.
  7289. * @private
  7290. * @param {Schedule} schedule The instance of schedule.
  7291. * @returns {array} contain dates.
  7292. */
  7293. Base.prototype._getContainDatesInSchedule = function(schedule) {
  7294. var scheduleStart = schedule.getStarts();
  7295. var scheduleEnd = schedule.getEnds();
  7296. var start = datetime.start(scheduleStart);
  7297. var equalStartEnd = datetime.compare(scheduleStart, scheduleEnd) === 0;
  7298. var endDate = equalStartEnd ? scheduleEnd : datetime.convertStartDayToLastDay(scheduleEnd);
  7299. var end = datetime.end(endDate);
  7300. var rangeDateByOffset;
  7301. if (tz.hasPrimaryTimezoneCustomSetting()) {
  7302. rangeDateByOffset = getRangeDateByOffset(schedule);
  7303. start = rangeDateByOffset.start;
  7304. end = rangeDateByOffset.end;
  7305. }
  7306. return datetime.range(start, end, datetime.MILLISECONDS_PER_DAY);
  7307. };
  7308. /****************
  7309. * CRUD Schedule
  7310. ****************/
  7311. /**
  7312. * Create a schedule instance from raw data.
  7313. * @emits Base#beforeCreateSchedule
  7314. * @emits Base#createdSchedule
  7315. * @param {object} options Data object to create schedule.
  7316. * @param {boolean} silent - set true then don't fire events.
  7317. * @returns {Schedule} The instance of Schedule that created.
  7318. */
  7319. Base.prototype.createSchedule = function(options, silent) {
  7320. var schedule,
  7321. scheduleData = {
  7322. data: sanitizeOptions(options)
  7323. };
  7324. /**
  7325. * @event Base#beforeCreateSchedule
  7326. * @type {Calendar~Schedule[]}
  7327. */
  7328. if (!this.invoke('beforeCreateSchedule', scheduleData)) {
  7329. return null;
  7330. }
  7331. schedule = this.addSchedule(Schedule.create(options));
  7332. if (!silent) {
  7333. /**
  7334. * @event Base#createdSchedule
  7335. * @type {Schedule}
  7336. */
  7337. this.fire('createdSchedule', schedule);
  7338. }
  7339. return schedule;
  7340. };
  7341. /**
  7342. * @emits Base#beforeCreateSchedule
  7343. * @emits Base#createdSchedule
  7344. * @param {Calendar~Schedule[]} dataList - dataObject list to create schedule.
  7345. * @param {boolean} [silent=false] - set true then don't fire events.
  7346. * @returns {Schedule[]} The instance list of Schedule that created.
  7347. */
  7348. Base.prototype.createSchedules = function(dataList, silent) {
  7349. var self = this;
  7350. return util.map(dataList, function(data) {
  7351. return self.createSchedule(data, silent);
  7352. });
  7353. };
  7354. /**
  7355. * Update a schedule.
  7356. * @emits Base#updateSchedule
  7357. * @param {Schedule} schedule - schedule instance to update
  7358. * @param {object} options updated object data.
  7359. * @returns {Schedule} updated schedule instance
  7360. */
  7361. // eslint-disable-next-line complexity
  7362. Base.prototype.updateSchedule = function(schedule, options) {
  7363. var start = options.start || schedule.start;
  7364. var end = options.end || schedule.end;
  7365. options = options ? sanitizeOptions(options) : {};
  7366. if (['milestone', 'task', 'allday', 'time'].indexOf(options.category) > -1) {
  7367. schedule.set('category', options.category);
  7368. }
  7369. if (options.category === 'allday') {
  7370. options.isAllDay = true;
  7371. }
  7372. if (!util.isUndefined(options.isAllDay)) {
  7373. schedule.set('isAllDay', options.isAllDay);
  7374. }
  7375. if (!util.isUndefined(options.calendarId)) {
  7376. schedule.set('calendarId', options.calendarId);
  7377. }
  7378. if (options.title) {
  7379. schedule.set('title', options.title);
  7380. }
  7381. if (options.body) {
  7382. schedule.set('body', options.body);
  7383. }
  7384. if (options.start || options.end) {
  7385. if (schedule.isAllDay) {
  7386. schedule.setAllDayPeriod(start, end);
  7387. } else {
  7388. schedule.setTimePeriod(start, end);
  7389. }
  7390. }
  7391. if (options.color) {
  7392. schedule.set('color', options.color);
  7393. }
  7394. if (options.bgColor) {
  7395. schedule.set('bgColor', options.bgColor);
  7396. }
  7397. if (options.borderColor) {
  7398. schedule.set('borderColor', options.borderColor);
  7399. }
  7400. if (options.origin) {
  7401. schedule.set('origin', options.origin);
  7402. }
  7403. if (!util.isUndefined(options.isPending)) {
  7404. schedule.set('isPending', options.isPending);
  7405. }
  7406. if (!util.isUndefined(options.isFocused)) {
  7407. schedule.set('isFocused', options.isFocused);
  7408. }
  7409. if (!util.isUndefined(options.isReadOnly)) {
  7410. schedule.set('isReadOnly', options.isReadOnly);
  7411. }
  7412. if (options.location) {
  7413. schedule.set('location', options.location);
  7414. }
  7415. if (options.state) {
  7416. schedule.set('state', options.state);
  7417. }
  7418. if (options.raw) {
  7419. schedule.set('raw', options.raw);
  7420. }
  7421. if (options.attendees) {
  7422. schedule.set('attendees', options.attendees);
  7423. }
  7424. this._removeFromMatrix(schedule);
  7425. this._addToMatrix(schedule);
  7426. /**
  7427. * @event Base#updateSchedule
  7428. */
  7429. this.fire('updateSchedule');
  7430. return schedule;
  7431. };
  7432. /**
  7433. * Delete schedule instance from controller.
  7434. * @param {Schedule} schedule - schedule instance to delete
  7435. * @returns {Schedule} deleted model instance.
  7436. */
  7437. Base.prototype.deleteSchedule = function(schedule) {
  7438. this._removeFromMatrix(schedule);
  7439. this.schedules.remove(schedule);
  7440. return schedule;
  7441. };
  7442. /**
  7443. * Set date matrix to supplied schedule instance.
  7444. * @param {Schedule} schedule - instance of schedule.
  7445. */
  7446. Base.prototype._addToMatrix = function(schedule) {
  7447. var ownMatrix = this.dateMatrix;
  7448. var containDates = this._getContainDatesInSchedule(schedule);
  7449. util.forEach(containDates, function(date) {
  7450. var ymd = datetime.format(date, 'YYYYMMDD'),
  7451. matrix = (ownMatrix[ymd] = ownMatrix[ymd] || []);
  7452. matrix.push(util.stamp(schedule));
  7453. });
  7454. };
  7455. /**
  7456. * Remove schedule's id from matrix.
  7457. * @param {Schedule} schedule - instance of schedule
  7458. */
  7459. Base.prototype._removeFromMatrix = function(schedule) {
  7460. var modelID = util.stamp(schedule);
  7461. util.forEach(
  7462. this.dateMatrix,
  7463. function(matrix) {
  7464. var index = util.inArray(modelID, matrix);
  7465. if (~index) {
  7466. matrix.splice(index, 1);
  7467. }
  7468. },
  7469. this
  7470. );
  7471. };
  7472. /**
  7473. * Add a schedule instance.
  7474. * @emits Base#addedSchedule
  7475. * @param {Schedule} schedule The instance of Schedule.
  7476. * @param {boolean} silent - set true then don't fire events.
  7477. * @returns {Schedule} The instance of Schedule that added.
  7478. */
  7479. Base.prototype.addSchedule = function(schedule, silent) {
  7480. this.schedules.add(schedule);
  7481. this._addToMatrix(schedule);
  7482. if (!silent) {
  7483. /**
  7484. * @event Base#addedSchedule
  7485. * @type {object}
  7486. */
  7487. this.fire('addedSchedule', schedule);
  7488. }
  7489. return schedule;
  7490. };
  7491. /**
  7492. * split schedule model by ymd.
  7493. * @param {Date} start - start date
  7494. * @param {Date} end - end date
  7495. * @param {Collection} scheduleCollection - collection of schedule model.
  7496. * @returns {object.<string, Collection>} splitted schedule model collections.
  7497. */
  7498. Base.prototype.splitScheduleByDateRange = function(start, end, scheduleCollection) {
  7499. var range = datetime.range(
  7500. datetime.start(start),
  7501. datetime.end(end),
  7502. datetime.MILLISECONDS_PER_DAY
  7503. ),
  7504. ownMatrix = this.dateMatrix,
  7505. result = {};
  7506. util.forEachArray(range, function(date) {
  7507. var ymd = datetime.format(date, 'YYYYMMDD'),
  7508. matrix = ownMatrix[ymd],
  7509. collection;
  7510. collection = result[ymd] = common.createScheduleCollection();
  7511. if (matrix && matrix.length) {
  7512. util.forEachArray(matrix, function(id) {
  7513. scheduleCollection.doWhenHas(id, function(schedule) {
  7514. collection.add(schedule);
  7515. });
  7516. });
  7517. }
  7518. });
  7519. return result;
  7520. };
  7521. /**
  7522. * Return schedules in supplied date range.
  7523. *
  7524. * available only YMD.
  7525. * @param {TZDate} start start date.
  7526. * @param {TZDate} end end date.
  7527. * @returns {object.<string, Collection>} schedule collection grouped by dates.
  7528. */
  7529. Base.prototype.findByDateRange = function(start, end) {
  7530. var range = datetime.range(
  7531. datetime.start(start),
  7532. datetime.end(end),
  7533. datetime.MILLISECONDS_PER_DAY
  7534. ),
  7535. ownSchedules = this.schedules.items,
  7536. ownMatrix = this.dateMatrix,
  7537. dformat = datetime.format,
  7538. result = {},
  7539. matrix,
  7540. ymd,
  7541. viewModels;
  7542. util.forEachArray(range, function(date) {
  7543. ymd = dformat(date, 'YYYYMMDD');
  7544. matrix = ownMatrix[ymd];
  7545. viewModels = result[ymd] = common.createScheduleCollection();
  7546. if (matrix && matrix.length) {
  7547. viewModels.add.apply(
  7548. viewModels,
  7549. util.map(matrix, function(id) {
  7550. return ScheduleViewModel.create(ownSchedules[id]);
  7551. })
  7552. );
  7553. }
  7554. });
  7555. return result;
  7556. };
  7557. Base.prototype.clearSchedules = function() {
  7558. this.dateMatrix = {};
  7559. this.schedules.clear();
  7560. /**
  7561. * for inner view when clear schedules
  7562. * @event Base#clearSchedules
  7563. * @type {Schedule}
  7564. */
  7565. this.fire('clearSchedules');
  7566. };
  7567. /**
  7568. * Set a theme.
  7569. * @param {themeConfig} theme - theme keys, styles
  7570. * @returns {Array.<string>} keys - error keys not predefined.
  7571. */
  7572. Base.prototype.setTheme = function(theme) {
  7573. return this.theme.setStyles(theme);
  7574. };
  7575. /**
  7576. * Set calendar list
  7577. * @param {Array.<Calendar>} calendars - calendar list
  7578. */
  7579. Base.prototype.setCalendars = function(calendars) {
  7580. this.calendars = calendars;
  7581. };
  7582. // mixin
  7583. util.CustomEvents.mixin(Base);
  7584. module.exports = Base;
  7585. /***/ }),
  7586. /***/ "./src/js/controller/viewMixin/core.js":
  7587. /*!*********************************************!*\
  7588. !*** ./src/js/controller/viewMixin/core.js ***!
  7589. \*********************************************/
  7590. /*! no static exports found */
  7591. /***/ (function(module, exports, __webpack_require__) {
  7592. "use strict";
  7593. /**
  7594. * @fileoverview Core methods for schedule block placing
  7595. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  7596. */
  7597. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  7598. var forEachArr = util.forEachArray,
  7599. aps = Array.prototype.slice;
  7600. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  7601. var tz = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js");
  7602. var TZDate = tz.Date;
  7603. var Collection = __webpack_require__(/*! ../../common/collection */ "./src/js/common/collection.js");
  7604. var ScheduleViewModel = __webpack_require__(/*! ../../model/viewModel/scheduleViewModel */ "./src/js/model/viewModel/scheduleViewModel.js");
  7605. var Core = {
  7606. /**
  7607. * Calculate collision group.
  7608. * @param {array} viewModels List of viewmodels.
  7609. * @returns {array} Collision Group.
  7610. */
  7611. getCollisionGroup: function(viewModels) {
  7612. var collisionGroups = [],
  7613. foundPrevCollisionSchedule = false,
  7614. previousScheduleList;
  7615. if (!viewModels.length) {
  7616. return collisionGroups;
  7617. }
  7618. collisionGroups[0] = [util.stamp(viewModels[0].valueOf())];
  7619. forEachArr(viewModels.slice(1), function(schedule, index) {
  7620. foundPrevCollisionSchedule = false;
  7621. previousScheduleList = aps.apply(viewModels, [0, index + 1]).reverse();
  7622. forEachArr(previousScheduleList, function(previous) {
  7623. if (schedule.collidesWith(previous)) {
  7624. // If overlapping previous schedules, find a Collision Group of overlapping schedules and add this schedules
  7625. foundPrevCollisionSchedule = true;
  7626. forEachArr(collisionGroups.slice(0).reverse(), function(group) {
  7627. if (~util.inArray(util.stamp(previous.valueOf()), group)) {
  7628. // If you find a previous schedule that overlaps, include it in the Collision Group to which it belongs.
  7629. group.push(util.stamp(schedule.valueOf()));
  7630. return false; // returning false can stop this loop
  7631. }
  7632. return true;
  7633. });
  7634. return false; // returning false can stop this loop
  7635. }
  7636. return true;
  7637. });
  7638. if (!foundPrevCollisionSchedule) {
  7639. // This schedule is a schedule that does not overlap with the previous schedule, so a new Collision Group is constructed.
  7640. collisionGroups.push([util.stamp(schedule.valueOf())]);
  7641. }
  7642. });
  7643. return collisionGroups;
  7644. },
  7645. /**
  7646. * Get row length by column index in 2d matrix.
  7647. * @param {array[]} arr2d Matrix
  7648. * @param {number} col Column index.
  7649. * @returns {number} Last row number in column.
  7650. */
  7651. getLastRowInColumn: function(arr2d, col) {
  7652. var row = arr2d.length;
  7653. while (row > 0) {
  7654. row -= 1;
  7655. if (!util.isUndefined(arr2d[row][col])) {
  7656. return row;
  7657. }
  7658. }
  7659. return false;
  7660. },
  7661. /**
  7662. * Calculate matrix for appointment block element placing.
  7663. * @param {Collection} collection model collection.
  7664. * @param {array[]} collisionGroups Collision groups for schedule set.
  7665. * @returns {array} matrices
  7666. */
  7667. getMatrices: function(collection, collisionGroups) {
  7668. var result = [],
  7669. getLastRowInColumn = Core.getLastRowInColumn;
  7670. forEachArr(collisionGroups, function(group) {
  7671. var matrix = [[]];
  7672. forEachArr(group, function(scheduleID) {
  7673. var schedule = collection.items[scheduleID],
  7674. col = 0,
  7675. found = false,
  7676. nextRow,
  7677. lastRowInColumn;
  7678. while (!found) {
  7679. lastRowInColumn = getLastRowInColumn(matrix, col);
  7680. if (lastRowInColumn === false) {
  7681. matrix[0].push(schedule);
  7682. found = true;
  7683. } else if (!schedule.collidesWith(matrix[lastRowInColumn][col])) {
  7684. nextRow = lastRowInColumn + 1;
  7685. if (util.isUndefined(matrix[nextRow])) {
  7686. matrix[nextRow] = [];
  7687. }
  7688. matrix[nextRow][col] = schedule;
  7689. found = true;
  7690. }
  7691. col += 1;
  7692. }
  7693. });
  7694. result.push(matrix);
  7695. });
  7696. return result;
  7697. },
  7698. /**
  7699. * Filter that get schedule model in supplied date ranges.
  7700. * @param {Date} start - start date
  7701. * @param {Date} end - end date
  7702. * @returns {function} schedule filter function
  7703. */
  7704. getScheduleInDateRangeFilter: function(start, end) {
  7705. return function(model) {
  7706. var ownStarts = model.getStarts(),
  7707. ownEnds = model.getEnds();
  7708. var dateByOffset;
  7709. if (tz.hasPrimaryTimezoneCustomSetting()) {
  7710. dateByOffset = recalculateDateByOffset(ownStarts, ownEnds);
  7711. ownStarts = dateByOffset.start;
  7712. ownEnds = dateByOffset.end;
  7713. }
  7714. // shorthand condition of
  7715. //
  7716. // (ownStarts >= start && ownEnds <= end) ||
  7717. // (ownStarts < start && ownEnds >= start) ||
  7718. // (ownEnds > end && ownStarts <= end)
  7719. return !(ownEnds < start || ownStarts > end);
  7720. };
  7721. },
  7722. /**
  7723. * Position each view model for placing into container
  7724. * @param {Date} start - start date to render
  7725. * @param {Date} end - end date to render
  7726. * @param {array} matrices - matrices from controller
  7727. * @param {function} [iteratee] - iteratee function invoke each view models
  7728. */
  7729. positionViewModels: function(start, end, matrices, iteratee) {
  7730. var ymdListToRender;
  7731. ymdListToRender = util.map(
  7732. datetime.range(start, end, datetime.MILLISECONDS_PER_DAY),
  7733. function(date) {
  7734. return datetime.format(date, 'YYYYMMDD');
  7735. }
  7736. );
  7737. forEachArr(matrices, function(matrix) {
  7738. forEachArr(matrix, function(column) {
  7739. forEachArr(column, function(viewModel, index) {
  7740. var ymd, dateLength, startDate, endDate;
  7741. if (!viewModel) {
  7742. return;
  7743. }
  7744. startDate = viewModel.getStarts();
  7745. endDate = viewModel.getEnds();
  7746. dateLength = datetime.range(
  7747. datetime.start(startDate),
  7748. datetime.renderEnd(startDate, endDate),
  7749. datetime.MILLISECONDS_PER_DAY
  7750. ).length;
  7751. ymd = datetime.format(startDate, 'YYYYMMDD');
  7752. viewModel.top = index;
  7753. viewModel.left = util.inArray(ymd, ymdListToRender);
  7754. viewModel.width = dateLength;
  7755. if (iteratee) {
  7756. iteratee(viewModel);
  7757. }
  7758. });
  7759. });
  7760. });
  7761. },
  7762. /**
  7763. * Limit start, end date each view model for render properly
  7764. * @param {TZDate} start - start date to render
  7765. * @param {TZDate} end - end date to render
  7766. * @param {Collection|ScheduleViewModel} viewModelColl - schedule view
  7767. * model collection or ScheduleViewModel
  7768. * @returns {ScheduleViewModel} return view model when third parameter is
  7769. * view model
  7770. */
  7771. limitRenderRange: function(start, end, viewModelColl) {
  7772. /**
  7773. * Limit render range for view models
  7774. * @param {ScheduleViewModel} viewModel - view model instance
  7775. * @returns {ScheduleViewModel} view model that limited render range
  7776. */
  7777. function limit(viewModel) {
  7778. if (viewModel.getStarts() < start) {
  7779. viewModel.exceedLeft = true;
  7780. viewModel.renderStarts = new TZDate(start);
  7781. }
  7782. if (viewModel.getEnds() > end) {
  7783. viewModel.exceedRight = true;
  7784. viewModel.renderEnds = new TZDate(end);
  7785. }
  7786. return viewModel;
  7787. }
  7788. if (viewModelColl.constructor === Collection) {
  7789. viewModelColl.each(limit);
  7790. return null;
  7791. }
  7792. return limit(viewModelColl);
  7793. },
  7794. /**
  7795. * Convert schedule model collection to view model collection.
  7796. * @param {Collection} modelColl - collection of schedule model
  7797. * @returns {Collection} collection of schedule view model
  7798. */
  7799. convertToViewModel: function(modelColl) {
  7800. var viewModelColl;
  7801. viewModelColl = new Collection(function(viewModel) {
  7802. return viewModel.cid();
  7803. });
  7804. modelColl.each(function(model) {
  7805. viewModelColl.add(ScheduleViewModel.create(model));
  7806. });
  7807. return viewModelColl;
  7808. }
  7809. };
  7810. /**
  7811. * Get range date by custom timezone or native timezone
  7812. * @param {TZDate} ownStarts start date.
  7813. * @param {TZDate} ownEnds end date.
  7814. * @returns {RangeDate} recalculated start and end date
  7815. */
  7816. function recalculateDateByOffset(ownStarts, ownEnds) {
  7817. var nativeOffsetMs = tz.getNativeOffsetMs();
  7818. var startOffset = ownStarts.toDate().getTimezoneOffset();
  7819. var MIN_TO_MS = 60 * 1000;
  7820. var offsetDiffMs = 0;
  7821. var primaryTimezoneName = tz.getPrimaryTimezoneName();
  7822. var primaryOffset = tz.getPrimaryOffset();
  7823. var timezoneOffset = tz.getOffsetByTimezoneName(primaryTimezoneName, ownStarts.getTime());
  7824. if (tz.isNativeOsUsingDSTTimezone() && nativeOffsetMs !== startOffset) {
  7825. // When using a custom time zone, the native time zone offset is fixed and rendered.
  7826. // So, The fixed and rendered time should be recalculated as the original time zone offset.
  7827. offsetDiffMs = (startOffset * MIN_TO_MS) - nativeOffsetMs;
  7828. }
  7829. if (tz.isPrimaryUsingDSTTimezone() && primaryOffset !== timezoneOffset) {
  7830. // The custom time zone is a time zone where two offsets including DST are applied.
  7831. // The first rendered schedule is calculated and drawn with the offset calculated at the access time(system OS local time).
  7832. // It should be recalculated with the original time zone offset.
  7833. offsetDiffMs = (primaryOffset - timezoneOffset) * MIN_TO_MS;
  7834. }
  7835. return {
  7836. start: new TZDate(ownStarts.getUTCTime() + offsetDiffMs),
  7837. end: new TZDate(ownEnds.getUTCTime() + offsetDiffMs)
  7838. };
  7839. }
  7840. module.exports = Core;
  7841. /***/ }),
  7842. /***/ "./src/js/controller/viewMixin/month.js":
  7843. /*!**********************************************!*\
  7844. !*** ./src/js/controller/viewMixin/month.js ***!
  7845. \**********************************************/
  7846. /*! no static exports found */
  7847. /***/ (function(module, exports, __webpack_require__) {
  7848. "use strict";
  7849. /**
  7850. * @fileoverview Controller mixin for Month View
  7851. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  7852. */
  7853. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  7854. var array = __webpack_require__(/*! ../../common/array */ "./src/js/common/array.js"),
  7855. datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
  7856. Collection = __webpack_require__(/*! ../../common/collection */ "./src/js/common/collection.js");
  7857. var mmax = Math.max;
  7858. var Month = {
  7859. /**
  7860. * Filter function for find time schedule
  7861. * @param {ScheduleViewModel} viewModel - schedule view model
  7862. * @returns {boolean} whether model is time schedule?
  7863. */
  7864. _onlyTimeFilter: function(viewModel) {
  7865. return !viewModel.model.isAllDay && !viewModel.hasMultiDates;
  7866. },
  7867. /**
  7868. * Filter function for find allday schedule
  7869. * @param {ScheduleViewModel} viewModel - schedule view model
  7870. * @returns {boolean} whether model is allday schedule?
  7871. */
  7872. _onlyAlldayFilter: function(viewModel) {
  7873. return viewModel.model.isAllDay || viewModel.hasMultiDates;
  7874. },
  7875. /**
  7876. * Weight top value +1 for month view render
  7877. * @param {ScheduleViewModel} viewModel - schedule view model
  7878. */
  7879. _weightTopValue: function(viewModel) {
  7880. viewModel.top = viewModel.top || 0;
  7881. viewModel.top += 1;
  7882. },
  7883. /**
  7884. * Adjust render range to render properly.
  7885. *
  7886. * Limit start, end for each allday schedules and expand start, end for
  7887. * each time schedules
  7888. * @this Base
  7889. * @param {TZDate} start - render start date
  7890. * @param {TZDate} end - render end date
  7891. * @param {Collection} vColl - view model collection
  7892. * property.
  7893. */
  7894. _adjustRenderRange: function(start, end, vColl) {
  7895. var ctrlCore = this.Core;
  7896. vColl.each(function(viewModel) {
  7897. if (viewModel.model.isAllDay || viewModel.hasMultiDates) {
  7898. ctrlCore.limitRenderRange(start, end, viewModel);
  7899. }
  7900. });
  7901. },
  7902. /**
  7903. * Get max top index value for allday schedules in specific date (YMD)
  7904. * @this Base
  7905. * @param {string} ymd - yyyymmdd formatted value
  7906. * @param {Collection} vAlldayColl - collection of allday schedules
  7907. * @returns {number} max top index value in date
  7908. */
  7909. _getAlldayMaxTopIndexAtYMD: function(ymd, vAlldayColl) {
  7910. var dateMatrix = this.dateMatrix,
  7911. topIndexesInDate = [];
  7912. util.forEach(dateMatrix[ymd], function(cid) {
  7913. vAlldayColl.doWhenHas(cid, function(viewModel) {
  7914. topIndexesInDate.push(viewModel.top);
  7915. });
  7916. });
  7917. if (topIndexesInDate.length > 0) {
  7918. return mmax.apply(null, topIndexesInDate);
  7919. }
  7920. return 0;
  7921. },
  7922. /**
  7923. * Adjust time view model's top index value
  7924. * @this Base
  7925. * @param {Collection} vColl - collection of schedules
  7926. */
  7927. _adjustTimeTopIndex: function(vColl) {
  7928. var ctrlMonth = this.Month;
  7929. var getAlldayMaxTopIndexAtYMD = ctrlMonth._getAlldayMaxTopIndexAtYMD;
  7930. var vAlldayColl = vColl.find(ctrlMonth._onlyAlldayFilter);
  7931. var sortedTimeSchedules = vColl.find(ctrlMonth._onlyTimeFilter).sort(array.compare.schedule.asc);
  7932. var maxIndexInYMD = {};
  7933. sortedTimeSchedules.forEach(function(timeViewModel) {
  7934. var scheduleYMD = datetime.format(timeViewModel.getStarts(), 'YYYYMMDD');
  7935. var alldayMaxTopInYMD = maxIndexInYMD[scheduleYMD];
  7936. if (util.isUndefined(alldayMaxTopInYMD)) {
  7937. alldayMaxTopInYMD = maxIndexInYMD[scheduleYMD] =
  7938. getAlldayMaxTopIndexAtYMD(scheduleYMD, vAlldayColl);
  7939. }
  7940. maxIndexInYMD[scheduleYMD] = timeViewModel.top =
  7941. (alldayMaxTopInYMD + 1);
  7942. });
  7943. },
  7944. /**
  7945. * Adjust time view model's top index value
  7946. * @this Base
  7947. * @param {Collection} vColl - collection of schedules
  7948. */
  7949. _stackTimeFromTop: function(vColl) {
  7950. var ctrlMonth = this.Month;
  7951. var vAlldayColl = vColl.find(ctrlMonth._onlyAlldayFilter);
  7952. var sortedTimeSchedules = vColl.find(ctrlMonth._onlyTimeFilter).sort(array.compare.schedule.asc);
  7953. var indiceInYMD = {};
  7954. var dateMatrix = this.dateMatrix;
  7955. sortedTimeSchedules.forEach(function(timeViewModel) {
  7956. var scheduleYMD = datetime.format(timeViewModel.getStarts(), 'YYYYMMDD');
  7957. var topArrayInYMD = indiceInYMD[scheduleYMD];
  7958. var maxTopInYMD;
  7959. var i;
  7960. if (util.isUndefined(topArrayInYMD)) {
  7961. topArrayInYMD = indiceInYMD[scheduleYMD] = [];
  7962. util.forEach(dateMatrix[scheduleYMD], function(cid) {
  7963. vAlldayColl.doWhenHas(cid, function(viewModel) {
  7964. topArrayInYMD.push(viewModel.top);
  7965. });
  7966. });
  7967. }
  7968. if (util.inArray(timeViewModel.top, topArrayInYMD) >= 0) {
  7969. maxTopInYMD = mmax.apply(null, topArrayInYMD) + 1;
  7970. for (i = 1; i <= maxTopInYMD; i += 1) {
  7971. timeViewModel.top = i;
  7972. if (util.inArray(timeViewModel.top, topArrayInYMD) < 0) {
  7973. break;
  7974. }
  7975. }
  7976. }
  7977. topArrayInYMD.push(timeViewModel.top);
  7978. });
  7979. },
  7980. /**
  7981. * Convert multi-date time schedule to all-day schedule
  7982. * @this Base
  7983. * @param {Collection} vColl - view model collection
  7984. * property.
  7985. */
  7986. _addMultiDatesInfo: function(vColl) {
  7987. vColl.each(function(viewModel) {
  7988. var model = viewModel.model;
  7989. var start = model.getStarts();
  7990. var end = model.getEnds();
  7991. viewModel.hasMultiDates = datetime.hasMultiDates(start, end);
  7992. if (!model.isAllDay && viewModel.hasMultiDates) {
  7993. viewModel.renderStarts = datetime.start(start);
  7994. viewModel.renderEnds = datetime.renderEnd(start, end);
  7995. }
  7996. });
  7997. },
  7998. /**
  7999. * Find schedule and get view model for specific month
  8000. * @this Base
  8001. * @param {TZDate} start - start date to find schedules
  8002. * @param {TZDate} end - end date to find schedules
  8003. * @param {function[]} [andFilters] - optional filters to applying search query
  8004. * @param {boolean} [alldayFirstMode=false] if true, time schedule is lower than all-day schedule. Or stack schedules from the top.
  8005. * @returns {object} view model data
  8006. */
  8007. findByDateRange: function(start, end, andFilters, alldayFirstMode) {
  8008. var ctrlCore = this.Core,
  8009. ctrlMonth = this.Month,
  8010. filter = ctrlCore.getScheduleInDateRangeFilter(start, end),
  8011. coll, vColl, vList,
  8012. collisionGroup,
  8013. matrices;
  8014. alldayFirstMode = alldayFirstMode || false;
  8015. andFilters = andFilters || [];
  8016. filter = Collection.and.apply(null, [filter].concat(andFilters));
  8017. coll = this.schedules.find(filter);
  8018. vColl = ctrlCore.convertToViewModel(coll);
  8019. ctrlMonth._addMultiDatesInfo(vColl);
  8020. ctrlMonth._adjustRenderRange(start, end, vColl);
  8021. vList = vColl.sort(array.compare.schedule.asc);
  8022. collisionGroup = ctrlCore.getCollisionGroup(vList);
  8023. matrices = ctrlCore.getMatrices(vColl, collisionGroup);
  8024. ctrlCore.positionViewModels(start, end, matrices, ctrlMonth._weightTopValue);
  8025. if (alldayFirstMode) {
  8026. ctrlMonth._adjustTimeTopIndex(vColl);
  8027. } else {
  8028. ctrlMonth._stackTimeFromTop(vColl);
  8029. }
  8030. return matrices;
  8031. }
  8032. };
  8033. module.exports = Month;
  8034. /***/ }),
  8035. /***/ "./src/js/controller/viewMixin/week.js":
  8036. /*!*********************************************!*\
  8037. !*** ./src/js/controller/viewMixin/week.js ***!
  8038. \*********************************************/
  8039. /*! no static exports found */
  8040. /***/ (function(module, exports, __webpack_require__) {
  8041. "use strict";
  8042. /* eslint no-shadow: 0 */
  8043. /**
  8044. * @fileoverview Controller mixin modules for day views.
  8045. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  8046. */
  8047. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  8048. var Collection = __webpack_require__(/*! ../../common/collection */ "./src/js/common/collection.js");
  8049. var array = __webpack_require__(/*! ../../common/array */ "./src/js/common/array.js");
  8050. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  8051. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  8052. var SCHEDULE_MIN_DURATION = datetime.MILLISECONDS_SCHEDULE_MIN_DURATION;
  8053. /**
  8054. * @mixin Base.Week
  8055. */
  8056. var Week = {
  8057. /**********
  8058. * TIME GRID VIEW
  8059. **********/
  8060. /**
  8061. * Make array with start and end times on schedules.
  8062. * @this Base.Week
  8063. * @param {array[]} matrix - matrix from controller.
  8064. * @returns {array[]} starttime, endtime array (exclude first row's schedules)
  8065. */
  8066. generateTimeArrayInRow: function(matrix) {
  8067. var row,
  8068. col,
  8069. schedule,
  8070. start,
  8071. end,
  8072. map = [],
  8073. cursor = [],
  8074. maxColLen = Math.max.apply(null, util.map(matrix, function(col) {
  8075. return col.length;
  8076. }));
  8077. for (col = 1; col < maxColLen; col += 1) {
  8078. row = 0;
  8079. schedule = util.pick(matrix, row, col);
  8080. while (schedule) {
  8081. start = schedule.getStarts().getTime() - datetime.millisecondsFrom('minutes', schedule.valueOf().goingDuration);
  8082. end = schedule.getEnds().getTime() + datetime.millisecondsFrom('minutes', schedule.valueOf().comingDuration);
  8083. if (Math.abs(end - start) < SCHEDULE_MIN_DURATION) {
  8084. end += SCHEDULE_MIN_DURATION;
  8085. }
  8086. cursor.push([start, end]);
  8087. row += 1;
  8088. schedule = util.pick(matrix, row, col);
  8089. }
  8090. map.push(cursor);
  8091. cursor = [];
  8092. }
  8093. return map;
  8094. },
  8095. /**
  8096. * Get collision information from list
  8097. * @this Base
  8098. * @param {array.<number[]>} arr - list to detecting collision. [[start, end], [start, end]]
  8099. * @param {number} start - schedule start time that want to detect collisions.
  8100. * @param {number} end - schedule end time that want to detect collisions.
  8101. * @returns {boolean} target has collide in supplied array?
  8102. */
  8103. hasCollide: function(arr, start, end) {
  8104. var startStart,
  8105. startEnd,
  8106. endStart,
  8107. endEnd,
  8108. getFunc = function(index) {
  8109. return function(block) {
  8110. return block[index];
  8111. };
  8112. },
  8113. abs = Math.abs,
  8114. compare = array.compare.num.asc,
  8115. hasCollide;
  8116. if (!arr.length) {
  8117. return false;
  8118. }
  8119. startStart = abs(array.bsearch(arr, start, getFunc(0), compare));
  8120. startEnd = abs(array.bsearch(arr, start, getFunc(1), compare));
  8121. endStart = abs(array.bsearch(arr, end, getFunc(0), compare));
  8122. endEnd = abs(array.bsearch(arr, end, getFunc(1), compare));
  8123. hasCollide = !(startStart === startEnd && startEnd === endStart && endStart === endEnd);
  8124. return hasCollide;
  8125. },
  8126. /**
  8127. * Initialize values to viewmodels for detect real collision at rendering phase.
  8128. * @this Base
  8129. * @param {array[]} matrices - Matrix data.
  8130. */
  8131. getCollides: function(matrices) {
  8132. util.forEachArray(matrices, function(matrix) {
  8133. var binaryMap,
  8134. maxRowLength;
  8135. binaryMap = Week.generateTimeArrayInRow(matrix);
  8136. maxRowLength = Math.max.apply(null, util.map(matrix, function(row) {
  8137. return row.length;
  8138. }));
  8139. util.forEachArray(matrix, function(row) {
  8140. util.forEachArray(row, function(viewModel, col) {
  8141. var startTime,
  8142. endTime,
  8143. hasCollide,
  8144. i;
  8145. if (!viewModel) {
  8146. return;
  8147. }
  8148. startTime = viewModel.getStarts().getTime();
  8149. endTime = viewModel.getEnds().getTime();
  8150. if (Math.abs(endTime - startTime) < SCHEDULE_MIN_DURATION) {
  8151. endTime += SCHEDULE_MIN_DURATION;
  8152. }
  8153. startTime -= datetime.millisecondsFrom('minutes', viewModel.valueOf().goingDuration);
  8154. endTime += datetime.millisecondsFrom('minutes', viewModel.valueOf().comingDuration);
  8155. endTime -= 1;
  8156. for (i = (col + 1); i < maxRowLength; i += 1) {
  8157. hasCollide = Week.hasCollide(binaryMap[i - 1], startTime, endTime);
  8158. if (hasCollide) {
  8159. viewModel.hasCollide = true;
  8160. break;
  8161. }
  8162. viewModel.extraSpace += 1;
  8163. }
  8164. });
  8165. });
  8166. });
  8167. },
  8168. /**
  8169. * create view model for time view part
  8170. * @this Base
  8171. * @param {Date} start - start date.
  8172. * @param {Date} end - end date.
  8173. * @param {Collection} time - view model collection.
  8174. * @param {number} hourStart - start hour to be shown
  8175. * @param {number} hourEnd - end hour to be shown
  8176. * @returns {object} view model for time part.
  8177. */
  8178. getViewModelForTimeView: function(start, end, time, hourStart, hourEnd) {
  8179. var self = this,
  8180. ymdSplitted = this.splitScheduleByDateRange(start, end, time),
  8181. result = {};
  8182. var _getViewModel = Week._makeGetViewModelFuncForTimeView(hourStart, hourEnd);
  8183. util.forEach(ymdSplitted, function(collection, ymd) {
  8184. var viewModels = _getViewModel(collection);
  8185. var collisionGroups, matrices;
  8186. collisionGroups = self.Core.getCollisionGroup(viewModels);
  8187. matrices = self.Core.getMatrices(collection, collisionGroups);
  8188. self.Week.getCollides(matrices);
  8189. result[ymd] = matrices;
  8190. });
  8191. return result;
  8192. },
  8193. /**
  8194. * make view model function depending on start and end hour
  8195. * if time view option has start or end hour condition
  8196. * it add filter
  8197. * @param {number} hourStart - start hour to be shown
  8198. * @param {number} hourEnd - end hour to be shown
  8199. * @returns {function} function
  8200. */
  8201. _makeGetViewModelFuncForTimeView: function(hourStart, hourEnd) {
  8202. if (hourStart === 0 && hourEnd === 24) {
  8203. return function(collection) {
  8204. return collection.sort(array.compare.schedule.asc);
  8205. };
  8206. }
  8207. return function(collection) {
  8208. return collection.find(Week._makeHourRangeFilter(hourStart, hourEnd))
  8209. .sort(array.compare.schedule.asc);
  8210. };
  8211. },
  8212. /**
  8213. * make a filter function that is not included range of start, end hour
  8214. * @param {number} hStart - hour start
  8215. * @param {number} hEnd - hour end
  8216. * @returns {function} - filtering function
  8217. */
  8218. _makeHourRangeFilter: function(hStart, hEnd) {
  8219. // eslint-disable-next-line complexity
  8220. return function(schedule) {
  8221. var ownHourStart = schedule.model.start;
  8222. var ownHourEnd = schedule.model.end;
  8223. var yyyy = ownHourStart.getFullYear();
  8224. var mm = ownHourStart.getMonth();
  8225. var dd = ownHourStart.getDate();
  8226. var hourStart = new TZDate(yyyy, mm, dd).setHours(hStart);
  8227. var hourEnd = new TZDate(yyyy, mm, dd).setHours(hEnd);
  8228. return (ownHourStart >= hourStart && ownHourStart < hourEnd) ||
  8229. (ownHourEnd > hourStart && ownHourEnd <= hourEnd) ||
  8230. (ownHourStart < hourStart && ownHourEnd > hourStart) ||
  8231. (ownHourEnd > hourEnd && ownHourStart < hourEnd);
  8232. };
  8233. },
  8234. /**********
  8235. * ALLDAY VIEW
  8236. **********/
  8237. /**
  8238. * Set hasMultiDates flag to true and set date ranges for rendering
  8239. * @this Base
  8240. * @param {Collection} vColl - view model collection
  8241. */
  8242. _addMultiDatesInfo: function(vColl) {
  8243. vColl.each(function(viewModel) {
  8244. var model = viewModel.model;
  8245. var start = model.getStarts();
  8246. var end = model.getEnds();
  8247. viewModel.hasMultiDates = true;
  8248. viewModel.renderStarts = datetime.start(start);
  8249. viewModel.renderEnds = datetime.renderEnd(start, end);
  8250. });
  8251. },
  8252. /**
  8253. * create view model for allday view part
  8254. * @this Base
  8255. * @param {Date} start start date.
  8256. * @param {Date} end end date.
  8257. * @param {Collection} viewModelColl - allday schedule viewModel viewModels.
  8258. * @returns {object} allday viewModel.
  8259. */
  8260. getViewModelForAlldayView: function(start, end, viewModelColl) {
  8261. var ctrlCore = this.Core,
  8262. ctrlWeek = this.Week,
  8263. viewModels,
  8264. collisionGroups,
  8265. matrices;
  8266. if (!viewModelColl || !viewModelColl.length) {
  8267. return [];
  8268. }
  8269. ctrlWeek._addMultiDatesInfo(viewModelColl);
  8270. ctrlCore.limitRenderRange(start, end, viewModelColl);
  8271. viewModels = viewModelColl.sort(array.compare.schedule.asc);
  8272. collisionGroups = ctrlCore.getCollisionGroup(viewModels);
  8273. matrices = ctrlCore.getMatrices(viewModelColl, collisionGroups);
  8274. ctrlCore.positionViewModels(start, end, matrices);
  8275. return matrices;
  8276. },
  8277. /**********
  8278. * READ
  8279. **********/
  8280. /**
  8281. * Populate schedules in date range.
  8282. * @this Base
  8283. * @param {Date} start start date.
  8284. * @param {Date} end end date.
  8285. * @param {Array.<object>} panels - schedule panels like 'milestone', 'task', 'allday', 'time'
  8286. * @param {function[]} [andFilters] - optional filters to applying search query
  8287. * @param {Object} options - week view options
  8288. * @returns {object} schedules grouped by dates.
  8289. */
  8290. findByDateRange: function(start, end, panels, andFilters, options) {
  8291. var ctrlCore = this.Core,
  8292. ctrlWeek = this.Week,
  8293. filter = ctrlCore.getScheduleInDateRangeFilter(start, end),
  8294. scheduleTypes = util.pluck(panels, 'name'),
  8295. hourStart = util.pick(options, 'hourStart'),
  8296. hourEnd = util.pick(options, 'hourEnd'),
  8297. modelColl,
  8298. group;
  8299. andFilters = andFilters || [];
  8300. filter = Collection.and.apply(null, [filter].concat(andFilters));
  8301. modelColl = this.schedules.find(filter);
  8302. modelColl = ctrlCore.convertToViewModel(modelColl);
  8303. group = modelColl.groupBy(scheduleTypes, this.groupFunc);
  8304. util.forEach(panels, function(panel) {
  8305. var name = panel.name;
  8306. if (panel.type === 'daygrid') {
  8307. group[name] = ctrlWeek.getViewModelForAlldayView(start, end, group[name]);
  8308. } else if (panel.type === 'timegrid') {
  8309. group[name] = ctrlWeek.getViewModelForTimeView(start, end, group[name], hourStart, hourEnd);
  8310. }
  8311. });
  8312. return group;
  8313. },
  8314. /* eslint max-nested-callbacks: 0 */
  8315. /**
  8316. * Make exceed date information
  8317. * @param {number} maxCount - exceed schedule count
  8318. * @param {Array} eventsInDateRange - matrix of ScheduleViewModel
  8319. * @param {Array.<TZDate>} range - date range of one week
  8320. * @returns {object} exceedDate
  8321. */
  8322. getExceedDate: function(maxCount, eventsInDateRange, range) {
  8323. var exceedDate = {};
  8324. util.forEach(range, function(date) {
  8325. var ymd = datetime.format(date, 'YYYYMMDD');
  8326. exceedDate[ymd] = 0;
  8327. });
  8328. util.forEach(eventsInDateRange, function(matrix) {
  8329. util.forEach(matrix, function(column) {
  8330. util.forEach(column, function(viewModel) {
  8331. var period;
  8332. if (!viewModel || viewModel.top < maxCount) {
  8333. return;
  8334. }
  8335. period = datetime.range(
  8336. viewModel.getStarts(),
  8337. viewModel.getEnds(),
  8338. datetime.MILLISECONDS_PER_DAY
  8339. );
  8340. util.forEach(period, function(date) {
  8341. var ymd = datetime.format(date, 'YYYYMMDD');
  8342. exceedDate[ymd] += 1;
  8343. });
  8344. });
  8345. });
  8346. });
  8347. return exceedDate;
  8348. },
  8349. /**
  8350. * Exclude overflow schedules from matrices
  8351. * @param {array} matrices - The matrices for schedule placing.
  8352. * @param {number} visibleScheduleCount - maximum visible count on panel
  8353. * @returns {array} - The matrices for schedule placing except overflowed schedules.
  8354. */
  8355. excludeExceedSchedules: function(matrices, visibleScheduleCount) {
  8356. return matrices.map(function(matrix) {
  8357. return matrix.map(function(row) {
  8358. if (row.length > visibleScheduleCount) {
  8359. return row.filter(function(item) {
  8360. return item.top < visibleScheduleCount;
  8361. }, this);
  8362. }
  8363. return row;
  8364. }, this);
  8365. }, this);
  8366. }
  8367. };
  8368. module.exports = Week;
  8369. /***/ }),
  8370. /***/ "./src/js/factory/calendar.js":
  8371. /*!************************************!*\
  8372. !*** ./src/js/factory/calendar.js ***!
  8373. \************************************/
  8374. /*! no static exports found */
  8375. /***/ (function(module, exports, __webpack_require__) {
  8376. "use strict";
  8377. /**
  8378. * @fileoverview Factory module for control all other factory.
  8379. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  8380. */
  8381. var GA_TRACKING_ID = 'UA-129951699-1';
  8382. var DOMPurify = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.js");
  8383. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet"),
  8384. Handlebars = __webpack_require__(/*! handlebars-template-loader/runtime */ "./node_modules/handlebars-template-loader/runtime/index.js");
  8385. var dw = __webpack_require__(/*! ../common/dw */ "./src/js/common/dw.js");
  8386. var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
  8387. var Layout = __webpack_require__(/*! ../view/layout */ "./src/js/view/layout.js");
  8388. var Drag = __webpack_require__(/*! ../handler/drag */ "./src/js/handler/drag.js");
  8389. var controllerFactory = __webpack_require__(/*! ./controller */ "./src/js/factory/controller.js");
  8390. var weekViewFactory = __webpack_require__(/*! ./weekView */ "./src/js/factory/weekView.js");
  8391. var monthViewFactory = __webpack_require__(/*! ./monthView */ "./src/js/factory/monthView.js");
  8392. var tz = __webpack_require__(/*! ../common/timezone */ "./src/js/common/timezone.js");
  8393. var TZDate = tz.Date;
  8394. var config = __webpack_require__(/*! ../config */ "./src/js/config.js");
  8395. var reqAnimFrame = __webpack_require__(/*! ../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
  8396. var mmin = Math.min;
  8397. /**
  8398. * Schedule information
  8399. * @typedef {object} Schedule
  8400. * @property {string} [id] - The unique schedule id depends on calendar id
  8401. * @property {string} calendarId - The unique calendar id
  8402. * @property {string} [title] - The schedule title
  8403. * @property {string} [body] - The schedule body text which is text/plain
  8404. * @property {string|TZDate} [start] - The start time. It's 'string' for input. It's 'TZDate' for output like event handler.
  8405. * @property {string|TZDate} [end] - The end time. It's 'string' for input. It's 'TZDate' for output like event handler.
  8406. * @property {number} [goingDuration] - The travel time: Going duration minutes
  8407. * @property {number} [comingDuration] - The travel time: Coming duration minutes
  8408. * @property {boolean} [isAllDay] - The all day schedule
  8409. * @property {string} [category] - The schedule type('milestone', 'task', allday', 'time')
  8410. * @property {string} [dueDateClass] - The task schedule type string
  8411. * (any string value is ok and mandatory if category is 'task')
  8412. * @property {string} [location] - The location
  8413. * @property {Array.<string>} [attendees] - The attendees
  8414. * @property {string} [recurrenceRule] - The recurrence rule
  8415. * @property {boolean} [isPending] - The in progress flag to do something like network job(The schedule will be transparent.)
  8416. * @property {boolean} [isFocused] - The focused schedule flag
  8417. * @property {boolean} [isVisible] - The schedule visibility flag
  8418. * @property {boolean} [isReadOnly] - The schedule read-only flag
  8419. * @property {boolean} [isPrivate] - The private schedule
  8420. * @property {string} [color] - The schedule text color
  8421. * @property {string} [bgColor] - The schedule background color
  8422. * @property {string} [dragBgColor] - The schedule background color when dragging it
  8423. * @property {string} [borderColor] - The schedule left border color
  8424. * @property {string} [customStyle] - The schedule's custom css class
  8425. * @property {any} [raw] - The user data
  8426. * @property {string} [state] - The schedule's state ('busy', 'free')
  8427. */
  8428. /**
  8429. * Template functions to support customer renderer
  8430. * @typedef {object} Template
  8431. * @property {function} [milestoneTitle] - The milestone title(at left column) template function
  8432. * @property {function} [milestone] - The milestone template function
  8433. * @property {function} [taskTitle] - The task title(at left column) template function
  8434. * @property {function} [task] - The task template function
  8435. * @property {function} [alldayTitle] - The allday title(at left column) template function
  8436. * @property {function} [allday] - The allday template function
  8437. * @property {function} [time] - The time template function
  8438. * @property {function} [goingDuration] - The travel time(going duration) template function
  8439. * @property {function} [comingDuration] - The travel time(coming duration) template function
  8440. * @property {function} [monthMoreTitleDate] - The month more layer title template function
  8441. * @property {function} [monthMoreClose] - The month more layer close button template function
  8442. * @property {function} [monthGridHeader] - The month grid header(date, decorator, title) template function
  8443. * @property {function} [monthGridHeaderExceed] - The month grid header(exceed schedule count) template function
  8444. * @property {function} [monthGridFooter] - The month grid footer(date, decorator, title) template function
  8445. * @property {function} [monthGridFooterExceed] - The month grid footer(exceed schedule count) template function
  8446. * @property {function} [monthDayname] - The monthly dayname template function
  8447. * @property {function} [weekDayname] - The weekly dayname template function
  8448. * @property {function} [weekGridFooterExceed] - The week/day grid footer(exceed schedule count) template function
  8449. * @property {function} [dayGridTitle] - The week/day grid title template function(e.g. milestone, task, allday)
  8450. * @property {function} [schedule] - The week/day schedule template function(When the schedule category attribute is milestone, task, or all day)
  8451. * @property {function} [collapseBtnTitle] - The week/day (exceed schedule more view) collapse button title template function
  8452. * @property {function} [timezoneDisplayLabel] - The timezone display label template function in time grid
  8453. * @property {function} [timegridDisplayPrimayTime] - Deprecated: use 'timegridDisplayPrimaryTime'
  8454. * @property {function} [timegridDisplayPrimaryTime] - The display label template function of primary timezone in time grid
  8455. * @property {function} [timegridDisplayTime] - The display time template function in time grid
  8456. * @property {function} [timegridCurrentTime] - The current time template function in time grid
  8457. * @property {function} [popupIsAllDay] - The all day checkbox label text template function in the default creation popup
  8458. * @property {function} [popupStateFree] - The free option template function in the state select box of the default creation popup
  8459. * @property {function} [popupStateBusy] - The busy option template function in the state select box of the default creation popup
  8460. * @property {function} [titlePlaceholder] - The title input placeholder text template function in the default creation popup
  8461. * @property {function} [locationPlaceholder] - The location input placeholder text template function in the default creation popup
  8462. * @property {function} [startDatePlaceholder] - The start date input placeholder text template function in the default creation popup
  8463. * @property {function} [endDatePlaceholder] - The end date input placeholder text template function in the default creation popup
  8464. * @property {function} [popupSave] - The 'Save' button text template function in the default creation popup
  8465. * @property {function} [popupUpdate] - The 'Update' button text template function in the default creation popup when in edit mode
  8466. * @property {function} [popupDetailDate] - The schedule date information's template function on the default detail popup
  8467. * @property {function} [popupDetailLocation] - The schedule location text information's template function on the default detail popup
  8468. * @property {function} [popupDetailUser] - The schedule user text information's template function on the default detail popup
  8469. * @property {function} [popupDetailState] - The schedule state(busy or free) text information's template function on the default detail popup
  8470. * @property {function} [popupDetailRepeat] - The schedule repeat information's template function on the default detail popup
  8471. * @property {function} [popupDetailBody] - The schedule body text information's template function on the default detail popup
  8472. * @property {function} [popupEdit] - The 'Edit' button text template function on the default detail popup
  8473. * @property {function} [popupDelete] - The 'Delete' button text template function on the default detail popup
  8474. * @example
  8475. * var calendar = new tui.Calendar(document.getElementById('calendar'), {
  8476. * ...
  8477. * template: {
  8478. * milestone: function(schedule) {
  8479. * return '<span class="calendar-font-icon ic-milestone-b"></span> <span style="background-color: ' + schedule.bgColor + '">' + schedule.title + '</span>';
  8480. * },
  8481. * milestoneTitle: function() {
  8482. * return '<span class="tui-full-calendar-left-content">MILESTONE</span>';
  8483. * },
  8484. * task: function(schedule) {
  8485. * return '#' + schedule.title;
  8486. * },
  8487. * taskTitle: function() {
  8488. * return '<span class="tui-full-calendar-left-content">TASK</span>';
  8489. * },
  8490. * allday: function(schedule) {
  8491. * return getTimeTemplate(schedule, true);
  8492. * },
  8493. * alldayTitle: function() {
  8494. * return '<span class="tui-full-calendar-left-content">ALL DAY</span>';
  8495. * },
  8496. * time: function(schedule) {
  8497. * return '<strong>' + moment(schedule.start.getTime()).format('HH:mm') + '</strong> ' + schedule.title;
  8498. * },
  8499. * goingDuration: function(schedule) {
  8500. * return '<span class="calendar-icon ic-travel-time"></span>' + schedule.goingDuration + 'min.';
  8501. * },
  8502. * comingDuration: function(schedule) {
  8503. * return '<span class="calendar-icon ic-travel-time"></span>' + schedule.comingDuration + 'min.';
  8504. * },
  8505. * monthMoreTitleDate: function(date, dayname) {
  8506. * var day = date.split('.')[2];
  8507. *
  8508. * return '<span class="tui-full-calendar-month-more-title-day">' + day + '</span> <span class="tui-full-calendar-month-more-title-day-label">' + dayname + '</span>';
  8509. * },
  8510. * monthMoreClose: function() {
  8511. * return '<span class="tui-full-calendar-icon tui-full-calendar-ic-close"></span>';
  8512. * },
  8513. * monthGridHeader: function(dayModel) {
  8514. * var date = parseInt(dayModel.date.split('-')[2], 10);
  8515. * var classNames = ['tui-full-calendar-weekday-grid-date '];
  8516. *
  8517. * if (dayModel.isToday) {
  8518. * classNames.push('tui-full-calendar-weekday-grid-date-decorator');
  8519. * }
  8520. *
  8521. * return '<span class="' + classNames.join(' ') + '">' + date + '</span>';
  8522. * },
  8523. * monthGridHeaderExceed: function(hiddenSchedules) {
  8524. * return '<span class="weekday-grid-more-schedules">+' + hiddenSchedules + '</span>';
  8525. * },
  8526. * monthGridFooter: function() {
  8527. * return '';
  8528. * },
  8529. * monthGridFooterExceed: function(hiddenSchedules) {
  8530. * return '';
  8531. * },
  8532. * monthDayname: function(model) {
  8533. * return (model.label).toString().toLocaleUpperCase();
  8534. * },
  8535. * weekDayname: function(model) {
  8536. * return '<span class="tui-full-calendar-dayname-date">' + model.date + '</span>&nbsp;&nbsp;<span class="tui-full-calendar-dayname-name">' + model.dayName + '</span>';
  8537. * },
  8538. * weekGridFooterExceed: function(hiddenSchedules) {
  8539. * return '+' + hiddenSchedules;
  8540. * },
  8541. * dayGridTitle: function(viewName) {
  8542. *
  8543. * // use another functions instead of 'dayGridTitle'
  8544. * // milestoneTitle: function() {...}
  8545. * // taskTitle: function() {...}
  8546. * // alldayTitle: function() {...}
  8547. *
  8548. * var title = '';
  8549. * switch(viewName) {
  8550. * case 'milestone':
  8551. * title = '<span class="tui-full-calendar-left-content">MILESTONE</span>';
  8552. * break;
  8553. * case 'task':
  8554. * title = '<span class="tui-full-calendar-left-content">TASK</span>';
  8555. * break;
  8556. * case 'allday':
  8557. * title = '<span class="tui-full-calendar-left-content">ALL DAY</span>';
  8558. * break;
  8559. * }
  8560. *
  8561. * return title;
  8562. * },
  8563. * schedule: function(schedule) {
  8564. *
  8565. * // use another functions instead of 'schedule'
  8566. * // milestone: function() {...}
  8567. * // task: function() {...}
  8568. * // allday: function() {...}
  8569. *
  8570. * var tpl;
  8571. *
  8572. * switch(category) {
  8573. * case 'milestone':
  8574. * tpl = '<span class="calendar-font-icon ic-milestone-b"></span> <span style="background-color: ' + schedule.bgColor + '">' + schedule.title + '</span>';
  8575. * break;
  8576. * case 'task':
  8577. * tpl = '#' + schedule.title;
  8578. * break;
  8579. * case 'allday':
  8580. * tpl = getTimeTemplate(schedule, true);
  8581. * break;
  8582. * }
  8583. *
  8584. * return tpl;
  8585. * },
  8586. * collapseBtnTitle: function() {
  8587. * return '<span class="tui-full-calendar-icon tui-full-calendar-ic-arrow-solid-top"></span>';
  8588. * },
  8589. * timezoneDisplayLabel: function(timezoneOffset, displayLabel) {
  8590. * var gmt, hour, minutes;
  8591. *
  8592. * if (!displayLabel) {
  8593. * gmt = timezoneOffset < 0 ? '-' : '+';
  8594. * hour = Math.abs(parseInt(timezoneOffset / 60, 10));
  8595. * minutes = Math.abs(timezoneOffset % 60);
  8596. * displayLabel = gmt + getPadStart(hour) + ':' + getPadStart(minutes);
  8597. * }
  8598. *
  8599. * return displayLabel;
  8600. * },
  8601. * timegridDisplayPrimayTime: function(time) {
  8602. * // will be deprecated. use 'timegridDisplayPrimaryTime'
  8603. * var meridiem = 'am';
  8604. * var hour = time.hour;
  8605. *
  8606. * if (time.hour > 12) {
  8607. * meridiem = 'pm';
  8608. * hour = time.hour - 12;
  8609. * }
  8610. *
  8611. * return hour + ' ' + meridiem;
  8612. * },
  8613. * timegridDisplayPrimaryTime: function(time) {
  8614. * var meridiem = 'am';
  8615. * var hour = time.hour;
  8616. *
  8617. * if (time.hour > 12) {
  8618. * meridiem = 'pm';
  8619. * hour = time.hour - 12;
  8620. * }
  8621. *
  8622. * return hour + ' ' + meridiem;
  8623. * },
  8624. * timegridDisplayTime: function(time) {
  8625. * return getPadStart(time.hour) + ':' + getPadStart(time.hour);
  8626. * },
  8627. * timegridCurrentTime: function(timezone) {
  8628. * var templates = [];
  8629. *
  8630. * if (timezone.dateDifference) {
  8631. * templates.push('[' + timezone.dateDifferenceSign + timezone.dateDifference + ']<br>');
  8632. * }
  8633. *
  8634. * templates.push(moment(timezone.hourmarker).format('HH:mm a'));
  8635. *
  8636. * return templates.join('');
  8637. * },
  8638. * popupIsAllDay: function() {
  8639. * return 'All Day';
  8640. * },
  8641. * popupStateFree: function() {
  8642. * return 'Free';
  8643. * },
  8644. * popupStateBusy: function() {
  8645. * return 'Busy';
  8646. * },
  8647. * titlePlaceholder: function() {
  8648. * return 'Subject';
  8649. * },
  8650. * locationPlaceholder: function() {
  8651. * return 'Location';
  8652. * },
  8653. * startDatePlaceholder: function() {
  8654. * return 'Start date';
  8655. * },
  8656. * endDatePlaceholder: function() {
  8657. * return 'End date';
  8658. * },
  8659. * popupSave: function() {
  8660. * return 'Save';
  8661. * },
  8662. * popupUpdate: function() {
  8663. * return 'Update';
  8664. * },
  8665. * popupDetailDate: function(isAllDay, start, end) {
  8666. * var isSameDate = moment(start).isSame(end);
  8667. * var endFormat = (isSameDate ? '' : 'YYYY.MM.DD ') + 'hh:mm a';
  8668. *
  8669. * if (isAllDay) {
  8670. * return moment(start).format('YYYY.MM.DD') + (isSameDate ? '' : ' - ' + moment(end).format('YYYY.MM.DD'));
  8671. * }
  8672. *
  8673. * return (moment(start).format('YYYY.MM.DD hh:mm a') + ' - ' + moment(end).format(endFormat));
  8674. * },
  8675. * popupDetailLocation: function(schedule) {
  8676. * return 'Location : ' + schedule.location;
  8677. * },
  8678. * popupDetailUser: function(schedule) {
  8679. * return 'User : ' + (schedule.attendees || []).join(', ');
  8680. * },
  8681. * popupDetailState: function(schedule) {
  8682. * return 'State : ' + schedule.state || 'Busy';
  8683. * },
  8684. * popupDetailRepeat: function(schedule) {
  8685. * return 'Repeat : ' + schedule.recurrenceRule;
  8686. * },
  8687. * popupDetailBody: function(schedule) {
  8688. * return 'Body : ' + schedule.body;
  8689. * },
  8690. * popupEdit: function() {
  8691. * return 'Edit';
  8692. * },
  8693. * popupDelete: function() {
  8694. * return 'Delete';
  8695. * }
  8696. * }
  8697. * }
  8698. */
  8699. /**
  8700. * Options for daily, weekly view.
  8701. * @typedef {object} WeekOptions
  8702. * @property {number} [startDayOfWeek=0] - The start day of week,
  8703. * @property {Array.<string>} [daynames] - The day names in weekly and daily. Default values are ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
  8704. * @property {boolean} [narrowWeekend=false] - Make weekend column narrow(1/2 width)
  8705. * @property {boolean} [workweek=false] - Show only 5 days except for weekend
  8706. * @property {boolean} [showTimezoneCollapseButton=false] - Show a collapse button to close multiple timezones
  8707. * @property {boolean} [timezonesCollapsed=false] - An initial multiple timezones collapsed state
  8708. * @property {number} [hourStart=0] - Can limit of render hour start.
  8709. * @property {number} [hourEnd=24] - Can limit of render hour end.
  8710. */
  8711. /**
  8712. * Options for monthly view.
  8713. * @typedef {object} MonthOptions
  8714. * @property {Array.<string>} [daynames] - The day names in monthly. Default values are ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
  8715. * @property {number} [startDayOfWeek=0] - The start day of week
  8716. * @property {boolean} [narrowWeekend=false] - Make weekend column narrow(1/2 width)
  8717. * @property {number} [visibleWeeksCount=6] - The visible week count in monthly(0 or null are same with 6)
  8718. * @property {boolean} [isAlways6Week=true] - Always show 6 weeks. If false, show 5 weeks or 6 weeks based on the month.
  8719. * @property {boolean} [workweek=false] - Show only 5 days except for weekend
  8720. * @property {number} [visibleScheduleCount] - The visible schedule count in monthly grid
  8721. * @property {object} [moreLayerSize] - The more layer size
  8722. * @property {object} [moreLayerSize.width=null] - The css width value(px, 'auto').
  8723. * The default value 'null' is to fit a grid cell.
  8724. * @property {object} [moreLayerSize.height=null] - The css height value(px, 'auto').
  8725. * The default value 'null' is to fit a grid cell.
  8726. * @property {object} [grid] - The grid's header and footer information
  8727. * @property {object} [grid.header] - The grid's header informatioin
  8728. * @property {number} [grid.header.height=34] - The grid's header height
  8729. * @property {object} [grid.footer] - The grid's footer informatioin
  8730. * @property {number} [grid.footer.height=34] - The grid's footer height
  8731. * @property {function} [scheduleFilter=null] - The filter schedules on month view. A parameter is {Schedule} object.
  8732. */
  8733. /**
  8734. * @typedef {object} CalendarColor
  8735. * @property {string} [color] - The calendar color
  8736. * @property {string} [bgColor] - The calendar background color
  8737. * @property {string} [borderColor] - The calendar left border color
  8738. * @property {string} [dragBgColor] - The Background color displayed when you drag a calendar's schedule
  8739. */
  8740. /**
  8741. * @typedef {object} Timezone
  8742. * @property {Array.<Zone>} [zones] - {@link Zone} array. Set the list of time zones.
  8743. * The first zone element is primary
  8744. * The rest zone elements are shown in left timegrid of weekly/daily view
  8745. * @property {function} [offsetCalculator = null] - If you define the 'offsetCalculator' property, the offset calculation is done with this function.
  8746. * The offsetCalculator option allows you to set up a function that returns the timezone offset for that time using date libraries like ['js-joda'](https://js-joda.github.io/js-joda/) and ['moment-timezone'](https://momentjs.com/timezone/).
  8747. * The 'offsetCalculator' option is useful when your browser does not support 'Intl.DateTimeFormat' and 'formatToPart', or you want to use the date library you are familiar with.
  8748. *
  8749. * @example
  8750. * var cal = new Calendar('#calendar', {
  8751. * timezone: {
  8752. * zones: [
  8753. * {
  8754. * timezoneName: 'Asia/Seoul',
  8755. * displayLabel: 'GMT+09:00',
  8756. * tooltip: 'Seoul'
  8757. * },
  8758. * {
  8759. * timezoneName: 'America/New_York',
  8760. * displayLabel: 'GMT-05:00',
  8761. * tooltip: 'New York',
  8762. * }
  8763. * ],
  8764. * offsetCalculator: function(timezoneName, timestamp){
  8765. * // matches 'getTimezoneOffset()' of Date API
  8766. * // e.g. +09:00 => -540, -04:00 => 240
  8767. * return moment.tz.zone(timezoneName).utcOffset(timestamp);
  8768. * },
  8769. * }
  8770. * });
  8771. */
  8772. /**
  8773. * @typedef {object} Zone
  8774. * @property {string} [timezoneName] - timezone name (time zone names of the IANA time zone database, such as 'Asia/Seoul', 'America/New_York').
  8775. * Basically, it will calculate the offset using 'Intl.DateTimeFormat' with the value of the this property entered.
  8776. * This property is required.
  8777. * @property {string} [displayLabel] - The display label of your timezone at weekly/daily view(e.g. 'GMT+09:00')
  8778. * @property {string} [tooltip] - The tooltip(e.g. 'Seoul')
  8779. * @property {number} [timezoneOffset] - The minutes for your timezone offset. If null, use the browser's timezone. Refer to Date.prototype.getTimezoneOffset().
  8780. * This property will be deprecated. (since version 1.13)
  8781. *
  8782. * @example
  8783. * var cal = new Calendar('#calendar', {
  8784. * timezone: {
  8785. * zones: [
  8786. * {
  8787. * timezoneName: 'Asia/Seoul',
  8788. * displayLabel: 'GMT+09:00',
  8789. * tooltip: 'Seoul'
  8790. * },
  8791. * {
  8792. * timezoneName: 'America/New_York',
  8793. * displayLabel: 'GMT-05:00',
  8794. * tooltip: 'New York',
  8795. * }
  8796. * ],
  8797. * }
  8798. * });
  8799. */
  8800. /**
  8801. * @typedef {object} CalendarProps
  8802. * @property {string|number} id - The calendar id
  8803. * @property {string} name - The calendar name
  8804. * @property {string} color - The text color when schedule is displayed
  8805. * @property {string} bgColor - The background color schedule is displayed
  8806. * @property {string} borderColor - The color of left border or bullet point when schedule is displayed
  8807. * @property {string} dragBgColor - The background color when schedule dragging
  8808. * @example
  8809. * var cal = new Calendar('#calendar', {
  8810. * ...
  8811. * calendars: [
  8812. * {
  8813. * id: '1',
  8814. * name: 'My Calendar',
  8815. * color: '#ffffff',
  8816. * bgColor: '#9e5fff',
  8817. * dragBgColor: '#9e5fff',
  8818. * borderColor: '#9e5fff'
  8819. * },
  8820. * {
  8821. * id: '2',
  8822. * name: 'Company',
  8823. * color: '#00a9ff',
  8824. * bgColor: '#00a9ff',
  8825. * dragBgColor: '#00a9ff',
  8826. * borderColor: '#00a9ff'
  8827. * },
  8828. * ]
  8829. * });
  8830. */
  8831. /**
  8832. * @typedef {object} Options - Calendar option object
  8833. * @property {string} [defaultView='week'] - Default view of calendar. The default value is 'week'.
  8834. * @property {boolean|Array.<string>} [taskView=true] - Show the milestone and task in weekly, daily view. The default value is true. If the value is array, it can be &#91;'milestone', 'task'&#93;.
  8835. * @property {boolean|Array.<string>} [scheduleView=true] - Show the all day and time grid in weekly, daily view. The default value is false. If the value is array, it can be &#91;'allday', 'time'&#93;.
  8836. * @property {themeConfig} [theme=themeConfig] - {@link themeConfig} for custom style.
  8837. * @property {Template} [template={}] - {@link Template} for further information
  8838. * @property {WeekOptions} [week={}] - {@link WeekOptions} for week view
  8839. * @property {MonthOptions} [month={}] - {@link MonthOptions} for month view
  8840. * @property {Array.<CalendarProps>} [calendars=[]] - {@link CalendarProps} List that can be used to add new schedule. The default value is [].
  8841. * @property {boolean} [useCreationPopup=false] - Whether use default creation popup or not. The default value is false.
  8842. * @property {boolean} [useDetailPopup=false] - Whether use default detail popup or not. The default value is false.
  8843. * @property {Timezone} [timezone] - {@link Timezone} - Set a custom time zone. You can add secondary timezone in the weekly/daily view.
  8844. * @property {boolean} [disableDblClick=false] - Disable double click to create a schedule. The default value is false.
  8845. * @property {boolean} [disableClick=false] - Disable click to create a schedule. The default value is false.
  8846. * @property {boolean} [isReadOnly=false] - {@link Calendar} is read-only mode and a user can't create and modify any schedule. The default value is false.
  8847. * @property {boolean} [usageStatistics=true] - Let us know the hostname. If you don't want to send the hostname, please set to false.
  8848. * @property {Array.<Timezone>} [timezones] - This property will be deprecated. (since version 1.13) Please use timezone property.
  8849. */
  8850. /**
  8851. * {@link https://nhn.github.io/tui.code-snippet/latest/CustomEvents CustomEvents} document at {@link https://github.com/nhn/tui.code-snippet tui-code-snippet}
  8852. * @typedef {class} CustomEvents
  8853. */
  8854. /**
  8855. * @typedef {object} TimeCreationGuide - Time creation guide instance to present selected time period
  8856. * @property {HTMLElement} guideElement - Guide element
  8857. * @property {Object.<string, HTMLElement>} guideElements - Map by key. It can be used in monthly view
  8858. * @property {function} clearGuideElement - Hide the creation guide
  8859. * @example
  8860. * calendar.on('beforeCreateSchedule', function(event) {
  8861. * var guide = event.guide;
  8862. * // Use guideEl$'s left, top to locate your schedule creation popup
  8863. * var guideEl$ = guide.guideElement ?
  8864. * guide.guideElement : guide.guideElements[Object.keys(guide.guideElements)[0]];
  8865. *
  8866. * // After that call this to hide the creation guide
  8867. * guide.clearGuideElement();
  8868. * });
  8869. */
  8870. /**
  8871. * Calendar class
  8872. * @constructor
  8873. * @mixes CustomEvents
  8874. * @param {HTMLElement|string} container - The container element or selector id
  8875. * @param {Options} options - The calendar {@link Options} object
  8876. * @example
  8877. * var calendar = new tui.Calendar(document.getElementById('calendar'), {
  8878. * defaultView: 'week',
  8879. * taskView: true, // Can be also ['milestone', 'task']
  8880. * scheduleView: true, // Can be also ['allday', 'time']
  8881. * template: {
  8882. * milestone: function(schedule) {
  8883. * return '<span style="color:red;"><i class="fa fa-flag"></i> ' + schedule.title + '</span>';
  8884. * },
  8885. * milestoneTitle: function() {
  8886. * return 'Milestone';
  8887. * },
  8888. * task: function(schedule) {
  8889. * return '&nbsp;&nbsp;#' + schedule.title;
  8890. * },
  8891. * taskTitle: function() {
  8892. * return '<label><input type="checkbox" />Task</label>';
  8893. * },
  8894. * allday: function(schedule) {
  8895. * return schedule.title + ' <i class="fa fa-refresh"></i>';
  8896. * },
  8897. * alldayTitle: function() {
  8898. * return 'All Day';
  8899. * },
  8900. * time: function(schedule) {
  8901. * return schedule.title + ' <i class="fa fa-refresh"></i>' + schedule.start;
  8902. * }
  8903. * },
  8904. * month: {
  8905. * daynames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
  8906. * startDayOfWeek: 0,
  8907. * narrowWeekend: true
  8908. * },
  8909. * week: {
  8910. * daynames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
  8911. * startDayOfWeek: 0,
  8912. * narrowWeekend: true
  8913. * }
  8914. * });
  8915. */
  8916. function Calendar(container, options) {
  8917. options = util.extend(
  8918. {
  8919. usageStatistics: true
  8920. },
  8921. options
  8922. );
  8923. if (options.usageStatistics === true && util.sendHostname) {
  8924. util.sendHostname('calendar', GA_TRACKING_ID);
  8925. }
  8926. if (util.isString(container)) {
  8927. container = document.querySelector(container);
  8928. }
  8929. /**
  8930. * Calendar color map
  8931. * @type {object}
  8932. * @private
  8933. */
  8934. this._calendarColor = {};
  8935. /**
  8936. * Current rendered date
  8937. * @type {TZDate}
  8938. * @private
  8939. */
  8940. this._renderDate = datetime.start();
  8941. /**
  8942. * start and end date of weekly, monthly
  8943. * @type {object}
  8944. * @private
  8945. */
  8946. this._renderRange = {
  8947. start: null,
  8948. end: null
  8949. };
  8950. /**
  8951. * base controller
  8952. * @type {Base}
  8953. * @private
  8954. */
  8955. this._controller = _createController(options);
  8956. this._controller.setCalendars(options.calendars);
  8957. /**
  8958. * layout view (layout manager)
  8959. * @type {Layout}
  8960. * @private
  8961. */
  8962. this._layout = new Layout(container, this._controller.theme);
  8963. /**
  8964. * global drag handler
  8965. * @type {Drag}
  8966. * @private
  8967. */
  8968. this._dragHandler = new Drag({distance: 10}, this._layout.container);
  8969. /**
  8970. * current rendered view name. ('day', 'week', 'month')
  8971. * @type {string}
  8972. * @default 'week'
  8973. * @private
  8974. */
  8975. this._viewName = options.defaultView || 'week';
  8976. /**
  8977. * Refresh method. it can be ref different functions for each view modes.
  8978. * @type {function}
  8979. * @private
  8980. */
  8981. this._refreshMethod = null;
  8982. /**
  8983. * Scroll to now. It can be called for 'week', 'day' view modes.
  8984. * @type {function}
  8985. * @private
  8986. */
  8987. this._scrollToNowMethod = null;
  8988. /**
  8989. * It's true if Calendar.prototype.scrollToNow() is called.
  8990. * @type {boolean}
  8991. * @private
  8992. */
  8993. this._requestScrollToNow = false;
  8994. /**
  8995. * Open schedule creation popup
  8996. * @type {function}
  8997. * @private
  8998. */
  8999. this._openCreationPopup = null;
  9000. /**
  9001. * Hide the more view
  9002. * @type {function}
  9003. * @private
  9004. */
  9005. this._hideMoreView = null;
  9006. /**
  9007. * Unique id for requestAnimFrame()
  9008. * @type {number}
  9009. * @private
  9010. */
  9011. this._requestRender = 0;
  9012. /**
  9013. * calendar options
  9014. * @type {Options}
  9015. * @private
  9016. */
  9017. this._options = {};
  9018. this._initialize(options);
  9019. }
  9020. /**
  9021. * destroy calendar instance.
  9022. */
  9023. Calendar.prototype.destroy = function() {
  9024. this._dragHandler.destroy();
  9025. this._controller.off();
  9026. this._layout.clear();
  9027. this._layout.destroy();
  9028. util.forEach(this._options.template, function(func, name) {
  9029. if (func) {
  9030. Handlebars.unregisterHelper(name + '-tmpl');
  9031. }
  9032. });
  9033. this._options = this._renderDate = this._controller
  9034. = this._layout = this._dragHandler = this._viewName = this._refreshMethod
  9035. = this._scrollToNowMethod = null;
  9036. };
  9037. /**
  9038. * Initialize calendar
  9039. * @param {Options} options - calendar options
  9040. * @private
  9041. */
  9042. // eslint-disable-next-line complexity
  9043. Calendar.prototype._initialize = function(options) {
  9044. var controller = this._controller,
  9045. viewName = this._viewName;
  9046. this._options = util.extend(
  9047. {
  9048. defaultView: viewName,
  9049. taskView: true,
  9050. scheduleView: true,
  9051. template: util.extend(
  9052. {
  9053. allday: null,
  9054. time: null
  9055. },
  9056. util.pick(options, 'template') || {}
  9057. ),
  9058. week: util.extend({}, util.pick(options, 'week') || {}),
  9059. month: util.extend({}, util.pick(options, 'month') || {}),
  9060. calendars: [],
  9061. useCreationPopup: false,
  9062. useDetailPopup: false,
  9063. timezones: options.timezone && options.timezone.zones ? options.timezone.zones : [],
  9064. disableDblClick: false,
  9065. disableClick: false,
  9066. isReadOnly: false
  9067. },
  9068. options
  9069. );
  9070. this._options.week = util.extend(
  9071. {
  9072. startDayOfWeek: 0,
  9073. workweek: false
  9074. },
  9075. util.pick(this._options, 'week') || {}
  9076. );
  9077. this._options.timezone = util.extend({zones: []}, util.pick(options, 'timezone') || {});
  9078. this._options.month = util.extend(
  9079. {
  9080. startDayOfWeek: 0,
  9081. workweek: false,
  9082. scheduleFilter: function(schedule) {
  9083. return (
  9084. Boolean(schedule.isVisible) &&
  9085. (schedule.category === 'allday' || schedule.category === 'time')
  9086. );
  9087. }
  9088. },
  9089. util.pick(options, 'month') || {}
  9090. );
  9091. if (this._options.isReadOnly) {
  9092. this._options.useCreationPopup = false;
  9093. }
  9094. this._layout.controller = controller;
  9095. this._setAdditionalInternalOptions(this._options);
  9096. this.changeView(viewName, true);
  9097. };
  9098. /**
  9099. * Set additional internal options
  9100. * 1. Register to the template handlebar
  9101. * 2. Update the calendar list and set the color of the calendar.
  9102. * 3. Change the primary timezone offset of the timezones.
  9103. * @param {Options} options - calendar options
  9104. * @private
  9105. */
  9106. Calendar.prototype._setAdditionalInternalOptions = function(options) {
  9107. var timezone = options.timezone;
  9108. var templateWithSanitizer = function(templateFn) {
  9109. return function() {
  9110. var template = templateFn.apply(null, arguments);
  9111. return DOMPurify.sanitize(template);
  9112. };
  9113. };
  9114. var zones, offsetCalculator;
  9115. util.forEach(options.template, function(func, name) {
  9116. if (func) {
  9117. Handlebars.registerHelper(name + '-tmpl', templateWithSanitizer(func));
  9118. }
  9119. });
  9120. util.forEach(
  9121. options.calendars || [],
  9122. function(calendar) {
  9123. this.setCalendarColor(calendar.id, calendar, true);
  9124. },
  9125. this
  9126. );
  9127. if (timezone) {
  9128. offsetCalculator = timezone.offsetCalculator;
  9129. if (util.isFunction(offsetCalculator)) {
  9130. tz.setOffsetCalculator(offsetCalculator);
  9131. }
  9132. zones = timezone.zones;
  9133. if (zones.length) {
  9134. tz.setPrimaryTimezoneByOption(zones[0]);
  9135. if (util.isNumber(zones[0].timezoneOffset)) {
  9136. // @deprecated timezoneOffset property will be deprecated. use timezone property
  9137. tz.setOffsetByTimezoneOption(zones[0].timezoneOffset);
  9138. }
  9139. }
  9140. }
  9141. };
  9142. /**********
  9143. * CRUD Methods
  9144. **********/
  9145. /**
  9146. * Create schedules and render calendar.
  9147. * @param {Array.<Schedule>} schedules - {@link Schedule} data list
  9148. * @param {boolean} [silent=false] - no auto render after creation when set true
  9149. * @example
  9150. * calendar.createSchedules([
  9151. * {
  9152. * id: '1',
  9153. * calendarId: '1',
  9154. * title: 'my schedule',
  9155. * category: 'time',
  9156. * dueDateClass: '',
  9157. * start: '2018-01-18T22:30:00+09:00',
  9158. * end: '2018-01-19T02:30:00+09:00'
  9159. * },
  9160. * {
  9161. * id: '2',
  9162. * calendarId: '1',
  9163. * title: 'second schedule',
  9164. * category: 'time',
  9165. * dueDateClass: '',
  9166. * start: '2018-01-18T17:30:00+09:00',
  9167. * end: '2018-01-19T17:31:00+09:00'
  9168. * }
  9169. * ]);
  9170. */
  9171. Calendar.prototype.createSchedules = function(schedules, silent) {
  9172. util.forEach(
  9173. schedules,
  9174. function(obj) {
  9175. this._setScheduleColor(obj.calendarId, obj);
  9176. },
  9177. this
  9178. );
  9179. this._controller.createSchedules(schedules, silent);
  9180. if (!silent) {
  9181. this.render();
  9182. }
  9183. };
  9184. /**
  9185. * Get a {@link Schedule} object by schedule id and calendar id.
  9186. * @param {string} scheduleId - ID of schedule
  9187. * @param {string} calendarId - calendarId of the schedule
  9188. * @returns {Schedule} schedule object
  9189. * @example
  9190. * var schedule = calendar.getSchedule(scheduleId, calendarId);
  9191. * console.log(schedule.title);
  9192. */
  9193. Calendar.prototype.getSchedule = function(scheduleId, calendarId) {
  9194. return this._controller.schedules.single(function(model) {
  9195. return model.id === scheduleId && model.calendarId === calendarId;
  9196. });
  9197. };
  9198. /**
  9199. * Update the schedule
  9200. * @param {string} scheduleId - ID of the original schedule to update
  9201. * @param {string} calendarId - The calendarId of the original schedule to update
  9202. * @param {object} changes - The {@link Schedule} properties and values with changes to update
  9203. * @param {boolean} [silent=false] - No auto render after creation when set true
  9204. * @example
  9205. * calendar.updateSchedule(schedule.id, schedule.calendarId, {
  9206. * title: 'Changed schedule',
  9207. * start: new Date('2019-11-05T09:00:00'),
  9208. * end: new Date('2019-11-05T10:00:00'),
  9209. * category: 'time'
  9210. * });
  9211. */
  9212. Calendar.prototype.updateSchedule = function(scheduleId, calendarId, changes, silent) {
  9213. var ctrl = this._controller,
  9214. ownSchedules = ctrl.schedules,
  9215. schedule = ownSchedules.single(function(model) {
  9216. return model.id === scheduleId && model.calendarId === calendarId;
  9217. });
  9218. var hasChangedCalendar = false;
  9219. if (!changes || !schedule) {
  9220. return;
  9221. }
  9222. hasChangedCalendar = this._hasChangedCalendar(schedule, changes);
  9223. changes = hasChangedCalendar ? this._setScheduleColor(changes.calendarId, changes) : changes;
  9224. ctrl.updateSchedule(schedule, changes);
  9225. if (!silent) {
  9226. this.render();
  9227. }
  9228. };
  9229. Calendar.prototype._hasChangedCalendar = function(schedule, changes) {
  9230. return schedule && changes.calendarId && schedule.calendarId !== changes.calendarId;
  9231. };
  9232. Calendar.prototype._setScheduleColor = function(calendarId, schedule) {
  9233. var calColor = this._calendarColor;
  9234. var color = calColor[calendarId];
  9235. if (color) {
  9236. schedule.color = schedule.color || color.color;
  9237. schedule.bgColor = schedule.bgColor || color.bgColor;
  9238. schedule.borderColor = schedule.borderColor || color.borderColor;
  9239. schedule.dragBgColor = schedule.dragBgColor || color.dragBgColor;
  9240. }
  9241. return schedule;
  9242. };
  9243. /**
  9244. * Delete a schedule.
  9245. * @param {string} scheduleId - ID of schedule to delete
  9246. * @param {string} calendarId - The CalendarId of the schedule to delete
  9247. * @param {boolean} [silent=false] - No auto render after creation when set true
  9248. */
  9249. Calendar.prototype.deleteSchedule = function(scheduleId, calendarId, silent) {
  9250. var ctrl = this._controller,
  9251. ownSchedules = ctrl.schedules,
  9252. schedule = ownSchedules.single(function(model) {
  9253. return model.id === scheduleId && model.calendarId === calendarId;
  9254. });
  9255. if (!schedule) {
  9256. return;
  9257. }
  9258. ctrl.deleteSchedule(schedule);
  9259. if (!silent) {
  9260. this.render();
  9261. }
  9262. };
  9263. /**********
  9264. * Private Methods
  9265. **********/
  9266. /**
  9267. * @param {string|Date} date - The Date to show in calendar
  9268. * @param {number} [startDayOfWeek=0] - The Start day of week
  9269. * @param {boolean} [workweek=false] - The only show work week
  9270. * @returns {array} render range
  9271. * @private
  9272. */
  9273. Calendar.prototype._getWeekDayRange = function(date, startDayOfWeek, workweek) {
  9274. var day;
  9275. var start;
  9276. var end;
  9277. var range;
  9278. startDayOfWeek = (startDayOfWeek || 0); // eslint-disable-line
  9279. date = util.isDate(date) ? date : new TZDate(date);
  9280. day = date.getDay();
  9281. // calculate default render range first.
  9282. start = new TZDate(date).addDate(-day + startDayOfWeek);
  9283. end = new TZDate(start).addDate(6);
  9284. if (day < startDayOfWeek) {
  9285. start = new TZDate(start).addDate(-7);
  9286. end = new TZDate(end).addDate(-7);
  9287. }
  9288. if (workweek) {
  9289. range = datetime.range(
  9290. datetime.start(start),
  9291. datetime.end(end),
  9292. datetime.MILLISECONDS_PER_DAY
  9293. );
  9294. range = util.filter(range, function(weekday) {
  9295. return !datetime.isWeekend(weekday.getDay());
  9296. });
  9297. start = range[0];
  9298. end = range[range.length - 1];
  9299. }
  9300. start = datetime.start(start);
  9301. end = datetime.start(end);
  9302. return [start, end];
  9303. };
  9304. /**
  9305. * Toggle schedules' visibility by calendar ID
  9306. * @param {string} calendarId - The calendar id value
  9307. * @param {boolean} toHide - Set true to hide schedules
  9308. * @param {boolean} [render=true] - set true then render after change visible property each models
  9309. */
  9310. Calendar.prototype.toggleSchedules = function(calendarId, toHide, render) {
  9311. var ownSchedules = this._controller.schedules;
  9312. render = util.isExisty(render) ? render : true;
  9313. calendarId = util.isArray(calendarId) ? calendarId : [calendarId];
  9314. ownSchedules.each(function(schedule) {
  9315. if (~util.inArray(schedule.calendarId, calendarId)) {
  9316. schedule.set('isVisible', !toHide);
  9317. }
  9318. });
  9319. if (render) {
  9320. this.render();
  9321. }
  9322. };
  9323. /**********
  9324. * General Methods
  9325. **********/
  9326. /**
  9327. * Render the calendar. The real rendering occurs after requestAnimationFrame.
  9328. * If you have to render immediately, use the 'immediately' parameter as true.
  9329. * @param {boolean} [immediately=false] - Render it immediately
  9330. * @example
  9331. * var silent = true;
  9332. * calendar.clear();
  9333. * calendar.createSchedules(schedules, silent);
  9334. * calendar.render();
  9335. * @example
  9336. * // Render a calendar when resizing a window.
  9337. * window.addEventListener('resize', function() {
  9338. * calendar.render();
  9339. * });
  9340. */
  9341. Calendar.prototype.render = function(immediately) {
  9342. if (this._requestRender) {
  9343. reqAnimFrame.cancelAnimFrame(this._requestRender);
  9344. }
  9345. if (immediately) {
  9346. this._renderFunc();
  9347. } else {
  9348. this._requestRender = reqAnimFrame.requestAnimFrame(this._renderFunc, this);
  9349. }
  9350. };
  9351. /**
  9352. * Render and refresh all layout and process requests.
  9353. * @private
  9354. */
  9355. Calendar.prototype._renderFunc = function() {
  9356. if (this._refreshMethod) {
  9357. this._refreshMethod();
  9358. }
  9359. if (this._layout) {
  9360. this._layout.render();
  9361. }
  9362. if (this._scrollToNowMethod && this._requestScrollToNow) {
  9363. this._scrollToNowMethod();
  9364. }
  9365. this._requestScrollToNow = false;
  9366. this._requestRender = null;
  9367. };
  9368. /**
  9369. * Delete all schedules and clear view. The real rendering occurs after requestAnimationFrame.
  9370. * If you have to render immediately, use the 'immediately' parameter as true.
  9371. * @param {boolean} [immediately=false] - Render it immediately
  9372. * @example
  9373. * calendar.clear();
  9374. * calendar.createSchedules(schedules, true);
  9375. * calendar.render();
  9376. */
  9377. Calendar.prototype.clear = function(immediately) {
  9378. this._controller.clearSchedules();
  9379. this.render(immediately);
  9380. };
  9381. /**
  9382. * Scroll to current time on today in case of daily, weekly view
  9383. * @example
  9384. * function onNewSchedules(schedules) {
  9385. * calendar.createSchedules(schedules);
  9386. * if (calendar.getViewName() !== 'month') {
  9387. * calendar.scrollToNow();
  9388. * }
  9389. * }
  9390. */
  9391. Calendar.prototype.scrollToNow = function() {
  9392. if (this._scrollToNowMethod) {
  9393. this._requestScrollToNow = true;
  9394. // this._scrollToNowMethod() will be called at next frame rendering.
  9395. }
  9396. };
  9397. /**
  9398. * Move to today.
  9399. * @example
  9400. * function onClickTodayBtn() {
  9401. * calendar.today();
  9402. * }
  9403. */
  9404. Calendar.prototype.today = function() {
  9405. this._renderDate = datetime.start();
  9406. this._setViewName(this._viewName);
  9407. this.move();
  9408. this.render();
  9409. };
  9410. /**
  9411. * Move the calendar amount of offset value
  9412. * @param {number} offset - The offset value.
  9413. * @private
  9414. * @example
  9415. * // move previous week when "week" view.
  9416. * // move previous month when "month" view.
  9417. * calendar.move(-1);
  9418. */
  9419. // eslint-disable-next-line complexity
  9420. Calendar.prototype.move = function(offset) {
  9421. var renderDate = dw(datetime.start(this._renderDate)),
  9422. viewName = this._viewName,
  9423. view = this._getCurrentView(),
  9424. recursiveSet = _setOptionRecurseively,
  9425. startDate,
  9426. endDate,
  9427. tempDate,
  9428. startDayOfWeek,
  9429. visibleWeeksCount,
  9430. workweek,
  9431. isAlways6Week,
  9432. datetimeOptions;
  9433. offset = util.isExisty(offset) ? offset : 0;
  9434. if (viewName === 'month') {
  9435. startDayOfWeek = util.pick(this._options, 'month', 'startDayOfWeek') || 0;
  9436. visibleWeeksCount = mmin(util.pick(this._options, 'month', 'visibleWeeksCount') || 0, 6);
  9437. workweek = util.pick(this._options, 'month', 'workweek') || false;
  9438. isAlways6Week = util.pick(this._options, 'month', 'isAlways6Week');
  9439. if (visibleWeeksCount) {
  9440. datetimeOptions = {
  9441. startDayOfWeek: startDayOfWeek,
  9442. isAlways6Week: false,
  9443. visibleWeeksCount: visibleWeeksCount,
  9444. workweek: workweek
  9445. };
  9446. renderDate.addDate(offset * 7 * datetimeOptions.visibleWeeksCount);
  9447. tempDate = datetime.arr2dCalendar(renderDate.d, datetimeOptions);
  9448. recursiveSet(view, function(childView, opt) {
  9449. opt.renderMonth = new TZDate(renderDate.d);
  9450. });
  9451. } else {
  9452. datetimeOptions = {
  9453. startDayOfWeek: startDayOfWeek,
  9454. isAlways6Week: isAlways6Week,
  9455. workweek: workweek
  9456. };
  9457. renderDate.addMonth(offset);
  9458. tempDate = datetime.arr2dCalendar(renderDate.d, datetimeOptions);
  9459. recursiveSet(view, function(childView, opt) {
  9460. opt.renderMonth = new TZDate(renderDate.d);
  9461. });
  9462. }
  9463. startDate = tempDate[0][0];
  9464. endDate = tempDate[tempDate.length - 1][tempDate[tempDate.length - 1].length - 1];
  9465. } else if (viewName === 'week') {
  9466. renderDate.addDate(offset * 7);
  9467. startDayOfWeek = util.pick(this._options, 'week', 'startDayOfWeek') || 0;
  9468. workweek = util.pick(this._options, 'week', 'workweek') || false;
  9469. tempDate = this._getWeekDayRange(renderDate.d, startDayOfWeek, workweek);
  9470. startDate = tempDate[0];
  9471. endDate = tempDate[1];
  9472. recursiveSet(view, function(childView, opt) {
  9473. opt.renderStartDate = new TZDate(startDate);
  9474. opt.renderEndDate = new TZDate(endDate);
  9475. childView.setState({
  9476. collapsed: true
  9477. });
  9478. });
  9479. } else if (viewName === 'day') {
  9480. renderDate.addDate(offset);
  9481. startDate = datetime.start(renderDate.d);
  9482. endDate = datetime.end(renderDate.d);
  9483. recursiveSet(view, function(childView, opt) {
  9484. opt.renderStartDate = new TZDate(startDate);
  9485. opt.renderEndDate = new TZDate(endDate);
  9486. childView.setState({
  9487. collapsed: true
  9488. });
  9489. });
  9490. }
  9491. this._renderDate = renderDate.d;
  9492. this._renderRange = {
  9493. start: startDate,
  9494. end: endDate
  9495. };
  9496. };
  9497. /**
  9498. * Move to specific date
  9499. * @param {(Date|string)} date - The date to move
  9500. * @example
  9501. * calendar.on('clickDayname', function(event) {
  9502. * if (calendar.getViewName() === 'week') {
  9503. * calendar.setDate(new Date(event.date));
  9504. * calendar.changeView('day', true);
  9505. * }
  9506. * });
  9507. */
  9508. Calendar.prototype.setDate = function(date) {
  9509. if (util.isString(date)) {
  9510. date = datetime.parse(date);
  9511. }
  9512. this._renderDate = new TZDate(date);
  9513. this._setViewName(this._viewName);
  9514. this.move(0);
  9515. this.render();
  9516. };
  9517. /**
  9518. * Move the calendar forward a day, a week, a month, 2 weeks, 3 weeks.
  9519. * @example
  9520. * function moveToNextOrPrevRange(val) {
  9521. if (val === -1) {
  9522. calendar.prev();
  9523. } else if (val === 1) {
  9524. calendar.next();
  9525. }
  9526. }
  9527. */
  9528. Calendar.prototype.next = function() {
  9529. this.move(1);
  9530. this.render();
  9531. };
  9532. /**
  9533. * Move the calendar backward a day, a week, a month, 2 weeks, 3 weeks.
  9534. * @example
  9535. * function moveToNextOrPrevRange(val) {
  9536. if (val === -1) {
  9537. calendar.prev();
  9538. } else if (val === 1) {
  9539. calendar.next();
  9540. }
  9541. }
  9542. */
  9543. Calendar.prototype.prev = function() {
  9544. this.move(-1);
  9545. this.render();
  9546. };
  9547. /**
  9548. * Return current rendered view.
  9549. * @returns {View} current view instance
  9550. * @private
  9551. */
  9552. Calendar.prototype._getCurrentView = function() {
  9553. var viewName = this._viewName;
  9554. if (viewName === 'day') {
  9555. viewName = 'week';
  9556. }
  9557. return util.pick(this._layout.children.items, viewName);
  9558. };
  9559. /**
  9560. * Change calendar's schedule color with option
  9561. * @param {string} calendarId - The calendar ID
  9562. * @param {CalendarColor} option - The {@link CalendarColor} object
  9563. * @param {boolean} [silent=false] - No auto render after creation when set true
  9564. * @example
  9565. * calendar.setCalendarColor('1', {
  9566. * color: '#e8e8e8',
  9567. * bgColor: '#585858',
  9568. * borderColor: '#a1b56c'
  9569. * dragBgColor: '#585858',
  9570. * });
  9571. * calendar.setCalendarColor('2', {
  9572. * color: '#282828',
  9573. * bgColor: '#dc9656',
  9574. * borderColor: '#a1b56c',
  9575. * dragBgColor: '#dc9656',
  9576. * });
  9577. * calendar.setCalendarColor('3', {
  9578. * color: '#a16946',
  9579. * bgColor: '#ab4642',
  9580. * borderColor: '#a1b56c',
  9581. * dragBgColor: '#ab4642',
  9582. * });
  9583. */
  9584. Calendar.prototype.setCalendarColor = function(calendarId, option, silent) {
  9585. var calColor = this._calendarColor,
  9586. ownSchedules = this._controller.schedules,
  9587. ownColor = calColor[calendarId];
  9588. if (!util.isObject(option)) {
  9589. config.throwError(
  9590. "Calendar#changeCalendarColor(): color 는 {color: '', bgColor: ''} 형태여야 합니다."
  9591. );
  9592. }
  9593. ownColor = calColor[calendarId] = util.extend(
  9594. {
  9595. color: '#000',
  9596. bgColor: '#a1b56c',
  9597. borderColor: '#a1b56c',
  9598. dragBgColor: '#a1b56c'
  9599. },
  9600. option
  9601. );
  9602. ownSchedules.each(function(model) {
  9603. if (model.calendarId !== calendarId) {
  9604. return;
  9605. }
  9606. model.color = ownColor.color;
  9607. model.bgColor = ownColor.bgColor;
  9608. model.borderColor = ownColor.borderColor;
  9609. model.dragBgColor = ownColor.dragBgColor;
  9610. });
  9611. if (!silent) {
  9612. this.render();
  9613. }
  9614. };
  9615. /**********
  9616. * Custom Events
  9617. **********/
  9618. /**
  9619. * A bridge-based event handler for connecting a click handler to a user click event handler for each view
  9620. * @fires Calendar#clickSchedule
  9621. * @param {object} clickScheduleData - The event data of 'clickSchedule' handler
  9622. * @private
  9623. */
  9624. Calendar.prototype._onClick = function(clickScheduleData) {
  9625. /**
  9626. * Fire this event when click a schedule.
  9627. * @event Calendar#clickSchedule
  9628. * @type {object}
  9629. * @property {Schedule} schedule - The {@link Schedule} instance
  9630. * @property {MouseEvent} event - MouseEvent
  9631. * @example
  9632. * calendar.on('clickSchedule', function(event) {
  9633. * var schedule = event.schedule;
  9634. *
  9635. * if (lastClickSchedule) {
  9636. * calendar.updateSchedule(lastClickSchedule.id, lastClickSchedule.calendarId, {
  9637. * isFocused: false
  9638. * });
  9639. * }
  9640. * calendar.updateSchedule(schedule.id, schedule.calendarId, {
  9641. * isFocused: true
  9642. * });
  9643. *
  9644. * lastClickSchedule = schedule;
  9645. * // open detail view
  9646. * });
  9647. */
  9648. this.fire('clickSchedule', clickScheduleData);
  9649. };
  9650. /**
  9651. * A bridge-based event handler for connecting a click handler to a user click event handler for each view
  9652. * @fires Calendar#clickMore
  9653. * @param {object} clickMoreSchedule - The event data of 'clickMore' handler
  9654. * @private
  9655. */
  9656. Calendar.prototype._onClickMore = function(clickMoreSchedule) {
  9657. /**
  9658. * Fire this event when click a schedule.
  9659. * @event Calendar#clickMore
  9660. * @type {object}
  9661. * @property {Date} date - The Clicked date
  9662. * @property {HTMLElement} target - The more element
  9663. * @example
  9664. * calendar.on('clickMore', function(event) {
  9665. * console.log('clickMore', event.date, event.target);
  9666. * });
  9667. */
  9668. this.fire('clickMore', clickMoreSchedule);
  9669. };
  9670. /**
  9671. * dayname click event handler
  9672. * @fires Calendar#clickDayname
  9673. * @param {object} clickScheduleData - The event data of 'clickDayname' handler
  9674. * @private
  9675. */
  9676. Calendar.prototype._onClickDayname = function(clickScheduleData) {
  9677. /**
  9678. * Fire this event when click a day name in weekly.
  9679. * @event Calendar#clickDayname
  9680. * @type {object}
  9681. * @property {string} date - The date string by format 'YYYY-MM-DD'
  9682. * @example
  9683. * calendar.on('clickDayname', function(event) {
  9684. * if (calendar.getViewName() === 'week') {
  9685. * calendar.setDate(new Date(event.date));
  9686. * calendar.changeView('day', true);
  9687. * }
  9688. * });
  9689. */
  9690. this.fire('clickDayname', clickScheduleData);
  9691. };
  9692. /**
  9693. * @fires {Calendar#n('beforeCreateSchedule', function}
  9694. * @param {object} createScheduleData - select schedule data from allday, time
  9695. * @private
  9696. */
  9697. Calendar.prototype._onBeforeCreate = function(createScheduleData) {
  9698. if (this._options.useCreationPopup && !createScheduleData.useCreationPopup) {
  9699. if (this._showCreationPopup) {
  9700. this._showCreationPopup(createScheduleData);
  9701. return;
  9702. }
  9703. }
  9704. /**
  9705. * Fire this event when select time period in daily, weekly, monthly.
  9706. * @event Calendar#beforeCreateSchedule
  9707. * @type {object}
  9708. * @property {boolean} isAllDay - The allday schedule
  9709. * @property {Date} start - The selected start time
  9710. * @property {Date} end - The selected end time
  9711. * @property {TimeCreationGuide} guide - {@link TimeCreationGuide} instance
  9712. * @property {string} triggerEventName - The event name like 'click', 'dblclick'
  9713. * @example
  9714. * calendar.on('beforeCreateSchedule', function(event) {
  9715. * var startTime = event.start;
  9716. * var endTime = event.end;
  9717. * var isAllDay = event.isAllDay;
  9718. * var guide = event.guide;
  9719. * var triggerEventName = event.triggerEventName;
  9720. * var schedule;
  9721. *
  9722. * if (triggerEventName === 'click') {
  9723. * // open writing simple schedule popup
  9724. * schedule = {...};
  9725. * } else if (triggerEventName === 'dblclick') {
  9726. * // open writing detail schedule popup
  9727. * schedule = {...};
  9728. * }
  9729. *
  9730. * calendar.createSchedules([schedule]);
  9731. * });
  9732. */
  9733. this.fire('beforeCreateSchedule', createScheduleData);
  9734. };
  9735. /**
  9736. * @fires Calendar#beforeUpdateSchedule
  9737. * @param {object} updateScheduleData - update {@link Schedule} data
  9738. * @private
  9739. */
  9740. Calendar.prototype._onBeforeUpdate = function(updateScheduleData) {
  9741. /**
  9742. * Fire this event when drag a schedule to change time in daily, weekly, monthly.
  9743. * @event Calendar#beforeUpdateSchedule
  9744. * @type {object}
  9745. * @property {Schedule} schedule - The original {@link Schedule} instance
  9746. * @property {object} changes - The {@link Schedule} properties and values with changes to update
  9747. * @property {Date} start - Deprecated: start time to update
  9748. * @property {Date} end - Deprecated: end time to update
  9749. * @example
  9750. * calendar.on('beforeUpdateSchedule', function(event) {
  9751. * var schedule = event.schedule;
  9752. * var changes = event.changes;
  9753. *
  9754. * calendar.updateSchedule(schedule.id, schedule.calendarId, changes);
  9755. * });
  9756. */
  9757. this.fire('beforeUpdateSchedule', updateScheduleData);
  9758. };
  9759. /**
  9760. * @fires Calendar#beforeDeleteSchedule
  9761. * @param {object} deleteScheduleData - delete schedule data
  9762. * @private
  9763. */
  9764. Calendar.prototype._onBeforeDelete = function(deleteScheduleData) {
  9765. /**
  9766. * Fire this event when delete a schedule.
  9767. * @event Calendar#beforeDeleteSchedule
  9768. * @type {object}
  9769. * @property {Schedule} schedule - The {@link Schedule} instance to delete
  9770. * @example
  9771. * calendar.on('beforeDeleteSchedule', function(event) {
  9772. * var schedule = event.schedule;
  9773. * alert('The schedule is removed.', schedule);
  9774. * });
  9775. */
  9776. this.fire('beforeDeleteSchedule', deleteScheduleData);
  9777. };
  9778. /**
  9779. * @fires Calendar#afterRenderSchedule
  9780. * @param {Schedule} scheduleData - The schedule data
  9781. * @private
  9782. */
  9783. Calendar.prototype._onAfterRenderSchedule = function(scheduleData) {
  9784. /**
  9785. * Fire this event by every single schedule after rendering whole calendar.
  9786. * @event Calendar#afterRenderSchedule
  9787. * @type {object}
  9788. * @property {Schedule} schedule - A rendered {@link Schedule} instance
  9789. * @example
  9790. * calendar.on('afterRenderSchedule', function(event) {
  9791. * var schedule = event.schedule;
  9792. * var element = calendar.getElement(schedule.id, schedule.calendarId);
  9793. * // use the element
  9794. * console.log(element);
  9795. * });
  9796. */
  9797. this.fire('afterRenderSchedule', scheduleData);
  9798. };
  9799. /**
  9800. * @fires Calendar#clickTimezonesCollapseBtn
  9801. * @param {boolean} timezonesCollapsed - timezones collapsed flag
  9802. * @private
  9803. */
  9804. Calendar.prototype._onClickTimezonesCollapseBtn = function(timezonesCollapsed) {
  9805. /**
  9806. * Fire this event by clicking timezones collapse button
  9807. * @event Calendar#clickTimezonesCollapseBtn
  9808. * @type {object}
  9809. * @property {boolean} timezonesCollapsed - The timezones collapes flag
  9810. * @example
  9811. * calendar.on('clickTimezonesCollapseBtn', function(timezonesCollapsed) {
  9812. * console.log(timezonesCollapsed);
  9813. * });
  9814. */
  9815. this.fire('clickTimezonesCollapseBtn', timezonesCollapsed);
  9816. };
  9817. /**
  9818. * Toggle calendar factory class, main view, wallview event connection
  9819. * @param {boolean} isAttach - attach events if true.
  9820. * @param {Week|Month} view - Weekly view or Monthly view
  9821. * @private
  9822. */
  9823. Calendar.prototype._toggleViewSchedule = function(isAttach, view) {
  9824. var self = this,
  9825. handler = view.handler,
  9826. method = isAttach ? 'on' : 'off';
  9827. util.forEach(handler.click, function(clickHandler) {
  9828. clickHandler[method]('clickSchedule', self._onClick, self);
  9829. });
  9830. util.forEach(handler.dayname, function(clickHandler) {
  9831. clickHandler[method]('clickDayname', self._onClickDayname, self);
  9832. });
  9833. util.forEach(handler.creation, function(creationHandler) {
  9834. creationHandler[method]('beforeCreateSchedule', self._onBeforeCreate, self);
  9835. creationHandler[method]('beforeDeleteSchedule', self._onBeforeDelete, self);
  9836. });
  9837. util.forEach(handler.move, function(moveHandler) {
  9838. moveHandler[method]('beforeUpdateSchedule', self._onBeforeUpdate, self);
  9839. });
  9840. util.forEach(handler.resize, function(resizeHandler) {
  9841. resizeHandler[method]('beforeUpdateSchedule', self._onBeforeUpdate, self);
  9842. });
  9843. // bypass events from view
  9844. view[method]('afterRenderSchedule', self._onAfterRenderSchedule, self);
  9845. view[method]('clickTimezonesCollapseBtn', self._onClickTimezonesCollapseBtn, self);
  9846. view[method]('clickMore', self._onClickMore, self);
  9847. };
  9848. /**
  9849. * Change current view with view name('day', 'week', 'month')
  9850. * @param {string} newViewName - The New view name to render
  9851. * @param {boolean} force - Force render despite of current view and new view are equal
  9852. * @example
  9853. * // daily view
  9854. * calendar.changeView('day', true);
  9855. *
  9856. * // weekly view
  9857. * calendar.changeView('week', true);
  9858. *
  9859. * // monthly view(default 6 weeks view)
  9860. * calendar.setOptions({month: {visibleWeeksCount: 6}}, true); // or null
  9861. * calendar.changeView('month', true);
  9862. *
  9863. * // 2 weeks monthly view
  9864. * calendar.setOptions({month: {visibleWeeksCount: 2}}, true);
  9865. * calendar.changeView('month', true);
  9866. *
  9867. * // 3 weeks monthly view
  9868. * calendar.setOptions({month: {visibleWeeksCount: 3}}, true);
  9869. * calendar.changeView('month', true);
  9870. *
  9871. * // narrow weekend
  9872. * calendar.setOptions({month: {narrowWeekend: true}}, true);
  9873. * calendar.setOptions({week: {narrowWeekend: true}}, true);
  9874. * calendar.changeView(calendar.getViewName(), true);
  9875. *
  9876. * // change start day of week(from monday)
  9877. * calendar.setOptions({week: {startDayOfWeek: 1}}, true);
  9878. * calendar.setOptions({month: {startDayOfWeek: 1}}, true);
  9879. * calendar.changeView(calendar.getViewName(), true);
  9880. *
  9881. * // work week
  9882. * calendar.setOptions({week: {workweek: true}}, true);
  9883. * calendar.setOptions({month: {workweek: true}}, true);
  9884. * calendar.changeView(calendar.getViewName(), true);
  9885. */
  9886. // eslint-disable-next-line complexity
  9887. Calendar.prototype.changeView = function(newViewName, force) {
  9888. var self = this,
  9889. layout = this._layout,
  9890. controller = this._controller,
  9891. dragHandler = this._dragHandler,
  9892. options = this._options,
  9893. viewName = this._viewName,
  9894. created;
  9895. if (!force && viewName === newViewName) {
  9896. return;
  9897. }
  9898. this._setViewName(newViewName);
  9899. // convert day to week
  9900. if (viewName === 'day') {
  9901. viewName = 'week';
  9902. }
  9903. if (newViewName === 'day') {
  9904. newViewName = 'week';
  9905. }
  9906. layout.children.doWhenHas(viewName, function(view) {
  9907. self._toggleViewSchedule(false, view);
  9908. });
  9909. layout.clear();
  9910. if (newViewName === 'month') {
  9911. created = _createMonthView(controller, layout.container, dragHandler, options);
  9912. } else if (newViewName === 'week') {
  9913. created = _createWeekView(
  9914. controller,
  9915. layout.container,
  9916. dragHandler,
  9917. options,
  9918. this.getViewName()
  9919. );
  9920. }
  9921. layout.addChild(created.view);
  9922. layout.children.doWhenHas(newViewName, function(view) {
  9923. self._toggleViewSchedule(true, view);
  9924. });
  9925. this._refreshMethod = created.refresh;
  9926. this._scrollToNowMethod = created.scrollToNow;
  9927. this._openCreationPopup = created.openCreationPopup;
  9928. this._showCreationPopup = created.showCreationPopup;
  9929. this._hideMoreView = created.hideMoreView;
  9930. this.move();
  9931. this.render();
  9932. };
  9933. /**
  9934. * @deprecated
  9935. * Toggle task view('Milestone', 'Task') panel
  9936. * @param {boolean} enabled - use task view
  9937. * @example
  9938. * // There is no milestone, task, so hide those view panel
  9939. * calendar.toggleTaskView(false);
  9940. *
  9941. * // There are some milestone, task, so show those view panel.
  9942. * calendar.toggleTaskView(true);
  9943. */
  9944. Calendar.prototype.toggleTaskView = function(enabled) {
  9945. var viewName = this._viewName,
  9946. options = this._options;
  9947. options.taskView = enabled;
  9948. this.changeView(viewName, true);
  9949. };
  9950. /**
  9951. * @deprecated
  9952. * Toggle schedule view('AllDay', TimeGrid') panel
  9953. * @param {boolean} enabled - use task view
  9954. * @example
  9955. * // hide those view panel to show only 'Milestone', 'Task'
  9956. * calendar.toggleScheduleView(false);
  9957. *
  9958. * // show those view panel.
  9959. * calendar.toggleScheduleView(true);
  9960. */
  9961. Calendar.prototype.toggleScheduleView = function(enabled) {
  9962. var viewName = this._viewName,
  9963. options = this._options;
  9964. options.scheduleView = enabled;
  9965. this.changeView(viewName, true);
  9966. };
  9967. /**
  9968. * Set current view name
  9969. * @param {string} viewName - new view name to render
  9970. * @private
  9971. */
  9972. Calendar.prototype._setViewName = function(viewName) {
  9973. this._viewName = viewName;
  9974. };
  9975. /**
  9976. * Get a schedule element by schedule id and calendar id.
  9977. * @param {string} scheduleId - ID of schedule
  9978. * @param {string} calendarId - calendarId of schedule
  9979. * @returns {HTMLElement} schedule element if found or null
  9980. * @example
  9981. * var element = calendar.getElement(scheduleId, calendarId);
  9982. * console.log(element);
  9983. */
  9984. Calendar.prototype.getElement = function(scheduleId, calendarId) {
  9985. var schedule = this.getSchedule(scheduleId, calendarId);
  9986. if (schedule) {
  9987. return document.querySelector(
  9988. '[data-schedule-id="' + scheduleId + '"][data-calendar-id="' + calendarId + '"]'
  9989. );
  9990. }
  9991. return null;
  9992. };
  9993. /**
  9994. * Set a theme. If some keys are not defined in the preset, will be return.
  9995. * @param {object} theme - multiple styles map
  9996. * @returns {Array.<string>} keys - error keys not predefined.
  9997. * @example
  9998. * cal.setTheme({
  9999. 'month.dayname.height': '31px',
  10000. 'common.dayname.color': '#333',
  10001. 'month.dayname.borderBottom': '1px solid #e5e5e5' // Not valid key will be return.
  10002. * });
  10003. */
  10004. Calendar.prototype.setTheme = function(theme) {
  10005. var result = this._controller.setTheme(theme);
  10006. this.render(true);
  10007. return result;
  10008. };
  10009. /**
  10010. * Set options of calendar
  10011. * @param {Options} options - set {@link Options}
  10012. * @param {boolean} [silent=false] - no auto render after creation when set true
  10013. */
  10014. Calendar.prototype.setOptions = function(options, silent) {
  10015. util.forEach(
  10016. options,
  10017. function(value, name) {
  10018. if (util.isObject(value) && !util.isArray(value)) {
  10019. util.forEach(
  10020. value,
  10021. function(innerValue, innerName) {
  10022. this._options[name][innerName] = innerValue;
  10023. },
  10024. this
  10025. );
  10026. } else {
  10027. this._options[name] = value;
  10028. }
  10029. },
  10030. this
  10031. );
  10032. this._setAdditionalInternalOptions(options);
  10033. if (!silent) {
  10034. this.changeView(this._viewName, true);
  10035. }
  10036. };
  10037. /**
  10038. * Get current {@link Options}.
  10039. * @returns {Options} options
  10040. */
  10041. Calendar.prototype.getOptions = function() {
  10042. return this._options;
  10043. };
  10044. /**
  10045. * Current rendered date ({@link TZDate} for further information)
  10046. * @returns {TZDate}
  10047. */
  10048. Calendar.prototype.getDate = function() {
  10049. return this._renderDate;
  10050. };
  10051. /**
  10052. * Start time of rendered date range ({@link TZDate} for further information)
  10053. * @returns {TZDate}
  10054. */
  10055. Calendar.prototype.getDateRangeStart = function() {
  10056. return this._renderRange.start;
  10057. };
  10058. /**
  10059. * End time of rendered date range ({@link TZDate} for further information)
  10060. * @returns {TZDate}
  10061. */
  10062. Calendar.prototype.getDateRangeEnd = function() {
  10063. return this._renderRange.end;
  10064. };
  10065. /**
  10066. * Get current view name('day', 'week', 'month')
  10067. * @returns {string} view name
  10068. */
  10069. Calendar.prototype.getViewName = function() {
  10070. return this._viewName;
  10071. };
  10072. /**
  10073. * Set calendar list
  10074. * @param {Array.<CalendarProps>} calendars - {@link CalendarProps} List
  10075. */
  10076. Calendar.prototype.setCalendars = function(calendars) {
  10077. util.forEach(
  10078. calendars || [],
  10079. function(calendar) {
  10080. this.setCalendarColor(calendar.id, calendar, true);
  10081. },
  10082. this
  10083. );
  10084. this._controller.setCalendars(calendars);
  10085. this.render();
  10086. };
  10087. /**
  10088. * Open schedule creation popup
  10089. * @param {Schedule} schedule - The preset {@link Schedule} data
  10090. */
  10091. Calendar.prototype.openCreationPopup = function(schedule) {
  10092. if (this._openCreationPopup) {
  10093. this._openCreationPopup(schedule);
  10094. }
  10095. };
  10096. /**
  10097. * Hide the more view
  10098. */
  10099. Calendar.prototype.hideMoreView = function() {
  10100. if (this._hideMoreView) {
  10101. this._hideMoreView();
  10102. }
  10103. };
  10104. /**
  10105. * Set timezone offset
  10106. * @param {number} offset - The offset (min)
  10107. * @static
  10108. * @deprecated
  10109. * @example
  10110. * var timezoneName = moment.tz.guess();
  10111. * tui.Calendar.setTimezoneOffset(moment.tz.zone(timezoneName).utcOffset(moment()));
  10112. */
  10113. Calendar.setTimezoneOffset = function(offset) {
  10114. tz.setOffset(offset);
  10115. };
  10116. /**
  10117. * Set a callback function to get timezone offset by timestamp
  10118. * @param {function} callback - The callback function
  10119. * @static
  10120. * @deprecated
  10121. * @example
  10122. * var timezoneName = moment.tz.guess();
  10123. * tui.Calendar.setTimezoneOffsetCallback(function(timestamp) {
  10124. * return moment.tz.zone(timezoneName).utcOffset(timestamp));
  10125. * });
  10126. */
  10127. Calendar.setTimezoneOffsetCallback = function(callback) {
  10128. tz.setOffsetCallback(callback);
  10129. };
  10130. /**
  10131. * Create controller instance
  10132. * @returns {Base} controller instance
  10133. * @param {Options} options - calendar options
  10134. * @private
  10135. */
  10136. function _createController(options) {
  10137. return controllerFactory(options);
  10138. }
  10139. /**
  10140. * Create week view instance by dependent module instances
  10141. * @param {Base} controller - controller
  10142. * @param {HTMLElement} container - container element
  10143. * @param {Drag} dragHandler - global drag handler
  10144. * @param {object} options - options for week view
  10145. * @param {string} viewName - 'week', 'day'
  10146. * @returns {Week} week view instance
  10147. * @private
  10148. */
  10149. function _createWeekView(controller, container, dragHandler, options, viewName) {
  10150. return weekViewFactory(controller, container, dragHandler, options, viewName);
  10151. }
  10152. /**
  10153. * Create week view instance by dependent module instances
  10154. * @param {Base} controller - controller
  10155. * @param {HTMLElement} container - container element
  10156. * @param {Drag} dragHandler - global drag handler
  10157. * @param {object} options - options for week view
  10158. * @returns {Month} month view instance
  10159. * @private
  10160. */
  10161. function _createMonthView(controller, container, dragHandler, options) {
  10162. return monthViewFactory(controller, container, dragHandler, options);
  10163. }
  10164. /**
  10165. * Set child view's options recursively
  10166. * @param {View} view - parent view
  10167. * @param {function} func - option manipulate function
  10168. * @private
  10169. */
  10170. function _setOptionRecurseively(view, func) {
  10171. view.recursive(function(childView) {
  10172. var opt = childView.options;
  10173. if (!opt) {
  10174. return;
  10175. }
  10176. func(childView, opt);
  10177. });
  10178. }
  10179. util.CustomEvents.mixin(Calendar);
  10180. module.exports = Calendar;
  10181. /***/ }),
  10182. /***/ "./src/js/factory/controller.js":
  10183. /*!**************************************!*\
  10184. !*** ./src/js/factory/controller.js ***!
  10185. \**************************************/
  10186. /*! no static exports found */
  10187. /***/ (function(module, exports, __webpack_require__) {
  10188. "use strict";
  10189. /**
  10190. * @fileoverview Controller factory module.
  10191. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  10192. */
  10193. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  10194. var Base = __webpack_require__(/*! ../controller/base */ "./src/js/controller/base.js"),
  10195. Core = __webpack_require__(/*! ../controller/viewMixin/core */ "./src/js/controller/viewMixin/core.js"),
  10196. Week = __webpack_require__(/*! ../controller/viewMixin/week */ "./src/js/controller/viewMixin/week.js"),
  10197. Month = __webpack_require__(/*! ../controller/viewMixin/month */ "./src/js/controller/viewMixin/month.js");
  10198. /**
  10199. * Mixin object. create object property to target and mix to that
  10200. * @param {object} from - source object
  10201. * @param {object} to - target object
  10202. * @param {string} propertyName - property name
  10203. */
  10204. function mixin(from, to, propertyName) {
  10205. var obj = to[propertyName] = {};
  10206. util.forEach(from, function(method, methodName) {
  10207. obj[methodName] = method.bind(to);
  10208. });
  10209. }
  10210. /**
  10211. * @param {object} options - options for base controller
  10212. * @param {function} [options.groupFunc] - function for group each models {@see Collection#groupBy}
  10213. * @returns {Base} The controller instance.
  10214. */
  10215. module.exports = function(options) {
  10216. var controller = new Base(options);
  10217. mixin(Core, controller, 'Core');
  10218. mixin(Week, controller, 'Week');
  10219. mixin(Month, controller, 'Month');
  10220. // for Theme
  10221. controller.Core.theme = controller.theme;
  10222. controller.Week.theme = controller.theme;
  10223. controller.Month.theme = controller.theme;
  10224. return controller;
  10225. };
  10226. /***/ }),
  10227. /***/ "./src/js/factory/monthView.js":
  10228. /*!*************************************!*\
  10229. !*** ./src/js/factory/monthView.js ***!
  10230. \*************************************/
  10231. /*! no static exports found */
  10232. /***/ (function(module, exports, __webpack_require__) {
  10233. "use strict";
  10234. /**
  10235. * @fileoverview Month view factory module
  10236. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  10237. */
  10238. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  10239. var config = __webpack_require__(/*! ../config */ "./src/js/config.js"),
  10240. array = __webpack_require__(/*! ../common/array */ "./src/js/common/array.js"),
  10241. datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js"),
  10242. domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js"),
  10243. common = __webpack_require__(/*! ../common/common */ "./src/js/common/common.js"),
  10244. Month = __webpack_require__(/*! ../view/month/month */ "./src/js/view/month/month.js"),
  10245. MonthClick = __webpack_require__(/*! ../handler/month/click */ "./src/js/handler/month/click.js"),
  10246. MonthCreation = __webpack_require__(/*! ../handler/month/creation */ "./src/js/handler/month/creation.js"),
  10247. MonthResize = __webpack_require__(/*! ../handler/month/resize */ "./src/js/handler/month/resize.js"),
  10248. MonthMove = __webpack_require__(/*! ../handler/month/move */ "./src/js/handler/month/move.js"),
  10249. More = __webpack_require__(/*! ../view/month/more */ "./src/js/view/month/more.js"),
  10250. ScheduleCreationPopup = __webpack_require__(/*! ../view/popup/scheduleCreationPopup */ "./src/js/view/popup/scheduleCreationPopup.js"),
  10251. ScheduleDetailPopup = __webpack_require__(/*! ../view/popup/scheduleDetailPopup */ "./src/js/view/popup/scheduleDetailPopup.js"),
  10252. Schedule = __webpack_require__(/*! ../model/schedule */ "./src/js/model/schedule.js");
  10253. /**
  10254. * Get the view model for more layer
  10255. * @param {TZDate} date - date has more schedules
  10256. * @param {HTMLElement} target - target element
  10257. * @param {Collection} schedules - schedule collection
  10258. * @param {string[]} daynames - daynames to use upside of month more view
  10259. * @returns {object} view model
  10260. */
  10261. function getViewModelForMoreLayer(date, target, schedules, daynames) {
  10262. schedules.each(function(schedule) {
  10263. var model = schedule.model;
  10264. schedule.hasMultiDates = datetime.hasMultiDates(model.start, model.end);
  10265. });
  10266. return {
  10267. target: target,
  10268. date: datetime.format(date, 'YYYY.MM.DD'),
  10269. dayname: daynames[date.getDay()],
  10270. schedules: schedules.sort(array.compare.schedule.asc)
  10271. };
  10272. }
  10273. /**
  10274. * @param {Base} baseController - controller instance
  10275. * @param {HTMLElement} layoutContainer - container element for month view
  10276. * @param {Drag} dragHandler - drag handler instance
  10277. * @param {object} options - options
  10278. * @returns {object} view instance and refresh method
  10279. */
  10280. function createMonthView(baseController, layoutContainer, dragHandler, options) {
  10281. var monthViewContainer, monthView, moreView, createView;
  10282. var clickHandler, creationHandler, resizeHandler, moveHandler, clearSchedulesHandler, onUpdateSchedule;
  10283. var onShowCreationPopup, onSaveNewSchedule, onShowEditPopup;
  10284. var detailView, onShowDetailPopup, onDeleteSchedule, onEditSchedule;
  10285. monthViewContainer = domutil.appendHTMLElement(
  10286. 'div', layoutContainer, config.classname('month'));
  10287. monthView = new Month(options, monthViewContainer, baseController.Month);
  10288. moreView = new More(options.month, layoutContainer, baseController.theme);
  10289. // handlers
  10290. clickHandler = new MonthClick(dragHandler, monthView, baseController);
  10291. if (!options.isReadOnly) {
  10292. creationHandler = new MonthCreation(dragHandler, monthView, baseController, options);
  10293. resizeHandler = new MonthResize(dragHandler, monthView, baseController);
  10294. moveHandler = new MonthMove(dragHandler, monthView, baseController);
  10295. }
  10296. clearSchedulesHandler = function() {
  10297. if (moreView) {
  10298. moreView.hide();
  10299. }
  10300. };
  10301. onUpdateSchedule = function() {
  10302. if (moreView) {
  10303. moreView.refresh();
  10304. }
  10305. };
  10306. // binding +n click schedule
  10307. clickHandler.on('clickMore', function(clickMoreSchedule) {
  10308. var date = clickMoreSchedule.date,
  10309. target = clickMoreSchedule.target,
  10310. schedules = util.pick(baseController.findByDateRange(
  10311. datetime.start(date),
  10312. datetime.end(date)
  10313. ), clickMoreSchedule.ymd);
  10314. schedules.items = util.filter(schedules.items, function(item) {
  10315. return options.month.scheduleFilter(item.model);
  10316. });
  10317. if (schedules && schedules.length) {
  10318. moreView.render(getViewModelForMoreLayer(date, target, schedules, monthView.options.daynames));
  10319. schedules.each(function(scheduleViewModel) {
  10320. if (scheduleViewModel) {
  10321. /**
  10322. * @event More#afterRenderSchedule
  10323. */
  10324. monthView.fire('afterRenderSchedule', {schedule: scheduleViewModel.model});
  10325. }
  10326. });
  10327. monthView.fire('clickMore', {
  10328. date: clickMoreSchedule.date,
  10329. target: moreView.getMoreViewElement()
  10330. });
  10331. }
  10332. });
  10333. // binding popup for schedules creation
  10334. if (options.useCreationPopup) {
  10335. createView = new ScheduleCreationPopup(layoutContainer, baseController.calendars, options.usageStatistics);
  10336. onSaveNewSchedule = function(scheduleData) {
  10337. creationHandler.fire('beforeCreateSchedule', util.extend(scheduleData, {
  10338. useCreationPopup: true
  10339. }));
  10340. };
  10341. createView.on('beforeCreateSchedule', onSaveNewSchedule);
  10342. }
  10343. // binding popup for schedule detail
  10344. if (options.useDetailPopup) {
  10345. detailView = new ScheduleDetailPopup(layoutContainer, baseController.calendars);
  10346. onShowDetailPopup = function(eventData) {
  10347. var scheduleId = eventData.schedule.calendarId;
  10348. eventData.calendar = common.find(baseController.calendars, function(calendar) {
  10349. return calendar.id === scheduleId;
  10350. });
  10351. if (options.isReadOnly) {
  10352. eventData.schedule = util.extend({}, eventData.schedule, {isReadOnly: true});
  10353. }
  10354. detailView.render(eventData);
  10355. };
  10356. onDeleteSchedule = function(eventData) {
  10357. if (creationHandler) {
  10358. creationHandler.fire('beforeDeleteSchedule', eventData);
  10359. }
  10360. };
  10361. onEditSchedule = function(eventData) {
  10362. moveHandler.fire('beforeUpdateSchedule', eventData);
  10363. };
  10364. clickHandler.on('clickSchedule', onShowDetailPopup);
  10365. detailView.on('beforeDeleteSchedule', onDeleteSchedule);
  10366. if (options.useCreationPopup) {
  10367. onShowEditPopup = function(eventData) {
  10368. createView.setCalendars(baseController.calendars);
  10369. createView.render(eventData);
  10370. };
  10371. createView.on('beforeUpdateSchedule', onEditSchedule);
  10372. detailView.on('beforeUpdateSchedule', onShowEditPopup);
  10373. } else {
  10374. detailView.on('beforeUpdateSchedule', onEditSchedule);
  10375. }
  10376. }
  10377. // binding clear schedules
  10378. baseController.on('clearSchedules', clearSchedulesHandler);
  10379. // bind update schedule event
  10380. baseController.on('updateSchedule', onUpdateSchedule);
  10381. if (moveHandler) {
  10382. moveHandler.on('monthMoveStart_from_morelayer', function() {
  10383. moreView.hide();
  10384. });
  10385. }
  10386. monthView.handler = {
  10387. click: {
  10388. 'default': clickHandler
  10389. }
  10390. };
  10391. if (!options.isReadOnly) {
  10392. monthView.handler = util.extend(monthView.handler, {
  10393. creation: {
  10394. 'default': creationHandler
  10395. },
  10396. resize: {
  10397. 'default': resizeHandler
  10398. },
  10399. move: {
  10400. 'default': moveHandler
  10401. }
  10402. });
  10403. }
  10404. monthView._beforeDestroy = function() {
  10405. moreView.destroy();
  10406. baseController.off('clearSchedules', clearSchedulesHandler);
  10407. baseController.off('updateSchedule', onUpdateSchedule);
  10408. util.forEach(monthView.handler, function(type) {
  10409. util.forEach(type, function(handler) {
  10410. handler.off();
  10411. handler.destroy();
  10412. });
  10413. });
  10414. if (options.useCreationPopup && options.useDetailPopup) {
  10415. createView.off('beforeUpdateSchedule', onUpdateSchedule);
  10416. }
  10417. if (options.useCreationPopup) {
  10418. if (creationHandler) {
  10419. creationHandler.off('beforeCreateSchedule', onShowCreationPopup);
  10420. }
  10421. createView.off('saveSchedule', onSaveNewSchedule);
  10422. createView.destroy();
  10423. }
  10424. if (options.useDetailPopup) {
  10425. clickHandler.off('clickSchedule', onShowDetailPopup);
  10426. detailView.off('beforeUpdateSchedule', onUpdateSchedule);
  10427. detailView.off('beforeDeleteSchedule', onDeleteSchedule);
  10428. detailView.destroy();
  10429. }
  10430. };
  10431. // add controller
  10432. monthView.controller = baseController.Month;
  10433. return {
  10434. view: monthView,
  10435. refresh: function() {
  10436. monthView.vLayout.refresh();
  10437. },
  10438. openCreationPopup: function(schedule) {
  10439. if (createView && creationHandler) {
  10440. creationHandler.invokeCreationClick(Schedule.create(schedule));
  10441. }
  10442. },
  10443. showCreationPopup: function(eventData) {
  10444. if (createView) {
  10445. createView.setCalendars(baseController.calendars);
  10446. createView.render(eventData);
  10447. }
  10448. },
  10449. hideMoreView: function() {
  10450. if (moreView) {
  10451. moreView.hide();
  10452. }
  10453. }
  10454. };
  10455. }
  10456. module.exports = createMonthView;
  10457. /***/ }),
  10458. /***/ "./src/js/factory/weekView.js":
  10459. /*!************************************!*\
  10460. !*** ./src/js/factory/weekView.js ***!
  10461. \************************************/
  10462. /*! no static exports found */
  10463. /***/ (function(module, exports, __webpack_require__) {
  10464. "use strict";
  10465. /**
  10466. * @fileoverview Factory module for WeekView
  10467. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  10468. */
  10469. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  10470. var config = __webpack_require__(/*! ../config */ "./src/js/config.js");
  10471. var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js");
  10472. var common = __webpack_require__(/*! ../common/common */ "./src/js/common/common.js");
  10473. var VLayout = __webpack_require__(/*! ../common/vlayout */ "./src/js/common/vlayout.js");
  10474. var reqAnimFrame = __webpack_require__(/*! ../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
  10475. var Schedule = __webpack_require__(/*! ../model/schedule */ "./src/js/model/schedule.js");
  10476. // Parent views
  10477. var Week = __webpack_require__(/*! ../view/week/week */ "./src/js/view/week/week.js");
  10478. // Sub views
  10479. var DayName = __webpack_require__(/*! ../view/week/dayname */ "./src/js/view/week/dayname.js");
  10480. var DayGrid = __webpack_require__(/*! ../view/week/dayGrid */ "./src/js/view/week/dayGrid.js");
  10481. var TimeGrid = __webpack_require__(/*! ../view/week/timeGrid */ "./src/js/view/week/timeGrid.js");
  10482. var ScheduleCreationPopup = __webpack_require__(/*! ../view/popup/scheduleCreationPopup */ "./src/js/view/popup/scheduleCreationPopup.js");
  10483. var ScheduleDetailPopup = __webpack_require__(/*! ../view/popup/scheduleDetailPopup */ "./src/js/view/popup/scheduleDetailPopup.js");
  10484. // Handlers
  10485. var DayNameClick = __webpack_require__(/*! ../handler/time/clickDayname */ "./src/js/handler/time/clickDayname.js");
  10486. var DayGridClick = __webpack_require__(/*! ../handler/daygrid/click */ "./src/js/handler/daygrid/click.js");
  10487. var DayGridCreation = __webpack_require__(/*! ../handler/daygrid/creation */ "./src/js/handler/daygrid/creation.js");
  10488. var DayGridMove = __webpack_require__(/*! ../handler/daygrid/move */ "./src/js/handler/daygrid/move.js");
  10489. var DayGridResize = __webpack_require__(/*! ../handler/daygrid/resize */ "./src/js/handler/daygrid/resize.js");
  10490. var TimeClick = __webpack_require__(/*! ../handler/time/click */ "./src/js/handler/time/click.js");
  10491. var TimeCreation = __webpack_require__(/*! ../handler/time/creation */ "./src/js/handler/time/creation.js");
  10492. var TimeMove = __webpack_require__(/*! ../handler/time/move */ "./src/js/handler/time/move.js");
  10493. var TimeResize = __webpack_require__(/*! ../handler/time/resize */ "./src/js/handler/time/resize.js");
  10494. var DAYGRID_HANDLDERS = {
  10495. 'click': DayGridClick,
  10496. 'creation': DayGridCreation,
  10497. 'move': DayGridMove,
  10498. 'resize': DayGridResize
  10499. };
  10500. var TIMEGRID_HANDLERS = {
  10501. 'click': TimeClick,
  10502. 'creation': TimeCreation,
  10503. 'move': TimeMove,
  10504. 'resize': TimeResize
  10505. };
  10506. var DEFAULT_PANELS = [
  10507. {
  10508. name: 'milestone',
  10509. type: 'daygrid',
  10510. minHeight: 20,
  10511. maxHeight: 80,
  10512. showExpandableButton: true,
  10513. maxExpandableHeight: 210,
  10514. handlers: ['click'],
  10515. show: true
  10516. },
  10517. {
  10518. name: 'task',
  10519. type: 'daygrid',
  10520. minHeight: 40,
  10521. maxHeight: 120,
  10522. showExpandableButton: true,
  10523. maxExpandableHeight: 210,
  10524. handlers: ['click', 'move'],
  10525. show: true
  10526. },
  10527. {
  10528. name: 'allday',
  10529. type: 'daygrid',
  10530. minHeight: 30,
  10531. maxHeight: 80,
  10532. showExpandableButton: true,
  10533. maxExpandableHeight: 210,
  10534. handlers: ['click', 'creation', 'move', 'resize'],
  10535. show: true
  10536. },
  10537. {
  10538. name: 'time',
  10539. type: 'timegrid',
  10540. autoHeight: true,
  10541. handlers: ['click', 'creation', 'move', 'resize'],
  10542. show: true
  10543. }
  10544. ];
  10545. /* eslint-disable complexity*/
  10546. module.exports = function(baseController, layoutContainer, dragHandler, options, viewName) {
  10547. var panels = [],
  10548. vpanels = [];
  10549. var weekView, dayNameContainer, dayNameView, vLayoutContainer, vLayout;
  10550. var createView, onSaveNewSchedule, onSetCalendars, lastVPanel;
  10551. var detailView, onShowDetailPopup, onDeleteSchedule, onShowEditPopup, onEditSchedule;
  10552. var taskView = options.taskView;
  10553. var scheduleView = options.scheduleView;
  10554. var viewVisibilities = {
  10555. 'milestone': util.isArray(taskView) ? util.inArray('milestone', taskView) >= 0 : taskView,
  10556. 'task': util.isArray(taskView) ? util.inArray('task', taskView) >= 0 : taskView,
  10557. 'allday': util.isArray(scheduleView) ? util.inArray('allday', scheduleView) >= 0 : scheduleView,
  10558. 'time': util.isArray(scheduleView) ? util.inArray('time', scheduleView) >= 0 : scheduleView
  10559. };
  10560. // Make panels by view sequence and visibilities
  10561. util.forEach(DEFAULT_PANELS, function(panel) {
  10562. var name = panel.name;
  10563. panel = util.extend({}, panel);
  10564. panels.push(panel);
  10565. // Change visibilities
  10566. panel.show = viewVisibilities[name];
  10567. if (panel.show) {
  10568. if (vpanels.length) {
  10569. vpanels.push({
  10570. isSplitter: true
  10571. });
  10572. }
  10573. vpanels.push(util.extend({}, panel));
  10574. }
  10575. });
  10576. if (vpanels.length) {
  10577. lastVPanel = vpanels[vpanels.length - 1];
  10578. lastVPanel.autoHeight = true;
  10579. lastVPanel.maxHeight = null;
  10580. lastVPanel.showExpandableButton = false;
  10581. util.forEach(panels, function(panel) {
  10582. if (panel.name === lastVPanel.name) {
  10583. panel.showExpandableButton = false;
  10584. return false;
  10585. }
  10586. return true;
  10587. });
  10588. }
  10589. util.extend(options.week, {panels: panels});
  10590. weekView = new Week(null, options.week, layoutContainer, panels, viewName);
  10591. weekView.handler = {
  10592. click: {},
  10593. dayname: {},
  10594. creation: {},
  10595. move: {},
  10596. resize: {}
  10597. };
  10598. dayNameContainer = domutil.appendHTMLElement('div', weekView.container, config.classname('dayname-layout'));
  10599. /**********
  10600. * Day name (top row(Mon, Tue, Wed...))
  10601. **********/
  10602. dayNameView = new DayName(options, dayNameContainer, baseController.theme);
  10603. weekView.handler.dayname.date = new DayNameClick(dragHandler, dayNameView, baseController);
  10604. weekView.addChild(dayNameView);
  10605. /**********
  10606. * Initialize vertical layout module
  10607. **********/
  10608. vLayoutContainer = domutil.appendHTMLElement('div', weekView.container, config.classname('vlayout-area'));
  10609. vLayoutContainer.style.height = (domutil.getSize(weekView.container)[1] - dayNameView.container.offsetHeight) + 'px';
  10610. vLayout = new VLayout({
  10611. panels: vpanels,
  10612. panelHeights: options.week.panelHeights || []
  10613. }, vLayoutContainer, baseController.theme);
  10614. weekView.vLayout = vLayout;
  10615. util.forEach(panels, function(panel) {
  10616. var name = panel.name;
  10617. var handlers = panel.handlers;
  10618. var view;
  10619. if (!panel.show) {
  10620. return;
  10621. }
  10622. if (panel.type === 'daygrid') {
  10623. /**********
  10624. * Schedule panel by Grid
  10625. **********/
  10626. view = new DayGrid(name, options, vLayout.getPanelByName(panel.name).container, baseController.theme);
  10627. view.on('afterRender', function(viewModel) {
  10628. vLayout.getPanelByName(name).setHeight(null, viewModel.height);
  10629. });
  10630. weekView.addChild(view);
  10631. util.forEach(handlers, function(type) {
  10632. if (!options.isReadOnly || type === 'click') {
  10633. weekView.handler[type][name] =
  10634. new DAYGRID_HANDLDERS[type](dragHandler, view, baseController, options);
  10635. view.addHandler(type, weekView.handler[type][name], vLayout.getPanelByName(name));
  10636. }
  10637. });
  10638. } else if (panel.type === 'timegrid') {
  10639. /**********
  10640. * Schedule panel by TimeGrid
  10641. **********/
  10642. view = new TimeGrid(name, options, vLayout.getPanelByName(name).container);
  10643. weekView.addChild(view);
  10644. util.forEach(handlers, function(type) {
  10645. if (!options.isReadOnly || type === 'click') {
  10646. weekView.handler[type][name] =
  10647. new TIMEGRID_HANDLERS[type](dragHandler, view, baseController, options);
  10648. }
  10649. });
  10650. view.on('clickTimezonesCollapsedBtn', function() {
  10651. var timezonesCollapsed = !weekView.state.timezonesCollapsed;
  10652. weekView.setState({
  10653. timezonesCollapsed: timezonesCollapsed
  10654. });
  10655. reqAnimFrame.requestAnimFrame(function() {
  10656. if (!weekView.invoke('clickTimezonesCollapseBtn', timezonesCollapsed)) {
  10657. weekView.render();
  10658. }
  10659. });
  10660. });
  10661. }
  10662. });
  10663. vLayout.on('resize', function() {
  10664. reqAnimFrame.requestAnimFrame(function() {
  10665. weekView.render();
  10666. });
  10667. });
  10668. // binding create schedules event
  10669. if (options.useCreationPopup) {
  10670. createView = new ScheduleCreationPopup(layoutContainer, baseController.calendars, options.usageStatistics);
  10671. onSaveNewSchedule = function(scheduleData) {
  10672. util.extend(scheduleData, {
  10673. useCreationPopup: true
  10674. });
  10675. if (scheduleData.isAllDay) {
  10676. weekView.handler.creation.allday.fire('beforeCreateSchedule', scheduleData);
  10677. } else {
  10678. weekView.handler.creation.time.fire('beforeCreateSchedule', scheduleData);
  10679. }
  10680. };
  10681. createView.on('beforeCreateSchedule', onSaveNewSchedule);
  10682. }
  10683. onSetCalendars = function(calendars) {
  10684. if (createView) {
  10685. createView.setCalendars(calendars);
  10686. }
  10687. };
  10688. baseController.on('setCalendars', onSetCalendars);
  10689. // binding popup for schedule detail
  10690. if (options.useDetailPopup) {
  10691. detailView = new ScheduleDetailPopup(layoutContainer, baseController.calendars);
  10692. onShowDetailPopup = function(eventData) {
  10693. var scheduleId = eventData.schedule.calendarId;
  10694. eventData.calendar = common.find(baseController.calendars, function(calendar) {
  10695. return calendar.id === scheduleId;
  10696. });
  10697. if (options.isReadOnly) {
  10698. eventData.schedule = util.extend({}, eventData.schedule, {isReadOnly: true});
  10699. }
  10700. detailView.render(eventData);
  10701. };
  10702. onDeleteSchedule = function(eventData) {
  10703. if (eventData.isAllDay) {
  10704. weekView.handler.creation.allday.fire('beforeDeleteSchedule', eventData);
  10705. } else {
  10706. weekView.handler.creation.time.fire('beforeDeleteSchedule', eventData);
  10707. }
  10708. };
  10709. onEditSchedule = function(eventData) {
  10710. if (eventData.isAllDay) {
  10711. weekView.handler.move.allday.fire('beforeUpdateSchedule', eventData);
  10712. } else {
  10713. weekView.handler.move.time.fire('beforeUpdateSchedule', eventData);
  10714. }
  10715. };
  10716. util.forEach(weekView.handler.click, function(panel) {
  10717. panel.on('clickSchedule', onShowDetailPopup);
  10718. });
  10719. if (options.useCreationPopup) {
  10720. onShowEditPopup = function(eventData) {
  10721. var calendars = baseController.calendars;
  10722. eventData.isEditMode = true;
  10723. createView.setCalendars(calendars);
  10724. createView.render(eventData);
  10725. };
  10726. createView.on('beforeUpdateSchedule', onEditSchedule);
  10727. detailView.on('beforeUpdateSchedule', onShowEditPopup);
  10728. } else {
  10729. detailView.on('beforeUpdateSchedule', onEditSchedule);
  10730. }
  10731. detailView.on('beforeDeleteSchedule', onDeleteSchedule);
  10732. }
  10733. weekView.on('afterRender', function() {
  10734. vLayout.refresh();
  10735. });
  10736. // add controller
  10737. weekView.controller = baseController.Week;
  10738. // add destroy
  10739. weekView._beforeDestroy = function() {
  10740. util.forEach(weekView.handler, function(type) {
  10741. util.forEach(type, function(handler) {
  10742. handler.off();
  10743. handler.destroy();
  10744. });
  10745. });
  10746. if (options.useCreationPopup) {
  10747. createView.off('beforeCreateSchedule', onSaveNewSchedule);
  10748. createView.destroy();
  10749. }
  10750. if (options.useDetailPopup) {
  10751. detailView.off('beforeDeleteSchedule', onDeleteSchedule);
  10752. detailView.destroy();
  10753. }
  10754. weekView.off();
  10755. };
  10756. return {
  10757. view: weekView,
  10758. refresh: function() {
  10759. var weekViewHeight = weekView.getViewBound().height,
  10760. daynameViewHeight = domutil.getBCRect(
  10761. dayNameView.container
  10762. ).height;
  10763. vLayout.container.style.height =
  10764. weekViewHeight - daynameViewHeight + 'px';
  10765. vLayout.refresh();
  10766. },
  10767. scrollToNow: function() {
  10768. weekView.children.each(function(childView) {
  10769. if (childView.scrollToNow) {
  10770. childView.scrollToNow();
  10771. }
  10772. });
  10773. },
  10774. openCreationPopup: function(schedule) {
  10775. if (createView) {
  10776. if (schedule.isAllDay) {
  10777. weekView.handler.creation.allday.invokeCreationClick(Schedule.create(schedule));
  10778. } else {
  10779. weekView.handler.creation.time.invokeCreationClick(Schedule.create(schedule));
  10780. }
  10781. }
  10782. },
  10783. showCreationPopup: function(eventData) {
  10784. if (createView) {
  10785. createView.setCalendars(baseController.calendars);
  10786. createView.render(eventData);
  10787. }
  10788. }
  10789. };
  10790. };
  10791. /***/ }),
  10792. /***/ "./src/js/handler/daygrid/click.js":
  10793. /*!*****************************************!*\
  10794. !*** ./src/js/handler/daygrid/click.js ***!
  10795. \*****************************************/
  10796. /*! no static exports found */
  10797. /***/ (function(module, exports, __webpack_require__) {
  10798. "use strict";
  10799. /**
  10800. * @fileoverview Click handle module for daygrid schedules
  10801. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  10802. */
  10803. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  10804. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  10805. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  10806. var DayGridMove = __webpack_require__(/*! ./move */ "./src/js/handler/daygrid/move.js");
  10807. /**
  10808. * @constructor
  10809. * @implements {Handler}
  10810. * @mixes CustomEvents
  10811. * @param {Drag} [dragHandler] - Drag handler instance.
  10812. * @param {DayGrid} [view] - daygrid view instance.
  10813. * @param {Base} [controller] - Base controller instance.
  10814. */
  10815. function DayGridClick(dragHandler, view, controller) {
  10816. /**
  10817. * @type {Drag}
  10818. */
  10819. this.dragHandler = dragHandler;
  10820. /**
  10821. * @type {DayGrid}
  10822. */
  10823. this.view = view;
  10824. /**
  10825. * @type {Base}
  10826. */
  10827. this.controller = controller;
  10828. dragHandler.on({
  10829. 'click': this._onClick
  10830. }, this);
  10831. }
  10832. /**
  10833. * Destroy handler module
  10834. */
  10835. DayGridClick.prototype.destroy = function() {
  10836. this.dragHandler.off(this);
  10837. this.view = this.controller = this.dragHandler = null;
  10838. };
  10839. /**
  10840. * Check target element is expected condition for activate this plugins.
  10841. * @param {HTMLElement} target - The element to check
  10842. * @returns {string} - model id
  10843. */
  10844. DayGridClick.prototype.checkExpectCondition = DayGridMove.prototype.checkExpectedCondition;
  10845. /**
  10846. * Click event handler
  10847. * @param {object} clickEvent - click event data
  10848. * @emits DayGridClick#clickSchedule
  10849. * @emits DayGridClick#collapse
  10850. * @emits DayGridClick#expand
  10851. */
  10852. DayGridClick.prototype._onClick = function(clickEvent) {
  10853. var self = this,
  10854. target = clickEvent.target,
  10855. dayGridScheduleView = this.checkExpectCondition(target),
  10856. scheduleCollection = this.controller.schedules,
  10857. collapseBtnElement = domutil.closest(
  10858. target,
  10859. config.classname('.weekday-collapse-btn')
  10860. ),
  10861. expandBtnElement = domutil.closest(
  10862. target,
  10863. config.classname('.weekday-exceed-in-week')
  10864. ),
  10865. containsTarget = this.view.container.contains(target);
  10866. var blockElement, scheduleElement;
  10867. if (!containsTarget) {
  10868. return;
  10869. }
  10870. if (collapseBtnElement) {
  10871. /**
  10872. * click collpase btn event
  10873. * @events DayGridClick#collapse
  10874. */
  10875. self.fire('collapse');
  10876. return;
  10877. }
  10878. if (expandBtnElement) {
  10879. this.view.setState({
  10880. clickedExpandBtnIndex: parseInt(domutil.getData(expandBtnElement, 'index'), 10)
  10881. });
  10882. /**
  10883. * click expand btn event
  10884. * @events DayGridClick#expand
  10885. */
  10886. self.fire('expand');
  10887. return;
  10888. }
  10889. if (!dayGridScheduleView) {
  10890. return;
  10891. }
  10892. scheduleElement = domutil.closest(target, config.classname('.weekday-schedule'));
  10893. if (scheduleElement) {
  10894. blockElement = domutil.closest(target, config.classname('.weekday-schedule-block'));
  10895. scheduleCollection.doWhenHas(domutil.getData(blockElement, 'id'), function(schedule) {
  10896. /**
  10897. * @events DayGridClick#clickSchedule
  10898. * @type {object}
  10899. * @property {Schedule} schedule - schedule instance
  10900. * @property {MouseEvent} event - MouseEvent object
  10901. */
  10902. self.fire('clickSchedule', {
  10903. schedule: schedule,
  10904. event: clickEvent.originEvent
  10905. });
  10906. });
  10907. }
  10908. };
  10909. util.CustomEvents.mixin(DayGridClick);
  10910. module.exports = DayGridClick;
  10911. /***/ }),
  10912. /***/ "./src/js/handler/daygrid/core.js":
  10913. /*!****************************************!*\
  10914. !*** ./src/js/handler/daygrid/core.js ***!
  10915. \****************************************/
  10916. /*! no static exports found */
  10917. /***/ (function(module, exports, __webpack_require__) {
  10918. "use strict";
  10919. /* eslint no-shadow: 0 */
  10920. /**
  10921. * @fileoverview Base mixin object for handler/daygrid
  10922. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  10923. */
  10924. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  10925. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  10926. var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
  10927. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  10928. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  10929. var mmax = Math.max,
  10930. mmin = Math.min;
  10931. /**
  10932. * @mixin dayGridCore
  10933. */
  10934. var dayGridCore = {
  10935. /**
  10936. * @param {view} view - view instance.
  10937. * @param {MouseEvent} mouseEvent - mouse schedule object.
  10938. * @returns {function|boolean} function that return schedule data by mouse events.
  10939. */
  10940. _retriveScheduleData: function(view, mouseEvent) {
  10941. var weekdayView = view.children.single(),
  10942. container,
  10943. datesInRange,
  10944. containerWidth,
  10945. mousePos,
  10946. dragStartXIndex,
  10947. grids,
  10948. range;
  10949. if (!weekdayView) {
  10950. return false;
  10951. }
  10952. container = weekdayView.container;
  10953. range = weekdayView.getRenderDateRange();
  10954. datesInRange = range.length;
  10955. grids = weekdayView.getRenderDateGrids();
  10956. containerWidth = domutil.getSize(container)[0];
  10957. mousePos = domevent.getMousePosition(mouseEvent, container);
  10958. dragStartXIndex = getX(grids, common.ratio(containerWidth, 100, mousePos[0]));
  10959. /**
  10960. * @param {MouseEvent} mouseEvent - mouse schedule in drag actions.
  10961. * @returns {object} schedule data.
  10962. */
  10963. return function(mouseEvent) {
  10964. var pos = domevent.getMousePosition(mouseEvent, container),
  10965. mouseX = pos[0],
  10966. xIndex = getX(grids, common.ratio(containerWidth, 100, mouseX));
  10967. // apply limitation of creation schedule X index.
  10968. xIndex = mmax(xIndex, 0);
  10969. xIndex = mmin(xIndex, datesInRange - 1);
  10970. return {
  10971. relatedView: view,
  10972. dragStartXIndex: dragStartXIndex,
  10973. datesInRange: datesInRange,
  10974. xIndex: xIndex,
  10975. triggerEvent: mouseEvent.type,
  10976. grids: grids,
  10977. range: range
  10978. };
  10979. };
  10980. },
  10981. /**
  10982. * @param {view} view - view instance.
  10983. * @param {TZDate} startDate - start date
  10984. * @returns {object} schedule data by mouse events.
  10985. */
  10986. _retriveScheduleDataFromDate: function(view, startDate) {
  10987. var weekdayView = view.children.single(),
  10988. xIndex = 0,
  10989. datesInRange,
  10990. dragStartXIndex = 0,
  10991. grids,
  10992. range;
  10993. if (!weekdayView) {
  10994. return false;
  10995. }
  10996. range = weekdayView.getRenderDateRange();
  10997. datesInRange = range.length;
  10998. grids = weekdayView.getRenderDateGrids();
  10999. util.forEach(range, function(date, index) {
  11000. if (datetime.isSameDate(date, startDate)) {
  11001. xIndex = dragStartXIndex = index;
  11002. }
  11003. });
  11004. // apply limitation of creation schedule X index.
  11005. xIndex = mmax(xIndex, 0);
  11006. xIndex = mmin(xIndex, datesInRange - 1);
  11007. return {
  11008. relatedView: view,
  11009. dragStartXIndex: dragStartXIndex,
  11010. datesInRange: datesInRange,
  11011. xIndex: xIndex,
  11012. triggerEvent: 'manual',
  11013. grids: grids,
  11014. range: range
  11015. };
  11016. }
  11017. };
  11018. /**
  11019. * Get the left index
  11020. * @param {Array} grids - grid size information
  11021. * @param {number} left - left position(percent)
  11022. * @returns {number} grid left index
  11023. */
  11024. function getX(grids, left) {
  11025. var i = 0;
  11026. var length = grids.length;
  11027. var grid;
  11028. if (left < 0) {
  11029. left = 0;
  11030. }
  11031. for (; i < length; i += 1) {
  11032. grid = grids[i];
  11033. if (grid.left <= left && left <= (grid.left + grid.width)) {
  11034. return i;
  11035. }
  11036. }
  11037. return i;
  11038. }
  11039. module.exports = dayGridCore;
  11040. /***/ }),
  11041. /***/ "./src/js/handler/daygrid/creation.js":
  11042. /*!********************************************!*\
  11043. !*** ./src/js/handler/daygrid/creation.js ***!
  11044. \********************************************/
  11045. /*! no static exports found */
  11046. /***/ (function(module, exports, __webpack_require__) {
  11047. "use strict";
  11048. /**
  11049. * @fileoverview Handler module for WeekdayInWeek view's creation actions.
  11050. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  11051. */
  11052. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  11053. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  11054. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  11055. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  11056. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  11057. var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
  11058. var dayGridCore = __webpack_require__(/*! ./core */ "./src/js/handler/daygrid/core.js");
  11059. var DayGridCreationGuide = __webpack_require__(/*! ./creationGuide */ "./src/js/handler/daygrid/creationGuide.js");
  11060. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  11061. var CLICK_DELAY = 300;
  11062. /**
  11063. * @constructor
  11064. * @implements {Handler}
  11065. * @mixes dayGridCore
  11066. * @mixes CutomEvents
  11067. * @param {Drag} [dragHandler] - Drag handler instance.
  11068. * @param {DayGrid} [view] - DayGrid view instance.
  11069. * @param {Base} [controller] - Base controller instance.
  11070. * @param {Options} [options] - calendar Options
  11071. */
  11072. function DayGridCreation(dragHandler, view, controller, options) {
  11073. /**
  11074. * Drag handler instance.
  11075. * @type {Drag}
  11076. */
  11077. this.dragHandler = dragHandler;
  11078. /**
  11079. * view instance.
  11080. * @type {DayGrid}
  11081. */
  11082. this.view = view;
  11083. /**
  11084. * Base controller instance.
  11085. * @type {Base}
  11086. */
  11087. this.controller = controller;
  11088. /**
  11089. * @type {function}
  11090. */
  11091. this.getScheduleDataFunc = null;
  11092. /**
  11093. * @type {DayGridCreationGuide}
  11094. */
  11095. this.guide = new DayGridCreationGuide(this);
  11096. /**
  11097. * @type {boolean}
  11098. */
  11099. this._requestOnClick = false;
  11100. /**
  11101. * @type {boolean}
  11102. */
  11103. this._disableDblClick = options.disableDblClick;
  11104. /**
  11105. * @type {boolean}
  11106. */
  11107. this._disableClick = options.disableClick;
  11108. dragHandler.on('dragStart', this._onDragStart, this);
  11109. dragHandler.on('click', this._onClick, this);
  11110. if (this._disableDblClick) {
  11111. CLICK_DELAY = 0;
  11112. } else {
  11113. domevent.on(view.container, 'dblclick', this._onDblClick, this);
  11114. }
  11115. }
  11116. /**
  11117. * Destroy method
  11118. */
  11119. DayGridCreation.prototype.destroy = function() {
  11120. this.guide.destroy();
  11121. this.dragHandler.off(this);
  11122. if (this.view && this.view.container) {
  11123. domevent.off(this.view.container, 'dblclick', this._onDblClick, this);
  11124. }
  11125. this.dragHandler = this.view = this.controller = this.getScheduleDataFunc = null;
  11126. };
  11127. /**
  11128. * Check dragstart target is expected conditions for this handler.
  11129. * @param {HTMLElement} target - dragstart event handler's target element.
  11130. * @returns {boolean|WeekdayInWeek} return WeekdayInWeek view instance when satiate condition.
  11131. */
  11132. DayGridCreation.prototype.checkExpectedCondition = function(target) {
  11133. var cssClass = domutil.getClass(target).trim();
  11134. var excludeTarget = true;
  11135. var matches, schedulesElement;
  11136. if (domutil.closest(target, config.classname('.weekday-exceed-in-week'))
  11137. || domutil.closest(target, config.classname('.weekday-collapse-btn'))
  11138. ) {
  11139. return false;
  11140. }
  11141. if (domutil.closest(target, config.classname('.weekday-schedule-block'), excludeTarget)) {
  11142. return false;
  11143. }
  11144. schedulesElement = domutil.closest(target, config.classname('.weekday-schedules'));
  11145. if (!schedulesElement && cssClass !== config.classname('weekday-schedules')) {
  11146. return false;
  11147. }
  11148. target = schedulesElement ? schedulesElement.parentNode : target.parentNode;
  11149. cssClass = domutil.getClass(target);
  11150. matches = cssClass.match(config.daygrid.getViewIDRegExp);
  11151. if (!matches || matches.length < 2) {
  11152. return false;
  11153. }
  11154. return util.pick(this.view.children.items, matches[1]);
  11155. };
  11156. /**
  11157. * Request schedule model creation to controller by custom schedules.
  11158. * @fires {DayGridCreation#beforeCreateSchedule}
  11159. * @param {object} scheduleData - schedule data from DayGridCreation module.
  11160. */
  11161. DayGridCreation.prototype._createSchedule = function(scheduleData) {
  11162. var dateRange = scheduleData.range,
  11163. startXIndex = scheduleData.dragStartXIndex,
  11164. xIndex = scheduleData.xIndex,
  11165. start, end;
  11166. // when inverse start, end then change it.
  11167. if (xIndex < startXIndex) {
  11168. startXIndex = xIndex + startXIndex;
  11169. xIndex = startXIndex - xIndex;
  11170. startXIndex = startXIndex - xIndex;
  11171. }
  11172. start = new TZDate(dateRange[startXIndex]);
  11173. end = datetime.end(dateRange[xIndex]);
  11174. /**
  11175. * @event {DayGridCreation#beforeCreateSchedule}
  11176. * @type {object}
  11177. * @property {string} category - schedule category
  11178. * @property {boolean} isAllDay - whether schedule is fired in view area?
  11179. * @property {Date} start - select start time
  11180. * @property {Date} end - select end time
  11181. * @property {DayGridCreationGuide} guide - DayGridCreationGuide instance
  11182. * @property {string} triggerEventName - event name
  11183. */
  11184. this.fire('beforeCreateSchedule', {
  11185. category: this.view.options.viewName,
  11186. isAllDay: true,
  11187. start: start,
  11188. end: end,
  11189. guide: this.guide,
  11190. triggerEventName: scheduleData.triggerEvent
  11191. });
  11192. };
  11193. /**
  11194. * DragStart event handler method.
  11195. * @emits DayGridCreation#dragstart
  11196. * @param {object} dragStartEventData - Drag#dragStart event handler schedule data.
  11197. */
  11198. DayGridCreation.prototype._onDragStart = function(dragStartEventData) {
  11199. var target = dragStartEventData.target,
  11200. result = this.checkExpectedCondition(target),
  11201. getScheduleDataFunc,
  11202. scheduleData;
  11203. if (!result) {
  11204. return;
  11205. }
  11206. this.dragHandler.on({
  11207. drag: this._onDrag,
  11208. dragEnd: this._onDragEnd
  11209. }, this);
  11210. getScheduleDataFunc = this._retriveScheduleData(this.view, dragStartEventData.originEvent);
  11211. this.getScheduleDataFunc = getScheduleDataFunc;
  11212. scheduleData = getScheduleDataFunc(dragStartEventData.originEvent);
  11213. /**
  11214. * @event DayGridCreation#dragstart
  11215. * @type {object}
  11216. * @property {DayGridView} relatedView - view instance.
  11217. * @property {number} datesInRange - date count of this view.
  11218. * @property {number} dragStartXIndex - index number of dragstart grid index.
  11219. * @property {number} xIndex - index number of mouse positions.
  11220. */
  11221. this.fire('dragstart', scheduleData);
  11222. };
  11223. /**
  11224. * Drag event handler method.
  11225. * @emits DayGridCreation#drag
  11226. * @param {object} dragEventData - Drag#drag event handler scheduledata.
  11227. */
  11228. DayGridCreation.prototype._onDrag = function(dragEventData) {
  11229. var getScheduleDataFunc = this.getScheduleDataFunc,
  11230. scheduleData;
  11231. if (!getScheduleDataFunc) {
  11232. return;
  11233. }
  11234. scheduleData = getScheduleDataFunc(dragEventData.originEvent);
  11235. /**
  11236. * @event DayGridCreation#drag
  11237. * @type {object}
  11238. * @property {DayGridView} relatedView - view instance.
  11239. * @property {number} datesInRange - date count of this view.
  11240. * @property {number} dragStartXIndex - index number of dragstart grid index.
  11241. * @property {number} xIndex - index number of mouse positions.
  11242. */
  11243. this.fire('drag', scheduleData);
  11244. };
  11245. /**
  11246. * DragEnd event hander method.
  11247. * @emits DayGridCreation#dragend
  11248. * @param {object} dragEndEventData - Drag#dragEnd event handler data.
  11249. * @param {string} [overrideEventName] - override emitted event name when supplied.
  11250. */
  11251. DayGridCreation.prototype._onDragEnd = function(dragEndEventData, overrideEventName) {
  11252. var getScheduleDataFunc = this.getScheduleDataFunc;
  11253. var scheduleData;
  11254. if (!getScheduleDataFunc) {
  11255. return;
  11256. }
  11257. this.dragHandler.off({
  11258. drag: this._onDrag,
  11259. dragEnd: this._onDragEnd
  11260. }, this);
  11261. scheduleData = getScheduleDataFunc(dragEndEventData.originEvent);
  11262. this._createSchedule(scheduleData);
  11263. /**
  11264. * @event DayGridCreation#dragend
  11265. * @type {object}
  11266. * @property {DayGridView} relatedView - view instance.
  11267. * @property {number} datesInRange - date count of this view.
  11268. * @property {number} dragStartXIndex - index number of dragstart grid index.
  11269. * @property {number} xIndex - index number of mouse positions.
  11270. */
  11271. this.fire(overrideEventName || 'dragend', scheduleData);
  11272. this.getScheduleDataFunc = null;
  11273. };
  11274. /**
  11275. * Click event handler method.
  11276. * @emits DayGridCreation#click
  11277. * @param {object} clickEventData - Drag#click event handler data.
  11278. */
  11279. DayGridCreation.prototype._onClick = function(clickEventData) {
  11280. var self = this;
  11281. var getScheduleDataFunc, scheduleData;
  11282. if (!this.checkExpectedCondition(clickEventData.target) || this._disableClick) {
  11283. return;
  11284. }
  11285. getScheduleDataFunc = this._retriveScheduleData(this.view, clickEventData.originEvent);
  11286. scheduleData = getScheduleDataFunc(clickEventData.originEvent);
  11287. this._requestOnClick = true;
  11288. setTimeout(function() {
  11289. if (self._requestOnClick) {
  11290. self.fire('click', scheduleData);
  11291. self._createSchedule(scheduleData);
  11292. }
  11293. self._requestOnClick = false;
  11294. }, CLICK_DELAY);
  11295. };
  11296. /**
  11297. * Dblclick event handler method.
  11298. * @emits DayGridCreation#click
  11299. * @param {object} clickEventData - Drag#Click event handler data.
  11300. */
  11301. DayGridCreation.prototype._onDblClick = function(clickEventData) {
  11302. var getScheduleDataFunc, scheduleData;
  11303. if (!this.checkExpectedCondition(clickEventData.target)) {
  11304. return;
  11305. }
  11306. getScheduleDataFunc = this._retriveScheduleData(this.view, clickEventData);
  11307. scheduleData = getScheduleDataFunc(clickEventData);
  11308. this.fire('click', scheduleData);
  11309. this._createSchedule(scheduleData);
  11310. this._requestOnClick = false;
  11311. };
  11312. /**
  11313. * Invoke creation click
  11314. * @param {Schedule} schedule - schedule instance
  11315. */
  11316. DayGridCreation.prototype.invokeCreationClick = function(schedule) {
  11317. var scheduleData = this._retriveScheduleDataFromDate(this.view, schedule.start);
  11318. this.fire('click', scheduleData);
  11319. this._createSchedule(scheduleData);
  11320. };
  11321. common.mixin(dayGridCore, DayGridCreation);
  11322. util.CustomEvents.mixin(DayGridCreation);
  11323. module.exports = DayGridCreation;
  11324. /***/ }),
  11325. /***/ "./src/js/handler/daygrid/creationGuide.js":
  11326. /*!*************************************************!*\
  11327. !*** ./src/js/handler/daygrid/creationGuide.js ***!
  11328. \*************************************************/
  11329. /*! no static exports found */
  11330. /***/ (function(module, exports, __webpack_require__) {
  11331. "use strict";
  11332. /**
  11333. * @fileoverview Guide element for DayGrid.Creation
  11334. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  11335. */
  11336. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  11337. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  11338. var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
  11339. /**
  11340. * Class for DayGrid.Creation dragging effect.
  11341. * @constructor
  11342. * @param {DayGridCreation} creation - instance of DayGridCreation.
  11343. */
  11344. function DayGridCreationGuide(creation) {
  11345. /**
  11346. * @type {DayGridCreation}
  11347. */
  11348. this.creation = creation;
  11349. /**
  11350. * @type {HTMLDIVElement}
  11351. */
  11352. this.scheduleContainer = null;
  11353. /**
  11354. * @type {HTMLDIVElement}
  11355. */
  11356. this.guideElement = document.createElement('div');
  11357. this.initializeGuideElement();
  11358. this.applyTheme(creation.controller.theme);
  11359. creation.on({
  11360. dragstart: this._createGuideElement,
  11361. drag: this._onDrag,
  11362. click: this._createGuideElement
  11363. }, this);
  11364. }
  11365. /**
  11366. * Destroy method
  11367. */
  11368. DayGridCreationGuide.prototype.destroy = function() {
  11369. this.clearGuideElement();
  11370. this.creation.off(this);
  11371. this.creation = this.scheduleContainer = this.guideElement = null;
  11372. };
  11373. /**
  11374. * initialize guide element's default style.
  11375. */
  11376. DayGridCreationGuide.prototype.initializeGuideElement = function() {
  11377. domutil.addClass(this.guideElement, config.classname('daygrid-guide-creation-block'));
  11378. };
  11379. /**
  11380. * Drag event handler
  11381. * @param {object} scheduleData - schedule data from DayGrid.Creation handler.
  11382. */
  11383. DayGridCreationGuide.prototype._onDrag = function(scheduleData) {
  11384. this._refreshGuideElement(scheduleData, true);
  11385. };
  11386. /**
  11387. * Get element width based on narrowWeekend
  11388. * @param {number} dragStartIndex - grid start index
  11389. * @param {number} dragEndIndex - grid end index
  11390. * @param {Array} grids - dates information
  11391. * @returns {number} element width
  11392. */
  11393. DayGridCreationGuide.prototype._getGuideWidth = function(dragStartIndex, dragEndIndex, grids) {
  11394. var width = 0;
  11395. var i = dragStartIndex;
  11396. for (; i <= dragEndIndex; i += 1) {
  11397. width += grids[i] ? grids[i].width : 0;
  11398. }
  11399. return width;
  11400. };
  11401. /**
  11402. * Refresh guide element.
  11403. * @param {object} scheduleData - schedule data from DayGrid.Creation handler.
  11404. * @param {boolean} defer - If set to true, set style in the next frame
  11405. */
  11406. DayGridCreationGuide.prototype._refreshGuideElement = function(scheduleData, defer) {
  11407. var guideElement = this.guideElement,
  11408. data = scheduleData,
  11409. dragStartXIndex = data.dragStartXIndex < data.xIndex ? data.dragStartXIndex : data.xIndex,
  11410. dragEndXIndex = data.dragStartXIndex < data.xIndex ? data.xIndex : data.dragStartXIndex,
  11411. leftPercent,
  11412. widthPercent;
  11413. leftPercent = data.grids[dragStartXIndex] ? data.grids[dragStartXIndex].left : 0;
  11414. widthPercent = this._getGuideWidth(dragStartXIndex, dragEndXIndex, data.grids);
  11415. /** eslint-disable require-jsdoc */
  11416. function setStyle() {
  11417. guideElement.style.display = 'block';
  11418. guideElement.style.left = leftPercent + '%';
  11419. guideElement.style.width = widthPercent + '%';
  11420. }
  11421. if (defer) {
  11422. reqAnimFrame.requestAnimFrame(setStyle);
  11423. } else {
  11424. setStyle();
  11425. }
  11426. };
  11427. /**
  11428. * Clear guide element.
  11429. */
  11430. DayGridCreationGuide.prototype.clearGuideElement = function() {
  11431. var guideElement = this.guideElement;
  11432. domutil.remove(guideElement);
  11433. guideElement.style.display = 'none';
  11434. guideElement.style.left = '';
  11435. guideElement.style.width = '';
  11436. };
  11437. /**
  11438. * Create guide element
  11439. * @param {object} dragStartEventData - schedule data object of DayGrid.Creation.
  11440. */
  11441. DayGridCreationGuide.prototype._createGuideElement = function(dragStartEventData) {
  11442. var creation = this.creation,
  11443. view = creation.view,
  11444. container = view.container,
  11445. scheduleContainer = domutil.find(config.classname('.weekday-grid'), container);
  11446. scheduleContainer.appendChild(this.guideElement);
  11447. this._refreshGuideElement(dragStartEventData);
  11448. };
  11449. /**
  11450. * Drag event handler.
  11451. * @param {object} dragEventData - event data object of DayGrid.Creation.
  11452. */
  11453. DayGridCreationGuide.prototype._onDrag = function(dragEventData) {
  11454. this._refreshGuideElement(dragEventData);
  11455. };
  11456. DayGridCreationGuide.prototype.applyTheme = function(theme) {
  11457. var style = this.guideElement.style;
  11458. style.backgroundColor = theme.common.creationGuide.backgroundColor;
  11459. style.border = theme.common.creationGuide.border;
  11460. };
  11461. module.exports = DayGridCreationGuide;
  11462. /***/ }),
  11463. /***/ "./src/js/handler/daygrid/move.js":
  11464. /*!****************************************!*\
  11465. !*** ./src/js/handler/daygrid/move.js ***!
  11466. \****************************************/
  11467. /*! no static exports found */
  11468. /***/ (function(module, exports, __webpack_require__) {
  11469. "use strict";
  11470. /**
  11471. * @fileoverview Move handler for DayGrid view.
  11472. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  11473. */
  11474. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  11475. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  11476. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  11477. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  11478. var dayGridCore = __webpack_require__(/*! ./core */ "./src/js/handler/daygrid/core.js");
  11479. var DayGridMoveGuide = __webpack_require__(/*! ./moveGuide */ "./src/js/handler/daygrid/moveGuide.js");
  11480. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  11481. /**
  11482. * @constructor
  11483. * @implements {Handler}
  11484. * @mixes dayGridCore
  11485. * @mixes CustomEvents
  11486. * @param {Drag} dragHandler - Drag handler instance.
  11487. * @param {DayGrid} view - view instance.
  11488. * @param {Base} controller - Base controller instance.
  11489. */
  11490. function DayGridMove(dragHandler, view, controller) {
  11491. /**
  11492. * Drag handler instance.
  11493. * @type {Drag}
  11494. */
  11495. this.dragHandler = dragHandler;
  11496. /**
  11497. * view instance.
  11498. * @type {DayGrid}
  11499. */
  11500. this.view = view;
  11501. /**
  11502. * Base controller instance.
  11503. * @type {Base}
  11504. */
  11505. this.controller = controller;
  11506. /**
  11507. * Temporary variable for dragstart event data.
  11508. * @type {object}
  11509. */
  11510. this._dragStart = null;
  11511. dragHandler.on({
  11512. dragStart: this._onDragStart
  11513. }, this);
  11514. /**
  11515. * @type {DayGridMoveGuide}
  11516. */
  11517. this.guide = new DayGridMoveGuide(this);
  11518. }
  11519. DayGridMove.prototype.destroy = function() {
  11520. this.guide.destroy();
  11521. this.dragHandler.off(this);
  11522. this.dragHandler = this.view = this.controller =
  11523. this.guide = this._dragStart = null;
  11524. };
  11525. /**
  11526. * Check dragstart target is expected conditions for this handler.
  11527. * @param {HTMLElement} target - dragstart event handler's target element.
  11528. * @returns {boolean|DayGridSchedule} return DayGridSchedule view instance when satiate condition.
  11529. */
  11530. DayGridMove.prototype.checkExpectedCondition = function(target) {
  11531. var cssClass = domutil.getClass(target),
  11532. parentView,
  11533. matches;
  11534. if (~cssClass.indexOf(config.classname('weekday-resize-handle'))) {
  11535. return false;
  11536. }
  11537. parentView = domutil.closest(target, config.classname('.weekday'));
  11538. if (!parentView) {
  11539. return false;
  11540. }
  11541. cssClass = domutil.getClass(parentView);
  11542. matches = cssClass.match(config.daygrid.getViewIDRegExp);
  11543. if (!matches || matches.length < 2) {
  11544. return false;
  11545. }
  11546. return util.pick(this.view.children.items, matches[1]);
  11547. };
  11548. /**
  11549. * DragStart event handler method.
  11550. * @emits DayGridMove#dragstart
  11551. * @param {object} dragStartEventData - Drag#dragStart event handler event data.
  11552. */
  11553. DayGridMove.prototype._onDragStart = function(dragStartEventData) {
  11554. var target = dragStartEventData.target,
  11555. result = this.checkExpectedCondition(target),
  11556. controller = this.controller,
  11557. excludeTarget = true,
  11558. scheduleBlockElement,
  11559. modelID,
  11560. targetModel,
  11561. getScheduleDataFunc,
  11562. scheduleData;
  11563. if (!result) {
  11564. return;
  11565. }
  11566. scheduleBlockElement = domutil.closest(target, config.classname('.weekday-schedule-block'), excludeTarget);
  11567. if (!scheduleBlockElement) {
  11568. return;
  11569. }
  11570. modelID = domutil.getData(scheduleBlockElement, 'id');
  11571. targetModel = controller.schedules.items[modelID];
  11572. if (!targetModel) {
  11573. return;
  11574. }
  11575. if (targetModel.isReadOnly) {
  11576. return;
  11577. }
  11578. getScheduleDataFunc = this._retriveScheduleData(this.view, dragStartEventData.originEvent);
  11579. this.getScheduleDataFunc = getScheduleDataFunc;
  11580. scheduleData = this._dragStart = getScheduleDataFunc(dragStartEventData.originEvent);
  11581. util.extend(scheduleData, {
  11582. scheduleBlockElement: scheduleBlockElement,
  11583. model: targetModel
  11584. });
  11585. this.dragHandler.on({
  11586. drag: this._onDrag,
  11587. dragEnd: this._onDragEnd,
  11588. click: this._onClick
  11589. }, this);
  11590. /**
  11591. * @event DayGridMove#dragstart
  11592. * @type {object}
  11593. * @property {DayGrid} relatedView - view instance.
  11594. * @property {number} datesInRange - date count of this view.
  11595. * @property {number} dragStartXIndex - index number of dragstart grid index.
  11596. * @property {number} xIndex - index number of mouse positions.
  11597. * @property {Schedule} model - data object of model isntance.
  11598. * @property {HTMLDivElement} scheduleBlockElement - target schedule block element.
  11599. */
  11600. this.fire('dragstart', scheduleData);
  11601. };
  11602. /**
  11603. * Drag event handler method.
  11604. * @emits DayGridMove#drag
  11605. * @param {object} dragEventData - Drag#drag event handler eventdata.
  11606. */
  11607. DayGridMove.prototype._onDrag = function(dragEventData) {
  11608. var getScheduleDataFunc = this.getScheduleDataFunc;
  11609. if (!getScheduleDataFunc) {
  11610. return;
  11611. }
  11612. /**
  11613. * @schedule DayGridMove#drag
  11614. * @type {object}
  11615. * @property {DayGrid} relatedView - view instance.
  11616. * @property {number} datesInRange - date count of this view.
  11617. * @property {number} dragStartXIndex - index number of dragstart grid index.
  11618. * @property {number} xIndex - index number of mouse positions.
  11619. */
  11620. this.fire('drag', getScheduleDataFunc(dragEventData.originEvent));
  11621. };
  11622. /**
  11623. * Request update schedule model to base controller.
  11624. * @fires DayGridMove#beforeUpdateSchedule
  11625. * @param {object} scheduleData - schedule data from DayGridMove handler module.
  11626. */
  11627. DayGridMove.prototype._updateSchedule = function(scheduleData) {
  11628. var schedule = scheduleData.targetModel,
  11629. dateOffset = scheduleData.xIndex - scheduleData.dragStartXIndex,
  11630. newStarts = new TZDate(schedule.start),
  11631. newEnds = new TZDate(schedule.end);
  11632. newStarts = newStarts.addDate(dateOffset);
  11633. newEnds = newEnds.addDate(dateOffset);
  11634. /**
  11635. * @event DayGridMove#beforeUpdateSchedule
  11636. * @type {object}
  11637. * @property {Schedule} schedule - The original schedule instance
  11638. * @property {Date} start - Deprecated: start time to update
  11639. * @property {Date} end - Deprecated: end time to update
  11640. * @property {object} changes - start and end time to update
  11641. * @property {Date} start - start time to update
  11642. * @property {Date} end - end time to update
  11643. */
  11644. this.fire('beforeUpdateSchedule', {
  11645. schedule: schedule,
  11646. changes: {
  11647. start: newStarts,
  11648. end: newEnds
  11649. },
  11650. start: newStarts,
  11651. end: newEnds
  11652. });
  11653. };
  11654. /**
  11655. * DragEnd event hander method.
  11656. * @emits DayGridMove#dragend
  11657. * @param {object} dragEndEventData - Drag#DragEnd event handler data.
  11658. * @param {string} [overrideEventName] - override emitted event name when supplied.
  11659. * @param {?boolean} skipUpdate - true then skip update schedule model.
  11660. */
  11661. DayGridMove.prototype._onDragEnd = function(dragEndEventData, overrideEventName, skipUpdate) {
  11662. var getScheduleDataFunc = this.getScheduleDataFunc,
  11663. dragStart = this._dragStart,
  11664. scheduleData;
  11665. if (!getScheduleDataFunc || !dragStart) {
  11666. return;
  11667. }
  11668. this.dragHandler.off({
  11669. drag: this._onDrag,
  11670. dragEnd: this._onDragEnd,
  11671. click: this._onClick
  11672. }, this);
  11673. scheduleData = getScheduleDataFunc(dragEndEventData.originEvent);
  11674. util.extend(scheduleData, {
  11675. targetModel: dragStart.model
  11676. });
  11677. if (!skipUpdate) {
  11678. this._updateSchedule(scheduleData);
  11679. }
  11680. /**
  11681. * @event DayGridMove#dragend
  11682. * @type {object}
  11683. * @property {DayGrid} relatedView - view instance.
  11684. * @property {number} datesInRange - date count of this view.
  11685. * @property {number} dragStartXIndex - index number of dragstart grid index.
  11686. * @property {number} xIndex - index number of mouse positions.
  11687. */
  11688. this.fire(overrideEventName || 'dragend', scheduleData);
  11689. this.getScheduleDataFunc = this._dragStart = null;
  11690. };
  11691. /**
  11692. * Click event handler method.
  11693. * @emits DayGridMove#click
  11694. * @param {object} clickEventData - Drag#Click event handler data.
  11695. */
  11696. DayGridMove.prototype._onClick = function(clickEventData) {
  11697. /**
  11698. * @event DayGridMove#click
  11699. * @type {object}
  11700. * @property {DayGrid} relatedView - view instance.
  11701. * @property {number} datesInRange - date count of this view.
  11702. * @property {number} dragStartXIndex - index number of dragstart grid index.
  11703. * @property {number} xIndex - index number of mouse positions.
  11704. */
  11705. this._onDragEnd(clickEventData, 'click', true);
  11706. };
  11707. common.mixin(dayGridCore, DayGridMove);
  11708. util.CustomEvents.mixin(DayGridMove);
  11709. module.exports = DayGridMove;
  11710. /***/ }),
  11711. /***/ "./src/js/handler/daygrid/moveGuide.js":
  11712. /*!*********************************************!*\
  11713. !*** ./src/js/handler/daygrid/moveGuide.js ***!
  11714. \*********************************************/
  11715. /*! no static exports found */
  11716. /***/ (function(module, exports, __webpack_require__) {
  11717. "use strict";
  11718. /* WEBPACK VAR INJECTION */(function(global) {/**
  11719. * @fileoverview Effect module for DayGrid.Move
  11720. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  11721. */
  11722. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  11723. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  11724. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  11725. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  11726. var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
  11727. /**
  11728. * Class for DayGrid.Move dragging effect.
  11729. * @constructor
  11730. * @param {DayGridMove} daygridMove - instance of DayGridMove.
  11731. */
  11732. function DayGridMoveGuide(daygridMove) {
  11733. /**
  11734. * @type {DayGridMove}
  11735. */
  11736. this.daygridMove = daygridMove;
  11737. /**
  11738. * The element that actually contains the event element
  11739. * @type {HTMLDIVElement}
  11740. */
  11741. this.scheduleContainer = null;
  11742. /**
  11743. * @type {number}
  11744. */
  11745. this._dragStartXIndex = null;
  11746. /**
  11747. * @type {HTMLDIVElement}
  11748. */
  11749. this.guideElement = null;
  11750. /**
  11751. * @type {HTMLElement[]}
  11752. */
  11753. this.elements = null;
  11754. daygridMove.on({
  11755. 'dragstart': this._onDragStart,
  11756. 'drag': this._onDrag,
  11757. 'dragend': this._clearGuideElement,
  11758. 'click': this._clearGuideElement
  11759. }, this);
  11760. }
  11761. /**
  11762. * Destroy method
  11763. */
  11764. DayGridMoveGuide.prototype.destroy = function() {
  11765. this._clearGuideElement();
  11766. this.daygridMove.off(this);
  11767. this.daygridMove = this.scheduleContainer = this._dragStartXIndex =
  11768. this.elements = this.guideElement = null;
  11769. };
  11770. /**
  11771. * Clear guide element.
  11772. */
  11773. DayGridMoveGuide.prototype._clearGuideElement = function() {
  11774. this._showOriginScheduleBlocks();
  11775. domutil.remove(this.guideElement);
  11776. if (!util.browser.msie) {
  11777. domutil.removeClass(global.document.body, config.classname('dragging'));
  11778. }
  11779. this._dragStartXIndex = this.getScheduleDataFunc = this.guideElement = null;
  11780. };
  11781. /**
  11782. * Dim element blocks
  11783. * @param {number} modelID - Schedule model instance ID
  11784. */
  11785. DayGridMoveGuide.prototype._hideOriginScheduleBlocks = function(modelID) {
  11786. var className = config.classname('weekday-schedule-block-dragging-dim');
  11787. var scheduleBlocks = domutil.find(
  11788. config.classname('.weekday-schedule-block'),
  11789. this.daygridMove.view.container,
  11790. true
  11791. );
  11792. this.elements = util.filter(scheduleBlocks, function(schedule) {
  11793. return domutil.getData(schedule, 'id') === modelID;
  11794. });
  11795. util.forEach(this.elements, function(el) {
  11796. domutil.addClass(el, className);
  11797. });
  11798. };
  11799. /**
  11800. * Show element blocks
  11801. */
  11802. DayGridMoveGuide.prototype._showOriginScheduleBlocks = function() {
  11803. var className = config.classname('weekday-schedule-block-dragging-dim');
  11804. util.forEach(this.elements, function(el) {
  11805. domutil.removeClass(el, className);
  11806. });
  11807. };
  11808. /**
  11809. * Highlight element blocks
  11810. * @param {Schedule} model - model
  11811. * @param {HTMLElement} parent - parent element
  11812. */
  11813. DayGridMoveGuide.prototype._highlightScheduleBlocks = function(model, parent) {
  11814. var elements = domutil.find(config.classname('.weekday-schedule'), parent, true);
  11815. util.forEach(elements, function(el) {
  11816. el.style.margin = '0';
  11817. if (!model.isFocused) {
  11818. el.style.backgroundColor = model.dragBgColor;
  11819. el.style.borderLeftColor = model.borderColor;
  11820. el.style.color = '#ffffff';
  11821. }
  11822. });
  11823. };
  11824. /**
  11825. * Refresh guide element.
  11826. * @param {number} leftPercent - left percent of guide element.
  11827. * @param {number} widthPercent - width percent of guide element.
  11828. * @param {boolean} isExceededLeft - schedule start is faster then render start date?
  11829. * @param {boolean} isExceededRight - schedule end is later then render end date?
  11830. */
  11831. DayGridMoveGuide.prototype.refreshGuideElement = function(leftPercent, widthPercent, isExceededLeft, isExceededRight) {
  11832. var guideElement = this.guideElement;
  11833. reqAnimFrame.requestAnimFrame(function() {
  11834. guideElement.style.left = leftPercent + '%';
  11835. guideElement.style.width = widthPercent + '%';
  11836. if (isExceededLeft) {
  11837. domutil.addClass(guideElement, config.classname('weekday-exceed-left'));
  11838. } else {
  11839. domutil.removeClass(guideElement, config.classname('weekday-exceed-left'));
  11840. }
  11841. if (isExceededRight) {
  11842. domutil.addClass(guideElement, config.classname('weekday-exceed-right'));
  11843. } else {
  11844. domutil.removeClass(guideElement, config.classname('weekday-exceed-right'));
  11845. }
  11846. });
  11847. };
  11848. /**
  11849. * Get schedule block information from schedule data.
  11850. *
  11851. * For example, there is single schedule has 10 length. but render range in view is 5 then
  11852. * rendered block must be cut out to render properly. in this case, this method return
  11853. * how many block are cut before rendering.
  11854. *
  11855. * @param {object} dragStartEventData - schedule data from DayGrid.Move handler.
  11856. * @returns {function} function that return schedule block information.
  11857. */
  11858. DayGridMoveGuide.prototype._getScheduleBlockDataFunc = function(dragStartEventData) {
  11859. var model = dragStartEventData.model,
  11860. datesInRange = dragStartEventData.datesInRange,
  11861. range = dragStartEventData.range,
  11862. baseWidthPercent = (100 / datesInRange),
  11863. originScheduleStarts = datetime.start(model.start),
  11864. originScheduleEnds = datetime.end(model.end),
  11865. renderStartDate = datetime.start(range[0]),
  11866. renderEndDate = datetime.end(range[range.length - 1]),
  11867. fromLeft = Math.ceil((originScheduleStarts.getTime() -
  11868. renderStartDate.getTime()) / datetime.MILLISECONDS_PER_DAY) || 0,
  11869. fromRight = Math.ceil((originScheduleEnds.getTime() -
  11870. renderEndDate.getTime()) / datetime.MILLISECONDS_PER_DAY) || 0;
  11871. return function(indexOffset) {
  11872. return {
  11873. baseWidthPercent: baseWidthPercent,
  11874. fromLeft: fromLeft + indexOffset,
  11875. fromRight: fromRight + indexOffset
  11876. };
  11877. };
  11878. };
  11879. /**
  11880. * DragStart event handler.
  11881. * @param {object} dragStartEventData - schedule data.
  11882. */
  11883. DayGridMoveGuide.prototype._onDragStart = function(dragStartEventData) {
  11884. var container = this.daygridMove.view.container,
  11885. guideElement = this.guideElement = dragStartEventData.scheduleBlockElement.cloneNode(true),
  11886. scheduleContainer;
  11887. if (!util.browser.msie) {
  11888. domutil.addClass(global.document.body, config.classname('dragging'));
  11889. }
  11890. this._hideOriginScheduleBlocks(String(dragStartEventData.model.cid()));
  11891. scheduleContainer = domutil.find(config.classname('.weekday-schedules'), container);
  11892. domutil.appendHTMLElement('div', guideElement, config.classname('weekday-schedule-cover'));
  11893. scheduleContainer.appendChild(guideElement);
  11894. this._dragStartXIndex = dragStartEventData.xIndex;
  11895. this.getScheduleDataFunc = this._getScheduleBlockDataFunc(dragStartEventData);
  11896. this._highlightScheduleBlocks(dragStartEventData.model, guideElement);
  11897. };
  11898. /**
  11899. * Drag event handler.
  11900. * @param {object} dragEventData - schedule data.
  11901. */
  11902. DayGridMoveGuide.prototype._onDrag = function(dragEventData) {
  11903. var getScheduleDataFunc = this.getScheduleDataFunc,
  11904. dragStartXIndex = this._dragStartXIndex,
  11905. datesInRange = dragEventData.datesInRange,
  11906. grids = dragEventData.grids,
  11907. scheduleData,
  11908. isExceededLeft,
  11909. isExceededRight,
  11910. originLength,
  11911. leftIndex,
  11912. size,
  11913. newLeft,
  11914. newWidth;
  11915. if (!getScheduleDataFunc) {
  11916. return;
  11917. }
  11918. scheduleData = getScheduleDataFunc(dragEventData.xIndex - dragStartXIndex);
  11919. isExceededLeft = scheduleData.fromLeft < 0;
  11920. isExceededRight = scheduleData.fromRight > 0;
  11921. leftIndex = Math.max(0, scheduleData.fromLeft);
  11922. originLength = (scheduleData.fromLeft * -1) + (datesInRange + scheduleData.fromRight);
  11923. size = isExceededLeft ? (originLength + scheduleData.fromLeft) : originLength;
  11924. size = isExceededRight ? (size - scheduleData.fromRight) : size;
  11925. newLeft = grids[leftIndex] ? grids[leftIndex].left : 0;
  11926. newWidth = getScheduleBlockWidth(leftIndex, size, grids);
  11927. this.refreshGuideElement(newLeft, newWidth, isExceededLeft, isExceededRight);
  11928. };
  11929. /**
  11930. * Get schedule width based on grids
  11931. * @param {number} left - left index
  11932. * @param {number} size - schedule width
  11933. * @param {Array} grids - dates information
  11934. * @returns {number} element width
  11935. */
  11936. function getScheduleBlockWidth(left, size, grids) {
  11937. var width = 0;
  11938. var i = 0;
  11939. var length = grids.length;
  11940. for (; i < size; i += 1) {
  11941. left = (left + i) % length;
  11942. if (left < length) {
  11943. width += grids[left] ? grids[left].width : 0;
  11944. }
  11945. }
  11946. return width;
  11947. }
  11948. module.exports = DayGridMoveGuide;
  11949. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  11950. /***/ }),
  11951. /***/ "./src/js/handler/daygrid/resize.js":
  11952. /*!******************************************!*\
  11953. !*** ./src/js/handler/daygrid/resize.js ***!
  11954. \******************************************/
  11955. /*! no static exports found */
  11956. /***/ (function(module, exports, __webpack_require__) {
  11957. "use strict";
  11958. /**
  11959. * @fileoverview Resize handler module for DayGrid view.
  11960. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  11961. */
  11962. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  11963. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  11964. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  11965. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  11966. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  11967. var dayGridCore = __webpack_require__(/*! ./core */ "./src/js/handler/daygrid/core.js");
  11968. var DayGridResizeGuide = __webpack_require__(/*! ./resizeGuide */ "./src/js/handler/daygrid/resizeGuide.js");
  11969. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  11970. /**
  11971. * @constructor
  11972. * @implements {Handler}
  11973. * @mixes dayGridCore
  11974. * @mixes CustomEvents
  11975. * @param {Drag} [dragHandler] - Drag handler instance.
  11976. * @param {DayGrid} [view] - view instance.
  11977. * @param {Base} [controller] - Base controller instance.
  11978. */
  11979. function DayGridResize(dragHandler, view, controller) {
  11980. /**
  11981. * Drag handler instance.
  11982. * @type {Drag}
  11983. */
  11984. this.dragHandler = dragHandler;
  11985. /**
  11986. * view instance.
  11987. * @type {DayGrid}
  11988. */
  11989. this.view = view;
  11990. /**
  11991. * Base controller instance.
  11992. * @type {Base}
  11993. */
  11994. this.controller = controller;
  11995. /**
  11996. * Temporary variable for dragStart event data.
  11997. * @type {object}
  11998. */
  11999. this._dragStart = null;
  12000. dragHandler.on({
  12001. dragStart: this._onDragStart
  12002. }, this);
  12003. /**
  12004. * @type {DayGridResizeGuide}
  12005. */
  12006. this.guide = new DayGridResizeGuide(this);
  12007. }
  12008. /**
  12009. * Destroy method
  12010. */
  12011. DayGridResize.prototype.destroy = function() {
  12012. this.guide.destroy();
  12013. this.dragHandler.off(this);
  12014. this.dragHandler = this.view = this.controller =
  12015. this.guide = this._dragStart = null;
  12016. };
  12017. /**
  12018. * Check dragstart target is expected conditions for this handler.
  12019. * @param {HTMLElement} target - dragstart event handler's target element.
  12020. * @returns {boolean|WeekdayInWeek} return WeekdayInWeek view instance when satiate condition.
  12021. */
  12022. DayGridResize.prototype.checkExpectedCondition = function(target) {
  12023. var cssClass = domutil.getClass(target),
  12024. matches;
  12025. if (!~cssClass.indexOf(config.classname('weekday-resize-handle'))) {
  12026. return false;
  12027. }
  12028. target = domutil.closest(target, config.classname('.weekday'));
  12029. if (!target) {
  12030. return false;
  12031. }
  12032. cssClass = domutil.getClass(target);
  12033. matches = cssClass.match(config.daygrid.getViewIDRegExp);
  12034. if (!matches || matches.length < 2) {
  12035. return false;
  12036. }
  12037. return util.pick(this.view.children.items, matches[1]);
  12038. };
  12039. /**
  12040. * DragStart event handler.
  12041. * @emits DayGridResize#dragstart
  12042. * @param {object} dragStartEventData - schedule data.
  12043. */
  12044. DayGridResize.prototype._onDragStart = function(dragStartEventData) {
  12045. var target = dragStartEventData.target,
  12046. result = this.checkExpectedCondition(target),
  12047. controller = this.controller,
  12048. scheduleBlockElement,
  12049. modelID,
  12050. targetModel,
  12051. getScheduleDataFunc,
  12052. scheduleData;
  12053. if (!result) {
  12054. return;
  12055. }
  12056. scheduleBlockElement = domutil.closest(target, config.classname('.weekday-schedule-block'));
  12057. modelID = domutil.getData(scheduleBlockElement, 'id');
  12058. targetModel = controller.schedules.items[modelID];
  12059. if (!targetModel) {
  12060. return;
  12061. }
  12062. getScheduleDataFunc = this._retriveScheduleData(this.view, dragStartEventData.originEvent);
  12063. this.getScheduleDataFunc = getScheduleDataFunc;
  12064. scheduleData = this._dragStart = getScheduleDataFunc(dragStartEventData.originEvent);
  12065. util.extend(scheduleData, {
  12066. scheduleBlockElement: scheduleBlockElement,
  12067. model: targetModel
  12068. });
  12069. this.dragHandler.on({
  12070. drag: this._onDrag,
  12071. dragEnd: this._onDragEnd,
  12072. click: this._onClick
  12073. }, this);
  12074. /**
  12075. * @event DayGridResize#dragstart
  12076. * @type {object}
  12077. * @property {View} relatedView - view instance.
  12078. * @property {number} datesInRange - date count of this view.
  12079. * @property {number} dragStartXIndex - index number of dragstart grid index.
  12080. * @property {number} xIndex - index number of mouse positions.
  12081. * @property {Schedule} model - data object of model isntance.
  12082. * @property {HTMLDivElement} scheduleBlockElement - target schedule block element.
  12083. */
  12084. this.fire('dragstart', scheduleData);
  12085. };
  12086. /**
  12087. * Drag event handler method.
  12088. * @emits DayGridResize#drag
  12089. * @param {object} dragEventData - Drag#drag event handler scheduledata.
  12090. */
  12091. DayGridResize.prototype._onDrag = function(dragEventData) {
  12092. var getScheduleDataFunc = this.getScheduleDataFunc;
  12093. if (!getScheduleDataFunc) {
  12094. return;
  12095. }
  12096. /**
  12097. * @event DayGridResize#drag
  12098. * @type {object}
  12099. * @property {View} relatedView - view instance.
  12100. * @property {number} datesInRange - date count of this view.
  12101. * @property {number} dragStartXIndex - index number of dragstart grid index.
  12102. * @property {number} xIndex - index number of mouse positions.
  12103. */
  12104. this.fire('drag', getScheduleDataFunc(dragEventData.originEvent));
  12105. };
  12106. /**
  12107. * Request update schedule instance to base controller.
  12108. * @fires DayGridResize#beforeUpdateSchedule
  12109. * @param {object} scheduleData - schedule data from DayGridResize handler.
  12110. */
  12111. DayGridResize.prototype._updateSchedule = function(scheduleData) {
  12112. var schedule = scheduleData.targetModel,
  12113. dateOffset = scheduleData.xIndex - scheduleData.dragStartXIndex,
  12114. newEnds = new TZDate(schedule.end);
  12115. var changes;
  12116. newEnds = newEnds.addDate(dateOffset);
  12117. newEnds = new TZDate(common.maxDate(datetime.end(schedule.start), newEnds));
  12118. changes = common.getScheduleChanges(
  12119. schedule,
  12120. ['end'],
  12121. {end: newEnds}
  12122. );
  12123. /**
  12124. * @event DayGridResize#beforeUpdateSchedule
  12125. * @type {object}
  12126. * @property {Schedule} schedule - The original schedule instance
  12127. * @property {Date} start - Deprecated: start time to update
  12128. * @property {Date} end - Deprecated: end time to update
  12129. * @property {object} changes - end time to update
  12130. * @property {date} end - end time to update
  12131. */
  12132. this.fire('beforeUpdateSchedule', {
  12133. schedule: schedule,
  12134. changes: changes,
  12135. start: schedule.getStarts(),
  12136. end: newEnds
  12137. });
  12138. };
  12139. /**
  12140. * DragEnd event hander method.
  12141. * @emits DayGridResize#dragend
  12142. * @param {object} dragEndEventData - Drag#DragEnd event handler data.
  12143. * @param {string} [overrideEventName] - override emitted event name when supplied.
  12144. * @param {?boolean} skipUpdate - true then skip update schedule model.
  12145. */
  12146. DayGridResize.prototype._onDragEnd = function(dragEndEventData, overrideEventName, skipUpdate) {
  12147. var getScheduleDataFunc = this.getScheduleDataFunc,
  12148. dragStart = this._dragStart,
  12149. scheduleData;
  12150. if (!getScheduleDataFunc || !dragStart) {
  12151. return;
  12152. }
  12153. this.dragHandler.off({
  12154. drag: this._onDrag,
  12155. dragEnd: this._onDragEnd,
  12156. click: this._onClick
  12157. }, this);
  12158. scheduleData = getScheduleDataFunc(dragEndEventData.originEvent);
  12159. util.extend(scheduleData, {
  12160. targetModel: dragStart.model
  12161. });
  12162. if (!skipUpdate) {
  12163. this._updateSchedule(scheduleData);
  12164. }
  12165. /**
  12166. * @event DayGridResize#dragend
  12167. * @type {object}
  12168. * @property {View} relatedView - view instance.
  12169. * @property {number} datesInRange - date count of this view.
  12170. * @property {number} dragStartXIndex - index number of dragstart grid index.
  12171. * @property {number} xIndex - index number of mouse positions.
  12172. */
  12173. this.fire(overrideEventName || 'dragend', scheduleData);
  12174. this.getScheduleDataFunc = this._dragStart = null;
  12175. };
  12176. /**
  12177. * Click event handler method.
  12178. * @emits DayGridResize#click
  12179. * @param {object} clickEventData - Drag#Click event handler data.
  12180. */
  12181. DayGridResize.prototype._onClick = function(clickEventData) {
  12182. /**
  12183. * @event DayGridResize#click
  12184. * @type {object}
  12185. * @property {View} relatedView - view instance.
  12186. * @property {number} datesInRange - date count of this view.
  12187. * @property {number} dragStartXIndex - index number of dragstart grid index.
  12188. * @property {number} xIndex - index number of mouse positions.
  12189. */
  12190. this._onDragEnd(clickEventData, 'click', true);
  12191. };
  12192. common.mixin(dayGridCore, DayGridResize);
  12193. util.CustomEvents.mixin(DayGridResize);
  12194. module.exports = DayGridResize;
  12195. /***/ }),
  12196. /***/ "./src/js/handler/daygrid/resizeGuide.js":
  12197. /*!***********************************************!*\
  12198. !*** ./src/js/handler/daygrid/resizeGuide.js ***!
  12199. \***********************************************/
  12200. /*! no static exports found */
  12201. /***/ (function(module, exports, __webpack_require__) {
  12202. "use strict";
  12203. /* WEBPACK VAR INJECTION */(function(global) {/**
  12204. * @fileoverview Resize Guide module.
  12205. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  12206. */
  12207. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  12208. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  12209. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  12210. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  12211. var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
  12212. /**
  12213. * @constructor
  12214. * @param {DayGridResize} resizeHandler - instance of DayGridResize
  12215. */
  12216. function DayGridResizeGuide(resizeHandler) {
  12217. /**
  12218. * @type {DayGridResize}
  12219. */
  12220. this.resizeHandler = resizeHandler;
  12221. /**
  12222. * The element that actually contains the event element
  12223. * @type {HTMLDIVElement}
  12224. */
  12225. this.scheduleContainer = null;
  12226. /**
  12227. * @type {function}
  12228. */
  12229. this.getScheduleDataFunc = null;
  12230. /**
  12231. * @type {HTMLDIVElement}
  12232. */
  12233. this.guideElement = null;
  12234. /**
  12235. * @type {HTMLDIVElement}
  12236. */
  12237. this.scheduleBlockElement = null;
  12238. resizeHandler.on({
  12239. 'dragstart': this._onDragStart,
  12240. 'drag': this._onDrag,
  12241. 'dragend': this._clearGuideElement,
  12242. 'click': this._clearGuideElement
  12243. }, this);
  12244. }
  12245. /**
  12246. * Destroy method
  12247. */
  12248. DayGridResizeGuide.prototype.destroy = function() {
  12249. this._clearGuideElement();
  12250. this.resizeHandler.off(this);
  12251. this.resizeHandler = this.scheduleContainer = this.getScheduleDataFunc =
  12252. this.guideElement = this.scheduleBlockElement = null;
  12253. };
  12254. /**
  12255. * Clear guide element.
  12256. */
  12257. DayGridResizeGuide.prototype._clearGuideElement = function() {
  12258. domutil.remove(this.guideElement);
  12259. if (!util.browser.msie) {
  12260. domutil.removeClass(global.document.body, config.classname('resizing-x'));
  12261. }
  12262. if (this.scheduleBlockElement) {
  12263. domutil.removeClass(this.scheduleBlockElement, config.classname('weekday-schedule-block-dragging-dim'));
  12264. }
  12265. this.getScheduleDataFunc = null;
  12266. };
  12267. /**
  12268. * Refresh guide element
  12269. * @param {number} newWidth - new width percentage value to resize guide element.
  12270. */
  12271. DayGridResizeGuide.prototype.refreshGuideElement = function(newWidth) {
  12272. var guideElement = this.guideElement;
  12273. reqAnimFrame.requestAnimFrame(function() {
  12274. guideElement.style.width = newWidth + '%';
  12275. });
  12276. };
  12277. /**
  12278. * Return function that calculate guide element's new width percentage value.
  12279. * @param {object} dragStartEventData - dragstart schedule data.
  12280. * @returns {function} return function that calculate guide element new width percentage.
  12281. */
  12282. DayGridResizeGuide.prototype.getGuideElementWidthFunc = function(dragStartEventData) {
  12283. var model = dragStartEventData.model,
  12284. viewOptions = this.resizeHandler.view.options,
  12285. fromLeft = Math.ceil(
  12286. (model.start - viewOptions.renderStartDate) / datetime.MILLISECONDS_PER_DAY
  12287. ) || 0,
  12288. grids = dragStartEventData.grids;
  12289. return function(xIndex) {
  12290. var width = 0;
  12291. var i = 0;
  12292. var length = grids.length;
  12293. width += grids[fromLeft] ? grids[fromLeft].width : 0;
  12294. for (; i < length; i += 1) {
  12295. if (i > fromLeft && i <= xIndex) {
  12296. width += grids[i] ? grids[i].width : 0;
  12297. }
  12298. }
  12299. return width;
  12300. };
  12301. };
  12302. /**
  12303. * DragStart event handler.
  12304. * @param {object} dragStartEventData - schedule data.
  12305. */
  12306. DayGridResizeGuide.prototype._onDragStart = function(dragStartEventData) {
  12307. var container = this.resizeHandler.view.container,
  12308. scheduleBlockElement = this.scheduleBlockElement = dragStartEventData.scheduleBlockElement,
  12309. guideElement = this.guideElement = scheduleBlockElement.cloneNode(true),
  12310. scheduleContainer;
  12311. if (!util.browser.msie) {
  12312. domutil.addClass(global.document.body, config.classname('resizing-x'));
  12313. }
  12314. scheduleContainer = domutil.find(config.classname('.weekday-schedules'), container);
  12315. domutil.addClass(guideElement, config.classname('daygrid-guide-move'));
  12316. domutil.addClass(scheduleBlockElement, config.classname('weekday-schedule-block-dragging-dim'));
  12317. scheduleContainer.appendChild(guideElement);
  12318. this.getScheduleDataFunc = this.getGuideElementWidthFunc(dragStartEventData);
  12319. };
  12320. /**
  12321. * Drag event handler.
  12322. * @param {object} dragEventData - schedule data.
  12323. */
  12324. DayGridResizeGuide.prototype._onDrag = function(dragEventData) {
  12325. var func = this.getScheduleDataFunc;
  12326. if (!func) {
  12327. return;
  12328. }
  12329. this.refreshGuideElement(func(dragEventData.xIndex));
  12330. };
  12331. module.exports = DayGridResizeGuide;
  12332. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  12333. /***/ }),
  12334. /***/ "./src/js/handler/drag.js":
  12335. /*!********************************!*\
  12336. !*** ./src/js/handler/drag.js ***!
  12337. \********************************/
  12338. /*! no static exports found */
  12339. /***/ (function(module, exports, __webpack_require__) {
  12340. "use strict";
  12341. /* WEBPACK VAR INJECTION */(function(global) {/**
  12342. * @fileoverview Drag handler for calendar.
  12343. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  12344. */
  12345. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  12346. var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js");
  12347. var domevent = __webpack_require__(/*! ../common/domevent */ "./src/js/common/domevent.js");
  12348. var config = __webpack_require__(/*! ../config */ "./src/js/config.js");
  12349. /**
  12350. * @constructor
  12351. * @mixes CustomEvents
  12352. * @param {object} options - options for drag handler
  12353. * @param {number} [options.distance=10] - distance in pixels after mouse must move before dragging should start
  12354. * @param {function} [options.exclude] - filter function for don't fire drag events that specific conditions.
  12355. * @param {HTMLElement} container element to watching drag interaction.
  12356. */
  12357. function Drag(options, container) {
  12358. domevent.on(container, 'mousedown', this._onMouseDown, this);
  12359. this.options = util.extend({
  12360. distance: 10,
  12361. exclude: null
  12362. }, options);
  12363. /**
  12364. * @type {HTMLElement}
  12365. */
  12366. this.container = container;
  12367. /**
  12368. * Flag for represent current dragging session has been cancelled for exclude option.
  12369. * @type {boolean}
  12370. */
  12371. this._cancelled = false;
  12372. /**
  12373. * @type {boolean}
  12374. */
  12375. this._isMoved = false;
  12376. /**
  12377. * dragging distance in pixel between mousedown and firing dragStart events
  12378. * @type {number}
  12379. */
  12380. this._distance = 0;
  12381. /**
  12382. * @type {boolean}
  12383. */
  12384. this._dragStartFired = false;
  12385. /**
  12386. * @type {object}
  12387. */
  12388. this._dragStartEventData = null;
  12389. }
  12390. /**
  12391. * Destroy method.
  12392. */
  12393. Drag.prototype.destroy = function() {
  12394. domevent.off(this.container, 'mousedown', this._onMouseDown, this);
  12395. this._isMoved = null;
  12396. this.container = null;
  12397. };
  12398. /**
  12399. * Clear cache data for single dragging session.
  12400. */
  12401. Drag.prototype._clearData = function() {
  12402. this._cancelled = false;
  12403. this._distance = 0;
  12404. this._isMoved = false;
  12405. this._dragStartFired = false;
  12406. this._dragStartEventData = null;
  12407. };
  12408. /**
  12409. * Toggle events for mouse dragging.
  12410. * @param {boolean} toBind - bind events related with dragging when supplied "true"
  12411. */
  12412. Drag.prototype._toggleDragEvent = function(toBind) {
  12413. var container = this.container,
  12414. domMethod,
  12415. method;
  12416. if (toBind) {
  12417. domMethod = 'on';
  12418. method = 'disable';
  12419. } else {
  12420. domMethod = 'off';
  12421. method = 'enable';
  12422. }
  12423. domutil[method + 'TextSelection'](container, preventDefaultWhenNotPopup);
  12424. domutil[method + 'ImageDrag'](container, preventDefaultWhenNotPopup);
  12425. domevent[domMethod](global.document, {
  12426. mousemove: this._onMouseMove,
  12427. mouseup: this._onMouseUp
  12428. }, this);
  12429. };
  12430. /**
  12431. * Normalize mouse event object.
  12432. * @param {MouseEvent} mouseEvent - mouse event object.
  12433. * @returns {object} normalized mouse event data.
  12434. */
  12435. Drag.prototype._getEventData = function(mouseEvent) {
  12436. return {
  12437. target: domevent.getEventTarget(mouseEvent),
  12438. originEvent: mouseEvent
  12439. };
  12440. };
  12441. /**
  12442. * MouseDown DOM event handler.
  12443. * @param {MouseEvent} mouseDownEvent MouseDown event object.
  12444. */
  12445. Drag.prototype._onMouseDown = function(mouseDownEvent) {
  12446. var opt = this.options,
  12447. target = domevent.getEventTarget(mouseDownEvent);
  12448. // only primary button can start drag.
  12449. if (domevent.getMouseButton(mouseDownEvent) !== 0) {
  12450. return;
  12451. }
  12452. if (opt.exclude && opt.exclude(target)) {
  12453. this._cancelled = true;
  12454. return;
  12455. }
  12456. this._clearData();
  12457. this._dragStartEventData = this._getEventData(mouseDownEvent);
  12458. this._toggleDragEvent(true);
  12459. /**
  12460. * mousedown event for firefox bug. cancelable.
  12461. * @event Drag#mouseDown
  12462. * @type {object}
  12463. * @property {HTMLElement} target - target element in this event.
  12464. * @property {MouseEvent} originEvent - original mouse event object.
  12465. */
  12466. this.fire('mousedown', this._dragStartEventData);
  12467. };
  12468. /**
  12469. * MouseMove DOM event handler.
  12470. * @emits Drag#drag
  12471. * @emits Drag#dragStart
  12472. * @param {MouseEvent} mouseMoveEvent MouseMove event object.
  12473. */
  12474. Drag.prototype._onMouseMove = function(mouseMoveEvent) {
  12475. var distance;
  12476. if (this._cancelled) {
  12477. this._clearData();
  12478. return;
  12479. }
  12480. distance = this.options.distance;
  12481. // prevent automatic scrolling.
  12482. preventDefaultWhenNotPopup(mouseMoveEvent);
  12483. if (this._distance < distance) {
  12484. this._distance += 1;
  12485. return;
  12486. }
  12487. this._isMoved = true;
  12488. if (!this._dragStartFired) {
  12489. this._dragStartFired = true;
  12490. /**
  12491. * Drag start events. cancelable.
  12492. * @event Drag#dragStart
  12493. * @type {object}
  12494. * @property {HTMLElement} target - target element in this event.
  12495. * @property {MouseEvent} originEvent - original mouse event object.
  12496. */
  12497. if (!this.invoke('dragStart', this._dragStartEventData)) {
  12498. this._toggleDragEvent(false);
  12499. this._clearData();
  12500. return;
  12501. }
  12502. }
  12503. /**
  12504. * CalEvents while dragging.
  12505. * @event Drag#drag
  12506. * @type {object}
  12507. * @property {HTMLElement} target - target element in this event.
  12508. * @property {MouseEvent} originEvent - original mouse event object.
  12509. */
  12510. this.fire('drag', this._getEventData(mouseMoveEvent));
  12511. };
  12512. /**
  12513. * MouseUp DOM event handler.
  12514. * @param {MouseEvent} mouseUpEvent MouseUp event object.
  12515. * @emits Drag#dragEnd
  12516. * @emits Drag#click
  12517. */
  12518. Drag.prototype._onMouseUp = function(mouseUpEvent) {
  12519. if (this._cancelled) {
  12520. return;
  12521. }
  12522. this._toggleDragEvent(false);
  12523. // emit "click" event when not emitted drag event between mousedown and mouseup.
  12524. if (this._isMoved) {
  12525. this._isMoved = false;
  12526. /**
  12527. * Drag end events.
  12528. * @event Drag#dragEnd
  12529. * @type {MouseEvent}
  12530. * @property {HTMLElement} target - target element in this event.
  12531. * @property {MouseEvent} originEvent - original mouse event object.
  12532. */
  12533. this.fire('dragEnd', this._getEventData(mouseUpEvent));
  12534. } else {
  12535. /**
  12536. * Click events.
  12537. * @event Drag#click
  12538. * @type {MouseEvent}
  12539. * @property {HTMLElement} target - target element in this event.
  12540. * @property {MouseEvent} originEvent - original mouse event object.
  12541. */
  12542. this.fire('click', this._getEventData(mouseUpEvent));
  12543. }
  12544. this._clearData();
  12545. };
  12546. /**
  12547. * If the target is not a popup, it prevents the default.
  12548. * @method
  12549. * @param {MouseEvent} event - Mouse event object
  12550. */
  12551. function preventDefaultWhenNotPopup(event) {
  12552. var popup = domutil.closest(event.target, config.classname('.popup'));
  12553. if (!popup) {
  12554. domevent.preventDefault(event);
  12555. }
  12556. }
  12557. util.CustomEvents.mixin(Drag);
  12558. module.exports = Drag;
  12559. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  12560. /***/ }),
  12561. /***/ "./src/js/handler/month/click.js":
  12562. /*!***************************************!*\
  12563. !*** ./src/js/handler/month/click.js ***!
  12564. \***************************************/
  12565. /*! no static exports found */
  12566. /***/ (function(module, exports, __webpack_require__) {
  12567. "use strict";
  12568. /**
  12569. * @fileoverview Click handler for month view
  12570. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  12571. */
  12572. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  12573. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
  12574. datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
  12575. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  12576. /**
  12577. * @constructor
  12578. * @implements {Handler}
  12579. * @mixes util.CustomEvents
  12580. * @param {Drag} [dragHandler] - Drag handler instance.
  12581. * @param {Month} [monthView] - Month view instance.
  12582. * @param {Base} [baseController] - Base controller instance.
  12583. */
  12584. function MonthClick(dragHandler, monthView, baseController) {
  12585. /**
  12586. * @type {Drag}
  12587. */
  12588. this.dragHandler = dragHandler;
  12589. /**
  12590. * @type {Month}
  12591. */
  12592. this.monthView = monthView;
  12593. /**
  12594. * @type {Base}
  12595. */
  12596. this.baseController = baseController;
  12597. dragHandler.on({
  12598. 'click': this._onClick
  12599. }, this);
  12600. }
  12601. /**
  12602. * Destructor
  12603. */
  12604. MonthClick.prototype.destroy = function() {
  12605. this.dragHandler.off(this);
  12606. this.monthView = this.baseController = this.dragHandler = null;
  12607. };
  12608. /**
  12609. * @fires MonthClick#clickMore
  12610. * @param {object} clickEvent - click event object
  12611. */
  12612. MonthClick.prototype._onClick = function(clickEvent) {
  12613. var self = this,
  12614. moreElement,
  12615. scheduleCollection = this.baseController.schedules,
  12616. blockElement = domutil.closest(clickEvent.target, config.classname('.weekday-schedule-block'))
  12617. || domutil.closest(clickEvent.target, config.classname('.month-more-schedule'));
  12618. moreElement = domutil.closest(
  12619. clickEvent.target,
  12620. config.classname('.weekday-exceed-in-month')
  12621. );
  12622. if (moreElement) {
  12623. self.fire('clickMore', {
  12624. date: datetime.parse(domutil.getData(moreElement, 'ymd')),
  12625. target: moreElement,
  12626. ymd: domutil.getData(moreElement, 'ymd')
  12627. });
  12628. }
  12629. if (blockElement) {
  12630. scheduleCollection.doWhenHas(domutil.getData(blockElement, 'id'), function(schedule) {
  12631. /**
  12632. * @events AlldayClick#clickSchedule
  12633. * @type {object}
  12634. * @property {Schedule} schedule - schedule instance
  12635. * @property {MouseEvent} event - MouseEvent object
  12636. */
  12637. self.fire('clickSchedule', {
  12638. schedule: schedule,
  12639. event: clickEvent.originEvent
  12640. });
  12641. });
  12642. }
  12643. };
  12644. util.CustomEvents.mixin(MonthClick);
  12645. module.exports = MonthClick;
  12646. /***/ }),
  12647. /***/ "./src/js/handler/month/core.js":
  12648. /*!**************************************!*\
  12649. !*** ./src/js/handler/month/core.js ***!
  12650. \**************************************/
  12651. /*! no static exports found */
  12652. /***/ (function(module, exports, __webpack_require__) {
  12653. "use strict";
  12654. /* eslint-disable complexity */
  12655. /**
  12656. * @fileoverview Module for calculate date by month view and mouse event object
  12657. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  12658. */
  12659. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  12660. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js"),
  12661. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
  12662. domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js"),
  12663. datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  12664. var mfloor = Math.floor;
  12665. /**
  12666. * Get high order function that can calc date in mouse point
  12667. * @param {Month} monthView - month view
  12668. * @returns {function} function return event data by mouse event object
  12669. */
  12670. function getMousePosDate(monthView) {
  12671. var weekColl = monthView.children,
  12672. weeks = weekColl.sort(function(a, b) {
  12673. return util.stamp(a) - util.stamp(b);
  12674. }),
  12675. weekCount = weekColl.length,
  12676. days = weekColl.single().getRenderDateRange(),
  12677. dayCount = days.length,
  12678. relativeContainer = util.pick(monthView.vLayout.panels[1], 'container'),
  12679. size = domutil.getSize(relativeContainer),
  12680. grids = monthView.grids;
  12681. /**
  12682. * Get the left index
  12683. * @param {number} left - left position(percent)
  12684. * @returns {number} grid left index
  12685. */
  12686. function getX(left) {
  12687. var i = 0;
  12688. var length = grids.length;
  12689. var grid;
  12690. for (; i < length; i += 1) {
  12691. grid = grids[i];
  12692. if (grid.left <= left && left <= (grid.left + grid.width)) {
  12693. return i;
  12694. }
  12695. }
  12696. return left < 0 ? -1 : i;
  12697. }
  12698. /**
  12699. * Get date related with mouse event object
  12700. * @param {object} mouseEvent - click event data
  12701. * @returns {object} data related with mouse event
  12702. */
  12703. function getDate(mouseEvent) {
  12704. var pos = domevent.getMousePosition(mouseEvent, relativeContainer),
  12705. x = getX(common.ratio(size[0], 100, pos[0])),
  12706. y = mfloor(common.ratio(size[1], weekCount, pos[1])),
  12707. weekdayView,
  12708. date,
  12709. dateRange;
  12710. if (y < 0) {
  12711. y = 0;
  12712. }
  12713. if (y >= weeks.length) {
  12714. y = weeks.length - 1;
  12715. }
  12716. weekdayView = util.pick(weeks, y);
  12717. if (!weekdayView) {
  12718. return null;
  12719. }
  12720. dateRange = weekdayView.getRenderDateRange();
  12721. if (x < 0) {
  12722. x = 0;
  12723. }
  12724. if (x >= dateRange.length) {
  12725. x = dateRange.length - 1;
  12726. }
  12727. date = util.pick(dateRange, x);
  12728. if (!date) {
  12729. return null;
  12730. }
  12731. return {
  12732. x: x,
  12733. y: y,
  12734. sizeX: dayCount,
  12735. sizeY: weekCount,
  12736. date: datetime.end(date),
  12737. weekdayView: weekdayView,
  12738. triggerEvent: mouseEvent.type
  12739. };
  12740. }
  12741. return getDate;
  12742. }
  12743. module.exports = getMousePosDate;
  12744. /***/ }),
  12745. /***/ "./src/js/handler/month/creation.js":
  12746. /*!******************************************!*\
  12747. !*** ./src/js/handler/month/creation.js ***!
  12748. \******************************************/
  12749. /*! no static exports found */
  12750. /***/ (function(module, exports, __webpack_require__) {
  12751. "use strict";
  12752. /**
  12753. * @fileoverview Creation handler for month view
  12754. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  12755. */
  12756. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  12757. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  12758. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  12759. var array = __webpack_require__(/*! ../../common/array */ "./src/js/common/array.js");
  12760. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  12761. var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
  12762. var getMousePosDate = __webpack_require__(/*! ./core */ "./src/js/handler/month/core.js");
  12763. var Guide = __webpack_require__(/*! ./creationGuide */ "./src/js/handler/month/creationGuide.js");
  12764. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  12765. var CLICK_DELAY = 300;
  12766. /**
  12767. * @constructor
  12768. * @param {Drag} dragHandler - Drag handler instance.
  12769. * @param {Month} monthView - Month view instance.
  12770. * @param {Base} baseController - Base controller instance.
  12771. * @param {Options} [options] - calendar Options
  12772. */
  12773. function MonthCreation(dragHandler, monthView, baseController, options) {
  12774. /**
  12775. * @type {Drag}
  12776. */
  12777. this.dragHandler = dragHandler;
  12778. /**
  12779. * @type {Month}
  12780. */
  12781. this.monthView = monthView;
  12782. /**
  12783. * @type {Base}
  12784. */
  12785. this.baseController = baseController;
  12786. /**
  12787. * @type {function}
  12788. */
  12789. this.getScheduleData = null;
  12790. /**
  12791. * Cache for dragging session
  12792. * @type {object}
  12793. */
  12794. this._cache = null;
  12795. /**
  12796. * @type {MonthCreationGuide}
  12797. */
  12798. this.guide = new Guide(this);
  12799. /**
  12800. * @type {boolean}
  12801. */
  12802. this._requestOnClick = false;
  12803. /**
  12804. * @type {boolean}
  12805. */
  12806. this._disableDblClick = options.disableDblClick;
  12807. /**
  12808. * @type {boolean}
  12809. */
  12810. this._disableClick = options.disableClick;
  12811. dragHandler.on('dragStart', this._onDragStart, this);
  12812. dragHandler.on('click', this._onClick, this);
  12813. if (this._disableDblClick) {
  12814. CLICK_DELAY = 0;
  12815. } else {
  12816. domevent.on(monthView.container, 'dblclick', this._onDblClick, this);
  12817. }
  12818. }
  12819. /**
  12820. * Destructor
  12821. */
  12822. MonthCreation.prototype.destroy = function() {
  12823. this.dragHandler.off(this);
  12824. this.guide.destroy();
  12825. if (this.monthView && this.monthView.container) {
  12826. domevent.off(this.monthView.container, 'dblclick', this._onDblClick, this);
  12827. }
  12828. this.dragHandler = this.monthView = this.baseController =
  12829. this.getScheduleData = this._cache = this.guide = null;
  12830. };
  12831. /**
  12832. * Fire before create schedule
  12833. * @fires {MonthCreation#beforeCreateSchedule}
  12834. * @param {object} eventData - cache data from single dragging session
  12835. */
  12836. MonthCreation.prototype._createSchedule = function(eventData) {
  12837. /**
  12838. * @event {MonthCreation#beforeCreateSchedule}
  12839. * @type {object}
  12840. * @property {boolean} isAllDay - whether schedule is fired in allday view area?
  12841. * @property {Date} start - select start time
  12842. * @property {Date} end - select end time
  12843. * @property {TimeCreationGuide} guide - TimeCreationGuide instance
  12844. * @property {string} triggerEventName - event name
  12845. */
  12846. this.fire('beforeCreateSchedule', {
  12847. isAllDay: eventData.isAllDay,
  12848. start: eventData.start,
  12849. end: eventData.end,
  12850. guide: this.guide.guide,
  12851. triggerEventName: eventData.triggerEvent
  12852. });
  12853. };
  12854. /**
  12855. * DragStart event handler
  12856. * @fires {MonthCreation#monthCreationDragstart}
  12857. * @param {object} dragStartEvent - dragStart event data
  12858. */
  12859. MonthCreation.prototype._onDragStart = function(dragStartEvent) {
  12860. var eventData;
  12861. if (!isElementWeekdayGrid(dragStartEvent.target)) {
  12862. return;
  12863. }
  12864. this.dragHandler.on({
  12865. drag: this._onDrag,
  12866. dragEnd: this._onDragEnd
  12867. }, this);
  12868. this.getScheduleData = getMousePosDate(this.monthView);
  12869. eventData = this.getScheduleData(dragStartEvent.originEvent);
  12870. this._cache = {
  12871. start: new TZDate(eventData.date)
  12872. };
  12873. /**
  12874. * @event {MonthCreation#monthCreationDragstart}
  12875. * @type {object}
  12876. * @property {number} x - x index
  12877. * @property {number} y - y index
  12878. * @property {Date} date - drag date
  12879. */
  12880. this.fire('monthCreationDragstart', eventData);
  12881. };
  12882. /**
  12883. * Drag event handler
  12884. * @fires {MonthCreation#monthCreationDrag}
  12885. * @param {object} dragEvent - drag event data
  12886. */
  12887. MonthCreation.prototype._onDrag = function(dragEvent) {
  12888. var eventData;
  12889. if (!this.getScheduleData) {
  12890. return;
  12891. }
  12892. eventData = this.getScheduleData(dragEvent.originEvent);
  12893. if (!eventData) {
  12894. return;
  12895. }
  12896. /**
  12897. * @event {MonthCreation#monthCreationDrag}
  12898. * @type {object}
  12899. * @property {number} x - x index
  12900. * @property {number} y - y index
  12901. * @property {Date} date - drag date
  12902. */
  12903. this.fire('monthCreationDrag', eventData);
  12904. };
  12905. /**
  12906. * DragEnd event handler
  12907. * @fires {MonthCreation#monthCreationDragend}
  12908. * @param {object} dragEndEvent - drag end event data
  12909. */
  12910. MonthCreation.prototype._onDragEnd = function(dragEndEvent) {
  12911. var cache = this._cache;
  12912. var eventData;
  12913. var times;
  12914. this.dragHandler.off({
  12915. drag: this._onDrag,
  12916. dragEnd: this._onDragEnd
  12917. }, this);
  12918. if (!this.getScheduleData) {
  12919. return;
  12920. }
  12921. eventData = this.getScheduleData(dragEndEvent.originEvent);
  12922. if (eventData) {
  12923. cache.end = new TZDate(eventData.date);
  12924. cache.isAllDay = true;
  12925. times = [
  12926. cache.start,
  12927. cache.end
  12928. ].sort(array.compare.num.asc);
  12929. cache.start = new TZDate(times[0]);
  12930. cache.end = datetime.end(times[1]);
  12931. this._createSchedule(cache);
  12932. }
  12933. /**
  12934. * @event {MonthCreation#monthCreationDragend}
  12935. * @type {object}
  12936. * @property {number} x - x index
  12937. * @property {number} y - y index
  12938. * @property {Date} date - drag date
  12939. */
  12940. this.fire('monthCreationDragend', eventData);
  12941. this.getScheduleData = this._cache = null;
  12942. };
  12943. /**
  12944. * Dblclick event handler
  12945. * @fires {MonthCreation#monthCreationDragstart}
  12946. * @param {MouseEvent} e - Native MouseEvent
  12947. */
  12948. MonthCreation.prototype._onDblClick = function(e) {
  12949. var eventData, range;
  12950. if (!isElementWeekdayGrid(e.target)) {
  12951. return;
  12952. }
  12953. eventData = getMousePosDate(this.monthView)(e);
  12954. this.fire('monthCreationClick', eventData);
  12955. range = this._adjustStartAndEndTime(new TZDate(eventData.date), new TZDate(eventData.date));
  12956. this._createSchedule({
  12957. start: range.start,
  12958. end: range.end,
  12959. isAllDay: false,
  12960. triggerEvent: eventData.triggerEvent
  12961. });
  12962. this._requestOnClick = false;
  12963. };
  12964. /**
  12965. * Click event handler
  12966. * @fires {MonthCreation#monthCreationDragstart}
  12967. * @param {MouseEvent} e - Native MouseEvent
  12968. */
  12969. MonthCreation.prototype._onClick = function(e) {
  12970. var self = this;
  12971. var eventData, range;
  12972. if (!isElementWeekdayGrid(e.target) || this._disableClick) {
  12973. return;
  12974. }
  12975. eventData = getMousePosDate(this.monthView)(e.originEvent);
  12976. this._requestOnClick = true;
  12977. setTimeout(function() {
  12978. if (self._requestOnClick) {
  12979. self.fire('monthCreationClick', eventData);
  12980. range = self._adjustStartAndEndTime(new TZDate(eventData.date), new TZDate(eventData.date));
  12981. self._createSchedule({
  12982. start: range.start,
  12983. end: range.end,
  12984. isAllDay: false,
  12985. triggerEvent: eventData.triggerEvent
  12986. });
  12987. }
  12988. self._requestOnClick = false;
  12989. }, CLICK_DELAY);
  12990. };
  12991. /**
  12992. * Adjust time to our o'clock
  12993. * @param {TZDate} start - start time
  12994. * @param {TZDate} end - end time
  12995. * @returns {Object} start and end
  12996. */
  12997. MonthCreation.prototype._adjustStartAndEndTime = function(start, end) {
  12998. var now = new TZDate();
  12999. var hours = now.getHours();
  13000. var minutes = now.getMinutes();
  13001. // adjust start to less time. Adjusting had been greater time in monthly view when clicking grid
  13002. if (minutes <= 30) {
  13003. minutes = 0;
  13004. } else {
  13005. minutes = 30;
  13006. }
  13007. start.setHours(hours, minutes, 0, 0);
  13008. end.setHours(hours + 1, minutes, 0, 0);
  13009. return {
  13010. start: start,
  13011. end: end
  13012. };
  13013. };
  13014. /**
  13015. * Invoke creation click
  13016. * @param {Schedule} schedule - schedule instance
  13017. */
  13018. MonthCreation.prototype.invokeCreationClick = function(schedule) {
  13019. var eventData = {
  13020. model: schedule
  13021. };
  13022. this.fire('monthCreationClick', eventData);
  13023. this._createSchedule({
  13024. start: schedule.start,
  13025. end: schedule.end,
  13026. isAllDay: schedule.isAllDay,
  13027. triggerEvent: 'manual'
  13028. });
  13029. };
  13030. /**
  13031. * Returns whether the given element is Weekday-Schedule.
  13032. * @param {HTMLElement} el - target element
  13033. * @returns {boolean}
  13034. */
  13035. function isElementWeekdayGrid(el) {
  13036. return domutil.closest(el, config.classname('.weekday-grid'))
  13037. && !domutil.closest(el, config.classname('.weekday-exceed-in-month'));
  13038. }
  13039. util.CustomEvents.mixin(MonthCreation);
  13040. module.exports = MonthCreation;
  13041. /***/ }),
  13042. /***/ "./src/js/handler/month/creationGuide.js":
  13043. /*!***********************************************!*\
  13044. !*** ./src/js/handler/month/creationGuide.js ***!
  13045. \***********************************************/
  13046. /*! no static exports found */
  13047. /***/ (function(module, exports, __webpack_require__) {
  13048. "use strict";
  13049. /**
  13050. * @fileoverview Creation guide module for month view
  13051. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  13052. */
  13053. var MonthGuide = __webpack_require__(/*! ./guide */ "./src/js/handler/month/guide.js");
  13054. /**
  13055. * @constructor
  13056. * @param {MonthCreation} monthCreation - instance of MonthCreation
  13057. */
  13058. function MonthCreationGuide(monthCreation) {
  13059. /**
  13060. * @type {MonthCreation}
  13061. */
  13062. this.monthCreation = monthCreation;
  13063. /**
  13064. * @type {MonthGuide}
  13065. */
  13066. this.guide = null;
  13067. monthCreation.on({
  13068. monthCreationDragstart: this._createGuideElement,
  13069. monthCreationDrag: this._onDrag,
  13070. monthCreationDragend: this._onDragEnd,
  13071. monthCreationClick: this._createGuideElement
  13072. }, this);
  13073. }
  13074. /**
  13075. * Destructor
  13076. */
  13077. MonthCreationGuide.prototype.destroy = function() {
  13078. this.monthCreation.off(this);
  13079. if (this.guide) {
  13080. this.guide.destroy();
  13081. }
  13082. this.guide = this.monthCreation = null;
  13083. };
  13084. /**
  13085. * Drag start event handler
  13086. * @param {object} dragStartEvent - schedule data from MonthCreation
  13087. */
  13088. MonthCreationGuide.prototype._createGuideElement = function(dragStartEvent) {
  13089. var options = {
  13090. isCreationMode: true,
  13091. height: '100%',
  13092. top: 0
  13093. };
  13094. this.guide = new MonthGuide(options, this.monthCreation.monthView);
  13095. this.guide.start(dragStartEvent);
  13096. };
  13097. /**
  13098. * Drag event handler
  13099. * @param {object} dragEvent - schedule data from MonthCreation
  13100. */
  13101. MonthCreationGuide.prototype._onDrag = function(dragEvent) {
  13102. this.guide.update(dragEvent.x, dragEvent.y);
  13103. };
  13104. /**
  13105. * Drag end event handler
  13106. */
  13107. MonthCreationGuide.prototype._onDragEnd = function() {
  13108. // Do nothing. User calls destroy directly.
  13109. this.guide = null;
  13110. };
  13111. module.exports = MonthCreationGuide;
  13112. /***/ }),
  13113. /***/ "./src/js/handler/month/guide.hbs":
  13114. /*!****************************************!*\
  13115. !*** ./src/js/handler/month/guide.hbs ***!
  13116. \****************************************/
  13117. /*! no static exports found */
  13118. /***/ (function(module, exports, __webpack_require__) {
  13119. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  13120. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  13121. var stack1, helper, alias1=container.escapeExpression, alias2=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  13122. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  13123. return parent[propertyName];
  13124. }
  13125. return undefined
  13126. };
  13127. return "<div class=\""
  13128. + alias1(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":30}}}) : helper)))
  13129. + "month-creation-guide\" style=\"border: "
  13130. + alias1(alias2(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"border") : stack1), depth0))
  13131. + "; background-color: "
  13132. + alias1(alias2(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"backgroundColor") : stack1), depth0))
  13133. + ";\"></div>\n";
  13134. },"3":function(container,depth0,helpers,partials,data) {
  13135. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  13136. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  13137. return parent[propertyName];
  13138. }
  13139. return undefined
  13140. };
  13141. return "<div class=\""
  13142. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":30}}}) : helper)))
  13143. + "weekday-schedule\"\n style=\"height: "
  13144. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
  13145. + "; line-height: "
  13146. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
  13147. + "; margin-top: "
  13148. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleGutter") : stack1), depth0))
  13149. + "; border-radius:"
  13150. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"borderRadius") : stack1), depth0))
  13151. + "; margin-left: "
  13152. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"marginLeft") : stack1), depth0))
  13153. + "; margin-right: "
  13154. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"marginRight") : stack1), depth0))
  13155. + ";\n color:"
  13156. + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":7,"column":18},"end":{"line":7,"column":27}}}) : helper)))
  13157. + ";border-color:"
  13158. + alias4(((helper = (helper = lookupProperty(helpers,"borderColor") || (depth0 != null ? lookupProperty(depth0,"borderColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"borderColor","hash":{},"data":data,"loc":{"start":{"line":7,"column":41},"end":{"line":7,"column":56}}}) : helper)))
  13159. + ";background-color:"
  13160. + alias4(((helper = (helper = lookupProperty(helpers,"bgColor") || (depth0 != null ? lookupProperty(depth0,"bgColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"bgColor","hash":{},"data":data,"loc":{"start":{"line":7,"column":74},"end":{"line":7,"column":85}}}) : helper)))
  13161. + "\">\n <div class=\""
  13162. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":20},"end":{"line":8,"column":34}}}) : helper)))
  13163. + "weekday-schedule-title\">\n"
  13164. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isAllDay") : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(6, data, 0),"data":data,"loc":{"start":{"line":9,"column":12},"end":{"line":13,"column":19}}})) != null ? stack1 : "")
  13165. + " </div>\n <div class=\""
  13166. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":15,"column":20},"end":{"line":15,"column":34}}}) : helper)))
  13167. + "weekday-resize-handle handle-y\" style=\"line-height: "
  13168. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
  13169. + ";\">&nbsp;</div>\n </div>\n";
  13170. },"4":function(container,depth0,helpers,partials,data) {
  13171. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  13172. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  13173. return parent[propertyName];
  13174. }
  13175. return undefined
  13176. };
  13177. return " "
  13178. + ((stack1 = (lookupProperty(helpers,"allday-tmpl")||(depth0 && lookupProperty(depth0,"allday-tmpl"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"allday-tmpl","hash":{},"data":data,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":38}}})) != null ? stack1 : "")
  13179. + "\n";
  13180. },"6":function(container,depth0,helpers,partials,data) {
  13181. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  13182. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  13183. return parent[propertyName];
  13184. }
  13185. return undefined
  13186. };
  13187. return " "
  13188. + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":12,"column":16},"end":{"line":12,"column":36}}})) != null ? stack1 : "")
  13189. + "\n";
  13190. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  13191. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  13192. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  13193. return parent[propertyName];
  13194. }
  13195. return undefined
  13196. };
  13197. return "<div class=\""
  13198. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  13199. + "month-guide-block\" style=\"top:"
  13200. + alias4(((helper = (helper = lookupProperty(helpers,"top") || (depth0 != null ? lookupProperty(depth0,"top") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"top","hash":{},"data":data,"loc":{"start":{"line":1,"column":56},"end":{"line":1,"column":63}}}) : helper)))
  13201. + ";height:"
  13202. + alias4(((helper = (helper = lookupProperty(helpers,"height") || (depth0 != null ? lookupProperty(depth0,"height") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"height","hash":{},"data":data,"loc":{"start":{"line":1,"column":71},"end":{"line":1,"column":81}}}) : helper)))
  13203. + ";display:none\">\n"
  13204. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isCreationMode") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.program(3, data, 0),"data":data,"loc":{"start":{"line":2,"column":4},"end":{"line":17,"column":11}}})) != null ? stack1 : "")
  13205. + "</div>\n";
  13206. },"useData":true});
  13207. /***/ }),
  13208. /***/ "./src/js/handler/month/guide.js":
  13209. /*!***************************************!*\
  13210. !*** ./src/js/handler/month/guide.js ***!
  13211. \***************************************/
  13212. /*! no static exports found */
  13213. /***/ (function(module, exports, __webpack_require__) {
  13214. "use strict";
  13215. /**
  13216. * @fileoverview Guide element controller for creation, resize in month view
  13217. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  13218. */
  13219. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  13220. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
  13221. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
  13222. datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
  13223. TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date,
  13224. tmpl = __webpack_require__(/*! ./guide.hbs */ "./src/js/handler/month/guide.hbs");
  13225. var mmax = Math.max,
  13226. mmin = Math.min,
  13227. mabs = Math.abs,
  13228. mfloor = Math.floor;
  13229. /**
  13230. * @constructor
  13231. * @param {object} [options] - options
  13232. * @param {boolean} [options.useHandle=false] - whether displaying resize handle on
  13233. * guide element?
  13234. * @param {boolean} [options.isResizeMode=false] - whether resize mode?
  13235. * @param {Month} monthView - Month view instance
  13236. */
  13237. function MonthGuide(options, monthView) {
  13238. /**
  13239. * @type {object}
  13240. */
  13241. this.options = util.extend({
  13242. top: 0,
  13243. height: '20px',
  13244. bgColor: '#f7ca88',
  13245. label: 'New event',
  13246. isResizeMode: false,
  13247. isCreationMode: false,
  13248. styles: this._getStyles(monthView.controller.theme)
  13249. }, options);
  13250. /**
  13251. * @type {Month}
  13252. */
  13253. this.view = monthView;
  13254. /**
  13255. * @type {WeekdayInMonth[]}
  13256. */
  13257. this.weeks = monthView.children.sort(function(a, b) {
  13258. return util.stamp(a) - util.stamp(b);
  13259. });
  13260. /**
  13261. * @type {number}
  13262. */
  13263. this.days = monthView.children.single().getRenderDateRange().length;
  13264. /**
  13265. * start coordinate of guide effect. (x, y) (days, weeks) effect can't
  13266. * start lower than this coordinate.
  13267. * @type {number[]}
  13268. */
  13269. this.startCoord = [0, 0];
  13270. /**
  13271. * @type {Object.<string, HTMLElement>}
  13272. */
  13273. this.guideElements = {};
  13274. /**
  13275. * horizontal grid information
  13276. * @type {Object}
  13277. */
  13278. this.grids = monthView.grids;
  13279. }
  13280. /**
  13281. * Destructor
  13282. */
  13283. MonthGuide.prototype.destroy = function() {
  13284. this.clear();
  13285. this.options = this.view = this.weeks = this.days =
  13286. this.startCoord = this.guideElements = null;
  13287. };
  13288. MonthGuide.prototype.clearGuideElement = function() {
  13289. this.destroy();
  13290. };
  13291. /**
  13292. * Get ratio value in week.
  13293. * @param {number} value - value for calc ratio in week
  13294. * @returns {number} percent value
  13295. */
  13296. MonthGuide.prototype._getRatioValueInWeek = function(value) {
  13297. var grid = this.grids[value] || {left: 100};
  13298. return grid.left;
  13299. };
  13300. /**
  13301. * Create guide element
  13302. * @returns {HTMLElement} guide element
  13303. */
  13304. MonthGuide.prototype._createGuideElement = function() {
  13305. var guide = document.createElement('div');
  13306. guide.innerHTML = tmpl(this.options);
  13307. return guide.firstChild;
  13308. };
  13309. /**
  13310. * Get guide element. if not exist then create one
  13311. * @param {number} y - y coordinate
  13312. * @returns {?HTMLElement} guide element
  13313. */
  13314. MonthGuide.prototype._getGuideElement = function(y) {
  13315. var guideElements = this.guideElements,
  13316. guide = guideElements[y],
  13317. weekdayView = this.weeks[y],
  13318. container;
  13319. if (!weekdayView) {
  13320. return null;
  13321. }
  13322. if (!guide) {
  13323. guide = this._createGuideElement();
  13324. container = weekdayView.container;
  13325. container.appendChild(guide);
  13326. guideElements[y] = guide;
  13327. }
  13328. return guide;
  13329. };
  13330. /**
  13331. * Get coordinate by supplied date in month
  13332. * @param {TZDate} date - date to find coordinate
  13333. * @returns {number[]} coordinate (x, y)
  13334. */
  13335. MonthGuide.prototype._getCoordByDate = function(date) {
  13336. var WEEKEND_DAYS = 2;
  13337. var weeks = this.weeks;
  13338. var isWorkWeek = util.pick(this.view, 'options', 'workweek');
  13339. var days = isWorkWeek ? this.days + WEEKEND_DAYS : this.days;
  13340. var getIdxFromDiff = function(d1, d2) {
  13341. return mfloor(datetime.millisecondsTo('day', mabs(d2 - d1)));
  13342. },
  13343. monthStart = datetime.start(weeks[0].options.renderStartDate),
  13344. isBefore = date < monthStart,
  13345. start = new TZDate(monthStart),
  13346. end = new TZDate(monthStart).addDate(isBefore ? -days : days).addDate(-1),
  13347. x = getIdxFromDiff(date, start),
  13348. y = 0;
  13349. while (!datetime.isBetweenWithDate(date, start, end)) {
  13350. start.addDate(isBefore ? -days : days);
  13351. end = new TZDate(start).addDate(days - 1);
  13352. x = getIdxFromDiff(date, start);
  13353. y += (isBefore ? -1 : 1);
  13354. }
  13355. return [x, y];
  13356. };
  13357. /**
  13358. * Get limited coordinate by supplied coodinates
  13359. * @param {number[]} coord - coordinate need to limit
  13360. * @param {number[]} [min] - minimum limitaion of coordinate
  13361. * @param {number[]} [max] - maximum limitation of coordinate
  13362. * @returns {number[]} limited coordiate
  13363. */
  13364. MonthGuide.prototype._getLimitedCoord = function(coord, min, max) {
  13365. var toIndex = 1,
  13366. x = coord[0],
  13367. y = coord[1],
  13368. result;
  13369. min = min || [0, 0];
  13370. max = max || [this.days - toIndex, this.weeks.length - toIndex];
  13371. if (y < min[1]) {
  13372. result = min.slice(0);
  13373. } else if (y > max[1]) {
  13374. result = max.slice(0);
  13375. } else {
  13376. x = mmax(min[0], x);
  13377. x = mmin(max[0], x);
  13378. result = [x, y];
  13379. }
  13380. return result;
  13381. };
  13382. /**
  13383. * Prepare guide element modification
  13384. * @param {object} dragStartEvent - dragStart schedule data from *guide
  13385. */
  13386. MonthGuide.prototype.start = function(dragStartEvent) {
  13387. var opt = this.options,
  13388. target = dragStartEvent.target,
  13389. model = dragStartEvent.model,
  13390. x = dragStartEvent.x,
  13391. y = dragStartEvent.y,
  13392. renderMonth = new TZDate(this.view.options.renderMonth),
  13393. temp;
  13394. if (opt.isCreationMode) {
  13395. if (model && !datetime.isSameMonth(renderMonth, model.start)) {
  13396. model.start.setMonth(renderMonth.getMonth());
  13397. model.start.setDate(1);
  13398. model.end.setMonth(renderMonth.getMonth());
  13399. model.end.setDate(1);
  13400. }
  13401. } else {
  13402. temp = this._getCoordByDate(model.getStarts());
  13403. x = temp[0];
  13404. y = temp[1];
  13405. util.extend(this.options, {
  13406. top: parseInt(target.style.top, 10) + 'px',
  13407. height: parseInt(target.style.height, 10) + 'px',
  13408. label: model.title
  13409. }, model);
  13410. }
  13411. if (util.isUndefined(x) || util.isUndefined(y)) {
  13412. temp = this._getCoordByDate(model.getStarts());
  13413. x = temp[0];
  13414. y = temp[1];
  13415. }
  13416. this.startCoord = [x, y];
  13417. this.update(x, y);
  13418. };
  13419. /**
  13420. * Data for update several guide elements
  13421. * @typedef UpdateIndication
  13422. * @type {object}
  13423. * @property {HTMLElement} guide - guide element
  13424. * @property {number} left - left style value
  13425. * @property {number} width - width style value
  13426. * @property {boolean} [exceedL=false] - whether schedule is exceeded past weeks?
  13427. * @property {boolean} [exceedR=false] - whether schedule is exceeded future weeks?
  13428. */
  13429. /**
  13430. * Modify HTML element that uses for guide element
  13431. * @param {UpdateIndication[]} inds - indication of update severel guide element
  13432. */
  13433. MonthGuide.prototype._updateGuides = function(inds) {
  13434. util.forEach(inds, function(ind) {
  13435. var guide = ind.guide,
  13436. exceedLClass = config.classname('month-exceed-left'),
  13437. exceedRClass = config.classname('month-exceed-right');
  13438. guide.style.display = 'block';
  13439. guide.style.left = ind.left + '%';
  13440. guide.style.width = ind.width + '%';
  13441. if (ind.exceedL) {
  13442. domutil.addClass(guide, exceedLClass);
  13443. } else {
  13444. domutil.removeClass(guide, exceedLClass);
  13445. }
  13446. if (ind.exceedR) {
  13447. domutil.addClass(guide, exceedRClass);
  13448. } else {
  13449. domutil.removeClass(guide, exceedRClass);
  13450. }
  13451. });
  13452. };
  13453. /**
  13454. * Get guide element indicate for origin week
  13455. * @param {number[]} startCoord - drag start coordinate
  13456. * @param {number[]} mouseCoord - mouse coordinate
  13457. * @returns {object} indicate
  13458. */
  13459. MonthGuide.prototype._getOriginIndicate = function(startCoord, mouseCoord) {
  13460. var left = mmin(startCoord[0], mouseCoord[0]),
  13461. right = mmax(startCoord[0], mouseCoord[0]) + 1,
  13462. exceedL, exceedR;
  13463. if (mouseCoord[1] > startCoord[1]) {
  13464. left = startCoord[0];
  13465. right = this.days;
  13466. exceedR = true;
  13467. } else if (mouseCoord[1] < startCoord[1]) {
  13468. left = 0;
  13469. right = startCoord[0] + 1;
  13470. exceedL = true;
  13471. }
  13472. return {
  13473. left: this._getRatioValueInWeek(left),
  13474. width: this._getRatioValueInWeek(right) -
  13475. this._getRatioValueInWeek(left),
  13476. exceedL: exceedL,
  13477. exceedR: exceedR
  13478. };
  13479. };
  13480. /**
  13481. * Get guide element indicate for week related with mouse position
  13482. * @param {number[]} startCoord - drag start coordinate
  13483. * @param {number[]} mouseCoord - mouse coordinate
  13484. * @returns {object} indicate
  13485. */
  13486. MonthGuide.prototype._getMouseIndicate = function(startCoord, mouseCoord) {
  13487. var left = mouseCoord[0],
  13488. right = mouseCoord[0] + 1,
  13489. exceedL, exceedR;
  13490. if (mouseCoord[1] > startCoord[1]) {
  13491. left = 0;
  13492. exceedL = true;
  13493. } else if (mouseCoord[1] < startCoord[1]) {
  13494. right = this.days;
  13495. exceedR = true;
  13496. }
  13497. return {
  13498. left: this._getRatioValueInWeek(left),
  13499. width: this._getRatioValueInWeek(right) -
  13500. this._getRatioValueInWeek(left),
  13501. exceedL: exceedL,
  13502. exceedR: exceedR
  13503. };
  13504. };
  13505. /**
  13506. * Get guide element indicate for contained weeks
  13507. * @returns {object} indicate
  13508. */
  13509. MonthGuide.prototype._getContainIndicate = function() {
  13510. return {
  13511. left: 0,
  13512. width: 100,
  13513. exceedL: true,
  13514. exceedR: true
  13515. };
  13516. };
  13517. /**
  13518. * Remove several guide element that supplied by parameter
  13519. * @param {number[]} yCoords - array of y coordinate to remove guide element
  13520. */
  13521. MonthGuide.prototype._removeGuideElements = function(yCoords) {
  13522. var guides = this.guideElements;
  13523. util.forEach(yCoords, function(y) {
  13524. domutil.remove(guides[y]);
  13525. delete guides[y];
  13526. });
  13527. };
  13528. /**
  13529. * Get excluded numbers in range
  13530. * @param {number[]} range - the range. value must be sequencial.
  13531. * @param {number[]} numbers - numbers to check
  13532. * @returns {number[]} excluded numbers
  13533. */
  13534. MonthGuide.prototype._getExcludesInRange = function(range, numbers) {
  13535. var min = mmin.apply(null, range),
  13536. max = mmax.apply(null, range),
  13537. excludes = [];
  13538. util.forEach(numbers, function(num) {
  13539. num = parseInt(num, 10);
  13540. if (num < min || num > max) {
  13541. excludes.push(num);
  13542. }
  13543. });
  13544. return excludes;
  13545. };
  13546. /**
  13547. * Update guide elements by coordinate in month grid from mousemove event
  13548. * @param {number} x - x coordinate
  13549. * @param {number} y - y coordinate
  13550. */
  13551. MonthGuide.prototype.update = function(x, y) {
  13552. var self = this,
  13553. startCoord = this.startCoord,
  13554. mouseCoord = [x, y],
  13555. limitedCoord = this.options.isResizeMode ?
  13556. this._getLimitedCoord(mouseCoord, startCoord) : mouseCoord,
  13557. renderedYIndex = util.keys(this.guideElements),
  13558. yCoordsToUpdate = util.range(
  13559. mmin(startCoord[1], limitedCoord[1]),
  13560. mmax(startCoord[1], limitedCoord[1]) + 1
  13561. ),
  13562. yCoordsToRemove = this._getExcludesInRange(
  13563. yCoordsToUpdate,
  13564. renderedYIndex
  13565. ),
  13566. renderIndication = {};
  13567. this._removeGuideElements(yCoordsToRemove);
  13568. util.forEach(yCoordsToUpdate, function(guideYCoord) {
  13569. var guide = self._getGuideElement(guideYCoord),
  13570. indicate;
  13571. if (!guide) {
  13572. return;
  13573. }
  13574. if (guideYCoord === startCoord[1]) {
  13575. indicate = self._getOriginIndicate(startCoord, limitedCoord);
  13576. } else if (guideYCoord === mouseCoord[1]) {
  13577. indicate = self._getMouseIndicate(startCoord, mouseCoord);
  13578. } else {
  13579. indicate = self._getContainIndicate();
  13580. }
  13581. renderIndication[guideYCoord] = util.extend({
  13582. guide: guide
  13583. }, indicate);
  13584. });
  13585. this._updateGuides(renderIndication);
  13586. };
  13587. /**
  13588. * Clear all guide elements
  13589. */
  13590. MonthGuide.prototype.clear = function() {
  13591. util.forEach(this.guideElements, function(element) {
  13592. domutil.remove(element);
  13593. });
  13594. this.guideElements = {};
  13595. };
  13596. /**
  13597. * Get the styles from theme
  13598. * @param {Theme} theme - theme instance
  13599. * @returns {object} styles - styles object
  13600. */
  13601. MonthGuide.prototype._getStyles = function(theme) {
  13602. var styles = {};
  13603. if (theme) {
  13604. styles.border = theme.common.creationGuide.border;
  13605. styles.backgroundColor = theme.common.creationGuide.backgroundColor;
  13606. styles.scheduleHeight = theme.month.schedule.height;
  13607. styles.scheduleGutter = theme.month.schedule.marginTop;
  13608. styles.marginLeft = theme.month.schedule.marginLeft;
  13609. styles.marginRight = theme.month.schedule.marginRight;
  13610. styles.borderRadius = theme.month.schedule.borderRadius;
  13611. }
  13612. return styles;
  13613. };
  13614. module.exports = MonthGuide;
  13615. /***/ }),
  13616. /***/ "./src/js/handler/month/move.js":
  13617. /*!**************************************!*\
  13618. !*** ./src/js/handler/month/move.js ***!
  13619. \**************************************/
  13620. /*! no static exports found */
  13621. /***/ (function(module, exports, __webpack_require__) {
  13622. "use strict";
  13623. /**
  13624. * @fileoverview Move handler for month view
  13625. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  13626. */
  13627. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  13628. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
  13629. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
  13630. datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
  13631. getMousePosData = __webpack_require__(/*! ./core */ "./src/js/handler/month/core.js"),
  13632. MonthMoveGuide = __webpack_require__(/*! ./moveGuide */ "./src/js/handler/month/moveGuide.js"),
  13633. TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  13634. /**
  13635. * @constructor
  13636. * @mixes CustomEvents
  13637. * @param {Drag} dragHandler - Drag handler instance.
  13638. * @param {Month} monthView - Month view instance.
  13639. * @param {Base} baseController - Base controller instance.
  13640. */
  13641. function MonthMove(dragHandler, monthView, baseController) {
  13642. /**
  13643. * @type {Drag}
  13644. */
  13645. this.dragHandler = dragHandler;
  13646. /**
  13647. * @type {Month}
  13648. */
  13649. this.monthView = monthView;
  13650. /**
  13651. * @type {Base}
  13652. */
  13653. this.baseController = baseController;
  13654. /**
  13655. * @type {function}
  13656. */
  13657. this.getScheduleData = null;
  13658. /**
  13659. * @type {object}
  13660. */
  13661. this._cache = null;
  13662. /**
  13663. * @type {MonthMoveGuide}
  13664. */
  13665. this.guide = new MonthMoveGuide(this);
  13666. dragHandler.on('dragStart', this._onDragStart, this);
  13667. }
  13668. /**
  13669. * Destructor
  13670. */
  13671. MonthMove.prototype.destroy = function() {
  13672. this.dragHandler.off(this);
  13673. this.dragHandler = this.monthView = this.baseController = null;
  13674. };
  13675. /**
  13676. * Update target schedule
  13677. * @fires {MonthMove#beforeUpdateSchedule}
  13678. * @param {object} scheduleCache - cache object that result of single dragging
  13679. * session.
  13680. */
  13681. MonthMove.prototype.updateSchedule = function(scheduleCache) {
  13682. var schedule = scheduleCache.model;
  13683. var duration = schedule.duration();
  13684. var startDateRaw = datetime.raw(schedule.start);
  13685. var dragEndTime = new TZDate(scheduleCache.end);
  13686. var newStartDate = new TZDate(dragEndTime);
  13687. newStartDate.setHours(startDateRaw.h, startDateRaw.m, startDateRaw.s, startDateRaw.ms);
  13688. /**
  13689. * @event MonthMove#beforeUpdateSchedule
  13690. * @type {object}
  13691. * @property {Schedule} schedule - The original schedule instance
  13692. * @property {Date} start - Deprecated: start time to update
  13693. * @property {Date} end - Deprecated: end time to update
  13694. * @property {object} changes - start and end time to update
  13695. * @property {Date} start - start time to update
  13696. * @property {Date} end - end time to update
  13697. */
  13698. this.fire('beforeUpdateSchedule', {
  13699. schedule: schedule,
  13700. changes: {
  13701. start: newStartDate,
  13702. end: new TZDate(newStartDate).addMilliseconds(duration)
  13703. },
  13704. start: newStartDate,
  13705. end: new TZDate(newStartDate).addMilliseconds(duration)
  13706. });
  13707. };
  13708. /**
  13709. * Get schedule block to clone for month guide effect
  13710. * @param {HTMLElement} target - target element that related with drag schedule
  13711. * @returns {HTMLElement} element to create guide effect
  13712. */
  13713. MonthMove.prototype.getMonthScheduleBlock = function(target) {
  13714. var blockSelector = config.classname('.weekday-schedule-block');
  13715. return domutil.closest(target, blockSelector);
  13716. };
  13717. /**
  13718. * Get schedule block from more layer
  13719. * @param {HTMLElement} target - element to check
  13720. * @returns {HTMLElement} schedule element
  13721. */
  13722. MonthMove.prototype.getMoreLayerScheduleBlock = function(target) {
  13723. var className = config.classname('.month-more-schedule');
  13724. return domutil.closest(target, className);
  13725. };
  13726. /**
  13727. * Check handler has permission to handle fired schedule
  13728. * @fires {MonthMove#monthMoveStart_from_morelayer}
  13729. * @param {HTMLElement} target - target element of fired schedule
  13730. * @returns {(string|null)} model instance ID related with schedule. if handle
  13731. * has not permission to handle the schedule then return null.
  13732. */
  13733. MonthMove.prototype.hasPermissionToHandle = function(target) {
  13734. var modelID = null;
  13735. var blockElement;
  13736. if (domutil.hasClass(target, config.classname('weekday-resize-handle'))) {
  13737. return null;
  13738. }
  13739. blockElement = this.getMonthScheduleBlock(target);
  13740. if (blockElement) {
  13741. modelID = domutil.getData(blockElement, 'id');
  13742. } else {
  13743. blockElement = this.getMoreLayerScheduleBlock(target);
  13744. if (blockElement) {
  13745. modelID = domutil.getData(blockElement, 'id');
  13746. /**
  13747. * Fire for notificate that the drag schedule start at more layer view.
  13748. * @event {MonthMove#monthMoveStart_from_morelayer}
  13749. */
  13750. this.fire('monthMoveStart_from_morelayer');
  13751. }
  13752. }
  13753. return modelID;
  13754. };
  13755. /**
  13756. * Event handler for Drag#dragStart
  13757. * @fires {MonthMove#monthMoveDragstart}
  13758. * @param {object} dragStartEvent - drag start schedule data
  13759. */
  13760. MonthMove.prototype._onDragStart = function(dragStartEvent) {
  13761. var target = dragStartEvent.target,
  13762. modelID = this.hasPermissionToHandle(target),
  13763. model = this.baseController.schedules.items[modelID],
  13764. scheduleData;
  13765. if (!modelID || !model || model.isReadOnly || model.isPending) {
  13766. return;
  13767. }
  13768. this.dragHandler.on({
  13769. drag: this._onDrag,
  13770. dragEnd: this._onDragEnd
  13771. }, this);
  13772. this.getScheduleData = getMousePosData(this.monthView);
  13773. scheduleData = this.getScheduleData(dragStartEvent.originEvent);
  13774. scheduleData.originEvent = dragStartEvent.originEvent;
  13775. scheduleData.target = this.getMonthScheduleBlock(target);
  13776. scheduleData.model = model;
  13777. this._cache = {
  13778. model: model,
  13779. target: target,
  13780. start: new TZDate(Number(scheduleData.date))
  13781. };
  13782. /**
  13783. * @event {MonthMove#monthMoveDragstart}
  13784. * @type {object}
  13785. * @property {number} x - x index
  13786. * @property {number} y - y index
  13787. * @property {Date} date - drag date
  13788. * @property {HTMLElement} target - schedule block element
  13789. * @property {Schedule} model - model instance
  13790. */
  13791. this.fire('monthMoveDragstart', scheduleData);
  13792. };
  13793. /**
  13794. * @fires {MonthMove#monthMoveDrag}
  13795. * @param {object} dragEvent - drag event data
  13796. */
  13797. MonthMove.prototype._onDrag = function(dragEvent) {
  13798. var scheduleData;
  13799. if (!this.getScheduleData) {
  13800. return;
  13801. }
  13802. scheduleData = util.extend({
  13803. originEvent: dragEvent.originEvent
  13804. }, this.getScheduleData(dragEvent.originEvent));
  13805. if (!scheduleData) {
  13806. return;
  13807. }
  13808. /**
  13809. * @event {MonthMove#monthMoveDrag}
  13810. * @type {object}
  13811. * @property {number} x - x index
  13812. * @property {number} y - y index
  13813. * @property {Date} date - drag date
  13814. */
  13815. this.fire('monthMoveDrag', scheduleData);
  13816. };
  13817. /**
  13818. * Event handler for Drag#dragEnd
  13819. * @fires {MonthMove#monthMoveDragend}
  13820. * @param {object} dragEndEvent - dragend event data
  13821. */
  13822. MonthMove.prototype._onDragEnd = function(dragEndEvent) {
  13823. var cache = this._cache;
  13824. var scheduleData;
  13825. this.dragHandler.off({
  13826. drag: this._onDrag,
  13827. dragEnd: this._onDragEnd
  13828. }, this);
  13829. if (!this.getScheduleData) {
  13830. return;
  13831. }
  13832. scheduleData = this.getScheduleData(dragEndEvent.originEvent);
  13833. if (scheduleData) {
  13834. cache.end = new TZDate(scheduleData.date);
  13835. this.updateSchedule(cache);
  13836. }
  13837. /**
  13838. * @event {MonthResize#monthMoveDragend}
  13839. * @type {object}
  13840. * @property {number} x - x index
  13841. * @property {number} y - y index
  13842. * @property {Date} date - drag date
  13843. */
  13844. this.fire('monthMoveDragend', scheduleData);
  13845. this.getScheduleData = this._cache = null;
  13846. };
  13847. util.CustomEvents.mixin(MonthMove);
  13848. module.exports = MonthMove;
  13849. /***/ }),
  13850. /***/ "./src/js/handler/month/moveGuide.hbs":
  13851. /*!********************************************!*\
  13852. !*** ./src/js/handler/month/moveGuide.hbs ***!
  13853. \********************************************/
  13854. /*! no static exports found */
  13855. /***/ (function(module, exports, __webpack_require__) {
  13856. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  13857. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  13858. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  13859. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  13860. return parent[propertyName];
  13861. }
  13862. return undefined
  13863. };
  13864. return " border-left:3px solid "
  13865. + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  13866. + ";\n ";
  13867. },"3":function(container,depth0,helpers,partials,data) {
  13868. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  13869. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  13870. return parent[propertyName];
  13871. }
  13872. return undefined
  13873. };
  13874. return " <span class=\""
  13875. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":31}}}) : helper)))
  13876. + "weekday-schedule-bullet "
  13877. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":55},"end":{"line":14,"column":69}}}) : helper)))
  13878. + "weekday-schedule-bullet-focused\" style=\"top: "
  13879. + alias4(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleBulletTop") : stack1), depth0))
  13880. + "px;\"></span>\n";
  13881. },"5":function(container,depth0,helpers,partials,data) {
  13882. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  13883. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  13884. return parent[propertyName];
  13885. }
  13886. return undefined
  13887. };
  13888. return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":110},"end":{"line":16,"column":124}}}) : helper)))
  13889. + "weekday-schedule-title-focused";
  13890. },"7":function(container,depth0,helpers,partials,data) {
  13891. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  13892. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  13893. return parent[propertyName];
  13894. }
  13895. return undefined
  13896. };
  13897. return " "
  13898. + ((stack1 = (lookupProperty(helpers,"allday-tmpl")||(depth0 && lookupProperty(depth0,"allday-tmpl"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"allday-tmpl","hash":{},"data":data,"loc":{"start":{"line":18,"column":12},"end":{"line":18,"column":35}}})) != null ? stack1 : "")
  13899. + "\n";
  13900. },"9":function(container,depth0,helpers,partials,data) {
  13901. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  13902. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  13903. return parent[propertyName];
  13904. }
  13905. return undefined
  13906. };
  13907. return " "
  13908. + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":20,"column":12},"end":{"line":20,"column":33}}})) != null ? stack1 : "")
  13909. + "\n";
  13910. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  13911. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  13912. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  13913. return parent[propertyName];
  13914. }
  13915. return undefined
  13916. };
  13917. return "<div class=\""
  13918. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  13919. + "month-guide "
  13920. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":52}}}) : helper)))
  13921. + "month-guide-focused\"\n style=\"top: -50%;\n left: -50%;\n width: 100%;\n color: #ffffff;\n background-color:"
  13922. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"dragBgColor") : stack1), depth0))
  13923. + ";\n height:"
  13924. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
  13925. + "px;\n line-height:"
  13926. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
  13927. + "px;\n border-radius: "
  13928. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"borderRadius") : stack1), depth0))
  13929. + ";\n"
  13930. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":12},"end":{"line":12,"column":19}}})) != null ? stack1 : "")
  13931. + "\">\n"
  13932. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),{"name":"unless","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":13,"column":4},"end":{"line":15,"column":15}}})) != null ? stack1 : "")
  13933. + " <div class=\""
  13934. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":16},"end":{"line":16,"column":30}}}) : helper)))
  13935. + "month-move-guide "
  13936. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":47},"end":{"line":16,"column":61}}}) : helper)))
  13937. + "weekday-schedule-title "
  13938. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),{"name":"unless","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":16,"column":84},"end":{"line":16,"column":165}}})) != null ? stack1 : "")
  13939. + "\">\n"
  13940. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.program(9, data, 0),"data":data,"loc":{"start":{"line":17,"column":8},"end":{"line":21,"column":15}}})) != null ? stack1 : "")
  13941. + " </div>\n</div>\n<div class=\""
  13942. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":24,"column":12},"end":{"line":24,"column":26}}}) : helper)))
  13943. + "month-guide-cover\" style=\"height:"
  13944. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"scheduleHeight") : stack1), depth0))
  13945. + "px; border-radius: "
  13946. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"borderRadius") : stack1), depth0))
  13947. + ";\"></div>\n";
  13948. },"useData":true});
  13949. /***/ }),
  13950. /***/ "./src/js/handler/month/moveGuide.js":
  13951. /*!*******************************************!*\
  13952. !*** ./src/js/handler/month/moveGuide.js ***!
  13953. \*******************************************/
  13954. /*! no static exports found */
  13955. /***/ (function(module, exports, __webpack_require__) {
  13956. "use strict";
  13957. /* WEBPACK VAR INJECTION */(function(global) {/**
  13958. * @fileoverview Module for modification of guide element for move in month view
  13959. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  13960. */
  13961. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  13962. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
  13963. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
  13964. domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js"),
  13965. FloatingLayer = __webpack_require__(/*! ../../common/floatingLayer */ "./src/js/common/floatingLayer.js"),
  13966. tmpl = __webpack_require__(/*! ./moveGuide.hbs */ "./src/js/handler/month/moveGuide.hbs"),
  13967. Schedule = __webpack_require__(/*! ../../model/schedule */ "./src/js/model/schedule.js");
  13968. /**
  13969. * @constructor
  13970. * @param {MonthMove} monthMove - month/move module instance
  13971. */
  13972. function MonthMoveGuide(monthMove) {
  13973. /**
  13974. * @type {MonthMove}
  13975. */
  13976. this.monthMove = monthMove;
  13977. /**
  13978. * @type {HTMLElement[]}
  13979. */
  13980. this.elements = null;
  13981. /**
  13982. * @type {FloatingLayer}
  13983. */
  13984. this.layer = null;
  13985. monthMove.on({
  13986. monthMoveDragstart: this._onDragStart,
  13987. monthMoveDrag: this._onDrag,
  13988. monthMoveDragend: this._onDragEnd
  13989. }, this);
  13990. }
  13991. /**
  13992. * Destructor
  13993. */
  13994. MonthMoveGuide.prototype.destroy = function() {
  13995. this.monthMove.off(this);
  13996. this._clearGridBgColor();
  13997. if (this.layer) {
  13998. this.layer.destroy();
  13999. }
  14000. if (this.element) {
  14001. domutil.remove(this.element);
  14002. }
  14003. this.monthMove = this.elements = this.layer = null;
  14004. };
  14005. /**
  14006. * Hide element blocks for resize effect
  14007. * @param {number} modelID - Schedule model instance ID
  14008. */
  14009. MonthMoveGuide.prototype._hideOriginScheduleBlocks = function(modelID) {
  14010. var className = config.classname('weekday-schedule-block-dragging-dim');
  14011. this.elements = domutil.find(
  14012. config.classname('.weekday-schedule-block-' + modelID),
  14013. this.monthMove.monthView.container,
  14014. true
  14015. );
  14016. util.forEach(this.elements, function(el) {
  14017. domutil.addClass(el, className);
  14018. });
  14019. };
  14020. /**
  14021. * Show element blocks
  14022. */
  14023. MonthMoveGuide.prototype._showOriginScheduleBlocks = function() {
  14024. var className = config.classname('weekday-schedule-block-dragging-dim');
  14025. util.forEach(this.elements, function(el) {
  14026. domutil.removeClass(el, className);
  14027. });
  14028. };
  14029. /**
  14030. * Clear background color for filled grid element.
  14031. */
  14032. MonthMoveGuide.prototype._clearGridBgColor = function() {
  14033. var selector = config.classname('.weekday-filled'),
  14034. className = config.classname('weekday-filled'),
  14035. beforeGridElement = domutil.find(selector,
  14036. this.monthMove.monthView.container);
  14037. if (beforeGridElement) {
  14038. domutil.removeClass(beforeGridElement, className);
  14039. }
  14040. };
  14041. /**
  14042. * Fill background color of date grids relatied with model updates.
  14043. * @param {object} dragEvent - drag event data from MonthMoveGuide#_onDrag
  14044. */
  14045. MonthMoveGuide.prototype._updateGridBgColor = function(dragEvent) {
  14046. var gridElements = domutil.find(config.classname('.weekday-grid-line'), this.monthMove.monthView.container, true),
  14047. className = config.classname('weekday-filled'),
  14048. targetIndex = (dragEvent.x + (dragEvent.sizeX * dragEvent.y));
  14049. this._clearGridBgColor();
  14050. if (!gridElements || !gridElements[targetIndex]) {
  14051. return;
  14052. }
  14053. domutil.addClass(gridElements[targetIndex], className);
  14054. };
  14055. /**
  14056. * Handler for MonthMove#dragStart
  14057. * @param {object} dragStartEvent - dragStart schedule data object
  14058. */
  14059. MonthMoveGuide.prototype._onDragStart = function(dragStartEvent) {
  14060. var monthView = this.monthMove.monthView,
  14061. firstWeekdayView = monthView.children.single(),
  14062. weekdayOptions = firstWeekdayView.options,
  14063. widthPercent = 100 / firstWeekdayView.getRenderDateRange().length,
  14064. height = weekdayOptions.scheduleGutter + weekdayOptions.scheduleHeight,
  14065. container = monthView.container,
  14066. mousePos = domevent.getMousePosition(dragStartEvent.originEvent, container),
  14067. model = dragStartEvent.model,
  14068. layer = new FloatingLayer(null, container);
  14069. this._hideOriginScheduleBlocks(model.cid());
  14070. this.layer = layer;
  14071. layer.setSize(widthPercent + '%', height);
  14072. layer.setPosition(mousePos[0], mousePos[1]);
  14073. layer.setContent(tmpl({
  14074. model: util.extend(
  14075. Schedule.create(model),
  14076. model
  14077. ),
  14078. styles: {
  14079. scheduleHeight: weekdayOptions.scheduleHeight,
  14080. scheduleBulletTop: weekdayOptions.scheduleHeight / 3,
  14081. borderRadius: monthView.controller.theme.month.schedule.borderRadius
  14082. }
  14083. }));
  14084. layer.show();
  14085. if (!util.browser.msie) {
  14086. domutil.addClass(global.document.body, config.classname('dragging'));
  14087. }
  14088. };
  14089. /**
  14090. * Handler for MonthMove#drag
  14091. * @param {object} dragEvent - drag event data object
  14092. */
  14093. MonthMoveGuide.prototype._onDrag = function(dragEvent) {
  14094. var container = this.monthMove.monthView.container,
  14095. mousePos = domevent.getMousePosition(
  14096. dragEvent.originEvent,
  14097. container
  14098. );
  14099. this._updateGridBgColor(dragEvent);
  14100. if (!this.layer) {
  14101. return;
  14102. }
  14103. this.layer.setPosition(mousePos[0], mousePos[1]);
  14104. };
  14105. /**
  14106. * Handler for MonthMove#dragEnd
  14107. */
  14108. MonthMoveGuide.prototype._onDragEnd = function() {
  14109. this._showOriginScheduleBlocks();
  14110. if (!util.browser.msie) {
  14111. domutil.removeClass(global.document.body, config.classname('dragging'));
  14112. }
  14113. this._clearGridBgColor();
  14114. this.layer.destroy();
  14115. this.layer = null;
  14116. };
  14117. module.exports = MonthMoveGuide;
  14118. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  14119. /***/ }),
  14120. /***/ "./src/js/handler/month/resize.js":
  14121. /*!****************************************!*\
  14122. !*** ./src/js/handler/month/resize.js ***!
  14123. \****************************************/
  14124. /*! no static exports found */
  14125. /***/ (function(module, exports, __webpack_require__) {
  14126. "use strict";
  14127. /**
  14128. * @fileoverview Module for resize schedule in month view
  14129. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  14130. */
  14131. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  14132. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
  14133. datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
  14134. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
  14135. getMousePosData = __webpack_require__(/*! ./core */ "./src/js/handler/month/core.js"),
  14136. MonthResizeGuide = __webpack_require__(/*! ./resizeGuide */ "./src/js/handler/month/resizeGuide.js"),
  14137. TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  14138. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  14139. /**
  14140. * @constructor
  14141. * @param {Drag} dragHandler - Drag handler instance.
  14142. * @param {Month} monthView - Month view instance.
  14143. * @param {Base} baseController - Base controller instance.
  14144. */
  14145. function MonthResize(dragHandler, monthView, baseController) {
  14146. /**
  14147. * @type {Drag}
  14148. */
  14149. this.dragHandler = dragHandler;
  14150. /**
  14151. * @type {Month}
  14152. */
  14153. this.monthView = monthView;
  14154. /**
  14155. * @type {Base}
  14156. */
  14157. this.baseController = baseController;
  14158. /**
  14159. * @type {function}
  14160. */
  14161. this.getScheduleData = null;
  14162. /**
  14163. * @type {object}
  14164. */
  14165. this._cache = null;
  14166. /**
  14167. * @type {MonthResizeGuide}
  14168. */
  14169. this.guide = new MonthResizeGuide(this);
  14170. dragHandler.on('dragStart', this._onDragStart, this);
  14171. }
  14172. /**
  14173. * Destructor
  14174. */
  14175. MonthResize.prototype.destroy = function() {
  14176. this.dragHandler.off(this);
  14177. this.dragHandler = this.monthView = this.baseController = null;
  14178. };
  14179. /**
  14180. * Fire event for update model
  14181. * @fires {MonthResize#beforeUpdateSchedule}
  14182. * @param {object} scheduleCache - cache object that result of single dragging
  14183. * session.
  14184. */
  14185. MonthResize.prototype._updateSchedule = function(scheduleCache) {
  14186. // You can not change the start date of the event. Only the end time can be changed.
  14187. var newEnd = datetime.end(new TZDate(scheduleCache.end)),
  14188. schedule = scheduleCache.schedule;
  14189. var changes = common.getScheduleChanges(
  14190. schedule,
  14191. ['end'],
  14192. {end: newEnd}
  14193. );
  14194. /**
  14195. * @event MonthResize#beforeUpdateSchedule
  14196. * @type {object}
  14197. * @property {Schedule} schedule - The original schedule instance
  14198. * @property {Date} start - Deprecated: start time to update
  14199. * @property {Date} end - Deprecated: end time to update
  14200. * @property {object} changes - end time to update
  14201. * @property {date} end - end time to update
  14202. */
  14203. this.fire('beforeUpdateSchedule', {
  14204. schedule: schedule,
  14205. changes: changes,
  14206. start: new TZDate(schedule.getStarts()),
  14207. end: newEnd
  14208. });
  14209. };
  14210. /**
  14211. * Event handler for Drag#dragStart
  14212. * @fires {MonthResize#monthResizeDragstart}
  14213. * @param {object} dragStartEvent - drag start event data
  14214. */
  14215. MonthResize.prototype._onDragStart = function(dragStartEvent) {
  14216. var target = dragStartEvent.target,
  14217. modelID, schedule,
  14218. scheduleData;
  14219. if (!domutil.hasClass(target, config.classname('weekday-resize-handle'))) {
  14220. return;
  14221. }
  14222. target = domutil.closest(target, config.classname('.weekday-schedule-block'));
  14223. if (!target) {
  14224. return;
  14225. }
  14226. modelID = domutil.getData(target, 'id');
  14227. schedule = this.baseController.schedules.items[modelID];
  14228. this.dragHandler.on({
  14229. drag: this._onDrag,
  14230. dragEnd: this._onDragEnd
  14231. }, this);
  14232. this.getScheduleData = getMousePosData(this.monthView);
  14233. scheduleData = this.getScheduleData(dragStartEvent.originEvent);
  14234. scheduleData.target = target;
  14235. scheduleData.model = schedule;
  14236. this._cache = {
  14237. schedule: schedule,
  14238. target: target,
  14239. start: new TZDate(scheduleData.date)
  14240. };
  14241. /**
  14242. * @event {MonthCreation#monthResizeDragstart}
  14243. * @type {object}
  14244. * @property {number} x - x index
  14245. * @property {number} y - y index
  14246. * @property {Date} date - drag date
  14247. * @property {HTMLElement} target - schedule block element
  14248. * @property {Schedule} model - model instance
  14249. */
  14250. this.fire('monthResizeDragstart', scheduleData);
  14251. };
  14252. /**
  14253. * @fires {MonthResize#monthResizeDrag}
  14254. * @param {object} dragEvent - drag event data
  14255. */
  14256. MonthResize.prototype._onDrag = function(dragEvent) {
  14257. var scheduleData;
  14258. if (!this.getScheduleData) {
  14259. return;
  14260. }
  14261. scheduleData = this.getScheduleData(dragEvent.originEvent);
  14262. if (!scheduleData) {
  14263. return;
  14264. }
  14265. /**
  14266. * @event {MonthResize#monthResizeDrag}
  14267. * @type {object}
  14268. * @property {number} x - x index
  14269. * @property {number} y - y index
  14270. * @property {Date} date - drag date
  14271. */
  14272. this.fire('monthResizeDrag', scheduleData);
  14273. };
  14274. /**
  14275. * @fires {MonthResize#monthResizeDragend}
  14276. * @param {object} dragEndEvent - drag end event data
  14277. */
  14278. MonthResize.prototype._onDragEnd = function(dragEndEvent) {
  14279. var cache = this._cache;
  14280. var scheduleData;
  14281. var start, end;
  14282. this.dragHandler.off({
  14283. drag: this._onDrag,
  14284. dragEnd: this._onDragEnd
  14285. }, this);
  14286. if (!this.getScheduleData) {
  14287. return;
  14288. }
  14289. scheduleData = this.getScheduleData(dragEndEvent.originEvent);
  14290. if (scheduleData) {
  14291. start = new TZDate(cache.schedule.getStarts());
  14292. end = new TZDate(scheduleData.date);
  14293. cache.end = end;
  14294. if (start <= cache.end) {
  14295. this._updateSchedule(cache);
  14296. }
  14297. }
  14298. /**
  14299. * @event {MonthResize#monthResizeDragend}
  14300. * @type {object}
  14301. * @property {number} x - x index
  14302. * @property {number} y - y index
  14303. * @property {Date} date - drag date
  14304. */
  14305. this.fire('monthResizeDragend', scheduleData);
  14306. this.getScheduleData = this._cache = null;
  14307. };
  14308. util.CustomEvents.mixin(MonthResize);
  14309. module.exports = MonthResize;
  14310. /***/ }),
  14311. /***/ "./src/js/handler/month/resizeGuide.js":
  14312. /*!*********************************************!*\
  14313. !*** ./src/js/handler/month/resizeGuide.js ***!
  14314. \*********************************************/
  14315. /*! no static exports found */
  14316. /***/ (function(module, exports, __webpack_require__) {
  14317. "use strict";
  14318. /* WEBPACK VAR INJECTION */(function(global) {/**
  14319. * @fileoverview Module for modification of guide element in schedule resize
  14320. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  14321. */
  14322. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  14323. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
  14324. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
  14325. MonthGuide = __webpack_require__(/*! ./guide */ "./src/js/handler/month/guide.js");
  14326. /**
  14327. * @constructor
  14328. * @param {MonthResize} monthResize - month/resize module instance
  14329. */
  14330. function MonthResizeGuide(monthResize) {
  14331. /**
  14332. * @type {MonthResize}
  14333. */
  14334. this.monthResize = monthResize;
  14335. /**
  14336. * @type {HTMLElement[]}
  14337. */
  14338. this.elements = null;
  14339. /**
  14340. * @type {MonthGuide}
  14341. */
  14342. this.guide = null;
  14343. monthResize.on({
  14344. monthResizeDragstart: this._onDragStart,
  14345. monthResizeDrag: this._onDrag,
  14346. monthResizeDragend: this._onDragEnd
  14347. }, this);
  14348. }
  14349. /**
  14350. * Destructor
  14351. */
  14352. MonthResizeGuide.prototype.destroy = function() {
  14353. this.monthResize.off(this);
  14354. this.guide.destroy();
  14355. this.guide = this.monthResize = null;
  14356. };
  14357. /**
  14358. * Hide element blocks for resize effect
  14359. * @param {number} modelID - Schedule model instance ID
  14360. */
  14361. MonthResizeGuide.prototype._hideScheduleBlocks = function(modelID) {
  14362. this.elements = domutil.find(
  14363. config.classname('.weekday-schedule-block-' + modelID),
  14364. this.monthResize.monthView.container,
  14365. true
  14366. );
  14367. util.forEach(this.elements, function(el) {
  14368. el.style.display = 'none';
  14369. });
  14370. };
  14371. /**
  14372. * Show element blocks
  14373. */
  14374. MonthResizeGuide.prototype._showScheduleBlocks = function() {
  14375. util.forEach(this.elements, function(el) {
  14376. el.style.display = 'block';
  14377. });
  14378. };
  14379. /**
  14380. * Drag start event handler
  14381. * @param {object} dragStartEvent - schedule data from MonthResize
  14382. */
  14383. MonthResizeGuide.prototype._onDragStart = function(dragStartEvent) {
  14384. this.guide = new MonthGuide({
  14385. isResizeMode: true
  14386. }, this.monthResize.monthView);
  14387. this.guide.start(dragStartEvent);
  14388. this._hideScheduleBlocks(dragStartEvent.model.cid());
  14389. if (!util.browser.msie) {
  14390. domutil.addClass(global.document.body, config.classname('resizing-x'));
  14391. }
  14392. };
  14393. /**
  14394. * Drag event handler
  14395. * @param {object} dragEvent - event data from MonthCreation
  14396. */
  14397. MonthResizeGuide.prototype._onDrag = function(dragEvent) {
  14398. this.guide.update(dragEvent.x, dragEvent.y);
  14399. };
  14400. /**
  14401. * Drag end event handler
  14402. */
  14403. MonthResizeGuide.prototype._onDragEnd = function() {
  14404. this._showScheduleBlocks();
  14405. this.guide.destroy();
  14406. this.elements = this.guide = null;
  14407. if (!util.browser.msie) {
  14408. domutil.removeClass(global.document.body, config.classname('resizing-x'));
  14409. }
  14410. };
  14411. module.exports = MonthResizeGuide;
  14412. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  14413. /***/ }),
  14414. /***/ "./src/js/handler/time/click.js":
  14415. /*!**************************************!*\
  14416. !*** ./src/js/handler/time/click.js ***!
  14417. \**************************************/
  14418. /*! no static exports found */
  14419. /***/ (function(module, exports, __webpack_require__) {
  14420. "use strict";
  14421. /**
  14422. * @fileoverview Allday event click event hander module
  14423. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  14424. */
  14425. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  14426. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  14427. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  14428. /**
  14429. * @constructor
  14430. * @implements {Handler}
  14431. * @mixes util.CustomEvents
  14432. * @param {Drag} [dragHandler] - Drag handler instance.
  14433. * @param {TimeGrid} [timeGridView] - TimeGrid view instance.
  14434. * @param {Base} [baseController] - Base controller instance.
  14435. */
  14436. function TimeClick(dragHandler, timeGridView, baseController) {
  14437. /**
  14438. * @type {Drag}
  14439. */
  14440. this.dragHandler = dragHandler;
  14441. /**
  14442. * @type {TimeGrid}
  14443. */
  14444. this.timeGridView = timeGridView;
  14445. /**
  14446. * @type {Base}
  14447. */
  14448. this.baseController = baseController;
  14449. dragHandler.on({
  14450. 'click': this._onClick
  14451. }, this);
  14452. }
  14453. /**
  14454. * Destroy method
  14455. */
  14456. TimeClick.prototype.destroy = function() {
  14457. this.dragHandler.off(this);
  14458. this.timeGridView = this.baseController = this.dragHandler = null;
  14459. };
  14460. /**
  14461. * Check target element is expected condition for activate this plugins.
  14462. * @param {HTMLElement} target - The element to check
  14463. * @returns {string} - model id
  14464. */
  14465. TimeClick.prototype.checkExpectCondition = function(target) {
  14466. var container,
  14467. matches;
  14468. container = domutil.closest(target, config.classname('.time-date'));
  14469. if (!container) {
  14470. return false;
  14471. }
  14472. matches = domutil.getClass(container).match(config.time.getViewIDRegExp);
  14473. if (!matches || matches.length < 2) {
  14474. return false;
  14475. }
  14476. return util.pick(this.timeGridView.children.items, Number(matches[1]));
  14477. };
  14478. /**
  14479. * Click event hander
  14480. * @param {object} clickEvent - click event from {@link Drag}
  14481. * @emits TimeClick#clickEvent
  14482. */
  14483. TimeClick.prototype._onClick = function(clickEvent) {
  14484. var self = this,
  14485. target = clickEvent.target,
  14486. timeView = this.checkExpectCondition(target),
  14487. blockElement = domutil.closest(target, config.classname('.time-date-schedule-block')),
  14488. schedulesCollection = this.baseController.schedules;
  14489. if (!timeView || !blockElement) {
  14490. return;
  14491. }
  14492. schedulesCollection.doWhenHas(domutil.getData(blockElement, 'id'), function(schedule) {
  14493. /**
  14494. * @events TimeClick#clickSchedule
  14495. * @type {object}
  14496. * @property {Schedule} schedule - schedule instance
  14497. * @property {MouseEvent} event - MouseEvent object
  14498. */
  14499. self.fire('clickSchedule', {
  14500. schedule: schedule,
  14501. event: clickEvent.originEvent
  14502. });
  14503. });
  14504. };
  14505. util.CustomEvents.mixin(TimeClick);
  14506. module.exports = TimeClick;
  14507. /***/ }),
  14508. /***/ "./src/js/handler/time/clickDayname.js":
  14509. /*!*********************************************!*\
  14510. !*** ./src/js/handler/time/clickDayname.js ***!
  14511. \*********************************************/
  14512. /*! no static exports found */
  14513. /***/ (function(module, exports, __webpack_require__) {
  14514. "use strict";
  14515. /**
  14516. * @fileoverview Dayname click event hander module
  14517. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  14518. */
  14519. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  14520. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  14521. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  14522. /**
  14523. * @constructor
  14524. * @implements {Handler}
  14525. * @mixes util.CustomEvents
  14526. * @param {Drag} [dragHandler] - Drag handler instance.
  14527. * @param {DayName} [dayNameView] - DayName view instance.
  14528. * @param {Base} [baseController] - Base controller instance.
  14529. */
  14530. function DayNameClick(dragHandler, dayNameView, baseController) {
  14531. /**
  14532. * @type {Drag}
  14533. */
  14534. this.dragHandler = dragHandler;
  14535. /**
  14536. * @type {DayName}
  14537. */
  14538. this.dayNameView = dayNameView;
  14539. /**
  14540. * @type {Base}
  14541. */
  14542. this.baseController = baseController;
  14543. dragHandler.on({
  14544. 'click': this._onClick
  14545. }, this);
  14546. }
  14547. /**
  14548. * Destroy method
  14549. */
  14550. DayNameClick.prototype.destroy = function() {
  14551. this.dragHandler.off(this);
  14552. this.dayNameView = this.baseController = this.dragHandler = null;
  14553. };
  14554. /**
  14555. * Check target element is expected condition for activate this plugins.
  14556. * @param {HTMLElement} target - The element to check
  14557. * @returns {string} - model id
  14558. */
  14559. DayNameClick.prototype.checkExpectCondition = function(target) {
  14560. var container = domutil.closest(target, config.classname('.dayname-date-area'));
  14561. if (!container) {
  14562. return false;
  14563. }
  14564. return true;
  14565. };
  14566. /**
  14567. * Click event hander
  14568. * @param {object} clickEvent - click event from {@link Drag}
  14569. * @emits DayNameClick#clickDayname
  14570. */
  14571. DayNameClick.prototype._onClick = function(clickEvent) {
  14572. var self = this,
  14573. target = clickEvent.target,
  14574. daynameView = this.checkExpectCondition(target),
  14575. blockElement = domutil.closest(target, config.classname('.dayname'));
  14576. if (!daynameView || !blockElement) {
  14577. return;
  14578. }
  14579. /**
  14580. * @events DayNameClick#clickDayname
  14581. * @type {object}
  14582. * @property {string} date - click date
  14583. */
  14584. self.fire('clickDayname', {
  14585. date: domutil.getData(blockElement, 'date')
  14586. });
  14587. };
  14588. util.CustomEvents.mixin(DayNameClick);
  14589. module.exports = DayNameClick;
  14590. /***/ }),
  14591. /***/ "./src/js/handler/time/core.js":
  14592. /*!*************************************!*\
  14593. !*** ./src/js/handler/time/core.js ***!
  14594. \*************************************/
  14595. /*! no static exports found */
  14596. /***/ (function(module, exports, __webpack_require__) {
  14597. "use strict";
  14598. /**
  14599. * @fileoverview Core methods for dragging actions
  14600. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  14601. */
  14602. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  14603. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  14604. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  14605. var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
  14606. var Point = __webpack_require__(/*! ../../common/point */ "./src/js/common/point.js");
  14607. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  14608. /**
  14609. * @mixin Time.Core
  14610. */
  14611. var timeCore = {
  14612. /**
  14613. * Get Y index ratio(hour) in time grids by supplied parameters.
  14614. * @param {number} baseMil - base milliseconds number for supplied height.
  14615. * @param {number} height - container element height.
  14616. * @param {number} y - Y coordinate to calculate hour ratio.
  14617. * @returns {number} hour index ratio value.
  14618. */
  14619. _calcGridYIndex: function(baseMil, height, y) {
  14620. // get ratio from right expression > point.y : x = session.height : baseMil
  14621. // and convert milliseconds value to hours.
  14622. var result = datetime.millisecondsTo('hour', (y * baseMil) / height),
  14623. floored = result | 0,
  14624. nearest = common.nearest(result - floored, [0, 1]);
  14625. return floored + (nearest ? 0.5 : 0);
  14626. },
  14627. /**
  14628. * Get function to makes event data from Time and mouseEvent
  14629. * @param {Time} timeView - Instance of time view.
  14630. * @returns {function} - Function that return event data from mouse event.
  14631. */
  14632. _retriveScheduleData: function(timeView) {
  14633. var self = this,
  14634. container = timeView.container,
  14635. options = timeView.options,
  14636. viewHeight = timeView.getViewBound().height,
  14637. viewTime = timeView.getDate(),
  14638. hourLength = options.hourEnd - options.hourStart,
  14639. baseMil = datetime.millisecondsFrom('hour', hourLength);
  14640. /**
  14641. * @param {MouseEvent} mouseEvent - mouse event object to get common event data.
  14642. * @param {object} [extend] - object to extend event data before return.
  14643. * @returns {object} - common event data for time
  14644. */
  14645. return function(mouseEvent, extend) {
  14646. var mouseY = Point.n(domevent.getMousePosition(mouseEvent, container)).y,
  14647. gridY = common.ratio(viewHeight, hourLength, mouseY),
  14648. timeY = new TZDate(viewTime).addMinutes(datetime.minutesFromHours(gridY)),
  14649. nearestGridY = self._calcGridYIndex(baseMil, viewHeight, mouseY),
  14650. nearestGridTimeY = new TZDate(viewTime).addMinutes(
  14651. datetime.minutesFromHours(nearestGridY + options.hourStart)
  14652. );
  14653. return util.extend({
  14654. target: domevent.getEventTarget(mouseEvent),
  14655. relatedView: timeView,
  14656. originEvent: mouseEvent,
  14657. mouseY: mouseY,
  14658. gridY: gridY,
  14659. timeY: timeY,
  14660. nearestGridY: nearestGridY,
  14661. nearestGridTimeY: nearestGridTimeY,
  14662. triggerEvent: mouseEvent.type
  14663. }, extend);
  14664. };
  14665. },
  14666. /**
  14667. * Get function to makes event data from Time and mouseEvent
  14668. * @param {Time} timeView - Instance of time view.
  14669. * @param {TZDate} startDate - start date
  14670. * @param {TZDate} endDate - end date
  14671. * @param {number} hourStart Can limit of render hour start.
  14672. * @returns {object} - common event data for time from mouse event.
  14673. */
  14674. _retriveScheduleDataFromDate: function(timeView, startDate, endDate, hourStart) {
  14675. var viewTime = timeView.getDate();
  14676. var gridY, timeY, nearestGridY, nearestGridTimeY, nearestGridEndY, nearestGridEndTimeY;
  14677. gridY = startDate.getHours() - hourStart + getNearestHour(startDate.getMinutes());
  14678. timeY = new TZDate(viewTime).addMinutes(datetime.minutesFromHours(gridY));
  14679. nearestGridY = gridY;
  14680. nearestGridTimeY = new TZDate(viewTime).addMinutes(datetime.minutesFromHours(nearestGridY));
  14681. nearestGridEndY = endDate.getHours() - hourStart + getNearestHour(endDate.getMinutes());
  14682. nearestGridEndTimeY = new TZDate(viewTime).addMinutes(datetime.minutesFromHours(nearestGridEndY));
  14683. return {
  14684. target: timeView,
  14685. relatedView: timeView,
  14686. gridY: gridY,
  14687. timeY: timeY,
  14688. nearestGridY: nearestGridY,
  14689. nearestGridTimeY: nearestGridTimeY,
  14690. nearestGridEndY: nearestGridEndY,
  14691. nearestGridEndTimeY: nearestGridEndTimeY,
  14692. triggerEvent: 'manual',
  14693. hourStart: hourStart
  14694. };
  14695. },
  14696. /**
  14697. * Mixin method.
  14698. * @param {(TimeCreation|TimeMove)} obj - Constructor functions
  14699. */
  14700. mixin: function(obj) {
  14701. var proto = obj.prototype;
  14702. util.forEach(timeCore, function(method, methodName) {
  14703. if (methodName === 'mixin') {
  14704. return;
  14705. }
  14706. proto[methodName] = method;
  14707. });
  14708. }
  14709. };
  14710. /**
  14711. * Get the nearest hour
  14712. * @param {number} minutes - minutes
  14713. * @returns {number} hour
  14714. */
  14715. function getNearestHour(minutes) {
  14716. var nearestHour;
  14717. if (minutes === 0) {
  14718. nearestHour = 0;
  14719. } else if (minutes > 30) {
  14720. nearestHour = 1;
  14721. } else if (minutes <= 30) {
  14722. nearestHour = 0.5;
  14723. }
  14724. return nearestHour;
  14725. }
  14726. module.exports = timeCore;
  14727. /***/ }),
  14728. /***/ "./src/js/handler/time/creation.js":
  14729. /*!*****************************************!*\
  14730. !*** ./src/js/handler/time/creation.js ***!
  14731. \*****************************************/
  14732. /*! no static exports found */
  14733. /***/ (function(module, exports, __webpack_require__) {
  14734. "use strict";
  14735. /**
  14736. * @fileoverview Handling creation events from drag handler and time grid view
  14737. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  14738. */
  14739. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  14740. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  14741. var array = __webpack_require__(/*! ../../common/array */ "./src/js/common/array.js");
  14742. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  14743. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  14744. var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
  14745. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  14746. var TimeCreationGuide = __webpack_require__(/*! ./creationGuide */ "./src/js/handler/time/creationGuide.js");
  14747. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  14748. var timeCore = __webpack_require__(/*! ./core */ "./src/js/handler/time/core.js");
  14749. var CLICK_DELAY = 300;
  14750. /**
  14751. * @constructor
  14752. * @implements {Handler}
  14753. * @mixes timeCore
  14754. * @mixes CustomEvents
  14755. * @param {Drag} [dragHandler] - Drag handler instance.
  14756. * @param {TimeGrid} [timeGridView] - TimeGrid view instance.
  14757. * @param {Base} [baseController] - Base controller instance.
  14758. * @param {Options} [options] - calendar Options
  14759. */
  14760. function TimeCreation(dragHandler, timeGridView, baseController, options) {
  14761. /**
  14762. * Drag handler instance.
  14763. * @type {Drag}
  14764. */
  14765. this.dragHandler = dragHandler;
  14766. /**
  14767. * TimeGrid view instance.
  14768. * @type {TimeGrid}
  14769. */
  14770. this.timeGridView = timeGridView;
  14771. /**
  14772. * Base controller instance.
  14773. * @type {Base}
  14774. */
  14775. this.baseController = baseController;
  14776. /**
  14777. * @type {TimeCreationGuide}
  14778. */
  14779. this.guide = new TimeCreationGuide(this);
  14780. /**
  14781. * Temporary function for single drag session's calc.
  14782. * @type {function}
  14783. */
  14784. this._getScheduleDataFunc = null;
  14785. /**
  14786. * Temporary function for drag start data cache.
  14787. * @type {object}
  14788. */
  14789. this._dragStart = null;
  14790. /**
  14791. * @type {boolean}
  14792. */
  14793. this._requestOnClick = false;
  14794. /**
  14795. * @type {boolean}
  14796. */
  14797. this._disableDblClick = options.disableDblClick;
  14798. /**
  14799. * @type {boolean}
  14800. */
  14801. this._disableClick = options.disableClick;
  14802. dragHandler.on('dragStart', this._onDragStart, this);
  14803. dragHandler.on('click', this._onClick, this);
  14804. if (this._disableDblClick) {
  14805. CLICK_DELAY = 0;
  14806. } else {
  14807. domevent.on(timeGridView.container, 'dblclick', this._onDblClick, this);
  14808. }
  14809. }
  14810. /**
  14811. * Destroy method
  14812. */
  14813. TimeCreation.prototype.destroy = function() {
  14814. var timeGridView = this.timeGridView;
  14815. this.guide.destroy();
  14816. this.dragHandler.off(this);
  14817. if (timeGridView && timeGridView.container) {
  14818. domevent.off(timeGridView.container, 'dblclick', this._onDblClick, this);
  14819. }
  14820. this.dragHandler = this.timeGridView = this.baseController =
  14821. this._getScheduleDataFunc = this._dragStart = this.guide = null;
  14822. };
  14823. /**
  14824. * Check target element is expected condition for activate this plugins.
  14825. * @param {HTMLElement} target - The element to check
  14826. * @returns {(boolean|Time)} - return Time view instance when satiate condition.
  14827. */
  14828. TimeCreation.prototype.checkExpectedCondition = function(target) {
  14829. var cssClass = domutil.getClass(target),
  14830. matches;
  14831. if (cssClass === config.classname('time-date-schedule-block-wrap')) {
  14832. target = target.parentNode;
  14833. cssClass = domutil.getClass(target);
  14834. }
  14835. matches = cssClass.match(config.time.getViewIDRegExp);
  14836. if (!matches || matches.length < 2) {
  14837. return false;
  14838. }
  14839. return util.pick(this.timeGridView.children.items, matches[1]);
  14840. };
  14841. /**
  14842. * Drag#dragStart event handler.
  14843. * @emits TimeCreation#timeCreationDragstart
  14844. * @param {object} dragStartEventData - Drag#dragStart event data.
  14845. * @param {string} [overrideEventName] - override emitted event name when supplied.
  14846. * @param {function} [revise] - supply function for revise event data before emit.
  14847. */
  14848. TimeCreation.prototype._onDragStart = function(dragStartEventData, overrideEventName, revise) {
  14849. var target = dragStartEventData.target,
  14850. result = this.checkExpectedCondition(target),
  14851. getScheduleDataFunc,
  14852. eventData;
  14853. if (!result) {
  14854. return;
  14855. }
  14856. getScheduleDataFunc = this._getScheduleDataFunc = this._retriveScheduleData(result);
  14857. eventData = this._dragStart = getScheduleDataFunc(dragStartEventData.originEvent);
  14858. if (revise) {
  14859. revise(eventData);
  14860. }
  14861. this.dragHandler.on({
  14862. drag: this._onDrag,
  14863. dragEnd: this._onDragEnd
  14864. }, this);
  14865. /**
  14866. * @event TimeCreation#timeCreationDragstart
  14867. * @type {object}
  14868. * @property {Time} relatedView - time view instance related with mouse position.
  14869. * @property {MouseEvent} originEvent - mouse event object.
  14870. * @property {number} mouseY - mouse Y px mouse event.
  14871. * @property {number} gridY - grid Y index value related with mouseY value.
  14872. * @property {number} timeY - milliseconds value of mouseY points.
  14873. * @property {number} nearestGridY - nearest grid index related with mouseY value.
  14874. * @property {number} nearestGridTimeY - time value for nearestGridY.
  14875. */
  14876. this.fire(overrideEventName || 'timeCreationDragstart', eventData);
  14877. };
  14878. /**
  14879. * Drag#drag event handler
  14880. * @emits TimeCreation#timeCreationDrag
  14881. * @param {object} dragEventData - event data from Drag#drag.
  14882. * @param {string} [overrideEventName] - override emitted event name when supplied.
  14883. * @param {function} [revise] - supply function for revise event data before emit.
  14884. */
  14885. TimeCreation.prototype._onDrag = function(dragEventData, overrideEventName, revise) {
  14886. var getScheduleDataFunc = this._getScheduleDataFunc,
  14887. eventData;
  14888. if (!getScheduleDataFunc) {
  14889. return;
  14890. }
  14891. eventData = getScheduleDataFunc(dragEventData.originEvent);
  14892. if (revise) {
  14893. revise(eventData);
  14894. }
  14895. /**
  14896. * @event TimeCreation#timeCreationDrag
  14897. * @type {object}
  14898. * @property {Time} relatedView - time view instance related with mouse position.
  14899. * @property {MouseEvent} originEvent - mouse event object.
  14900. * @property {number} mouseY - mouse Y px mouse event.
  14901. * @property {number} gridY - grid Y index value related with mouseY value.
  14902. * @property {number} timeY - milliseconds value of mouseY points.
  14903. * @property {number} nearestGridY - nearest grid index related with mouseY value.
  14904. * @property {number} nearestGridTimeY - time value for nearestGridY.
  14905. */
  14906. this.fire(overrideEventName || 'timeCreationDrag', eventData);
  14907. };
  14908. /**
  14909. * @fires TimeCreation#beforeCreateSchedule
  14910. * @param {object} eventData - event data object from TimeCreation#timeCreationDragend
  14911. * or TimeCreation#timeCreationClick
  14912. */
  14913. TimeCreation.prototype._createSchedule = function(eventData) {
  14914. var relatedView = eventData.relatedView,
  14915. createRange = eventData.createRange,
  14916. nearestGridTimeY = eventData.nearestGridTimeY,
  14917. nearestGridEndTimeY = eventData.nearestGridEndTimeY
  14918. ? eventData.nearestGridEndTimeY
  14919. : new TZDate(nearestGridTimeY).addMinutes(30),
  14920. baseDate,
  14921. dateStart,
  14922. dateEnd,
  14923. start,
  14924. end;
  14925. if (!createRange) {
  14926. createRange = [
  14927. nearestGridTimeY,
  14928. nearestGridEndTimeY
  14929. ];
  14930. }
  14931. baseDate = new TZDate(relatedView.getDate());
  14932. dateStart = datetime.start(baseDate);
  14933. dateEnd = datetime.getStartOfNextDay(baseDate);
  14934. start = common.limitDate(createRange[0], dateStart, dateEnd);
  14935. end = common.limitDate(createRange[1], dateStart, dateEnd);
  14936. /**
  14937. * @event TimeCreation#beforeCreateSchedule
  14938. * @type {object}
  14939. * @property {boolean} isAllDay - whether schedule is fired in allday view area?
  14940. * @property {Date} start - select start time
  14941. * @property {Date} end - select end time
  14942. * @property {TimeCreationGuide} guide - TimeCreationGuide instance
  14943. * @property {string} triggerEventName - event name
  14944. */
  14945. this.fire('beforeCreateSchedule', {
  14946. isAllDay: false,
  14947. start: new TZDate(start),
  14948. end: new TZDate(end),
  14949. guide: this.guide,
  14950. triggerEventName: eventData.triggerEvent
  14951. });
  14952. };
  14953. /**
  14954. * Drag#dragEnd event handler
  14955. * @emits TimeCreation#timeCreationDragend
  14956. * @param {object} dragEndEventData - event data from Drag#dragend
  14957. */
  14958. TimeCreation.prototype._onDragEnd = function(dragEndEventData) {
  14959. var self = this,
  14960. dragStart = this._dragStart;
  14961. this.dragHandler.off({
  14962. drag: this._onDrag,
  14963. dragEnd: this._onDragEnd
  14964. }, this);
  14965. /**
  14966. * Function for manipulate event data before firing event
  14967. * @param {object} eventData - event data
  14968. */
  14969. function reviseFunc(eventData) {
  14970. var range = [
  14971. dragStart.nearestGridTimeY,
  14972. eventData.nearestGridTimeY
  14973. ].sort(array.compare.num.asc);
  14974. range[1].addMinutes(30);
  14975. eventData.createRange = range;
  14976. self._createSchedule(eventData);
  14977. }
  14978. /**
  14979. * @event TimeCreation#timeCreationDragend
  14980. * @type {object}
  14981. * @property {Time} relatedView - time view instance related with mouse position.
  14982. * @property {MouseEvent} originEvent - mouse event object.
  14983. * @property {number} mouseY - mouse Y px mouse event.
  14984. * @property {number} gridY - grid Y index value related with mouseY value.
  14985. * @property {number} timeY - milliseconds value of mouseY points.
  14986. * @property {number} nearestGridY - nearest grid index related with mouseY value.
  14987. * @property {number} nearestGridTimeY - time value for nearestGridY.
  14988. * @property {number[]} createRange - milliseconds range between drag start and end to create.
  14989. */
  14990. this._onDrag(dragEndEventData, 'timeCreationDragend', reviseFunc);
  14991. this._dragStart = this._getScheduleDataFunc = null;
  14992. };
  14993. /**
  14994. * Drag#click event handler
  14995. * @emits TimeCreation#timeCreationClick
  14996. * @param {object} clickEventData - event data from Drag#click.
  14997. */
  14998. TimeCreation.prototype._onClick = function(clickEventData) {
  14999. var self = this;
  15000. var condResult, getScheduleDataFunc, eventData;
  15001. this.dragHandler.off({
  15002. drag: this._onDrag,
  15003. dragEnd: this._onDragEnd
  15004. }, this);
  15005. condResult = this.checkExpectedCondition(clickEventData.target);
  15006. if (!condResult || this._disableClick) {
  15007. return;
  15008. }
  15009. getScheduleDataFunc = this._retriveScheduleData(condResult);
  15010. eventData = getScheduleDataFunc(clickEventData.originEvent);
  15011. this._requestOnClick = true;
  15012. setTimeout(function() {
  15013. if (self._requestOnClick) {
  15014. self.fire('timeCreationClick', eventData);
  15015. self._createSchedule(eventData);
  15016. }
  15017. self._requestOnClick = false;
  15018. }, CLICK_DELAY);
  15019. this._dragStart = this._getScheduleDataFunc = null;
  15020. };
  15021. /**
  15022. * Dblclick event handler
  15023. * @param {MouseEvent} e - Native MouseEvent
  15024. */
  15025. TimeCreation.prototype._onDblClick = function(e) {
  15026. var condResult, getScheduleDataFunc, eventData;
  15027. condResult = this.checkExpectedCondition(e.target);
  15028. if (!condResult) {
  15029. return;
  15030. }
  15031. getScheduleDataFunc = this._retriveScheduleData(condResult);
  15032. eventData = getScheduleDataFunc(e);
  15033. this.fire('timeCreationClick', eventData);
  15034. this._createSchedule(eventData);
  15035. this._requestOnClick = false;
  15036. };
  15037. /**
  15038. * Invoke creation click
  15039. * @param {Schedule} schedule - schedule instance
  15040. */
  15041. TimeCreation.prototype.invokeCreationClick = function(schedule) {
  15042. var opt = this.timeGridView.options,
  15043. range = datetime.range(
  15044. opt.renderStartDate,
  15045. opt.renderEndDate,
  15046. datetime.MILLISECONDS_PER_DAY),
  15047. hourStart = opt.hourStart,
  15048. targetDate = schedule.start;
  15049. var eventData, timeView;
  15050. util.forEach(range, function(date, index) {
  15051. if (datetime.isSameDate(date, targetDate)) {
  15052. timeView = this.timeGridView.children.toArray()[index];
  15053. }
  15054. }, this);
  15055. // If start date is not in current date, set start date as first date.
  15056. if (!timeView) {
  15057. timeView = this.timeGridView.children.toArray()[0];
  15058. }
  15059. eventData = this._retriveScheduleDataFromDate(timeView, schedule.start, schedule.end, hourStart);
  15060. this.fire('timeCreationClick', eventData);
  15061. this._createSchedule(eventData);
  15062. };
  15063. timeCore.mixin(TimeCreation);
  15064. util.CustomEvents.mixin(TimeCreation);
  15065. module.exports = TimeCreation;
  15066. /***/ }),
  15067. /***/ "./src/js/handler/time/creationGuide.js":
  15068. /*!**********************************************!*\
  15069. !*** ./src/js/handler/time/creationGuide.js ***!
  15070. \**********************************************/
  15071. /*! no static exports found */
  15072. /***/ (function(module, exports, __webpack_require__) {
  15073. "use strict";
  15074. /* WEBPACK VAR INJECTION */(function(global) {/**
  15075. * @fileoverview Module for Time.Creation effect while dragging.
  15076. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  15077. */
  15078. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  15079. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  15080. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  15081. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  15082. var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
  15083. var ratio = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js").ratio;
  15084. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  15085. var MIN60 = (datetime.MILLISECONDS_PER_MINUTES * 60);
  15086. /**
  15087. * Class for Time.Creation dragging effect.
  15088. * @constructor
  15089. * @param {TimeCreation} timeCreation - instance of TimeCreation.
  15090. */
  15091. function TimeCreationGuide(timeCreation) {
  15092. /**
  15093. * Guide element for creation effect.
  15094. * @type {HTMLElement}
  15095. */
  15096. this.guideElement = global.document.createElement('div');
  15097. /**
  15098. * @type {HTMLDivElement}
  15099. */
  15100. this.guideTimeElement = domutil.appendHTMLElement(
  15101. 'span',
  15102. this.guideElement,
  15103. config.classname('time-guide-creation-label')
  15104. );
  15105. domutil.addClass(this.guideElement, config.classname('time-guide-creation'));
  15106. /**
  15107. * @type {TimeCreation}
  15108. */
  15109. this.timeCreation = timeCreation;
  15110. /**
  15111. * @type {array}
  15112. */
  15113. this._styleUnit = null;
  15114. /**
  15115. * @type {array}
  15116. */
  15117. this._styleStart = null;
  15118. /**
  15119. * @type {function}
  15120. */
  15121. this._styleFunc = null;
  15122. timeCreation.on({
  15123. timeCreationDragstart: this._createGuideElement,
  15124. timeCreationDrag: this._onDrag,
  15125. timeCreationClick: this._createGuideElement
  15126. }, this);
  15127. this.applyTheme(timeCreation.baseController.theme);
  15128. }
  15129. /**
  15130. * Destroy method.
  15131. */
  15132. TimeCreationGuide.prototype.destroy = function() {
  15133. this.clearGuideElement();
  15134. this.timeCreation.off(this);
  15135. this.timeCreation = this._styleUnit = this._styleStart =
  15136. this._styleFunc = this.guideElement = this.guideTimeElement = null;
  15137. };
  15138. /**
  15139. * Clear guide element.
  15140. */
  15141. TimeCreationGuide.prototype.clearGuideElement = function() {
  15142. var guideElement = this.guideElement,
  15143. timeElement = this.guideTimeElement;
  15144. domutil.remove(guideElement);
  15145. reqAnimFrame.requestAnimFrame(function() {
  15146. guideElement.style.display = 'none';
  15147. guideElement.style.top = '';
  15148. guideElement.style.height = '';
  15149. timeElement.innerHTML = '';
  15150. });
  15151. };
  15152. /**
  15153. * Refresh guide element
  15154. * @param {number} top - The number of guide element's style top
  15155. * @param {number} height - The number of guide element's style height
  15156. * @param {TZDate} start - start time of schedule to create
  15157. * @param {TZDate} end - end time of schedule to create
  15158. * @param {boolean} bottomLabel - is label need to render bottom of guide element?
  15159. */
  15160. TimeCreationGuide.prototype._refreshGuideElement = function(top, height, start, end, bottomLabel) {
  15161. var guideElement = this.guideElement;
  15162. var timeElement = this.guideTimeElement;
  15163. guideElement.style.top = top + 'px';
  15164. guideElement.style.height = height + 'px';
  15165. guideElement.style.display = 'block';
  15166. timeElement.innerHTML = datetime.format(start, 'HH:mm') +
  15167. ' - ' + datetime.format(end, 'HH:mm');
  15168. if (bottomLabel) {
  15169. domutil.removeClass(timeElement, config.classname('time-guide-bottom'));
  15170. } else {
  15171. domutil.addClass(timeElement, config.classname('time-guide-bottom'));
  15172. }
  15173. };
  15174. /**
  15175. * Get unit data of calculating new style of guide element by user interaction
  15176. * @param {Time} relatedView - time view instance related with schedule
  15177. * @returns {array} unit data.
  15178. */
  15179. TimeCreationGuide.prototype._getUnitData = function(relatedView) {
  15180. var viewOpt = relatedView.options,
  15181. viewHeight = relatedView.getViewBound().height,
  15182. hourLength = viewOpt.hourEnd - viewOpt.hourStart,
  15183. todayStart = datetime.parse(viewOpt.ymd),
  15184. todayEnd = datetime.getStartOfNextDay(todayStart);
  15185. todayStart.setHours(0, 0, 0, 0);
  15186. todayStart.setHours(viewOpt.hourStart);
  15187. // [0] height of view
  15188. // [1] hour length of view
  15189. // [2] start time of view
  15190. // [3] end time of view
  15191. // [4] height of view for one hour
  15192. return [
  15193. viewHeight,
  15194. hourLength,
  15195. todayStart,
  15196. todayEnd,
  15197. viewHeight / hourLength
  15198. ];
  15199. };
  15200. /**
  15201. * Applying limitation to supplied data and return it.
  15202. * @param {number} top - top pixel of guide element
  15203. * @param {number} height - height pixel of guide element
  15204. * @param {TZDate} start - relative time value of dragstart point
  15205. * @param {TZDate} end - relative time value of dragend point
  15206. * @returns {array} limited style data
  15207. */
  15208. TimeCreationGuide.prototype._limitStyleData = function(top, height, start, end) {
  15209. var unitData = this._styleUnit;
  15210. top = common.limit(top, [0], [unitData[0]]);
  15211. height = common.limit(top + height, [0], [unitData[0]]) - top;
  15212. start = common.limitDate(start, unitData[2], unitData[3]);
  15213. end = common.limitDate(end, unitData[2], unitData[3]);
  15214. return [top, height, start, end];
  15215. };
  15216. /**
  15217. * Get function to calculate guide element UI data from supplied units
  15218. * @param {number} viewHeight - total height of view's container element
  15219. * @param {number} hourLength - hour length that rendered in time view
  15220. * @param {TZDate} todayStart - time for view's start date
  15221. * @returns {function} UI data calculator function
  15222. */
  15223. TimeCreationGuide.prototype._getStyleDataFunc = function(viewHeight, hourLength, todayStart) {
  15224. var todayStartTime = todayStart;
  15225. var todayEndTime = datetime.end(todayStart);
  15226. /**
  15227. * Get top, time value from schedule data
  15228. * @param {object} scheduleData - schedule data object
  15229. * @returns {number[]} top, time
  15230. */
  15231. function getStyleData(scheduleData) {
  15232. var minMinutes = 30;
  15233. var gridY = scheduleData.nearestGridY,
  15234. gridTimeY = scheduleData.nearestGridTimeY,
  15235. gridEndTimeY = scheduleData.nearestGridEndTimeY || new TZDate(gridTimeY).addMinutes(minMinutes),
  15236. top, startTime, endTime;
  15237. top = common.limit(ratio(hourLength, viewHeight, gridY), [0], [viewHeight]);
  15238. startTime = common.limitDate(gridTimeY, todayStartTime, todayEndTime);
  15239. endTime = common.limitDate(gridEndTimeY, todayStartTime, todayEndTime);
  15240. return [top, startTime, endTime];
  15241. }
  15242. return getStyleData;
  15243. };
  15244. /**
  15245. * DragStart event handler
  15246. * @param {object} dragStartEventData - dragStart schedule data.
  15247. */
  15248. TimeCreationGuide.prototype._createGuideElement = function(dragStartEventData) {
  15249. var relatedView = dragStartEventData.relatedView,
  15250. hourStart = datetime.millisecondsFrom('hour', dragStartEventData.hourStart) || 0,
  15251. unitData, styleFunc, styleData, result, top, height, start, end;
  15252. unitData = this._styleUnit = this._getUnitData(relatedView);
  15253. styleFunc = this._styleFunc = this._getStyleDataFunc.apply(this, unitData);
  15254. styleData = this._styleStart = styleFunc(dragStartEventData);
  15255. start = new TZDate(styleData[1]).addMinutes(datetime.minutesFromHours(hourStart));
  15256. end = new TZDate(styleData[2]).addMinutes(datetime.minutesFromHours(hourStart));
  15257. top = styleData[0];
  15258. height = (unitData[4] * (end - start) / MIN60);
  15259. result = this._limitStyleData(
  15260. top,
  15261. height,
  15262. start,
  15263. end
  15264. );
  15265. this._refreshGuideElement.apply(this, result);
  15266. relatedView.container.appendChild(this.guideElement);
  15267. };
  15268. /**
  15269. * Drag event handler
  15270. * @param {object} dragEventData - drag schedule data.
  15271. */
  15272. TimeCreationGuide.prototype._onDrag = function(dragEventData) {
  15273. var minutes30 = 30;
  15274. var styleFunc = this._styleFunc,
  15275. unitData = this._styleUnit,
  15276. startStyle = this._styleStart,
  15277. refreshGuideElement = this._refreshGuideElement.bind(this),
  15278. heightOfHalfHour,
  15279. endStyle,
  15280. result;
  15281. if (!styleFunc || !unitData || !startStyle) {
  15282. return;
  15283. }
  15284. heightOfHalfHour = (unitData[4] / 2);
  15285. endStyle = styleFunc(dragEventData);
  15286. if (endStyle[0] > startStyle[0]) {
  15287. result = this._limitStyleData(
  15288. startStyle[0],
  15289. (endStyle[0] - startStyle[0]) + heightOfHalfHour,
  15290. startStyle[1],
  15291. new TZDate(endStyle[1]).addMinutes(minutes30)
  15292. );
  15293. } else {
  15294. result = this._limitStyleData(
  15295. endStyle[0],
  15296. (startStyle[0] - endStyle[0]) + heightOfHalfHour,
  15297. endStyle[1],
  15298. new TZDate(startStyle[1]).addMinutes(minutes30)
  15299. );
  15300. result.push(true);
  15301. }
  15302. reqAnimFrame.requestAnimFrame(function() {
  15303. refreshGuideElement.apply(null, result);
  15304. });
  15305. };
  15306. TimeCreationGuide.prototype.applyTheme = function(theme) {
  15307. var style = this.guideElement.style;
  15308. var timeStyle = this.guideTimeElement.style;
  15309. // block
  15310. style.backgroundColor = theme.common.creationGuide.backgroundColor;
  15311. style.border = theme.common.creationGuide.border;
  15312. // label
  15313. timeStyle.color = theme.week.creationGuide.color;
  15314. timeStyle.fontSize = theme.week.creationGuide.fontSize;
  15315. timeStyle.fontWeight = theme.week.creationGuide.fontWeight;
  15316. };
  15317. module.exports = TimeCreationGuide;
  15318. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  15319. /***/ }),
  15320. /***/ "./src/js/handler/time/move.js":
  15321. /*!*************************************!*\
  15322. !*** ./src/js/handler/time/move.js ***!
  15323. \*************************************/
  15324. /*! no static exports found */
  15325. /***/ (function(module, exports, __webpack_require__) {
  15326. "use strict";
  15327. /**
  15328. * @fileoverview Handling move schedules from drag handler and time grid view
  15329. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  15330. */
  15331. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  15332. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  15333. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  15334. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  15335. var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
  15336. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  15337. var timeCore = __webpack_require__(/*! ./core */ "./src/js/handler/time/core.js");
  15338. var TimeMoveGuide = __webpack_require__(/*! ./moveGuide */ "./src/js/handler/time/moveGuide.js");
  15339. /**
  15340. * @constructor
  15341. * @implements {Handler}
  15342. * @mixes timeCore
  15343. * @mixes util.CustomEvents
  15344. * @param {Drag} [dragHandler] - Drag handler instance.
  15345. * @param {TimeGrid} [timeGridView] - TimeGrid view instance.
  15346. * @param {Base} [baseController] - Base controller instance.
  15347. */
  15348. function TimeMove(dragHandler, timeGridView, baseController) {
  15349. /**
  15350. * @type {Drag}
  15351. */
  15352. this.dragHandler = dragHandler;
  15353. /**
  15354. * @type {TimeGrid}
  15355. */
  15356. this.timeGridView = timeGridView;
  15357. /**
  15358. * @type {Base}
  15359. */
  15360. this.baseController = baseController;
  15361. /**
  15362. * @type {function}
  15363. */
  15364. this._getScheduleDataFunc = null;
  15365. /**
  15366. * @type {object}
  15367. */
  15368. this._dragStart = null;
  15369. /**
  15370. * @type {TimeMoveGuide}
  15371. */
  15372. this._guide = new TimeMoveGuide(this);
  15373. dragHandler.on('dragStart', this._onDragStart, this);
  15374. dragHandler.on('mousedown', this._onMouseDown, this);
  15375. }
  15376. /**
  15377. * Destroy method.
  15378. */
  15379. TimeMove.prototype.destroy = function() {
  15380. this._guide.destroy();
  15381. this.dragHandler.off(this);
  15382. this.dragHandler = this.timeGridView = this.baseController =
  15383. this._getScheduleDataFunc = this._dragStart = this._guide = null;
  15384. };
  15385. /**
  15386. * Check target element is expected condition for activate this plugins.
  15387. * @param {HTMLElement} target - The element to check
  15388. * @returns {boolean|object} - return object when satiate condition.
  15389. */
  15390. TimeMove.prototype.checkExpectCondition = function(target) {
  15391. if (!domutil.closest(target, config.classname('.time-schedule'))) {
  15392. return false;
  15393. }
  15394. return this._getTimeView(target);
  15395. };
  15396. /**
  15397. * Get Time view container from supplied element.
  15398. * @param {HTMLElement} target - element to find time view container.
  15399. * @returns {object|boolean} - return time view instance when finded.
  15400. */
  15401. TimeMove.prototype._getTimeView = function(target) {
  15402. var container = domutil.closest(target, config.classname('.time-date')),
  15403. matches;
  15404. if (!container) {
  15405. return false;
  15406. }
  15407. matches = domutil.getClass(container).match(config.time.getViewIDRegExp);
  15408. if (!matches || matches.length < 2) {
  15409. return false;
  15410. }
  15411. return util.pick(this.timeGridView.children.items, Number(matches[1]));
  15412. };
  15413. /**
  15414. * @emits TimeMove#mousedown
  15415. * @param {object} mouseDownEventData - Drag#mousedown schedule data.
  15416. */
  15417. TimeMove.prototype._onMouseDown = function(mouseDownEventData) {
  15418. var target = mouseDownEventData.target,
  15419. timeView = this.checkExpectCondition(target),
  15420. blockElement = domutil.closest(target, config.classname('.time-date-schedule-block'));
  15421. if (!timeView || !blockElement) {
  15422. return;
  15423. }
  15424. // EventTarget.target is not changed in mousemove event even if mouse is over the other element.
  15425. // It's different with other browsers(IE, Chrome, Safari)
  15426. if (util.browser.firefox) {
  15427. domevent.preventDefault(mouseDownEventData.originEvent);
  15428. }
  15429. };
  15430. /**
  15431. * @emits TimeMove#timeMoveDragstart
  15432. * @param {object} dragStartEventData - Drag#dragStart schedule data.
  15433. */
  15434. TimeMove.prototype._onDragStart = function(dragStartEventData) {
  15435. var target = dragStartEventData.target,
  15436. timeView = this.checkExpectCondition(target),
  15437. blockElement = domutil.closest(target, config.classname('.time-date-schedule-block')),
  15438. getScheduleDataFunc,
  15439. scheduleData,
  15440. ctrl = this.baseController,
  15441. targetModelID,
  15442. targetModel;
  15443. if (!timeView || !blockElement) {
  15444. return;
  15445. }
  15446. targetModelID = domutil.getData(blockElement, 'id');
  15447. targetModel = ctrl.schedules.items[targetModelID];
  15448. if (targetModel.isReadOnly) {
  15449. return;
  15450. }
  15451. getScheduleDataFunc = this._getScheduleDataFunc = this._retriveScheduleData(timeView);
  15452. scheduleData = this._dragStart = getScheduleDataFunc(
  15453. dragStartEventData.originEvent, {
  15454. targetModelID: targetModelID,
  15455. model: targetModel
  15456. }
  15457. );
  15458. this.dragHandler.on({
  15459. drag: this._onDrag,
  15460. dragEnd: this._onDragEnd,
  15461. click: this._onClick
  15462. }, this);
  15463. /**
  15464. * @event TimeMove#timeMoveDragstart
  15465. * @type {object}
  15466. * @property {HTMLElement} target - current target in mouse event object.
  15467. * @property {Time} relatedView - time view instance related with mouse position.
  15468. * @property {MouseEvent} originEvent - mouse event object.
  15469. * @property {number} mouseY - mouse Y px mouse event.
  15470. * @property {number} gridY - grid Y index value related with mouseY value.
  15471. * @property {number} timeY - milliseconds value of mouseY points.
  15472. * @property {number} nearestGridY - nearest grid index related with mouseY value.
  15473. * @property {number} nearestGridTimeY - time value for nearestGridY.
  15474. * @property {string} targetModelID - The model unique id emitted move schedule.
  15475. * @property {Schedule} model - model instance
  15476. */
  15477. this.fire('timeMoveDragstart', scheduleData);
  15478. };
  15479. /**
  15480. * @emits TimeMove#timeMoveDrag
  15481. * @param {MouseEvent} dragEventData - mousemove event object
  15482. * @param {string} [overrideEventName] - name of emitting event to override.
  15483. * @param {function} [revise] - supply function for revise schedule data before emit.
  15484. */
  15485. TimeMove.prototype._onDrag = function(dragEventData, overrideEventName, revise) {
  15486. var getScheduleDataFunc = this._getScheduleDataFunc,
  15487. timeView = this._getTimeView(dragEventData.target),
  15488. dragStart = this._dragStart,
  15489. scheduleData;
  15490. if (!timeView || !getScheduleDataFunc || !dragStart) {
  15491. return;
  15492. }
  15493. scheduleData = getScheduleDataFunc(dragEventData.originEvent, {
  15494. currentView: timeView,
  15495. targetModelID: dragStart.targetModelID
  15496. });
  15497. if (revise) {
  15498. revise(scheduleData);
  15499. }
  15500. /**
  15501. * @event TimeMove#timeMoveDrag
  15502. * @type {object}
  15503. * @property {HTMLElement} target - current target in mouse event object.
  15504. * @property {Time} relatedView - time view instance related with drag start position.
  15505. * @property {MouseEvent} originEvent - mouse event object.
  15506. * @property {number} mouseY - mouse Y px mouse event.
  15507. * @property {number} gridY - grid Y index value related with mouseY value.
  15508. * @property {number} timeY - milliseconds value of mouseY points.
  15509. * @property {number} nearestGridY - nearest grid index related with mouseY value.
  15510. * @property {number} nearestGridTimeY - time value for nearestGridY.
  15511. * @property {Time} currentView - time view instance related with current mouse position.
  15512. * @property {string} targetModelID - The model unique id emitted move schedule.
  15513. */
  15514. this.fire(overrideEventName || 'timeMoveDrag', scheduleData);
  15515. };
  15516. /**
  15517. * Update model instance by dragend event results.
  15518. * @fires TimeMove#beforeUpdateSchedule
  15519. * @param {object} scheduleData - schedule data from TimeMove#timeMoveDragend
  15520. */
  15521. TimeMove.prototype._updateSchedule = function(scheduleData) {
  15522. var ctrl = this.baseController,
  15523. modelID = scheduleData.targetModelID,
  15524. range = scheduleData.nearestRange,
  15525. timeDiff = range[1] - range[0],
  15526. dateDiff = 0,
  15527. schedule = ctrl.schedules.items[modelID],
  15528. relatedView = scheduleData.relatedView,
  15529. currentView = scheduleData.currentView,
  15530. newStarts,
  15531. newEnds;
  15532. if (!schedule || !currentView) {
  15533. return;
  15534. }
  15535. timeDiff -= datetime.millisecondsFrom('minutes', 30);
  15536. newStarts = new TZDate(schedule.getStarts()).addMilliseconds(timeDiff);
  15537. newEnds = new TZDate(schedule.getEnds()).addMilliseconds(timeDiff);
  15538. if (currentView) {
  15539. dateDiff = currentView.getDate() - relatedView.getDate();
  15540. }
  15541. newStarts.addMilliseconds(dateDiff);
  15542. newEnds.addMilliseconds(dateDiff);
  15543. /**
  15544. * @event TimeMove#beforeUpdateSchedule
  15545. * @type {object}
  15546. * @property {Schedule} schedule - The original schedule instance
  15547. * @property {Date} start - Deprecated: start time to update
  15548. * @property {Date} end - Deprecated: end time to update
  15549. * @property {object} changes - start and end time to update
  15550. * @property {Date} start - start time to update
  15551. * @property {Date} end - end time to update
  15552. */
  15553. this.fire('beforeUpdateSchedule', {
  15554. schedule: schedule,
  15555. changes: {
  15556. start: newStarts,
  15557. end: newEnds
  15558. },
  15559. start: newStarts,
  15560. end: newEnds
  15561. });
  15562. };
  15563. /**
  15564. * @emits TimeMove#timeMoveDragend
  15565. * @param {MouseEvent} dragEndEventData - mouseup mouse event object.
  15566. */
  15567. TimeMove.prototype._onDragEnd = function(dragEndEventData) {
  15568. var getScheduleDataFunc = this._getScheduleDataFunc,
  15569. currentView = this._getTimeView(dragEndEventData.target),
  15570. dragStart = this._dragStart,
  15571. scheduleData;
  15572. this.dragHandler.off({
  15573. drag: this._onDrag,
  15574. dragEnd: this._onDragEnd,
  15575. click: this._onClick
  15576. }, this);
  15577. if (!getScheduleDataFunc || !dragStart) {
  15578. return;
  15579. }
  15580. scheduleData = getScheduleDataFunc(dragEndEventData.originEvent, {
  15581. currentView: currentView,
  15582. targetModelID: dragStart.targetModelID
  15583. });
  15584. scheduleData.range = [
  15585. dragStart.timeY,
  15586. new TZDate(scheduleData.timeY).addMinutes(30)
  15587. ];
  15588. scheduleData.nearestRange = [
  15589. dragStart.nearestGridTimeY,
  15590. new TZDate(scheduleData.nearestGridTimeY).addMinutes(30)
  15591. ];
  15592. this._updateSchedule(scheduleData);
  15593. /**
  15594. * @event TimeMove#timeMoveDragend
  15595. * @type {object}
  15596. * @property {HTMLElement} target - current target in mouse event object.
  15597. * @property {Time} relatedView - time view instance related with drag start position.
  15598. * @property {Time} currentView - time view instance related with current mouse position.
  15599. * @property {MouseEvent} originEvent - mouse event object.
  15600. * @property {number} mouseY - mouse Y px mouse event.
  15601. * @property {number} gridY - grid Y index value related with mouseY value.
  15602. * @property {number} timeY - milliseconds value of mouseY points.
  15603. * @property {number} nearestGridY - nearest grid index related with mouseY value.
  15604. * @property {number} nearestGridTimeY - time value for nearestGridY.
  15605. * @property {string} targetModelID - The model unique id emitted move schedule.
  15606. * @property {number[]} range - milliseconds range between drag start and end.
  15607. * @property {number[]} nearestRange - milliseconds range related with nearestGridY between start and end.
  15608. */
  15609. this.fire('timeMoveDragend', scheduleData);
  15610. };
  15611. /**
  15612. * @emits TimeMove#timeMoveClick
  15613. * @param {MouseEvent} clickEventData - click mouse event object.
  15614. */
  15615. TimeMove.prototype._onClick = function(clickEventData) {
  15616. var getScheduleDataFunc = this._getScheduleDataFunc,
  15617. dragStart = this._dragStart,
  15618. scheduleData;
  15619. this.dragHandler.off({
  15620. drag: this._onDrag,
  15621. dragEnd: this._onDragEnd,
  15622. click: this._onClick
  15623. }, this);
  15624. if (!getScheduleDataFunc || !dragStart) {
  15625. return;
  15626. }
  15627. scheduleData = getScheduleDataFunc(clickEventData.originEvent, {
  15628. targetModelID: dragStart.targetModelID
  15629. });
  15630. /**
  15631. * @event TimeMove#timeMoveClick
  15632. * @type {object}
  15633. * @property {HTMLElement} target - current target in mouse event object.
  15634. * @property {Time} relatedView - time view instance related with drag start position.
  15635. * @property {MouseEvent} originEvent - mouse event object.
  15636. * @property {number} mouseY - mouse Y px mouse event.
  15637. * @property {number} gridY - grid Y index value related with mouseY value.
  15638. * @property {number} timeY - milliseconds value of mouseY points.
  15639. * @property {number} nearestGridY - nearest grid index related with mouseY value.
  15640. * @property {number} nearestGridTimeY - time value for nearestGridY.
  15641. * @property {string} targetModelID - The model unique id emitted move schedule.
  15642. */
  15643. this.fire('timeMoveClick', scheduleData);
  15644. };
  15645. timeCore.mixin(TimeMove);
  15646. util.CustomEvents.mixin(TimeMove);
  15647. module.exports = TimeMove;
  15648. /***/ }),
  15649. /***/ "./src/js/handler/time/moveGuide.js":
  15650. /*!******************************************!*\
  15651. !*** ./src/js/handler/time/moveGuide.js ***!
  15652. \******************************************/
  15653. /*! no static exports found */
  15654. /***/ (function(module, exports, __webpack_require__) {
  15655. "use strict";
  15656. /* WEBPACK VAR INJECTION */(function(global) {/**
  15657. * @fileoverview Module for Time.Move effect while dragging.
  15658. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  15659. */
  15660. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  15661. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  15662. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  15663. var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
  15664. var ratio = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js").ratio;
  15665. var FloatingLayer = __webpack_require__(/*! ../../common/floatingLayer */ "./src/js/common/floatingLayer.js");
  15666. var tmpl = __webpack_require__(/*! ../../view/template/week/timeMoveGuide.hbs */ "./src/js/view/template/week/timeMoveGuide.hbs");
  15667. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  15668. var Schedule = __webpack_require__(/*! ../../model/schedule */ "./src/js/model/schedule.js");
  15669. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  15670. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  15671. var SCHEDULE_MIN_DURATION = datetime.MILLISECONDS_SCHEDULE_MIN_DURATION;
  15672. /**
  15673. * Class for Time.Move effect.
  15674. * @constructor
  15675. * @param {TimeMove} timeMove - The instance of TimeMove.
  15676. */
  15677. function TimeMoveGuide(timeMove) {
  15678. /**
  15679. * @type {FloatingLayer}
  15680. */
  15681. this._guideLayer = null;
  15682. /**
  15683. * @Type {Schedule}
  15684. */
  15685. this._model = null;
  15686. /**
  15687. * @type {object}
  15688. */
  15689. this._viewModel = null;
  15690. /**
  15691. * @type {object}
  15692. */
  15693. this._lastDrag = null;
  15694. /**
  15695. * @type {HTMLElement}
  15696. */
  15697. this.guideElement = null;
  15698. /**
  15699. * @type {TimeMove}
  15700. */
  15701. this.timeMove = timeMove;
  15702. /**
  15703. * @type {HTMLElement}
  15704. */
  15705. this._container = null;
  15706. /**
  15707. * @type {function}
  15708. */
  15709. this._getTopFunc = null;
  15710. /**
  15711. * @type {number}
  15712. */
  15713. this._startGridY = 0;
  15714. /**
  15715. * @type {number}
  15716. */
  15717. this._startTopPixel = 0;
  15718. timeMove.on({
  15719. 'timeMoveDragstart': this._onDragStart,
  15720. 'timeMoveDrag': this._onDrag,
  15721. 'timeMoveDragend': this._clearGuideElement,
  15722. 'timeMoveClick': this._clearGuideElement
  15723. }, this);
  15724. }
  15725. /**
  15726. * Destroy method
  15727. */
  15728. TimeMoveGuide.prototype.destroy = function() {
  15729. this._clearGuideElement();
  15730. this.timeMove.off(this);
  15731. if (this._guideLayer) {
  15732. this._guideLayer.destroy();
  15733. }
  15734. this.guideElement = this.timeMove = this._container = this._guideLayer = this._lastDrag =
  15735. this._getTopFunc = this._startGridY = this._startTopPixel = this._viewModel = null;
  15736. };
  15737. /**
  15738. * Clear guide element.
  15739. */
  15740. TimeMoveGuide.prototype._clearGuideElement = function() {
  15741. if (!util.browser.msie) {
  15742. domutil.removeClass(global.document.body, config.classname('dragging'));
  15743. }
  15744. if (this._guideLayer) {
  15745. this._guideLayer.destroy();
  15746. }
  15747. this._showOriginScheduleBlocks();
  15748. this.guideElement = this._getTopFunc = this._guideLayer = this._model = this._lastDrag =
  15749. this._startGridY = this._startTopPixel = this._viewModel = null;
  15750. };
  15751. /**
  15752. * Dim element blocks
  15753. * @param {number} modelID - Schedule model instance ID
  15754. */
  15755. TimeMoveGuide.prototype._hideOriginScheduleBlocks = function() {
  15756. var className = config.classname('time-date-schedule-block-dragging-dim');
  15757. if (this.guideElement) {
  15758. domutil.addClass(this.guideElement, className);
  15759. }
  15760. };
  15761. /**
  15762. * Show element blocks
  15763. */
  15764. TimeMoveGuide.prototype._showOriginScheduleBlocks = function() {
  15765. var className = config.classname('time-date-schedule-block-dragging-dim');
  15766. if (this.guideElement) {
  15767. domutil.removeClass(this.guideElement, className);
  15768. }
  15769. };
  15770. /**
  15771. * Refresh guide element
  15772. * @param {string} top - guide element's style top.
  15773. * @param {Schedule} model - updated model
  15774. * @param {object} viewModel - view model
  15775. */
  15776. TimeMoveGuide.prototype._refreshGuideElement = function(top, model, viewModel) {
  15777. var self = this;
  15778. reqAnimFrame.requestAnimFrame(function() {
  15779. if (!self._guideLayer) {
  15780. return;
  15781. }
  15782. self._guideLayer.setPosition(0, top);
  15783. self._guideLayer.setContent(tmpl(util.extend({model: model}, viewModel)));
  15784. });
  15785. };
  15786. /**
  15787. * TimeMove#timeMoveDragstart event handler
  15788. * @param {object} dragStartEventData - dragstart event data
  15789. */
  15790. TimeMoveGuide.prototype._onDragStart = function(dragStartEventData) {
  15791. var guideElement = domutil.closest(
  15792. dragStartEventData.target,
  15793. config.classname('.time-date-schedule-block')
  15794. );
  15795. var duration, modelDuration, goingDuration, comingDuration;
  15796. if (!guideElement) {
  15797. return;
  15798. }
  15799. this._startTopPixel = parseFloat(guideElement.style.top);
  15800. this._startGridY = dragStartEventData.nearestGridY;
  15801. this.guideElement = guideElement;
  15802. this._container = dragStartEventData.relatedView.container;
  15803. this._model = util.extend(
  15804. Schedule.create(dragStartEventData.model),
  15805. dragStartEventData.model
  15806. );
  15807. modelDuration = this._model.duration();
  15808. modelDuration = modelDuration > SCHEDULE_MIN_DURATION ? modelDuration : SCHEDULE_MIN_DURATION;
  15809. goingDuration = datetime.millisecondsFrom('minutes', this._model.goingDuration);
  15810. comingDuration = datetime.millisecondsFrom('minutes', this._model.comingDuration);
  15811. duration = goingDuration + modelDuration + comingDuration;
  15812. this._lastDrag = dragStartEventData;
  15813. this._viewModel = {
  15814. hasGoingDuration: goingDuration > 0,
  15815. hasComingDuration: comingDuration > 0,
  15816. goingDurationHeight: common.ratio(duration, goingDuration, 100),
  15817. modelDurationHeight: common.ratio(duration, modelDuration, 100),
  15818. comingDurationHeight: common.ratio(duration, comingDuration, 100)
  15819. };
  15820. this._resetGuideLayer();
  15821. this._hideOriginScheduleBlocks();
  15822. };
  15823. /**
  15824. * TimeMove#timeMoveDrag event handler
  15825. * @param {object} dragEventData - drag event data
  15826. */
  15827. TimeMoveGuide.prototype._onDrag = function(dragEventData) {
  15828. var timeView = dragEventData.currentView,
  15829. viewOptions = timeView.options,
  15830. viewHeight = timeView.getViewBound().height,
  15831. guideHeight = parseFloat(this.guideElement.style.height),
  15832. hourLength = viewOptions.hourEnd - viewOptions.hourStart,
  15833. gridYOffset = dragEventData.nearestGridY - this._startGridY,
  15834. gridYOffsetPixel = ratio(hourLength, viewHeight, gridYOffset),
  15835. gridDiff = dragEventData.nearestGridY - this._lastDrag.nearestGridY,
  15836. bottomLimit,
  15837. top;
  15838. if (!util.browser.msie) {
  15839. domutil.addClass(global.document.body, config.classname('dragging'));
  15840. }
  15841. if (this._container !== timeView.container) {
  15842. this._container = timeView.container;
  15843. this._resetGuideLayer();
  15844. }
  15845. top = this._startTopPixel + gridYOffsetPixel;
  15846. bottomLimit = viewHeight - guideHeight;
  15847. top = Math.max(top, 0);
  15848. top = Math.min(top, bottomLimit);
  15849. // update time
  15850. this._model.start = new TZDate(this._model.getStarts()).addMinutes(datetime.minutesFromHours(gridDiff));
  15851. this._model.end = new TZDate(this._model.getEnds()).addMinutes(datetime.minutesFromHours(gridDiff));
  15852. this._lastDrag = dragEventData;
  15853. this._refreshGuideElement(top, this._model, this._viewModel);
  15854. };
  15855. TimeMoveGuide.prototype._resetGuideLayer = function() {
  15856. if (this._guideLayer) {
  15857. this._guideLayer.destroy();
  15858. this._guideLayer = null;
  15859. }
  15860. this._guideLayer = new FloatingLayer(null, this._container);
  15861. this._guideLayer.setSize(this._container.getBoundingClientRect().width, this.guideElement.style.height);
  15862. this._guideLayer.setPosition(0, this.guideElement.style.top);
  15863. this._guideLayer.setContent(tmpl(util.extend({model: this._model}, this._viewModel)));
  15864. this._guideLayer.show();
  15865. };
  15866. module.exports = TimeMoveGuide;
  15867. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  15868. /***/ }),
  15869. /***/ "./src/js/handler/time/resize.js":
  15870. /*!***************************************!*\
  15871. !*** ./src/js/handler/time/resize.js ***!
  15872. \***************************************/
  15873. /*! no static exports found */
  15874. /***/ (function(module, exports, __webpack_require__) {
  15875. "use strict";
  15876. /**
  15877. * @fileoverview Handling resize schedules from drag handler and time grid view
  15878. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  15879. */
  15880. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  15881. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  15882. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  15883. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  15884. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  15885. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  15886. var timeCore = __webpack_require__(/*! ./core */ "./src/js/handler/time/core.js");
  15887. var TimeResizeGuide = __webpack_require__(/*! ./resizeGuide */ "./src/js/handler/time/resizeGuide.js");
  15888. /**
  15889. * @constructor
  15890. * @implements {Handler}
  15891. * @mixes timeCore
  15892. * @mixes util.CustomEvents
  15893. * @param {Drag} [dragHandler] - Drag handler instance.
  15894. * @param {TimeGrid} [timeGridView] - TimeGrid view instance.
  15895. * @param {Base} [baseController] - Base controller instance.
  15896. */
  15897. function TimeResize(dragHandler, timeGridView, baseController) {
  15898. /**
  15899. * @type {Drag}
  15900. */
  15901. this.dragHandler = dragHandler;
  15902. /**
  15903. * @type {TimeGrid}
  15904. */
  15905. this.timeGridView = timeGridView;
  15906. /**
  15907. * @type {Base}
  15908. */
  15909. this.baseController = baseController;
  15910. /**
  15911. * @type {function}
  15912. */
  15913. this._getScheduleDataFunc = null;
  15914. /**
  15915. * @type {object}
  15916. */
  15917. this._dragStart = null;
  15918. /**
  15919. * @type {TimeResizeGuide}
  15920. */
  15921. this._guide = new TimeResizeGuide(this);
  15922. dragHandler.on('dragStart', this._onDragStart, this);
  15923. }
  15924. /**
  15925. * Destroy method
  15926. */
  15927. TimeResize.prototype.destroy = function() {
  15928. this._guide.destroy();
  15929. this.dragHandler.off(this);
  15930. this.dragHandler = this.timeGridView = this.baseController =
  15931. this._getScheduleDataFunc = this._dragStart = this._guide = null;
  15932. };
  15933. /**
  15934. * @param {HTMLElement} target - element to check condition.
  15935. * @returns {object|boolean} - return time view instance or false
  15936. */
  15937. TimeResize.prototype.checkExpectCondition = function(target) {
  15938. var container,
  15939. matches;
  15940. if (!domutil.hasClass(target, config.classname('time-resize-handle'))) {
  15941. return false;
  15942. }
  15943. container = domutil.closest(target, config.classname('.time-date'));
  15944. if (!container) {
  15945. return false;
  15946. }
  15947. matches = domutil.getClass(container).match(config.time.getViewIDRegExp);
  15948. if (!matches || matches.length < 2) {
  15949. return false;
  15950. }
  15951. return util.pick(this.timeGridView.children.items, Number(matches[1]));
  15952. };
  15953. /**
  15954. * @emits TimeResize#timeResizeDragstart
  15955. * @param {object} dragStartEventData - event data of Drag#dragstart
  15956. */
  15957. TimeResize.prototype._onDragStart = function(dragStartEventData) {
  15958. var target = dragStartEventData.target,
  15959. timeView = this.checkExpectCondition(target),
  15960. blockElement = domutil.closest(target, config.classname('.time-date-schedule-block')),
  15961. ctrl = this.baseController,
  15962. targetModelID,
  15963. getScheduleDataFunc,
  15964. scheduleData;
  15965. if (!timeView || !blockElement) {
  15966. return;
  15967. }
  15968. targetModelID = domutil.getData(blockElement, 'id');
  15969. getScheduleDataFunc = this._getScheduleDataFunc = this._retriveScheduleData(timeView);
  15970. scheduleData = this._dragStart = getScheduleDataFunc(
  15971. dragStartEventData.originEvent, {
  15972. targetModelID: targetModelID,
  15973. schedule: ctrl.schedules.items[targetModelID]
  15974. }
  15975. );
  15976. this.dragHandler.on({
  15977. drag: this._onDrag,
  15978. dragEnd: this._onDragEnd,
  15979. click: this._onClick
  15980. }, this);
  15981. /**
  15982. * @event TimeResize#timeResizeDragstart
  15983. * @type {object}
  15984. * @property {HTMLElement} target - current target in mouse event object.
  15985. * @property {Time} relatedView - time view instance related with mouse position.
  15986. * @property {MouseEvent} originEvent - mouse event object.
  15987. * @property {number} mouseY - mouse Y px mouse event.
  15988. * @property {number} gridY - grid Y index value related with mouseY value.
  15989. * @property {number} timeY - milliseconds value of mouseY points.
  15990. * @property {number} nearestGridY - nearest grid index related with mouseY value.
  15991. * @property {number} nearestGridTimeY - time value for nearestGridY.
  15992. * @property {string} targetModelID - The model unique id emitted move schedule.
  15993. * @property {Schedule} schedule - schedule data
  15994. */
  15995. this.fire('timeResizeDragstart', scheduleData);
  15996. };
  15997. /**
  15998. * Drag#drag event handler
  15999. * @emits TimeResize#timeResizeDrag
  16000. * @param {object} dragEventData - event data of Drag#drag custom event.
  16001. * @param {string} [overrideEventName] - override emitted event name when supplied.
  16002. * @param {function} [revise] - supply function for revise schedule data before emit.
  16003. */
  16004. TimeResize.prototype._onDrag = function(dragEventData, overrideEventName, revise) {
  16005. var getScheduleDataFunc = this._getScheduleDataFunc,
  16006. startScheduleData = this._dragStart,
  16007. scheduleData;
  16008. if (!getScheduleDataFunc || !startScheduleData) {
  16009. return;
  16010. }
  16011. scheduleData = getScheduleDataFunc(dragEventData.originEvent, {
  16012. targetModelID: startScheduleData.targetModelID
  16013. });
  16014. if (revise) {
  16015. revise(scheduleData);
  16016. }
  16017. /**
  16018. * @event TimeResize#timeResizeDrag
  16019. * @type {object}
  16020. * @property {HTMLElement} target - current target in mouse event object.
  16021. * @property {Time} relatedView - time view instance related with drag start position.
  16022. * @property {MouseEvent} originEvent - mouse event object.
  16023. * @property {number} mouseY - mouse Y px mouse event.
  16024. * @property {number} gridY - grid Y index value related with mouseY value.
  16025. * @property {number} timeY - milliseconds value of mouseY points.
  16026. * @property {number} nearestGridY - nearest grid index related with mouseY value.
  16027. * @property {number} nearestGridTimeY - time value for nearestGridY.
  16028. * @property {string} targetModelID - The model unique id emitted move schedule.
  16029. */
  16030. this.fire(overrideEventName || 'timeResizeDrag', scheduleData);
  16031. };
  16032. /**
  16033. * Update model instance by dragend event results.
  16034. * @fires TimeResize#beforeUpdateSchedule
  16035. * @param {object} scheduleData - schedule data from TimeResize#timeResizeDragend
  16036. */
  16037. TimeResize.prototype._updateSchedule = function(scheduleData) {
  16038. var ctrl = this.baseController,
  16039. modelID = scheduleData.targetModelID,
  16040. range = scheduleData.nearestRange,
  16041. timeDiff = range[1] - range[0],
  16042. schedule = ctrl.schedules.items[modelID],
  16043. relatedView = scheduleData.relatedView,
  16044. dateEnd,
  16045. newEnds,
  16046. baseDate;
  16047. var changes;
  16048. if (!schedule) {
  16049. return;
  16050. }
  16051. timeDiff -= datetime.millisecondsFrom('minutes', 30);
  16052. baseDate = new TZDate(relatedView.getDate());
  16053. dateEnd = datetime.end(baseDate);
  16054. newEnds = new TZDate(schedule.getEnds()).addMilliseconds(timeDiff);
  16055. if (newEnds > dateEnd) {
  16056. newEnds = new TZDate(dateEnd);
  16057. }
  16058. if (newEnds.getTime() - schedule.getStarts().getTime() < datetime.millisecondsFrom('minutes', 30)) {
  16059. newEnds = new TZDate(schedule.getStarts()).addMinutes(30);
  16060. }
  16061. changes = common.getScheduleChanges(
  16062. schedule,
  16063. ['end'],
  16064. {end: newEnds}
  16065. );
  16066. /**
  16067. * @event TimeResize#beforeUpdateSchedule
  16068. * @type {object}
  16069. * @property {Schedule} schedule - The original schedule instance
  16070. * @property {Date} start - Deprecated: start time to update
  16071. * @property {Date} end - Deprecated: end time to update
  16072. * @property {object} changes - end time to update
  16073. * @property {date} end - end time to update
  16074. */
  16075. this.fire('beforeUpdateSchedule', {
  16076. schedule: schedule,
  16077. changes: changes,
  16078. start: schedule.getStarts(),
  16079. end: newEnds
  16080. });
  16081. };
  16082. /**
  16083. * Drag#dragEnd event handler
  16084. * @emits TimeResize#timeResizeDragend
  16085. * @param {MouseEvent} dragEndEventData - Mouse event of Drag#dragEnd custom event.
  16086. */
  16087. TimeResize.prototype._onDragEnd = function(dragEndEventData) {
  16088. var getScheduleDataFunc = this._getScheduleDataFunc,
  16089. dragStart = this._dragStart,
  16090. scheduleData;
  16091. this.dragHandler.off({
  16092. drag: this._onDrag,
  16093. dragEnd: this._onDragEnd,
  16094. click: this._onClick
  16095. }, this);
  16096. if (!getScheduleDataFunc || !dragStart) {
  16097. return;
  16098. }
  16099. scheduleData = getScheduleDataFunc(dragEndEventData.originEvent, {
  16100. targetModelID: dragStart.targetModelID
  16101. });
  16102. scheduleData.range = [
  16103. dragStart.timeY,
  16104. new TZDate(scheduleData.timeY).addMinutes(30)
  16105. ];
  16106. scheduleData.nearestRange = [
  16107. dragStart.nearestGridTimeY,
  16108. scheduleData.nearestGridTimeY.addMinutes(30)
  16109. ];
  16110. this._updateSchedule(scheduleData);
  16111. /**
  16112. * @event TimeResize#timeResizeDragend
  16113. * @type {object}
  16114. * @property {HTMLElement} target - current target in mouse event object.
  16115. * @property {Time} relatedView - time view instance related with drag start position.
  16116. * @property {MouseEvent} originEvent - mouse event object.
  16117. * @property {number} mouseY - mouse Y px mouse event.
  16118. * @property {number} gridY - grid Y index value related with mouseY value.
  16119. * @property {number} timeY - milliseconds value of mouseY points.
  16120. * @property {number} nearestGridY - nearest grid index related with mouseY value.
  16121. * @property {number} nearestGridTimeY - time value for nearestGridY.
  16122. * @property {string} targetModelID - The model unique id emitted move schedule.
  16123. * @property {number[]} range - milliseconds range between drag start and end.
  16124. * @property {number[]} nearestRange - milliseconds range related with nearestGridY between start and end.
  16125. */
  16126. this.fire('timeResizeDragend', scheduleData);
  16127. this._getScheduleDataFunc = this._dragStart = null;
  16128. };
  16129. /**
  16130. * @emits TimeResize#timeResizeClick
  16131. */
  16132. TimeResize.prototype._onClick = function() {
  16133. this.dragHandler.off({
  16134. drag: this._onDrag,
  16135. dragEnd: this._onDragEnd,
  16136. click: this._onClick
  16137. }, this);
  16138. /**
  16139. * @event TimeResize#timeResizeClick
  16140. */
  16141. this.fire('timeResizeClick');
  16142. };
  16143. timeCore.mixin(TimeResize);
  16144. util.CustomEvents.mixin(TimeResize);
  16145. module.exports = TimeResize;
  16146. /***/ }),
  16147. /***/ "./src/js/handler/time/resizeGuide.js":
  16148. /*!********************************************!*\
  16149. !*** ./src/js/handler/time/resizeGuide.js ***!
  16150. \********************************************/
  16151. /*! no static exports found */
  16152. /***/ (function(module, exports, __webpack_require__) {
  16153. "use strict";
  16154. /* WEBPACK VAR INJECTION */(function(global) {/**
  16155. * @fileoverview Module for Time.Resize effect while dragging.
  16156. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  16157. */
  16158. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  16159. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  16160. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  16161. var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
  16162. var ratio = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js").ratio;
  16163. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  16164. /**
  16165. * Class for Time.Resize effect.
  16166. * @constructor
  16167. * @param {TimeResize} timeResize - the instance of TimeResize handler.
  16168. */
  16169. function TimeResizeGuide(timeResize) {
  16170. /**
  16171. * @type {HTMLElement}
  16172. */
  16173. this.guideElement = null;
  16174. /**
  16175. * @type {TimeResize}
  16176. */
  16177. this.timeResize = timeResize;
  16178. /**
  16179. * @type {function}
  16180. */
  16181. this._getTopFunc = null;
  16182. /**
  16183. * @type {HTMLElement}
  16184. */
  16185. this._originScheduleElement = null;
  16186. /**
  16187. * @type {number}
  16188. */
  16189. this._startTopPixel = 0;
  16190. /**
  16191. * @type {number}
  16192. */
  16193. this._startHeightPixel = 0;
  16194. /**
  16195. * @type {number}
  16196. */
  16197. this._startGridY = 0;
  16198. /**
  16199. * @type {Schedule}
  16200. */
  16201. this._schedule = null;
  16202. timeResize.on({
  16203. 'timeResizeDragstart': this._onDragStart,
  16204. 'timeResizeDrag': this._onDrag,
  16205. 'timeResizeDragend': this._clearGuideElement,
  16206. 'timeResizeClick': this._clearGuideElement
  16207. }, this);
  16208. }
  16209. /**
  16210. * Destroy method
  16211. */
  16212. TimeResizeGuide.prototype.destroy = function() {
  16213. this._clearGuideElement();
  16214. this.timeResize.off(this);
  16215. this.guideElement = this.timeResize = this._getTopFunc =
  16216. this._originScheduleElement = this._startHeightPixel =
  16217. this._startGridY = this._startTopPixel = null;
  16218. };
  16219. /**
  16220. * Clear guide element.
  16221. */
  16222. TimeResizeGuide.prototype._clearGuideElement = function() {
  16223. var guideElement = this.guideElement,
  16224. originElement = this._originScheduleElement;
  16225. if (!util.browser.msie) {
  16226. domutil.removeClass(global.document.body, config.classname('resizing'));
  16227. }
  16228. if (originElement) {
  16229. originElement.style.display = 'block';
  16230. }
  16231. domutil.remove(guideElement);
  16232. this.guideElement = this._getTopFunc = this._originScheduleElement =
  16233. this._startHeightPixel = this._startGridY = this._startTopPixel = null;
  16234. };
  16235. /**
  16236. * Refresh guide element
  16237. * @param {number} guideHeight - guide element's style height.
  16238. * @param {number} minTimeHeight - time element's min height
  16239. * @param {number} timeHeight - time element's height.
  16240. */
  16241. TimeResizeGuide.prototype._refreshGuideElement = function(guideHeight, minTimeHeight, timeHeight) {
  16242. var guideElement = this.guideElement;
  16243. var timeElement;
  16244. if (!guideElement) {
  16245. return;
  16246. }
  16247. timeElement = domutil.find(config.classname('.time-schedule-content-time'), guideElement);
  16248. reqAnimFrame.requestAnimFrame(function() {
  16249. guideElement.style.height = guideHeight + 'px';
  16250. guideElement.style.display = 'block';
  16251. if (timeElement) {
  16252. timeElement.style.height = timeHeight + 'px';
  16253. timeElement.style.minHeight = minTimeHeight + 'px';
  16254. }
  16255. });
  16256. };
  16257. /**
  16258. * TimeMove#timeMoveDragstart event handler
  16259. * @param {object} dragStartEventData - dragstart event data
  16260. */
  16261. TimeResizeGuide.prototype._onDragStart = function(dragStartEventData) {
  16262. var originElement = domutil.closest(
  16263. dragStartEventData.target,
  16264. config.classname('.time-date-schedule-block')
  16265. ),
  16266. schedule = dragStartEventData.schedule,
  16267. guideElement;
  16268. if (!util.browser.msie) {
  16269. domutil.addClass(global.document.body, config.classname('resizing'));
  16270. }
  16271. if (!originElement || !schedule) {
  16272. return;
  16273. }
  16274. this._startGridY = dragStartEventData.nearestGridY;
  16275. this._startHeightPixel = parseFloat(originElement.style.height);
  16276. this._startTopPixel = parseFloat(originElement.style.top);
  16277. this._originScheduleElement = originElement;
  16278. this._schedule = schedule;
  16279. guideElement = this.guideElement = originElement.cloneNode(true);
  16280. domutil.addClass(guideElement, config.classname('time-guide-resize'));
  16281. originElement.style.display = 'none';
  16282. dragStartEventData.relatedView.container.appendChild(guideElement);
  16283. };
  16284. /**
  16285. * @param {object} dragEventData - event data from Drag#drag.
  16286. */
  16287. TimeResizeGuide.prototype._onDrag = function(dragEventData) {
  16288. var timeView = dragEventData.relatedView,
  16289. viewOptions = timeView.options,
  16290. viewHeight = timeView.getViewBound().height,
  16291. hourLength = viewOptions.hourEnd - viewOptions.hourStart,
  16292. guideElement = this.guideElement,
  16293. guideTop = parseFloat(guideElement.style.top),
  16294. gridYOffset = dragEventData.nearestGridY - this._startGridY,
  16295. // hourLength : viewHeight = gridYOffset : X;
  16296. gridYOffsetPixel = ratio(hourLength, viewHeight, gridYOffset),
  16297. goingDuration = this._schedule.goingDuration,
  16298. modelDuration = this._schedule.duration() / datetime.MILLISECONDS_PER_MINUTES,
  16299. comingDuration = this._schedule.comingDuration,
  16300. minutesLength = hourLength * 60,
  16301. timeHeight,
  16302. timeMinHeight,
  16303. minHeight,
  16304. maxHeight,
  16305. height;
  16306. height = (this._startHeightPixel + gridYOffsetPixel);
  16307. // at least large than 30min from schedule start time.
  16308. minHeight = guideTop + ratio(hourLength, viewHeight, 0.5);
  16309. minHeight -= this._startTopPixel;
  16310. timeMinHeight = minHeight;
  16311. minHeight += ratio(minutesLength, viewHeight, goingDuration) + ratio(minutesLength, viewHeight, comingDuration);
  16312. // smaller than 24h
  16313. maxHeight = viewHeight - guideTop;
  16314. height = Math.max(height, minHeight);
  16315. height = Math.min(height, maxHeight);
  16316. timeHeight = ratio(minutesLength, viewHeight, modelDuration) + gridYOffsetPixel;
  16317. this._refreshGuideElement(height, timeMinHeight, timeHeight);
  16318. };
  16319. module.exports = TimeResizeGuide;
  16320. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  16321. /***/ }),
  16322. /***/ "./src/js/model/schedule.js":
  16323. /*!**********************************!*\
  16324. !*** ./src/js/model/schedule.js ***!
  16325. \**********************************/
  16326. /*! no static exports found */
  16327. /***/ (function(module, exports, __webpack_require__) {
  16328. "use strict";
  16329. /* eslint complexity: 0 */
  16330. /**
  16331. * @fileoverview Model of schedule.
  16332. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  16333. */
  16334. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  16335. var tz = __webpack_require__(/*! ../common/timezone */ "./src/js/common/timezone.js");
  16336. var datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js");
  16337. var dirty = __webpack_require__(/*! ../common/dirty */ "./src/js/common/dirty.js");
  16338. var model = __webpack_require__(/*! ../common/model */ "./src/js/common/model.js");
  16339. var TZDate = tz.Date;
  16340. var MIN_TO_MS = 60 * 1000;
  16341. var SCHEDULE_MIN_DURATION = datetime.MILLISECONDS_SCHEDULE_MIN_DURATION;
  16342. /**
  16343. * Schedule category
  16344. * @readonly
  16345. * @enum {string}
  16346. */
  16347. var SCHEDULE_CATEGORY = {
  16348. /** milestone */
  16349. MILESTONE: 'milestone',
  16350. /** task */
  16351. TASK: 'task',
  16352. /** all-day schedule */
  16353. ALLDAY: 'allday',
  16354. /** normal schedule */
  16355. TIME: 'time'
  16356. };
  16357. /**
  16358. * Get duration by primary timezone
  16359. * @param {Date} start render start date
  16360. * @param {Date} end render end date
  16361. * @returns {number} duration
  16362. */
  16363. function getDurationByPrimaryTimezone(start, end) {
  16364. var checkOffset = tz.isDifferentOffsetStartAndEndTime(start.getTime(), end.getTime());
  16365. var isOffsetChanged = checkOffset.isOffsetChanged;
  16366. var duration = end - start;
  16367. if (isOffsetChanged !== 0) {
  16368. duration += checkOffset.offsetDiff * MIN_TO_MS;
  16369. }
  16370. return duration;
  16371. }
  16372. /**
  16373. * Get duration by native timezone
  16374. * @param {TZDate} start render start date
  16375. * @param {TZDate} end render end date
  16376. * @returns {number} duration
  16377. */
  16378. function getDurationByNativeTimezone(start, end) {
  16379. var startOffset = start.toDate().getTimezoneOffset();
  16380. var endOffset = end.toDate().getTimezoneOffset();
  16381. return (end - start) + ((endOffset - startOffset) * MIN_TO_MS);
  16382. }
  16383. /**
  16384. * The model of calendar schedules.
  16385. * @constructor
  16386. * @mixes dirty
  16387. * @mixes model
  16388. */
  16389. function Schedule() {
  16390. /**
  16391. * `Optional` unique id for various use.
  16392. * @type {string}
  16393. */
  16394. this.id = '';
  16395. /**
  16396. * title for schedule.
  16397. * @type {string}
  16398. */
  16399. this.title = '';
  16400. /**
  16401. * body for schedule.
  16402. * @type {string}
  16403. */
  16404. this.body = '';
  16405. /**
  16406. * is schedule is all day schedule?
  16407. * @type {boolean}
  16408. */
  16409. this.isAllDay = false;
  16410. /**
  16411. * schedule start
  16412. * @type {TZDate}
  16413. */
  16414. this.start = null;
  16415. /**
  16416. * schedule end
  16417. * @type {TZDate}
  16418. */
  16419. this.end = null;
  16420. /**
  16421. * schedule text color
  16422. * @type {string}
  16423. */
  16424. this.color = '#000';
  16425. /**
  16426. * schedule block visibility
  16427. * @type {boolean}
  16428. */
  16429. this.isVisible = true;
  16430. /**
  16431. * schedule background color
  16432. * @type {string}
  16433. */
  16434. this.bgColor = '#a1b56c';
  16435. /**
  16436. * schedule background color when dragging it
  16437. * @type {string}
  16438. */
  16439. this.dragBgColor = '#a1b56c';
  16440. /**
  16441. * schedule left border color
  16442. * @type {string}
  16443. */
  16444. this.borderColor = '#000';
  16445. /**
  16446. * calendar ID
  16447. * @type {string}
  16448. */
  16449. this.calendarId = '';
  16450. /**
  16451. * Schedule category(milestone, task, allday, time)
  16452. * @type {string}
  16453. */
  16454. this.category = '';
  16455. /**
  16456. * Classification of work schedules (before work, before lunch, before work)
  16457. * @type {string}
  16458. */
  16459. this.dueDateClass = '';
  16460. /**
  16461. * Custom style for schedule element
  16462. * @type {string}
  16463. */
  16464. this.customStyle = '';
  16465. /**
  16466. * in progress flag to do something
  16467. * @type {boolean}
  16468. */
  16469. this.isPending = false;
  16470. /**
  16471. * focused schedule flag
  16472. * @type {boolean}
  16473. */
  16474. this.isFocused = false;
  16475. /**
  16476. * read-only schedule flag
  16477. * @type {boolean}
  16478. */
  16479. this.isReadOnly = false;
  16480. /**
  16481. * private schedule
  16482. * @type {boolean}
  16483. */
  16484. this.isPrivate = false;
  16485. /**
  16486. * location
  16487. * @type {string}
  16488. */
  16489. this.location = '';
  16490. /**
  16491. * attendees
  16492. * @type {Array.<string>}
  16493. */
  16494. this.attendees = [];
  16495. /**
  16496. * recurrence rule
  16497. * @type {any}
  16498. */
  16499. this.recurrenceRule = '';
  16500. /**
  16501. * state. 'Busy' is default.
  16502. * @type {string}
  16503. */
  16504. this.state = '';
  16505. /**
  16506. * travelTime: going-Duration minutes
  16507. * @type {number}
  16508. */
  16509. this.goingDuration = 0;
  16510. /**
  16511. * travelTime: coming-Duration minutes
  16512. * @type {number}
  16513. */
  16514. this.comingDuration = 0;
  16515. /**
  16516. * Separate data storage space independent of rendering.
  16517. * @type {object}
  16518. */
  16519. this.raw = null;
  16520. // initialize model id
  16521. util.stamp(this);
  16522. }
  16523. /**********
  16524. * static props
  16525. **********/
  16526. Schedule.schema = {
  16527. required: ['title'],
  16528. dateRange: ['start', 'end']
  16529. };
  16530. /**
  16531. * create schedule model from json(object) data.
  16532. * @param {object} data object for model.
  16533. * @returns {Schedule} Schedule model instance.
  16534. */
  16535. Schedule.create = function(data) {
  16536. var inst = new Schedule();
  16537. inst.init(data);
  16538. return inst;
  16539. };
  16540. /**********
  16541. * prototype props
  16542. **********/
  16543. /**
  16544. * Initialize schedule instance.
  16545. * @param {object} options options.
  16546. */
  16547. Schedule.prototype.init = function(options) {
  16548. options = util.extend({}, options);
  16549. if (options.category === SCHEDULE_CATEGORY.ALLDAY) {
  16550. options.isAllDay = true;
  16551. }
  16552. this.id = options.id || '';
  16553. this.title = options.title || '';
  16554. this.body = options.body || '';
  16555. this.isAllDay = util.isExisty(options.isAllDay) ? options.isAllDay : false;
  16556. this.isVisible = util.isExisty(options.isVisible) ? options.isVisible : true;
  16557. this.color = options.color || this.color;
  16558. this.bgColor = options.bgColor || this.bgColor;
  16559. this.dragBgColor = options.dragBgColor || this.dragBgColor;
  16560. this.borderColor = options.borderColor || this.borderColor;
  16561. this.calendarId = options.calendarId || '';
  16562. this.category = options.category || '';
  16563. this.dueDateClass = options.dueDateClass || '';
  16564. this.customStyle = options.customStyle || '';
  16565. this.location = options.location || '';
  16566. this.attendees = options.attendees || [];
  16567. this.recurrenceRule = options.recurrenceRule || '';
  16568. this.isPrivate = options.isPrivate || false;
  16569. this.isPending = options.isPending || false;
  16570. this.isFocused = options.isFocused || false;
  16571. this.isReadOnly = options.isReadOnly || false;
  16572. this.goingDuration = options.goingDuration || 0;
  16573. this.comingDuration = options.comingDuration || 0;
  16574. this.state = options.state || '';
  16575. if (this.isAllDay) {
  16576. this.setAllDayPeriod(options.start, options.end);
  16577. } else {
  16578. this.setTimePeriod(options.start, options.end);
  16579. }
  16580. this.raw = options.raw || null;
  16581. };
  16582. Schedule.prototype.setAllDayPeriod = function(start, end) {
  16583. // If it is an all-day schedule, only the date information of the string is used.
  16584. if (util.isString(start) && start.length === 10) {
  16585. start = datetime.parse(start);
  16586. } else {
  16587. start = new TZDate(start || Date.now());
  16588. }
  16589. if (util.isString(end) && end.length === 10) {
  16590. end = datetime.parse(end);
  16591. end.setHours(23, 59, 59);
  16592. } else {
  16593. end = new TZDate(end || start);
  16594. }
  16595. this.start = datetime.start(start);
  16596. this.end = datetime.renderEnd(start, end);
  16597. };
  16598. Schedule.prototype.setTimePeriod = function(start, end) {
  16599. this.start = new TZDate(start || Date.now());
  16600. this.end = new TZDate(end || this.start);
  16601. if (!end) {
  16602. this.end.setMinutes(this.end.getMinutes() + 30);
  16603. }
  16604. };
  16605. /**
  16606. * @returns {Date} render start date.
  16607. */
  16608. Schedule.prototype.getStarts = function() {
  16609. return this.start;
  16610. };
  16611. /**
  16612. * @returns {Date} render end date.
  16613. */
  16614. Schedule.prototype.getEnds = function() {
  16615. return this.end;
  16616. };
  16617. /**
  16618. * @returns {number} instance unique id.
  16619. */
  16620. Schedule.prototype.cid = function() {
  16621. return util.stamp(this);
  16622. };
  16623. /**
  16624. * Check two schedule are equals (means title, isAllDay, start, end are same)
  16625. * @param {Schedule} schedule Schedule model instance to compare.
  16626. * @returns {boolean} Return false when not same.
  16627. */
  16628. Schedule.prototype.equals = function(schedule) {
  16629. if (this.id !== schedule.id) {
  16630. return false;
  16631. }
  16632. if (this.title !== schedule.title) {
  16633. return false;
  16634. }
  16635. if (this.body !== schedule.body) {
  16636. return false;
  16637. }
  16638. if (this.isAllDay !== schedule.isAllDay) {
  16639. return false;
  16640. }
  16641. if (datetime.compare(this.getStarts(), schedule.getStarts()) !== 0) {
  16642. return false;
  16643. }
  16644. if (datetime.compare(this.getEnds(), schedule.getEnds()) !== 0) {
  16645. return false;
  16646. }
  16647. if (this.color !== schedule.color) {
  16648. return false;
  16649. }
  16650. if (this.bgColor !== schedule.bgColor) {
  16651. return false;
  16652. }
  16653. if (this.dragBgColor !== schedule.dragBgColor) {
  16654. return false;
  16655. }
  16656. if (this.borderColor !== schedule.borderColor) {
  16657. return false;
  16658. }
  16659. return true;
  16660. };
  16661. /**
  16662. * return duration between start and end.
  16663. * @returns {Date} duration (UTC)
  16664. */
  16665. Schedule.prototype.duration = function() {
  16666. var start = this.getStarts(),
  16667. end = this.getEnds(),
  16668. duration;
  16669. var hasPrimaryTimezoneCustomSetting = tz.hasPrimaryTimezoneCustomSetting();
  16670. if (this.isAllDay) {
  16671. duration = datetime.end(end) - datetime.start(start);
  16672. } else if (hasPrimaryTimezoneCustomSetting && tz.isPrimaryUsingDSTTimezone()) {
  16673. duration = getDurationByPrimaryTimezone(start, end);
  16674. } else if (hasPrimaryTimezoneCustomSetting && tz.isNativeOsUsingDSTTimezone()) {
  16675. duration = getDurationByNativeTimezone(start, end);
  16676. } else {
  16677. duration = end - start;
  16678. }
  16679. return duration;
  16680. };
  16681. /**
  16682. * Returns true if the given Schedule coincides with the same time as the
  16683. * calling Schedule.
  16684. * @param {Schedule} schedule The other schedule to compare with this Schedule.
  16685. * @returns {boolean} If the other schedule occurs within the same time as the first object.
  16686. */
  16687. Schedule.prototype.collidesWith = function(schedule) {
  16688. var ownStarts = this.getStarts(),
  16689. ownEnds = this.getEnds(),
  16690. start = schedule.getStarts(),
  16691. end = schedule.getEnds();
  16692. var ownGoingDuration = datetime.millisecondsFrom('minutes', this.goingDuration),
  16693. ownComingDuration = datetime.millisecondsFrom('minutes', this.comingDuration),
  16694. goingDuration = datetime.millisecondsFrom('minutes', schedule.goingDuration),
  16695. comingDuration = datetime.millisecondsFrom('minutes', schedule.comingDuration);
  16696. if (Math.abs(ownEnds - ownStarts) < SCHEDULE_MIN_DURATION) {
  16697. ownEnds += SCHEDULE_MIN_DURATION;
  16698. }
  16699. if (Math.abs(end - start) < SCHEDULE_MIN_DURATION) {
  16700. end += SCHEDULE_MIN_DURATION;
  16701. }
  16702. ownStarts -= ownGoingDuration;
  16703. ownEnds += ownComingDuration;
  16704. start -= goingDuration;
  16705. end += comingDuration;
  16706. if (
  16707. (start > ownStarts && start < ownEnds) ||
  16708. (end > ownStarts && end < ownEnds) ||
  16709. (start <= ownStarts && end >= ownEnds)
  16710. ) {
  16711. return true;
  16712. }
  16713. return false;
  16714. };
  16715. model.mixin(Schedule.prototype);
  16716. dirty.mixin(Schedule.prototype);
  16717. module.exports = Schedule;
  16718. /***/ }),
  16719. /***/ "./src/js/model/viewModel/scheduleViewModel.js":
  16720. /*!*****************************************************!*\
  16721. !*** ./src/js/model/viewModel/scheduleViewModel.js ***!
  16722. \*****************************************************/
  16723. /*! no static exports found */
  16724. /***/ (function(module, exports, __webpack_require__) {
  16725. "use strict";
  16726. /**
  16727. * @fileoverview Model for views
  16728. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  16729. */
  16730. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  16731. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  16732. var SCHEDULE_MIN_DURATION = datetime.MILLISECONDS_SCHEDULE_MIN_DURATION;
  16733. /**
  16734. * Schedule ViewModel
  16735. * @constructor
  16736. * @param {Schedule} schedule Schedule instance.
  16737. */
  16738. function ScheduleViewModel(schedule) {
  16739. /**
  16740. * The model of schedule.
  16741. * @type {Schedule}
  16742. */
  16743. this.model = schedule;
  16744. /**
  16745. * @type {number}
  16746. */
  16747. this.top = 0;
  16748. /**
  16749. * @type {number}
  16750. */
  16751. this.left = 0;
  16752. /**
  16753. * @type {number}
  16754. */
  16755. this.width = 0;
  16756. /**
  16757. * @type {number}
  16758. */
  16759. this.height = 0;
  16760. /**
  16761. * Represent schedule has collide with other schedules when rendering.
  16762. * @type {boolean}
  16763. */
  16764. this.hasCollide = false;
  16765. /**
  16766. * Extra space at rigth side of this schedule.
  16767. * @type {number}
  16768. */
  16769. this.extraSpace = 0;
  16770. /**
  16771. * represent this schedule block is not visible after rendered.
  16772. *
  16773. * in month view, some viewmodel in date need to hide when already rendered before dates.
  16774. *
  16775. * set true then it just shows empty space.
  16776. * @type {boolean}
  16777. */
  16778. this.hidden = false;
  16779. /**
  16780. * whether the schedule includes multiple dates
  16781. */
  16782. this.hasMultiDates = false;
  16783. /**
  16784. * represent render start date used at rendering.
  16785. *
  16786. * if set null then use model's 'start' property.
  16787. * @type {TZDate}
  16788. */
  16789. this.renderStarts = null;
  16790. /**
  16791. * whether the actual start-date is before the render-start-date
  16792. * @type {boolean}
  16793. */
  16794. this.exceedLeft = false;
  16795. /**
  16796. * represent render end date used at rendering.
  16797. *
  16798. * if set null then use model's 'end' property.
  16799. * @type {TZDate}
  16800. */
  16801. this.renderEnds = null;
  16802. /**
  16803. * whether the actual end-date is after the render-end-date
  16804. * @type {boolean}
  16805. */
  16806. this.exceedRight = false;
  16807. }
  16808. /**********
  16809. * static props
  16810. **********/
  16811. /**
  16812. * ScheduleViewModel factory method.
  16813. * @param {Schedule} schedule Schedule instance.
  16814. * @returns {ScheduleViewModel} ScheduleViewModel instance.
  16815. */
  16816. ScheduleViewModel.create = function(schedule) {
  16817. return new ScheduleViewModel(schedule);
  16818. };
  16819. /**********
  16820. * prototype props
  16821. **********/
  16822. /**
  16823. * return renderStarts property to render properly when specific schedule that exceed rendering date range.
  16824. *
  16825. * if renderStarts is not set. return model's start property.
  16826. * @override
  16827. * @returns {Date} render start date.
  16828. */
  16829. ScheduleViewModel.prototype.getStarts = function() {
  16830. if (this.renderStarts) {
  16831. return this.renderStarts;
  16832. }
  16833. return this.model.start;
  16834. };
  16835. /**
  16836. * return renderStarts property to render properly when specific schedule that exceed rendering date range.
  16837. *
  16838. * if renderEnds is not set. return model's end property.
  16839. * @override
  16840. * @returns {Date} render end date.
  16841. */
  16842. ScheduleViewModel.prototype.getEnds = function() {
  16843. if (this.renderEnds) {
  16844. return this.renderEnds;
  16845. }
  16846. return this.model.end;
  16847. };
  16848. /**
  16849. * @returns {number} unique number for model.
  16850. */
  16851. ScheduleViewModel.prototype.cid = function() {
  16852. return util.stamp(this.model);
  16853. };
  16854. /**
  16855. * Shadowing valueOf method for schedule sorting.
  16856. * @returns {Schedule} The model of schedule.
  16857. */
  16858. ScheduleViewModel.prototype.valueOf = function() {
  16859. return this.model;
  16860. };
  16861. /**
  16862. * Link duration method
  16863. * @returns {number} Schedule#duration result.
  16864. */
  16865. ScheduleViewModel.prototype.duration = function() {
  16866. return this.model.duration();
  16867. };
  16868. /**
  16869. * Link collidesWith method
  16870. * @param {Schedule|ScheduleViewModel} viewModel - Model or viewmodel instance of Schedule.
  16871. * @returns {boolean} Schedule#collidesWith result.
  16872. */
  16873. ScheduleViewModel.prototype.collidesWith = function(viewModel) {
  16874. var ownStarts = this.getStarts(),
  16875. ownEnds = this.getEnds(),
  16876. start = viewModel.getStarts(),
  16877. end = viewModel.getEnds();
  16878. var ownGoingDuration = datetime.millisecondsFrom('minutes', this.valueOf().goingDuration),
  16879. ownComingDuration = datetime.millisecondsFrom('minutes', this.valueOf().comingDuration),
  16880. goingDuration = datetime.millisecondsFrom('minutes', viewModel.valueOf().goingDuration),
  16881. comingDuration = datetime.millisecondsFrom('minutes', viewModel.valueOf().comingDuration);
  16882. if (Math.abs(ownEnds - ownStarts) < SCHEDULE_MIN_DURATION) {
  16883. ownEnds += SCHEDULE_MIN_DURATION;
  16884. }
  16885. if (Math.abs(end - start) < SCHEDULE_MIN_DURATION) {
  16886. end += SCHEDULE_MIN_DURATION;
  16887. }
  16888. ownStarts -= ownGoingDuration;
  16889. ownEnds += ownComingDuration;
  16890. start -= goingDuration;
  16891. end += comingDuration;
  16892. if ((start > ownStarts && start < ownEnds) ||
  16893. (end > ownStarts && end < ownEnds) ||
  16894. (start <= ownStarts && end >= ownEnds)) {
  16895. return true;
  16896. }
  16897. return false;
  16898. };
  16899. module.exports = ScheduleViewModel;
  16900. /***/ }),
  16901. /***/ "./src/js/theme/standard.js":
  16902. /*!**********************************!*\
  16903. !*** ./src/js/theme/standard.js ***!
  16904. \**********************************/
  16905. /*! no static exports found */
  16906. /***/ (function(module, exports, __webpack_require__) {
  16907. "use strict";
  16908. /**
  16909. * @fileoverview The standard theme
  16910. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  16911. */
  16912. /**
  16913. * "common" prefix is for entire calendar. "common" properties can be overriden by "week", "month".
  16914. * "week" prefix is for weekly and daily view.
  16915. * "month" prefix is for monthly view.
  16916. */
  16917. var theme = {
  16918. 'common.border': '1px solid #e5e5e5',
  16919. 'common.backgroundColor': 'white',
  16920. 'common.holiday.color': '#ff4040',
  16921. 'common.saturday.color': '#333',
  16922. 'common.dayname.color': '#333',
  16923. 'common.today.color': '#333',
  16924. // creation guide style
  16925. 'common.creationGuide.backgroundColor': 'rgba(81, 92, 230, 0.05)',
  16926. 'common.creationGuide.border': '1px solid #515ce6',
  16927. // month header 'dayname'
  16928. 'month.dayname.height': '31px',
  16929. 'month.dayname.borderLeft': 'none',
  16930. 'month.dayname.paddingLeft': '10px',
  16931. 'month.dayname.paddingRight': '0',
  16932. 'month.dayname.backgroundColor': 'inherit',
  16933. 'month.dayname.fontSize': '12px',
  16934. 'month.dayname.fontWeight': 'normal',
  16935. 'month.dayname.textAlign': 'left',
  16936. // month day grid cell 'day'
  16937. 'month.holidayExceptThisMonth.color': 'rgba(255, 64, 64, 0.4)',
  16938. 'month.dayExceptThisMonth.color': 'rgba(51, 51, 51, 0.4)',
  16939. 'month.weekend.backgroundColor': 'inherit',
  16940. 'month.day.fontSize': '14px',
  16941. // month schedule style
  16942. 'month.schedule.borderRadius': '2px',
  16943. 'month.schedule.height': '24px',
  16944. 'month.schedule.marginTop': '2px',
  16945. 'month.schedule.marginLeft': '8px',
  16946. 'month.schedule.marginRight': '8px',
  16947. // month more view
  16948. 'month.moreView.border': '1px solid #d5d5d5',
  16949. 'month.moreView.boxShadow': '0 2px 6px 0 rgba(0, 0, 0, 0.1)',
  16950. 'month.moreView.backgroundColor': 'white',
  16951. 'month.moreView.paddingBottom': '17px',
  16952. 'month.moreViewTitle.height': '44px',
  16953. 'month.moreViewTitle.marginBottom': '12px',
  16954. 'month.moreViewTitle.borderBottom': 'none',
  16955. 'month.moreViewTitle.padding': '12px 17px 0 17px',
  16956. 'month.moreViewList.padding': '0 17px',
  16957. // week header 'dayname'
  16958. 'week.dayname.height': '42px',
  16959. 'week.dayname.borderTop': '1px solid #e5e5e5',
  16960. 'week.dayname.borderBottom': '1px solid #e5e5e5',
  16961. 'week.dayname.borderLeft': 'none',
  16962. 'week.dayname.paddingLeft': '0',
  16963. 'week.dayname.backgroundColor': 'inherit',
  16964. 'week.dayname.textAlign': 'left',
  16965. 'week.today.color': 'inherit',
  16966. 'week.pastDay.color': '#bbb',
  16967. // week vertical panel 'vpanel'
  16968. 'week.vpanelSplitter.border': '1px solid #e5e5e5',
  16969. 'week.vpanelSplitter.height': '3px',
  16970. // week daygrid 'daygrid'
  16971. 'week.daygrid.borderRight': '1px solid #e5e5e5',
  16972. 'week.daygrid.backgroundColor': 'inherit',
  16973. 'week.daygridLeft.width': '72px',
  16974. 'week.daygridLeft.backgroundColor': 'inherit',
  16975. 'week.daygridLeft.paddingRight': '8px',
  16976. 'week.daygridLeft.borderRight': '1px solid #e5e5e5',
  16977. 'week.today.backgroundColor': 'rgba(81, 92, 230, 0.05)',
  16978. 'week.weekend.backgroundColor': 'inherit',
  16979. // week timegrid 'timegrid'
  16980. 'week.timegridLeft.width': '72px',
  16981. 'week.timegridLeft.backgroundColor': 'inherit',
  16982. 'week.timegridLeft.borderRight': '1px solid #e5e5e5',
  16983. 'week.timegridLeft.fontSize': '11px',
  16984. 'week.timegridOneHour.height': '52px',
  16985. 'week.timegridHalfHour.height': '26px',
  16986. 'week.timegridHalfHour.borderBottom': 'none',
  16987. 'week.timegridHorizontalLine.borderBottom': '1px solid #e5e5e5',
  16988. 'week.timegrid.paddingRight': '8px',
  16989. 'week.timegrid.borderRight': '1px solid #e5e5e5',
  16990. 'week.timegridSchedule.borderRadius': '2px',
  16991. 'week.timegridSchedule.paddingLeft': '2px',
  16992. 'week.currentTime.color': '#515ce6',
  16993. 'week.currentTime.fontSize': '11px',
  16994. 'week.currentTime.fontWeight': 'normal',
  16995. 'week.currentTimeLinePast.border': '1px dashed #515ce6',
  16996. 'week.currentTimeLineBullet.backgroundColor': '#515ce6',
  16997. 'week.currentTimeLineToday.border': '1px solid #515ce6',
  16998. 'week.currentTimeLineFuture.border': 'none',
  16999. // week creation guide style
  17000. 'week.creationGuide.color': '#515ce6',
  17001. 'week.creationGuide.fontSize': '11px',
  17002. 'week.creationGuide.fontWeight': 'bold',
  17003. // week daygrid schedule style
  17004. 'week.dayGridSchedule.borderRadius': '2px',
  17005. 'week.dayGridSchedule.height': '24px',
  17006. 'week.dayGridSchedule.marginTop': '2px',
  17007. 'week.dayGridSchedule.marginLeft': '8px',
  17008. 'week.dayGridSchedule.marginRight': '8px'
  17009. };
  17010. module.exports = theme;
  17011. /***/ }),
  17012. /***/ "./src/js/theme/theme.js":
  17013. /*!*******************************!*\
  17014. !*** ./src/js/theme/theme.js ***!
  17015. \*******************************/
  17016. /*! no static exports found */
  17017. /***/ (function(module, exports, __webpack_require__) {
  17018. "use strict";
  17019. /**
  17020. * @fileoverview The all configuration of a theme
  17021. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  17022. */
  17023. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  17024. var themeStandard = __webpack_require__(/*! ./standard */ "./src/js/theme/standard.js");
  17025. var themeConfig = __webpack_require__(/*! ./themeConfig */ "./src/js/theme/themeConfig.js");
  17026. var common = __webpack_require__(/*! ../common/common */ "./src/js/common/common.js");
  17027. /**
  17028. * Theme manager
  17029. * @param {object} customTheme - custom theme
  17030. */
  17031. function Theme(customTheme) {
  17032. var theme = customTheme || themeStandard;
  17033. /**
  17034. * @type {util.HashMap}
  17035. */
  17036. this._map = new util.HashMap();
  17037. this.setStyles(theme);
  17038. }
  17039. /**
  17040. * Get a style with key
  17041. * @param {string} key - key for getting a style
  17042. * @returns {string|undefined} style
  17043. */
  17044. Theme.prototype.getStyle = function(key) {
  17045. return this._map.get(key);
  17046. };
  17047. /**
  17048. * Set a style
  17049. * @param {string} key - key for setting a style
  17050. * @param {string} style - style value
  17051. * @returns {boolean} true if the give key is valid or false
  17052. */
  17053. Theme.prototype.setStyle = function(key, style) {
  17054. var styles = {};
  17055. styles[key] = style;
  17056. return this.setStyles(styles).length === 0;
  17057. };
  17058. /**
  17059. * Set styles
  17060. * @param {object} styles - multiple styles map
  17061. * @returns {Array.<string>} error keys
  17062. */
  17063. Theme.prototype.setStyles = function(styles) {
  17064. var errors = [];
  17065. util.forEach(styles, function(style, key) {
  17066. if (util.isUndefined(themeConfig[key])) {
  17067. errors.push(key);
  17068. } else {
  17069. this._map.set(key, style);
  17070. common.set(this, key, style);
  17071. }
  17072. }, this);
  17073. // apply missing styles which have to be default
  17074. util.forEach(themeConfig, function(style, key) {
  17075. if (!this.getStyle(key)) {
  17076. this._map.set(key, style);
  17077. common.set(this, key, style);
  17078. }
  17079. }, this);
  17080. return errors;
  17081. };
  17082. /**
  17083. * Delete all styles
  17084. */
  17085. Theme.prototype.clear = function() {
  17086. var keys = this._map.keys();
  17087. var categories = {};
  17088. util.forEach(keys, function(key) {
  17089. var category = key.split('.')[0];
  17090. if (!categories[category]) {
  17091. categories[category] = category;
  17092. }
  17093. });
  17094. util.forEach(categories, function(child) {
  17095. delete this[child];
  17096. }, this);
  17097. this._map.removeAll();
  17098. };
  17099. module.exports = Theme;
  17100. /***/ }),
  17101. /***/ "./src/js/theme/themeConfig.js":
  17102. /*!*************************************!*\
  17103. !*** ./src/js/theme/themeConfig.js ***!
  17104. \*************************************/
  17105. /*! no static exports found */
  17106. /***/ (function(module, exports, __webpack_require__) {
  17107. "use strict";
  17108. /**
  17109. * @fileoverview The all configuration of a theme
  17110. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  17111. */
  17112. /**
  17113. * Full configuration for theme.
  17114. * "common" prefix is for entire calendar. "common" properties can be overriden by "week", "month".
  17115. * "week" prefix is for weekly and daily view.
  17116. * "month" prefix is for monthly view.
  17117. * @typedef {object} themeConfig
  17118. * @example
  17119. // default keys and styles
  17120. var themeConfig = {
  17121. 'common.border': '1px solid #e5e5e5',
  17122. 'common.backgroundColor': 'white',
  17123. 'common.holiday.color': '#ff4040',
  17124. 'common.saturday.color': '#333',
  17125. 'common.dayname.color': '#333',
  17126. 'common.today.color': '#333',
  17127. // creation guide style
  17128. 'common.creationGuide.backgroundColor': 'rgba(81, 92, 230, 0.05)',
  17129. 'common.creationGuide.border': '1px solid #515ce6',
  17130. // month header 'dayname'
  17131. 'month.dayname.height': '31px',
  17132. 'month.dayname.borderLeft': '1px solid #e5e5e5',
  17133. 'month.dayname.paddingLeft': '10px',
  17134. 'month.dayname.paddingRight': '10px',
  17135. 'month.dayname.backgroundColor': 'inherit',
  17136. 'month.dayname.fontSize': '12px',
  17137. 'month.dayname.fontWeight': 'normal',
  17138. 'month.dayname.textAlign': 'left',
  17139. // month day grid cell 'day'
  17140. 'month.holidayExceptThisMonth.color': 'rgba(255, 64, 64, 0.4)',
  17141. 'month.dayExceptThisMonth.color': 'rgba(51, 51, 51, 0.4)',
  17142. 'month.weekend.backgroundColor': 'inherit',
  17143. 'month.day.fontSize': '14px',
  17144. // month schedule style
  17145. 'month.schedule.borderRadius': '2px',
  17146. 'month.schedule.height': '24px',
  17147. 'month.schedule.marginTop': '2px',
  17148. 'month.schedule.marginLeft': '8px',
  17149. 'month.schedule.marginRight': '8px',
  17150. // month more view
  17151. 'month.moreView.border': '1px solid #d5d5d5',
  17152. 'month.moreView.boxShadow': '0 2px 6px 0 rgba(0, 0, 0, 0.1)',
  17153. 'month.moreView.backgroundColor': 'white',
  17154. 'month.moreView.paddingBottom': '17px',
  17155. 'month.moreViewTitle.height': '44px',
  17156. 'month.moreViewTitle.marginBottom': '12px',
  17157. 'month.moreViewTitle.backgroundColor': 'inherit',
  17158. 'month.moreViewTitle.borderBottom': 'none',
  17159. 'month.moreViewTitle.padding': '12px 17px 0 17px',
  17160. 'month.moreViewList.padding': '0 17px',
  17161. // week header 'dayname'
  17162. 'week.dayname.height': '42px',
  17163. 'week.dayname.borderTop': '1px solid #e5e5e5',
  17164. 'week.dayname.borderBottom': '1px solid #e5e5e5',
  17165. 'week.dayname.borderLeft': 'inherit',
  17166. 'week.dayname.paddingLeft': '0',
  17167. 'week.dayname.backgroundColor': 'inherit',
  17168. 'week.dayname.textAlign': 'left',
  17169. 'week.today.color': '#333',
  17170. 'week.pastDay.color': '#bbb',
  17171. // week vertical panel 'vpanel'
  17172. 'week.vpanelSplitter.border': '1px solid #e5e5e5',
  17173. 'week.vpanelSplitter.height': '3px',
  17174. // week daygrid 'daygrid'
  17175. 'week.daygrid.borderRight': '1px solid #e5e5e5',
  17176. 'week.daygrid.backgroundColor': 'inherit',
  17177. 'week.daygridLeft.width': '72px',
  17178. 'week.daygridLeft.backgroundColor': 'inherit',
  17179. 'week.daygridLeft.paddingRight': '8px',
  17180. 'week.daygridLeft.borderRight': '1px solid #e5e5e5',
  17181. 'week.today.backgroundColor': 'rgba(81, 92, 230, 0.05)',
  17182. 'week.weekend.backgroundColor': 'inherit',
  17183. // week timegrid 'timegrid'
  17184. 'week.timegridLeft.width': '72px',
  17185. 'week.timegridLeft.backgroundColor': 'inherit',
  17186. 'week.timegridLeft.borderRight': '1px solid #e5e5e5',
  17187. 'week.timegridLeft.fontSize': '11px',
  17188. 'week.timegridLeftTimezoneLabel.height': '40px',
  17189. 'week.timegridLeftAdditionalTimezone.backgroundColor': 'white',
  17190. 'week.timegridOneHour.height': '52px',
  17191. 'week.timegridHalfHour.height': '26px',
  17192. 'week.timegridHalfHour.borderBottom': 'none',
  17193. 'week.timegridHorizontalLine.borderBottom': '1px solid #e5e5e5',
  17194. 'week.timegrid.paddingRight': '8px',
  17195. 'week.timegrid.borderRight': '1px solid #e5e5e5',
  17196. 'week.timegridSchedule.borderRadius': '2px',
  17197. 'week.timegridSchedule.paddingLeft': '2px',
  17198. 'week.currentTime.color': '#515ce6',
  17199. 'week.currentTime.fontSize': '11px',
  17200. 'week.currentTime.fontWeight': 'normal',
  17201. 'week.pastTime.color': '#bbb',
  17202. 'week.pastTime.fontWeight': 'normal',
  17203. 'week.futureTime.color': '#333',
  17204. 'week.futureTime.fontWeight': 'normal',
  17205. 'week.currentTimeLinePast.border': '1px dashed #515ce6',
  17206. 'week.currentTimeLineBullet.backgroundColor': '#515ce6',
  17207. 'week.currentTimeLineToday.border': '1px solid #515ce6',
  17208. 'week.currentTimeLineFuture.border': 'none',
  17209. // week creation guide style
  17210. 'week.creationGuide.color': '#515ce6',
  17211. 'week.creationGuide.fontSize': '11px',
  17212. 'week.creationGuide.fontWeight': 'bold',
  17213. // week daygrid schedule style
  17214. 'week.dayGridSchedule.borderRadius': '2px',
  17215. 'week.dayGridSchedule.height': '24px',
  17216. 'week.dayGridSchedule.marginTop': '2px',
  17217. 'week.dayGridSchedule.marginLeft': '8px',
  17218. 'week.dayGridSchedule.marginRight': '8px'
  17219. };
  17220. */
  17221. var themeConfig = {
  17222. 'common.border': '1px solid #e5e5e5',
  17223. 'common.backgroundColor': 'white',
  17224. 'common.holiday.color': '#ff4040',
  17225. 'common.saturday.color': '#333',
  17226. 'common.dayname.color': '#333',
  17227. 'common.today.color': '#333',
  17228. // creation guide style
  17229. 'common.creationGuide.backgroundColor': 'rgba(81, 92, 230, 0.05)',
  17230. 'common.creationGuide.border': '1px solid #515ce6',
  17231. // month header 'dayname'
  17232. 'month.dayname.height': '31px',
  17233. 'month.dayname.borderLeft': '1px solid #e5e5e5',
  17234. 'month.dayname.paddingLeft': '10px',
  17235. 'month.dayname.paddingRight': '10px',
  17236. 'month.dayname.backgroundColor': 'inherit',
  17237. 'month.dayname.fontSize': '12px',
  17238. 'month.dayname.fontWeight': 'normal',
  17239. 'month.dayname.textAlign': 'left',
  17240. // month day grid cell 'day'
  17241. 'month.holidayExceptThisMonth.color': 'rgba(255, 64, 64, 0.4)',
  17242. 'month.dayExceptThisMonth.color': 'rgba(51, 51, 51, 0.4)',
  17243. 'month.weekend.backgroundColor': 'inherit',
  17244. 'month.day.fontSize': '14px',
  17245. // month schedule style
  17246. 'month.schedule.borderRadius': '2px',
  17247. 'month.schedule.height': '24px',
  17248. 'month.schedule.marginTop': '2px',
  17249. 'month.schedule.marginLeft': '8px',
  17250. 'month.schedule.marginRight': '8px',
  17251. // month more view
  17252. 'month.moreView.border': '1px solid #d5d5d5',
  17253. 'month.moreView.boxShadow': '0 2px 6px 0 rgba(0, 0, 0, 0.1)',
  17254. 'month.moreView.backgroundColor': 'white',
  17255. 'month.moreView.paddingBottom': '17px',
  17256. 'month.moreViewTitle.height': '44px',
  17257. 'month.moreViewTitle.marginBottom': '12px',
  17258. 'month.moreViewTitle.backgroundColor': 'inherit',
  17259. 'month.moreViewTitle.borderBottom': 'none',
  17260. 'month.moreViewTitle.padding': '12px 17px 0 17px',
  17261. 'month.moreViewList.padding': '0 17px',
  17262. // week header 'dayname'
  17263. 'week.dayname.height': '42px',
  17264. 'week.dayname.borderTop': '1px solid #e5e5e5',
  17265. 'week.dayname.borderBottom': '1px solid #e5e5e5',
  17266. 'week.dayname.borderLeft': 'inherit',
  17267. 'week.dayname.paddingLeft': '0',
  17268. 'week.dayname.backgroundColor': 'inherit',
  17269. 'week.dayname.textAlign': 'left',
  17270. 'week.today.color': '#333',
  17271. 'week.pastDay.color': '#bbb',
  17272. // week vertical panel 'vpanel'
  17273. 'week.vpanelSplitter.border': '1px solid #e5e5e5',
  17274. 'week.vpanelSplitter.height': '3px',
  17275. // week daygrid 'daygrid'
  17276. 'week.daygrid.borderRight': '1px solid #e5e5e5',
  17277. 'week.daygrid.backgroundColor': 'inherit',
  17278. 'week.daygridLeft.width': '72px',
  17279. 'week.daygridLeft.backgroundColor': 'inherit',
  17280. 'week.daygridLeft.paddingRight': '8px',
  17281. 'week.daygridLeft.borderRight': '1px solid #e5e5e5',
  17282. 'week.today.backgroundColor': 'rgba(81, 92, 230, 0.05)',
  17283. 'week.weekend.backgroundColor': 'inherit',
  17284. // week timegrid 'timegrid'
  17285. 'week.timegridLeft.width': '72px',
  17286. 'week.timegridLeft.backgroundColor': 'inherit',
  17287. 'week.timegridLeft.borderRight': '1px solid #e5e5e5',
  17288. 'week.timegridLeft.fontSize': '11px',
  17289. 'week.timegridLeftTimezoneLabel.height': '40px',
  17290. 'week.timegridLeftAdditionalTimezone.backgroundColor': 'white',
  17291. 'week.timegridOneHour.height': '52px',
  17292. 'week.timegridHalfHour.height': '26px',
  17293. 'week.timegridHalfHour.borderBottom': 'none',
  17294. 'week.timegridHorizontalLine.borderBottom': '1px solid #e5e5e5',
  17295. 'week.timegrid.paddingRight': '8px',
  17296. 'week.timegrid.borderRight': '1px solid #e5e5e5',
  17297. 'week.timegridSchedule.borderRadius': '2px',
  17298. 'week.timegridSchedule.paddingLeft': '2px',
  17299. 'week.currentTime.color': '#515ce6',
  17300. 'week.currentTime.fontSize': '11px',
  17301. 'week.currentTime.fontWeight': 'normal',
  17302. 'week.pastTime.color': '#bbb',
  17303. 'week.pastTime.fontWeight': 'normal',
  17304. 'week.futureTime.color': '#333',
  17305. 'week.futureTime.fontWeight': 'normal',
  17306. 'week.currentTimeLinePast.border': '1px dashed #515ce6',
  17307. 'week.currentTimeLineBullet.backgroundColor': '#515ce6',
  17308. 'week.currentTimeLineToday.border': '1px solid #515ce6',
  17309. 'week.currentTimeLineFuture.border': 'none',
  17310. // week creation guide style
  17311. 'week.creationGuide.color': '#515ce6',
  17312. 'week.creationGuide.fontSize': '11px',
  17313. 'week.creationGuide.fontWeight': 'bold',
  17314. // week daygrid schedule style
  17315. 'week.dayGridSchedule.borderRadius': '2px',
  17316. 'week.dayGridSchedule.height': '24px',
  17317. 'week.dayGridSchedule.marginTop': '2px',
  17318. 'week.dayGridSchedule.marginLeft': '8px',
  17319. 'week.dayGridSchedule.marginRight': '8px'
  17320. };
  17321. module.exports = themeConfig;
  17322. /***/ }),
  17323. /***/ "./src/js/view/layout.js":
  17324. /*!*******************************!*\
  17325. !*** ./src/js/view/layout.js ***!
  17326. \*******************************/
  17327. /*! no static exports found */
  17328. /***/ (function(module, exports, __webpack_require__) {
  17329. "use strict";
  17330. /**
  17331. * @fileoverview Layout view. wrap all view containers at outside.
  17332. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  17333. */
  17334. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  17335. var config = __webpack_require__(/*! ../config */ "./src/js/config.js");
  17336. var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js");
  17337. var Collection = __webpack_require__(/*! ../common/collection */ "./src/js/common/collection.js");
  17338. var View = __webpack_require__(/*! ./view */ "./src/js/view/view.js");
  17339. /**
  17340. * Layout view for toggle each child view. It will controlled via navigation UI.
  17341. * @constructor
  17342. * @extends {View}
  17343. * @param {HTMLElement} container Container element to use layout view.
  17344. * @param {Theme} theme - theme instance
  17345. */
  17346. function Layout(container, theme) {
  17347. container = domutil.appendHTMLElement('div', container, config.classname('layout'));
  17348. /**
  17349. * @type {HTMLElement}
  17350. */
  17351. this.container = container;
  17352. /*eslint-disable*/
  17353. /**
  17354. * @type {Collection} Child view collection.
  17355. */
  17356. this.children = new Collection(function(childView) {
  17357. return childView.viewName;
  17358. });
  17359. /* eslint-enable*/
  17360. /**
  17361. * @type {Theme}
  17362. */
  17363. this.theme = theme;
  17364. this.applyTheme();
  17365. }
  17366. util.inherit(Layout, View);
  17367. /**
  17368. * Clear child views.
  17369. */
  17370. Layout.prototype.clear = function() {
  17371. this.children.each(function(childView) {
  17372. childView.destroy();
  17373. });
  17374. this.children.clear();
  17375. this.container.innerHTML = '';
  17376. };
  17377. /**
  17378. * Remove child view.
  17379. * @override
  17380. * @param {(string|View)} viewName - name of view or instance.
  17381. */
  17382. Layout.prototype.removeChild = function(viewName) {
  17383. this.children.remove(viewName);
  17384. };
  17385. /**
  17386. * Toggle child views.
  17387. * @param {string} viewName - Name of view.
  17388. */
  17389. Layout.prototype.toggleChildView = function(viewName) {
  17390. var container,
  17391. prefix = ['add', 'remove'],
  17392. flag;
  17393. this.children.each(function(childView) {
  17394. container = childView.container;
  17395. flag = Number(childView.viewName === viewName);
  17396. domutil[prefix[flag] + 'Class'](container, config.classname('hidden'));
  17397. });
  17398. };
  17399. Layout.prototype.applyTheme = function() {
  17400. var style = this.container.style;
  17401. var theme = this.theme.common;
  17402. // background color
  17403. style.backgroundColor = theme.backgroundColor;
  17404. };
  17405. module.exports = Layout;
  17406. /***/ }),
  17407. /***/ "./src/js/view/month/month.js":
  17408. /*!************************************!*\
  17409. !*** ./src/js/view/month/month.js ***!
  17410. \************************************/
  17411. /*! no static exports found */
  17412. /***/ (function(module, exports, __webpack_require__) {
  17413. "use strict";
  17414. /**
  17415. * @fileoverview Month view
  17416. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  17417. */
  17418. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  17419. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
  17420. datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
  17421. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
  17422. TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date,
  17423. tmpl = __webpack_require__(/*! ../template/month/month.hbs */ "./src/js/view/template/month/month.hbs"),
  17424. View = __webpack_require__(/*! ../view */ "./src/js/view/view.js"),
  17425. VLayout = __webpack_require__(/*! ../..//common/vlayout */ "./src/js/common/vlayout.js"),
  17426. WeekdayInMonth = __webpack_require__(/*! ./weekdayInMonth */ "./src/js/view/month/weekdayInMonth.js");
  17427. var mmin = Math.min;
  17428. /**
  17429. * @constructor
  17430. * @extends {View}
  17431. * @param {object} options - options
  17432. * @param {function} [options.scheduleFilter] - schedule filter
  17433. * @param {number} [options.startDayOfWeek=0] - start day of week
  17434. * @param {string} [options.renderMonth='2015-12'] - render month
  17435. * @param {string[]} [options.daynames] - daynames to use upside of month view
  17436. * @param {HTMLElement} container - container element
  17437. * @param {Base.Month} controller - controller instance
  17438. */
  17439. function Month(options, container, controller) {
  17440. var theme = controller ? controller.theme : null;
  17441. var monthOption;
  17442. options = options || {};
  17443. monthOption = options ? options.month : {};
  17444. View.call(this, container);
  17445. /**
  17446. * @type {Base.Month}
  17447. */
  17448. this.controller = controller;
  17449. /**
  17450. * @type {VLayout}
  17451. */
  17452. this.vLayout = new VLayout({
  17453. panels: [
  17454. {height: parseInt(controller.theme.month.dayname.height, 10) || 42},
  17455. {autoHeight: true}
  17456. ]
  17457. }, container, theme);
  17458. /**
  17459. * @type {string}
  17460. */
  17461. this.options = util.extend({
  17462. scheduleFilter: function(schedule) {
  17463. return Boolean(schedule.isVisible);
  17464. },
  17465. startDayOfWeek: 0,
  17466. renderMonth: '2018-01',
  17467. daynames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
  17468. narrowWeekend: false,
  17469. visibleWeeksCount: null,
  17470. isAlways6Week: true,
  17471. isReadOnly: options.isReadOnly,
  17472. grid: {
  17473. header: {
  17474. height: 34
  17475. },
  17476. footer: {
  17477. height: 3
  17478. }
  17479. }
  17480. }, monthOption);
  17481. this.options.grid.header = util.extend({
  17482. height: 34
  17483. }, util.pick(monthOption, 'grid', 'header'));
  17484. this.options.grid.footer = util.extend({
  17485. height: 3
  17486. }, util.pick(monthOption, 'grid', 'footer'));
  17487. /**
  17488. * horizontal grid information
  17489. * @type {Object}
  17490. */
  17491. this.grids = datetime.getGridLeftAndWidth(
  17492. this.options.daynames.length,
  17493. this.options.narrowWeekend,
  17494. this.options.startDayOfWeek);
  17495. }
  17496. util.inherit(Month, View);
  17497. /**
  17498. * Name of view. for managing subview at layout view
  17499. * @type {string}
  17500. */
  17501. Month.prototype.viewName = 'month';
  17502. /**
  17503. * Get calendar array by supplied date
  17504. * @param {string} renderMonth - month to render YYYY-MM, weeks2/3 to render YYYY-MM-DD
  17505. * @returns {array.<Date[]>} calendar array
  17506. */
  17507. Month.prototype._getMonthCalendar = function(renderMonth) {
  17508. var date = new TZDate(renderMonth);
  17509. var startDayOfWeek = this.options.startDayOfWeek || 0;
  17510. var visibleWeeksCount = mmin(this.options.visibleWeeksCount || 0, 6);
  17511. var workweek = this.options.workweek || false;
  17512. var datetimeOptions, calendar;
  17513. if (this.options.visibleWeeksCount) {
  17514. datetimeOptions = {
  17515. startDayOfWeek: startDayOfWeek,
  17516. isAlways6Week: false,
  17517. visibleWeeksCount: visibleWeeksCount,
  17518. workweek: workweek
  17519. };
  17520. } else {
  17521. datetimeOptions = {
  17522. startDayOfWeek: startDayOfWeek,
  17523. isAlways6Week: this.options.isAlways6Week,
  17524. workweek: workweek
  17525. };
  17526. }
  17527. calendar = datetime.arr2dCalendar(date, datetimeOptions);
  17528. return calendar;
  17529. };
  17530. /**
  17531. * Create children view (week) and add children
  17532. * @param {HTMLElement} container - container element to render weeks
  17533. * @param {array.<Date[]>} calendar - calendar array from datetime#arr2dCalendar
  17534. * @param {Theme} theme - theme instance
  17535. */
  17536. Month.prototype._renderChildren = function(container, calendar, theme) {
  17537. var self = this;
  17538. var weekCount = calendar.length;
  17539. var heightPercent = 100 / weekCount;
  17540. var opt = this.options;
  17541. var renderMonth = opt.renderMonth;
  17542. var narrowWeekend = opt.narrowWeekend;
  17543. var startDayOfWeek = opt.startDayOfWeek;
  17544. var visibleWeeksCount = opt.visibleWeeksCount;
  17545. var visibleScheduleCount = opt.visibleScheduleCount;
  17546. var gridOption = opt.grid;
  17547. var isReadOnly = opt.isReadOnly;
  17548. container.innerHTML = '';
  17549. this.children.clear();
  17550. util.forEach(calendar, function(weekArr) {
  17551. var start = new TZDate(weekArr[0]),
  17552. end = new TZDate(weekArr[weekArr.length - 1]),
  17553. weekdayViewContainer,
  17554. weekdayView;
  17555. weekdayViewContainer = domutil.appendHTMLElement(
  17556. 'div', container, config.classname('month-week-item'));
  17557. weekdayView = new WeekdayInMonth({
  17558. renderMonth: renderMonth,
  17559. heightPercent: heightPercent,
  17560. renderStartDate: start,
  17561. renderEndDate: end,
  17562. narrowWeekend: narrowWeekend,
  17563. startDayOfWeek: startDayOfWeek,
  17564. visibleWeeksCount: visibleWeeksCount,
  17565. visibleScheduleCount: visibleScheduleCount,
  17566. grid: gridOption,
  17567. scheduleHeight: parseInt(theme.month.schedule.height, 10),
  17568. scheduleGutter: parseInt(theme.month.schedule.marginTop, 10),
  17569. isReadOnly: isReadOnly
  17570. }, weekdayViewContainer);
  17571. self.addChild(weekdayView);
  17572. });
  17573. };
  17574. /**
  17575. * Render month view
  17576. * @override
  17577. */
  17578. Month.prototype.render = function() {
  17579. var self = this,
  17580. opt = this.options,
  17581. vLayout = this.vLayout,
  17582. controller = this.controller,
  17583. daynames = opt.daynames,
  17584. workweek = opt.workweek,
  17585. calendar = this._getMonthCalendar(opt.renderMonth),
  17586. scheduleFilter = opt.scheduleFilter,
  17587. theme = controller ? controller.theme : null,
  17588. styles = this._getStyles(theme),
  17589. grids,
  17590. daynameViewModel,
  17591. baseViewModel;
  17592. grids = this.grids = datetime.getGridLeftAndWidth(
  17593. opt.daynames.length,
  17594. opt.narrowWeekend,
  17595. opt.startDayOfWeek
  17596. );
  17597. daynameViewModel = util.map(
  17598. util.range(opt.startDayOfWeek, 7).concat(util.range(7)).slice(0, 7),
  17599. function(day, index) {
  17600. return {
  17601. day: day,
  17602. label: daynames[day],
  17603. width: grids[index] ? grids[index].width : 0,
  17604. left: grids[index] ? grids[index].left : 0,
  17605. color: this._getDayNameColor(theme, day)
  17606. };
  17607. },
  17608. this
  17609. );
  17610. if (workweek) {
  17611. grids = this.grids = datetime.getGridLeftAndWidth(5, opt.narrowWeekend, opt.startDayOfWeek, workweek);
  17612. daynameViewModel = util.filter(daynameViewModel, function(daynameModel) {
  17613. return !datetime.isWeekend(daynameModel.day);
  17614. });
  17615. util.forEach(daynameViewModel, function(daynameModel, index) {
  17616. daynameModel.width = grids[index] ? grids[index].width : 0;
  17617. daynameModel.left = grids[index] ? grids[index].left : 0;
  17618. });
  17619. }
  17620. baseViewModel = {
  17621. daynames: daynameViewModel,
  17622. styles: styles
  17623. };
  17624. vLayout.panels[0].container.innerHTML = tmpl(baseViewModel);
  17625. this._renderChildren(vLayout.panels[1].container, calendar, theme);
  17626. baseViewModel.panelHeight = vLayout.panels[1].getHeight();
  17627. this.children.each(function(childView) {
  17628. var start = datetime.start(childView.options.renderStartDate);
  17629. var end = datetime.start(childView.options.renderEndDate);
  17630. var eventsInDateRange = controller.findByDateRange(
  17631. datetime.start(start),
  17632. datetime.end(end),
  17633. scheduleFilter
  17634. );
  17635. var dateRange = datetime.range(
  17636. datetime.start(start),
  17637. datetime.end(end),
  17638. datetime.MILLISECONDS_PER_DAY);
  17639. var viewModel = {
  17640. eventsInDateRange: eventsInDateRange,
  17641. range: dateRange.slice(0, grids.length),
  17642. grids: grids,
  17643. panelHeight: baseViewModel.panelHeight,
  17644. theme: theme
  17645. };
  17646. childView.render(viewModel);
  17647. self._invokeAfterRenderSchedule(eventsInDateRange);
  17648. });
  17649. };
  17650. /**
  17651. * Fire 'afterRenderSchedule' event
  17652. * @param {Array} matrices - schedule matrices from view model
  17653. * @fires Month#afterRenderSchedule
  17654. */
  17655. Month.prototype._invokeAfterRenderSchedule = function(matrices) {
  17656. var self = this;
  17657. util.forEachArray(matrices, function(matrix) {
  17658. util.forEachArray(matrix, function(column) {
  17659. util.forEachArray(column, function(scheduleViewModel) {
  17660. if (scheduleViewModel && !scheduleViewModel.hidden) {
  17661. /**
  17662. * @event Month#afterRenderSchedule
  17663. */
  17664. self.fire('afterRenderSchedule', {schedule: scheduleViewModel.model});
  17665. }
  17666. });
  17667. });
  17668. });
  17669. };
  17670. /**
  17671. * Get the styles from theme
  17672. * @param {Theme} theme - theme instance
  17673. * @returns {object} styles - styles object
  17674. */
  17675. Month.prototype._getStyles = function(theme) {
  17676. var styles = {};
  17677. var dayname;
  17678. if (theme) {
  17679. dayname = theme.month.dayname;
  17680. styles.borderTop = dayname.borderTop || theme.common.border;
  17681. styles.borderLeft = dayname.borderLeft || theme.common.border;
  17682. styles.height = dayname.height;
  17683. styles.paddingLeft = dayname.paddingLeft;
  17684. styles.paddingRight = dayname.paddingRight;
  17685. styles.fontSize = dayname.fontSize;
  17686. styles.backgroundColor = dayname.backgroundColor;
  17687. styles.fontWeight = dayname.fontWeight;
  17688. styles.textAlign = dayname.textAlign;
  17689. }
  17690. return styles;
  17691. };
  17692. /**
  17693. * Get a day name color
  17694. * @param {Theme} theme - theme instance
  17695. * @param {number} day - day number
  17696. * @returns {string} style - color style
  17697. */
  17698. Month.prototype._getDayNameColor = function(theme, day) {
  17699. var color = '';
  17700. if (theme) {
  17701. if (day === 0) {
  17702. color = theme.common.holiday.color;
  17703. } else if (day === 6) {
  17704. color = theme.common.saturday.color;
  17705. } else {
  17706. color = theme.common.dayname.color;
  17707. }
  17708. }
  17709. return color;
  17710. };
  17711. module.exports = Month;
  17712. /***/ }),
  17713. /***/ "./src/js/view/month/more.js":
  17714. /*!***********************************!*\
  17715. !*** ./src/js/view/month/more.js ***!
  17716. \***********************************/
  17717. /*! no static exports found */
  17718. /***/ (function(module, exports, __webpack_require__) {
  17719. "use strict";
  17720. /**
  17721. * @fileoverview Floating layer for displaying schedule in specific date
  17722. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  17723. */
  17724. var OUT_PADDING = 5;
  17725. var VIEW_MIN_WIDTH = 280;
  17726. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  17727. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
  17728. domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js"),
  17729. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
  17730. View = __webpack_require__(/*! ../../view/view */ "./src/js/view/view.js"),
  17731. FloatingLayer = __webpack_require__(/*! ../../common/floatingLayer */ "./src/js/common/floatingLayer.js"),
  17732. common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js"),
  17733. tmpl = __webpack_require__(/*! ../template/month/more.hbs */ "./src/js/view/template/month/more.hbs");
  17734. /**
  17735. * @constructor
  17736. * @extends {View}
  17737. * @param {object} options - options
  17738. * @param {object} [options.moreLayerSize] - more layer size
  17739. * @param {object} [options.moreLayerSize.width=null] - css width value(px, auto).
  17740. * The default value 'null' is to fit a grid cell.
  17741. * @param {object} [options.moreLayerSize.height=null] - css height value(px, auto).
  17742. * The default value 'null' is to fit a grid cell.
  17743. * @param {HTMLElement} container = container element
  17744. * @param {Theme} theme - theme instance
  17745. */
  17746. function More(options, container, theme) {
  17747. View.call(this, container);
  17748. /**
  17749. * @type {FloatingLayer}
  17750. */
  17751. this.layer = new FloatingLayer(null, container);
  17752. /**
  17753. * cached view model
  17754. * @type {object}
  17755. */
  17756. this._viewModel = null;
  17757. /**
  17758. * @type {object}
  17759. */
  17760. this.options = util.extend({
  17761. moreLayerSize: {
  17762. width: null,
  17763. height: null
  17764. },
  17765. scheduleHeight: parseInt(theme.month.schedule.height, 10) || 18,
  17766. scheduleGutter: parseInt(theme.month.schedule.marginTop, 10) || 2,
  17767. scheduleBulletTop: (parseInt(theme.month.schedule.height, 10) || 18) / 3,
  17768. borderRadius: theme.month.schedule.borderRadius
  17769. }, options);
  17770. /**
  17771. * @type {Theme}
  17772. */
  17773. this.theme = theme;
  17774. domevent.on(container, 'click', this._onClick, this);
  17775. }
  17776. util.inherit(More, View);
  17777. /**
  17778. * Click event handler for close button
  17779. * @param {MouseEvent} clickEvent - mouse event object
  17780. */
  17781. More.prototype._onClick = function(clickEvent) {
  17782. var target = domevent.getEventTarget(clickEvent);
  17783. var className = config.classname('month-more-close');
  17784. if (!domutil.hasClass(target, className) && !domutil.closest(target, '.' + className)) {
  17785. return;
  17786. }
  17787. this.hide();
  17788. };
  17789. /**
  17790. * Mousedown event handler for hiding more layer when user mousedown outside of
  17791. * layer
  17792. * @param {MouseEvent} mouseDownEvent - mouse event object
  17793. */
  17794. More.prototype._onMouseDown = function(mouseDownEvent) {
  17795. var target = domevent.getEventTarget(mouseDownEvent),
  17796. moreLayer = domutil.closest(target, config.classname('.month-more'));
  17797. if (moreLayer) {
  17798. return;
  17799. }
  17800. this.hide();
  17801. };
  17802. /**
  17803. * Get new position for more layer by +n element itself
  17804. * @param {HTMLElement} target - parent grid-line element of +n element
  17805. * @param {HTMLElement} weekItem - weekItem container element
  17806. * @returns {number[]} new position of more layer
  17807. */
  17808. More.prototype._getRenderPosition = function(target, weekItem) {
  17809. var pos = domevent.getMousePosition({
  17810. clientX: domutil.getPosition(target)[0],
  17811. clientY: domutil.getPosition(weekItem)[1]
  17812. }, this.container);
  17813. var containerSize = domutil.getSize(this.container);
  17814. var left = pos[0] - OUT_PADDING;
  17815. var top = pos[1] - OUT_PADDING;
  17816. left = common.ratio(containerSize[0], 100, left);
  17817. top = common.ratio(containerSize[1], 100, top);
  17818. return [left, top];
  17819. };
  17820. /**
  17821. * @override
  17822. */
  17823. More.prototype.destroy = function() {
  17824. this.layer.destroy();
  17825. this.layer = null;
  17826. domevent.off(this.container, 'click', this._onClick, this);
  17827. domevent.off(document.body, 'mousedown', this._onMouseDown, this);
  17828. View.prototype.destroy.call(this);
  17829. };
  17830. /**
  17831. * @override
  17832. * @param {object} viewModel - view model from factory/monthView
  17833. */
  17834. More.prototype.render = function(viewModel) {
  17835. var target = domutil.closest(viewModel.target, config.classname('.weekday-grid-line'));
  17836. var weekItem = domutil.closest(target, config.classname('.month-week-item'));
  17837. var layer = this.layer;
  17838. var self = this;
  17839. var pos = this._getRenderPosition(target, weekItem);
  17840. var minHeight = domutil.getSize(weekItem)[1] + (OUT_PADDING * 2);
  17841. var width = target.offsetWidth + (OUT_PADDING * 2);
  17842. var opt = this.options;
  17843. var optMoreLayerSize = opt.moreLayerSize;
  17844. var styles = this._getStyles(this.theme);
  17845. var maxVisibleSchedulesInLayer = 10;
  17846. var height = '';
  17847. var containerSize = domutil.getSize(this.container);
  17848. var calWidth = 0;
  17849. var calHeight = 0;
  17850. var isOverWidth = false;
  17851. var isOverHeight = false;
  17852. var leftPos = pos[0];
  17853. var topPos = pos[1];
  17854. this._viewModel = util.extend(viewModel, {
  17855. scheduleGutter: opt.scheduleGutter,
  17856. scheduleHeight: opt.scheduleHeight,
  17857. scheduleBulletTop: opt.scheduleBulletTop,
  17858. borderRadius: opt.borderRadius,
  17859. styles: styles
  17860. });
  17861. width = Math.max(width, VIEW_MIN_WIDTH);
  17862. height = parseInt(styles.titleHeight, 10);
  17863. height += parseInt(styles.titleMarginBottom, 10);
  17864. if (viewModel.schedules.length <= maxVisibleSchedulesInLayer) {
  17865. height += (opt.scheduleGutter + opt.scheduleHeight) * viewModel.schedules.length;
  17866. } else {
  17867. height += (opt.scheduleGutter + opt.scheduleHeight) * maxVisibleSchedulesInLayer;
  17868. }
  17869. height += parseInt(styles.paddingBottom, 10);
  17870. height += OUT_PADDING; // for border
  17871. if (optMoreLayerSize.width) {
  17872. width = optMoreLayerSize.width;
  17873. }
  17874. if (optMoreLayerSize.height) {
  17875. height = optMoreLayerSize.height;
  17876. }
  17877. if (isNaN(height) || height < minHeight) {
  17878. height = minHeight;
  17879. }
  17880. layer.setContent(tmpl(viewModel));
  17881. calWidth = leftPos * containerSize[0] / 100;
  17882. calHeight = topPos * containerSize[1] / 100;
  17883. isOverWidth = calWidth + width >= containerSize[0];
  17884. isOverHeight = calHeight + height >= containerSize[1];
  17885. leftPos = leftPos + '%';
  17886. topPos = topPos + '%';
  17887. if (isOverWidth && isOverHeight) {
  17888. layer.setLTRB({
  17889. right: 0,
  17890. bottom: 0
  17891. });
  17892. } else if (!isOverWidth && isOverHeight) {
  17893. layer.setLTRB({
  17894. left: leftPos,
  17895. bottom: 0
  17896. });
  17897. } else if (isOverWidth && !isOverHeight) {
  17898. layer.setLTRB({
  17899. right: 0,
  17900. top: topPos
  17901. });
  17902. } else {
  17903. layer.setPosition(leftPos, topPos);
  17904. }
  17905. layer.setSize(width, height);
  17906. layer.show();
  17907. util.debounce(function() {
  17908. domevent.on(document.body, 'mousedown', self._onMouseDown, self);
  17909. })();
  17910. };
  17911. /**
  17912. * Hide layer
  17913. */
  17914. More.prototype.hide = function() {
  17915. this.layer.hide();
  17916. domevent.off(document.body, 'mousedown', this._onMouseDown, this);
  17917. };
  17918. /**
  17919. * refresh layer
  17920. */
  17921. More.prototype.refresh = function() {
  17922. if (this._viewModel) {
  17923. this.layer.setContent(tmpl(this._viewModel));
  17924. }
  17925. };
  17926. /**
  17927. * Return more layer root element
  17928. * @returns {HTMLElement} root element
  17929. */
  17930. More.prototype.getMoreViewElement = function() {
  17931. return domutil.find(config.classname('.month-more'), this.layer.container);
  17932. };
  17933. /**
  17934. * Get the styles from theme
  17935. * @param {Theme} theme - theme instance
  17936. * @returns {object} styles - styles object
  17937. */
  17938. More.prototype._getStyles = function(theme) {
  17939. var styles = {};
  17940. var listHeight = '';
  17941. if (theme) {
  17942. styles.border = theme.month.moreView.border || theme.common.border;
  17943. styles.boxShadow = theme.month.moreView.boxShadow;
  17944. styles.backgroundColor = theme.month.moreView.backgroundColor || theme.common.backgroundColor;
  17945. styles.paddingBottom = theme.month.moreView.paddingBottom;
  17946. styles.titleHeight = theme.month.moreViewTitle.height;
  17947. styles.titleMarginBottom = theme.month.moreViewTitle.marginBottom;
  17948. styles.titleBackgroundColor = theme.month.moreViewTitle.backgroundColor;
  17949. styles.titleBorderBottom = theme.month.moreViewTitle.borderBottom;
  17950. styles.titlePadding = theme.month.moreViewTitle.padding;
  17951. styles.listPadding = theme.month.moreViewList.padding;
  17952. listHeight = 'calc(100%';
  17953. if (parseInt(styles.titleHeight, 10)) {
  17954. listHeight += ' - ' + styles.titleHeight;
  17955. }
  17956. if (parseInt(styles.titleMarginBottom, 10)) {
  17957. listHeight += ' - ' + styles.titleMarginBottom;
  17958. }
  17959. listHeight += ')';
  17960. styles.listHeight = listHeight;
  17961. }
  17962. return styles;
  17963. };
  17964. module.exports = More;
  17965. /***/ }),
  17966. /***/ "./src/js/view/month/weekdayInMonth.js":
  17967. /*!*********************************************!*\
  17968. !*** ./src/js/view/month/weekdayInMonth.js ***!
  17969. \*********************************************/
  17970. /*! no static exports found */
  17971. /***/ (function(module, exports, __webpack_require__) {
  17972. "use strict";
  17973. /**
  17974. * @fileoverview Monthday in month view
  17975. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  17976. */
  17977. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  17978. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
  17979. common = __webpack_require__(/*! ../../common/common.js */ "./src/js/common/common.js"),
  17980. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
  17981. View = __webpack_require__(/*! ../../view/view */ "./src/js/view/view.js"),
  17982. Weekday = __webpack_require__(/*! ../weekday */ "./src/js/view/weekday.js"),
  17983. baseTmpl = __webpack_require__(/*! ../template/month/weekdayInMonth.hbs */ "./src/js/view/template/month/weekdayInMonth.hbs"),
  17984. scheduleTmpl = __webpack_require__(/*! ../template/month/weekdayInMonthSchedule.hbs */ "./src/js/view/template/month/weekdayInMonthSchedule.hbs");
  17985. var mfloor = Math.floor,
  17986. mmin = Math.min;
  17987. /**
  17988. * @constructor
  17989. * @extends {Weekday}
  17990. * @param {object} options - options for WeekdayInWeek view
  17991. * @param {number} [options.heightPercent] - height percent of view
  17992. * @param {number} [options.containerButtonGutter=8] - free space at bottom to
  17993. * make create easy.
  17994. * @param {number} [options.scheduleHeight=18] - height of each schedule block.
  17995. * @param {number} [options.scheduleGutter=2] - gutter height of each schedule block.
  17996. * @param {HTMLDIVElement} container - DOM element to use container for this
  17997. * view.
  17998. */
  17999. function WeekdayInMonth(options, container) {
  18000. Weekday.call(this, options, container);
  18001. container.style.height = options.heightPercent + '%';
  18002. }
  18003. util.inherit(WeekdayInMonth, Weekday);
  18004. /**
  18005. * Get schedule container element's bound properly by override
  18006. *
  18007. * View#getViewBound.
  18008. * @override
  18009. */
  18010. WeekdayInMonth.prototype.getViewBound = function() {
  18011. var bound = View.prototype.getViewBound.call(this);
  18012. return bound;
  18013. };
  18014. /**
  18015. * Get limit index of schedule block in current view
  18016. * @param {number} panelHeight - panel's height for pre-calculation
  18017. * @returns {number} limit index
  18018. */
  18019. WeekdayInMonth.prototype._getRenderLimitIndex = function(panelHeight) {
  18020. var opt = this.options;
  18021. var containerHeight = panelHeight || this.getViewBound().height;
  18022. var gridHeaderHeight = util.pick(opt, 'grid', 'header', 'height') || 0;
  18023. var gridFooterHeight = util.pick(opt, 'grid', 'footer', 'height') || 0;
  18024. var visibleScheduleCount = opt.visibleScheduleCount || 0;
  18025. var count;
  18026. containerHeight -= (gridHeaderHeight + gridFooterHeight);
  18027. count = mfloor(containerHeight / (opt.scheduleHeight + opt.scheduleGutter));
  18028. if (!visibleScheduleCount) {
  18029. visibleScheduleCount = count;
  18030. }
  18031. return mmin(count, visibleScheduleCount); // subtraction for '+n' label block
  18032. };
  18033. /**
  18034. * @override
  18035. * @param {object} viewModel - schedules view models
  18036. */
  18037. WeekdayInMonth.prototype.getBaseViewModel = function(viewModel) {
  18038. var opt = this.options,
  18039. gridHeaderHeight = util.pick(opt, 'grid', 'header', 'height') || 0,
  18040. gridFooterHeight = util.pick(opt, 'grid', 'footer', 'height') || 0,
  18041. renderLimitIdx = this._getRenderLimitIndex() + 1,
  18042. exceedDate = this.getExceedDate(renderLimitIdx, viewModel.eventsInDateRange, viewModel.range),
  18043. styles = this._getStyles(viewModel.theme);
  18044. var baseViewModel;
  18045. viewModel = util.extend({
  18046. exceedDate: exceedDate
  18047. }, viewModel);
  18048. baseViewModel = Weekday.prototype.getBaseViewModel.call(this, viewModel);
  18049. baseViewModel = util.extend({
  18050. matrices: viewModel.eventsInDateRange,
  18051. gridHeaderHeight: gridHeaderHeight,
  18052. gridFooterHeight: gridFooterHeight,
  18053. renderLimitIdx: renderLimitIdx,
  18054. isReadOnly: opt.isReadOnly,
  18055. styles: styles
  18056. }, baseViewModel);
  18057. return baseViewModel;
  18058. };
  18059. /**
  18060. * @override
  18061. * @param {object} viewModel - schedules view models
  18062. */
  18063. WeekdayInMonth.prototype.render = function(viewModel) {
  18064. var container = this.container,
  18065. baseViewModel = this.getBaseViewModel(viewModel),
  18066. scheduleContainer;
  18067. if (!this.options.visibleWeeksCount) {
  18068. setIsOtherMonthFlag(baseViewModel.dates, this.options.renderMonth, viewModel.theme);
  18069. }
  18070. container.innerHTML = baseTmpl(baseViewModel);
  18071. scheduleContainer = domutil.find(
  18072. config.classname('.weekday-schedules'),
  18073. container
  18074. );
  18075. if (!scheduleContainer) {
  18076. return;
  18077. }
  18078. scheduleContainer.innerHTML = scheduleTmpl(baseViewModel);
  18079. common.setAutoEllipsis(
  18080. config.classname('.weekday-schedule-title'),
  18081. container,
  18082. true
  18083. );
  18084. };
  18085. WeekdayInMonth.prototype._beforeDestroy = function() {
  18086. };
  18087. /**
  18088. * Get the styles from theme
  18089. * @param {Theme} theme - theme instance
  18090. * @returns {object} styles - styles object
  18091. */
  18092. WeekdayInMonth.prototype._getStyles = function(theme) {
  18093. var styles = {};
  18094. if (theme) {
  18095. styles.borderTop = theme.common.border;
  18096. styles.borderLeft = theme.common.border;
  18097. styles.fontSize = theme.month.day.fontSize;
  18098. styles.borderRadius = theme.month.schedule.borderRadius;
  18099. styles.marginLeft = theme.month.schedule.marginLeft;
  18100. styles.marginRight = theme.month.schedule.marginRight;
  18101. styles.scheduleBulletTop = this.options.scheduleHeight / 3;
  18102. }
  18103. return styles;
  18104. };
  18105. /**
  18106. * 현재 달이 아닌 날짜에 대해 isOtherMonth = true 플래그를 추가한다.
  18107. * @param {Array} dates - 날짜정보 배열
  18108. * @param {TZDate} renderMonth - 현재 렌더링중인 월 (YYYYMM)
  18109. * @param {Theme} theme - theme instance
  18110. */
  18111. function setIsOtherMonthFlag(dates, renderMonth, theme) {
  18112. var month = renderMonth.getMonth() + 1;
  18113. util.forEach(dates, function(dateObj) {
  18114. var isOtherMonth = dateObj.month !== month;
  18115. dateObj.isOtherMonth = isOtherMonth;
  18116. if (isOtherMonth) {
  18117. dateObj.color = Weekday.prototype._getDayNameColor(theme, dateObj.day, dateObj.isToday, isOtherMonth);
  18118. }
  18119. });
  18120. }
  18121. module.exports = WeekdayInMonth;
  18122. /***/ }),
  18123. /***/ "./src/js/view/popup/scheduleCreationPopup.js":
  18124. /*!****************************************************!*\
  18125. !*** ./src/js/view/popup/scheduleCreationPopup.js ***!
  18126. \****************************************************/
  18127. /*! no static exports found */
  18128. /***/ (function(module, exports, __webpack_require__) {
  18129. "use strict";
  18130. /**
  18131. * @fileoverview Floating layer for writing new schedules
  18132. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  18133. */
  18134. var View = __webpack_require__(/*! ../../view/view */ "./src/js/view/view.js");
  18135. var FloatingLayer = __webpack_require__(/*! ../../common/floatingLayer */ "./src/js/common/floatingLayer.js");
  18136. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  18137. var DatePicker = __webpack_require__(/*! tui-date-picker */ "tui-date-picker");
  18138. var timezone = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js");
  18139. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  18140. var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
  18141. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  18142. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  18143. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  18144. var tmpl = __webpack_require__(/*! ../template/popup/scheduleCreationPopup.hbs */ "./src/js/view/template/popup/scheduleCreationPopup.hbs");
  18145. var TZDate = timezone.Date;
  18146. var MAX_WEEK_OF_MONTH = 6;
  18147. /**
  18148. * @constructor
  18149. * @extends {View}
  18150. * @param {HTMLElement} container - container element
  18151. * @param {Array.<Calendar>} calendars - calendar list used to create new schedule
  18152. * @param {boolean} usageStatistics - GA tracking options in Calendar
  18153. */
  18154. function ScheduleCreationPopup(container, calendars, usageStatistics) {
  18155. View.call(this, container);
  18156. /**
  18157. * @type {FloatingLayer}
  18158. */
  18159. this.layer = new FloatingLayer(null, container);
  18160. /**
  18161. * cached view model
  18162. * @type {object}
  18163. */
  18164. this._viewModel = null;
  18165. this._selectedCal = null;
  18166. this._schedule = null;
  18167. this.calendars = calendars;
  18168. this._focusedDropdown = null;
  18169. this._usageStatistics = usageStatistics;
  18170. this._onClickListeners = [
  18171. this._selectDropdownMenuItem.bind(this),
  18172. this._toggleDropdownMenuView.bind(this),
  18173. this._closeDropdownMenuView.bind(this, null),
  18174. this._closePopup.bind(this),
  18175. this._toggleIsAllday.bind(this),
  18176. this._toggleIsPrivate.bind(this),
  18177. this._onClickSaveSchedule.bind(this)
  18178. ];
  18179. domevent.on(container, 'click', this._onClick, this);
  18180. }
  18181. util.inherit(ScheduleCreationPopup, View);
  18182. /**
  18183. * Mousedown event handler for hiding popup layer when user mousedown outside of
  18184. * layer
  18185. * @param {MouseEvent} mouseDownEvent - mouse event object
  18186. */
  18187. ScheduleCreationPopup.prototype._onMouseDown = function(mouseDownEvent) {
  18188. var target = domevent.getEventTarget(mouseDownEvent),
  18189. popupLayer = domutil.closest(target, config.classname('.floating-layer'));
  18190. if (popupLayer) {
  18191. return;
  18192. }
  18193. this.hide();
  18194. };
  18195. /**
  18196. * @override
  18197. */
  18198. ScheduleCreationPopup.prototype.destroy = function() {
  18199. this.layer.destroy();
  18200. this.layer = null;
  18201. domevent.off(this.container, 'click', this._onClick, this);
  18202. domevent.off(document.body, 'mousedown', this._onMouseDown, this);
  18203. View.prototype.destroy.call(this);
  18204. };
  18205. /**
  18206. * @override
  18207. * Click event handler for close button
  18208. * @param {MouseEvent} clickEvent - mouse event object
  18209. */
  18210. ScheduleCreationPopup.prototype._onClick = function(clickEvent) {
  18211. var target = domevent.getEventTarget(clickEvent);
  18212. util.forEach(this._onClickListeners, function(listener) {
  18213. return !listener(target);
  18214. });
  18215. };
  18216. /**
  18217. * Test click event target is close button, and return layer is closed(hidden)
  18218. * @param {HTMLElement} target click event target
  18219. * @returns {boolean} whether popup layer is closed or not
  18220. */
  18221. ScheduleCreationPopup.prototype._closePopup = function(target) {
  18222. var className = config.classname('popup-close');
  18223. if (domutil.hasClass(target, className) || domutil.closest(target, '.' + className)) {
  18224. this.hide();
  18225. return true;
  18226. }
  18227. return false;
  18228. };
  18229. /**
  18230. * Toggle dropdown menu view, when user clicks dropdown button
  18231. * @param {HTMLElement} target click event target
  18232. * @returns {boolean} whether user clicked dropdown button or not
  18233. */
  18234. ScheduleCreationPopup.prototype._toggleDropdownMenuView = function(target) {
  18235. var className = config.classname('dropdown-button');
  18236. var dropdownBtn = domutil.hasClass(target, className) ? target : domutil.closest(target, '.' + className);
  18237. if (!dropdownBtn) {
  18238. return false;
  18239. }
  18240. if (domutil.hasClass(dropdownBtn.parentNode, config.classname('open'))) {
  18241. this._closeDropdownMenuView(dropdownBtn.parentNode);
  18242. } else {
  18243. this._openDropdownMenuView(dropdownBtn.parentNode);
  18244. }
  18245. return true;
  18246. };
  18247. /**
  18248. * Close drop down menu
  18249. * @param {HTMLElement} dropdown - dropdown element that has a opened dropdown menu
  18250. */
  18251. ScheduleCreationPopup.prototype._closeDropdownMenuView = function(dropdown) {
  18252. dropdown = dropdown || this._focusedDropdown;
  18253. if (dropdown) {
  18254. domutil.removeClass(dropdown, config.classname('open'));
  18255. this._focusedDropdown = null;
  18256. }
  18257. };
  18258. /**
  18259. * Open drop down menu
  18260. * @param {HTMLElement} dropdown - dropdown element that has a closed dropdown menu
  18261. */
  18262. ScheduleCreationPopup.prototype._openDropdownMenuView = function(dropdown) {
  18263. domutil.addClass(dropdown, config.classname('open'));
  18264. this._focusedDropdown = dropdown;
  18265. };
  18266. /**
  18267. * If click dropdown menu item, close dropdown menu
  18268. * @param {HTMLElement} target click event target
  18269. * @returns {boolean} whether
  18270. */
  18271. ScheduleCreationPopup.prototype._selectDropdownMenuItem = function(target) {
  18272. var itemClassName = config.classname('dropdown-menu-item');
  18273. var iconClassName = config.classname('icon');
  18274. var contentClassName = config.classname('content');
  18275. var selectedItem = domutil.hasClass(target, itemClassName) ? target : domutil.closest(target, '.' + itemClassName);
  18276. var bgColor, title, dropdown, dropdownBtn;
  18277. if (!selectedItem) {
  18278. return false;
  18279. }
  18280. bgColor = domutil.find('.' + iconClassName, selectedItem).style.backgroundColor || 'transparent';
  18281. title = domutil.find('.' + contentClassName, selectedItem).innerHTML;
  18282. dropdown = domutil.closest(selectedItem, config.classname('.dropdown'));
  18283. dropdownBtn = domutil.find(config.classname('.dropdown-button'), dropdown);
  18284. domutil.find('.' + contentClassName, dropdownBtn).innerText = title;
  18285. if (domutil.hasClass(dropdown, config.classname('section-calendar'))) {
  18286. domutil.find('.' + iconClassName, dropdownBtn).style.backgroundColor = bgColor;
  18287. this._selectedCal = common.find(this.calendars, function(cal) {
  18288. return String(cal.id) === domutil.getData(selectedItem, 'calendarId');
  18289. });
  18290. }
  18291. domutil.removeClass(dropdown, config.classname('open'));
  18292. return true;
  18293. };
  18294. /**
  18295. * Toggle allday checkbox state
  18296. * @param {HTMLElement} target click event target
  18297. * @returns {boolean} whether event target is allday section or not
  18298. */
  18299. ScheduleCreationPopup.prototype._toggleIsAllday = function(target) {
  18300. var className = config.classname('section-allday');
  18301. var alldaySection = domutil.hasClass(target, className) ? target : domutil.closest(target, '.' + className);
  18302. var checkbox;
  18303. if (alldaySection) {
  18304. checkbox = domutil.find(config.classname('.checkbox-square'), alldaySection);
  18305. checkbox.checked = !checkbox.checked;
  18306. return true;
  18307. }
  18308. return false;
  18309. };
  18310. /**
  18311. * Toggle private button
  18312. * @param {HTMLElement} target click event target
  18313. * @returns {boolean} whether event target is private section or not
  18314. */
  18315. ScheduleCreationPopup.prototype._toggleIsPrivate = function(target) {
  18316. var className = config.classname('section-private');
  18317. var privateSection = domutil.hasClass(target, className) ? target : domutil.closest(target, '.' + className);
  18318. if (privateSection) {
  18319. if (domutil.hasClass(privateSection, config.classname('public'))) {
  18320. domutil.removeClass(privateSection, config.classname('public'));
  18321. } else {
  18322. domutil.addClass(privateSection, config.classname('public'));
  18323. }
  18324. return true;
  18325. }
  18326. return false;
  18327. };
  18328. /**
  18329. * Save new schedule if user clicked save button
  18330. * @emits ScheduleCreationPopup#saveSchedule
  18331. * @param {HTMLElement} target click event target
  18332. * @returns {boolean} whether save button is clicked or not
  18333. */
  18334. // eslint-disable-next-line complexity
  18335. ScheduleCreationPopup.prototype._onClickSaveSchedule = function(target) {
  18336. var className = config.classname('popup-save');
  18337. var cssPrefix = config.cssPrefix;
  18338. var title;
  18339. var startDate;
  18340. var endDate;
  18341. var rangeDate;
  18342. var form;
  18343. var isAllDay;
  18344. if (!domutil.hasClass(target, className) && !domutil.closest(target, '.' + className)) {
  18345. return false;
  18346. }
  18347. title = domutil.get(cssPrefix + 'schedule-title');
  18348. startDate = new TZDate(this.rangePicker.getStartDate());
  18349. endDate = new TZDate(this.rangePicker.getEndDate());
  18350. if (!this._validateForm(title, startDate, endDate)) {
  18351. if (!title.value) {
  18352. title.focus();
  18353. }
  18354. return false;
  18355. }
  18356. isAllDay = !!domutil.get(cssPrefix + 'schedule-allday').checked;
  18357. rangeDate = this._getRangeDate(startDate, endDate, isAllDay);
  18358. form = {
  18359. calendarId: this._selectedCal ? this._selectedCal.id : null,
  18360. title: title,
  18361. location: domutil.get(cssPrefix + 'schedule-location'),
  18362. start: rangeDate.start,
  18363. end: rangeDate.end,
  18364. isAllDay: isAllDay,
  18365. state: domutil.get(cssPrefix + 'schedule-state').innerText,
  18366. isPrivate: !domutil.hasClass(domutil.get(cssPrefix + 'schedule-private'), config.classname('public'))
  18367. };
  18368. if (this._isEditMode) {
  18369. this._onClickUpdateSchedule(form);
  18370. } else {
  18371. this._onClickCreateSchedule(form);
  18372. }
  18373. this.hide();
  18374. return true;
  18375. };
  18376. /**
  18377. * @override
  18378. * @param {object} viewModel - view model from factory/monthView
  18379. */
  18380. ScheduleCreationPopup.prototype.render = function(viewModel) {
  18381. var calendars = this.calendars;
  18382. var layer = this.layer;
  18383. var self = this;
  18384. var boxElement, guideElements;
  18385. viewModel.zIndex = this.layer.zIndex + 5;
  18386. viewModel.calendars = calendars;
  18387. if (calendars.length) {
  18388. viewModel.selectedCal = this._selectedCal = calendars[0];
  18389. }
  18390. this._isEditMode = viewModel.schedule && viewModel.schedule.id;
  18391. if (this._isEditMode) {
  18392. boxElement = viewModel.target;
  18393. viewModel = this._makeEditModeData(viewModel);
  18394. } else {
  18395. this.guide = viewModel.guide;
  18396. guideElements = this._getGuideElements(this.guide);
  18397. boxElement = guideElements.length ? guideElements[0] : null;
  18398. }
  18399. layer.setContent(tmpl(viewModel));
  18400. this._createDatepicker(viewModel.start, viewModel.end, viewModel.isAllDay);
  18401. layer.show();
  18402. if (boxElement) {
  18403. this._setPopupPositionAndArrowDirection(boxElement.getBoundingClientRect());
  18404. }
  18405. util.debounce(function() {
  18406. domevent.on(document.body, 'mousedown', self._onMouseDown, self);
  18407. })();
  18408. };
  18409. /**
  18410. * Make view model for edit mode
  18411. * @param {object} viewModel - original view model from 'beforeCreateEditPopup'
  18412. * @returns {object} - edit mode view model
  18413. */
  18414. ScheduleCreationPopup.prototype._makeEditModeData = function(viewModel) {
  18415. var schedule = viewModel.schedule;
  18416. var title, isPrivate, location, startDate, endDate, isAllDay, state;
  18417. var raw = schedule.raw || {};
  18418. var calendars = this.calendars;
  18419. var id = schedule.id;
  18420. title = schedule.title;
  18421. isPrivate = raw['class'] === 'private';
  18422. location = schedule.location;
  18423. startDate = schedule.start;
  18424. endDate = schedule.end;
  18425. isAllDay = schedule.isAllDay;
  18426. state = schedule.state;
  18427. viewModel.selectedCal = this._selectedCal = common.find(this.calendars, function(cal) {
  18428. return cal.id === viewModel.schedule.calendarId;
  18429. });
  18430. this._schedule = schedule;
  18431. return {
  18432. id: id,
  18433. selectedCal: this._selectedCal,
  18434. calendars: calendars,
  18435. title: title,
  18436. isPrivate: isPrivate,
  18437. location: location,
  18438. isAllDay: isAllDay,
  18439. state: state,
  18440. start: startDate,
  18441. end: endDate,
  18442. raw: {
  18443. class: isPrivate ? 'private' : 'public'
  18444. },
  18445. zIndex: this.layer.zIndex + 5,
  18446. isEditMode: this._isEditMode
  18447. };
  18448. };
  18449. /**
  18450. * Set popup position and arrow direction to apear near guide element
  18451. * @param {MonthCreationGuide|TimeCreationGuide|DayGridCreationGuide} guideBound - creation guide element
  18452. */
  18453. ScheduleCreationPopup.prototype._setPopupPositionAndArrowDirection = function(guideBound) {
  18454. var layer = domutil.find(config.classname('.popup'), this.layer.container);
  18455. var layerSize = {
  18456. width: layer.offsetWidth,
  18457. height: layer.offsetHeight
  18458. };
  18459. var containerBound = this.container.getBoundingClientRect();
  18460. var pos = this._calcRenderingData(layerSize, containerBound, guideBound);
  18461. this.layer.setPosition(pos.x, pos.y);
  18462. this._setArrowDirection(pos.arrow);
  18463. };
  18464. /**
  18465. * Get guide elements from creation guide object
  18466. * It is used to calculate rendering position of popup
  18467. * It will be disappeared when hiding popup
  18468. * @param {MonthCreationGuide|TimeCreationGuide|AlldayCreationGuide} guide - creation guide
  18469. * @returns {Array.<HTMLElement>} creation guide element
  18470. */
  18471. ScheduleCreationPopup.prototype._getGuideElements = function(guide) {
  18472. var guideElements = [];
  18473. var i = 0;
  18474. if (guide.guideElement) {
  18475. guideElements.push(guide.guideElement);
  18476. } else if (guide.guideElements) {
  18477. for (; i < MAX_WEEK_OF_MONTH; i += 1) {
  18478. if (guide.guideElements[i]) {
  18479. guideElements.push(guide.guideElements[i]);
  18480. }
  18481. }
  18482. }
  18483. return guideElements;
  18484. };
  18485. /**
  18486. * Get guide element's bound data which only includes top, right, bottom, left
  18487. * @param {Array.<HTMLElement>} guideElements - creation guide elements
  18488. * @returns {Object} - popup bound data
  18489. */
  18490. ScheduleCreationPopup.prototype._getBoundOfFirstRowGuideElement = function(guideElements) {
  18491. var bound;
  18492. if (!guideElements.length) {
  18493. return null;
  18494. }
  18495. bound = guideElements[0].getBoundingClientRect();
  18496. return {
  18497. top: bound.top,
  18498. left: bound.left,
  18499. bottom: bound.bottom,
  18500. right: bound.right
  18501. };
  18502. };
  18503. /**
  18504. * Get calculate rendering positions of y and arrow direction by guide block elements
  18505. * @param {number} guideBoundTop - guide block's top
  18506. * @param {number} guideBoundBottom - guide block's bottom
  18507. * @param {number} layerHeight - popup layer's height
  18508. * @param {number} containerTop - container's top
  18509. * @param {number} containerBottom - container's bottom
  18510. * @returns {YAndArrowDirection} y and arrowDirection
  18511. */
  18512. ScheduleCreationPopup.prototype._getYAndArrowDirection = function(
  18513. guideBoundTop,
  18514. guideBoundBottom,
  18515. layerHeight,
  18516. containerTop,
  18517. containerBottom
  18518. ) {
  18519. var arrowDirection = 'arrow-bottom';
  18520. var MARGIN = 3;
  18521. var y = guideBoundTop - layerHeight;
  18522. if (y < containerTop) {
  18523. y = guideBoundBottom - containerTop + MARGIN;
  18524. arrowDirection = 'arrow-top';
  18525. } else {
  18526. y = y - containerTop - MARGIN;
  18527. }
  18528. if (y + layerHeight > containerBottom) {
  18529. y = containerBottom - layerHeight - containerTop - MARGIN;
  18530. }
  18531. /**
  18532. * @typedef {Object} YAndArrowDirection
  18533. * @property {number} y - top position of popup layer
  18534. * @property {string} [arrowDirection] - direction of popup arrow
  18535. */
  18536. return {
  18537. y: y,
  18538. arrowDirection: arrowDirection
  18539. };
  18540. };
  18541. /**
  18542. * Get calculate rendering x position and arrow left by guide block elements
  18543. * @param {number} guideBoundLeft - guide block's left
  18544. * @param {number} guideBoundRight - guide block's right
  18545. * @param {number} layerWidth - popup layer's width
  18546. * @param {number} containerLeft - container's left
  18547. * @param {number} containerRight - container's right
  18548. * @returns {XAndArrowLeft} x and arrowLeft
  18549. */
  18550. ScheduleCreationPopup.prototype._getXAndArrowLeft = function(
  18551. guideBoundLeft,
  18552. guideBoundRight,
  18553. layerWidth,
  18554. containerLeft,
  18555. containerRight
  18556. ) {
  18557. var guideHorizontalCenter = (guideBoundLeft + guideBoundRight) / 2;
  18558. var x = guideHorizontalCenter - (layerWidth / 2);
  18559. var ARROW_WIDTH_HALF = 8;
  18560. var arrowLeft;
  18561. if (x + layerWidth > containerRight) {
  18562. x = guideBoundRight - layerWidth + ARROW_WIDTH_HALF;
  18563. arrowLeft = guideHorizontalCenter - x;
  18564. } else {
  18565. x += ARROW_WIDTH_HALF;
  18566. }
  18567. if (x < containerLeft) {
  18568. x = 0;
  18569. arrowLeft = guideHorizontalCenter - containerLeft - ARROW_WIDTH_HALF;
  18570. } else {
  18571. x = x - containerLeft - ARROW_WIDTH_HALF;
  18572. }
  18573. /**
  18574. * @typedef {Object} XAndArrowLeft
  18575. * @property {number} x - left position of popup layer
  18576. * @property {numbe3er} arrowLeft - relative position of popup arrow, if it is not set, arrow appears on the middle of popup
  18577. */
  18578. return {
  18579. x: x,
  18580. arrowLeft: arrowLeft
  18581. };
  18582. };
  18583. /**
  18584. * Calculate rendering position usering guide elements
  18585. * @param {{width: {number}, height: {number}}} layerSize - popup layer's width and height
  18586. * @param {{top: {number}, left: {number}, right: {number}, bottom: {number}}} containerBound - width and height of the upper layer, that acts as a border of popup
  18587. * @param {{top: {number}, left: {number}, right: {number}, bottom: {number}}} guideBound - guide element bound data
  18588. * @returns {PopupRenderingData} rendering position of popup and popup arrow
  18589. */
  18590. ScheduleCreationPopup.prototype._calcRenderingData = function(layerSize, containerBound, guideBound) {
  18591. var yPosInfo = this._getYAndArrowDirection(
  18592. guideBound.top,
  18593. guideBound.bottom,
  18594. layerSize.height,
  18595. containerBound.top,
  18596. containerBound.bottom
  18597. );
  18598. var xPosInfo = this._getXAndArrowLeft(
  18599. guideBound.left,
  18600. guideBound.right,
  18601. layerSize.width,
  18602. containerBound.left,
  18603. containerBound.right
  18604. );
  18605. /**
  18606. * @typedef {Object} PopupRenderingData
  18607. * @property {number} x - left position
  18608. * @property {number} y - top position
  18609. * @property {string} arrow.direction - direction of popup arrow
  18610. * @property {number} [arrow.position] - relative position of popup arrow, if it is not set, arrow appears on the middle of popup
  18611. */
  18612. return {
  18613. x: xPosInfo.x,
  18614. y: yPosInfo.y,
  18615. arrow: {
  18616. direction: yPosInfo.arrowDirection,
  18617. position: xPosInfo.arrowLeft
  18618. }
  18619. };
  18620. };
  18621. /**
  18622. * Set arrow's direction and position
  18623. * @param {Object} arrow rendering data for popup arrow
  18624. */
  18625. ScheduleCreationPopup.prototype._setArrowDirection = function(arrow) {
  18626. var direction = arrow.direction || 'arrow-bottom';
  18627. var arrowEl = domutil.get(config.classname('popup-arrow'));
  18628. var borderElement = domutil.find(config.classname('.popup-arrow-border', arrowEl));
  18629. if (direction !== config.classname('arrow-bottom')) {
  18630. domutil.removeClass(arrowEl, config.classname('arrow-bottom'));
  18631. domutil.addClass(arrowEl, config.classname(direction));
  18632. }
  18633. if (arrow.position) {
  18634. borderElement.style.left = arrow.position + 'px';
  18635. }
  18636. };
  18637. /**
  18638. * Create date range picker using start date and end date
  18639. * @param {TZDate} start - start date
  18640. * @param {TZDate} end - end date
  18641. * @param {boolean} isAllDay - isAllDay
  18642. */
  18643. ScheduleCreationPopup.prototype._createDatepicker = function(start, end, isAllDay) {
  18644. var cssPrefix = config.cssPrefix;
  18645. this.rangePicker = DatePicker.createRangePicker({
  18646. startpicker: {
  18647. date: new TZDate(start).toDate(),
  18648. input: '#' + cssPrefix + 'schedule-start-date',
  18649. container: '#' + cssPrefix + 'startpicker-container'
  18650. },
  18651. endpicker: {
  18652. date: new TZDate(end).toDate(),
  18653. input: '#' + cssPrefix + 'schedule-end-date',
  18654. container: '#' + cssPrefix + 'endpicker-container'
  18655. },
  18656. format: isAllDay ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm',
  18657. timepicker: isAllDay ? null : {
  18658. showMeridiem: false,
  18659. usageStatistics: this._usageStatistics
  18660. },
  18661. usageStatistics: this._usageStatistics
  18662. });
  18663. };
  18664. /**
  18665. * Hide layer
  18666. */
  18667. ScheduleCreationPopup.prototype.hide = function() {
  18668. this.layer.hide();
  18669. if (this.guide) {
  18670. this.guide.clearGuideElement();
  18671. this.guide = null;
  18672. }
  18673. domevent.off(document.body, 'mousedown', this._onMouseDown, this);
  18674. };
  18675. /**
  18676. * refresh layer
  18677. */
  18678. ScheduleCreationPopup.prototype.refresh = function() {
  18679. if (this._viewModel) {
  18680. this.layer.setContent(this.tmpl(this._viewModel));
  18681. }
  18682. };
  18683. /**
  18684. * Set calendar list
  18685. * @param {Array.<Calendar>} calendars - calendar list
  18686. */
  18687. ScheduleCreationPopup.prototype.setCalendars = function(calendars) {
  18688. this.calendars = calendars || [];
  18689. };
  18690. /**
  18691. * Validate the form
  18692. * @param {string} title title of then entered schedule
  18693. * @param {TZDate} startDate start date time from range picker
  18694. * @param {TZDate} endDate end date time from range picker
  18695. * @returns {boolean} Returns false if the form is not valid for submission.
  18696. */
  18697. ScheduleCreationPopup.prototype._validateForm = function(title, startDate, endDate) {
  18698. if (!title.value) {
  18699. return false;
  18700. }
  18701. if (!startDate && !endDate) {
  18702. return false;
  18703. }
  18704. if (datetime.compare(startDate, endDate) === 1) {
  18705. return false;
  18706. }
  18707. return true;
  18708. };
  18709. /**
  18710. * Get range date from range picker
  18711. * @param {TZDate} startDate start date time from range picker
  18712. * @param {TZDate} endDate end date time from range picker
  18713. * @param {boolean} isAllDay whether it is an all-day schedule
  18714. * @returns {RangeDate} Returns the start and end time data that is the range date
  18715. */
  18716. ScheduleCreationPopup.prototype._getRangeDate = function(startDate, endDate, isAllDay) {
  18717. var start = isAllDay ? datetime.start(startDate) : startDate;
  18718. var end = isAllDay ? datetime.renderEnd(startDate, endDate) : endDate;
  18719. /**
  18720. * @typedef {object} RangeDate
  18721. * @property {TZDate} start start time
  18722. * @property {TZDate} end end time
  18723. */
  18724. return {
  18725. start: new TZDate(start),
  18726. end: new TZDate(end)
  18727. };
  18728. };
  18729. /**
  18730. * Request schedule model creation to controller by custom schedules.
  18731. * @fires {ScheduleCreationPopup#beforeUpdateSchedule}
  18732. * @param {{
  18733. calendarId: {string},
  18734. title: {string},
  18735. location: {string},
  18736. start: {TZDate},
  18737. end: {TZDate},
  18738. isAllDay: {boolean},
  18739. state: {string},
  18740. isPrivate: {boolean}
  18741. }} form schedule input form data
  18742. */
  18743. ScheduleCreationPopup.prototype._onClickUpdateSchedule = function(form) {
  18744. var changes = common.getScheduleChanges(
  18745. this._schedule,
  18746. ['calendarId', 'title', 'location', 'start', 'end', 'isAllDay', 'state'],
  18747. {
  18748. calendarId: form.calendarId,
  18749. title: form.title.value,
  18750. location: form.location.value,
  18751. start: form.start,
  18752. end: form.end,
  18753. isAllDay: form.isAllDay,
  18754. state: form.state
  18755. }
  18756. );
  18757. /**
  18758. * @event ScheduleCreationPopup#beforeUpdateSchedule
  18759. * @type {object}
  18760. * @property {Schedule} schedule - schedule object to be updated
  18761. */
  18762. this.fire('beforeUpdateSchedule', {
  18763. schedule: util.extend({
  18764. raw: {
  18765. class: form.isPrivate ? 'private' : 'public'
  18766. }
  18767. }, this._schedule),
  18768. changes: changes,
  18769. start: form.start,
  18770. end: form.end,
  18771. calendar: this._selectedCal,
  18772. triggerEventName: 'click'
  18773. });
  18774. };
  18775. /**
  18776. * Request the controller to update the schedule model according to the custom schedule.
  18777. * @fires {ScheduleCreationPopup#beforeCreateSchedule}
  18778. * @param {{
  18779. calendarId: {string},
  18780. title: {string},
  18781. location: {string},
  18782. start: {TZDate},
  18783. end: {TZDate},
  18784. isAllDay: {boolean},
  18785. state: {string}
  18786. }} form schedule input form data
  18787. */
  18788. ScheduleCreationPopup.prototype._onClickCreateSchedule = function(form) {
  18789. /**
  18790. * @event ScheduleCreationPopup#beforeCreateSchedule
  18791. * @type {object}
  18792. * @property {Schedule} schedule - new schedule instance to be added
  18793. */
  18794. this.fire('beforeCreateSchedule', {
  18795. calendarId: form.calendarId,
  18796. title: form.title.value,
  18797. location: form.location.value,
  18798. raw: {
  18799. class: form.isPrivate ? 'private' : 'public'
  18800. },
  18801. start: form.start,
  18802. end: form.end,
  18803. isAllDay: form.isAllDay,
  18804. state: form.state
  18805. });
  18806. };
  18807. module.exports = ScheduleCreationPopup;
  18808. /***/ }),
  18809. /***/ "./src/js/view/popup/scheduleDetailPopup.js":
  18810. /*!**************************************************!*\
  18811. !*** ./src/js/view/popup/scheduleDetailPopup.js ***!
  18812. \**************************************************/
  18813. /*! no static exports found */
  18814. /***/ (function(module, exports, __webpack_require__) {
  18815. "use strict";
  18816. /* eslint-disable vars-on-top */
  18817. /**
  18818. * @fileoverview Floating layer for showing detail schedule
  18819. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  18820. */
  18821. var View = __webpack_require__(/*! ../../view/view */ "./src/js/view/view.js");
  18822. var FloatingLayer = __webpack_require__(/*! ../../common/floatingLayer */ "./src/js/common/floatingLayer.js");
  18823. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  18824. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
  18825. domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js"),
  18826. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  18827. var tmpl = __webpack_require__(/*! ../template/popup/scheduleDetailPopup.hbs */ "./src/js/view/template/popup/scheduleDetailPopup.hbs");
  18828. var tz = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js");
  18829. var TZDate = tz.Date;
  18830. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  18831. /**
  18832. * @constructor
  18833. * @extends {View}
  18834. * @param {HTMLElement} container - container element
  18835. */
  18836. function ScheduleDetailPopup(container) {
  18837. View.call(this, container);
  18838. /**
  18839. * @type {FloatingLayer}
  18840. */
  18841. this.layer = new FloatingLayer(null, container);
  18842. /**
  18843. * cached view model
  18844. * @type {object}
  18845. */
  18846. this._viewModel = null;
  18847. this._schedule = null;
  18848. this._calendar = null;
  18849. domevent.on(container, 'click', this._onClick, this);
  18850. }
  18851. util.inherit(ScheduleDetailPopup, View);
  18852. /**
  18853. * Mousedown event handler for hiding popup layer when user mousedown outside of
  18854. * layer
  18855. * @param {MouseEvent} mouseDownEvent - mouse event object
  18856. */
  18857. ScheduleDetailPopup.prototype._onMouseDown = function(mouseDownEvent) {
  18858. var target = domevent.getEventTarget(mouseDownEvent),
  18859. popupLayer = domutil.closest(target, config.classname('.floating-layer'));
  18860. if (popupLayer) {
  18861. return;
  18862. }
  18863. this.hide();
  18864. };
  18865. /**
  18866. * @override
  18867. */
  18868. ScheduleDetailPopup.prototype.destroy = function() {
  18869. this.layer.destroy();
  18870. this.layer = null;
  18871. domevent.off(this.container, 'click', this._onClick, this);
  18872. domevent.off(document.body, 'mousedown', this._onMouseDown, this);
  18873. View.prototype.destroy.call(this);
  18874. };
  18875. /**
  18876. * @override
  18877. * Click event handler for close button
  18878. * @param {MouseEvent} clickEvent - mouse event object
  18879. */
  18880. ScheduleDetailPopup.prototype._onClick = function(clickEvent) {
  18881. var target = domevent.getEventTarget(clickEvent);
  18882. this._onClickEditSchedule(target);
  18883. this._onClickDeleteSchedule(target);
  18884. };
  18885. /**
  18886. * @fires ScheduleDetailPopup#clickEditSchedule
  18887. * @param {HTMLElement} target - event target
  18888. */
  18889. ScheduleDetailPopup.prototype._onClickEditSchedule = function(target) {
  18890. var className = config.classname('popup-edit');
  18891. if (domutil.hasClass(target, className) || domutil.closest(target, '.' + className)) {
  18892. this.fire('beforeUpdateSchedule', {
  18893. schedule: this._schedule,
  18894. triggerEventName: 'click',
  18895. target: this._scheduleEl
  18896. });
  18897. this.hide();
  18898. }
  18899. };
  18900. /**
  18901. * @fires ScheduleDetailPopup#clickEditSchedule
  18902. * @param {HTMLElement} target - event target
  18903. */
  18904. ScheduleDetailPopup.prototype._onClickDeleteSchedule = function(target) {
  18905. var className = config.classname('popup-delete');
  18906. if (domutil.hasClass(target, className) || domutil.closest(target, '.' + className)) {
  18907. this.fire('beforeDeleteSchedule', {
  18908. schedule: this._schedule
  18909. });
  18910. this.hide();
  18911. }
  18912. };
  18913. /**
  18914. * @override
  18915. * @param {object} viewModel - view model from factory/monthView
  18916. */
  18917. ScheduleDetailPopup.prototype.render = function(viewModel) {
  18918. var layer = this.layer;
  18919. var self = this;
  18920. layer.setContent(tmpl({
  18921. schedule: this._getScheduleModel(viewModel.schedule),
  18922. calendar: viewModel.calendar
  18923. }));
  18924. layer.show();
  18925. this._setPopupPositionAndArrowDirection(viewModel.event);
  18926. this._schedule = viewModel.schedule;
  18927. this._calendar = viewModel.calendar;
  18928. util.debounce(function() {
  18929. domevent.on(document.body, 'mousedown', self._onMouseDown, self);
  18930. })();
  18931. };
  18932. // eslint-disable-next-line complexity
  18933. ScheduleDetailPopup.prototype._getScheduleModel = function(scheduleViewModel) {
  18934. var viewModel = util.extend({}, scheduleViewModel);
  18935. var dayStart = datetime.start(scheduleViewModel.start);
  18936. var startDayOffset = dayStart.toDate().getTimezoneOffset();
  18937. var nativeOffsetMs = tz.getNativeOffsetMs();
  18938. var hasPrimaryTimezoneCustomSetting = tz.hasPrimaryTimezoneCustomSetting();
  18939. var startOffset = viewModel.start.toDate().getTimezoneOffset();
  18940. var endOffset = viewModel.end.toDate().getTimezoneOffset();
  18941. var primaryTimezoneCode = tz.getPrimaryTimezoneName();
  18942. var primaryOffset = tz.getPrimaryOffset();
  18943. var startTimezoneOffset = tz.getOffsetByTimezoneName(
  18944. primaryTimezoneCode,
  18945. viewModel.start.getTime()
  18946. );
  18947. var endTimezoneOffset = tz.getOffsetByTimezoneName(
  18948. primaryTimezoneCode,
  18949. viewModel.end.getTime()
  18950. );
  18951. var MIN_TO_MS = 60 * 1000;
  18952. var offsetDiffMs = 0;
  18953. var start, end;
  18954. if (
  18955. hasPrimaryTimezoneCustomSetting &&
  18956. tz.isNativeOsUsingDSTTimezone() &&
  18957. nativeOffsetMs !== startDayOffset
  18958. ) {
  18959. // When using a custom time zone, the native time zone offset is fixed and rendered.
  18960. // So, The fixed and rendered time should be recalculated as the original time zone offset.
  18961. // The current system OS local time is not affected by summer/standard time and the schedule should always be displayed in the same location.
  18962. offsetDiffMs = (startOffset * MIN_TO_MS) - nativeOffsetMs;
  18963. start = new TZDate(viewModel.start);
  18964. start.addMilliseconds(offsetDiffMs);
  18965. viewModel.start = start;
  18966. offsetDiffMs = (endOffset * MIN_TO_MS) - nativeOffsetMs;
  18967. end = new TZDate(viewModel.end);
  18968. end.addMilliseconds(offsetDiffMs);
  18969. viewModel.end = end;
  18970. }
  18971. if (
  18972. hasPrimaryTimezoneCustomSetting &&
  18973. tz.isPrimaryUsingDSTTimezone() &&
  18974. (primaryOffset !== startTimezoneOffset || primaryOffset !== endTimezoneOffset)
  18975. ) {
  18976. // The custom time zone is a time zone where two offsets including DST are applied.
  18977. // The first rendered schedule is calculated and drawn with the offset calculated at the access time(system OS local time).
  18978. // It should be recalculated with the original time zone offset.
  18979. offsetDiffMs = (primaryOffset - startTimezoneOffset) * MIN_TO_MS;
  18980. start = new TZDate(viewModel.start);
  18981. start.addMilliseconds(offsetDiffMs);
  18982. viewModel.start = start;
  18983. offsetDiffMs = (primaryOffset - endTimezoneOffset) * MIN_TO_MS;
  18984. end = new TZDate(viewModel.end);
  18985. end.addMilliseconds(offsetDiffMs);
  18986. viewModel.end = end;
  18987. }
  18988. return viewModel;
  18989. };
  18990. /**
  18991. * Set popup position and arrow direction to apear near guide element
  18992. * @param {Event} event - creation guide element
  18993. */
  18994. ScheduleDetailPopup.prototype._setPopupPositionAndArrowDirection = function(event) {
  18995. var layer = domutil.find(config.classname('.popup'), this.layer.container);
  18996. var layerSize = {
  18997. width: layer.offsetWidth,
  18998. height: layer.offsetHeight
  18999. };
  19000. var containerBound = this.container.getBoundingClientRect();
  19001. var scheduleEl = domevent.getEventTarget(event);
  19002. var blockEl = domutil.closest(scheduleEl, config.classname('.time-date-schedule-block'))
  19003. || domutil.closest(scheduleEl, config.classname('.weekday-schedule'))
  19004. || scheduleEl;
  19005. var scheduleBound = blockEl.getBoundingClientRect();
  19006. var pos;
  19007. this._scheduleEl = blockEl;
  19008. pos = this._calcRenderingData(layerSize, containerBound, scheduleBound);
  19009. this.layer.setPosition(pos.x, pos.y);
  19010. this._setArrowDirection(pos.arrow);
  19011. };
  19012. /**
  19013. * Get calculate rendering positions of y and arrow top by schedule block elements
  19014. * @param {number} scheduleBoundTop - schedule block's top
  19015. * @param {number} scheduleBoundBottom - schedule block's bottom
  19016. * @param {number} layerHeight - popup layer's height
  19017. * @param {number} containerTop - container's top
  19018. * @param {number} containerBottom - container's bottom
  19019. * @returns {YAndArrowTop} y and arrowTop
  19020. */
  19021. ScheduleDetailPopup.prototype._getYAndArrowTop = function(
  19022. scheduleBoundTop,
  19023. scheduleBoundBottom,
  19024. layerHeight,
  19025. containerTop,
  19026. containerBottom
  19027. ) {
  19028. var ARROW_WIDTH_HALF = 8;
  19029. var scheduleVerticalCenter, y, arrowTop;
  19030. scheduleBoundTop = scheduleBoundTop < 0 ? 0 : scheduleBoundTop;
  19031. scheduleVerticalCenter = (scheduleBoundTop + scheduleBoundBottom) / 2;
  19032. y = scheduleVerticalCenter - (layerHeight / 2);
  19033. if (y < containerTop) {
  19034. y = 0;
  19035. arrowTop = scheduleVerticalCenter - containerTop - ARROW_WIDTH_HALF;
  19036. } else if (y + layerHeight > containerBottom) {
  19037. y = Math.max(containerBottom - layerHeight - containerTop, 0);
  19038. arrowTop = scheduleVerticalCenter - y - containerTop - ARROW_WIDTH_HALF;
  19039. } else {
  19040. y -= containerTop;
  19041. }
  19042. if (arrowTop < 0 || arrowTop > layerHeight) {
  19043. arrowTop = null;
  19044. }
  19045. /**
  19046. * @typedef {Object} YAndArrowTop
  19047. * @property {number} y - top position of popup layer
  19048. * @property {number} [arrowTop] - relative position of popup arrow, if it is not set, arrow appears on the middle of popup
  19049. */
  19050. return {
  19051. y: y,
  19052. arrowTop: arrowTop
  19053. };
  19054. };
  19055. /**
  19056. * Get calculate rendering x position and arrow direction by schedule block elements
  19057. * @param {number} scheduleBoundLeft - schedule block's left
  19058. * @param {number} scheduleBoundRight - schedule block's right
  19059. * @param {number} layerWidth - popup layer's width
  19060. * @param {number} containerLeft - container's left
  19061. * @param {number} containerRight - container's right
  19062. * @returns {XAndArrowDirection} x and arrowDirection
  19063. */
  19064. ScheduleDetailPopup.prototype._getXAndArrowDirection = function(
  19065. scheduleBoundLeft,
  19066. scheduleBoundRight,
  19067. layerWidth,
  19068. containerLeft,
  19069. containerRight
  19070. ) {
  19071. var arrowDirection = 'arrow-left';
  19072. var x = scheduleBoundRight;
  19073. var MARGIN = 4;
  19074. if (x + layerWidth > containerRight) {
  19075. arrowDirection = 'arrow-right';
  19076. x = scheduleBoundLeft - layerWidth - MARGIN;
  19077. } else {
  19078. x += MARGIN;
  19079. }
  19080. if (x < containerLeft) {
  19081. x = 0;
  19082. } else {
  19083. x -= containerLeft;
  19084. }
  19085. /**
  19086. * @typedef {Object} XAndArrowDirection
  19087. * @property {number} x - left position of popup layer
  19088. * @property {string} arrowDirection - direction of popup arrow
  19089. */
  19090. return {
  19091. x: x,
  19092. arrowDirection: arrowDirection
  19093. };
  19094. };
  19095. /**
  19096. * Calculate rendering position usering guide elements
  19097. * @param {{width: {number}, height: {number}}} layerSize - popup layer's width and height
  19098. * @param {{top: {number}, left: {number}, right: {number}, bottom: {number}}} containerBound - width and height of the upper layer, that acts as a border of popup
  19099. * @param {{top: {number}, left: {number}, right: {number}, bottom: {number}}} scheduleBound - guide element bound data
  19100. * @returns {PopupRenderingData} rendering position of popup and popup arrow
  19101. */
  19102. ScheduleDetailPopup.prototype._calcRenderingData = function(layerSize, containerBound, scheduleBound) {
  19103. var yPosInfo = this._getYAndArrowTop(
  19104. scheduleBound.top,
  19105. scheduleBound.bottom,
  19106. layerSize.height,
  19107. containerBound.top,
  19108. containerBound.bottom
  19109. );
  19110. var xPosInfo = this._getXAndArrowDirection(
  19111. scheduleBound.left,
  19112. scheduleBound.right,
  19113. layerSize.width,
  19114. containerBound.left,
  19115. containerBound.right
  19116. );
  19117. /**
  19118. * @typedef {Object} PopupRenderingData
  19119. * @property {number} x - left position
  19120. * @property {number} y - top position
  19121. * @property {string} arrow.direction - direction of popup arrow
  19122. * @property {number} [arrow.position] - relative position of popup arrow, if it is not set, arrow appears on the middle of popup
  19123. */
  19124. return {
  19125. x: xPosInfo.x,
  19126. y: yPosInfo.y,
  19127. arrow: {
  19128. direction: xPosInfo.arrowDirection,
  19129. position: yPosInfo.arrowTop
  19130. }
  19131. };
  19132. };
  19133. /**
  19134. * Set arrow's direction and position
  19135. * @param {Object} arrow rendering data for popup arrow
  19136. */
  19137. ScheduleDetailPopup.prototype._setArrowDirection = function(arrow) {
  19138. var direction = arrow.direction || 'arrow-left';
  19139. var arrowEl = domutil.find(config.classname('.popup-arrow'), this.layer.container);
  19140. var borderElement = domutil.find(config.classname('.popup-arrow-border'), arrowEl);
  19141. if (direction !== config.classname('arrow-left')) {
  19142. domutil.removeClass(arrowEl, config.classname('arrow-left'));
  19143. domutil.addClass(arrowEl, config.classname(direction));
  19144. }
  19145. if (arrow.position) {
  19146. borderElement.style.top = arrow.position + 'px';
  19147. }
  19148. };
  19149. /**
  19150. * Hide layer
  19151. */
  19152. ScheduleDetailPopup.prototype.hide = function() {
  19153. this.layer.hide();
  19154. if (this.guide) {
  19155. this.guide.clearGuideElement();
  19156. this.guide = null;
  19157. }
  19158. domevent.off(document.body, 'mousedown', this._onMouseDown, this);
  19159. };
  19160. /**
  19161. * refresh layer
  19162. */
  19163. ScheduleDetailPopup.prototype.refresh = function() {
  19164. if (this._viewModel) {
  19165. this.layer.setContent(this.tmpl(this._viewModel));
  19166. }
  19167. };
  19168. module.exports = ScheduleDetailPopup;
  19169. /***/ }),
  19170. /***/ "./src/js/view/template/helper.js":
  19171. /*!****************************************!*\
  19172. !*** ./src/js/view/template/helper.js ***!
  19173. \****************************************/
  19174. /*! no static exports found */
  19175. /***/ (function(module, exports, __webpack_require__) {
  19176. "use strict";
  19177. /* eslint complexity: 0 */
  19178. /**
  19179. * @fileoverview Helpers for handlebar templates.
  19180. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  19181. */
  19182. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  19183. var Handlebars = __webpack_require__(/*! handlebars-template-loader/runtime */ "./node_modules/handlebars-template-loader/runtime/index.js");
  19184. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  19185. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  19186. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  19187. var mmax = Math.max;
  19188. var SIXTY_MINUTES = 60;
  19189. var helpers = {
  19190. /**
  19191. * Stamp supplied object
  19192. *
  19193. * Commonly use for rendering object's unique ID to rendered view
  19194. * @param {object} obj - object to stamp
  19195. * @returns {number} stamp value
  19196. */
  19197. 'stamp': function(obj) {
  19198. return util.stamp(obj);
  19199. },
  19200. /**
  19201. * Whether supplied object are equal?
  19202. * @param {*} a - a
  19203. * @param {*} b - b
  19204. * @returns {boolean} result of operation
  19205. */
  19206. 'equal': function(a, b) {
  19207. return a === b;
  19208. },
  19209. /**
  19210. * OR
  19211. * @param {*} a - a
  19212. * @param {*} b - b
  19213. * @returns {boolean} or
  19214. */
  19215. 'or': function(a, b) {
  19216. return a || b;
  19217. },
  19218. /**
  19219. * AND
  19220. * @param {*} a - a
  19221. * @param {*} b - b
  19222. * @returns {boolean} or
  19223. */
  19224. 'and': function(a, b) {
  19225. return a && b;
  19226. },
  19227. /**
  19228. * Compare object or apply logical operation by customizable oper parameter
  19229. * @param {*} a - a
  19230. * @param {string} oper - operator ex) '==', '<'
  19231. * @param {*} b - b
  19232. * @param {Handlebars} options - handlebar options
  19233. * @returns {boolean} result of operation
  19234. */
  19235. 'fi': function(a, oper, b, options) {
  19236. switch (oper) {
  19237. case '==':
  19238. return (a == b) ? options.fn(this) : options.inverse(this); // eslint-disable-line
  19239. case '===':
  19240. return (a === b) ? options.fn(this) : options.inverse(this);
  19241. case '!==':
  19242. return (a !== b) ? options.fn(this) : options.inverse(this);
  19243. case '<':
  19244. return (a < b) ? options.fn(this) : options.inverse(this);
  19245. case '||':
  19246. return (a || b) ? options.fn(this) : options.inverse(this);
  19247. default:
  19248. throw new Error('Not match operation');
  19249. }
  19250. },
  19251. /**
  19252. * Get hhmm formatted time str
  19253. * @param {Date} date - date object
  19254. * @returns {string} formatted value
  19255. */
  19256. 'hhmm': function(date) {
  19257. return datetime.format(date, 'HH:mm');
  19258. },
  19259. /**
  19260. * Get `width` stylesheet string
  19261. * @param {number} width - width percentage
  19262. * @returns {string} css style part
  19263. */
  19264. 'common-width': function(width) {
  19265. return getElSize(width, '%', 'width');
  19266. },
  19267. /**
  19268. * Get element left based on narrowWeekend
  19269. * @param {object} viewModel - view model
  19270. * @param {Array} grids - dates information
  19271. * @returns {number} element left
  19272. */
  19273. 'grid-left': function(viewModel, grids) {
  19274. return getElLeft(viewModel, grids);
  19275. },
  19276. /**
  19277. * Get element width based on narrowWeekend
  19278. * @param {object} viewModel - view model
  19279. * @param {Array} grids - dates information
  19280. * @returns {number} element width
  19281. */
  19282. 'grid-width': function(viewModel, grids) {
  19283. return getElWidth(viewModel, grids);
  19284. },
  19285. /**
  19286. * Use in time.hbs
  19287. * @param {ScheduleViewModel} viewModel viewModel
  19288. * @returns {string} element size css class
  19289. */
  19290. 'time-scheduleBlock': function(viewModel) {
  19291. var top = getElSize(viewModel.top, 'px', 'top'),
  19292. left = getElSize(viewModel.left, '%', 'left'),
  19293. width = getElSize(viewModel.width, '%', 'width'),
  19294. height = getElSize(viewModel.height, 'px', 'height');
  19295. return [top, left, width, height].join(';');
  19296. },
  19297. 'month-scheduleBlock': function(viewModel, grids, blockHeight, paddingTop) {
  19298. var top = getElSize(((viewModel.top - 1) * blockHeight) + paddingTop, 'px', 'top');
  19299. var left = getElSize(grids[viewModel.left] ? grids[viewModel.left].left : 0, '%', 'left');
  19300. var width = getElSize(getElWidth(viewModel, grids), '%', 'width');
  19301. var height = getElSize(viewModel.height, 'px', 'height');
  19302. return [top, left, width, height].join(';');
  19303. },
  19304. 'holiday': function(day) {
  19305. var cssClass = '';
  19306. if (day === 0) {
  19307. cssClass = config.classname('holiday-sun');
  19308. }
  19309. if (day === 6) {
  19310. cssClass = config.classname('holiday-sat');
  19311. }
  19312. return cssClass;
  19313. },
  19314. /**
  19315. * Add supplied two parameter
  19316. * @param {*} a - a
  19317. * @param {*} b - b
  19318. * @returns {number} result of operation
  19319. */
  19320. 'add': function(a, b) {
  19321. return a + b;
  19322. },
  19323. /**
  19324. * Multiply supplied two parameter
  19325. * @param {*} a - a
  19326. * @param {*} b - b
  19327. * @returns {number} result of operation
  19328. */
  19329. 'multiply': function(a, b) {
  19330. return a * b;
  19331. },
  19332. /**
  19333. * Divide supplied two parameter
  19334. * @param {*} a - a
  19335. * @param {*} b - b
  19336. * @returns {number} result of operation
  19337. */
  19338. 'divide': function(a, b) {
  19339. return a / b;
  19340. },
  19341. /**
  19342. * Subtract supplied two parameter
  19343. * @param {*} a - a
  19344. * @param {*} b - b
  19345. * @returns {number} result of operation
  19346. */
  19347. 'subtract': function(a, b) {
  19348. return a - b;
  19349. },
  19350. 'getRight': function(a, b) {
  19351. return mmax(0, 100 - (a + b));
  19352. },
  19353. /**
  19354. * Get css prefix in global configuration
  19355. * @returns {string} css prefix
  19356. */
  19357. 'CSS_PREFIX': function() {
  19358. return config.cssPrefix;
  19359. },
  19360. 'reverse': function(array) {
  19361. return array.slice().reverse();
  19362. },
  19363. /**********
  19364. * Default schedule template
  19365. **********/
  19366. 'milestone-tmpl': function(model) {
  19367. var icon = config.classname('icon');
  19368. var iconName = config.classname('ic-milestone');
  19369. return '<span class="' + icon + ' ' + iconName + '"></span><span style="background-color: ' + model.bgColor + '">' + common.stripTags(model.title) + '</span>';
  19370. },
  19371. 'milestoneTitle-tmpl': function() {
  19372. var className = config.classname('left-content');
  19373. return '<span class="' + className + '">Milestone</span>';
  19374. },
  19375. 'task-tmpl': function(model) {
  19376. return '#' + model.title;
  19377. },
  19378. 'taskTitle-tmpl': function() {
  19379. var className = config.classname('left-content');
  19380. return '<span class="' + className + '">Task</span>';
  19381. },
  19382. 'alldayTitle-tmpl': function() {
  19383. var className = config.classname('left-content');
  19384. return '<span class="' + className + '">All Day</span>';
  19385. },
  19386. 'allday-tmpl': function(model) {
  19387. return common.stripTags(model.title);
  19388. },
  19389. 'time-tmpl': function(model) {
  19390. return common.stripTags(model.title);
  19391. },
  19392. 'goingDuration-tmpl': function(model) {
  19393. var goingDuration = model.goingDuration;
  19394. var hour = parseInt(goingDuration / SIXTY_MINUTES, 10);
  19395. var minutes = goingDuration % SIXTY_MINUTES;
  19396. return 'GoingTime ' + datetime.leadingZero(hour, 2) + ':' + datetime.leadingZero(minutes, 2);
  19397. },
  19398. 'comingDuration-tmpl': function(model) {
  19399. var goingDuration = model.goingDuration;
  19400. var hour = parseInt(goingDuration / SIXTY_MINUTES, 10);
  19401. var minutes = goingDuration % SIXTY_MINUTES;
  19402. return 'ComingTime ' + datetime.leadingZero(hour, 2) + ':' + datetime.leadingZero(minutes, 2);
  19403. },
  19404. 'monthMoreTitleDate-tmpl': function(date, dayname) {
  19405. var classDay = config.classname('month-more-title-day');
  19406. var classDayLabel = config.classname('month-more-title-day-label');
  19407. var day = util.pick(date.split('.'), 2);
  19408. return '<span class="' + classDay + '">' + day + '</span> <span class="' + classDayLabel + '">' + dayname + '</span>';
  19409. },
  19410. 'monthMoreClose-tmpl': function() {
  19411. return '';
  19412. },
  19413. 'monthGridHeader-tmpl': function(model) {
  19414. var date = parseInt(model.date.split('-')[2], 10);
  19415. var classNames = [];
  19416. classNames.push(config.classname('weekday-grid-date'));
  19417. if (model.isToday) {
  19418. classNames.push(config.classname('weekday-grid-date-decorator'));
  19419. }
  19420. return '<span class="' + classNames.join(' ') + '">' + date + '</span>';
  19421. },
  19422. 'monthGridHeaderExceed-tmpl': function(hiddenSchedules) {
  19423. var className = config.classname('weekday-grid-more-schedules');
  19424. return '<span class="' + className + '">' + hiddenSchedules + ' more</span>';
  19425. },
  19426. 'monthGridFooter-tmpl': function() {
  19427. return '';
  19428. },
  19429. /* eslint no-unused-vars: 0 */
  19430. 'monthGridFooterExceed-tmpl': function(hiddenSchedules) {
  19431. return '';
  19432. },
  19433. 'monthDayname-tmpl': function(model) {
  19434. return model.label;
  19435. },
  19436. 'weekDayname-tmpl': function(model) {
  19437. var classDate = config.classname('dayname-date');
  19438. var className = config.classname('dayname-name');
  19439. return '<span class="' + classDate + '">' + model.date + '</span>&nbsp;&nbsp;<span class="' + className + '">' + model.dayName + '</span>';
  19440. },
  19441. 'weekGridFooterExceed-tmpl': function(hiddenSchedules) {
  19442. return '+' + hiddenSchedules;
  19443. },
  19444. 'dayGridTitle-tmpl': function(viewName) {
  19445. var tmpl = Handlebars.helpers[viewName + 'Title-tmpl'];
  19446. if (tmpl) {
  19447. return tmpl(viewName);
  19448. }
  19449. return viewName;
  19450. },
  19451. 'schedule-tmpl': function(model) {
  19452. var tmpl = Handlebars.helpers[model.category + '-tmpl'];
  19453. if (tmpl) {
  19454. return tmpl(model);
  19455. }
  19456. return '';
  19457. },
  19458. 'collapseBtnTitle-tmpl': function() {
  19459. var iconName = config.classname('icon');
  19460. var closeIconName = config.classname('ic-arrow-solid-top');
  19461. return '<span class="' + iconName + ' ' + closeIconName + '"></span>';
  19462. },
  19463. 'timezoneDisplayLabel-tmpl': function(timezoneOffset, displayLabel) {
  19464. var gmt, hour, minutes;
  19465. if (util.isUndefined(displayLabel)) {
  19466. gmt = timezoneOffset < 0 ? '-' : '+';
  19467. hour = Math.abs(parseInt(timezoneOffset / SIXTY_MINUTES, 10));
  19468. minutes = Math.abs(timezoneOffset % SIXTY_MINUTES);
  19469. displayLabel = gmt + datetime.leadingZero(hour, 2) + ':' + datetime.leadingZero(minutes, 2);
  19470. }
  19471. return displayLabel;
  19472. },
  19473. 'timegridDisplayPrimayTime-tmpl': function(time) {
  19474. /* TODO: 삭제 필요 (will be deprecated) */
  19475. return Handlebars.helpers['timegridDisplayPrimaryTime-tmpl'](time);
  19476. },
  19477. 'timegridDisplayPrimaryTime-tmpl': function(time) {
  19478. var hour = time.hour;
  19479. var meridiem = hour >= 12 ? 'pm' : 'am';
  19480. if (hour > 12) {
  19481. hour = hour - 12;
  19482. }
  19483. return hour + ' ' + meridiem;
  19484. },
  19485. 'timegridDisplayTime-tmpl': function(time) {
  19486. return datetime.leadingZero(time.hour, 2) + ':' + datetime.leadingZero(time.minutes, 2);
  19487. },
  19488. 'timegridCurrentTime-tmpl': function(timezone) {
  19489. var templates = [];
  19490. if (timezone.dateDifference) {
  19491. templates.push('[' + timezone.dateDifferenceSign + timezone.dateDifference + ']<br>');
  19492. }
  19493. templates.push(datetime.format(timezone.hourmarker, 'HH:mm'));
  19494. return templates.join('');
  19495. },
  19496. 'popupIsAllDay-tmpl': function() {
  19497. return 'All day';
  19498. },
  19499. 'popupStateFree-tmpl': function() {
  19500. return 'Free';
  19501. },
  19502. 'popupStateBusy-tmpl': function() {
  19503. return 'Busy';
  19504. },
  19505. 'titlePlaceholder-tmpl': function() {
  19506. return 'Subject';
  19507. },
  19508. 'locationPlaceholder-tmpl': function() {
  19509. return 'Location';
  19510. },
  19511. 'startDatePlaceholder-tmpl': function() {
  19512. return 'Start date';
  19513. },
  19514. 'endDatePlaceholder-tmpl': function() {
  19515. return 'End date';
  19516. },
  19517. 'popupSave-tmpl': function() {
  19518. return 'Save';
  19519. },
  19520. 'popupUpdate-tmpl': function() {
  19521. return 'Update';
  19522. },
  19523. 'popupDetailDate-tmpl': function(isAllDay, start, end) {
  19524. var isSameDate = datetime.isSameDate(start, end);
  19525. var endFormat = (isSameDate ? '' : 'YYYY.MM.DD ') + 'hh:mm tt';
  19526. if (isAllDay) {
  19527. return datetime.format(start, 'YYYY.MM.DD') + (isSameDate ? '' : ' - ' + datetime.format(end, 'YYYY.MM.DD'));
  19528. }
  19529. return (datetime.format(start, 'YYYY.MM.DD hh:mm tt') + ' - ' + datetime.format(end, endFormat));
  19530. },
  19531. 'popupDetailLocation-tmpl': function(schedule) {
  19532. return schedule.location;
  19533. },
  19534. 'popupDetailUser-tmpl': function(schedule) {
  19535. return (schedule.attendees || []).join(', ');
  19536. },
  19537. 'popupDetailState-tmpl': function(schedule) {
  19538. return schedule.state || 'Busy';
  19539. },
  19540. 'popupDetailRepeat-tmpl': function(schedule) {
  19541. return schedule.recurrenceRule;
  19542. },
  19543. 'popupDetailBody-tmpl': function(schedule) {
  19544. return schedule.body;
  19545. },
  19546. 'popupEdit-tmpl': function() {
  19547. return 'Edit';
  19548. },
  19549. 'popupDelete-tmpl': function() {
  19550. return 'Delete';
  19551. }
  19552. };
  19553. /**
  19554. * Get CSS syntax for element size
  19555. * @param {number} value - size value to apply element
  19556. * @param {string} postfix - postfix string ex) px, em, %
  19557. * @param {string} prefix - property name ex) width, height
  19558. * @returns {string} CSS syntax
  19559. */
  19560. function getElSize(value, postfix, prefix) {
  19561. prefix = prefix || '';
  19562. if (util.isNumber(value)) {
  19563. return prefix + ':' + value + postfix;
  19564. }
  19565. return prefix + ':auto';
  19566. }
  19567. /**
  19568. * Get element left based on narrowWeekend
  19569. * @param {object} viewModel - view model
  19570. * @param {Array} grids - dates information
  19571. * @returns {number} element left
  19572. */
  19573. function getElLeft(viewModel, grids) {
  19574. return grids[viewModel.left] ? grids[viewModel.left].left : 0;
  19575. }
  19576. /**
  19577. * Get element width based on narrowWeekend
  19578. * @param {object} viewModel - view model
  19579. * @param {Array} grids - dates information
  19580. * @returns {number} element width
  19581. */
  19582. function getElWidth(viewModel, grids) {
  19583. var width = 0;
  19584. var i = 0;
  19585. var length = grids.length;
  19586. var left;
  19587. for (; i < viewModel.width; i += 1) {
  19588. left = (viewModel.left + i) % length;
  19589. left += parseInt((viewModel.left + i) / length, 10);
  19590. if (left < length) {
  19591. width += grids[left] ? grids[left].width : 0;
  19592. }
  19593. }
  19594. return width;
  19595. }
  19596. Handlebars.registerHelper(helpers);
  19597. /***/ }),
  19598. /***/ "./src/js/view/template/month/month.hbs":
  19599. /*!**********************************************!*\
  19600. !*** ./src/js/view/template/month/month.hbs ***!
  19601. \**********************************************/
  19602. /*! no static exports found */
  19603. /***/ (function(module, exports, __webpack_require__) {
  19604. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  19605. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  19606. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19607. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19608. return parent[propertyName];
  19609. }
  19610. return undefined
  19611. };
  19612. return " <div class=\""
  19613. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":30}}}) : helper)))
  19614. + "month-dayname-item\"\n style=\"position: absolute;\n width: "
  19615. + alias4(((helper = (helper = lookupProperty(helpers,"width") || (depth0 != null ? lookupProperty(depth0,"width") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"width","hash":{},"data":data,"loc":{"start":{"line":6,"column":23},"end":{"line":6,"column":32}}}) : helper)))
  19616. + "%;\n left: "
  19617. + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":7,"column":22},"end":{"line":7,"column":30}}}) : helper)))
  19618. + "%;\n padding-left: "
  19619. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"paddingLeft")), depth0))
  19620. + ";\n padding-right: "
  19621. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"paddingRight")), depth0))
  19622. + ";\n line-height: "
  19623. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"height")), depth0))
  19624. + ";\n"
  19625. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(data && lookupProperty(data,"last")),{"name":"unless","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":11,"column":16},"end":{"line":13,"column":27}}})) != null ? stack1 : "")
  19626. + " \">\n <span class=\""
  19627. + alias4((lookupProperty(helpers,"holiday")||(depth0 && lookupProperty(depth0,"holiday"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"day") : depth0),{"name":"holiday","hash":{},"data":data,"loc":{"start":{"line":15,"column":21},"end":{"line":15,"column":36}}}))
  19628. + "\" style=\"color: "
  19629. + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":15,"column":52},"end":{"line":15,"column":61}}}) : helper)))
  19630. + ";\">\n "
  19631. + ((stack1 = (lookupProperty(helpers,"monthDayname-tmpl")||(depth0 && lookupProperty(depth0,"monthDayname-tmpl"))||alias2).call(alias1,depth0,{"name":"monthDayname-tmpl","hash":{},"data":data,"loc":{"start":{"line":16,"column":12},"end":{"line":16,"column":40}}})) != null ? stack1 : "")
  19632. + "\n </span>\n </div>\n";
  19633. },"2":function(container,depth0,helpers,partials,data) {
  19634. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19635. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19636. return parent[propertyName];
  19637. }
  19638. return undefined
  19639. };
  19640. return " border-right: "
  19641. + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderLeft")), depth0))
  19642. + ";\n";
  19643. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  19644. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.escapeExpression, alias3=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19645. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19646. return parent[propertyName];
  19647. }
  19648. return undefined
  19649. };
  19650. return "<div class=\""
  19651. + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  19652. + "month-dayname\"\n style=\"border-top: "
  19653. + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"borderTop") : stack1), depth0))
  19654. + "; height: "
  19655. + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"height") : stack1), depth0))
  19656. + "; font-size: "
  19657. + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"fontSize") : stack1), depth0))
  19658. + "; background-color: "
  19659. + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"backgroundColor") : stack1), depth0))
  19660. + "; text-align: "
  19661. + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"textAlign") : stack1), depth0))
  19662. + "; font-weight: "
  19663. + alias2(alias3(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"fontWeight") : stack1), depth0))
  19664. + ";\">\n"
  19665. + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"daynames") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":0},"end":{"line":19,"column":9}}})) != null ? stack1 : "")
  19666. + "</div>\n";
  19667. },"useData":true});
  19668. /***/ }),
  19669. /***/ "./src/js/view/template/month/more.hbs":
  19670. /*!*********************************************!*\
  19671. !*** ./src/js/view/template/month/more.hbs ***!
  19672. \*********************************************/
  19673. /*! no static exports found */
  19674. /***/ (function(module, exports, __webpack_require__) {
  19675. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  19676. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  19677. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19678. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19679. return parent[propertyName];
  19680. }
  19681. return undefined
  19682. };
  19683. return ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),"||",(depth0 != null ? lookupProperty(depth0,"hasMultiDates") : depth0),{"name":"fi","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(7, data, 0),"data":data,"loc":{"start":{"line":9,"column":8},"end":{"line":65,"column":15}}})) != null ? stack1 : "");
  19684. },"2":function(container,depth0,helpers,partials,data) {
  19685. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4=container.lambda, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19686. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19687. return parent[propertyName];
  19688. }
  19689. return undefined
  19690. };
  19691. return "<div data-id=\""
  19692. + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":10,"column":26},"end":{"line":10,"column":41}}}))
  19693. + "\"\n data-schedule-id=\""
  19694. + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
  19695. + "\" data-calendar-id=\""
  19696. + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
  19697. + "\"\n class=\""
  19698. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":23},"end":{"line":12,"column":37}}}) : helper)))
  19699. + "month-more-schedule "
  19700. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":57},"end":{"line":12,"column":71}}}) : helper)))
  19701. + "month-more-allday "
  19702. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":89},"end":{"line":12,"column":103}}}) : helper)))
  19703. + "weekday-schedule-title\"\n style=\"height: "
  19704. + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  19705. + "px; line-height: "
  19706. + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  19707. + "px; margin-top: "
  19708. + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleGutter")), depth0))
  19709. + "px; border-radius: "
  19710. + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"borderRadius")), depth0))
  19711. + ";\n"
  19712. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.program(5, data, 0),"data":data,"loc":{"start":{"line":14,"column":20},"end":{"line":18,"column":27}}})) != null ? stack1 : "")
  19713. + " "
  19714. + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
  19715. + "\">\n "
  19716. + ((stack1 = (lookupProperty(helpers,"allday-tmpl")||(depth0 && lookupProperty(depth0,"allday-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"allday-tmpl","hash":{},"data":data,"loc":{"start":{"line":20,"column":20},"end":{"line":20,"column":43}}})) != null ? stack1 : "")
  19717. + "\n </div>\n";
  19718. },"3":function(container,depth0,helpers,partials,data) {
  19719. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19720. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19721. return parent[propertyName];
  19722. }
  19723. return undefined
  19724. };
  19725. return " color: #ffffff; background-color:"
  19726. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  19727. + "; border-left:3px solid "
  19728. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  19729. + ";\n";
  19730. },"5":function(container,depth0,helpers,partials,data) {
  19731. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19732. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19733. return parent[propertyName];
  19734. }
  19735. return undefined
  19736. };
  19737. return " color:"
  19738. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  19739. + "; background-color:"
  19740. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
  19741. + "; border-left:3px solid "
  19742. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  19743. + ";\n";
  19744. },"7":function(container,depth0,helpers,partials,data) {
  19745. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19746. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19747. return parent[propertyName];
  19748. }
  19749. return undefined
  19750. };
  19751. return ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"category") : stack1),"===","time",{"name":"fi","hash":{},"fn":container.program(8, data, 0),"inverse":container.program(17, data, 0),"data":data,"loc":{"start":{"line":23,"column":12},"end":{"line":64,"column":19}}})) != null ? stack1 : "");
  19752. },"8":function(container,depth0,helpers,partials,data) {
  19753. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4=container.lambda, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19754. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19755. return parent[propertyName];
  19756. }
  19757. return undefined
  19758. };
  19759. return " <div data-id=\""
  19760. + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":24,"column":30},"end":{"line":24,"column":45}}}))
  19761. + "\"\n data-schedule-id=\""
  19762. + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
  19763. + "\" data-calendar-id=\""
  19764. + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
  19765. + "\"\n class=\""
  19766. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":26,"column":27},"end":{"line":26,"column":41}}}) : helper)))
  19767. + "month-more-schedule "
  19768. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":26,"column":61},"end":{"line":26,"column":75}}}) : helper)))
  19769. + "weekday-schedule "
  19770. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":26,"column":92},"end":{"line":26,"column":106}}}) : helper)))
  19771. + "weekday-schedule-time\"\n style=\"height: "
  19772. + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  19773. + "px; line-height: "
  19774. + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  19775. + "px; margin-top: "
  19776. + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleGutter")), depth0))
  19777. + "px;"
  19778. + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
  19779. + "\">\n <span class=\""
  19780. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":28,"column":33},"end":{"line":28,"column":47}}}) : helper)))
  19781. + "weekday-schedule-bullet\"\n style=\"top: "
  19782. + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleBulletTop")), depth0))
  19783. + "px;\n"
  19784. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.program(11, data, 0),"data":data,"loc":{"start":{"line":30,"column":28},"end":{"line":34,"column":35}}})) != null ? stack1 : "")
  19785. + "\"></span>\n <span class=\""
  19786. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":35,"column":33},"end":{"line":35,"column":47}}}) : helper)))
  19787. + "weekday-schedule-title\"\n style=\""
  19788. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.program(15, data, 0),"data":data,"loc":{"start":{"line":36,"column":31},"end":{"line":41,"column":35}}})) != null ? stack1 : "")
  19789. + "\"\n data-title=\""
  19790. + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
  19791. + "\">"
  19792. + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":42,"column":53},"end":{"line":42,"column":74}}})) != null ? stack1 : "")
  19793. + "</span>\n </div>\n";
  19794. },"9":function(container,depth0,helpers,partials,data) {
  19795. return " background: #ffffff\n";
  19796. },"11":function(container,depth0,helpers,partials,data) {
  19797. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19798. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19799. return parent[propertyName];
  19800. }
  19801. return undefined
  19802. };
  19803. return " background:"
  19804. + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  19805. + "\n ";
  19806. },"13":function(container,depth0,helpers,partials,data) {
  19807. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19808. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19809. return parent[propertyName];
  19810. }
  19811. return undefined
  19812. };
  19813. return "\n color: #ffffff;\n background-color: "
  19814. + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  19815. + "\n";
  19816. },"15":function(container,depth0,helpers,partials,data) {
  19817. return " color:#333;\n ";
  19818. },"17":function(container,depth0,helpers,partials,data) {
  19819. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4=container.lambda, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19820. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19821. return parent[propertyName];
  19822. }
  19823. return undefined
  19824. };
  19825. return "<div data-id=\""
  19826. + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":45,"column":30},"end":{"line":45,"column":45}}}))
  19827. + "\"\n data-schedule-id=\""
  19828. + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
  19829. + "\" data-calendar-id=\""
  19830. + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
  19831. + "\"\n class=\""
  19832. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":27},"end":{"line":47,"column":41}}}) : helper)))
  19833. + "month-more-schedule "
  19834. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":61},"end":{"line":47,"column":75}}}) : helper)))
  19835. + "weekday-schedule "
  19836. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":47,"column":92},"end":{"line":47,"column":161}}})) != null ? stack1 : "")
  19837. + "\"\n style=\"height:"
  19838. + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  19839. + "px; line-height:"
  19840. + alias3(alias4(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  19841. + "px; border-radius: "
  19842. + alias3(alias4(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
  19843. + ";\n"
  19844. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedLeft") : depth0),{"name":"unless","hash":{},"fn":container.program(20, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":49,"column":20},"end":{"line":51,"column":31}}})) != null ? stack1 : "")
  19845. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedRight") : depth0),{"name":"unless","hash":{},"fn":container.program(22, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":52,"column":20},"end":{"line":54,"column":31}}})) != null ? stack1 : "")
  19846. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.program(26, data, 0),"data":data,"loc":{"start":{"line":55,"column":20},"end":{"line":59,"column":27}}})) != null ? stack1 : "")
  19847. + " "
  19848. + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
  19849. + "\">\n <span class=\""
  19850. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias5 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":61,"column":33},"end":{"line":61,"column":47}}}) : helper)))
  19851. + "weekday-schedule-title\"\n data-title=\""
  19852. + alias3(alias4(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
  19853. + "\">"
  19854. + ((stack1 = (lookupProperty(helpers,"schedule-tmpl")||(depth0 && lookupProperty(depth0,"schedule-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"schedule-tmpl","hash":{},"data":data,"loc":{"start":{"line":62,"column":65},"end":{"line":62,"column":90}}})) != null ? stack1 : "")
  19855. + "</span>\n </div>\n";
  19856. },"18":function(container,depth0,helpers,partials,data) {
  19857. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19858. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19859. return parent[propertyName];
  19860. }
  19861. return undefined
  19862. };
  19863. return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":115},"end":{"line":47,"column":129}}}) : helper)))
  19864. + "weekday-schedule-focused ";
  19865. },"20":function(container,depth0,helpers,partials,data) {
  19866. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19867. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19868. return parent[propertyName];
  19869. }
  19870. return undefined
  19871. };
  19872. return " margin-left: "
  19873. + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginLeft")), depth0))
  19874. + ";\n";
  19875. },"22":function(container,depth0,helpers,partials,data) {
  19876. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19877. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19878. return parent[propertyName];
  19879. }
  19880. return undefined
  19881. };
  19882. return " margin-right: "
  19883. + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginRight")), depth0))
  19884. + ";\n";
  19885. },"24":function(container,depth0,helpers,partials,data) {
  19886. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19887. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19888. return parent[propertyName];
  19889. }
  19890. return undefined
  19891. };
  19892. return " color: #ffffff; background-color:"
  19893. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  19894. + "; border-color:"
  19895. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  19896. + ";\n";
  19897. },"26":function(container,depth0,helpers,partials,data) {
  19898. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19899. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19900. return parent[propertyName];
  19901. }
  19902. return undefined
  19903. };
  19904. return " color:"
  19905. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  19906. + "; background-color:"
  19907. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
  19908. + "; border-color:"
  19909. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  19910. + ";\n";
  19911. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  19912. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19913. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19914. return parent[propertyName];
  19915. }
  19916. return undefined
  19917. };
  19918. return "<div class=\""
  19919. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  19920. + "month-more\" style=\"padding-bottom: "
  19921. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"paddingBottom") : stack1), depth0))
  19922. + "; border: "
  19923. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"border") : stack1), depth0))
  19924. + "; box-shadow: "
  19925. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"boxShadow") : stack1), depth0))
  19926. + "; background-color: "
  19927. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"backgroundColor") : stack1), depth0))
  19928. + ";\">\n <div class=\""
  19929. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":30}}}) : helper)))
  19930. + "month-more-title\"\n style=\"height: "
  19931. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"titleHeight") : stack1), depth0))
  19932. + "; margin-bottom: "
  19933. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"titleMarginBottom") : stack1), depth0))
  19934. + "; background-color: "
  19935. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"titleBackgroundColor") : stack1), depth0))
  19936. + "; border-bottom: "
  19937. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"titleBorderBottom") : stack1), depth0))
  19938. + "; padding: "
  19939. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"titlePadding") : stack1), depth0))
  19940. + ";\">\n <span class=\""
  19941. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":35}}}) : helper)))
  19942. + "month-more-title-date\">"
  19943. + ((stack1 = (lookupProperty(helpers,"monthMoreTitleDate-tmpl")||(depth0 && lookupProperty(depth0,"monthMoreTitleDate-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"date") : depth0),(depth0 != null ? lookupProperty(depth0,"dayname") : depth0),{"name":"monthMoreTitleDate-tmpl","hash":{},"data":data,"loc":{"start":{"line":4,"column":58},"end":{"line":4,"column":100}}})) != null ? stack1 : "")
  19944. + "</span>\n <button type=\"button\" class=\""
  19945. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":37},"end":{"line":5,"column":51}}}) : helper)))
  19946. + "month-more-close\">"
  19947. + ((stack1 = ((helper = (helper = lookupProperty(helpers,"monthMoreClose-tmpl") || (depth0 != null ? lookupProperty(depth0,"monthMoreClose-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"monthMoreClose-tmpl","hash":{},"data":data,"loc":{"start":{"line":5,"column":69},"end":{"line":5,"column":94}}}) : helper))) != null ? stack1 : "")
  19948. + "</button>\n </div>\n <div class=\""
  19949. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":30}}}) : helper)))
  19950. + "month-more-list\" style=\"padding: "
  19951. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"listPadding") : stack1), depth0))
  19952. + "; height: "
  19953. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"listHeight") : stack1), depth0))
  19954. + ";\">\n"
  19955. + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"schedules") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":8},"end":{"line":66,"column":17}}})) != null ? stack1 : "")
  19956. + " </div>\n</div>\n";
  19957. },"useData":true});
  19958. /***/ }),
  19959. /***/ "./src/js/view/template/month/weekdayInMonth.hbs":
  19960. /*!*******************************************************!*\
  19961. !*** ./src/js/view/template/month/weekdayInMonth.hbs ***!
  19962. \*******************************************************/
  19963. /*! no static exports found */
  19964. /***/ (function(module, exports, __webpack_require__) {
  19965. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  19966. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  19967. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  19968. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  19969. return parent[propertyName];
  19970. }
  19971. return undefined
  19972. };
  19973. return "<div class=\""
  19974. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":30}}}) : helper)))
  19975. + "weekday-grid-line "
  19976. + alias4((lookupProperty(helpers,"holiday")||(depth0 && lookupProperty(depth0,"holiday"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"day") : depth0),{"name":"holiday","hash":{},"data":data,"loc":{"start":{"line":7,"column":48},"end":{"line":7,"column":63}}}))
  19977. + ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"date") : depth0),"!==",1,{"name":"fi","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":63},"end":{"line":7,"column":119}}})) != null ? stack1 : "")
  19978. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isToday") : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":119},"end":{"line":7,"column":161}}})) != null ? stack1 : "")
  19979. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isOtherMonth") : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":161},"end":{"line":7,"column":213}}})) != null ? stack1 : "")
  19980. + "\"\n style=\"width:"
  19981. + alias4(((helper = (helper = lookupProperty(helpers,"width") || (depth0 != null ? lookupProperty(depth0,"width") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"width","hash":{},"data":data,"loc":{"start":{"line":8,"column":21},"end":{"line":8,"column":30}}}) : helper)))
  19982. + "%; left:"
  19983. + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":8,"column":38},"end":{"line":8,"column":46}}}) : helper)))
  19984. + "%; background-color: "
  19985. + alias4(((helper = (helper = lookupProperty(helpers,"backgroundColor") || (depth0 != null ? lookupProperty(depth0,"backgroundColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"backgroundColor","hash":{},"data":data,"loc":{"start":{"line":8,"column":67},"end":{"line":8,"column":86}}}) : helper)))
  19986. + "; font-size: "
  19987. + alias4(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"fontSize")), depth0))
  19988. + ";\n"
  19989. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(data && lookupProperty(data,"last")),{"name":"unless","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":8},"end":{"line":11,"column":19}}})) != null ? stack1 : "")
  19990. + " \">\n <div class=\""
  19991. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":20},"end":{"line":13,"column":34}}}) : helper)))
  19992. + "weekday-grid-header\">\n <span style=\"color: "
  19993. + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":14,"column":32},"end":{"line":14,"column":41}}}) : helper)))
  19994. + ";\">"
  19995. + ((stack1 = (lookupProperty(helpers,"monthGridHeader-tmpl")||(depth0 && lookupProperty(depth0,"monthGridHeader-tmpl"))||alias2).call(alias1,depth0,{"name":"monthGridHeader-tmpl","hash":{},"data":data,"loc":{"start":{"line":14,"column":44},"end":{"line":14,"column":75}}})) != null ? stack1 : "")
  19996. + "</span>\n"
  19997. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":15,"column":12},"end":{"line":17,"column":19}}})) != null ? stack1 : "")
  19998. + " </div>\n <div class=\""
  19999. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":19,"column":20},"end":{"line":19,"column":34}}}) : helper)))
  20000. + "weekday-grid-footer\">\n <span style=\"color: "
  20001. + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":20,"column":32},"end":{"line":20,"column":41}}}) : helper)))
  20002. + ";\">"
  20003. + ((stack1 = (lookupProperty(helpers,"monthGridFooter-tmpl")||(depth0 && lookupProperty(depth0,"monthGridFooter-tmpl"))||alias2).call(alias1,depth0,{"name":"monthGridFooter-tmpl","hash":{},"data":data,"loc":{"start":{"line":20,"column":44},"end":{"line":20,"column":75}}})) != null ? stack1 : "")
  20004. + "</span>\n"
  20005. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"if","hash":{},"fn":container.program(12, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":21,"column":12},"end":{"line":23,"column":19}}})) != null ? stack1 : "")
  20006. + " </div>\n </div>\n";
  20007. },"2":function(container,depth0,helpers,partials,data) {
  20008. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20009. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20010. return parent[propertyName];
  20011. }
  20012. return undefined
  20013. };
  20014. return " "
  20015. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":84},"end":{"line":7,"column":98}}}) : helper)))
  20016. + "near-month-day";
  20017. },"4":function(container,depth0,helpers,partials,data) {
  20018. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20019. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20020. return parent[propertyName];
  20021. }
  20022. return undefined
  20023. };
  20024. return " "
  20025. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":135},"end":{"line":7,"column":149}}}) : helper)))
  20026. + "today";
  20027. },"6":function(container,depth0,helpers,partials,data) {
  20028. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20029. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20030. return parent[propertyName];
  20031. }
  20032. return undefined
  20033. };
  20034. return " "
  20035. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":182},"end":{"line":7,"column":196}}}) : helper)))
  20036. + "extra-date";
  20037. },"8":function(container,depth0,helpers,partials,data) {
  20038. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20039. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20040. return parent[propertyName];
  20041. }
  20042. return undefined
  20043. };
  20044. return " border-right:"
  20045. + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderLeft")), depth0))
  20046. + ";\n";
  20047. },"10":function(container,depth0,helpers,partials,data) {
  20048. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20049. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20050. return parent[propertyName];
  20051. }
  20052. return undefined
  20053. };
  20054. return " <span class=\""
  20055. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":29},"end":{"line":16,"column":43}}}) : helper)))
  20056. + "weekday-exceed-in-month\" data-ymd=\""
  20057. + alias4(((helper = (helper = lookupProperty(helpers,"ymd") || (depth0 != null ? lookupProperty(depth0,"ymd") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"ymd","hash":{},"data":data,"loc":{"start":{"line":16,"column":78},"end":{"line":16,"column":85}}}) : helper)))
  20058. + "\">"
  20059. + ((stack1 = (lookupProperty(helpers,"monthGridHeaderExceed-tmpl")||(depth0 && lookupProperty(depth0,"monthGridHeaderExceed-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"monthGridHeaderExceed-tmpl","hash":{},"data":data,"loc":{"start":{"line":16,"column":87},"end":{"line":16,"column":135}}})) != null ? stack1 : "")
  20060. + "</span>\n";
  20061. },"12":function(container,depth0,helpers,partials,data) {
  20062. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20063. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20064. return parent[propertyName];
  20065. }
  20066. return undefined
  20067. };
  20068. return " <span class=\""
  20069. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":22,"column":29},"end":{"line":22,"column":43}}}) : helper)))
  20070. + "weekday-exceed-in-month\" data-ymd=\""
  20071. + alias4(((helper = (helper = lookupProperty(helpers,"ymd") || (depth0 != null ? lookupProperty(depth0,"ymd") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"ymd","hash":{},"data":data,"loc":{"start":{"line":22,"column":78},"end":{"line":22,"column":85}}}) : helper)))
  20072. + "\">"
  20073. + ((stack1 = (lookupProperty(helpers,"monthGridFooterExceed-tmpl")||(depth0 && lookupProperty(depth0,"monthGridFooterExceed-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"monthGridFooterExceed-tmpl","hash":{},"data":data,"loc":{"start":{"line":22,"column":87},"end":{"line":22,"column":135}}})) != null ? stack1 : "")
  20074. + "</span>\n";
  20075. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  20076. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20077. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20078. return parent[propertyName];
  20079. }
  20080. return undefined
  20081. };
  20082. return "<div class=\""
  20083. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  20084. + "weekday-border\"\n style=\"\n border-top: "
  20085. + alias4(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"borderTop") : stack1), depth0))
  20086. + ";\n\"></div>\n<div class=\""
  20087. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":26}}}) : helper)))
  20088. + "weekday-grid\">\n"
  20089. + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"dates") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":6,"column":0},"end":{"line":26,"column":11}}})) != null ? stack1 : "")
  20090. + "</div>\n<div class=\""
  20091. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":28,"column":12},"end":{"line":28,"column":26}}}) : helper)))
  20092. + "weekday-schedules\"></div>\n";
  20093. },"useData":true});
  20094. /***/ }),
  20095. /***/ "./src/js/view/template/month/weekdayInMonthSchedule.hbs":
  20096. /*!***************************************************************!*\
  20097. !*** ./src/js/view/template/month/weekdayInMonthSchedule.hbs ***!
  20098. \***************************************************************/
  20099. /*! no static exports found */
  20100. /***/ (function(module, exports, __webpack_require__) {
  20101. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  20102. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  20103. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20104. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20105. return parent[propertyName];
  20106. }
  20107. return undefined
  20108. };
  20109. return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":0},"end":{"line":80,"column":11}}})) != null ? stack1 : "");
  20110. },"2":function(container,depth0,helpers,partials,data) {
  20111. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20112. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20113. return parent[propertyName];
  20114. }
  20115. return undefined
  20116. };
  20117. return "\n"
  20118. + ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":0},"end":{"line":79,"column":11}}})) != null ? stack1 : "");
  20119. },"3":function(container,depth0,helpers,partials,data) {
  20120. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20121. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20122. return parent[propertyName];
  20123. }
  20124. return undefined
  20125. };
  20126. return "\n"
  20127. + ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":0},"end":{"line":78,"column":9}}})) != null ? stack1 : "");
  20128. },"4":function(container,depth0,helpers,partials,data) {
  20129. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20130. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20131. return parent[propertyName];
  20132. }
  20133. return undefined
  20134. };
  20135. return "\n"
  20136. + ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"top") : depth0),"<",((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"renderLimitIdx")),{"name":"fi","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":4},"end":{"line":77,"column":13}}})) != null ? stack1 : "");
  20137. },"5":function(container,depth0,helpers,partials,data) {
  20138. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20139. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20140. return parent[propertyName];
  20141. }
  20142. return undefined
  20143. };
  20144. return "<div data-id=\""
  20145. + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":6,"column":18},"end":{"line":6,"column":33}}}))
  20146. + "\"\n class=\""
  20147. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":30}}}) : helper)))
  20148. + "weekday-schedule-block\n "
  20149. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":16},"end":{"line":8,"column":30}}}) : helper)))
  20150. + "weekday-schedule-block-"
  20151. + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":8,"column":53},"end":{"line":8,"column":68}}}))
  20152. + "\n "
  20153. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedLeft") : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":71}}})) != null ? stack1 : "")
  20154. + "\n "
  20155. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedRight") : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":73}}})) != null ? stack1 : "")
  20156. + "\"\n style=\""
  20157. + alias3((lookupProperty(helpers,"month-scheduleBlock")||(depth0 && lookupProperty(depth0,"month-scheduleBlock"))||alias2).call(alias1,depth0,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"dates")),((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleBlockHeight")),((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"gridHeaderHeight")),{"name":"month-scheduleBlock","hash":{},"data":data,"loc":{"start":{"line":11,"column":16},"end":{"line":11,"column":105}}}))
  20158. + ";\n margin-top:"
  20159. + alias3(container.lambda(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleBlockGutter")), depth0))
  20160. + "px\">\n"
  20161. + ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||alias2).call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),"||",(depth0 != null ? lookupProperty(depth0,"hasMultiDates") : depth0),{"name":"fi","hash":{},"fn":container.program(10, data, 0),"inverse":container.program(23, data, 0),"data":data,"loc":{"start":{"line":13,"column":8},"end":{"line":75,"column":15}}})) != null ? stack1 : "")
  20162. + " </div>\n";
  20163. },"6":function(container,depth0,helpers,partials,data) {
  20164. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20165. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20166. return parent[propertyName];
  20167. }
  20168. return undefined
  20169. };
  20170. return " "
  20171. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":9,"column":31},"end":{"line":9,"column":45}}}) : helper)))
  20172. + "weekday-exceed-left";
  20173. },"8":function(container,depth0,helpers,partials,data) {
  20174. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20175. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20176. return parent[propertyName];
  20177. }
  20178. return undefined
  20179. };
  20180. return " "
  20181. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":10,"column":32},"end":{"line":10,"column":46}}}) : helper)))
  20182. + "weekday-exceed-right";
  20183. },"10":function(container,depth0,helpers,partials,data) {
  20184. var stack1, helper, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : (container.nullContext || {}), alias4=container.hooks.helperMissing, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20185. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20186. return parent[propertyName];
  20187. }
  20188. return undefined
  20189. };
  20190. return " <div data-schedule-id=\""
  20191. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
  20192. + "\" data-calendar-id=\""
  20193. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
  20194. + "\" class=\""
  20195. + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":92},"end":{"line":14,"column":106}}}) : helper)))
  20196. + "weekday-schedule "
  20197. + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":123},"end":{"line":14,"column":192}}})) != null ? stack1 : "")
  20198. + "\"\n style=\"height:"
  20199. + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  20200. + "px; line-height:"
  20201. + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  20202. + "px; border-radius: "
  20203. + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
  20204. + ";\n"
  20205. + ((stack1 = lookupProperty(helpers,"unless").call(alias3,(depth0 != null ? lookupProperty(depth0,"exceedLeft") : depth0),{"name":"unless","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":16,"column":16},"end":{"line":18,"column":27}}})) != null ? stack1 : "")
  20206. + ((stack1 = lookupProperty(helpers,"unless").call(alias3,(depth0 != null ? lookupProperty(depth0,"exceedRight") : depth0),{"name":"unless","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":19,"column":16},"end":{"line":21,"column":27}}})) != null ? stack1 : "")
  20207. + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(17, data, 0),"inverse":container.program(19, data, 0),"data":data,"loc":{"start":{"line":22,"column":16},"end":{"line":26,"column":23}}})) != null ? stack1 : "")
  20208. + " "
  20209. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
  20210. + "\">\n <span class=\""
  20211. + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":28,"column":25},"end":{"line":28,"column":39}}}) : helper)))
  20212. + "weekday-schedule-title\"\n data-title=\""
  20213. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
  20214. + "\">"
  20215. + ((stack1 = (lookupProperty(helpers,"allday-tmpl")||(depth0 && lookupProperty(depth0,"allday-tmpl"))||alias4).call(alias3,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"allday-tmpl","hash":{},"data":data,"loc":{"start":{"line":29,"column":47},"end":{"line":29,"column":70}}})) != null ? stack1 : "")
  20216. + "</span>\n "
  20217. + ((stack1 = lookupProperty(helpers,"unless").call(alias3,(lookupProperty(helpers,"or")||(depth0 && lookupProperty(depth0,"or"))||alias4).call(alias3,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"isReadOnly")),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isReadOnly") : stack1),{"name":"or","hash":{},"data":data,"loc":{"start":{"line":30,"column":22},"end":{"line":30,"column":60}}}),{"name":"unless","hash":{},"fn":container.program(21, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":30,"column":12},"end":{"line":30,"column":194}}})) != null ? stack1 : "")
  20218. + "\n </div>\n";
  20219. },"11":function(container,depth0,helpers,partials,data) {
  20220. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20221. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20222. return parent[propertyName];
  20223. }
  20224. return undefined
  20225. };
  20226. return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":146},"end":{"line":14,"column":160}}}) : helper)))
  20227. + "weekday-schedule-focused ";
  20228. },"13":function(container,depth0,helpers,partials,data) {
  20229. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20230. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20231. return parent[propertyName];
  20232. }
  20233. return undefined
  20234. };
  20235. return " margin-left: "
  20236. + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginLeft")), depth0))
  20237. + ";\n";
  20238. },"15":function(container,depth0,helpers,partials,data) {
  20239. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20240. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20241. return parent[propertyName];
  20242. }
  20243. return undefined
  20244. };
  20245. return " margin-right: "
  20246. + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginRight")), depth0))
  20247. + ";\n";
  20248. },"17":function(container,depth0,helpers,partials,data) {
  20249. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20250. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20251. return parent[propertyName];
  20252. }
  20253. return undefined
  20254. };
  20255. return " color: #ffffff; background-color:"
  20256. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  20257. + "; border-color:"
  20258. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  20259. + ";\n";
  20260. },"19":function(container,depth0,helpers,partials,data) {
  20261. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20262. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20263. return parent[propertyName];
  20264. }
  20265. return undefined
  20266. };
  20267. return " color:"
  20268. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  20269. + "; background-color:"
  20270. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
  20271. + "; border-color:"
  20272. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  20273. + ";\n";
  20274. },"21":function(container,depth0,helpers,partials,data) {
  20275. var stack1, helper, alias1=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20276. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20277. return parent[propertyName];
  20278. }
  20279. return undefined
  20280. };
  20281. return "<span class=\""
  20282. + alias1(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":75},"end":{"line":30,"column":89}}}) : helper)))
  20283. + "weekday-resize-handle handle-y\" style=\"line-height: "
  20284. + alias1(container.lambda(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  20285. + "px;\">&nbsp;</span>";
  20286. },"23":function(container,depth0,helpers,partials,data) {
  20287. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20288. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20289. return parent[propertyName];
  20290. }
  20291. return undefined
  20292. };
  20293. return ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"category") : stack1),"===","time",{"name":"fi","hash":{},"fn":container.program(24, data, 0),"inverse":container.program(33, data, 0),"data":data,"loc":{"start":{"line":33,"column":12},"end":{"line":74,"column":19}}})) != null ? stack1 : "");
  20294. },"24":function(container,depth0,helpers,partials,data) {
  20295. var stack1, helper, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : (container.nullContext || {}), alias4=container.hooks.helperMissing, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20296. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20297. return parent[propertyName];
  20298. }
  20299. return undefined
  20300. };
  20301. return " <div data-schedule-id=\""
  20302. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
  20303. + "\" data-calendar-id=\""
  20304. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
  20305. + "\" class=\""
  20306. + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":34,"column":100},"end":{"line":34,"column":114}}}) : helper)))
  20307. + "weekday-schedule "
  20308. + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":34,"column":131},"end":{"line":34,"column":145}}}) : helper)))
  20309. + "weekday-schedule-time\"\n style=\"height:"
  20310. + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  20311. + "px; line-height:"
  20312. + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  20313. + "px; "
  20314. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
  20315. + "\">\n <span class=\""
  20316. + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":36,"column":33},"end":{"line":36,"column":47}}}) : helper)))
  20317. + "weekday-schedule-bullet\"\n style=\"top: "
  20318. + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"scheduleBulletTop")), depth0))
  20319. + "px;\n"
  20320. + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(25, data, 0),"inverse":container.program(27, data, 0),"data":data,"loc":{"start":{"line":38,"column":28},"end":{"line":42,"column":35}}})) != null ? stack1 : "")
  20321. + " \"\n ></span>\n <span class=\""
  20322. + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":45,"column":33},"end":{"line":45,"column":47}}}) : helper)))
  20323. + "weekday-schedule-title\"\n style=\"\n"
  20324. + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(29, data, 0),"inverse":container.program(31, data, 0),"data":data,"loc":{"start":{"line":47,"column":28},"end":{"line":52,"column":35}}})) != null ? stack1 : "")
  20325. + " \"\n data-title=\""
  20326. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
  20327. + "\">"
  20328. + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||alias4).call(alias3,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":54,"column":53},"end":{"line":54,"column":74}}})) != null ? stack1 : "")
  20329. + "</span>\n </div>\n";
  20330. },"25":function(container,depth0,helpers,partials,data) {
  20331. return " background: #ffffff\n";
  20332. },"27":function(container,depth0,helpers,partials,data) {
  20333. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20334. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20335. return parent[propertyName];
  20336. }
  20337. return undefined
  20338. };
  20339. return " background:"
  20340. + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  20341. + "\n";
  20342. },"29":function(container,depth0,helpers,partials,data) {
  20343. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20344. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20345. return parent[propertyName];
  20346. }
  20347. return undefined
  20348. };
  20349. return " color: #ffffff;\n background-color: "
  20350. + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  20351. + "\n";
  20352. },"31":function(container,depth0,helpers,partials,data) {
  20353. return " color:#333;\n";
  20354. },"33":function(container,depth0,helpers,partials,data) {
  20355. var stack1, helper, alias1=container.lambda, alias2=container.escapeExpression, alias3=depth0 != null ? depth0 : (container.nullContext || {}), alias4=container.hooks.helperMissing, alias5="function", lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20356. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20357. return parent[propertyName];
  20358. }
  20359. return undefined
  20360. };
  20361. return "<div data-schedule-id=\""
  20362. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
  20363. + "\" data-calendar-id=\""
  20364. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
  20365. + "\" class=\""
  20366. + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":57,"column":100},"end":{"line":57,"column":114}}}) : helper)))
  20367. + "weekday-schedule "
  20368. + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":57,"column":131},"end":{"line":57,"column":200}}})) != null ? stack1 : "")
  20369. + "\"\n style=\"height:"
  20370. + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  20371. + "px; line-height:"
  20372. + alias2(alias1(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  20373. + "px; border-radius: "
  20374. + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
  20375. + ";\n"
  20376. + ((stack1 = lookupProperty(helpers,"unless").call(alias3,(depth0 != null ? lookupProperty(depth0,"exceedLeft") : depth0),{"name":"unless","hash":{},"fn":container.program(34, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":59,"column":20},"end":{"line":61,"column":31}}})) != null ? stack1 : "")
  20377. + ((stack1 = lookupProperty(helpers,"unless").call(alias3,(depth0 != null ? lookupProperty(depth0,"exceedRight") : depth0),{"name":"unless","hash":{},"fn":container.program(36, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":62,"column":20},"end":{"line":64,"column":31}}})) != null ? stack1 : "")
  20378. + ((stack1 = lookupProperty(helpers,"if").call(alias3,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(38, data, 0),"inverse":container.program(40, data, 0),"data":data,"loc":{"start":{"line":65,"column":20},"end":{"line":69,"column":27}}})) != null ? stack1 : "")
  20379. + " "
  20380. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
  20381. + "\">\n <span class=\""
  20382. + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias4),(typeof helper === alias5 ? helper.call(alias3,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":71,"column":33},"end":{"line":71,"column":47}}}) : helper)))
  20383. + "weekday-schedule-title\"\n data-title=\""
  20384. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
  20385. + "\">"
  20386. + ((stack1 = (lookupProperty(helpers,"schedule-tmpl")||(depth0 && lookupProperty(depth0,"schedule-tmpl"))||alias4).call(alias3,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"schedule-tmpl","hash":{},"data":data,"loc":{"start":{"line":72,"column":65},"end":{"line":72,"column":90}}})) != null ? stack1 : "")
  20387. + "</span>\n </div>\n";
  20388. },"34":function(container,depth0,helpers,partials,data) {
  20389. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20390. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20391. return parent[propertyName];
  20392. }
  20393. return undefined
  20394. };
  20395. return " margin-left: "
  20396. + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginLeft")), depth0))
  20397. + ";\n";
  20398. },"36":function(container,depth0,helpers,partials,data) {
  20399. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20400. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20401. return parent[propertyName];
  20402. }
  20403. return undefined
  20404. };
  20405. return " margin-right: "
  20406. + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginRight")), depth0))
  20407. + ";\n";
  20408. },"38":function(container,depth0,helpers,partials,data) {
  20409. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20410. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20411. return parent[propertyName];
  20412. }
  20413. return undefined
  20414. };
  20415. return " color: #ffffff; background-color:"
  20416. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  20417. + "; border-color:"
  20418. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  20419. + ";\n";
  20420. },"40":function(container,depth0,helpers,partials,data) {
  20421. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20422. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20423. return parent[propertyName];
  20424. }
  20425. return undefined
  20426. };
  20427. return " color:"
  20428. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  20429. + "; background-color:"
  20430. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
  20431. + "; border-color:"
  20432. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  20433. + ";\n";
  20434. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  20435. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20436. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20437. return parent[propertyName];
  20438. }
  20439. return undefined
  20440. };
  20441. return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"matrices") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":1,"column":0},"end":{"line":81,"column":11}}})) != null ? stack1 : "");
  20442. },"useData":true});
  20443. /***/ }),
  20444. /***/ "./src/js/view/template/popup/scheduleCreationPopup.hbs":
  20445. /*!**************************************************************!*\
  20446. !*** ./src/js/view/template/popup/scheduleCreationPopup.hbs ***!
  20447. \**************************************************************/
  20448. /*! no static exports found */
  20449. /***/ (function(module, exports, __webpack_require__) {
  20450. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  20451. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  20452. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20453. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20454. return parent[propertyName];
  20455. }
  20456. return undefined
  20457. };
  20458. return " "
  20459. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":150},"end":{"line":3,"column":164}}}) : helper)))
  20460. + "hide";
  20461. },"3":function(container,depth0,helpers,partials,data) {
  20462. var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20463. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20464. return parent[propertyName];
  20465. }
  20466. return undefined
  20467. };
  20468. return " <li class=\""
  20469. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":31},"end":{"line":11,"column":45}}}) : helper)))
  20470. + "popup-section-item "
  20471. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":64},"end":{"line":11,"column":78}}}) : helper)))
  20472. + "dropdown-menu-item\" data-calendar-id=\""
  20473. + alias4(((helper = (helper = lookupProperty(helpers,"id") || (depth0 != null ? lookupProperty(depth0,"id") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"id","hash":{},"data":data,"loc":{"start":{"line":11,"column":116},"end":{"line":11,"column":122}}}) : helper)))
  20474. + "\">\n <span class=\""
  20475. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":37},"end":{"line":12,"column":51}}}) : helper)))
  20476. + "icon "
  20477. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":56},"end":{"line":12,"column":70}}}) : helper)))
  20478. + "calendar-dot\" style=\"background-color: "
  20479. + alias4(((helper = (helper = lookupProperty(helpers,"bgColor") || (depth0 != null ? lookupProperty(depth0,"bgColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"bgColor","hash":{},"data":data,"loc":{"start":{"line":12,"column":109},"end":{"line":12,"column":120}}}) : helper)))
  20480. + "\"></span>\n <span class=\""
  20481. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":37},"end":{"line":13,"column":51}}}) : helper)))
  20482. + "content\">"
  20483. + alias4(((helper = (helper = lookupProperty(helpers,"name") || (depth0 != null ? lookupProperty(depth0,"name") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data,"loc":{"start":{"line":13,"column":60},"end":{"line":13,"column":68}}}) : helper)))
  20484. + "</span>\n </li>\n";
  20485. },"5":function(container,depth0,helpers,partials,data) {
  20486. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20487. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20488. return parent[propertyName];
  20489. }
  20490. return undefined
  20491. };
  20492. return " "
  20493. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":135},"end":{"line":23,"column":149}}}) : helper)))
  20494. + "public";
  20495. },"7":function(container,depth0,helpers,partials,data) {
  20496. return " checked";
  20497. },"9":function(container,depth0,helpers,partials,data) {
  20498. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20499. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20500. return parent[propertyName];
  20501. }
  20502. return undefined
  20503. };
  20504. return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"state") || (depth0 != null ? lookupProperty(depth0,"state") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"state","hash":{},"data":data,"loc":{"start":{"line":54,"column":99},"end":{"line":54,"column":108}}}) : helper)));
  20505. },"11":function(container,depth0,helpers,partials,data) {
  20506. var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20507. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20508. return parent[propertyName];
  20509. }
  20510. return undefined
  20511. };
  20512. return ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupStateBusy-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupStateBusy-tmpl") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"popupStateBusy-tmpl","hash":{},"data":data,"loc":{"start":{"line":54,"column":116},"end":{"line":54,"column":141}}}) : helper))) != null ? stack1 : "");
  20513. },"13":function(container,depth0,helpers,partials,data) {
  20514. var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20515. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20516. return parent[propertyName];
  20517. }
  20518. return undefined
  20519. };
  20520. return ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupUpdate-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupUpdate-tmpl") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"popupUpdate-tmpl","hash":{},"data":data,"loc":{"start":{"line":69,"column":163},"end":{"line":69,"column":185}}}) : helper))) != null ? stack1 : "");
  20521. },"15":function(container,depth0,helpers,partials,data) {
  20522. var stack1, helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20523. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20524. return parent[propertyName];
  20525. }
  20526. return undefined
  20527. };
  20528. return ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupSave-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupSave-tmpl") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"popupSave-tmpl","hash":{},"data":data,"loc":{"start":{"line":69,"column":193},"end":{"line":69,"column":213}}}) : helper))) != null ? stack1 : "");
  20529. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  20530. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20531. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20532. return parent[propertyName];
  20533. }
  20534. return undefined
  20535. };
  20536. return "<div class=\""
  20537. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  20538. + "popup\">\n <div class=\""
  20539. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":30}}}) : helper)))
  20540. + "popup-container\">\n <div class=\""
  20541. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":34}}}) : helper)))
  20542. + "popup-section "
  20543. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":48},"end":{"line":3,"column":62}}}) : helper)))
  20544. + "dropdown "
  20545. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":71},"end":{"line":3,"column":85}}}) : helper)))
  20546. + "close "
  20547. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":91},"end":{"line":3,"column":105}}}) : helper)))
  20548. + "section-calendar"
  20549. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"calendars") : depth0)) != null ? lookupProperty(stack1,"length") : stack1),{"name":"unless","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":121},"end":{"line":3,"column":179}}})) != null ? stack1 : "")
  20550. + "\">\n <button class=\""
  20551. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":27},"end":{"line":4,"column":41}}}) : helper)))
  20552. + "button "
  20553. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":48},"end":{"line":4,"column":62}}}) : helper)))
  20554. + "dropdown-button "
  20555. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":78},"end":{"line":4,"column":92}}}) : helper)))
  20556. + "popup-section-item\">\n <span class=\""
  20557. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":29},"end":{"line":5,"column":43}}}) : helper)))
  20558. + "icon "
  20559. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":48},"end":{"line":5,"column":62}}}) : helper)))
  20560. + "calendar-dot\" style=\"background-color: "
  20561. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"selectedCal") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
  20562. + "\"></span>\n <span id=\""
  20563. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":26},"end":{"line":6,"column":40}}}) : helper)))
  20564. + "schedule-calendar\" class=\""
  20565. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":66},"end":{"line":6,"column":80}}}) : helper)))
  20566. + "content\">"
  20567. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"selectedCal") : depth0)) != null ? lookupProperty(stack1,"name") : stack1), depth0))
  20568. + "</span>\n <span class=\""
  20569. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":29},"end":{"line":7,"column":43}}}) : helper)))
  20570. + "icon "
  20571. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":48},"end":{"line":7,"column":62}}}) : helper)))
  20572. + "dropdown-arrow\"></span>\n </button>\n <ul class=\""
  20573. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":9,"column":23},"end":{"line":9,"column":37}}}) : helper)))
  20574. + "dropdown-menu\" style=\"z-index: "
  20575. + alias4(((helper = (helper = lookupProperty(helpers,"zIndex") || (depth0 != null ? lookupProperty(depth0,"zIndex") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"zIndex","hash":{},"data":data,"loc":{"start":{"line":9,"column":68},"end":{"line":9,"column":78}}}) : helper)))
  20576. + "\">\n"
  20577. + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"calendars") : depth0),{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":16},"end":{"line":15,"column":25}}})) != null ? stack1 : "")
  20578. + " </ul>\n </div>\n <div class=\""
  20579. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":18,"column":20},"end":{"line":18,"column":34}}}) : helper)))
  20580. + "popup-section\">\n <div class=\""
  20581. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":19,"column":24},"end":{"line":19,"column":38}}}) : helper)))
  20582. + "popup-section-item "
  20583. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":19,"column":57},"end":{"line":19,"column":71}}}) : helper)))
  20584. + "section-title\">\n <span class=\""
  20585. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":20,"column":25},"end":{"line":20,"column":39}}}) : helper)))
  20586. + "icon "
  20587. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":20,"column":44},"end":{"line":20,"column":58}}}) : helper)))
  20588. + "ic-title\"></span>\n <input id=\""
  20589. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":21,"column":27},"end":{"line":21,"column":41}}}) : helper)))
  20590. + "schedule-title\" class=\""
  20591. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":21,"column":64},"end":{"line":21,"column":78}}}) : helper)))
  20592. + "content\" placeholder=\""
  20593. + alias4(((helper = (helper = lookupProperty(helpers,"titlePlaceholder-tmpl") || (depth0 != null ? lookupProperty(depth0,"titlePlaceholder-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"titlePlaceholder-tmpl","hash":{},"data":data,"loc":{"start":{"line":21,"column":100},"end":{"line":21,"column":125}}}) : helper)))
  20594. + "\" value=\""
  20595. + alias4(((helper = (helper = lookupProperty(helpers,"title") || (depth0 != null ? lookupProperty(depth0,"title") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"title","hash":{},"data":data,"loc":{"start":{"line":21,"column":134},"end":{"line":21,"column":143}}}) : helper)))
  20596. + "\">\n </div>\n <button id=\""
  20597. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":24},"end":{"line":23,"column":38}}}) : helper)))
  20598. + "schedule-private\" class=\""
  20599. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":63},"end":{"line":23,"column":77}}}) : helper)))
  20600. + "button "
  20601. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":84},"end":{"line":23,"column":98}}}) : helper)))
  20602. + "section-private"
  20603. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"isPrivate") : depth0),{"name":"unless","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":23,"column":113},"end":{"line":23,"column":166}}})) != null ? stack1 : "")
  20604. + "\">\n <span class=\""
  20605. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":24,"column":25},"end":{"line":24,"column":39}}}) : helper)))
  20606. + "icon "
  20607. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":24,"column":44},"end":{"line":24,"column":58}}}) : helper)))
  20608. + "ic-private\"></span>\n </button>\n </div>\n <div class=\""
  20609. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":27,"column":20},"end":{"line":27,"column":34}}}) : helper)))
  20610. + "popup-section\">\n <div class=\""
  20611. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":28,"column":24},"end":{"line":28,"column":38}}}) : helper)))
  20612. + "popup-section-item "
  20613. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":28,"column":57},"end":{"line":28,"column":71}}}) : helper)))
  20614. + "section-location\">\n <span class=\""
  20615. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":29,"column":25},"end":{"line":29,"column":39}}}) : helper)))
  20616. + "icon "
  20617. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":29,"column":44},"end":{"line":29,"column":58}}}) : helper)))
  20618. + "ic-location\"></span>\n <input id=\""
  20619. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":27},"end":{"line":30,"column":41}}}) : helper)))
  20620. + "schedule-location\" class=\""
  20621. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":67},"end":{"line":30,"column":81}}}) : helper)))
  20622. + "content\" placeholder=\""
  20623. + alias4(((helper = (helper = lookupProperty(helpers,"locationPlaceholder-tmpl") || (depth0 != null ? lookupProperty(depth0,"locationPlaceholder-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"locationPlaceholder-tmpl","hash":{},"data":data,"loc":{"start":{"line":30,"column":103},"end":{"line":30,"column":131}}}) : helper)))
  20624. + "\" value=\""
  20625. + alias4(((helper = (helper = lookupProperty(helpers,"location") || (depth0 != null ? lookupProperty(depth0,"location") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"location","hash":{},"data":data,"loc":{"start":{"line":30,"column":140},"end":{"line":30,"column":152}}}) : helper)))
  20626. + "\">\n </div>\n </div>\n <div class=\""
  20627. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":33,"column":20},"end":{"line":33,"column":34}}}) : helper)))
  20628. + "popup-section\">\n <div class=\""
  20629. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":34,"column":24},"end":{"line":34,"column":38}}}) : helper)))
  20630. + "popup-section-item "
  20631. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":34,"column":57},"end":{"line":34,"column":71}}}) : helper)))
  20632. + "section-start-date\">\n <span class=\""
  20633. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":35,"column":29},"end":{"line":35,"column":43}}}) : helper)))
  20634. + "icon "
  20635. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":35,"column":48},"end":{"line":35,"column":62}}}) : helper)))
  20636. + "ic-date\"></span>\n <input id=\""
  20637. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":36,"column":27},"end":{"line":36,"column":41}}}) : helper)))
  20638. + "schedule-start-date\" class=\""
  20639. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":36,"column":69},"end":{"line":36,"column":83}}}) : helper)))
  20640. + "content\" placeholder=\""
  20641. + alias4(((helper = (helper = lookupProperty(helpers,"startDatePlaceholder-tmpl") || (depth0 != null ? lookupProperty(depth0,"startDatePlaceholder-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"startDatePlaceholder-tmpl","hash":{},"data":data,"loc":{"start":{"line":36,"column":105},"end":{"line":36,"column":134}}}) : helper)))
  20642. + "\">\n <div id=\""
  20643. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":37,"column":25},"end":{"line":37,"column":39}}}) : helper)))
  20644. + "startpicker-container\" style=\"margin-left: -1px; position: relative\"></div>\n </div>\n <span class=\""
  20645. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":39,"column":25},"end":{"line":39,"column":39}}}) : helper)))
  20646. + "section-date-dash\">-</span>\n <div class=\""
  20647. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":40,"column":24},"end":{"line":40,"column":38}}}) : helper)))
  20648. + "popup-section-item "
  20649. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":40,"column":57},"end":{"line":40,"column":71}}}) : helper)))
  20650. + "section-end-date\">\n <span class=\""
  20651. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":41,"column":29},"end":{"line":41,"column":43}}}) : helper)))
  20652. + "icon "
  20653. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":41,"column":48},"end":{"line":41,"column":62}}}) : helper)))
  20654. + "ic-date\"></span>\n <input id=\""
  20655. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":42,"column":27},"end":{"line":42,"column":41}}}) : helper)))
  20656. + "schedule-end-date\" class=\""
  20657. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":42,"column":67},"end":{"line":42,"column":81}}}) : helper)))
  20658. + "content\" placeholder=\""
  20659. + alias4(((helper = (helper = lookupProperty(helpers,"endDatePlaceholder-tmpl") || (depth0 != null ? lookupProperty(depth0,"endDatePlaceholder-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"endDatePlaceholder-tmpl","hash":{},"data":data,"loc":{"start":{"line":42,"column":103},"end":{"line":42,"column":130}}}) : helper)))
  20660. + "\">\n <div id=\""
  20661. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":43,"column":25},"end":{"line":43,"column":39}}}) : helper)))
  20662. + "endpicker-container\" style=\"margin-left: -1px; position: relative\"></div>\n </div>\n <div class=\""
  20663. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":45,"column":24},"end":{"line":45,"column":38}}}) : helper)))
  20664. + "popup-section-item "
  20665. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":45,"column":57},"end":{"line":45,"column":71}}}) : helper)))
  20666. + "section-allday\">\n <input id=\""
  20667. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":46,"column":27},"end":{"line":46,"column":41}}}) : helper)))
  20668. + "schedule-allday\" type=\"checkbox\" class=\""
  20669. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":46,"column":81},"end":{"line":46,"column":95}}}) : helper)))
  20670. + "checkbox-square\""
  20671. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isAllDay") : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":46,"column":111},"end":{"line":46,"column":142}}})) != null ? stack1 : "")
  20672. + ">\n <span class=\""
  20673. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":29},"end":{"line":47,"column":43}}}) : helper)))
  20674. + "icon "
  20675. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":48},"end":{"line":47,"column":62}}}) : helper)))
  20676. + "ic-checkbox\"></span>\n <span class=\""
  20677. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":48,"column":29},"end":{"line":48,"column":43}}}) : helper)))
  20678. + "content\">"
  20679. + ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupIsAllDay-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupIsAllDay-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"popupIsAllDay-tmpl","hash":{},"data":data,"loc":{"start":{"line":48,"column":52},"end":{"line":48,"column":76}}}) : helper))) != null ? stack1 : "")
  20680. + "</span>\n </div>\n </div>\n <div class=\""
  20681. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":51,"column":20},"end":{"line":51,"column":34}}}) : helper)))
  20682. + "popup-section "
  20683. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":51,"column":48},"end":{"line":51,"column":62}}}) : helper)))
  20684. + "dropdown "
  20685. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":51,"column":71},"end":{"line":51,"column":85}}}) : helper)))
  20686. + "close "
  20687. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":51,"column":91},"end":{"line":51,"column":105}}}) : helper)))
  20688. + "section-state\">\n <button class=\""
  20689. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":52,"column":27},"end":{"line":52,"column":41}}}) : helper)))
  20690. + "button "
  20691. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":52,"column":48},"end":{"line":52,"column":62}}}) : helper)))
  20692. + "dropdown-button "
  20693. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":52,"column":78},"end":{"line":52,"column":92}}}) : helper)))
  20694. + "popup-section-item\">\n <span class=\""
  20695. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":53,"column":29},"end":{"line":53,"column":43}}}) : helper)))
  20696. + "icon "
  20697. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":53,"column":48},"end":{"line":53,"column":62}}}) : helper)))
  20698. + "ic-state\"></span>\n <span id=\""
  20699. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":54,"column":26},"end":{"line":54,"column":40}}}) : helper)))
  20700. + "schedule-state\" class=\""
  20701. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":54,"column":63},"end":{"line":54,"column":77}}}) : helper)))
  20702. + "content\">"
  20703. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"state") : depth0),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.program(11, data, 0),"data":data,"loc":{"start":{"line":54,"column":86},"end":{"line":54,"column":148}}})) != null ? stack1 : "")
  20704. + "</span>\n <span class=\""
  20705. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":55,"column":29},"end":{"line":55,"column":43}}}) : helper)))
  20706. + "icon "
  20707. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":55,"column":48},"end":{"line":55,"column":62}}}) : helper)))
  20708. + "dropdown-arrow\"></span>\n </button>\n <ul class=\""
  20709. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":57,"column":23},"end":{"line":57,"column":37}}}) : helper)))
  20710. + "dropdown-menu\" style=\"z-index: "
  20711. + alias4(((helper = (helper = lookupProperty(helpers,"zIndex") || (depth0 != null ? lookupProperty(depth0,"zIndex") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"zIndex","hash":{},"data":data,"loc":{"start":{"line":57,"column":68},"end":{"line":57,"column":78}}}) : helper)))
  20712. + "\">\n <li class=\""
  20713. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":58,"column":27},"end":{"line":58,"column":41}}}) : helper)))
  20714. + "popup-section-item "
  20715. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":58,"column":60},"end":{"line":58,"column":74}}}) : helper)))
  20716. + "dropdown-menu-item\">\n <span class=\""
  20717. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":59,"column":29},"end":{"line":59,"column":43}}}) : helper)))
  20718. + "icon "
  20719. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":59,"column":48},"end":{"line":59,"column":62}}}) : helper)))
  20720. + "none\"></span>\n <span class=\""
  20721. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":60,"column":29},"end":{"line":60,"column":43}}}) : helper)))
  20722. + "content\">"
  20723. + ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupStateBusy-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupStateBusy-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"popupStateBusy-tmpl","hash":{},"data":data,"loc":{"start":{"line":60,"column":52},"end":{"line":60,"column":77}}}) : helper))) != null ? stack1 : "")
  20724. + "</span>\n </li>\n <li class=\""
  20725. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":62,"column":27},"end":{"line":62,"column":41}}}) : helper)))
  20726. + "popup-section-item "
  20727. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":62,"column":60},"end":{"line":62,"column":74}}}) : helper)))
  20728. + "dropdown-menu-item\">\n <span class=\""
  20729. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":63,"column":29},"end":{"line":63,"column":43}}}) : helper)))
  20730. + "icon "
  20731. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":63,"column":48},"end":{"line":63,"column":62}}}) : helper)))
  20732. + "none\"></span>\n <span class=\""
  20733. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":64,"column":29},"end":{"line":64,"column":43}}}) : helper)))
  20734. + "content\">"
  20735. + ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupStateFree-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupStateFree-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"popupStateFree-tmpl","hash":{},"data":data,"loc":{"start":{"line":64,"column":52},"end":{"line":64,"column":77}}}) : helper))) != null ? stack1 : "")
  20736. + "</span>\n </li>\n </ul>\n </div>\n <button class=\""
  20737. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":68,"column":23},"end":{"line":68,"column":37}}}) : helper)))
  20738. + "button "
  20739. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":68,"column":44},"end":{"line":68,"column":58}}}) : helper)))
  20740. + "popup-close\"><span class=\""
  20741. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":68,"column":84},"end":{"line":68,"column":98}}}) : helper)))
  20742. + "icon "
  20743. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":68,"column":103},"end":{"line":68,"column":117}}}) : helper)))
  20744. + "ic-close\"></span></button>\n <div class=\""
  20745. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":69,"column":20},"end":{"line":69,"column":34}}}) : helper)))
  20746. + "section-button-save\"><button class=\""
  20747. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":69,"column":70},"end":{"line":69,"column":84}}}) : helper)))
  20748. + "button "
  20749. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":69,"column":91},"end":{"line":69,"column":105}}}) : helper)))
  20750. + "confirm "
  20751. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":69,"column":113},"end":{"line":69,"column":127}}}) : helper)))
  20752. + "popup-save\"><span>"
  20753. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isEditMode") : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.program(15, data, 0),"data":data,"loc":{"start":{"line":69,"column":145},"end":{"line":69,"column":220}}})) != null ? stack1 : "")
  20754. + "</span></button></div>\n </div>\n <div id=\""
  20755. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":71,"column":13},"end":{"line":71,"column":27}}}) : helper)))
  20756. + "popup-arrow\" class=\""
  20757. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":71,"column":47},"end":{"line":71,"column":61}}}) : helper)))
  20758. + "popup-arrow "
  20759. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":71,"column":73},"end":{"line":71,"column":87}}}) : helper)))
  20760. + "arrow-bottom\">\n <div class=\""
  20761. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":72,"column":20},"end":{"line":72,"column":34}}}) : helper)))
  20762. + "popup-arrow-border\">\n <div class=\""
  20763. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":73,"column":24},"end":{"line":73,"column":38}}}) : helper)))
  20764. + "popup-arrow-fill\"></div>\n </div>\n </div>\n</div>\n";
  20765. },"useData":true});
  20766. /***/ }),
  20767. /***/ "./src/js/view/template/popup/scheduleDetailPopup.hbs":
  20768. /*!************************************************************!*\
  20769. !*** ./src/js/view/template/popup/scheduleDetailPopup.hbs ***!
  20770. \************************************************************/
  20771. /*! no static exports found */
  20772. /***/ (function(module, exports, __webpack_require__) {
  20773. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  20774. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  20775. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20776. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20777. return parent[propertyName];
  20778. }
  20779. return undefined
  20780. };
  20781. return "<div class=\""
  20782. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":45},"end":{"line":11,"column":59}}}) : helper)))
  20783. + "popup-detail-item\"><span class=\""
  20784. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":91},"end":{"line":11,"column":105}}}) : helper)))
  20785. + "icon "
  20786. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":110},"end":{"line":11,"column":124}}}) : helper)))
  20787. + "ic-location-b\"></span><span class=\""
  20788. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":159},"end":{"line":11,"column":173}}}) : helper)))
  20789. + "content\">"
  20790. + ((stack1 = (lookupProperty(helpers,"popupDetailLocation-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailLocation-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"schedule") : depth0),{"name":"popupDetailLocation-tmpl","hash":{},"data":data,"loc":{"start":{"line":11,"column":182},"end":{"line":11,"column":221}}})) != null ? stack1 : "")
  20791. + "</span></div>";
  20792. },"3":function(container,depth0,helpers,partials,data) {
  20793. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20794. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20795. return parent[propertyName];
  20796. }
  20797. return undefined
  20798. };
  20799. return "<div class=\""
  20800. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":51},"end":{"line":12,"column":65}}}) : helper)))
  20801. + "popup-detail-item\"><span class=\""
  20802. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":97},"end":{"line":12,"column":111}}}) : helper)))
  20803. + "icon "
  20804. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":116},"end":{"line":12,"column":130}}}) : helper)))
  20805. + "ic-repeat-b\"></span><span class=\""
  20806. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":163},"end":{"line":12,"column":177}}}) : helper)))
  20807. + "content\">"
  20808. + ((stack1 = (lookupProperty(helpers,"popupDetailRepeat-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailRepeat-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"schedule") : depth0),{"name":"popupDetailRepeat-tmpl","hash":{},"data":data,"loc":{"start":{"line":12,"column":186},"end":{"line":12,"column":223}}})) != null ? stack1 : "")
  20809. + "</span></div>";
  20810. },"5":function(container,depth0,helpers,partials,data) {
  20811. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20812. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20813. return parent[propertyName];
  20814. }
  20815. return undefined
  20816. };
  20817. return "<div class=\""
  20818. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":46},"end":{"line":13,"column":60}}}) : helper)))
  20819. + "popup-detail-item "
  20820. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":78},"end":{"line":13,"column":92}}}) : helper)))
  20821. + "popup-detail-item-indent\"><span class=\""
  20822. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":131},"end":{"line":13,"column":145}}}) : helper)))
  20823. + "icon "
  20824. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":150},"end":{"line":13,"column":164}}}) : helper)))
  20825. + "ic-user-b\"></span><span class=\""
  20826. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":195},"end":{"line":13,"column":209}}}) : helper)))
  20827. + "content\">"
  20828. + ((stack1 = (lookupProperty(helpers,"popupDetailUser-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailUser-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"schedule") : depth0),{"name":"popupDetailUser-tmpl","hash":{},"data":data,"loc":{"start":{"line":13,"column":218},"end":{"line":13,"column":253}}})) != null ? stack1 : "")
  20829. + "</span></div>";
  20830. },"7":function(container,depth0,helpers,partials,data) {
  20831. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20832. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20833. return parent[propertyName];
  20834. }
  20835. return undefined
  20836. };
  20837. return "<div class=\""
  20838. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":42},"end":{"line":14,"column":56}}}) : helper)))
  20839. + "popup-detail-item\"><span class=\""
  20840. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":88},"end":{"line":14,"column":102}}}) : helper)))
  20841. + "icon "
  20842. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":107},"end":{"line":14,"column":121}}}) : helper)))
  20843. + "ic-state-b\"></span><span class=\""
  20844. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":153},"end":{"line":14,"column":167}}}) : helper)))
  20845. + "content\">"
  20846. + ((stack1 = (lookupProperty(helpers,"popupDetailState-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailState-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"schedule") : depth0),{"name":"popupDetailState-tmpl","hash":{},"data":data,"loc":{"start":{"line":14,"column":176},"end":{"line":14,"column":212}}})) != null ? stack1 : "")
  20847. + "</span></div>";
  20848. },"9":function(container,depth0,helpers,partials,data) {
  20849. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20850. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20851. return parent[propertyName];
  20852. }
  20853. return undefined
  20854. };
  20855. return " <div class=\""
  20856. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":20},"end":{"line":16,"column":34}}}) : helper)))
  20857. + "popup-detail-item\"><span class=\""
  20858. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":66},"end":{"line":16,"column":80}}}) : helper)))
  20859. + "icon "
  20860. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":85},"end":{"line":16,"column":99}}}) : helper)))
  20861. + "calendar-dot\" style=\"background-color: "
  20862. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
  20863. + "\"></span><span class=\""
  20864. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":16,"column":180},"end":{"line":16,"column":194}}}) : helper)))
  20865. + "content\">"
  20866. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"calendar") : depth0)) != null ? lookupProperty(stack1,"name") : stack1), depth0))
  20867. + "</span></div>\n";
  20868. },"11":function(container,depth0,helpers,partials,data) {
  20869. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20870. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20871. return parent[propertyName];
  20872. }
  20873. return undefined
  20874. };
  20875. return "<div class=\""
  20876. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":18,"column":41},"end":{"line":18,"column":55}}}) : helper)))
  20877. + "popup-detail-item "
  20878. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":18,"column":73},"end":{"line":18,"column":87}}}) : helper)))
  20879. + "popup-detail-item-separate\"><span class=\""
  20880. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":18,"column":128},"end":{"line":18,"column":142}}}) : helper)))
  20881. + "content\">"
  20882. + ((stack1 = (lookupProperty(helpers,"popupDetailBody-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailBody-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"schedule") : depth0),{"name":"popupDetailBody-tmpl","hash":{},"data":data,"loc":{"start":{"line":18,"column":151},"end":{"line":18,"column":186}}})) != null ? stack1 : "")
  20883. + "</span></div>";
  20884. },"13":function(container,depth0,helpers,partials,data) {
  20885. return "";
  20886. },"15":function(container,depth0,helpers,partials,data) {
  20887. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20888. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20889. return parent[propertyName];
  20890. }
  20891. return undefined
  20892. };
  20893. return " <div class=\""
  20894. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":22,"column":16},"end":{"line":22,"column":30}}}) : helper)))
  20895. + "section-button\">\n <button class=\""
  20896. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":21},"end":{"line":23,"column":35}}}) : helper)))
  20897. + "popup-edit\"><span class=\""
  20898. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":60},"end":{"line":23,"column":74}}}) : helper)))
  20899. + "icon "
  20900. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":79},"end":{"line":23,"column":93}}}) : helper)))
  20901. + "ic-edit\"></span><span class=\""
  20902. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":122},"end":{"line":23,"column":136}}}) : helper)))
  20903. + "content\">"
  20904. + ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupEdit-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupEdit-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"popupEdit-tmpl","hash":{},"data":data,"loc":{"start":{"line":23,"column":145},"end":{"line":23,"column":165}}}) : helper))) != null ? stack1 : "")
  20905. + "</span></button>\n <div class=\""
  20906. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":24,"column":18},"end":{"line":24,"column":32}}}) : helper)))
  20907. + "popup-vertical-line\"></div>\n <button class=\""
  20908. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":25,"column":21},"end":{"line":25,"column":35}}}) : helper)))
  20909. + "popup-delete\"><span class=\""
  20910. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":25,"column":62},"end":{"line":25,"column":76}}}) : helper)))
  20911. + "icon "
  20912. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":25,"column":81},"end":{"line":25,"column":95}}}) : helper)))
  20913. + "ic-delete\"></span><span class=\""
  20914. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":25,"column":126},"end":{"line":25,"column":140}}}) : helper)))
  20915. + "content\">"
  20916. + ((stack1 = ((helper = (helper = lookupProperty(helpers,"popupDelete-tmpl") || (depth0 != null ? lookupProperty(depth0,"popupDelete-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"popupDelete-tmpl","hash":{},"data":data,"loc":{"start":{"line":25,"column":149},"end":{"line":25,"column":171}}}) : helper))) != null ? stack1 : "")
  20917. + "</span></button>\n </div>\n";
  20918. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  20919. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20920. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20921. return parent[propertyName];
  20922. }
  20923. return undefined
  20924. };
  20925. return "<div class=\""
  20926. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  20927. + "popup "
  20928. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":46}}}) : helper)))
  20929. + "popup-detail\">\n <div class=\""
  20930. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":28}}}) : helper)))
  20931. + "popup-container\">\n <div class=\""
  20932. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":30}}}) : helper)))
  20933. + "popup-section "
  20934. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":44},"end":{"line":3,"column":58}}}) : helper)))
  20935. + "section-header\">\n <div>\n <span class=\""
  20936. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":21},"end":{"line":5,"column":35}}}) : helper)))
  20937. + "schedule-private "
  20938. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":52},"end":{"line":5,"column":66}}}) : helper)))
  20939. + "icon "
  20940. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":71},"end":{"line":5,"column":85}}}) : helper)))
  20941. + "ic-private\"></span>\n <span class=\""
  20942. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":21},"end":{"line":6,"column":35}}}) : helper)))
  20943. + "schedule-title\">"
  20944. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
  20945. + "</span>\n </div>\n <div class=\""
  20946. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":18},"end":{"line":8,"column":32}}}) : helper)))
  20947. + "popup-detail-date "
  20948. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":50},"end":{"line":8,"column":64}}}) : helper)))
  20949. + "content\">"
  20950. + ((stack1 = (lookupProperty(helpers,"popupDetailDate-tmpl")||(depth0 && lookupProperty(depth0,"popupDetailDate-tmpl"))||alias2).call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"isAllDay") : stack1),((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"start") : stack1),((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"end") : stack1),{"name":"popupDetailDate-tmpl","hash":{},"data":data,"loc":{"start":{"line":8,"column":73},"end":{"line":8,"column":145}}})) != null ? stack1 : "")
  20951. + "</div>\n </div>\n <div class=\""
  20952. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":30}}}) : helper)))
  20953. + "section-detail\">\n "
  20954. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"location") : stack1),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":11,"column":8},"end":{"line":11,"column":241}}})) != null ? stack1 : "")
  20955. + "\n "
  20956. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"recurrenceRule") : stack1),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":12,"column":8},"end":{"line":12,"column":243}}})) != null ? stack1 : "")
  20957. + "\n "
  20958. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"attendees") : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":13,"column":8},"end":{"line":13,"column":273}}})) != null ? stack1 : "")
  20959. + "\n "
  20960. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"state") : stack1),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":232}}})) != null ? stack1 : "")
  20961. + "\n"
  20962. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"calendar") : depth0),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":15,"column":8},"end":{"line":17,"column":15}}})) != null ? stack1 : "")
  20963. + " "
  20964. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"body") : stack1),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":18,"column":8},"end":{"line":18,"column":206}}})) != null ? stack1 : "")
  20965. + "\n </div>\n"
  20966. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"isReadOnly") : stack1),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.program(15, data, 0),"data":data,"loc":{"start":{"line":20,"column":4},"end":{"line":27,"column":11}}})) != null ? stack1 : "")
  20967. + " </div>\n <div class=\""
  20968. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":29,"column":14},"end":{"line":29,"column":28}}}) : helper)))
  20969. + "popup-top-line\" style=\"background-color: "
  20970. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"schedule") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
  20971. + "\"></div>\n <div id=\""
  20972. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":11},"end":{"line":30,"column":25}}}) : helper)))
  20973. + "popup-arrow\" class=\""
  20974. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":45},"end":{"line":30,"column":59}}}) : helper)))
  20975. + "popup-arrow "
  20976. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":71},"end":{"line":30,"column":85}}}) : helper)))
  20977. + "arrow-left\">\n <div class=\""
  20978. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":31,"column":16},"end":{"line":31,"column":30}}}) : helper)))
  20979. + "popup-arrow-border\">\n <div class=\""
  20980. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":32,"column":20},"end":{"line":32,"column":34}}}) : helper)))
  20981. + "popup-arrow-fill\"></div>\n </div>\n </div>\n</div>\n";
  20982. },"useData":true});
  20983. /***/ }),
  20984. /***/ "./src/js/view/template/week/dayGrid.hbs":
  20985. /*!***********************************************!*\
  20986. !*** ./src/js/view/template/week/dayGrid.hbs ***!
  20987. \***********************************************/
  20988. /*! no static exports found */
  20989. /***/ (function(module, exports, __webpack_require__) {
  20990. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  20991. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  20992. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  20993. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  20994. return parent[propertyName];
  20995. }
  20996. return undefined
  20997. };
  20998. return "<div class=\""
  20999. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":24},"end":{"line":8,"column":38}}}) : helper)))
  21000. + "weekday-grid-line\"\n style=\"left:"
  21001. + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":9,"column":28},"end":{"line":9,"column":36}}}) : helper)))
  21002. + "%; width:"
  21003. + alias4(((helper = (helper = lookupProperty(helpers,"width") || (depth0 != null ? lookupProperty(depth0,"width") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"width","hash":{},"data":data,"loc":{"start":{"line":9,"column":45},"end":{"line":9,"column":54}}}) : helper)))
  21004. + "%; background-color: "
  21005. + alias4(((helper = (helper = lookupProperty(helpers,"backgroundColor") || (depth0 != null ? lookupProperty(depth0,"backgroundColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"backgroundColor","hash":{},"data":data,"loc":{"start":{"line":9,"column":75},"end":{"line":9,"column":94}}}) : helper)))
  21006. + ";\n"
  21007. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(data && lookupProperty(data,"last")),{"name":"unless","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":20},"end":{"line":12,"column":31}}})) != null ? stack1 : "")
  21008. + " \"></div>\n";
  21009. },"2":function(container,depth0,helpers,partials,data) {
  21010. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21011. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21012. return parent[propertyName];
  21013. }
  21014. return undefined
  21015. };
  21016. return " border-right: "
  21017. + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRight")), depth0))
  21018. + ";\n";
  21019. },"4":function(container,depth0,helpers,partials,data) {
  21020. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21021. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21022. return parent[propertyName];
  21023. }
  21024. return undefined
  21025. };
  21026. return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"days") : depth0),{"name":"each","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":17,"column":8},"end":{"line":27,"column":19}}})) != null ? stack1 : "");
  21027. },"5":function(container,depth0,helpers,partials,data) {
  21028. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21029. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21030. return parent[propertyName];
  21031. }
  21032. return undefined
  21033. };
  21034. return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"collapsed")),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.program(9, data, 0),"data":data,"loc":{"start":{"line":18,"column":12},"end":{"line":26,"column":19}}})) != null ? stack1 : "");
  21035. },"6":function(container,depth0,helpers,partials,data) {
  21036. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21037. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21038. return parent[propertyName];
  21039. }
  21040. return undefined
  21041. };
  21042. return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":19,"column":16},"end":{"line":21,"column":23}}})) != null ? stack1 : "");
  21043. },"7":function(container,depth0,helpers,partials,data) {
  21044. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21045. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21046. return parent[propertyName];
  21047. }
  21048. return undefined
  21049. };
  21050. return " <span class=\""
  21051. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":20,"column":33},"end":{"line":20,"column":47}}}) : helper)))
  21052. + "weekday-exceed-in-week\" style=\"z-index: 1; right:"
  21053. + alias4((lookupProperty(helpers,"getRight")||(depth0 && lookupProperty(depth0,"getRight"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"left") : depth0),(depth0 != null ? lookupProperty(depth0,"width") : depth0),{"name":"getRight","hash":{},"data":data,"loc":{"start":{"line":20,"column":96},"end":{"line":20,"column":119}}}))
  21054. + "%;\" data-index=\""
  21055. + alias4(((helper = (helper = lookupProperty(helpers,"key") || (data && lookupProperty(data,"key"))) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"key","hash":{},"data":data,"loc":{"start":{"line":20,"column":135},"end":{"line":20,"column":143}}}) : helper)))
  21056. + "\">"
  21057. + ((stack1 = (lookupProperty(helpers,"weekGridFooterExceed-tmpl")||(depth0 && lookupProperty(depth0,"weekGridFooterExceed-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"hiddenSchedules") : depth0),{"name":"weekGridFooterExceed-tmpl","hash":{},"data":data,"loc":{"start":{"line":20,"column":145},"end":{"line":20,"column":192}}})) != null ? stack1 : "")
  21058. + "</span>\n";
  21059. },"9":function(container,depth0,helpers,partials,data) {
  21060. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21061. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21062. return parent[propertyName];
  21063. }
  21064. return undefined
  21065. };
  21066. return ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),(data && lookupProperty(data,"key")),"===",((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"collapseBtnIndex")),{"name":"fi","hash":{},"fn":container.program(10, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":23,"column":16},"end":{"line":25,"column":23}}})) != null ? stack1 : "");
  21067. },"10":function(container,depth0,helpers,partials,data) {
  21068. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21069. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21070. return parent[propertyName];
  21071. }
  21072. return undefined
  21073. };
  21074. return " <span class=\""
  21075. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":24,"column":33},"end":{"line":24,"column":47}}}) : helper)))
  21076. + "weekday-collapse-btn\" style=\"z-index: 1; right:"
  21077. + alias4((lookupProperty(helpers,"getRight")||(depth0 && lookupProperty(depth0,"getRight"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"left") : depth0),(depth0 != null ? lookupProperty(depth0,"width") : depth0),{"name":"getRight","hash":{},"data":data,"loc":{"start":{"line":24,"column":94},"end":{"line":24,"column":117}}}))
  21078. + "%;\">"
  21079. + ((stack1 = ((helper = (helper = lookupProperty(helpers,"collapseBtnTitle-tmpl") || (depth0 != null ? lookupProperty(depth0,"collapseBtnTitle-tmpl") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"collapseBtnTitle-tmpl","hash":{},"data":data,"loc":{"start":{"line":24,"column":121},"end":{"line":24,"column":148}}}) : helper))) != null ? stack1 : "")
  21080. + "</span>\n";
  21081. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  21082. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21083. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21084. return parent[propertyName];
  21085. }
  21086. return undefined
  21087. };
  21088. return "<div class=\""
  21089. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  21090. + alias4(((helper = (helper = lookupProperty(helpers,"viewName") || (depth0 != null ? lookupProperty(depth0,"viewName") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"viewName","hash":{},"data":data,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":38}}}) : helper)))
  21091. + "-left "
  21092. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":58}}}) : helper)))
  21093. + "left\" style=\"border-right: "
  21094. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftBorderRight") : stack1), depth0))
  21095. + "; width: "
  21096. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftWidth") : stack1), depth0))
  21097. + "; background-color: "
  21098. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftBackgroundColor") : stack1), depth0))
  21099. + "; padding-right: "
  21100. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftPaddingRight") : stack1), depth0))
  21101. + ";\">\n "
  21102. + ((stack1 = (lookupProperty(helpers,"dayGridTitle-tmpl")||(depth0 && lookupProperty(depth0,"dayGridTitle-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"viewName") : depth0),{"name":"dayGridTitle-tmpl","hash":{},"data":data,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":36}}})) != null ? stack1 : "")
  21103. + "\n</div>\n<div class=\""
  21104. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":26}}}) : helper)))
  21105. + alias4(((helper = (helper = lookupProperty(helpers,"viewName") || (depth0 != null ? lookupProperty(depth0,"viewName") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"viewName","hash":{},"data":data,"loc":{"start":{"line":4,"column":26},"end":{"line":4,"column":38}}}) : helper)))
  21106. + "-right "
  21107. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":45},"end":{"line":4,"column":59}}}) : helper)))
  21108. + "right\">\n <div class=\""
  21109. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":30}}}) : helper)))
  21110. + "container\">\n <div class=\""
  21111. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":20},"end":{"line":6,"column":34}}}) : helper)))
  21112. + "weekday-grid\">\n"
  21113. + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"days") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":8},"end":{"line":14,"column":19}}})) != null ? stack1 : "")
  21114. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"showExpandableButton")),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":16,"column":8},"end":{"line":28,"column":15}}})) != null ? stack1 : "")
  21115. + " </div>\n </div>\n</div>\n";
  21116. },"useData":true});
  21117. /***/ }),
  21118. /***/ "./src/js/view/template/week/dayGridSchedule.hbs":
  21119. /*!*******************************************************!*\
  21120. !*** ./src/js/view/template/week/dayGridSchedule.hbs ***!
  21121. \*******************************************************/
  21122. /*! no static exports found */
  21123. /***/ (function(module, exports, __webpack_require__) {
  21124. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  21125. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  21126. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21127. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21128. return parent[propertyName];
  21129. }
  21130. return undefined
  21131. };
  21132. return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":4},"end":{"line":27,"column":15}}})) != null ? stack1 : "");
  21133. },"2":function(container,depth0,helpers,partials,data) {
  21134. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21135. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21136. return parent[propertyName];
  21137. }
  21138. return undefined
  21139. };
  21140. return "\n "
  21141. + ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":4},"end":{"line":26,"column":15}}})) != null ? stack1 : "");
  21142. },"3":function(container,depth0,helpers,partials,data) {
  21143. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21144. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21145. return parent[propertyName];
  21146. }
  21147. return undefined
  21148. };
  21149. return "\n "
  21150. + ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":4},"end":{"line":25,"column":13}}})) != null ? stack1 : "");
  21151. },"4":function(container,depth0,helpers,partials,data) {
  21152. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3=container.escapeExpression, alias4="function", alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21153. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21154. return parent[propertyName];
  21155. }
  21156. return undefined
  21157. };
  21158. return "\n <div data-id=\""
  21159. + alias3((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":6,"column":18},"end":{"line":6,"column":33}}}))
  21160. + "\"\n class=\""
  21161. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":29}}}) : helper)))
  21162. + "weekday-schedule-block\n "
  21163. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedLeft") : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":12},"end":{"line":8,"column":71}}})) != null ? stack1 : "")
  21164. + "\n "
  21165. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"exceedRight") : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":73}}})) != null ? stack1 : "")
  21166. + "\"\n style=\"top:"
  21167. + alias3((lookupProperty(helpers,"multiply")||(depth0 && lookupProperty(depth0,"multiply"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"top") : depth0),((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleBlockHeight")),{"name":"multiply","hash":{},"data":data,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":61}}}))
  21168. + "px;\n left:"
  21169. + alias3((lookupProperty(helpers,"grid-left")||(depth0 && lookupProperty(depth0,"grid-left"))||alias2).call(alias1,depth0,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"dates")),{"name":"grid-left","hash":{},"data":data,"loc":{"start":{"line":11,"column":21},"end":{"line":11,"column":51}}}))
  21170. + "%;\n width:"
  21171. + alias3((lookupProperty(helpers,"grid-width")||(depth0 && lookupProperty(depth0,"grid-width"))||alias2).call(alias1,depth0,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"dates")),{"name":"grid-width","hash":{},"data":data,"loc":{"start":{"line":12,"column":22},"end":{"line":12,"column":53}}}))
  21172. + "%\">\n <div data-schedule-id=\""
  21173. + alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
  21174. + "\" data-calendar-id=\""
  21175. + alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
  21176. + "\" class=\""
  21177. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":92},"end":{"line":13,"column":106}}}) : helper)))
  21178. + "weekday-schedule "
  21179. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":13,"column":123},"end":{"line":13,"column":192}}})) != null ? stack1 : "")
  21180. + "\"\n style=\"height:"
  21181. + alias3(alias5(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  21182. + "px; line-height:"
  21183. + alias3(alias5(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  21184. + "px; border-radius: "
  21185. + alias3(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
  21186. + ";\n"
  21187. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.program(13, data, 0),"data":data,"loc":{"start":{"line":15,"column":16},"end":{"line":19,"column":23}}})) != null ? stack1 : "")
  21188. + " "
  21189. + alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
  21190. + "\">\n <span class=\""
  21191. + alias3(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias4 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":21,"column":25},"end":{"line":21,"column":39}}}) : helper)))
  21192. + "weekday-schedule-title\" title=\""
  21193. + alias3(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"title") : stack1), depth0))
  21194. + "\">"
  21195. + ((stack1 = (lookupProperty(helpers,"schedule-tmpl")||(depth0 && lookupProperty(depth0,"schedule-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"schedule-tmpl","hash":{},"data":data,"loc":{"start":{"line":21,"column":87},"end":{"line":21,"column":112}}})) != null ? stack1 : "")
  21196. + "</span>\n "
  21197. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(lookupProperty(helpers,"or")||(depth0 && lookupProperty(depth0,"or"))||alias2).call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"isReadOnly")),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isReadOnly") : stack1),{"name":"or","hash":{},"data":data,"loc":{"start":{"line":22,"column":22},"end":{"line":22,"column":60}}}),{"name":"unless","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":22,"column":12},"end":{"line":22,"column":193}}})) != null ? stack1 : "")
  21198. + "\n </div>\n </div>\n";
  21199. },"5":function(container,depth0,helpers,partials,data) {
  21200. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21201. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21202. return parent[propertyName];
  21203. }
  21204. return undefined
  21205. };
  21206. return " "
  21207. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":8,"column":31},"end":{"line":8,"column":45}}}) : helper)))
  21208. + "weekday-exceed-left";
  21209. },"7":function(container,depth0,helpers,partials,data) {
  21210. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21211. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21212. return parent[propertyName];
  21213. }
  21214. return undefined
  21215. };
  21216. return " "
  21217. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":9,"column":32},"end":{"line":9,"column":46}}}) : helper)))
  21218. + "weekday-exceed-right";
  21219. },"9":function(container,depth0,helpers,partials,data) {
  21220. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21221. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21222. return parent[propertyName];
  21223. }
  21224. return undefined
  21225. };
  21226. return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":146},"end":{"line":13,"column":160}}}) : helper)))
  21227. + "weekday-schedule-focused ";
  21228. },"11":function(container,depth0,helpers,partials,data) {
  21229. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21230. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21231. return parent[propertyName];
  21232. }
  21233. return undefined
  21234. };
  21235. return " color: #ffffff; background-color:"
  21236. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  21237. + "; border-color:"
  21238. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  21239. + ";\n";
  21240. },"13":function(container,depth0,helpers,partials,data) {
  21241. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21242. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21243. return parent[propertyName];
  21244. }
  21245. return undefined
  21246. };
  21247. return " color:"
  21248. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  21249. + "; background-color:"
  21250. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
  21251. + "; border-color:"
  21252. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  21253. + ";\n";
  21254. },"15":function(container,depth0,helpers,partials,data) {
  21255. var stack1, helper, alias1=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21256. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21257. return parent[propertyName];
  21258. }
  21259. return undefined
  21260. };
  21261. return "<span class=\""
  21262. + alias1(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":22,"column":75},"end":{"line":22,"column":89}}}) : helper)))
  21263. + "weekday-resize-handle handle-y\" style=\"line-height:"
  21264. + alias1(container.lambda(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleHeight")), depth0))
  21265. + "px;\">&nbsp;</span>";
  21266. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  21267. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21268. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21269. return parent[propertyName];
  21270. }
  21271. return undefined
  21272. };
  21273. return "<div class=\""
  21274. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  21275. + "weekday-schedules "
  21276. + alias4(((helper = (helper = lookupProperty(helpers,"collapsed") || (depth0 != null ? lookupProperty(depth0,"collapsed") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"collapsed","hash":{},"data":data,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":57}}}) : helper)))
  21277. + "\"style=\"top:"
  21278. + alias4(container.lambda(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"scheduleContainerTop")), depth0))
  21279. + "px;\">\n"
  21280. + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"matrices") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":4},"end":{"line":28,"column":15}}})) != null ? stack1 : "")
  21281. + "</div>\n";
  21282. },"useData":true});
  21283. /***/ }),
  21284. /***/ "./src/js/view/template/week/daynames.hbs":
  21285. /*!************************************************!*\
  21286. !*** ./src/js/view/template/week/daynames.hbs ***!
  21287. \************************************************/
  21288. /*! no static exports found */
  21289. /***/ (function(module, exports, __webpack_require__) {
  21290. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  21291. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  21292. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21293. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21294. return parent[propertyName];
  21295. }
  21296. return undefined
  21297. };
  21298. return "<div class=\""
  21299. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":26}}}) : helper)))
  21300. + "dayname "
  21301. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isToday") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":34},"end":{"line":3,"column":75}}})) != null ? stack1 : "")
  21302. + " "
  21303. + alias4((lookupProperty(helpers,"holiday")||(depth0 && lookupProperty(depth0,"holiday"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"day") : depth0),{"name":"holiday","hash":{},"data":data,"loc":{"start":{"line":3,"column":76},"end":{"line":3,"column":91}}}))
  21304. + "\"\n data-date=\""
  21305. + alias4(((helper = (helper = lookupProperty(helpers,"renderDate") || (depth0 != null ? lookupProperty(depth0,"renderDate") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"renderDate","hash":{},"data":data,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":30}}}) : helper)))
  21306. + "\"\n style=\""
  21307. + alias4((lookupProperty(helpers,"common-width")||(depth0 && lookupProperty(depth0,"common-width"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"width") : depth0),{"name":"common-width","hash":{},"data":data,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":34}}}))
  21308. + ";left:"
  21309. + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":5,"column":40},"end":{"line":5,"column":48}}}) : helper)))
  21310. + "%; line-height: "
  21311. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"height")), depth0))
  21312. + "; border-left: "
  21313. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderLeft")), depth0))
  21314. + "; padding-left: "
  21315. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"paddingLeft")), depth0))
  21316. + ";\">\n <span class=\""
  21317. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":17},"end":{"line":6,"column":31}}}) : helper)))
  21318. + "dayname-date-area\" style=\"color: "
  21319. + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":6,"column":64},"end":{"line":6,"column":73}}}) : helper)))
  21320. + ";\">\n "
  21321. + ((stack1 = (lookupProperty(helpers,"weekDayname-tmpl")||(depth0 && lookupProperty(depth0,"weekDayname-tmpl"))||alias2).call(alias1,depth0,{"name":"weekDayname-tmpl","hash":{},"data":data,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":35}}})) != null ? stack1 : "")
  21322. + "\n </span>\n</div>\n";
  21323. },"2":function(container,depth0,helpers,partials,data) {
  21324. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21325. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21326. return parent[propertyName];
  21327. }
  21328. return undefined
  21329. };
  21330. return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":49},"end":{"line":3,"column":63}}}) : helper)))
  21331. + "today";
  21332. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  21333. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21334. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21335. return parent[propertyName];
  21336. }
  21337. return undefined
  21338. };
  21339. return "<div class=\""
  21340. + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  21341. + "dayname-leftmargin\" style=\"margin-left: "
  21342. + alias2(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"marginLeft")), depth0))
  21343. + ";\">\n"
  21344. + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"dayNames") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":0},"end":{"line":10,"column":9}}})) != null ? stack1 : "")
  21345. + "</div>\n";
  21346. },"useData":true});
  21347. /***/ }),
  21348. /***/ "./src/js/view/template/week/time.hbs":
  21349. /*!********************************************!*\
  21350. !*** ./src/js/view/template/week/time.hbs ***!
  21351. \********************************************/
  21352. /*! no static exports found */
  21353. /***/ (function(module, exports, __webpack_require__) {
  21354. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  21355. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  21356. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21357. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21358. return parent[propertyName];
  21359. }
  21360. return undefined
  21361. };
  21362. return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":4},"end":{"line":60,"column":13}}})) != null ? stack1 : "");
  21363. },"2":function(container,depth0,helpers,partials,data) {
  21364. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21365. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21366. return parent[propertyName];
  21367. }
  21368. return undefined
  21369. };
  21370. return ((stack1 = lookupProperty(helpers,"each").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"each","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":8},"end":{"line":59,"column":17}}})) != null ? stack1 : "");
  21371. },"3":function(container,depth0,helpers,partials,data) {
  21372. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21373. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21374. return parent[propertyName];
  21375. }
  21376. return undefined
  21377. };
  21378. return ((stack1 = lookupProperty(helpers,"if").call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":8},"end":{"line":58,"column":17}}})) != null ? stack1 : "");
  21379. },"4":function(container,depth0,helpers,partials,data) {
  21380. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21381. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21382. return parent[propertyName];
  21383. }
  21384. return undefined
  21385. };
  21386. return "<div class=\""
  21387. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":20},"end":{"line":6,"column":34}}}) : helper)))
  21388. + "time-date-schedule-block "
  21389. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isPending") : stack1),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":6,"column":59},"end":{"line":6,"column":136}}})) != null ? stack1 : "")
  21390. + "\" data-id=\""
  21391. + alias4((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":6,"column":147},"end":{"line":6,"column":162}}}))
  21392. + "\"\n style=\""
  21393. + alias4((lookupProperty(helpers,"time-scheduleBlock")||(depth0 && lookupProperty(depth0,"time-scheduleBlock"))||alias2).call(alias1,depth0,{"name":"time-scheduleBlock","hash":{},"data":data,"loc":{"start":{"line":7,"column":19},"end":{"line":7,"column":46}}}))
  21394. + ";\n"
  21395. + ((stack1 = (lookupProperty(helpers,"fi")||(depth0 && lookupProperty(depth0,"fi"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"left") : depth0),"!==",0,{"name":"fi","hash":{},"fn":container.program(7, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":8,"column":16},"end":{"line":10,"column":23}}})) != null ? stack1 : "")
  21396. + " \">\n <div data-schedule-id=\""
  21397. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"id") : stack1), depth0))
  21398. + "\" data-calendar-id=\""
  21399. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"calendarId") : stack1), depth0))
  21400. + "\" class=\""
  21401. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":96},"end":{"line":12,"column":110}}}) : helper)))
  21402. + "time-schedule "
  21403. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(9, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":12,"column":124},"end":{"line":12,"column":190}}})) != null ? stack1 : "")
  21404. + "\"\n style=\"\n"
  21405. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"croppedEnd") : depth0),{"name":"unless","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":14,"column":16},"end":{"line":17,"column":27}}})) != null ? stack1 : "")
  21406. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"croppedStart") : depth0),{"name":"unless","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":18,"column":16},"end":{"line":21,"column":27}}})) != null ? stack1 : "")
  21407. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(15, data, 0),"inverse":container.program(17, data, 0),"data":data,"loc":{"start":{"line":22,"column":16},"end":{"line":26,"column":23}}})) != null ? stack1 : "")
  21408. + " "
  21409. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"customStyle") : stack1), depth0))
  21410. + "\"\n >\n"
  21411. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hasGoingDuration") : depth0),{"name":"if","hash":{},"fn":container.program(19, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":29,"column":12},"end":{"line":37,"column":19}}})) != null ? stack1 : "")
  21412. + " <div class=\""
  21413. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":38,"column":28},"end":{"line":38,"column":42}}}) : helper)))
  21414. + "time-schedule-content "
  21415. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":38,"column":64},"end":{"line":38,"column":78}}}) : helper)))
  21416. + "time-schedule-content-time\" style=\"height: "
  21417. + alias4(((helper = (helper = lookupProperty(helpers,"modelDurationHeight") || (depth0 != null ? lookupProperty(depth0,"modelDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"modelDurationHeight","hash":{},"data":data,"loc":{"start":{"line":38,"column":121},"end":{"line":38,"column":144}}}) : helper)))
  21418. + "px;\n"
  21419. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(20, data, 0),"inverse":container.program(22, data, 0),"data":data,"loc":{"start":{"line":39,"column":16},"end":{"line":43,"column":23}}})) != null ? stack1 : "")
  21420. + " "
  21421. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hasComingDuration") : depth0),{"name":"if","hash":{},"fn":container.program(24, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":44,"column":16},"end":{"line":44,"column":96}}})) != null ? stack1 : "")
  21422. + "\">\n "
  21423. + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":45,"column":20},"end":{"line":45,"column":41}}})) != null ? stack1 : "")
  21424. + "\n </div>\n"
  21425. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hasComingDuration") : depth0),{"name":"if","hash":{},"fn":container.program(26, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":47,"column":12},"end":{"line":54,"column":19}}})) != null ? stack1 : "")
  21426. + " </div>\n "
  21427. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(lookupProperty(helpers,"or")||(depth0 && lookupProperty(depth0,"or"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"croppedEnd") : depth0),(lookupProperty(helpers,"or")||(depth0 && lookupProperty(depth0,"or"))||alias2).call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"isReadOnly")),((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isReadOnly") : stack1),{"name":"or","hash":{},"data":data,"loc":{"start":{"line":56,"column":37},"end":{"line":56,"column":75}}}),{"name":"or","hash":{},"data":data,"loc":{"start":{"line":56,"column":22},"end":{"line":56,"column":76}}}),{"name":"unless","hash":{},"fn":container.program(29, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":56,"column":12},"end":{"line":56,"column":207}}})) != null ? stack1 : "")
  21428. + "\n </div>\n";
  21429. },"5":function(container,depth0,helpers,partials,data) {
  21430. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21431. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21432. return parent[propertyName];
  21433. }
  21434. return undefined
  21435. };
  21436. return " "
  21437. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":83},"end":{"line":6,"column":97}}}) : helper)))
  21438. + "time-date-schedule-block-pending";
  21439. },"7":function(container,depth0,helpers,partials,data) {
  21440. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21441. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21442. return parent[propertyName];
  21443. }
  21444. return undefined
  21445. };
  21446. return " padding-left: "
  21447. + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"paddingLeft")), depth0))
  21448. + ";\n";
  21449. },"9":function(container,depth0,helpers,partials,data) {
  21450. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21451. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21452. return parent[propertyName];
  21453. }
  21454. return undefined
  21455. };
  21456. return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":147},"end":{"line":12,"column":161}}}) : helper)))
  21457. + "time-schedule-focused ";
  21458. },"11":function(container,depth0,helpers,partials,data) {
  21459. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21460. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21461. return parent[propertyName];
  21462. }
  21463. return undefined
  21464. };
  21465. return " border-bottom-left-radius: "
  21466. + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
  21467. + ";\n border-bottom-right-radius: "
  21468. + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
  21469. + ";\n";
  21470. },"13":function(container,depth0,helpers,partials,data) {
  21471. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21472. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21473. return parent[propertyName];
  21474. }
  21475. return undefined
  21476. };
  21477. return " border-top-left-radius: "
  21478. + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
  21479. + ";\n border-top-right-radius: "
  21480. + alias2(alias1(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderRadius")), depth0))
  21481. + ";\n";
  21482. },"15":function(container,depth0,helpers,partials,data) {
  21483. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21484. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21485. return parent[propertyName];
  21486. }
  21487. return undefined
  21488. };
  21489. return " color: #ffffff; background-color:"
  21490. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  21491. + "; border-color:"
  21492. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  21493. + ";\n";
  21494. },"17":function(container,depth0,helpers,partials,data) {
  21495. var stack1, alias1=container.lambda, alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21496. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21497. return parent[propertyName];
  21498. }
  21499. return undefined
  21500. };
  21501. return " color:"
  21502. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  21503. + "; background-color:"
  21504. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"bgColor") : stack1), depth0))
  21505. + "; border-color:"
  21506. + alias2(alias1(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  21507. + ";\n";
  21508. },"19":function(container,depth0,helpers,partials,data) {
  21509. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21510. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21511. return parent[propertyName];
  21512. }
  21513. return undefined
  21514. };
  21515. return " <div class=\""
  21516. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":28},"end":{"line":30,"column":42}}}) : helper)))
  21517. + "time-schedule-content "
  21518. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":64},"end":{"line":30,"column":78}}}) : helper)))
  21519. + "time-schedule-content-travel-time\" style=\"height: "
  21520. + alias4(((helper = (helper = lookupProperty(helpers,"goingDurationHeight") || (depth0 != null ? lookupProperty(depth0,"goingDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"goingDurationHeight","hash":{},"data":data,"loc":{"start":{"line":30,"column":128},"end":{"line":30,"column":151}}}) : helper)))
  21521. + "px;\n"
  21522. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(20, data, 0),"inverse":container.program(22, data, 0),"data":data,"loc":{"start":{"line":31,"column":16},"end":{"line":35,"column":23}}})) != null ? stack1 : "")
  21523. + " border-bottom: 1px dashed "
  21524. + alias4(((helper = (helper = lookupProperty(helpers,"travelBorderColor") || (depth0 != null ? lookupProperty(depth0,"travelBorderColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"travelBorderColor","hash":{},"data":data,"loc":{"start":{"line":36,"column":42},"end":{"line":36,"column":63}}}) : helper)))
  21525. + ";\">"
  21526. + ((stack1 = (lookupProperty(helpers,"goingDuration-tmpl")||(depth0 && lookupProperty(depth0,"goingDuration-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"goingDuration-tmpl","hash":{},"data":data,"loc":{"start":{"line":36,"column":66},"end":{"line":36,"column":96}}})) != null ? stack1 : "")
  21527. + "</div>\n";
  21528. },"20":function(container,depth0,helpers,partials,data) {
  21529. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21530. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21531. return parent[propertyName];
  21532. }
  21533. return undefined
  21534. };
  21535. return " border-color:"
  21536. + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  21537. + ";\n";
  21538. },"22":function(container,depth0,helpers,partials,data) {
  21539. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21540. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21541. return parent[propertyName];
  21542. }
  21543. return undefined
  21544. };
  21545. return " border-color:"
  21546. + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  21547. + ";\n";
  21548. },"24":function(container,depth0,helpers,partials,data) {
  21549. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21550. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21551. return parent[propertyName];
  21552. }
  21553. return undefined
  21554. };
  21555. return "border-bottom: 1px dashed "
  21556. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"travelBorderColor") || (depth0 != null ? lookupProperty(depth0,"travelBorderColor") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"travelBorderColor","hash":{},"data":data,"loc":{"start":{"line":44,"column":67},"end":{"line":44,"column":88}}}) : helper)))
  21557. + ";";
  21558. },"26":function(container,depth0,helpers,partials,data) {
  21559. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21560. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21561. return parent[propertyName];
  21562. }
  21563. return undefined
  21564. };
  21565. return " <div class=\""
  21566. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":48,"column":28},"end":{"line":48,"column":42}}}) : helper)))
  21567. + "time-schedule-content "
  21568. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":48,"column":64},"end":{"line":48,"column":78}}}) : helper)))
  21569. + "time-schedule-content-travel-time\" style=\"height: "
  21570. + alias4(((helper = (helper = lookupProperty(helpers,"comingDurationHeight") || (depth0 != null ? lookupProperty(depth0,"comingDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"comingDurationHeight","hash":{},"data":data,"loc":{"start":{"line":48,"column":128},"end":{"line":48,"column":152}}}) : helper)))
  21571. + "px;\n"
  21572. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"isFocused") : stack1),{"name":"if","hash":{},"fn":container.program(20, data, 0),"inverse":container.program(27, data, 0),"data":data,"loc":{"start":{"line":49,"column":16},"end":{"line":53,"column":23}}})) != null ? stack1 : "")
  21573. + ";\">"
  21574. + ((stack1 = (lookupProperty(helpers,"comingDuration-tmpl")||(depth0 && lookupProperty(depth0,"comingDuration-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"comingDuration-tmpl","hash":{},"data":data,"loc":{"start":{"line":53,"column":26},"end":{"line":53,"column":57}}})) != null ? stack1 : "")
  21575. + "</div>\n";
  21576. },"27":function(container,depth0,helpers,partials,data) {
  21577. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21578. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21579. return parent[propertyName];
  21580. }
  21581. return undefined
  21582. };
  21583. return " border-color:"
  21584. + container.escapeExpression(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  21585. + ";\n ";
  21586. },"29":function(container,depth0,helpers,partials,data) {
  21587. var stack1, helper, alias1=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21588. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21589. return parent[propertyName];
  21590. }
  21591. return undefined
  21592. };
  21593. return "<div class=\""
  21594. + alias1(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":56,"column":90},"end":{"line":56,"column":104}}}) : helper)))
  21595. + "time-resize-handle handle-x\" style=\"margin-left: "
  21596. + alias1(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"paddingLeft")), depth0))
  21597. + ";\">&nbsp;</div>";
  21598. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  21599. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21600. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21601. return parent[propertyName];
  21602. }
  21603. return undefined
  21604. };
  21605. return "<div class=\""
  21606. + alias2(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  21607. + "time-date-schedule-block-wrap\" style=\"margin-right: "
  21608. + alias2(container.lambda(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"marginRight") : stack1), depth0))
  21609. + ";\">\n"
  21610. + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"matrices") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":0},"end":{"line":61,"column":9}}})) != null ? stack1 : "")
  21611. + "</div>\n";
  21612. },"useData":true});
  21613. /***/ }),
  21614. /***/ "./src/js/view/template/week/timeGrid.hbs":
  21615. /*!************************************************!*\
  21616. !*** ./src/js/view/template/week/timeGrid.hbs ***!
  21617. \************************************************/
  21618. /*! no static exports found */
  21619. /***/ (function(module, exports, __webpack_require__) {
  21620. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  21621. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  21622. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21623. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21624. return parent[propertyName];
  21625. }
  21626. return undefined
  21627. };
  21628. return "<div class=\""
  21629. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":34}}}) : helper)))
  21630. + "timegrid-timezone\" data-timezone-index=\""
  21631. + alias4(((helper = (helper = lookupProperty(helpers,"index") || (data && lookupProperty(data,"index"))) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"index","hash":{},"data":data,"loc":{"start":{"line":3,"column":74},"end":{"line":3,"column":84}}}) : helper)))
  21632. + "\" style=\""
  21633. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hidden") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":93},"end":{"line":3,"column":127}}})) != null ? stack1 : "")
  21634. + "position: absolute; top: 0; width: "
  21635. + alias4(((helper = (helper = lookupProperty(helpers,"width") || (depth0 != null ? lookupProperty(depth0,"width") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"width","hash":{},"data":data,"loc":{"start":{"line":3,"column":162},"end":{"line":3,"column":171}}}) : helper)))
  21636. + "%; left: "
  21637. + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":3,"column":180},"end":{"line":3,"column":188}}}) : helper)))
  21638. + "%; border-right: "
  21639. + alias4(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"leftBorderRight")), depth0))
  21640. + "; background-color: "
  21641. + alias4(((helper = (helper = lookupProperty(helpers,"backgroundColor") || (depth0 != null ? lookupProperty(depth0,"backgroundColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"backgroundColor","hash":{},"data":data,"loc":{"start":{"line":3,"column":257},"end":{"line":3,"column":276}}}) : helper)))
  21642. + ";\" >\n"
  21643. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"isPrimary") : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(10, data, 0),"data":data,"loc":{"start":{"line":4,"column":8},"end":{"line":26,"column":15}}})) != null ? stack1 : "")
  21644. + " </div>\n";
  21645. },"2":function(container,depth0,helpers,partials,data) {
  21646. return "display:none;";
  21647. },"4":function(container,depth0,helpers,partials,data) {
  21648. var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21649. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21650. return parent[propertyName];
  21651. }
  21652. return undefined
  21653. };
  21654. return ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"timeSlots") : depth0),{"name":"each","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":5,"column":12},"end":{"line":9,"column":23}}})) != null ? stack1 : "")
  21655. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"showHourMarker")),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":10,"column":12},"end":{"line":14,"column":19}}})) != null ? stack1 : "");
  21656. },"5":function(container,depth0,helpers,partials,data) {
  21657. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21658. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21659. return parent[propertyName];
  21660. }
  21661. return undefined
  21662. };
  21663. return "<div class=\""
  21664. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":28},"end":{"line":6,"column":42}}}) : helper)))
  21665. + "timegrid-hour\" style=\"height: "
  21666. + alias4(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"oneHourHeight")), depth0))
  21667. + "; color: "
  21668. + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":6,"column":111},"end":{"line":6,"column":120}}}) : helper)))
  21669. + "; font-weight: "
  21670. + alias4(((helper = (helper = lookupProperty(helpers,"fontWeight") || (depth0 != null ? lookupProperty(depth0,"fontWeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"fontWeight","hash":{},"data":data,"loc":{"start":{"line":6,"column":135},"end":{"line":6,"column":149}}}) : helper)))
  21671. + ";\">\n <span style=\""
  21672. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hidden") : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":7,"column":33},"end":{"line":7,"column":66}}})) != null ? stack1 : "")
  21673. + "\">"
  21674. + ((stack1 = (lookupProperty(helpers,"timegridDisplayPrimayTime-tmpl")||(depth0 && lookupProperty(depth0,"timegridDisplayPrimayTime-tmpl"))||alias2).call(alias1,depth0,{"name":"timegridDisplayPrimayTime-tmpl","hash":{},"data":data,"loc":{"start":{"line":7,"column":68},"end":{"line":7,"column":109}}})) != null ? stack1 : "")
  21675. + "</span>\n </div>\n";
  21676. },"6":function(container,depth0,helpers,partials,data) {
  21677. return "display:none";
  21678. },"8":function(container,depth0,helpers,partials,data) {
  21679. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21680. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21681. return parent[propertyName];
  21682. }
  21683. return undefined
  21684. };
  21685. return " <div class=\""
  21686. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":28},"end":{"line":11,"column":42}}}) : helper)))
  21687. + "timegrid-hourmarker\" style=\"top:"
  21688. + alias4(alias5(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"hourmarkerTop")), depth0))
  21689. + "%; margin-top: calc(6px - "
  21690. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourHeight")), depth0))
  21691. + "); height: "
  21692. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourHeight")), depth0))
  21693. + ";\">\n <div class=\""
  21694. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":12,"column":32},"end":{"line":12,"column":46}}}) : helper)))
  21695. + "timegrid-hourmarker-time\" style=\"color: "
  21696. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"currentTimeColor")), depth0))
  21697. + "; font-size: "
  21698. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"currentTimeFontSize")), depth0))
  21699. + "; font-weight: "
  21700. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"currentTimeFontWeight")), depth0))
  21701. + "\">"
  21702. + ((stack1 = (lookupProperty(helpers,"timegridCurrentTime-tmpl")||(depth0 && lookupProperty(depth0,"timegridCurrentTime-tmpl"))||alias2).call(alias1,depth0,{"name":"timegridCurrentTime-tmpl","hash":{},"data":data,"loc":{"start":{"line":12,"column":223},"end":{"line":12,"column":258}}})) != null ? stack1 : "")
  21703. + "</div>\n </div>\n";
  21704. },"10":function(container,depth0,helpers,partials,data) {
  21705. var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21706. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21707. return parent[propertyName];
  21708. }
  21709. return undefined
  21710. };
  21711. return ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"timeSlots") : depth0),{"name":"each","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":16,"column":12},"end":{"line":20,"column":23}}})) != null ? stack1 : "")
  21712. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"showHourMarker")),{"name":"if","hash":{},"fn":container.program(13, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":21,"column":12},"end":{"line":25,"column":19}}})) != null ? stack1 : "");
  21713. },"11":function(container,depth0,helpers,partials,data) {
  21714. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21715. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21716. return parent[propertyName];
  21717. }
  21718. return undefined
  21719. };
  21720. return "<div class=\""
  21721. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":17,"column":28},"end":{"line":17,"column":42}}}) : helper)))
  21722. + "timegrid-hour\" style=\"height: "
  21723. + alias4(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"oneHourHeight")), depth0))
  21724. + "; color: "
  21725. + alias4(((helper = (helper = lookupProperty(helpers,"color") || (depth0 != null ? lookupProperty(depth0,"color") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"color","hash":{},"data":data,"loc":{"start":{"line":17,"column":111},"end":{"line":17,"column":120}}}) : helper)))
  21726. + "; font-weight: "
  21727. + alias4(((helper = (helper = lookupProperty(helpers,"fontWeight") || (depth0 != null ? lookupProperty(depth0,"fontWeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"fontWeight","hash":{},"data":data,"loc":{"start":{"line":17,"column":135},"end":{"line":17,"column":149}}}) : helper)))
  21728. + ";\">\n <span style=\""
  21729. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hidden") : depth0),{"name":"if","hash":{},"fn":container.program(6, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":18,"column":33},"end":{"line":18,"column":66}}})) != null ? stack1 : "")
  21730. + "\">"
  21731. + ((stack1 = (lookupProperty(helpers,"timegridDisplayTime-tmpl")||(depth0 && lookupProperty(depth0,"timegridDisplayTime-tmpl"))||alias2).call(alias1,depth0,{"name":"timegridDisplayTime-tmpl","hash":{},"data":data,"loc":{"start":{"line":18,"column":68},"end":{"line":18,"column":103}}})) != null ? stack1 : "")
  21732. + "</span>\n </div>\n";
  21733. },"13":function(container,depth0,helpers,partials,data) {
  21734. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21735. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21736. return parent[propertyName];
  21737. }
  21738. return undefined
  21739. };
  21740. return " <div class=\""
  21741. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":22,"column":28},"end":{"line":22,"column":42}}}) : helper)))
  21742. + "timegrid-hourmarker\" style=\"top:"
  21743. + alias4(alias5(((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"hourmarkerTop")), depth0))
  21744. + "%; margin-top: calc(6px - "
  21745. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourHeight")), depth0))
  21746. + "); height: "
  21747. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourHeight")), depth0))
  21748. + ";\">\n <div class=\""
  21749. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":23,"column":32},"end":{"line":23,"column":46}}}) : helper)))
  21750. + "timegrid-hourmarker-time\" style=\"color: "
  21751. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"currentTimeColor")), depth0))
  21752. + "; font-size: "
  21753. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"currentTimeFontSize")), depth0))
  21754. + ";\">"
  21755. + ((stack1 = (lookupProperty(helpers,"timegridCurrentTime-tmpl")||(depth0 && lookupProperty(depth0,"timegridCurrentTime-tmpl"))||alias2).call(alias1,depth0,{"name":"timegridCurrentTime-tmpl","hash":{},"data":data,"loc":{"start":{"line":23,"column":171},"end":{"line":23,"column":206}}})) != null ? stack1 : "")
  21756. + "</div>\n </div>\n";
  21757. },"15":function(container,depth0,helpers,partials,data) {
  21758. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21759. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21760. return parent[propertyName];
  21761. }
  21762. return undefined
  21763. };
  21764. return "<div class=\""
  21765. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":33,"column":20},"end":{"line":33,"column":34}}}) : helper)))
  21766. + "timegrid-gridline\" style=\"height: "
  21767. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"oneHourHeight")), depth0))
  21768. + ";\n"
  21769. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(data && lookupProperty(data,"last")),{"name":"unless","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":34,"column":12},"end":{"line":36,"column":23}}})) != null ? stack1 : "")
  21770. + " \">\n <div class=\""
  21771. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":38,"column":24},"end":{"line":38,"column":38}}}) : helper)))
  21772. + "timegrid-gridline-half\" style=\"height: "
  21773. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourHeight")), depth0))
  21774. + "; border-bottom: "
  21775. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"halfHourBorderBottom")), depth0))
  21776. + ";\"></div>\n </div>\n";
  21777. },"16":function(container,depth0,helpers,partials,data) {
  21778. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21779. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21780. return parent[propertyName];
  21781. }
  21782. return undefined
  21783. };
  21784. return " border-bottom: "
  21785. + container.escapeExpression(container.lambda(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"borderBottom")), depth0))
  21786. + ";\n";
  21787. },"18":function(container,depth0,helpers,partials,data) {
  21788. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21789. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21790. return parent[propertyName];
  21791. }
  21792. return undefined
  21793. };
  21794. return " <div class=\""
  21795. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":47,"column":16},"end":{"line":47,"column":30}}}) : helper)))
  21796. + "timegrid-hourmarker\" style=\"top:"
  21797. + alias4(((helper = (helper = lookupProperty(helpers,"hourmarkerTop") || (depth0 != null ? lookupProperty(depth0,"hourmarkerTop") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"hourmarkerTop","hash":{},"data":data,"loc":{"start":{"line":47,"column":62},"end":{"line":47,"column":79}}}) : helper)))
  21798. + "%\">\n <div class=\""
  21799. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":48,"column":20},"end":{"line":48,"column":34}}}) : helper)))
  21800. + "timegrid-hourmarker-line-left\" style=\"width:"
  21801. + alias4(((helper = (helper = lookupProperty(helpers,"todaymarkerLeft") || (depth0 != null ? lookupProperty(depth0,"todaymarkerLeft") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"todaymarkerLeft","hash":{},"data":data,"loc":{"start":{"line":48,"column":78},"end":{"line":48,"column":97}}}) : helper)))
  21802. + "%; border-top: "
  21803. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"currentTimeLeftBorderTop") : stack1), depth0))
  21804. + ";\"></div>\n <div class=\""
  21805. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":49,"column":20},"end":{"line":49,"column":34}}}) : helper)))
  21806. + "timegrid-todaymarker\" style=\"left:"
  21807. + alias4(((helper = (helper = lookupProperty(helpers,"todaymarkerLeft") || (depth0 != null ? lookupProperty(depth0,"todaymarkerLeft") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"todaymarkerLeft","hash":{},"data":data,"loc":{"start":{"line":49,"column":68},"end":{"line":49,"column":87}}}) : helper)))
  21808. + "%; background-color: "
  21809. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"currentTimeBulletBackgroundColor") : stack1), depth0))
  21810. + "; \">today</div>\n <div class=\""
  21811. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":50,"column":20},"end":{"line":50,"column":34}}}) : helper)))
  21812. + "timegrid-hourmarker-line-today\" style=\"left:"
  21813. + alias4(((helper = (helper = lookupProperty(helpers,"todaymarkerLeft") || (depth0 != null ? lookupProperty(depth0,"todaymarkerLeft") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"todaymarkerLeft","hash":{},"data":data,"loc":{"start":{"line":50,"column":78},"end":{"line":50,"column":97}}}) : helper)))
  21814. + "%; width: "
  21815. + alias4(((helper = (helper = lookupProperty(helpers,"todaymarkerWidth") || (depth0 != null ? lookupProperty(depth0,"todaymarkerWidth") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"todaymarkerWidth","hash":{},"data":data,"loc":{"start":{"line":50,"column":107},"end":{"line":50,"column":127}}}) : helper)))
  21816. + "%; border-top: "
  21817. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"currentTimeTodayBorderTop") : stack1), depth0))
  21818. + ";\"></div>\n <div class=\""
  21819. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":51,"column":20},"end":{"line":51,"column":34}}}) : helper)))
  21820. + "timegrid-hourmarker-line-right\" style=\"left:"
  21821. + alias4(((helper = (helper = lookupProperty(helpers,"todaymarkerRight") || (depth0 != null ? lookupProperty(depth0,"todaymarkerRight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"todaymarkerRight","hash":{},"data":data,"loc":{"start":{"line":51,"column":78},"end":{"line":51,"column":98}}}) : helper)))
  21822. + "%; border-top: "
  21823. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"currentTimeRightBorderTop") : stack1), depth0))
  21824. + ";\"></div>\n </div>\n";
  21825. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  21826. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21827. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21828. return parent[propertyName];
  21829. }
  21830. return undefined
  21831. };
  21832. return "<div class=\""
  21833. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  21834. + "timegrid-left\" style=\"width: "
  21835. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftWidth") : stack1), depth0))
  21836. + "; font-size: "
  21837. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"styles") : depth0)) != null ? lookupProperty(stack1,"leftFontSize") : stack1), depth0))
  21838. + ";\">\n"
  21839. + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"timezones") : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":4},"end":{"line":28,"column":15}}})) != null ? stack1 : "")
  21840. + "</div>\n<div class=\""
  21841. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":30,"column":12},"end":{"line":30,"column":26}}}) : helper)))
  21842. + "timegrid-right\" style=\"margin-left: "
  21843. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"leftWidth")), depth0))
  21844. + ";\">\n <div class=\""
  21845. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":31,"column":16},"end":{"line":31,"column":30}}}) : helper)))
  21846. + "timegrid-h-grid\">\n"
  21847. + ((stack1 = lookupProperty(helpers,"each").call(alias1,(depth0 != null ? lookupProperty(depth0,"hoursLabels") : depth0),{"name":"each","hash":{},"fn":container.program(15, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":32,"column":8},"end":{"line":40,"column":19}}})) != null ? stack1 : "")
  21848. + "</div>\n <div class=\""
  21849. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":42,"column":16},"end":{"line":42,"column":30}}}) : helper)))
  21850. + "timegrid-schedules\">\n <div class=\""
  21851. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":43,"column":20},"end":{"line":43,"column":34}}}) : helper)))
  21852. + "timegrid-schedules-container\"></div>\n </div>\n\n"
  21853. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"showHourMarker") : depth0),{"name":"if","hash":{},"fn":container.program(18, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":46,"column":4},"end":{"line":53,"column":11}}})) != null ? stack1 : "")
  21854. + "</div>\n";
  21855. },"useData":true});
  21856. /***/ }),
  21857. /***/ "./src/js/view/template/week/timeGridCurrentTime.hbs":
  21858. /*!***********************************************************!*\
  21859. !*** ./src/js/view/template/week/timeGridCurrentTime.hbs ***!
  21860. \***********************************************************/
  21861. /*! no static exports found */
  21862. /***/ (function(module, exports, __webpack_require__) {
  21863. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  21864. module.exports = (Handlebars['default'] || Handlebars).template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  21865. var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21866. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21867. return parent[propertyName];
  21868. }
  21869. return undefined
  21870. };
  21871. return ((stack1 = (lookupProperty(helpers,"timegridCurrentTime-tmpl")||(depth0 && lookupProperty(depth0,"timegridCurrentTime-tmpl"))||container.hooks.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),depth0,{"name":"timegridCurrentTime-tmpl","hash":{},"data":data,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}})) != null ? stack1 : "")
  21872. + "\n";
  21873. },"useData":true});
  21874. /***/ }),
  21875. /***/ "./src/js/view/template/week/timeMoveGuide.hbs":
  21876. /*!*****************************************************!*\
  21877. !*** ./src/js/view/template/week/timeMoveGuide.hbs ***!
  21878. \*****************************************************/
  21879. /*! no static exports found */
  21880. /***/ (function(module, exports, __webpack_require__) {
  21881. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  21882. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  21883. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21884. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21885. return parent[propertyName];
  21886. }
  21887. return undefined
  21888. };
  21889. return " <div class=\""
  21890. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":38}}}) : helper)))
  21891. + "time-schedule-content "
  21892. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":4,"column":60},"end":{"line":4,"column":74}}}) : helper)))
  21893. + "time-schedule-content-travel-time\" style=\"border-color:"
  21894. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  21895. + "; border-bottom: 1px dashed "
  21896. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  21897. + "; height: "
  21898. + alias4(((helper = (helper = lookupProperty(helpers,"goingDurationHeight") || (depth0 != null ? lookupProperty(depth0,"goingDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"goingDurationHeight","hash":{},"data":data,"loc":{"start":{"line":4,"column":203},"end":{"line":4,"column":226}}}) : helper)))
  21899. + "%;\">"
  21900. + ((stack1 = (lookupProperty(helpers,"goingDuration-tmpl")||(depth0 && lookupProperty(depth0,"goingDuration-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"goingDuration-tmpl","hash":{},"data":data,"loc":{"start":{"line":4,"column":230},"end":{"line":4,"column":260}}})) != null ? stack1 : "")
  21901. + "</div>\n";
  21902. },"3":function(container,depth0,helpers,partials,data) {
  21903. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21904. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21905. return parent[propertyName];
  21906. }
  21907. return undefined
  21908. };
  21909. return " <div class=\""
  21910. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":38}}}) : helper)))
  21911. + "time-schedule-content "
  21912. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":10,"column":60},"end":{"line":10,"column":74}}}) : helper)))
  21913. + "time-schedule-content-travel-time\" style=\"border-color:"
  21914. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  21915. + "; border-top: 1px dashed "
  21916. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"color") : stack1), depth0))
  21917. + "; height: "
  21918. + alias4(((helper = (helper = lookupProperty(helpers,"comingDurationHeight") || (depth0 != null ? lookupProperty(depth0,"comingDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"comingDurationHeight","hash":{},"data":data,"loc":{"start":{"line":10,"column":200},"end":{"line":10,"column":224}}}) : helper)))
  21919. + "%;\">"
  21920. + ((stack1 = (lookupProperty(helpers,"comingDuration-tmpl")||(depth0 && lookupProperty(depth0,"comingDuration-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"comingDuration-tmpl","hash":{},"data":data,"loc":{"start":{"line":10,"column":228},"end":{"line":10,"column":259}}})) != null ? stack1 : "")
  21921. + "</div>\n";
  21922. },"5":function(container,depth0,helpers,partials,data) {
  21923. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21924. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21925. return parent[propertyName];
  21926. }
  21927. return undefined
  21928. };
  21929. return "<div class=\""
  21930. + container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":13,"column":38},"end":{"line":13,"column":52}}}) : helper)))
  21931. + "time-resize-handle handle-x\">&nbsp;</div>";
  21932. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  21933. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21934. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21935. return parent[propertyName];
  21936. }
  21937. return undefined
  21938. };
  21939. return "<div class=\""
  21940. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}}) : helper)))
  21941. + "time-date-schedule-block\" data-id=\""
  21942. + alias4((lookupProperty(helpers,"stamp")||(depth0 && lookupProperty(depth0,"stamp"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"stamp","hash":{},"data":data,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":76}}}))
  21943. + "\" style=\"width: 100%; height: 100%;\">\n <div class=\""
  21944. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":30}}}) : helper)))
  21945. + "time-schedule "
  21946. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":44},"end":{"line":2,"column":58}}}) : helper)))
  21947. + "time-date-schedule-block-focused\" style=\"color: #ffffff; background-color:"
  21948. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"dragBgColor") : stack1), depth0))
  21949. + ";\">\n"
  21950. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hasGoingDuration") : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":3,"column":8},"end":{"line":5,"column":15}}})) != null ? stack1 : "")
  21951. + " <div class=\""
  21952. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":6,"column":24},"end":{"line":6,"column":38}}}) : helper)))
  21953. + "time-schedule-content\" style=\"height: "
  21954. + alias4(((helper = (helper = lookupProperty(helpers,"modelDurationHeight") || (depth0 != null ? lookupProperty(depth0,"modelDurationHeight") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"modelDurationHeight","hash":{},"data":data,"loc":{"start":{"line":6,"column":76},"end":{"line":6,"column":99}}}) : helper)))
  21955. + "%; border-color:"
  21956. + alias4(alias5(((stack1 = (depth0 != null ? lookupProperty(depth0,"model") : depth0)) != null ? lookupProperty(stack1,"borderColor") : stack1), depth0))
  21957. + ";\">\n "
  21958. + ((stack1 = (lookupProperty(helpers,"time-tmpl")||(depth0 && lookupProperty(depth0,"time-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"model") : depth0),{"name":"time-tmpl","hash":{},"data":data,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":37}}})) != null ? stack1 : "")
  21959. + "\n </div>\n"
  21960. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hasComingDuration") : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":9,"column":8},"end":{"line":11,"column":15}}})) != null ? stack1 : "")
  21961. + " </div>\n "
  21962. + ((stack1 = lookupProperty(helpers,"unless").call(alias1,(depth0 != null ? lookupProperty(depth0,"croppedEnd") : depth0),{"name":"unless","hash":{},"fn":container.program(5, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":13,"column":4},"end":{"line":13,"column":104}}})) != null ? stack1 : "")
  21963. + "\n <div class=\""
  21964. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":14,"column":16},"end":{"line":14,"column":30}}}) : helper)))
  21965. + "time-date-schedule-block-cover\"></div>\n</div>\n";
  21966. },"useData":true});
  21967. /***/ }),
  21968. /***/ "./src/js/view/template/week/timezoneSticky.hbs":
  21969. /*!******************************************************!*\
  21970. !*** ./src/js/view/template/week/timezoneSticky.hbs ***!
  21971. \******************************************************/
  21972. /*! no static exports found */
  21973. /***/ (function(module, exports, __webpack_require__) {
  21974. var Handlebars = __webpack_require__(/*! ./node_modules/handlebars/runtime.js */ "./node_modules/handlebars/runtime.js");
  21975. module.exports = (Handlebars['default'] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {
  21976. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  21977. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  21978. return parent[propertyName];
  21979. }
  21980. return undefined
  21981. };
  21982. return "<div class=\""
  21983. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":26}}}) : helper)))
  21984. + "timegrid-timezone-label-container\" style=\""
  21985. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(depth0 != null ? lookupProperty(depth0,"hidden") : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":2,"column":68},"end":{"line":2,"column":102}}})) != null ? stack1 : "")
  21986. + "background-color: "
  21987. + alias4(((helper = (helper = lookupProperty(helpers,"backgroundColor") || (depth0 != null ? lookupProperty(depth0,"backgroundColor") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"backgroundColor","hash":{},"data":data,"loc":{"start":{"line":2,"column":120},"end":{"line":2,"column":139}}}) : helper)))
  21988. + "; height: 100%; width: "
  21989. + alias4(((helper = (helper = lookupProperty(helpers,"width") || (depth0 != null ? lookupProperty(depth0,"width") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"width","hash":{},"data":data,"loc":{"start":{"line":2,"column":162},"end":{"line":2,"column":171}}}) : helper)))
  21990. + "%; left: "
  21991. + alias4(((helper = (helper = lookupProperty(helpers,"left") || (depth0 != null ? lookupProperty(depth0,"left") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"left","hash":{},"data":data,"loc":{"start":{"line":2,"column":180},"end":{"line":2,"column":188}}}) : helper)))
  21992. + "%; font-size: "
  21993. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"leftFontSize")), depth0))
  21994. + "; border-right: "
  21995. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"leftBorderRight")), depth0))
  21996. + ";\">\n <div title=\""
  21997. + alias4(((helper = (helper = lookupProperty(helpers,"tooltip") || (depth0 != null ? lookupProperty(depth0,"tooltip") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tooltip","hash":{},"data":data,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":27}}}) : helper)))
  21998. + "\" class=\""
  21999. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":3,"column":36},"end":{"line":3,"column":50}}}) : helper)))
  22000. + "timegrid-timezone-label-cell\" data-timezone=\""
  22001. + alias4(((helper = (helper = lookupProperty(helpers,"displayLabel") || (depth0 != null ? lookupProperty(depth0,"displayLabel") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayLabel","hash":{},"data":data,"loc":{"start":{"line":3,"column":95},"end":{"line":3,"column":111}}}) : helper)))
  22002. + "\" style=\"height: 100%; width: 100%;\">\n"
  22003. + ((stack1 = lookupProperty(helpers,"if").call(alias1,(lookupProperty(helpers,"and")||(depth0 && lookupProperty(depth0,"and"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"isPrimary") : depth0),((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"showTimezoneCollapseButton")),{"name":"and","hash":{},"data":data,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":62}}}),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":4,"column":8},"end":{"line":10,"column":15}}})) != null ? stack1 : "")
  22004. + " <div class=\""
  22005. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":11,"column":20},"end":{"line":11,"column":34}}}) : helper)))
  22006. + "timegrid-timezone-label\">"
  22007. + ((stack1 = (lookupProperty(helpers,"timezoneDisplayLabel-tmpl")||(depth0 && lookupProperty(depth0,"timezoneDisplayLabel-tmpl"))||alias2).call(alias1,(depth0 != null ? lookupProperty(depth0,"timezoneOffset") : depth0),(depth0 != null ? lookupProperty(depth0,"displayLabel") : depth0),{"name":"timezoneDisplayLabel-tmpl","hash":{},"data":data,"loc":{"start":{"line":11,"column":59},"end":{"line":11,"column":118}}})) != null ? stack1 : "")
  22008. + "</div>\n </div>\n</div>\n";
  22009. },"2":function(container,depth0,helpers,partials,data) {
  22010. return "display:none;";
  22011. },"4":function(container,depth0,helpers,partials,data) {
  22012. var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=container.hooks.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  22013. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  22014. return parent[propertyName];
  22015. }
  22016. return undefined
  22017. };
  22018. return " <div class=\""
  22019. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":5,"column":24},"end":{"line":5,"column":38}}}) : helper)))
  22020. + "timegrid-timezone-close-btn\" style=\"border: 1px solid #ddd; top:2px; bottom: 2px; width: 10px; border-left: none;\">\n <span style=\"color: #777; height: calc("
  22021. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"displayTimezoneLabelHeight")), depth0))
  22022. + " - 6px); line-height: calc("
  22023. + alias4(alias5(((stack1 = ((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"styles"))) && lookupProperty(stack1,"displayTimezoneLabelHeight")), depth0))
  22024. + " - 6px);\">\n <span class=\""
  22025. + alias4(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":33},"end":{"line":7,"column":47}}}) : helper)))
  22026. + "icon "
  22027. + ((stack1 = lookupProperty(helpers,"if").call(alias1,((stack1 = (data && lookupProperty(data,"root"))) && lookupProperty(stack1,"timezonesCollapsed")),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data,"loc":{"start":{"line":7,"column":52},"end":{"line":7,"column":154}}})) != null ? stack1 : "")
  22028. + "\"></span>\n </span>\n </div>\n";
  22029. },"5":function(container,depth0,helpers,partials,data) {
  22030. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  22031. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  22032. return parent[propertyName];
  22033. }
  22034. return undefined
  22035. };
  22036. return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":84},"end":{"line":7,"column":98}}}) : helper)))
  22037. + "ic-arrow-right";
  22038. },"7":function(container,depth0,helpers,partials,data) {
  22039. var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
  22040. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  22041. return parent[propertyName];
  22042. }
  22043. return undefined
  22044. };
  22045. return container.escapeExpression(((helper = (helper = lookupProperty(helpers,"CSS_PREFIX") || (depth0 != null ? lookupProperty(depth0,"CSS_PREFIX") : depth0)) != null ? helper : container.hooks.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"CSS_PREFIX","hash":{},"data":data,"loc":{"start":{"line":7,"column":120},"end":{"line":7,"column":134}}}) : helper)))
  22046. + "ic-arrow-left";
  22047. },"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
  22048. var stack1, alias1=depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function(parent, propertyName) {
  22049. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  22050. return parent[propertyName];
  22051. }
  22052. return undefined
  22053. };
  22054. return ((stack1 = lookupProperty(helpers,"each").call(alias1,(lookupProperty(helpers,"reverse")||(depth0 && lookupProperty(depth0,"reverse"))||container.hooks.helperMissing).call(alias1,(depth0 != null ? lookupProperty(depth0,"timezones") : depth0),{"name":"reverse","hash":{},"data":data,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":27}}}),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data,"loc":{"start":{"line":1,"column":0},"end":{"line":14,"column":11}}})) != null ? stack1 : "");
  22055. },"useData":true});
  22056. /***/ }),
  22057. /***/ "./src/js/view/view.js":
  22058. /*!*****************************!*\
  22059. !*** ./src/js/view/view.js ***!
  22060. \*****************************/
  22061. /*! no static exports found */
  22062. /***/ (function(module, exports, __webpack_require__) {
  22063. "use strict";
  22064. /**
  22065. * @fileoverview The base class of views.
  22066. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  22067. */
  22068. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  22069. var domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js");
  22070. var Collection = __webpack_require__(/*! ../common/collection */ "./src/js/common/collection.js");
  22071. /**
  22072. * Base class of views.
  22073. *
  22074. * All views create own container element inside supplied container element.
  22075. * @constructor
  22076. * @param {HTMLElement} container Default container element for view.
  22077. * you can use this element for this.container syntax.
  22078. */
  22079. function View(container) {
  22080. var id = util.stamp(this);
  22081. if (util.isUndefined(container)) {
  22082. container = domutil.appendHTMLElement('div');
  22083. }
  22084. domutil.addClass(container, this.cssprefix(id));
  22085. /**
  22086. * unique id
  22087. * @type {number}
  22088. */
  22089. this.id = id;
  22090. /**
  22091. * base element of view.
  22092. * @type {HTMLDIVElement}
  22093. */
  22094. this.container = container;
  22095. /*eslint-disable*/
  22096. /**
  22097. * child views.
  22098. * @type {Collection}
  22099. */
  22100. this.children = new Collection(function(view) {
  22101. return util.stamp(view);
  22102. });
  22103. /* eslint-enable*/
  22104. /**
  22105. * parent view instance.
  22106. * @type {View}
  22107. */
  22108. this.parent = null;
  22109. /**
  22110. * state of view
  22111. */
  22112. this.state = {};
  22113. }
  22114. /**
  22115. * CSS classname prefix
  22116. * @type {string}
  22117. */
  22118. View.prototype.cssPrefix = 'tui-view-';
  22119. /**
  22120. * Add child views.
  22121. * @param {View} view The view instance to add.
  22122. * @param {function} [fn] Function for invoke before add. parent view class is supplied first arguments.
  22123. */
  22124. View.prototype.addChild = function(view, fn) {
  22125. if (fn) {
  22126. fn.call(view, this);
  22127. }
  22128. // add parent view
  22129. view.parent = this;
  22130. this.children.add(view);
  22131. };
  22132. /**
  22133. * Remove added child view.
  22134. * @param {(number|View)} id View id or instance itself to remove.
  22135. * @param {function} [fn] Function for invoke before remove. parent view class is supplied first arguments.
  22136. */
  22137. View.prototype.removeChild = function(id, fn) {
  22138. var view = util.isNumber(id) ? this.children.items[id] : id;
  22139. id = util.stamp(view);
  22140. if (fn) {
  22141. fn.call(view, this);
  22142. }
  22143. this.children.remove(id);
  22144. };
  22145. /**
  22146. * Render view recursively.
  22147. */
  22148. View.prototype.render = function() {
  22149. this.children.each(function(childView) {
  22150. childView.render();
  22151. });
  22152. };
  22153. /**
  22154. * Invoke function recursively.
  22155. * @param {function} fn - function to invoke child view recursively
  22156. * @param {boolean} [skipThis=false] - set true then skip invoke with this(root) view.
  22157. */
  22158. View.prototype.recursive = function(fn, skipThis) {
  22159. if (!util.isFunction(fn)) {
  22160. return;
  22161. }
  22162. if (!skipThis) {
  22163. fn(this);
  22164. }
  22165. this.children.each(function(childView) {
  22166. childView.recursive(fn);
  22167. });
  22168. };
  22169. /**
  22170. * Resize view recursively to parent.
  22171. */
  22172. View.prototype.resize = function() {
  22173. var args = Array.prototype.slice.call(arguments),
  22174. parent = this.parent;
  22175. while (parent) {
  22176. if (util.isFunction(parent._onResize)) {
  22177. parent._onResize.apply(parent, args);
  22178. }
  22179. parent = parent.parent;
  22180. }
  22181. };
  22182. /**
  22183. * Invoking method before destroying.
  22184. */
  22185. View.prototype._beforeDestroy = function() {};
  22186. /**
  22187. * Clear properties
  22188. */
  22189. View.prototype._destroy = function() {
  22190. this._beforeDestroy();
  22191. this.children.clear();
  22192. this.container.innerHTML = '';
  22193. this.id = this.parent = this.children = this.container = null;
  22194. };
  22195. /*eslint-disable*/
  22196. /**
  22197. * Destroy child view recursively.
  22198. */
  22199. View.prototype.destroy = function(isChildView) {
  22200. this.children.each(function(childView) {
  22201. childView.destroy(true);
  22202. childView._destroy();
  22203. });
  22204. if (isChildView) {
  22205. return;
  22206. }
  22207. this._destroy();
  22208. };
  22209. /* eslint-enable*/
  22210. /**
  22211. * Calculate view's container element bound.
  22212. * @returns {object} The bound of container element.
  22213. */
  22214. View.prototype.getViewBound = function() {
  22215. var container = this.container,
  22216. position = domutil.getPosition(container),
  22217. size = domutil.getSize(container);
  22218. return {
  22219. x: position[0],
  22220. y: position[1],
  22221. width: size[0],
  22222. height: size[1]
  22223. };
  22224. };
  22225. /**
  22226. * Return view default CSS prefix
  22227. * @param {string} [className] - if supplied then return prefix added class name
  22228. * @returns {string} CSS prefix value
  22229. */
  22230. View.prototype.cssprefix = function(className) {
  22231. return this.cssPrefix + (className || '');
  22232. };
  22233. /**
  22234. * set state
  22235. * @param {object} state - state
  22236. */
  22237. View.prototype.setState = function(state) {
  22238. util.extend(this.state, state);
  22239. };
  22240. util.CustomEvents.mixin(View);
  22241. module.exports = View;
  22242. /***/ }),
  22243. /***/ "./src/js/view/week/dayGrid.js":
  22244. /*!*************************************!*\
  22245. !*** ./src/js/view/week/dayGrid.js ***!
  22246. \*************************************/
  22247. /*! no static exports found */
  22248. /***/ (function(module, exports, __webpack_require__) {
  22249. "use strict";
  22250. /**
  22251. * @fileoverview DayGrid in weekly view
  22252. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  22253. */
  22254. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  22255. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js"),
  22256. common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js"),
  22257. datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js"),
  22258. domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js"),
  22259. TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date,
  22260. View = __webpack_require__(/*! ../../view/view */ "./src/js/view/view.js"),
  22261. DayGridSchedule = __webpack_require__(/*! ./dayGridSchedule */ "./src/js/view/week/dayGridSchedule.js"),
  22262. baseTmpl = __webpack_require__(/*! ../template/week/dayGrid.hbs */ "./src/js/view/template/week/dayGrid.hbs"),
  22263. reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
  22264. var mmax = Math.max,
  22265. mmin = Math.min;
  22266. /**
  22267. * @constructor
  22268. * @extends {Weekday}
  22269. * @param {string} name - view name
  22270. * @param {object} options - options for DayGridSchedule view
  22271. * @param {number} [options.heightPercent] - height percent of view
  22272. * @param {number} [options.containerButtonGutter=8] - free space at bottom to
  22273. * make create easy.
  22274. * @param {number} [options.scheduleHeight=18] - height of each schedule block.
  22275. * @param {number} [options.scheduleGutter=2] - gutter height of each schedule block.
  22276. * @param {HTMLDIVElement} container - DOM element to use container for this
  22277. * view.
  22278. * @param {Theme} theme - theme instance
  22279. */
  22280. function DayGrid(name, options, container, theme) {
  22281. container = domutil.appendHTMLElement(
  22282. 'div',
  22283. container,
  22284. config.classname('daygrid-layout')
  22285. );
  22286. View.call(this, container);
  22287. name = name || 'daygrid';
  22288. this.options = util.extend({
  22289. viewName: name,
  22290. daynames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
  22291. renderStartDate: '',
  22292. renderEndDate: '',
  22293. containerBottomGutter: 18,
  22294. scheduleHeight: parseInt(theme.week.dayGridSchedule.height, 10),
  22295. scheduleGutter: parseInt(theme.week.dayGridSchedule.marginTop, 10),
  22296. scheduleContainerTop: 1,
  22297. timezones: options.timezones,
  22298. isReadOnly: options.isReadOnly,
  22299. getViewModelFunc: function(viewModel) {
  22300. return viewModel.schedulesInDateRange[name];
  22301. },
  22302. setViewModelFunc: function(viewModel, matrices) {
  22303. viewModel.schedulesInDateRange[name] = matrices;
  22304. }
  22305. }, options.week);
  22306. this.handler = {};
  22307. this.vPanel = null;
  22308. this.state.collapsed = true;
  22309. }
  22310. util.inherit(DayGrid, View);
  22311. /**
  22312. * @override
  22313. * @param {object} viewModel - schedules view models
  22314. */
  22315. DayGrid.prototype.getBaseViewModel = function(viewModel) {
  22316. var opt = this.options,
  22317. daynames = opt.daynames,
  22318. range = viewModel.range,
  22319. grids = viewModel.grids,
  22320. matrices = opt.getViewModelFunc(viewModel),
  22321. exceedDate = {},
  22322. panel = getPanel(opt.panels, opt.viewName),
  22323. panelHeight = this.getViewBound().height,
  22324. collapsed = this.state.collapsed,
  22325. heightForcedSet = this.vPanel ? this.vPanel.getHeightForcedSet() : false,
  22326. timezonesCollapsed = viewModel.state.timezonesCollapsed,
  22327. styles = this._getStyles(viewModel.theme, timezonesCollapsed);
  22328. var baseViewModel, visibleScheduleCount;
  22329. var now = new TZDate().toLocalTime();
  22330. if (panel.showExpandableButton) {
  22331. if (!heightForcedSet) {
  22332. if (collapsed) {
  22333. panelHeight = mmax(panelHeight, panel.maxHeight);
  22334. } else {
  22335. panelHeight = mmin(panelHeight, panel.maxExpandableHeight);
  22336. }
  22337. }
  22338. visibleScheduleCount = Math.floor(panelHeight / (opt.scheduleHeight + opt.scheduleGutter));
  22339. if (collapsed) {
  22340. exceedDate = this.parent.controller.getExceedDate(visibleScheduleCount,
  22341. matrices,
  22342. viewModel.range
  22343. );
  22344. matrices = this.parent.controller.excludeExceedSchedules(matrices, visibleScheduleCount);
  22345. opt.setViewModelFunc(viewModel, matrices);
  22346. }
  22347. }
  22348. baseViewModel = {
  22349. viewName: opt.viewName,
  22350. range: range,
  22351. grids: grids,
  22352. days: util.map(viewModel.range, function(d, index) {
  22353. var day = d.getDay();
  22354. var ymd = datetime.format(d, 'YYYYMMDD');
  22355. var isToday = datetime.isSameDate(now, d);
  22356. return {
  22357. day: day,
  22358. dayName: daynames[day],
  22359. isToday: isToday,
  22360. date: d.getDate(),
  22361. renderDate: datetime.format(d, 'YYYY-MM-DD'),
  22362. hiddenSchedules: exceedDate[ymd] || 0,
  22363. width: grids[index] ? grids[index].width : 0,
  22364. left: grids[index] ? grids[index].left : 0,
  22365. backgroundColor: viewModel.range.length > 1 ?
  22366. getWeekBackgroundColor(day, isToday, styles) : styles.backgroundColor
  22367. };
  22368. }),
  22369. exceedDate: exceedDate,
  22370. showExpandableButton: panel.showExpandableButton,
  22371. collapsed: collapsed,
  22372. collapseBtnIndex: this.state.clickedExpandBtnIndex,
  22373. styles: styles
  22374. };
  22375. return baseViewModel;
  22376. };
  22377. /**
  22378. * @override
  22379. * @param {object} viewModel - schedules view models
  22380. */
  22381. DayGrid.prototype.render = function(viewModel) {
  22382. var opt = this.options,
  22383. container = this.container,
  22384. baseViewModel = this.getBaseViewModel(viewModel),
  22385. scheduleContainerTop = this.options.scheduleContainerTop;
  22386. var dayGridSchedule;
  22387. container.innerHTML = baseTmpl(baseViewModel);
  22388. this.children.clear();
  22389. dayGridSchedule = new DayGridSchedule(
  22390. opt,
  22391. domutil.find(config.classname('.container'), container)
  22392. );
  22393. this.addChild(dayGridSchedule);
  22394. dayGridSchedule.on('afterRender', function(weekdayViewModel) {
  22395. baseViewModel.height = weekdayViewModel.minHeight + scheduleContainerTop;
  22396. });
  22397. this.children.each(function(childView) {
  22398. childView.render(viewModel);
  22399. }, this);
  22400. this.fire('afterRender', baseViewModel);
  22401. };
  22402. DayGrid.prototype._beforeDestroy = function() {
  22403. };
  22404. DayGrid.prototype.addHandler = function(type, handler, vPanel) {
  22405. var self = this;
  22406. this.handler[type] = handler;
  22407. this.vPanel = vPanel;
  22408. if (type === 'click') {
  22409. handler.on('expand', function() {
  22410. self.setState({
  22411. collapsed: false
  22412. });
  22413. }, this);
  22414. handler.on('collapse', function() {
  22415. self.setState({
  22416. collapsed: true
  22417. });
  22418. }, this);
  22419. }
  22420. };
  22421. DayGrid.prototype._expand = function() {
  22422. reqAnimFrame.requestAnimFrame(function() {
  22423. var vPanel = this.vPanel;
  22424. var opt = this.options;
  22425. var panel = getPanel(opt.panels, opt.viewName);
  22426. vPanel.setMaxHeight(panel.maxExpandableHeight);
  22427. vPanel.setHeightForcedSet(false);
  22428. vPanel.setHeight(null, panel.maxExpandableHeight);
  22429. if (this.parent) {
  22430. this.parent.render();
  22431. }
  22432. }, this);
  22433. };
  22434. DayGrid.prototype._collapse = function() {
  22435. reqAnimFrame.requestAnimFrame(function() {
  22436. var vPanel = this.vPanel;
  22437. var opt = this.options;
  22438. var panel = getPanel(opt.panels, opt.viewName);
  22439. vPanel.setMaxHeight(panel.maxHeight);
  22440. vPanel.setHeightForcedSet(false);
  22441. vPanel.setHeight(null, panel.minHeight);
  22442. if (this.parent) {
  22443. this.parent.render();
  22444. }
  22445. }, this);
  22446. };
  22447. /**
  22448. * set state
  22449. * @param {object} state - state
  22450. */
  22451. DayGrid.prototype.setState = function(state) {
  22452. var collapsed = this.state.collapsed;
  22453. View.prototype.setState.call(this, state);
  22454. if (this.state.collapsed === collapsed) {
  22455. return;
  22456. }
  22457. if (this.state.collapsed) {
  22458. this._collapse();
  22459. } else {
  22460. this._expand();
  22461. }
  22462. };
  22463. /**
  22464. * Get the styles from theme
  22465. * @param {Theme} theme - theme instance
  22466. * @param {boolean} timezonesCollapsed - multiple timezones are collapsed.
  22467. * @returns {object} styles - styles object
  22468. */
  22469. DayGrid.prototype._getStyles = function(theme, timezonesCollapsed) {
  22470. var styles = {};
  22471. var timezonesLength = this.options.timezones.length;
  22472. var collapsed = timezonesCollapsed;
  22473. var numberAndUnit;
  22474. if (theme) {
  22475. styles.borderRight = theme.week.daygrid.borderRight || theme.common.border;
  22476. styles.todayBackgroundColor = theme.week.today.backgroundColor;
  22477. styles.weekendBackgroundColor = theme.week.weekend.backgroundColor;
  22478. styles.backgroundColor = theme.week.daygrid.backgroundColor;
  22479. styles.leftWidth = theme.week.daygridLeft.width;
  22480. styles.leftBackgroundColor = theme.week.daygridLeft.backgroundColor;
  22481. styles.leftPaddingRight = theme.week.daygridLeft.paddingRight;
  22482. styles.leftBorderRight = theme.week.daygridLeft.borderRight;
  22483. if (!collapsed && timezonesLength > 1) {
  22484. numberAndUnit = common.parseUnit(styles.leftWidth);
  22485. styles.leftWidth = (numberAndUnit[0] * timezonesLength) + numberAndUnit[1];
  22486. }
  22487. }
  22488. return styles;
  22489. };
  22490. /**
  22491. * Get a background color based on day.
  22492. * @param {number} day - day number
  22493. * @param {boolean} isToday - today flag
  22494. * @param {object} styles - style object
  22495. * @returns {string} backgroundColor
  22496. */
  22497. function getWeekBackgroundColor(day, isToday, styles) {
  22498. var backgroundColor = '';
  22499. if (day === 0 || day === 6) {
  22500. backgroundColor = styles.weekendBackgroundColor;
  22501. } else if (isToday) {
  22502. backgroundColor = styles.todayBackgroundColor;
  22503. } else {
  22504. backgroundColor = styles.backgroundColor;
  22505. }
  22506. return backgroundColor;
  22507. }
  22508. /**
  22509. * get a panel infomation
  22510. * @param {Array.<object[]>} panels - panel infomations
  22511. * @param {string} name - panel name
  22512. * @returns {object} panel information
  22513. */
  22514. function getPanel(panels, name) {
  22515. var found;
  22516. util.forEach(panels, function(panel) {
  22517. if (panel.name === name) {
  22518. found = panel;
  22519. }
  22520. });
  22521. return found;
  22522. }
  22523. module.exports = DayGrid;
  22524. /***/ }),
  22525. /***/ "./src/js/view/week/dayGridSchedule.js":
  22526. /*!*********************************************!*\
  22527. !*** ./src/js/view/week/dayGridSchedule.js ***!
  22528. \*********************************************/
  22529. /*! no static exports found */
  22530. /***/ (function(module, exports, __webpack_require__) {
  22531. "use strict";
  22532. /**
  22533. * @fileoverview Weekday view for week
  22534. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  22535. */
  22536. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  22537. var Weekday = __webpack_require__(/*! ../weekday */ "./src/js/view/weekday.js"),
  22538. tmpl = __webpack_require__(/*! ../template/week/dayGridSchedule.hbs */ "./src/js/view/template/week/dayGridSchedule.hbs");
  22539. var mmax = Math.max;
  22540. /**
  22541. * @constructor
  22542. * @extends {Weekday}
  22543. * @param {object} options - options for DayGridSchedule view
  22544. * @param {number} [options.containerButtonGutter=8] - free space at bottom to
  22545. * make create easy.
  22546. * @param {number} [options.scheduleHeight=18] - height of each schedule block.
  22547. * @param {number} [options.scheduleGutter=2] - gutter height of each schedule block.
  22548. * @param {HTMLDIVElement} container - DOM element to use container for this
  22549. * view.
  22550. */
  22551. function DayGridSchedule(options, container) {
  22552. Weekday.call(this, options, container);
  22553. this.collapsed = true;
  22554. }
  22555. util.inherit(DayGridSchedule, Weekday);
  22556. /**
  22557. * Render Weekday view
  22558. * @override
  22559. */
  22560. DayGridSchedule.prototype.render = function(viewModel) {
  22561. var container = this.container;
  22562. var baseViewModel;
  22563. baseViewModel = this.getBaseViewModel(viewModel);
  22564. container.innerHTML = tmpl(baseViewModel);
  22565. this.fire('afterRender', baseViewModel);
  22566. };
  22567. /**
  22568. * returns maximum schedule count in day
  22569. * @param {array} matrices - The matrices for schedule placing.
  22570. * @returns {number} maximum schedule count in day
  22571. */
  22572. DayGridSchedule.prototype._getMaxScheduleInDay = function(matrices) {
  22573. return mmax.apply(
  22574. null,
  22575. util.map(matrices, function(matrix) {
  22576. return Math.max.apply(null, util.map(matrix, function(row) {
  22577. return row.length;
  22578. }));
  22579. })
  22580. );
  22581. };
  22582. /**
  22583. * returns minimum height for container.
  22584. * @param {number} maxScheduleInDay - max schedule blocks in one day
  22585. * @returns {number}
  22586. */
  22587. DayGridSchedule.prototype._getMinHeight = function(maxScheduleInDay) {
  22588. var opt = this.options;
  22589. var contentHeight = (maxScheduleInDay * opt.scheduleHeight)
  22590. + ((maxScheduleInDay - 1) * opt.scheduleGutter);
  22591. // if (this.collapsed && this.aboutMe.maxHeight >= contentHeight + opt.containerBottomGutter) {
  22592. // contentHeight += opt.containerBottomGutter;
  22593. // }
  22594. return contentHeight;
  22595. };
  22596. /**
  22597. * @override
  22598. * @param {object} viewModel - schedules view models
  22599. */
  22600. DayGridSchedule.prototype.getBaseViewModel = function(viewModel) {
  22601. var opt = this.options;
  22602. var matrices = opt.getViewModelFunc(viewModel);
  22603. var maxScheduleInDay = this._getMaxScheduleInDay(matrices);
  22604. var baseViewModel;
  22605. var styles = this._getStyles(viewModel.theme);
  22606. baseViewModel = Weekday.prototype.getBaseViewModel.call(this, viewModel);
  22607. baseViewModel = util.extend({
  22608. minHeight: this._getMinHeight(maxScheduleInDay),
  22609. matrices: matrices,
  22610. scheduleContainerTop: this.options.scheduleContainerTop,
  22611. maxScheduleInDay: maxScheduleInDay,
  22612. isReadOnly: opt.isReadOnly,
  22613. styles: styles
  22614. }, baseViewModel);
  22615. return baseViewModel;
  22616. };
  22617. /**
  22618. * Get the styles from theme
  22619. * @param {Theme} theme - theme instance
  22620. * @returns {object} styles - styles object
  22621. */
  22622. DayGridSchedule.prototype._getStyles = function(theme) {
  22623. var styles = {};
  22624. if (theme) {
  22625. styles.borderRadius = theme.week.dayGridSchedule.borderRadius;
  22626. }
  22627. return styles;
  22628. };
  22629. module.exports = DayGridSchedule;
  22630. /***/ }),
  22631. /***/ "./src/js/view/week/dayname.js":
  22632. /*!*************************************!*\
  22633. !*** ./src/js/view/week/dayname.js ***!
  22634. \*************************************/
  22635. /*! no static exports found */
  22636. /***/ (function(module, exports, __webpack_require__) {
  22637. "use strict";
  22638. /**
  22639. * @fileoverview View for rendering daynames
  22640. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  22641. */
  22642. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  22643. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  22644. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  22645. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  22646. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  22647. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  22648. var View = __webpack_require__(/*! ../view */ "./src/js/view/view.js");
  22649. var daynameTmpl = __webpack_require__(/*! ../template/week/daynames.hbs */ "./src/js/view/template/week/daynames.hbs");
  22650. /**
  22651. * @constructor
  22652. * @param {object} options - options for dayname view
  22653. * @param {HTMLElement} container Container element to use.
  22654. * @param {Theme} theme - theme instance
  22655. * @extends {View}
  22656. */
  22657. function DayName(options, container, theme) {
  22658. container = domutil.appendHTMLElement(
  22659. 'div',
  22660. container,
  22661. config.classname('dayname-container')
  22662. );
  22663. this.options = util.extend({
  22664. daynames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
  22665. timezones: options.timezones
  22666. }, options.week);
  22667. /**
  22668. * @type {Theme}
  22669. */
  22670. this.theme = theme;
  22671. View.call(this, container);
  22672. this.applyTheme();
  22673. }
  22674. util.inherit(DayName, View);
  22675. /**
  22676. * Get default viewmodels.
  22677. * @param {Date} start The date of start render
  22678. * @param {Date} end The end of end render
  22679. * @param {object} grids grid data(width, left, day)
  22680. * @returns {array} viewmodel.
  22681. */
  22682. DayName.prototype._getBaseViewModel = function(start, end, grids) {
  22683. var daynames = this.options.daynames,
  22684. theme = this.theme,
  22685. now = new TZDate().toLocalTime(),
  22686. viewModel;
  22687. viewModel = util.map(datetime.range(
  22688. datetime.start(start),
  22689. datetime.end(end),
  22690. datetime.MILLISECONDS_PER_DAY
  22691. ), function(d, i) {
  22692. var day = d.getDay();
  22693. var isToday = datetime.isSameDate(d, now);
  22694. var isPastDay = d < now && !isToday;
  22695. return {
  22696. day: day,
  22697. dayName: daynames[day],
  22698. isToday: isToday,
  22699. date: d.getDate(),
  22700. left: grids[i] ? grids[i].left : 0,
  22701. width: grids[i] ? grids[i].width : 0,
  22702. renderDate: datetime.format(d, 'YYYY-MM-DD'),
  22703. color: this._getDayNameColor(theme, day, isToday, isPastDay)
  22704. };
  22705. }, this);
  22706. return viewModel;
  22707. };
  22708. /**
  22709. * @override
  22710. * @param {object} viewModel View model from parent (WeekView)
  22711. */
  22712. DayName.prototype.render = function(viewModel) {
  22713. var dayNames = this._getBaseViewModel(
  22714. viewModel.renderStartDate,
  22715. viewModel.renderEndDate,
  22716. viewModel.grids
  22717. );
  22718. var timezonesCollapsed = viewModel.state.timezonesCollapsed;
  22719. var styles = this._getStyles(this.theme, timezonesCollapsed);
  22720. var baseViewModel = util.extend({}, {
  22721. dayNames: dayNames,
  22722. styles: styles
  22723. });
  22724. this.container.innerHTML = daynameTmpl(baseViewModel);
  22725. };
  22726. /**
  22727. * Get a day name color
  22728. * @param {Theme} theme - theme instance
  22729. * @param {number} day - day number
  22730. * @param {boolean} isToday - today flag
  22731. * @param {boolean} isPastDay - is past day flag
  22732. * @returns {string} style - color style
  22733. */
  22734. DayName.prototype._getDayNameColor = function(theme, day, isToday, isPastDay) {
  22735. var color = '';
  22736. if (theme) {
  22737. if (day === 0) {
  22738. color = theme.common.holiday.color;
  22739. } else if (isPastDay) {
  22740. color = theme.week.pastDay.color || theme.common.dayname.color;
  22741. } else if (day === 6) {
  22742. color = theme.common.saturday.color;
  22743. } else if (isToday) {
  22744. color = theme.week.today.color || theme.common.today.color;
  22745. } else {
  22746. color = theme.common.dayname.color;
  22747. }
  22748. }
  22749. return color;
  22750. };
  22751. /**
  22752. * Get the styles from theme
  22753. * @param {Theme} theme - theme instance
  22754. * @param {boolean} timezonesCollapsed - multiple timezones are collapsed.
  22755. * @returns {object} styles - styles object
  22756. */
  22757. DayName.prototype._getStyles = function(theme, timezonesCollapsed) {
  22758. var styles = {};
  22759. var timezonesLength = this.options.timezones.length;
  22760. var collapsed = timezonesCollapsed;
  22761. var numberAndUnit;
  22762. if (theme) {
  22763. styles.borderTop = theme.week.dayname.borderTop || theme.common.border;
  22764. styles.borderBottom = theme.week.dayname.borderBottom || theme.common.border;
  22765. styles.borderLeft = theme.week.dayname.borderLeft || theme.common.border;
  22766. styles.paddingLeft = theme.week.dayname.paddingLeft;
  22767. styles.backgroundColor = theme.week.dayname.backgroundColor;
  22768. styles.height = theme.week.dayname.height;
  22769. styles.textAlign = theme.week.dayname.textAlign;
  22770. styles.marginLeft = theme.week.daygridLeft.width;
  22771. if (!collapsed && timezonesLength > 1) {
  22772. numberAndUnit = common.parseUnit(styles.marginLeft);
  22773. styles.marginLeft = (numberAndUnit[0] * timezonesLength) + numberAndUnit[1];
  22774. }
  22775. }
  22776. return styles;
  22777. };
  22778. DayName.prototype.applyTheme = function() {
  22779. var styles = this._getStyles(this.theme);
  22780. var style = this.container.style;
  22781. style.borderTop = styles.borderTop;
  22782. style.borderBottom = styles.borderBottom;
  22783. style.height = styles.height;
  22784. style.backgroundColor = styles.backgroundColor;
  22785. style.textAlign = styles.textAlign;
  22786. return style;
  22787. };
  22788. module.exports = DayName;
  22789. /***/ }),
  22790. /***/ "./src/js/view/week/time.js":
  22791. /*!**********************************!*\
  22792. !*** ./src/js/view/week/time.js ***!
  22793. \**********************************/
  22794. /*! no static exports found */
  22795. /***/ (function(module, exports, __webpack_require__) {
  22796. "use strict";
  22797. /**
  22798. * @fileoverview View of time.
  22799. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  22800. */
  22801. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  22802. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  22803. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  22804. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  22805. var View = __webpack_require__(/*! ../view */ "./src/js/view/view.js");
  22806. var timeTmpl = __webpack_require__(/*! ../template/week/time.hbs */ "./src/js/view/template/week/time.hbs");
  22807. var tz = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js");
  22808. var forEachArr = util.forEachArray;
  22809. var SCHEDULE_MIN_DURATION = datetime.MILLISECONDS_SCHEDULE_MIN_DURATION;
  22810. /**
  22811. * calculate offset start of schedule
  22812. * @param {ScheduleViewModel} viewModel - view model instance to calculate bound.
  22813. * @param {object} options - options for calculating schedule element's bound.
  22814. * @returns {object} - left and width
  22815. */
  22816. function getOffsetStart(viewModel, options) {
  22817. var goingDuration = datetime.millisecondsFrom('minutes', viewModel.valueOf().goingDuration);
  22818. var startDayOffset = options.todayStart.toDate().getTimezoneOffset();
  22819. var nativeOffsetMs = tz.getNativeOffsetMs();
  22820. var startOffset = viewModel.valueOf().start.toDate().getTimezoneOffset();
  22821. var primaryOffset = tz.getPrimaryOffset();
  22822. var timezoneOffset = tz.getOffsetByTimezoneName(
  22823. tz.getPrimaryTimezoneName(),
  22824. viewModel.valueOf().start.getTime()
  22825. );
  22826. var MIN_TO_MS = 60 * 1000;
  22827. var offsetDiffMs = 0;
  22828. var offsetStart = viewModel.valueOf().start - goingDuration - options.todayStart;
  22829. if (tz.hasPrimaryTimezoneCustomSetting()) {
  22830. if (tz.isNativeOsUsingDSTTimezone() && nativeOffsetMs !== startDayOffset) {
  22831. // When using a custom time zone, the native time zone offset is fixed and rendered.
  22832. // So, The fixed and rendered time should be recalculated as the original time zone offset.
  22833. // The current system OS local time is not affected by summer/standard time and the schedule should always be displayed in the same location.
  22834. offsetDiffMs = (startOffset * MIN_TO_MS) - nativeOffsetMs;
  22835. offsetStart += offsetDiffMs;
  22836. }
  22837. if (tz.isPrimaryUsingDSTTimezone() && primaryOffset !== timezoneOffset) {
  22838. // The custom time zone is a time zone where two offsets including DST are applied.
  22839. // The first rendered schedule is calculated and drawn with the offset calculated at the access time(system OS local time).
  22840. // It should be recalculated with the original time zone offset.
  22841. offsetDiffMs = (primaryOffset - timezoneOffset) * MIN_TO_MS;
  22842. offsetStart += offsetDiffMs;
  22843. }
  22844. }
  22845. return offsetStart;
  22846. }
  22847. /**
  22848. * @constructor
  22849. * @extends {View}
  22850. * @param {object} options Options
  22851. * @param {number} options.index Date index in week view.
  22852. * @param {number} options.width Date element width (percent)
  22853. * @param {string} options.ymd YYYMMDD string for this view
  22854. * @param {boolean} options.isToday when set true then assign today design class to container.
  22855. * @param {number} options.hourStart Can limit of render hour start.
  22856. * @param {number} options.hourEnd Can limit of render hour end.
  22857. * @param {HTMLElement} container Element to use container for this view.
  22858. * @param {Theme} theme - theme instance
  22859. */
  22860. function Time(options, container, theme) {
  22861. View.call(this, container);
  22862. this.options = util.extend(
  22863. {
  22864. index: 0,
  22865. width: 0,
  22866. ymd: '',
  22867. isToday: false,
  22868. pending: false,
  22869. hourStart: 0,
  22870. hourEnd: 24,
  22871. defaultMarginBottom: 2,
  22872. minHeight: 18.5,
  22873. isReadOnly: false
  22874. },
  22875. options
  22876. );
  22877. this.timeTmpl = timeTmpl;
  22878. /**
  22879. * @type {Theme}
  22880. */
  22881. this.theme = theme;
  22882. container.style.width = options.width + '%';
  22883. container.style.left = options.left + '%';
  22884. if (this.options.isToday) {
  22885. domutil.addClass(this.container, config.classname('today'));
  22886. }
  22887. this.applyTheme();
  22888. }
  22889. util.inherit(Time, View);
  22890. /**
  22891. * Convert YYYYMMDD formatted string date to Date.
  22892. * @param {string} str formatted string.
  22893. * @returns {Date} start of date.
  22894. */
  22895. Time.prototype._parseDateGroup = function(str) {
  22896. var y = parseInt(str.substr(0, 4), 10),
  22897. m = parseInt(str.substr(4, 2), 10),
  22898. d = parseInt(str.substr(6, 2), 10);
  22899. var date = datetime.start();
  22900. date.setFullYear(y, m - 1, d);
  22901. return datetime.start(date);
  22902. };
  22903. /**
  22904. * calculate left and width
  22905. * @param {ScheduleViewModel} viewModel - view model instance to calculate bound.
  22906. * @param {object} options - options for calculating schedule element's bound.
  22907. * @returns {object} - left and width
  22908. */
  22909. Time.prototype._getScheduleViewBoundX = function(viewModel, options) {
  22910. var width = options.baseWidth * (viewModel.extraSpace + 1);
  22911. // set width auto when has no collisions.
  22912. if (!viewModel.hasCollide) {
  22913. width = null;
  22914. }
  22915. return {
  22916. left: options.baseLeft[options.columnIndex],
  22917. width: width
  22918. };
  22919. };
  22920. /**
  22921. * calculate top, height, croppedStart and croppedEnd
  22922. * @param {ScheduleViewModel} viewModel - view model instance to calculate bound.
  22923. * @param {object} options - options for calculating schedule element's bound.
  22924. * @returns {object} - left and width
  22925. */
  22926. Time.prototype._getScheduleViewBoundY = function(viewModel, options) {
  22927. var baseMS = options.baseMS;
  22928. var baseHeight = options.baseHeight;
  22929. var croppedStart = false;
  22930. var croppedEnd = false;
  22931. var goingDuration = datetime.millisecondsFrom('minutes', viewModel.valueOf().goingDuration);
  22932. var comingDuration = datetime.millisecondsFrom('minutes', viewModel.valueOf().comingDuration);
  22933. var modelDuration = viewModel.duration();
  22934. var top, height, duration;
  22935. var goingDurationHeight, modelDurationHeight, comingDurationHeight;
  22936. var offsetStart = getOffsetStart(viewModel, options);
  22937. // containerHeight : milliseconds in day = x : schedule's milliseconds
  22938. top = (baseHeight * offsetStart) / baseMS;
  22939. modelDuration = modelDuration > SCHEDULE_MIN_DURATION ? modelDuration : SCHEDULE_MIN_DURATION;
  22940. duration = modelDuration + goingDuration + comingDuration;
  22941. height = (baseHeight * duration) / baseMS;
  22942. goingDurationHeight = (baseHeight * goingDuration) / baseMS; // common.ratio(duration, goingDuration, 100);
  22943. modelDurationHeight = (baseHeight * modelDuration) / baseMS; // common.ratio(duration, modelDuration, 100);
  22944. comingDurationHeight = (baseHeight * comingDuration) / baseMS; // common.ratio(duration, comingDuration, 100);
  22945. if (offsetStart < 0) {
  22946. top = 0;
  22947. height += (baseHeight * offsetStart) / baseMS;
  22948. croppedStart = true;
  22949. }
  22950. if (height + top > baseHeight) {
  22951. height = baseHeight - top;
  22952. croppedEnd = true;
  22953. }
  22954. return {
  22955. top: top,
  22956. height: Math.max(height, this.options.minHeight) - this.options.defaultMarginBottom,
  22957. modelDurationHeight: modelDurationHeight,
  22958. goingDurationHeight: goingDurationHeight,
  22959. comingDurationHeight: comingDurationHeight,
  22960. hasGoingDuration: goingDuration > 0,
  22961. hasComingDuration: comingDuration > 0,
  22962. croppedStart: croppedStart,
  22963. croppedEnd: croppedEnd
  22964. };
  22965. };
  22966. /**
  22967. * @param {ScheduleViewModel} viewModel - view model instance to calculate bound.
  22968. * @param {object} options - options for calculating schedule element's bound.
  22969. * @param {Date} options.todayStart - date object represent schedule date's start (00:00:00)
  22970. * @param {number} options.baseMS - the number of milliseconds to render schedule blocks.
  22971. * @param {number} options.baseHeight - pixel value related with baseMS options.
  22972. * @param {number[]} options.baseLeft - left position percents for each columns.
  22973. * @param {number} options.baseWidth - the unit of schedule blocks width percent.
  22974. * @param {number} options.columnIndex - the number index of schedule blocks.
  22975. * it represent rendering index from left sides in view.
  22976. * @returns {object} bound object for supplied view model.
  22977. */
  22978. Time.prototype.getScheduleViewBound = function(viewModel, options) {
  22979. var boundX = this._getScheduleViewBoundX(viewModel, options);
  22980. var boundY = this._getScheduleViewBoundY(viewModel, options);
  22981. var schedule = viewModel.model;
  22982. var isReadOnly = util.pick(schedule, 'isReadOnly') || false;
  22983. var travelBorderColor = schedule.isFocused ? '#ffffff' : schedule.borderColor;
  22984. if (travelBorderColor === schedule.bgColor) {
  22985. travelBorderColor = null; // follow text color
  22986. }
  22987. return util.extend(
  22988. {
  22989. isReadOnly: isReadOnly,
  22990. travelBorderColor: travelBorderColor
  22991. },
  22992. boundX,
  22993. boundY
  22994. );
  22995. };
  22996. /**
  22997. * Set viewmodels for rendering.
  22998. * @param {string} ymd The date of schedules. YYYYMMDD format.
  22999. * @param {array} matrices The matrices for schedule placing.
  23000. * @param {number} containerHeight - container's height
  23001. */
  23002. Time.prototype._getBaseViewModel = function(ymd, matrices, containerHeight) {
  23003. var self = this,
  23004. options = this.options,
  23005. hourStart = options.hourStart,
  23006. hourEnd = options.hourEnd,
  23007. isReadOnly = options.isReadOnly,
  23008. todayStart,
  23009. baseMS;
  23010. /**
  23011. * Calculate each schedule element bounds relative with rendered hour milliseconds and
  23012. * wrap each schedule model to viewmodels.
  23013. */
  23014. containerHeight = containerHeight || this.getViewBound().height;
  23015. todayStart = this._parseDateGroup(ymd);
  23016. todayStart.setHours(hourStart);
  23017. baseMS = datetime.millisecondsFrom('hour', hourEnd - hourStart);
  23018. forEachArr(matrices, function(matrix) {
  23019. var maxRowLength, widthPercent, leftPercents, i;
  23020. maxRowLength = Math.max.apply(
  23021. null,
  23022. util.map(matrix, function(row) {
  23023. return row.length;
  23024. })
  23025. );
  23026. widthPercent = 100 / maxRowLength;
  23027. leftPercents = [];
  23028. for (i = 0; i < maxRowLength; i += 1) {
  23029. leftPercents[i] = widthPercent * i;
  23030. }
  23031. forEachArr(matrix, function(row) {
  23032. forEachArr(row, function(viewModel, col) {
  23033. var viewBound;
  23034. if (!viewModel) {
  23035. return;
  23036. }
  23037. viewBound = self.getScheduleViewBound(viewModel, {
  23038. todayStart: todayStart,
  23039. baseMS: baseMS,
  23040. baseLeft: leftPercents,
  23041. baseWidth: widthPercent,
  23042. baseHeight: containerHeight,
  23043. columnIndex: col,
  23044. isReadOnly: isReadOnly
  23045. });
  23046. util.extend(viewModel, viewBound);
  23047. });
  23048. });
  23049. });
  23050. };
  23051. /**
  23052. * @returns {Date} - Date of this view.
  23053. */
  23054. Time.prototype.getDate = function() {
  23055. return this._parseDateGroup(this.options.ymd);
  23056. };
  23057. /**
  23058. * @override
  23059. * @param {string} ymd The date of schedules. YYYYMMDD format
  23060. * @param {array} matrices Matrices for placing schedules
  23061. * @param {number} containerHeight - container's height
  23062. */
  23063. Time.prototype.render = function(ymd, matrices, containerHeight) {
  23064. this._getBaseViewModel(ymd, matrices, containerHeight);
  23065. this.container.innerHTML = this.timeTmpl({
  23066. matrices: matrices,
  23067. styles: this._getStyles(this.theme),
  23068. isReadOnly: this.options.isReadOnly
  23069. });
  23070. };
  23071. /**
  23072. * Get the styles from theme
  23073. * @param {Theme} theme - theme instance
  23074. * @returns {object} styles - styles object
  23075. */
  23076. Time.prototype._getStyles = function(theme) {
  23077. var styles = {};
  23078. var options = this.options;
  23079. if (theme) {
  23080. styles.borderRight = theme.week.timegrid.borderRight || theme.common.border;
  23081. styles.marginRight = theme.week.timegrid.paddingRight;
  23082. styles.borderRadius = theme.week.timegridSchedule.borderRadius;
  23083. styles.paddingLeft = theme.week.timegridSchedule.paddingLeft;
  23084. styles.backgroundColor = options.isToday ? theme.week.today.backgroundColor : 'inherit';
  23085. }
  23086. return styles;
  23087. };
  23088. Time.prototype.applyTheme = function() {
  23089. var style = this.container.style;
  23090. var styles = this._getStyles(this.theme);
  23091. style.borderRight = styles.borderRight;
  23092. style.backgroundColor = styles.backgroundColor;
  23093. };
  23094. module.exports = Time;
  23095. /***/ }),
  23096. /***/ "./src/js/view/week/timeGrid.js":
  23097. /*!**************************************!*\
  23098. !*** ./src/js/view/week/timeGrid.js ***!
  23099. \**************************************/
  23100. /*! no static exports found */
  23101. /***/ (function(module, exports, __webpack_require__) {
  23102. "use strict";
  23103. /**
  23104. * @fileoverview View for rendered schedules by times.
  23105. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  23106. */
  23107. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  23108. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  23109. var common = __webpack_require__(/*! ../../common/common */ "./src/js/common/common.js");
  23110. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  23111. var domevent = __webpack_require__(/*! ../../common/domevent */ "./src/js/common/domevent.js");
  23112. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  23113. var tz = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js");
  23114. var reqAnimFrame = __webpack_require__(/*! ../../common/reqAnimFrame */ "./src/js/common/reqAnimFrame.js");
  23115. var View = __webpack_require__(/*! ../view */ "./src/js/view/view.js");
  23116. var Time = __webpack_require__(/*! ./time */ "./src/js/view/week/time.js");
  23117. var AutoScroll = __webpack_require__(/*! ../../common/autoScroll */ "./src/js/common/autoScroll.js");
  23118. var mainTmpl = __webpack_require__(/*! ../template/week/timeGrid.hbs */ "./src/js/view/template/week/timeGrid.hbs");
  23119. var timezoneStickyTmpl = __webpack_require__(/*! ../template/week/timezoneSticky.hbs */ "./src/js/view/template/week/timezoneSticky.hbs");
  23120. var timegridCurrentTimeTmpl = __webpack_require__(/*! ../template/week/timeGridCurrentTime.hbs */ "./src/js/view/template/week/timeGridCurrentTime.hbs");
  23121. var TZDate = tz.Date;
  23122. var HOURMARKER_REFRESH_INTERVAL = 1000 * 60;
  23123. var SIXTY_SECONDS = 60;
  23124. var SIXTY_MINUTES = 60;
  23125. /**
  23126. * Returns a list of time labels from start to end.
  23127. * For hidden labels near the current time, set to hidden: true.
  23128. * @param {object} opt - TimeGrid.options
  23129. * @param {boolean} hasHourMarker - Whether the current time is displayed
  23130. * @param {number} timezoneOffset - timezone offset
  23131. * @param {object} styles - styles
  23132. * @returns {Array.<Object>}
  23133. */
  23134. function getHoursLabels(opt, hasHourMarker, timezoneOffset, styles) {
  23135. var hourStart = opt.hourStart;
  23136. var hourEnd = opt.hourEnd;
  23137. var renderEndDate = new TZDate(opt.renderEndDate);
  23138. var shiftByOffset = parseInt(timezoneOffset / SIXTY_MINUTES, 10);
  23139. var shiftMinutes = Math.abs(timezoneOffset % SIXTY_MINUTES);
  23140. var now = new TZDate().toLocalTime();
  23141. var nowMinutes = now.getMinutes();
  23142. var hoursRange = util.range(0, 24);
  23143. var nowAroundHours = null;
  23144. var nowHours, nowHoursIndex;
  23145. var isNegativeZero = 1 / -Infinity === shiftByOffset;
  23146. if ((shiftByOffset < 0 || isNegativeZero) && shiftMinutes > 0) {
  23147. shiftByOffset -= 1;
  23148. }
  23149. // shift the array and take elements between start and end
  23150. common.shiftArray(hoursRange, shiftByOffset);
  23151. common.takeArray(hoursRange, hourStart, hourEnd);
  23152. nowHours = common.shiftHours(now.getHours(), shiftByOffset) % 24;
  23153. nowHoursIndex = util.inArray(nowHours, hoursRange);
  23154. if (hasHourMarker) {
  23155. if (nowMinutes < 20) {
  23156. nowAroundHours = nowHours;
  23157. } else if (nowMinutes > 40) {
  23158. nowAroundHours = nowHours + 1;
  23159. }
  23160. if (util.isNumber(nowAroundHours)) {
  23161. nowAroundHours %= 24;
  23162. }
  23163. }
  23164. return util.map(hoursRange, function(hour, index) {
  23165. var color;
  23166. var fontWeight;
  23167. var isPast =
  23168. (hasHourMarker && index <= nowHoursIndex) ||
  23169. (renderEndDate < now && !datetime.isSameDate(renderEndDate, now));
  23170. if (isPast) {
  23171. // past
  23172. color = styles.pastTimeColor;
  23173. fontWeight = styles.pastTimeFontWeight;
  23174. } else {
  23175. // future
  23176. color = styles.futureTimeColor;
  23177. fontWeight = styles.futureTimeFontWeight;
  23178. }
  23179. return {
  23180. hour: hour,
  23181. minutes: shiftMinutes,
  23182. hidden: nowAroundHours === hour || index === 0,
  23183. color: color || '',
  23184. fontWeight: fontWeight || ''
  23185. };
  23186. });
  23187. }
  23188. /**
  23189. * Returns timezone offset from timezone object
  23190. * @param {object} timezoneObj - timezone object in options.timzones
  23191. * @param {number} timestamp - timestamp
  23192. * @returns {number} timezoneOffset - timezone offset
  23193. */
  23194. function getOffsetByTimezoneOption(timezoneObj, timestamp) {
  23195. var primaryOffset = tz.getPrimaryOffset();
  23196. if (util.isString(timezoneObj.timezoneName)) {
  23197. return -tz.getOffsetByTimezoneName(timezoneObj.timezoneName, timestamp);
  23198. }
  23199. // @deprecated timezoneOffset property will be deprecated
  23200. if (util.isNumber(timezoneObj.timezoneOffset) && timezoneObj.timezoneOffset !== primaryOffset) {
  23201. return timezoneObj.timezoneOffset;
  23202. }
  23203. return -primaryOffset;
  23204. }
  23205. /**
  23206. * @constructor
  23207. * @extends {View}
  23208. * @param {string} name - view name
  23209. * @param {object} options The object for view customization.
  23210. * @param {string} options.renderStartDate - render start date. YYYY-MM-DD
  23211. * @param {string} options.renderEndDate - render end date. YYYY-MM-DD
  23212. * @param {number} [options.hourStart=0] You can change view's start hours.
  23213. * @param {number} [options.hourEnd=0] You can change view's end hours.
  23214. * @param {HTMLElement} panelElement panel element.
  23215. */
  23216. function TimeGrid(name, options, panelElement) {
  23217. var container = domutil.appendHTMLElement(
  23218. 'div',
  23219. panelElement,
  23220. config.classname('timegrid-container')
  23221. );
  23222. var stickyContainer = domutil.appendHTMLElement(
  23223. 'div',
  23224. panelElement,
  23225. config.classname('timegrid-sticky-container')
  23226. );
  23227. panelElement.style.position = 'relative'; // for stickyContainer
  23228. name = name || 'time';
  23229. View.call(this, container);
  23230. if (!util.browser.safari) {
  23231. /**
  23232. * @type {AutoScroll}
  23233. */
  23234. this._autoScroll = new AutoScroll(container);
  23235. }
  23236. this.stickyContainer = stickyContainer;
  23237. /**
  23238. * Time view options.
  23239. * @type {object}
  23240. */
  23241. this.options = util.extend(
  23242. {
  23243. viewName: name,
  23244. renderStartDate: '',
  23245. renderEndDate: '',
  23246. hourStart: 0,
  23247. hourEnd: 24,
  23248. timezones: options.timezones,
  23249. isReadOnly: options.isReadOnly,
  23250. showTimezoneCollapseButton: false
  23251. },
  23252. options.week
  23253. );
  23254. if (this.options.timezones.length < 1) {
  23255. this.options.timezones = [
  23256. {
  23257. timezoneOffset: tz.getPrimaryOffset()
  23258. }
  23259. ];
  23260. }
  23261. /**
  23262. * Interval id for hourmarker animation.
  23263. * @type {number}
  23264. */
  23265. this.intervalID = 0;
  23266. /**
  23267. * timer id for hourmarker initial state
  23268. * @type {number}
  23269. */
  23270. this.timerID = 0;
  23271. /**
  23272. * requestAnimationFrame unique ID
  23273. * @type {number}
  23274. */
  23275. this.rAnimationFrameID = 0;
  23276. /**
  23277. * @type {boolean}
  23278. */
  23279. this._scrolled = false;
  23280. /**
  23281. * cache parent's view model
  23282. * @type {object}
  23283. */
  23284. this._cacheParentViewModel = null;
  23285. /**
  23286. * cache hoursLabels view model to render again TimeGrid
  23287. * @type {object}
  23288. */
  23289. this._cacheHoursLabels = null;
  23290. this.attachEvent();
  23291. }
  23292. util.inherit(TimeGrid, View);
  23293. /**********
  23294. * Prototype props
  23295. **********/
  23296. /**
  23297. * @type {string}
  23298. */
  23299. TimeGrid.prototype.viewName = 'timegrid';
  23300. /**
  23301. * Destroy view.
  23302. * @override
  23303. */
  23304. TimeGrid.prototype._beforeDestroy = function() {
  23305. clearInterval(this.intervalID);
  23306. clearTimeout(this.timerID);
  23307. reqAnimFrame.cancelAnimFrame(this.rAnimationFrameID);
  23308. if (this._autoScroll) {
  23309. this._autoScroll.destroy();
  23310. }
  23311. domevent.off(this.stickyContainer, 'click', this._onClickStickyContainer, this);
  23312. this._autoScroll = this.hourmarkers = this.intervalID
  23313. = this.timerID = this.rAnimationFrameID = this._cacheParentViewModel = this.stickyContainer = null;
  23314. };
  23315. /**
  23316. * @param {Date} [time] - date object to convert pixel in grids.
  23317. * use **Date.now()** when not supplied.
  23318. * @returns {number} The pixel value represent current time in grids.
  23319. */
  23320. TimeGrid.prototype._getTopPercentByTime = function(time) {
  23321. var opt = this.options,
  23322. raw = datetime.raw(time || new TZDate()),
  23323. hourLength = util.range(opt.hourStart, opt.hourEnd).length,
  23324. maxMilliseconds = hourLength * datetime.MILLISECONDS_PER_HOUR,
  23325. hmsMilliseconds =
  23326. datetime.millisecondsFrom('hour', raw.h) +
  23327. datetime.millisecondsFrom('minutes', raw.m) +
  23328. datetime.millisecondsFrom('seconds', raw.s) +
  23329. raw.ms,
  23330. topPercent;
  23331. topPercent = common.ratio(maxMilliseconds, 100, hmsMilliseconds);
  23332. topPercent -= common.ratio(
  23333. maxMilliseconds,
  23334. 100,
  23335. datetime.millisecondsFrom('hour', opt.hourStart)
  23336. );
  23337. return common.limit(topPercent, [0], [100]);
  23338. };
  23339. /**
  23340. * Get Hourmarker viewmodel.
  23341. * @param {TZDate} now - now
  23342. * @param {object} grids grid information(width, left, day)
  23343. * @param {Array.<TZDate>} range render range
  23344. * @returns {object} ViewModel of hourmarker.
  23345. */
  23346. TimeGrid.prototype._getHourmarkerViewModel = function(now, grids, range) {
  23347. var todaymarkerLeft = -1;
  23348. var todaymarkerWidth = -1;
  23349. var hourmarkerTimzones = [];
  23350. var opt = this.options;
  23351. var primaryOffset = tz.getPrimaryOffset();
  23352. var timezones = opt.timezones;
  23353. var viewModel;
  23354. util.forEach(range, function(date, index) {
  23355. if (datetime.isSameDate(now, date)) {
  23356. todaymarkerLeft = grids[index] ? grids[index].left : 0;
  23357. todaymarkerWidth = grids[index] ? grids[index].width : 0;
  23358. }
  23359. });
  23360. util.forEach(timezones, function(timezone) {
  23361. var hourmarker = new TZDate(now);
  23362. var timezoneOffset = getOffsetByTimezoneOption(timezone, hourmarker.getTime());
  23363. var timezoneDifference = timezoneOffset + primaryOffset;
  23364. var dateDifference;
  23365. hourmarker.setMinutes(hourmarker.getMinutes() + timezoneDifference);
  23366. dateDifference = datetime.getDateDifference(hourmarker, now);
  23367. hourmarkerTimzones.push({
  23368. hourmarker: hourmarker,
  23369. dateDifferenceSign: dateDifference < 0 ? '-' : '+',
  23370. dateDifference: Math.abs(dateDifference)
  23371. });
  23372. });
  23373. viewModel = {
  23374. currentHours: now.getHours(),
  23375. hourmarkerTop: this._getTopPercentByTime(now),
  23376. hourmarkerTimzones: hourmarkerTimzones,
  23377. todaymarkerLeft: todaymarkerLeft,
  23378. todaymarkerWidth: todaymarkerWidth,
  23379. todaymarkerRight: todaymarkerLeft + todaymarkerWidth
  23380. };
  23381. return viewModel;
  23382. };
  23383. /**
  23384. * Get timezone view model
  23385. * @param {number} currentHours - current hour
  23386. * @param {boolean} timezonesCollapsed - multiple timezones are collapsed.
  23387. * @param {object} styles - styles
  23388. * @returns {object} ViewModel
  23389. */
  23390. TimeGrid.prototype._getTimezoneViewModel = function(currentHours, timezonesCollapsed, styles) {
  23391. var opt = this.options;
  23392. var primaryOffset = tz.getPrimaryOffset();
  23393. var timezones = opt.timezones;
  23394. var timezonesLength = timezones.length;
  23395. var timezoneViewModel = [];
  23396. var collapsed = timezonesCollapsed;
  23397. var width = collapsed ? 100 : 100 / timezonesLength;
  23398. var now = new TZDate().toLocalTime();
  23399. var backgroundColor = styles.displayTimezoneLabelBackgroundColor;
  23400. // eslint-disable-next-line complexity
  23401. util.forEach(timezones, function(timezone, index) {
  23402. var hourmarker = new TZDate(now);
  23403. var timezoneOffset = getOffsetByTimezoneOption(timezone, hourmarker.getTime());
  23404. var timezoneDifference = timezoneOffset + primaryOffset;
  23405. var timeSlots = getHoursLabels(opt, currentHours >= 0, timezoneDifference, styles);
  23406. var dateDifference;
  23407. hourmarker.setMinutes(hourmarker.getMinutes() + timezoneDifference);
  23408. dateDifference = datetime.getDateDifference(hourmarker, now);
  23409. if (index > 0) {
  23410. backgroundColor = styles.additionalTimezoneBackgroundColor;
  23411. }
  23412. timezoneViewModel.push({
  23413. timeSlots: timeSlots,
  23414. displayLabel: timezone.displayLabel,
  23415. timezoneOffset: timezone.timezoneOffset,
  23416. tooltip: timezone.tooltip || '',
  23417. width: width,
  23418. left: collapsed ? 0 : (timezones.length - index - 1) * width,
  23419. isPrimary: index === 0,
  23420. backgroundColor: backgroundColor || '',
  23421. hidden: index !== 0 && collapsed,
  23422. hourmarker: hourmarker,
  23423. dateDifferenceSign: dateDifference < 0 ? '-' : '+',
  23424. dateDifference: Math.abs(dateDifference)
  23425. });
  23426. });
  23427. return timezoneViewModel;
  23428. };
  23429. /**
  23430. * Get base viewModel.
  23431. * @param {object} viewModel - view model
  23432. * @returns {object} ViewModel
  23433. */
  23434. TimeGrid.prototype._getBaseViewModel = function(viewModel) {
  23435. var grids = viewModel.grids;
  23436. var range = viewModel.range;
  23437. var opt = this.options;
  23438. var baseViewModel = this._getHourmarkerViewModel(new TZDate().toLocalTime(), grids, range);
  23439. var timezonesCollapsed = util.pick(viewModel, 'state', 'timezonesCollapsed');
  23440. var styles = this._getStyles(viewModel.theme, timezonesCollapsed);
  23441. return util.extend(baseViewModel, {
  23442. timezones: this._getTimezoneViewModel(
  23443. baseViewModel.todaymarkerLeft,
  23444. timezonesCollapsed,
  23445. styles
  23446. ),
  23447. hoursLabels: getHoursLabels(opt, baseViewModel.todaymarkerLeft >= 0, 0, styles),
  23448. styles: styles,
  23449. showTimezoneCollapseButton: util.pick(opt, 'showTimezoneCollapseButton'),
  23450. timezonesCollapsed: timezonesCollapsed
  23451. });
  23452. };
  23453. /**
  23454. * Reconcilation child views and render.
  23455. * @param {object} viewModels Viewmodel
  23456. * @param {object} grids grid information(width, left, day)
  23457. * @param {HTMLElement} container Container element for each time view.
  23458. * @param {Theme} theme - theme instance
  23459. */
  23460. TimeGrid.prototype._renderChildren = function(viewModels, grids, container, theme) {
  23461. var self = this,
  23462. options = this.options,
  23463. childOption,
  23464. child,
  23465. isToday,
  23466. containerHeight,
  23467. today = datetime.format(new TZDate().toLocalTime(), 'YYYYMMDD'),
  23468. i = 0;
  23469. // clear contents
  23470. container.innerHTML = '';
  23471. this.children.clear();
  23472. containerHeight = domutil.getSize(container.parentElement)[1];
  23473. // reconcilation of child views
  23474. util.forEach(viewModels, function(schedules, ymd) {
  23475. isToday = ymd === today;
  23476. childOption = {
  23477. index: i,
  23478. left: grids[i] ? grids[i].left : 0,
  23479. width: grids[i] ? grids[i].width : 0,
  23480. ymd: ymd,
  23481. isToday: isToday,
  23482. isPending: options.isPending,
  23483. isFocused: options.isFocused,
  23484. isReadOnly: options.isReadOnly,
  23485. hourStart: options.hourStart,
  23486. hourEnd: options.hourEnd
  23487. };
  23488. child = new Time(
  23489. childOption,
  23490. domutil.appendHTMLElement('div', container, config.classname('time-date')),
  23491. theme
  23492. );
  23493. child.render(ymd, schedules, containerHeight);
  23494. self.addChild(child);
  23495. i += 1;
  23496. });
  23497. };
  23498. /**
  23499. * @override
  23500. * @param {object} viewModel ViewModel list from Week view.
  23501. */
  23502. TimeGrid.prototype.render = function(viewModel) {
  23503. var opt = this.options,
  23504. timeViewModel = viewModel.schedulesInDateRange[opt.viewName],
  23505. container = this.container,
  23506. grids = viewModel.grids,
  23507. baseViewModel = this._getBaseViewModel(viewModel),
  23508. scheduleLen = util.keys(timeViewModel).length;
  23509. this._cacheParentViewModel = viewModel;
  23510. this._cacheHoursLabels = baseViewModel.hoursLabels;
  23511. if (!scheduleLen) {
  23512. return;
  23513. }
  23514. baseViewModel.showHourMarker = baseViewModel.todaymarkerLeft >= 0;
  23515. container.innerHTML = mainTmpl(baseViewModel);
  23516. /**********
  23517. * Render sticky container for timezone display label
  23518. **********/
  23519. this.renderStickyContainer(baseViewModel);
  23520. /**********
  23521. * Render children
  23522. **********/
  23523. this._renderChildren(
  23524. timeViewModel,
  23525. grids,
  23526. domutil.find(config.classname('.timegrid-schedules-container'), container),
  23527. viewModel.theme
  23528. );
  23529. this._hourLabels = domutil.find('ul', container);
  23530. /**********
  23531. * Render hourmarker
  23532. **********/
  23533. this.hourmarkers = domutil.find(config.classname('.timegrid-hourmarker'), container, true);
  23534. if (!this._scrolled) {
  23535. this._scrolled = true;
  23536. this.scrollToNow();
  23537. }
  23538. };
  23539. TimeGrid.prototype.renderStickyContainer = function(baseViewModel) {
  23540. var stickyContainer = this.stickyContainer;
  23541. stickyContainer.innerHTML = timezoneStickyTmpl(baseViewModel);
  23542. stickyContainer.style.display = baseViewModel.timezones.length > 1 ? 'block' : 'none';
  23543. stickyContainer.style.width = baseViewModel.styles.leftWidth;
  23544. stickyContainer.style.height = baseViewModel.styles.displayTimezoneLabelHeight;
  23545. stickyContainer.style.borderBottom = baseViewModel.styles.leftBorderRight;
  23546. };
  23547. /**
  23548. * Refresh hourmarker element.
  23549. */
  23550. TimeGrid.prototype.refreshHourmarker = function() {
  23551. var hourmarkers = this.hourmarkers;
  23552. var viewModel = this._cacheParentViewModel;
  23553. var hoursLabels = this._cacheHoursLabels;
  23554. var rAnimationFrameID = this.rAnimationFrameID;
  23555. var baseViewModel;
  23556. if (!hourmarkers || !viewModel || rAnimationFrameID) {
  23557. return;
  23558. }
  23559. baseViewModel = this._getBaseViewModel(viewModel);
  23560. this.rAnimationFrameID = reqAnimFrame.requestAnimFrame(function() {
  23561. var needsRender = false;
  23562. util.forEach(hoursLabels, function(hoursLabel, index) {
  23563. if (hoursLabel.hidden !== baseViewModel.hoursLabels[index].hidden) {
  23564. needsRender = true;
  23565. return false;
  23566. }
  23567. return true;
  23568. });
  23569. if (needsRender) {
  23570. this.render(viewModel);
  23571. } else {
  23572. util.forEach(hourmarkers, function(hourmarker) {
  23573. var todaymarker = domutil.find(
  23574. config.classname('.timegrid-todaymarker'),
  23575. hourmarker
  23576. );
  23577. var hourmarkerContainer = domutil.find(
  23578. config.classname('.timegrid-hourmarker-time'),
  23579. hourmarker
  23580. );
  23581. var timezone = domutil.closest(hourmarker, config.classname('.timegrid-timezone'));
  23582. var timezoneIndex = timezone ? domutil.getData(timezone, 'timezoneIndex') : 0;
  23583. hourmarker.style.top = baseViewModel.hourmarkerTop + '%';
  23584. if (todaymarker) {
  23585. todaymarker.style.display =
  23586. baseViewModel.todaymarkerLeft >= 0 ? 'block' : 'none';
  23587. }
  23588. if (hourmarkerContainer) {
  23589. hourmarkerContainer.innerHTML = timegridCurrentTimeTmpl(
  23590. baseViewModel.hourmarkerTimzones[timezoneIndex]
  23591. );
  23592. }
  23593. });
  23594. }
  23595. this.rAnimationFrameID = null;
  23596. }, this);
  23597. };
  23598. /**
  23599. * Attach events
  23600. */
  23601. TimeGrid.prototype.attachEvent = function() {
  23602. clearInterval(this.intervalID);
  23603. clearTimeout(this.timerID);
  23604. this.intervalID = this.timerID = this.rAnimationFrameID = null;
  23605. this.timerID = setTimeout(
  23606. this.onTick.bind(this),
  23607. (SIXTY_SECONDS - new TZDate().getSeconds()) * 1000
  23608. );
  23609. domevent.on(this.stickyContainer, 'click', this._onClickStickyContainer, this);
  23610. };
  23611. /**
  23612. * Scroll time grid to current hourmarker.
  23613. */
  23614. TimeGrid.prototype.scrollToNow = function() {
  23615. var container = this.container;
  23616. var offsetTop, viewBound, scrollTop, scrollAmount, scrollBy, scrollFn;
  23617. if (!this.hourmarkers || !this.hourmarkers.length) {
  23618. return;
  23619. }
  23620. offsetTop = this.hourmarkers[0].offsetTop;
  23621. viewBound = this.getViewBound();
  23622. scrollTop = offsetTop;
  23623. scrollAmount = viewBound.height / 4;
  23624. scrollBy = 10;
  23625. scrollFn = function() {
  23626. if (scrollTop > offsetTop - scrollAmount) {
  23627. scrollTop -= scrollBy;
  23628. container.scrollTop = scrollTop;
  23629. reqAnimFrame.requestAnimFrame(scrollFn);
  23630. } else {
  23631. container.scrollTop = offsetTop - scrollAmount;
  23632. }
  23633. };
  23634. reqAnimFrame.requestAnimFrame(scrollFn);
  23635. };
  23636. /**********
  23637. * Schedule handlers
  23638. **********/
  23639. /**
  23640. * Interval tick handler
  23641. */
  23642. TimeGrid.prototype.onTick = function() {
  23643. if (this.timerID) {
  23644. clearTimeout(this.timerID);
  23645. this.timerID = null;
  23646. }
  23647. if (!this.intervalID) {
  23648. this.intervalID = setInterval(this.onTick.bind(this), HOURMARKER_REFRESH_INTERVAL);
  23649. }
  23650. this.refreshHourmarker();
  23651. };
  23652. /**
  23653. * Get the styles from theme
  23654. * @param {Theme} theme - theme instance
  23655. * @param {boolean} timezonesCollapsed - multiple timezones are collapsed.
  23656. * @returns {object} styles - styles object
  23657. */
  23658. // eslint-disable-next-line complexity
  23659. TimeGrid.prototype._getStyles = function(theme, timezonesCollapsed) {
  23660. var styles = {};
  23661. var timezonesLength = this.options.timezones.length;
  23662. var collapsed = timezonesCollapsed;
  23663. var numberAndUnit;
  23664. if (theme) {
  23665. styles.borderBottom = theme.week.timegridHorizontalLine.borderBottom || theme.common.border;
  23666. styles.halfHourBorderBottom =
  23667. theme.week.timegridHalfHour.borderBottom || theme.common.border;
  23668. styles.todayBackgroundColor = theme.week.today.backgroundColor;
  23669. styles.weekendBackgroundColor = theme.week.weekend.backgroundColor;
  23670. styles.backgroundColor = theme.week.daygrid.backgroundColor;
  23671. styles.leftWidth = theme.week.timegridLeft.width;
  23672. styles.leftBackgroundColor = theme.week.timegridLeft.backgroundColor;
  23673. styles.leftBorderRight = theme.week.timegridLeft.borderRight || theme.common.border;
  23674. styles.leftFontSize = theme.week.timegridLeft.fontSize;
  23675. styles.timezoneWidth = theme.week.timegridLeft.width;
  23676. styles.additionalTimezoneBackgroundColor =
  23677. theme.week.timegridLeftAdditionalTimezone.backgroundColor || styles.leftBackgroundColor;
  23678. styles.displayTimezoneLabelHeight = theme.week.timegridLeftTimezoneLabel.height;
  23679. styles.displayTimezoneLabelBackgroundColor =
  23680. theme.week.timegridLeft.backgroundColor === 'inherit'
  23681. ? 'white'
  23682. : theme.week.timegridLeft.backgroundColor;
  23683. styles.oneHourHeight = theme.week.timegridOneHour.height;
  23684. styles.halfHourHeight = theme.week.timegridHalfHour.height;
  23685. styles.quaterHourHeight = (parseInt(styles.halfHourHeight, 10) / 2) + 'px';
  23686. styles.currentTimeColor = theme.week.currentTime.color;
  23687. styles.currentTimeFontSize = theme.week.currentTime.fontSize;
  23688. styles.currentTimeFontWeight = theme.week.currentTime.fontWeight;
  23689. styles.pastTimeColor = theme.week.pastTime.color;
  23690. styles.pastTimeFontWeight = theme.week.pastTime.fontWeight;
  23691. styles.futureTimeColor = theme.week.futureTime.color;
  23692. styles.futureTimeFontWeight = theme.week.futureTime.fontWeight;
  23693. styles.currentTimeLeftBorderTop = theme.week.currentTimeLinePast.border;
  23694. styles.currentTimeBulletBackgroundColor = theme.week.currentTimeLineBullet.backgroundColor;
  23695. styles.currentTimeTodayBorderTop = theme.week.currentTimeLineToday.border;
  23696. styles.currentTimeRightBorderTop = theme.week.currentTimeLineFuture.border;
  23697. if (!collapsed && timezonesLength > 1) {
  23698. numberAndUnit = common.parseUnit(styles.leftWidth);
  23699. styles.leftWidth = (numberAndUnit[0] * timezonesLength) + numberAndUnit[1];
  23700. }
  23701. }
  23702. return styles;
  23703. };
  23704. /**
  23705. * @param {MouseEvent} event - mouse event object
  23706. */
  23707. TimeGrid.prototype._onClickStickyContainer = function(event) {
  23708. var target = domevent.getEventTarget(event);
  23709. var closeBtn = domutil.closest(target, config.classname('.timegrid-timezone-close-btn'));
  23710. if (!closeBtn) {
  23711. return;
  23712. }
  23713. this.fire('clickTimezonesCollapsedBtn');
  23714. };
  23715. module.exports = TimeGrid;
  23716. /***/ }),
  23717. /***/ "./src/js/view/week/week.js":
  23718. /*!**********************************!*\
  23719. !*** ./src/js/view/week/week.js ***!
  23720. \**********************************/
  23721. /*! no static exports found */
  23722. /***/ (function(module, exports, __webpack_require__) {
  23723. "use strict";
  23724. /**
  23725. * @fileoverview View of days UI.
  23726. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  23727. */
  23728. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  23729. var config = __webpack_require__(/*! ../../config */ "./src/js/config.js");
  23730. var domutil = __webpack_require__(/*! ../../common/domutil */ "./src/js/common/domutil.js");
  23731. var datetime = __webpack_require__(/*! ../../common/datetime */ "./src/js/common/datetime.js");
  23732. var TZDate = __webpack_require__(/*! ../../common/timezone */ "./src/js/common/timezone.js").Date;
  23733. var View = __webpack_require__(/*! ../view */ "./src/js/view/view.js");
  23734. /**
  23735. * @constructor
  23736. * @param {Base.Week} controller The controller mixin part.
  23737. * @param {object} options View options
  23738. * @param {string} [options.renderStartDate] Start date of render.
  23739. * if not supplied then use -3d from today. YYYY-MM-DD format.
  23740. * @param {string} [options.renderEndDate] End date of render.
  23741. * if not supplied then use +3d from today. YYYY-MM-DD format.
  23742. * @param {string} [options.cssPrefix] - CSS classname prefix
  23743. * @param {HTMLElement} container The element to use container for this view.
  23744. * @param {object} panels - schedule panels like 'milestone', 'task', 'allday', 'time'
  23745. * @param {string} viewName - 'week', 'day'
  23746. * @extends {View}
  23747. */
  23748. function Week(controller, options, container, panels, viewName) {
  23749. var range;
  23750. container = domutil.appendHTMLElement('div', container);
  23751. View.call(this, container);
  23752. domutil.addClass(container, config.classname('week-container'));
  23753. range = this._getRenderDateRange(new TZDate());
  23754. /**
  23755. * @type {object} Options for view.
  23756. */
  23757. this.options = util.extend({
  23758. scheduleFilter: [function(schedule) {
  23759. return Boolean(schedule.isVisible);
  23760. }],
  23761. renderStartDate: datetime.format(range.start, 'YYYY-MM-DD'),
  23762. renderEndDate: datetime.format(range.end, 'YYYY-MM-DD'),
  23763. narrowWeekend: false,
  23764. startDayOfWeek: 0,
  23765. workweek: false,
  23766. showTimezoneCollapseButton: false,
  23767. timezonesCollapsed: false,
  23768. hourStart: 0,
  23769. hourEnd: 24
  23770. }, options);
  23771. /**
  23772. * Week controller mixin.
  23773. * @type {Base.Week}
  23774. */
  23775. this.controller = controller;
  23776. /**
  23777. * Schedule Panels
  23778. * @type {Array.<object>}
  23779. */
  23780. this.panels = panels;
  23781. /**
  23782. * Week view states
  23783. * @type {object}
  23784. */
  23785. this.state = {
  23786. timezonesCollapsed: this.options.timezonesCollapsed
  23787. };
  23788. if (viewName === 'day') {
  23789. _disableDayOptions(this.options);
  23790. }
  23791. }
  23792. util.inherit(Week, View);
  23793. /**********
  23794. * Override props
  23795. **********/
  23796. /**
  23797. * Render each child view with schedules in ranges.
  23798. * @fires Week#afterRender
  23799. * @override
  23800. */
  23801. Week.prototype.render = function() {
  23802. var self = this,
  23803. options = this.options,
  23804. scheduleFilter = options.scheduleFilter,
  23805. narrowWeekend = options.narrowWeekend,
  23806. startDayOfWeek = options.startDayOfWeek,
  23807. workweek = options.workweek,
  23808. theme = this.controller.theme || {},
  23809. state = this.state;
  23810. var renderStartDate, renderEndDate, schedulesInDateRange, viewModel, grids, range;
  23811. renderStartDate = new TZDate(options.renderStartDate);
  23812. renderEndDate = new TZDate(options.renderEndDate);
  23813. range = datetime.range(
  23814. datetime.start(renderStartDate),
  23815. datetime.end(renderEndDate),
  23816. datetime.MILLISECONDS_PER_DAY
  23817. );
  23818. if (options.workweek && datetime.compare(renderStartDate, renderEndDate)) {
  23819. range = util.filter(range, function(date) {
  23820. return !datetime.isWeekend(date.getDay());
  23821. });
  23822. renderStartDate = range[0];
  23823. renderEndDate = range[range.length - 1];
  23824. }
  23825. schedulesInDateRange = this.controller.findByDateRange(
  23826. datetime.start(renderStartDate),
  23827. datetime.end(renderEndDate),
  23828. this.panels,
  23829. scheduleFilter,
  23830. this.options
  23831. );
  23832. grids = datetime.getGridLeftAndWidth(
  23833. range.length,
  23834. narrowWeekend,
  23835. startDayOfWeek,
  23836. workweek
  23837. );
  23838. viewModel = {
  23839. schedulesInDateRange: schedulesInDateRange,
  23840. renderStartDate: renderStartDate,
  23841. renderEndDate: renderEndDate,
  23842. grids: grids,
  23843. range: range,
  23844. theme: theme,
  23845. state: state
  23846. };
  23847. this.children.each(function(childView) {
  23848. var matrices;
  23849. var viewName = util.pick(childView.options, 'viewName');
  23850. childView.render(viewModel);
  23851. if (viewName) {
  23852. matrices = viewModel.schedulesInDateRange[viewName]; // DayGrid limits schedule count by visibleScheduleCount after rendering it.
  23853. if (util.isArray(matrices)) {
  23854. self._invokeAfterRenderSchedule(matrices);
  23855. } else {
  23856. util.forEach(matrices, function(matricesOfDay) {
  23857. self._invokeAfterRenderSchedule(matricesOfDay);
  23858. });
  23859. }
  23860. }
  23861. });
  23862. /**
  23863. * @event Week#afterRender
  23864. */
  23865. this.fire('afterRender');
  23866. };
  23867. /**
  23868. * Fire 'afterRenderSchedule' event
  23869. * @param {Array} matrices - schedule matrices from view model
  23870. * @fires Week#afterRenderSchedule
  23871. */
  23872. Week.prototype._invokeAfterRenderSchedule = function(matrices) {
  23873. var self = this;
  23874. util.forEachArray(matrices, function(matrix) {
  23875. util.forEachArray(matrix, function(column) {
  23876. util.forEachArray(column, function(scheduleViewModel) {
  23877. if (scheduleViewModel) {
  23878. /**
  23879. * @event Week#afterRenderSchedule
  23880. */
  23881. self.fire('afterRenderSchedule', {schedule: scheduleViewModel.model});
  23882. }
  23883. });
  23884. });
  23885. });
  23886. };
  23887. /**********
  23888. * Prototype props
  23889. **********/
  23890. Week.prototype.viewName = 'week';
  23891. /**
  23892. * Calculate default render date range from supplied date.
  23893. * @param {Date} baseDate base date.
  23894. * @returns {object} date range.
  23895. */
  23896. Week.prototype._getRenderDateRange = function(baseDate) {
  23897. var base = datetime.start(baseDate),
  23898. start = new TZDate(Number(base)),
  23899. end = new TZDate(Number(base));
  23900. start.setDate(start.getDate() - 3);
  23901. end.setDate(end.getDate() + 3);
  23902. return {
  23903. start: start,
  23904. end: end
  23905. };
  23906. };
  23907. /**
  23908. * disable options for day view
  23909. * @param {WeekOptions} options - week options to disable
  23910. */
  23911. function _disableDayOptions(options) {
  23912. options.workweek = false;
  23913. }
  23914. util.CustomEvents.mixin(Week);
  23915. module.exports = Week;
  23916. /***/ }),
  23917. /***/ "./src/js/view/weekday.js":
  23918. /*!********************************!*\
  23919. !*** ./src/js/view/weekday.js ***!
  23920. \********************************/
  23921. /*! no static exports found */
  23922. /***/ (function(module, exports, __webpack_require__) {
  23923. "use strict";
  23924. /**
  23925. * @fileoverview Weekday view
  23926. * @author NHN FE Development Lab <dl_javascript@nhn.com>
  23927. */
  23928. var util = __webpack_require__(/*! tui-code-snippet */ "tui-code-snippet");
  23929. var config = __webpack_require__(/*! ../config */ "./src/js/config.js"),
  23930. domutil = __webpack_require__(/*! ../common/domutil */ "./src/js/common/domutil.js"),
  23931. datetime = __webpack_require__(/*! ../common/datetime */ "./src/js/common/datetime.js"),
  23932. TZDate = __webpack_require__(/*! ../common/timezone */ "./src/js/common/timezone.js").Date,
  23933. View = __webpack_require__(/*! ./view */ "./src/js/view/view.js");
  23934. /**
  23935. * @constructor
  23936. * @extends {View}
  23937. * @param {object} options - view options.
  23938. * @param {number} [options.containerButtonGutter=8] - free space at bottom to
  23939. * make create easy.
  23940. * @param {number} [options.scheduleHeight=18] - height of each schedule block.
  23941. * @param {number} [options.scheduleGutter=2] - gutter height of each schedule block.
  23942. * @param {HTMLDIVElement} container - DOM element to use container for this
  23943. * view.
  23944. */
  23945. function Weekday(options, container) {
  23946. container = domutil.appendHTMLElement(
  23947. 'div',
  23948. container,
  23949. config.classname('weekday')
  23950. );
  23951. /**
  23952. * @type {object}
  23953. */
  23954. this.options = util.extend({
  23955. containerBottomGutter: 8,
  23956. scheduleHeight: 18,
  23957. scheduleGutter: 2,
  23958. narrowWeekend: false,
  23959. startDayOfWeek: 0,
  23960. workweek: false
  23961. }, options);
  23962. /*
  23963. * cache parent's view model
  23964. * @type {object}
  23965. */
  23966. this._cacheParentViewModel = null;
  23967. View.call(this, container);
  23968. }
  23969. util.inherit(Weekday, View);
  23970. /**
  23971. * Get render date range
  23972. * @returns {Date[]} rendered date range
  23973. */
  23974. Weekday.prototype.getRenderDateRange = function() {
  23975. return this._cacheParentViewModel.range;
  23976. };
  23977. /**
  23978. * Get render date grids information
  23979. * @returns {Date[]} rendered date grids information
  23980. */
  23981. Weekday.prototype.getRenderDateGrids = function() {
  23982. return this._cacheParentViewModel.grids;
  23983. };
  23984. /**
  23985. * Get default view model.
  23986. * @param {object} viewModel parent's view model
  23987. * @returns {object} viewModel to rendering.
  23988. */
  23989. Weekday.prototype.getBaseViewModel = function(viewModel) {
  23990. var opt = this.options;
  23991. var range = viewModel.range;
  23992. var gridWidth = (100 / range.length);
  23993. var grids = viewModel.grids;
  23994. var exceedDate = viewModel.exceedDate || {};
  23995. var theme = viewModel.theme;
  23996. var now = new TZDate().toLocalTime();
  23997. this._cacheParentViewModel = viewModel;
  23998. return {
  23999. width: gridWidth,
  24000. scheduleHeight: opt.scheduleHeight,
  24001. scheduleBlockHeight: (opt.scheduleHeight + opt.scheduleGutter),
  24002. scheduleBlockGutter: opt.scheduleGutter,
  24003. dates: util.map(range, function(date, index) {
  24004. var day = date.getDay();
  24005. var ymd = datetime.format(new TZDate(date), 'YYYYMMDD');
  24006. var isToday = datetime.isSameDate(now, date);
  24007. return {
  24008. date: datetime.format(date, 'YYYY-MM-DD'),
  24009. month: date.getMonth() + 1,
  24010. day: day,
  24011. isToday: isToday,
  24012. ymd: ymd,
  24013. hiddenSchedules: exceedDate[ymd] || 0,
  24014. width: grids[index] ? grids[index].width : 0,
  24015. left: grids[index] ? grids[index].left : 0,
  24016. color: this._getDayNameColor(theme, day, isToday),
  24017. backgroundColor: this._getDayBackgroundColor(theme, day)
  24018. };
  24019. }, this)
  24020. };
  24021. };
  24022. /* eslint max-nested-callbacks: 0 */
  24023. /**
  24024. * Make exceed date information
  24025. * @param {number} maxCount - exceed schedule count
  24026. * @param {Array} eventsInDateRange - matrix of ScheduleViewModel
  24027. * @param {Array.<TZDate>} range - date range of one week
  24028. * @returns {object} exceedDate
  24029. */
  24030. Weekday.prototype.getExceedDate = function(maxCount, eventsInDateRange, range) {
  24031. var exceedDate = this._initExceedDate(range);
  24032. util.forEach(eventsInDateRange, function(matrix) {
  24033. util.forEach(matrix, function(column) {
  24034. util.forEach(column, function(viewModel) {
  24035. var period;
  24036. if (!viewModel || viewModel.top < maxCount) {
  24037. return;
  24038. }
  24039. // check that this schedule block is not visible after rendered.
  24040. viewModel.hidden = true;
  24041. period = datetime.range(
  24042. viewModel.getStarts(),
  24043. viewModel.getEnds(),
  24044. datetime.MILLISECONDS_PER_DAY
  24045. );
  24046. util.forEach(period, function(date) {
  24047. var ymd = datetime.format(date, 'YYYYMMDD');
  24048. exceedDate[ymd] += 1;
  24049. });
  24050. });
  24051. });
  24052. });
  24053. return exceedDate;
  24054. };
  24055. /**
  24056. * Initiate exceed date information
  24057. * @param {Array.<TZDate>} range - date range of one week
  24058. * @returns {Object} - initiated exceed date
  24059. */
  24060. Weekday.prototype._initExceedDate = function(range) {
  24061. var exceedDate = {};
  24062. util.forEach(range, function(date) {
  24063. var ymd = datetime.format(date, 'YYYYMMDD');
  24064. exceedDate[ymd] = 0;
  24065. });
  24066. return exceedDate;
  24067. };
  24068. /**
  24069. * Get a day name color
  24070. * @param {Theme} theme - theme instance
  24071. * @param {number} day - day number
  24072. * @param {boolean} isToday - today flag
  24073. * @param {boolean} isOtherMonth - not this month flag
  24074. * @returns {string} style - color style
  24075. */
  24076. Weekday.prototype._getDayNameColor = function(theme, day, isToday, isOtherMonth) {
  24077. var color = '';
  24078. if (theme) {
  24079. if (day === 0) {
  24080. color = isOtherMonth ? theme.month.holidayExceptThisMonth.color : theme.common.holiday.color;
  24081. } else if (day === 6) {
  24082. color = isOtherMonth ? theme.month.dayExceptThisMonth.color : theme.common.saturday.color;
  24083. } else if (isToday) {
  24084. color = theme.common.today.color;
  24085. } else {
  24086. color = isOtherMonth ? theme.month.dayExceptThisMonth.color : theme.common.dayname.color;
  24087. }
  24088. }
  24089. return color;
  24090. };
  24091. /**
  24092. * Get a day background color
  24093. * @param {Theme} theme - theme instance
  24094. * @param {number} day - day number
  24095. * @returns {string} style - color style
  24096. */
  24097. Weekday.prototype._getDayBackgroundColor = function(theme, day) {
  24098. var color = '';
  24099. if (theme) {
  24100. if (day === 0 || day === 6) {
  24101. color = theme.month.weekend.backgroundColor;
  24102. } else {
  24103. color = 'inherit';
  24104. }
  24105. }
  24106. return color;
  24107. };
  24108. module.exports = Weekday;
  24109. /***/ }),
  24110. /***/ "tui-code-snippet":
  24111. /*!******************************************************************************************************************************!*\
  24112. !*** external {"commonjs":"tui-code-snippet","commonjs2":"tui-code-snippet","amd":"tui-code-snippet","root":["tui","util"]} ***!
  24113. \******************************************************************************************************************************/
  24114. /*! no static exports found */
  24115. /***/ (function(module, exports) {
  24116. module.exports = __WEBPACK_EXTERNAL_MODULE_tui_code_snippet__;
  24117. /***/ }),
  24118. /***/ "tui-date-picker":
  24119. /*!*********************************************************************************************************************************!*\
  24120. !*** external {"commonjs":"tui-date-picker","commonjs2":"tui-date-picker","amd":"tui-date-picker","root":["tui","DatePicker"]} ***!
  24121. \*********************************************************************************************************************************/
  24122. /*! no static exports found */
  24123. /***/ (function(module, exports) {
  24124. module.exports = __WEBPACK_EXTERNAL_MODULE_tui_date_picker__;
  24125. /***/ })
  24126. /******/ });
  24127. });
  24128. //# sourceMappingURL=tui-calendar.js.map