dx.viz.debug.js 3.6 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018610196102061021610226102361024610256102661027610286102961030610316103261033610346103561036610376103861039610406104161042610436104461045610466104761048610496105061051610526105361054610556105661057610586105961060610616106261063610646106561066610676106861069610706107161072610736107461075610766107761078610796108061081610826108361084610856108661087610886108961090610916109261093610946109561096610976109861099611006110161102611036110461105611066110761108611096111061111611126111361114611156111661117611186111961120611216112261123611246112561126611276112861129611306113161132611336113461135611366113761138611396114061141611426114361144611456114661147611486114961150611516115261153611546115561156611576115861159611606116161162611636116461165611666116761168611696117061171611726117361174611756117661177611786117961180611816118261183611846118561186611876118861189611906119161192611936119461195611966119761198611996120061201612026120361204612056120661207612086120961210612116121261213612146121561216612176121861219612206122161222612236122461225612266122761228612296123061231612326123361234612356123661237612386123961240612416124261243612446124561246612476124861249612506125161252612536125461255612566125761258612596126061261612626126361264612656126661267612686126961270612716127261273612746127561276612776127861279612806128161282612836128461285612866128761288612896129061291612926129361294612956129661297612986129961300613016130261303613046130561306613076130861309613106131161312613136131461315613166131761318613196132061321613226132361324613256132661327613286132961330613316133261333613346133561336613376133861339613406134161342613436134461345613466134761348613496135061351613526135361354613556135661357613586135961360613616136261363613646136561366613676136861369613706137161372613736137461375613766137761378613796138061381613826138361384613856138661387613886138961390613916139261393613946139561396613976139861399614006140161402614036140461405614066140761408614096141061411614126141361414614156141661417614186141961420614216142261423614246142561426614276142861429614306143161432614336143461435614366143761438614396144061441614426144361444614456144661447614486144961450614516145261453614546145561456614576145861459614606146161462614636146461465614666146761468614696147061471614726147361474614756147661477614786147961480614816148261483614846148561486614876148861489614906149161492614936149461495614966149761498614996150061501615026150361504615056150661507615086150961510615116151261513615146151561516615176151861519615206152161522615236152461525615266152761528615296153061531615326153361534615356153661537615386153961540615416154261543615446154561546615476154861549615506155161552615536155461555615566155761558615596156061561615626156361564615656156661567615686156961570615716157261573615746157561576615776157861579615806158161582615836158461585615866158761588615896159061591615926159361594615956159661597615986159961600616016160261603616046160561606616076160861609616106161161612616136161461615616166161761618616196162061621616226162361624616256162661627616286162961630616316163261633616346163561636616376163861639616406164161642616436164461645616466164761648616496165061651616526165361654616556165661657616586165961660616616166261663616646166561666616676166861669616706167161672616736167461675616766167761678616796168061681616826168361684616856168661687616886168961690616916169261693616946169561696616976169861699617006170161702617036170461705617066170761708617096171061711617126171361714617156171661717617186171961720617216172261723617246172561726617276172861729617306173161732617336173461735617366173761738617396174061741617426174361744617456174661747617486174961750617516175261753617546175561756617576175861759617606176161762617636176461765617666176761768617696177061771617726177361774617756177661777617786177961780617816178261783617846178561786617876178861789617906179161792617936179461795617966179761798617996180061801618026180361804618056180661807618086180961810618116181261813618146181561816618176181861819618206182161822618236182461825618266182761828618296183061831618326183361834618356183661837618386183961840618416184261843618446184561846618476184861849618506185161852618536185461855618566185761858618596186061861618626186361864618656186661867618686186961870618716187261873618746187561876618776187861879618806188161882618836188461885618866188761888618896189061891618926189361894618956189661897618986189961900619016190261903619046190561906619076190861909619106191161912619136191461915619166191761918619196192061921619226192361924619256192661927619286192961930619316193261933619346193561936619376193861939619406194161942619436194461945619466194761948619496195061951619526195361954619556195661957619586195961960619616196261963619646196561966619676196861969619706197161972619736197461975619766197761978619796198061981619826198361984619856198661987619886198961990619916199261993619946199561996619976199861999620006200162002620036200462005620066200762008620096201062011620126201362014620156201662017620186201962020620216202262023620246202562026620276202862029620306203162032620336203462035620366203762038620396204062041620426204362044620456204662047620486204962050620516205262053620546205562056620576205862059620606206162062620636206462065620666206762068620696207062071620726207362074620756207662077620786207962080620816208262083620846208562086620876208862089620906209162092620936209462095620966209762098620996210062101621026210362104621056210662107621086210962110621116211262113621146211562116621176211862119621206212162122621236212462125621266212762128621296213062131621326213362134621356213662137621386213962140621416214262143621446214562146621476214862149621506215162152621536215462155621566215762158621596216062161621626216362164621656216662167621686216962170621716217262173621746217562176621776217862179621806218162182621836218462185621866218762188621896219062191621926219362194621956219662197621986219962200622016220262203622046220562206622076220862209622106221162212622136221462215622166221762218622196222062221622226222362224622256222662227622286222962230622316223262233622346223562236622376223862239622406224162242622436224462245622466224762248622496225062251622526225362254622556225662257622586225962260622616226262263622646226562266622676226862269622706227162272622736227462275622766227762278622796228062281622826228362284622856228662287622886228962290622916229262293622946229562296622976229862299623006230162302623036230462305623066230762308623096231062311623126231362314623156231662317623186231962320623216232262323623246232562326623276232862329623306233162332623336233462335623366233762338623396234062341623426234362344623456234662347623486234962350623516235262353623546235562356623576235862359623606236162362623636236462365623666236762368623696237062371623726237362374623756237662377623786237962380623816238262383623846238562386623876238862389623906239162392623936239462395623966239762398623996240062401624026240362404624056240662407624086240962410624116241262413624146241562416624176241862419624206242162422624236242462425624266242762428624296243062431624326243362434624356243662437624386243962440624416244262443624446244562446624476244862449624506245162452624536245462455624566245762458624596246062461624626246362464624656246662467624686246962470624716247262473624746247562476624776247862479624806248162482624836248462485624866248762488624896249062491624926249362494624956249662497624986249962500625016250262503625046250562506625076250862509625106251162512625136251462515625166251762518625196252062521625226252362524625256252662527625286252962530625316253262533625346253562536625376253862539625406254162542625436254462545625466254762548625496255062551625526255362554625556255662557625586255962560625616256262563625646256562566625676256862569625706257162572625736257462575625766257762578625796258062581625826258362584625856258662587625886258962590625916259262593625946259562596625976259862599626006260162602626036260462605626066260762608626096261062611626126261362614626156261662617626186261962620626216262262623626246262562626626276262862629626306263162632626336263462635626366263762638626396264062641626426264362644626456264662647626486264962650626516265262653626546265562656626576265862659626606266162662626636266462665626666266762668626696267062671626726267362674626756267662677626786267962680626816268262683626846268562686626876268862689626906269162692626936269462695626966269762698626996270062701627026270362704627056270662707627086270962710627116271262713627146271562716627176271862719627206272162722627236272462725627266272762728627296273062731627326273362734627356273662737627386273962740627416274262743627446274562746627476274862749627506275162752627536275462755627566275762758627596276062761627626276362764627656276662767627686276962770627716277262773627746277562776627776277862779627806278162782627836278462785627866278762788627896279062791627926279362794627956279662797627986279962800628016280262803628046280562806628076280862809628106281162812628136281462815628166281762818628196282062821628226282362824628256282662827628286282962830628316283262833628346283562836628376283862839628406284162842628436284462845628466284762848628496285062851628526285362854628556285662857628586285962860628616286262863628646286562866628676286862869628706287162872628736287462875628766287762878628796288062881628826288362884628856288662887628886288962890628916289262893628946289562896628976289862899629006290162902629036290462905629066290762908629096291062911629126291362914629156291662917629186291962920629216292262923629246292562926629276292862929629306293162932629336293462935629366293762938629396294062941629426294362944629456294662947629486294962950629516295262953629546295562956629576295862959629606296162962629636296462965629666296762968629696297062971629726297362974629756297662977629786297962980629816298262983629846298562986629876298862989629906299162992629936299462995629966299762998629996300063001630026300363004630056300663007630086300963010630116301263013630146301563016630176301863019630206302163022630236302463025630266302763028630296303063031630326303363034630356303663037630386303963040630416304263043630446304563046630476304863049630506305163052630536305463055630566305763058630596306063061630626306363064630656306663067630686306963070630716307263073630746307563076630776307863079630806308163082630836308463085630866308763088630896309063091630926309363094630956309663097630986309963100631016310263103631046310563106631076310863109631106311163112631136311463115631166311763118631196312063121631226312363124631256312663127631286312963130631316313263133631346313563136631376313863139631406314163142631436314463145631466314763148631496315063151631526315363154631556315663157631586315963160631616316263163631646316563166631676316863169631706317163172631736317463175631766317763178631796318063181631826318363184631856318663187631886318963190631916319263193631946319563196631976319863199632006320163202632036320463205632066320763208632096321063211632126321363214632156321663217632186321963220632216322263223632246322563226632276322863229632306323163232632336323463235632366323763238632396324063241632426324363244632456324663247632486324963250632516325263253632546325563256632576325863259632606326163262632636326463265632666326763268632696327063271632726327363274632756327663277632786327963280632816328263283632846328563286632876328863289632906329163292632936329463295632966329763298632996330063301633026330363304633056330663307633086330963310633116331263313633146331563316633176331863319633206332163322633236332463325633266332763328633296333063331633326333363334633356333663337633386333963340633416334263343633446334563346633476334863349633506335163352633536335463355633566335763358633596336063361633626336363364633656336663367633686336963370633716337263373633746337563376633776337863379633806338163382633836338463385633866338763388633896339063391633926339363394633956339663397633986339963400634016340263403634046340563406634076340863409634106341163412634136341463415634166341763418634196342063421634226342363424634256342663427634286342963430634316343263433634346343563436634376343863439634406344163442634436344463445634466344763448634496345063451634526345363454634556345663457634586345963460634616346263463634646346563466634676346863469634706347163472634736347463475634766347763478634796348063481634826348363484634856348663487634886348963490634916349263493634946349563496634976349863499635006350163502635036350463505635066350763508635096351063511635126351363514635156351663517635186351963520635216352263523635246352563526635276352863529635306353163532635336353463535635366353763538635396354063541635426354363544635456354663547635486354963550635516355263553635546355563556635576355863559635606356163562635636356463565635666356763568635696357063571635726357363574635756357663577635786357963580635816358263583635846358563586635876358863589635906359163592635936359463595635966359763598635996360063601636026360363604636056360663607636086360963610636116361263613636146361563616636176361863619636206362163622636236362463625636266362763628636296363063631636326363363634636356363663637636386363963640636416364263643636446364563646636476364863649636506365163652636536365463655636566365763658636596366063661636626366363664636656366663667636686366963670636716367263673636746367563676636776367863679636806368163682636836368463685636866368763688636896369063691636926369363694636956369663697636986369963700637016370263703637046370563706637076370863709637106371163712637136371463715637166371763718637196372063721637226372363724637256372663727637286372963730637316373263733637346373563736637376373863739637406374163742637436374463745637466374763748637496375063751637526375363754637556375663757637586375963760637616376263763637646376563766637676376863769637706377163772637736377463775637766377763778637796378063781637826378363784637856378663787637886378963790637916379263793637946379563796637976379863799638006380163802638036380463805638066380763808638096381063811638126381363814638156381663817638186381963820638216382263823638246382563826638276382863829638306383163832638336383463835638366383763838638396384063841638426384363844638456384663847638486384963850638516385263853638546385563856638576385863859638606386163862638636386463865638666386763868638696387063871638726387363874638756387663877638786387963880638816388263883638846388563886638876388863889638906389163892638936389463895638966389763898638996390063901639026390363904639056390663907639086390963910639116391263913639146391563916639176391863919639206392163922639236392463925639266392763928639296393063931639326393363934639356393663937639386393963940639416394263943639446394563946639476394863949639506395163952639536395463955639566395763958639596396063961639626396363964639656396663967639686396963970639716397263973639746397563976639776397863979639806398163982639836398463985639866398763988639896399063991639926399363994639956399663997639986399964000640016400264003640046400564006640076400864009640106401164012640136401464015640166401764018640196402064021640226402364024640256402664027640286402964030640316403264033640346403564036640376403864039640406404164042640436404464045640466404764048640496405064051640526405364054640556405664057640586405964060640616406264063640646406564066640676406864069640706407164072640736407464075640766407764078640796408064081640826408364084640856408664087640886408964090640916409264093640946409564096640976409864099641006410164102641036410464105641066410764108641096411064111641126411364114641156411664117641186411964120641216412264123641246412564126641276412864129641306413164132641336413464135641366413764138641396414064141641426414364144641456414664147641486414964150641516415264153641546415564156641576415864159641606416164162641636416464165641666416764168641696417064171641726417364174641756417664177641786417964180641816418264183641846418564186641876418864189641906419164192641936419464195641966419764198641996420064201642026420364204642056420664207642086420964210642116421264213642146421564216642176421864219642206422164222642236422464225642266422764228642296423064231642326423364234642356423664237642386423964240642416424264243642446424564246642476424864249642506425164252642536425464255642566425764258642596426064261642626426364264642656426664267642686426964270642716427264273642746427564276642776427864279642806428164282642836428464285642866428764288642896429064291642926429364294642956429664297642986429964300643016430264303643046430564306643076430864309643106431164312643136431464315643166431764318643196432064321643226432364324643256432664327643286432964330643316433264333643346433564336643376433864339643406434164342643436434464345643466434764348643496435064351643526435364354643556435664357643586435964360643616436264363643646436564366643676436864369643706437164372643736437464375643766437764378643796438064381643826438364384643856438664387643886438964390643916439264393643946439564396643976439864399644006440164402644036440464405644066440764408644096441064411644126441364414644156441664417644186441964420644216442264423644246442564426644276442864429644306443164432644336443464435644366443764438644396444064441644426444364444644456444664447644486444964450644516445264453644546445564456644576445864459644606446164462644636446464465644666446764468644696447064471644726447364474644756447664477644786447964480644816448264483644846448564486644876448864489644906449164492644936449464495644966449764498644996450064501645026450364504645056450664507645086450964510645116451264513645146451564516645176451864519645206452164522645236452464525645266452764528645296453064531645326453364534645356453664537645386453964540645416454264543645446454564546645476454864549645506455164552645536455464555645566455764558645596456064561645626456364564645656456664567645686456964570645716457264573645746457564576645776457864579645806458164582645836458464585645866458764588645896459064591645926459364594645956459664597645986459964600646016460264603646046460564606646076460864609646106461164612646136461464615646166461764618646196462064621646226462364624646256462664627646286462964630646316463264633646346463564636646376463864639646406464164642646436464464645646466464764648646496465064651646526465364654646556465664657646586465964660646616466264663646646466564666646676466864669646706467164672646736467464675646766467764678646796468064681646826468364684646856468664687646886468964690646916469264693646946469564696646976469864699647006470164702647036470464705647066470764708647096471064711647126471364714647156471664717647186471964720647216472264723647246472564726647276472864729647306473164732647336473464735647366473764738647396474064741647426474364744647456474664747647486474964750647516475264753647546475564756647576475864759647606476164762647636476464765647666476764768647696477064771647726477364774647756477664777647786477964780647816478264783647846478564786647876478864789647906479164792647936479464795647966479764798647996480064801648026480364804648056480664807648086480964810648116481264813648146481564816648176481864819648206482164822648236482464825648266482764828648296483064831648326483364834648356483664837648386483964840648416484264843648446484564846648476484864849648506485164852648536485464855648566485764858648596486064861648626486364864648656486664867648686486964870648716487264873648746487564876648776487864879648806488164882648836488464885648866488764888648896489064891648926489364894648956489664897648986489964900649016490264903649046490564906649076490864909649106491164912649136491464915649166491764918649196492064921649226492364924649256492664927649286492964930649316493264933649346493564936649376493864939649406494164942649436494464945649466494764948649496495064951649526495364954649556495664957649586495964960649616496264963649646496564966649676496864969649706497164972649736497464975649766497764978649796498064981649826498364984649856498664987649886498964990649916499264993649946499564996649976499864999650006500165002650036500465005650066500765008650096501065011650126501365014650156501665017650186501965020650216502265023650246502565026650276502865029650306503165032650336503465035650366503765038650396504065041650426504365044650456504665047650486504965050650516505265053650546505565056650576505865059650606506165062650636506465065650666506765068650696507065071650726507365074650756507665077650786507965080650816508265083650846508565086650876508865089650906509165092650936509465095650966509765098650996510065101651026510365104651056510665107651086510965110651116511265113651146511565116651176511865119651206512165122651236512465125651266512765128651296513065131651326513365134651356513665137651386513965140651416514265143651446514565146651476514865149651506515165152651536515465155651566515765158651596516065161651626516365164651656516665167651686516965170651716517265173651746517565176651776517865179651806518165182651836518465185651866518765188651896519065191651926519365194651956519665197651986519965200652016520265203652046520565206652076520865209652106521165212652136521465215652166521765218652196522065221652226522365224652256522665227652286522965230652316523265233652346523565236652376523865239652406524165242652436524465245652466524765248652496525065251652526525365254652556525665257652586525965260652616526265263652646526565266652676526865269652706527165272652736527465275652766527765278652796528065281652826528365284652856528665287652886528965290652916529265293652946529565296652976529865299653006530165302653036530465305653066530765308653096531065311653126531365314653156531665317653186531965320653216532265323653246532565326653276532865329653306533165332653336533465335653366533765338653396534065341653426534365344653456534665347653486534965350653516535265353653546535565356653576535865359653606536165362653636536465365653666536765368653696537065371653726537365374653756537665377653786537965380653816538265383653846538565386653876538865389653906539165392653936539465395653966539765398653996540065401654026540365404654056540665407654086540965410654116541265413654146541565416654176541865419654206542165422654236542465425654266542765428654296543065431654326543365434654356543665437654386543965440654416544265443654446544565446654476544865449654506545165452654536545465455654566545765458654596546065461654626546365464654656546665467654686546965470654716547265473654746547565476654776547865479654806548165482654836548465485654866548765488654896549065491654926549365494654956549665497654986549965500655016550265503655046550565506655076550865509655106551165512655136551465515655166551765518655196552065521655226552365524655256552665527655286552965530655316553265533655346553565536655376553865539655406554165542655436554465545655466554765548655496555065551655526555365554655556555665557655586555965560655616556265563655646556565566655676556865569655706557165572655736557465575655766557765578655796558065581655826558365584655856558665587655886558965590655916559265593655946559565596655976559865599656006560165602656036560465605656066560765608656096561065611656126561365614656156561665617656186561965620656216562265623656246562565626656276562865629656306563165632656336563465635656366563765638656396564065641656426564365644656456564665647656486564965650656516565265653656546565565656656576565865659656606566165662656636566465665656666566765668656696567065671656726567365674656756567665677656786567965680656816568265683656846568565686656876568865689656906569165692656936569465695656966569765698656996570065701657026570365704657056570665707657086570965710657116571265713657146571565716657176571865719657206572165722657236572465725657266572765728657296573065731657326573365734657356573665737657386573965740657416574265743657446574565746657476574865749657506575165752657536575465755657566575765758657596576065761657626576365764657656576665767657686576965770657716577265773657746577565776657776577865779657806578165782657836578465785657866578765788657896579065791657926579365794657956579665797657986579965800658016580265803658046580565806658076580865809658106581165812658136581465815658166581765818658196582065821658226582365824658256582665827658286582965830658316583265833658346583565836658376583865839658406584165842658436584465845658466584765848658496585065851658526585365854658556585665857658586585965860658616586265863658646586565866658676586865869658706587165872658736587465875658766587765878658796588065881658826588365884658856588665887658886588965890658916589265893658946589565896658976589865899659006590165902659036590465905659066590765908659096591065911659126591365914659156591665917659186591965920659216592265923659246592565926659276592865929659306593165932659336593465935659366593765938659396594065941659426594365944659456594665947659486594965950659516595265953659546595565956659576595865959659606596165962659636596465965659666596765968659696597065971659726597365974659756597665977659786597965980659816598265983659846598565986659876598865989659906599165992659936599465995659966599765998659996600066001660026600366004660056600666007660086600966010660116601266013660146601566016660176601866019660206602166022660236602466025660266602766028660296603066031660326603366034660356603666037660386603966040660416604266043660446604566046660476604866049660506605166052660536605466055660566605766058660596606066061660626606366064660656606666067660686606966070660716607266073660746607566076660776607866079660806608166082660836608466085660866608766088660896609066091660926609366094660956609666097660986609966100661016610266103661046610566106661076610866109661106611166112661136611466115661166611766118661196612066121661226612366124661256612666127661286612966130661316613266133661346613566136661376613866139661406614166142661436614466145661466614766148661496615066151661526615366154661556615666157661586615966160661616616266163661646616566166661676616866169661706617166172661736617466175661766617766178661796618066181661826618366184661856618666187661886618966190661916619266193661946619566196661976619866199662006620166202662036620466205662066620766208662096621066211662126621366214662156621666217662186621966220662216622266223662246622566226662276622866229662306623166232662336623466235662366623766238662396624066241662426624366244662456624666247662486624966250662516625266253662546625566256662576625866259662606626166262662636626466265662666626766268662696627066271662726627366274662756627666277662786627966280662816628266283662846628566286662876628866289662906629166292662936629466295662966629766298662996630066301663026630366304663056630666307663086630966310663116631266313663146631566316663176631866319663206632166322663236632466325663266632766328663296633066331663326633366334663356633666337663386633966340663416634266343663446634566346663476634866349663506635166352663536635466355663566635766358663596636066361663626636366364663656636666367663686636966370663716637266373663746637566376663776637866379663806638166382663836638466385663866638766388663896639066391663926639366394663956639666397663986639966400664016640266403664046640566406664076640866409664106641166412664136641466415664166641766418664196642066421664226642366424664256642666427664286642966430664316643266433664346643566436664376643866439664406644166442664436644466445664466644766448664496645066451664526645366454664556645666457664586645966460664616646266463664646646566466664676646866469664706647166472664736647466475664766647766478664796648066481664826648366484664856648666487664886648966490664916649266493664946649566496664976649866499665006650166502665036650466505665066650766508665096651066511665126651366514665156651666517665186651966520665216652266523665246652566526665276652866529665306653166532665336653466535665366653766538665396654066541665426654366544665456654666547665486654966550665516655266553665546655566556665576655866559665606656166562665636656466565665666656766568665696657066571665726657366574665756657666577665786657966580665816658266583665846658566586665876658866589665906659166592665936659466595665966659766598665996660066601666026660366604666056660666607666086660966610666116661266613666146661566616666176661866619666206662166622666236662466625666266662766628666296663066631666326663366634666356663666637666386663966640666416664266643666446664566646666476664866649666506665166652666536665466655666566665766658666596666066661666626666366664666656666666667666686666966670666716667266673666746667566676666776667866679666806668166682666836668466685666866668766688666896669066691666926669366694666956669666697666986669966700667016670266703667046670566706667076670866709667106671166712667136671466715667166671766718667196672066721667226672366724667256672666727667286672966730667316673266733667346673566736667376673866739667406674166742667436674466745667466674766748667496675066751667526675366754667556675666757667586675966760667616676266763667646676566766667676676866769667706677166772667736677466775667766677766778667796678066781667826678366784667856678666787667886678966790667916679266793667946679566796667976679866799668006680166802668036680466805668066680766808668096681066811668126681366814668156681666817668186681966820668216682266823668246682566826668276682866829668306683166832668336683466835668366683766838668396684066841668426684366844668456684666847668486684966850668516685266853668546685566856668576685866859668606686166862668636686466865668666686766868668696687066871668726687366874668756687666877668786687966880668816688266883668846688566886668876688866889668906689166892668936689466895668966689766898668996690066901669026690366904669056690666907669086690966910669116691266913669146691566916669176691866919669206692166922669236692466925669266692766928669296693066931669326693366934669356693666937669386693966940669416694266943669446694566946669476694866949669506695166952669536695466955669566695766958669596696066961669626696366964669656696666967669686696966970669716697266973669746697566976669776697866979669806698166982669836698466985669866698766988669896699066991669926699366994669956699666997669986699967000670016700267003670046700567006670076700867009670106701167012670136701467015670166701767018670196702067021670226702367024670256702667027670286702967030670316703267033670346703567036670376703867039670406704167042670436704467045670466704767048670496705067051670526705367054670556705667057670586705967060670616706267063670646706567066670676706867069670706707167072670736707467075670766707767078670796708067081670826708367084670856708667087670886708967090670916709267093670946709567096670976709867099671006710167102671036710467105671066710767108671096711067111671126711367114671156711667117671186711967120671216712267123671246712567126671276712867129671306713167132671336713467135671366713767138671396714067141671426714367144671456714667147671486714967150671516715267153671546715567156671576715867159671606716167162671636716467165671666716767168671696717067171671726717367174671756717667177671786717967180671816718267183671846718567186671876718867189671906719167192671936719467195671966719767198671996720067201672026720367204672056720667207672086720967210672116721267213672146721567216672176721867219672206722167222672236722467225672266722767228672296723067231672326723367234672356723667237672386723967240672416724267243672446724567246672476724867249672506725167252672536725467255672566725767258672596726067261672626726367264672656726667267672686726967270672716727267273672746727567276672776727867279672806728167282672836728467285672866728767288672896729067291672926729367294672956729667297672986729967300673016730267303673046730567306673076730867309673106731167312673136731467315673166731767318673196732067321673226732367324673256732667327673286732967330673316733267333673346733567336673376733867339673406734167342673436734467345673466734767348673496735067351673526735367354673556735667357673586735967360673616736267363673646736567366673676736867369673706737167372673736737467375673766737767378673796738067381673826738367384673856738667387673886738967390673916739267393673946739567396673976739867399674006740167402674036740467405674066740767408674096741067411674126741367414674156741667417674186741967420674216742267423674246742567426674276742867429674306743167432674336743467435674366743767438674396744067441674426744367444674456744667447674486744967450674516745267453674546745567456674576745867459674606746167462674636746467465674666746767468674696747067471674726747367474674756747667477674786747967480674816748267483674846748567486674876748867489674906749167492674936749467495674966749767498674996750067501675026750367504675056750667507675086750967510675116751267513675146751567516675176751867519675206752167522675236752467525675266752767528675296753067531675326753367534675356753667537675386753967540675416754267543675446754567546675476754867549675506755167552675536755467555675566755767558675596756067561675626756367564675656756667567675686756967570675716757267573675746757567576675776757867579675806758167582675836758467585675866758767588675896759067591675926759367594675956759667597675986759967600676016760267603676046760567606676076760867609676106761167612676136761467615676166761767618676196762067621676226762367624676256762667627676286762967630676316763267633676346763567636676376763867639676406764167642676436764467645676466764767648676496765067651676526765367654676556765667657676586765967660676616766267663676646766567666676676766867669676706767167672676736767467675676766767767678676796768067681676826768367684676856768667687676886768967690676916769267693676946769567696676976769867699677006770167702677036770467705677066770767708677096771067711677126771367714677156771667717677186771967720677216772267723677246772567726677276772867729677306773167732677336773467735677366773767738677396774067741677426774367744677456774667747677486774967750677516775267753677546775567756677576775867759677606776167762677636776467765677666776767768677696777067771677726777367774677756777667777677786777967780677816778267783677846778567786677876778867789677906779167792677936779467795677966779767798677996780067801678026780367804678056780667807678086780967810678116781267813678146781567816678176781867819678206782167822678236782467825678266782767828678296783067831678326783367834678356783667837678386783967840678416784267843678446784567846678476784867849678506785167852678536785467855678566785767858678596786067861678626786367864678656786667867678686786967870678716787267873678746787567876678776787867879678806788167882678836788467885678866788767888678896789067891678926789367894678956789667897678986789967900679016790267903679046790567906679076790867909679106791167912679136791467915679166791767918679196792067921679226792367924679256792667927679286792967930679316793267933679346793567936679376793867939679406794167942679436794467945679466794767948679496795067951679526795367954679556795667957679586795967960679616796267963679646796567966679676796867969679706797167972679736797467975679766797767978679796798067981679826798367984679856798667987679886798967990679916799267993679946799567996679976799867999680006800168002680036800468005680066800768008680096801068011680126801368014680156801668017680186801968020680216802268023680246802568026680276802868029680306803168032680336803468035680366803768038680396804068041680426804368044680456804668047680486804968050680516805268053680546805568056680576805868059680606806168062680636806468065680666806768068680696807068071680726807368074680756807668077680786807968080680816808268083680846808568086680876808868089680906809168092680936809468095680966809768098680996810068101681026810368104681056810668107681086810968110681116811268113681146811568116681176811868119681206812168122681236812468125681266812768128681296813068131681326813368134681356813668137681386813968140681416814268143681446814568146681476814868149681506815168152681536815468155681566815768158681596816068161681626816368164681656816668167681686816968170681716817268173681746817568176681776817868179681806818168182681836818468185681866818768188681896819068191681926819368194681956819668197681986819968200682016820268203682046820568206682076820868209682106821168212682136821468215682166821768218682196822068221682226822368224682256822668227682286822968230682316823268233682346823568236682376823868239682406824168242682436824468245682466824768248682496825068251682526825368254682556825668257682586825968260682616826268263682646826568266682676826868269682706827168272682736827468275682766827768278682796828068281682826828368284682856828668287682886828968290682916829268293682946829568296682976829868299683006830168302683036830468305683066830768308683096831068311683126831368314683156831668317683186831968320683216832268323683246832568326683276832868329683306833168332683336833468335683366833768338683396834068341683426834368344683456834668347683486834968350683516835268353683546835568356683576835868359683606836168362683636836468365683666836768368683696837068371683726837368374683756837668377683786837968380683816838268383683846838568386683876838868389683906839168392683936839468395683966839768398683996840068401684026840368404684056840668407684086840968410684116841268413684146841568416684176841868419684206842168422684236842468425684266842768428684296843068431684326843368434684356843668437684386843968440684416844268443684446844568446684476844868449684506845168452684536845468455684566845768458684596846068461684626846368464684656846668467684686846968470684716847268473684746847568476684776847868479684806848168482684836848468485684866848768488684896849068491684926849368494684956849668497684986849968500685016850268503685046850568506685076850868509685106851168512685136851468515685166851768518685196852068521685226852368524685256852668527685286852968530685316853268533685346853568536685376853868539685406854168542685436854468545685466854768548685496855068551685526855368554685556855668557685586855968560685616856268563685646856568566685676856868569685706857168572685736857468575685766857768578685796858068581685826858368584685856858668587685886858968590685916859268593685946859568596685976859868599686006860168602686036860468605686066860768608686096861068611686126861368614686156861668617686186861968620686216862268623686246862568626686276862868629686306863168632686336863468635686366863768638686396864068641686426864368644686456864668647686486864968650686516865268653686546865568656686576865868659686606866168662686636866468665686666866768668686696867068671686726867368674686756867668677686786867968680686816868268683686846868568686686876868868689686906869168692686936869468695686966869768698686996870068701687026870368704687056870668707687086870968710687116871268713687146871568716687176871868719687206872168722687236872468725687266872768728687296873068731687326873368734687356873668737687386873968740687416874268743687446874568746687476874868749687506875168752687536875468755687566875768758687596876068761687626876368764687656876668767687686876968770687716877268773687746877568776687776877868779687806878168782687836878468785687866878768788687896879068791687926879368794687956879668797687986879968800688016880268803688046880568806688076880868809688106881168812688136881468815688166881768818688196882068821688226882368824688256882668827688286882968830688316883268833688346883568836688376883868839688406884168842688436884468845688466884768848688496885068851688526885368854688556885668857688586885968860688616886268863688646886568866688676886868869688706887168872688736887468875688766887768878688796888068881688826888368884688856888668887688886888968890688916889268893688946889568896688976889868899689006890168902689036890468905689066890768908689096891068911689126891368914689156891668917689186891968920689216892268923689246892568926689276892868929689306893168932689336893468935689366893768938689396894068941689426894368944689456894668947689486894968950689516895268953689546895568956689576895868959689606896168962689636896468965689666896768968689696897068971689726897368974689756897668977689786897968980689816898268983689846898568986689876898868989689906899168992689936899468995689966899768998689996900069001690026900369004690056900669007690086900969010690116901269013690146901569016690176901869019690206902169022690236902469025690266902769028690296903069031690326903369034690356903669037690386903969040690416904269043690446904569046690476904869049690506905169052690536905469055690566905769058690596906069061690626906369064690656906669067690686906969070690716907269073690746907569076690776907869079690806908169082690836908469085690866908769088690896909069091690926909369094690956909669097690986909969100691016910269103691046910569106691076910869109691106911169112691136911469115691166911769118691196912069121691226912369124691256912669127691286912969130691316913269133691346913569136691376913869139691406914169142691436914469145691466914769148691496915069151691526915369154691556915669157691586915969160691616916269163691646916569166691676916869169691706917169172691736917469175691766917769178691796918069181691826918369184691856918669187691886918969190691916919269193691946919569196691976919869199692006920169202692036920469205692066920769208692096921069211692126921369214692156921669217692186921969220692216922269223692246922569226692276922869229692306923169232692336923469235692366923769238692396924069241692426924369244692456924669247692486924969250692516925269253692546925569256692576925869259692606926169262692636926469265692666926769268692696927069271692726927369274692756927669277692786927969280692816928269283692846928569286692876928869289692906929169292692936929469295692966929769298692996930069301693026930369304693056930669307693086930969310693116931269313693146931569316693176931869319693206932169322693236932469325693266932769328693296933069331693326933369334693356933669337693386933969340693416934269343693446934569346693476934869349693506935169352693536935469355693566935769358693596936069361693626936369364693656936669367693686936969370693716937269373693746937569376693776937869379693806938169382693836938469385693866938769388693896939069391693926939369394693956939669397693986939969400694016940269403694046940569406694076940869409694106941169412694136941469415694166941769418694196942069421694226942369424694256942669427694286942969430694316943269433694346943569436694376943869439694406944169442694436944469445694466944769448694496945069451694526945369454694556945669457694586945969460694616946269463694646946569466694676946869469694706947169472694736947469475694766947769478694796948069481694826948369484694856948669487694886948969490694916949269493694946949569496694976949869499695006950169502695036950469505695066950769508695096951069511695126951369514695156951669517695186951969520695216952269523695246952569526695276952869529695306953169532695336953469535695366953769538695396954069541695426954369544695456954669547695486954969550695516955269553695546955569556695576955869559695606956169562695636956469565695666956769568695696957069571695726957369574695756957669577695786957969580695816958269583695846958569586695876958869589695906959169592695936959469595695966959769598695996960069601696026960369604696056960669607696086960969610696116961269613696146961569616696176961869619696206962169622696236962469625696266962769628696296963069631696326963369634696356963669637696386963969640696416964269643696446964569646696476964869649696506965169652696536965469655696566965769658696596966069661696626966369664696656966669667696686966969670696716967269673696746967569676696776967869679696806968169682696836968469685696866968769688696896969069691696926969369694696956969669697696986969969700697016970269703697046970569706697076970869709697106971169712697136971469715697166971769718697196972069721697226972369724697256972669727697286972969730697316973269733697346973569736697376973869739697406974169742697436974469745697466974769748697496975069751697526975369754697556975669757697586975969760697616976269763697646976569766697676976869769697706977169772697736977469775697766977769778697796978069781697826978369784697856978669787697886978969790697916979269793697946979569796697976979869799698006980169802698036980469805698066980769808698096981069811698126981369814698156981669817698186981969820698216982269823698246982569826698276982869829698306983169832698336983469835698366983769838698396984069841698426984369844698456984669847698486984969850698516985269853698546985569856698576985869859698606986169862698636986469865698666986769868698696987069871698726987369874698756987669877698786987969880698816988269883698846988569886698876988869889698906989169892698936989469895698966989769898698996990069901699026990369904699056990669907699086990969910699116991269913699146991569916699176991869919699206992169922699236992469925699266992769928699296993069931699326993369934699356993669937699386993969940699416994269943699446994569946699476994869949699506995169952699536995469955699566995769958699596996069961699626996369964699656996669967699686996969970699716997269973699746997569976699776997869979699806998169982699836998469985699866998769988699896999069991699926999369994699956999669997699986999970000700017000270003700047000570006700077000870009700107001170012700137001470015700167001770018700197002070021700227002370024700257002670027700287002970030700317003270033700347003570036700377003870039700407004170042700437004470045700467004770048700497005070051700527005370054700557005670057700587005970060700617006270063700647006570066700677006870069700707007170072700737007470075700767007770078700797008070081700827008370084700857008670087700887008970090700917009270093700947009570096700977009870099701007010170102701037010470105701067010770108701097011070111701127011370114701157011670117701187011970120701217012270123701247012570126701277012870129701307013170132701337013470135701367013770138701397014070141701427014370144701457014670147701487014970150701517015270153701547015570156701577015870159701607016170162701637016470165701667016770168701697017070171701727017370174701757017670177701787017970180701817018270183701847018570186701877018870189701907019170192701937019470195701967019770198701997020070201702027020370204702057020670207702087020970210702117021270213702147021570216702177021870219702207022170222702237022470225702267022770228702297023070231702327023370234702357023670237702387023970240702417024270243702447024570246702477024870249702507025170252702537025470255702567025770258702597026070261702627026370264702657026670267702687026970270702717027270273702747027570276702777027870279702807028170282702837028470285702867028770288702897029070291702927029370294702957029670297702987029970300703017030270303703047030570306703077030870309703107031170312703137031470315703167031770318703197032070321703227032370324703257032670327703287032970330703317033270333703347033570336703377033870339703407034170342703437034470345703467034770348703497035070351703527035370354703557035670357703587035970360703617036270363703647036570366703677036870369703707037170372703737037470375703767037770378703797038070381703827038370384703857038670387703887038970390703917039270393703947039570396703977039870399704007040170402704037040470405704067040770408704097041070411704127041370414704157041670417704187041970420704217042270423704247042570426704277042870429704307043170432704337043470435704367043770438704397044070441704427044370444704457044670447704487044970450704517045270453704547045570456704577045870459704607046170462704637046470465704667046770468704697047070471704727047370474704757047670477704787047970480704817048270483704847048570486704877048870489704907049170492704937049470495704967049770498704997050070501705027050370504705057050670507705087050970510705117051270513705147051570516705177051870519705207052170522705237052470525705267052770528705297053070531705327053370534705357053670537705387053970540705417054270543705447054570546705477054870549705507055170552705537055470555705567055770558705597056070561705627056370564705657056670567705687056970570705717057270573705747057570576705777057870579705807058170582705837058470585705867058770588705897059070591705927059370594705957059670597705987059970600706017060270603706047060570606706077060870609706107061170612706137061470615706167061770618706197062070621706227062370624706257062670627706287062970630706317063270633706347063570636706377063870639706407064170642706437064470645706467064770648706497065070651706527065370654706557065670657706587065970660706617066270663706647066570666706677066870669706707067170672706737067470675706767067770678706797068070681706827068370684706857068670687706887068970690706917069270693706947069570696706977069870699707007070170702707037070470705707067070770708707097071070711707127071370714707157071670717707187071970720707217072270723707247072570726707277072870729707307073170732707337073470735707367073770738707397074070741707427074370744707457074670747707487074970750707517075270753707547075570756707577075870759707607076170762707637076470765707667076770768707697077070771707727077370774707757077670777707787077970780707817078270783707847078570786707877078870789707907079170792707937079470795707967079770798707997080070801708027080370804708057080670807708087080970810708117081270813708147081570816708177081870819708207082170822708237082470825708267082770828708297083070831708327083370834708357083670837708387083970840708417084270843708447084570846708477084870849708507085170852708537085470855708567085770858708597086070861708627086370864708657086670867708687086970870708717087270873708747087570876708777087870879708807088170882708837088470885708867088770888708897089070891708927089370894708957089670897708987089970900709017090270903709047090570906709077090870909709107091170912709137091470915709167091770918709197092070921709227092370924709257092670927709287092970930709317093270933709347093570936709377093870939709407094170942709437094470945709467094770948709497095070951709527095370954709557095670957709587095970960709617096270963709647096570966709677096870969709707097170972709737097470975709767097770978709797098070981709827098370984709857098670987709887098970990709917099270993709947099570996709977099870999710007100171002710037100471005710067100771008710097101071011710127101371014710157101671017710187101971020710217102271023710247102571026710277102871029710307103171032710337103471035710367103771038710397104071041710427104371044710457104671047710487104971050710517105271053710547105571056710577105871059710607106171062710637106471065710667106771068710697107071071710727107371074710757107671077710787107971080710817108271083710847108571086710877108871089710907109171092710937109471095710967109771098710997110071101711027110371104711057110671107711087110971110711117111271113711147111571116711177111871119711207112171122711237112471125711267112771128711297113071131711327113371134711357113671137711387113971140711417114271143711447114571146711477114871149711507115171152711537115471155711567115771158711597116071161711627116371164711657116671167711687116971170711717117271173711747117571176711777117871179711807118171182711837118471185711867118771188711897119071191711927119371194711957119671197711987119971200712017120271203712047120571206712077120871209712107121171212712137121471215712167121771218712197122071221712227122371224712257122671227712287122971230712317123271233712347123571236712377123871239712407124171242712437124471245712467124771248712497125071251712527125371254712557125671257712587125971260712617126271263712647126571266712677126871269712707127171272712737127471275712767127771278712797128071281712827128371284712857128671287712887128971290712917129271293712947129571296712977129871299713007130171302713037130471305713067130771308713097131071311713127131371314713157131671317713187131971320713217132271323713247132571326713277132871329713307133171332713337133471335713367133771338713397134071341713427134371344713457134671347713487134971350713517135271353713547135571356713577135871359713607136171362713637136471365713667136771368713697137071371713727137371374713757137671377713787137971380713817138271383713847138571386713877138871389713907139171392713937139471395713967139771398713997140071401714027140371404714057140671407714087140971410714117141271413714147141571416714177141871419714207142171422714237142471425714267142771428714297143071431714327143371434714357143671437714387143971440714417144271443714447144571446714477144871449714507145171452714537145471455714567145771458714597146071461714627146371464714657146671467714687146971470714717147271473714747147571476714777147871479714807148171482714837148471485714867148771488714897149071491714927149371494714957149671497714987149971500715017150271503715047150571506715077150871509715107151171512715137151471515715167151771518715197152071521715227152371524715257152671527715287152971530715317153271533715347153571536715377153871539715407154171542715437154471545715467154771548715497155071551715527155371554715557155671557715587155971560715617156271563715647156571566715677156871569715707157171572715737157471575715767157771578715797158071581715827158371584715857158671587715887158971590715917159271593715947159571596715977159871599716007160171602716037160471605716067160771608716097161071611716127161371614716157161671617716187161971620716217162271623716247162571626716277162871629716307163171632716337163471635716367163771638716397164071641716427164371644716457164671647716487164971650716517165271653716547165571656716577165871659716607166171662716637166471665716667166771668716697167071671716727167371674716757167671677716787167971680716817168271683716847168571686716877168871689716907169171692716937169471695716967169771698716997170071701717027170371704717057170671707717087170971710717117171271713717147171571716717177171871719717207172171722717237172471725717267172771728717297173071731717327173371734717357173671737717387173971740717417174271743717447174571746717477174871749717507175171752717537175471755717567175771758717597176071761717627176371764717657176671767717687176971770717717177271773717747177571776717777177871779717807178171782717837178471785717867178771788717897179071791717927179371794717957179671797717987179971800718017180271803718047180571806718077180871809718107181171812718137181471815718167181771818718197182071821718227182371824718257182671827718287182971830718317183271833718347183571836718377183871839718407184171842718437184471845718467184771848718497185071851718527185371854718557185671857718587185971860718617186271863718647186571866718677186871869718707187171872718737187471875718767187771878718797188071881718827188371884718857188671887718887188971890718917189271893718947189571896718977189871899719007190171902719037190471905719067190771908719097191071911719127191371914719157191671917719187191971920719217192271923719247192571926719277192871929719307193171932719337193471935719367193771938719397194071941719427194371944719457194671947719487194971950719517195271953719547195571956719577195871959719607196171962719637196471965719667196771968719697197071971719727197371974719757197671977719787197971980719817198271983719847198571986719877198871989719907199171992719937199471995719967199771998719997200072001720027200372004720057200672007720087200972010720117201272013720147201572016720177201872019720207202172022720237202472025720267202772028720297203072031720327203372034720357203672037720387203972040720417204272043720447204572046720477204872049720507205172052720537205472055720567205772058720597206072061720627206372064720657206672067720687206972070720717207272073720747207572076720777207872079720807208172082720837208472085720867208772088720897209072091720927209372094720957209672097720987209972100721017210272103721047210572106721077210872109721107211172112721137211472115721167211772118721197212072121721227212372124721257212672127721287212972130721317213272133721347213572136721377213872139721407214172142721437214472145721467214772148721497215072151721527215372154721557215672157721587215972160721617216272163721647216572166721677216872169721707217172172721737217472175721767217772178721797218072181721827218372184721857218672187721887218972190721917219272193721947219572196721977219872199722007220172202722037220472205722067220772208722097221072211722127221372214722157221672217722187221972220722217222272223722247222572226722277222872229722307223172232722337223472235722367223772238722397224072241722427224372244722457224672247722487224972250722517225272253722547225572256722577225872259722607226172262722637226472265722667226772268722697227072271722727227372274722757227672277722787227972280722817228272283722847228572286722877228872289722907229172292722937229472295722967229772298722997230072301723027230372304723057230672307723087230972310723117231272313723147231572316723177231872319723207232172322723237232472325723267232772328723297233072331723327233372334723357233672337723387233972340723417234272343723447234572346723477234872349723507235172352723537235472355723567235772358723597236072361723627236372364723657236672367723687236972370723717237272373723747237572376723777237872379723807238172382723837238472385723867238772388723897239072391723927239372394723957239672397723987239972400724017240272403724047240572406724077240872409724107241172412724137241472415724167241772418724197242072421724227242372424724257242672427724287242972430724317243272433724347243572436724377243872439724407244172442724437244472445724467244772448724497245072451724527245372454724557245672457724587245972460724617246272463724647246572466724677246872469724707247172472724737247472475724767247772478724797248072481724827248372484724857248672487724887248972490724917249272493724947249572496724977249872499725007250172502725037250472505725067250772508725097251072511725127251372514725157251672517725187251972520725217252272523725247252572526725277252872529725307253172532725337253472535725367253772538725397254072541725427254372544725457254672547725487254972550725517255272553725547255572556725577255872559725607256172562725637256472565725667256772568725697257072571725727257372574725757257672577725787257972580725817258272583725847258572586725877258872589725907259172592725937259472595725967259772598725997260072601726027260372604726057260672607726087260972610726117261272613726147261572616726177261872619726207262172622726237262472625726267262772628726297263072631726327263372634726357263672637726387263972640726417264272643726447264572646726477264872649726507265172652726537265472655726567265772658726597266072661726627266372664726657266672667726687266972670726717267272673726747267572676726777267872679726807268172682726837268472685726867268772688726897269072691726927269372694726957269672697726987269972700727017270272703727047270572706727077270872709727107271172712727137271472715727167271772718727197272072721727227272372724727257272672727727287272972730727317273272733727347273572736727377273872739727407274172742727437274472745727467274772748727497275072751727527275372754727557275672757727587275972760727617276272763727647276572766727677276872769727707277172772727737277472775727767277772778727797278072781727827278372784727857278672787727887278972790727917279272793727947279572796727977279872799728007280172802728037280472805728067280772808728097281072811728127281372814728157281672817728187281972820728217282272823728247282572826728277282872829728307283172832728337283472835728367283772838728397284072841728427284372844728457284672847728487284972850728517285272853728547285572856728577285872859728607286172862728637286472865728667286772868728697287072871728727287372874728757287672877728787287972880728817288272883728847288572886728877288872889728907289172892728937289472895728967289772898728997290072901729027290372904729057290672907729087290972910729117291272913729147291572916729177291872919729207292172922729237292472925729267292772928729297293072931729327293372934729357293672937729387293972940729417294272943729447294572946729477294872949729507295172952729537295472955729567295772958729597296072961729627296372964729657296672967729687296972970729717297272973729747297572976729777297872979729807298172982729837298472985729867298772988729897299072991729927299372994729957299672997729987299973000730017300273003730047300573006730077300873009730107301173012730137301473015730167301773018730197302073021730227302373024730257302673027730287302973030730317303273033730347303573036730377303873039730407304173042730437304473045730467304773048730497305073051730527305373054730557305673057730587305973060730617306273063730647306573066730677306873069730707307173072730737307473075730767307773078730797308073081730827308373084730857308673087730887308973090730917309273093730947309573096730977309873099731007310173102731037310473105731067310773108731097311073111731127311373114731157311673117731187311973120731217312273123731247312573126731277312873129731307313173132731337313473135731367313773138731397314073141731427314373144731457314673147731487314973150731517315273153731547315573156731577315873159731607316173162731637316473165731667316773168731697317073171731727317373174731757317673177731787317973180731817318273183731847318573186731877318873189731907319173192731937319473195731967319773198731997320073201732027320373204732057320673207732087320973210732117321273213732147321573216732177321873219732207322173222732237322473225732267322773228732297323073231732327323373234732357323673237732387323973240732417324273243732447324573246732477324873249732507325173252732537325473255732567325773258732597326073261732627326373264732657326673267732687326973270732717327273273732747327573276732777327873279732807328173282732837328473285732867328773288732897329073291732927329373294732957329673297732987329973300733017330273303733047330573306733077330873309733107331173312733137331473315733167331773318733197332073321733227332373324733257332673327733287332973330733317333273333733347333573336733377333873339733407334173342733437334473345733467334773348733497335073351733527335373354733557335673357733587335973360733617336273363733647336573366733677336873369733707337173372733737337473375733767337773378733797338073381733827338373384733857338673387733887338973390733917339273393733947339573396733977339873399734007340173402734037340473405734067340773408734097341073411734127341373414734157341673417734187341973420734217342273423734247342573426734277342873429734307343173432734337343473435734367343773438734397344073441734427344373444734457344673447734487344973450734517345273453734547345573456734577345873459734607346173462734637346473465734667346773468734697347073471734727347373474734757347673477734787347973480734817348273483734847348573486734877348873489734907349173492734937349473495734967349773498734997350073501735027350373504735057350673507735087350973510735117351273513735147351573516735177351873519735207352173522735237352473525735267352773528735297353073531735327353373534735357353673537735387353973540735417354273543735447354573546735477354873549735507355173552735537355473555735567355773558735597356073561735627356373564735657356673567735687356973570735717357273573735747357573576735777357873579735807358173582735837358473585735867358773588735897359073591735927359373594735957359673597735987359973600736017360273603736047360573606736077360873609736107361173612736137361473615736167361773618736197362073621736227362373624736257362673627736287362973630736317363273633736347363573636736377363873639736407364173642736437364473645736467364773648736497365073651736527365373654736557365673657736587365973660736617366273663736647366573666736677366873669736707367173672736737367473675736767367773678736797368073681736827368373684736857368673687736887368973690736917369273693736947369573696736977369873699737007370173702737037370473705737067370773708737097371073711737127371373714737157371673717737187371973720737217372273723737247372573726737277372873729737307373173732737337373473735737367373773738737397374073741737427374373744737457374673747737487374973750737517375273753737547375573756737577375873759737607376173762737637376473765737667376773768737697377073771737727377373774737757377673777737787377973780737817378273783737847378573786737877378873789737907379173792737937379473795737967379773798737997380073801738027380373804738057380673807738087380973810738117381273813738147381573816738177381873819738207382173822738237382473825738267382773828738297383073831738327383373834738357383673837738387383973840738417384273843738447384573846738477384873849738507385173852738537385473855738567385773858738597386073861738627386373864738657386673867738687386973870738717387273873738747387573876738777387873879738807388173882738837388473885738867388773888738897389073891738927389373894738957389673897738987389973900739017390273903739047390573906739077390873909739107391173912739137391473915739167391773918739197392073921739227392373924739257392673927739287392973930739317393273933739347393573936739377393873939739407394173942739437394473945739467394773948739497395073951739527395373954739557395673957739587395973960739617396273963739647396573966739677396873969739707397173972739737397473975739767397773978739797398073981739827398373984739857398673987739887398973990739917399273993739947399573996739977399873999740007400174002740037400474005740067400774008740097401074011740127401374014740157401674017740187401974020740217402274023740247402574026740277402874029740307403174032740337403474035740367403774038740397404074041740427404374044740457404674047740487404974050740517405274053740547405574056740577405874059740607406174062740637406474065740667406774068740697407074071740727407374074740757407674077740787407974080740817408274083740847408574086740877408874089740907409174092740937409474095740967409774098740997410074101741027410374104741057410674107741087410974110741117411274113741147411574116741177411874119741207412174122741237412474125741267412774128741297413074131741327413374134741357413674137741387413974140741417414274143741447414574146741477414874149741507415174152741537415474155741567415774158741597416074161741627416374164741657416674167741687416974170741717417274173741747417574176741777417874179741807418174182741837418474185741867418774188741897419074191741927419374194741957419674197741987419974200742017420274203742047420574206742077420874209742107421174212742137421474215742167421774218742197422074221742227422374224742257422674227742287422974230742317423274233742347423574236742377423874239742407424174242742437424474245742467424774248742497425074251742527425374254742557425674257742587425974260742617426274263742647426574266742677426874269742707427174272742737427474275742767427774278742797428074281742827428374284742857428674287742887428974290742917429274293742947429574296742977429874299743007430174302743037430474305743067430774308743097431074311743127431374314743157431674317743187431974320743217432274323743247432574326743277432874329743307433174332743337433474335743367433774338743397434074341743427434374344743457434674347743487434974350743517435274353743547435574356743577435874359743607436174362743637436474365743667436774368743697437074371743727437374374743757437674377743787437974380743817438274383743847438574386743877438874389743907439174392743937439474395743967439774398743997440074401744027440374404744057440674407744087440974410744117441274413744147441574416744177441874419744207442174422744237442474425744267442774428744297443074431744327443374434744357443674437744387443974440744417444274443744447444574446744477444874449744507445174452744537445474455744567445774458744597446074461744627446374464744657446674467744687446974470744717447274473744747447574476744777447874479744807448174482744837448474485744867448774488744897449074491744927449374494744957449674497744987449974500745017450274503745047450574506745077450874509745107451174512745137451474515745167451774518745197452074521745227452374524745257452674527745287452974530745317453274533745347453574536745377453874539745407454174542745437454474545745467454774548745497455074551745527455374554745557455674557745587455974560745617456274563745647456574566745677456874569745707457174572745737457474575745767457774578745797458074581745827458374584745857458674587745887458974590745917459274593745947459574596745977459874599746007460174602746037460474605746067460774608746097461074611746127461374614746157461674617746187461974620746217462274623746247462574626746277462874629746307463174632746337463474635746367463774638746397464074641746427464374644746457464674647746487464974650746517465274653746547465574656746577465874659746607466174662746637466474665746667466774668746697467074671746727467374674746757467674677746787467974680746817468274683746847468574686746877468874689746907469174692746937469474695746967469774698746997470074701747027470374704747057470674707747087470974710747117471274713747147471574716747177471874719747207472174722747237472474725747267472774728747297473074731747327473374734747357473674737747387473974740747417474274743747447474574746747477474874749747507475174752747537475474755747567475774758747597476074761747627476374764747657476674767747687476974770747717477274773747747477574776747777477874779747807478174782747837478474785747867478774788747897479074791747927479374794747957479674797747987479974800748017480274803748047480574806748077480874809748107481174812748137481474815748167481774818748197482074821748227482374824748257482674827748287482974830748317483274833748347483574836748377483874839748407484174842748437484474845748467484774848748497485074851748527485374854748557485674857748587485974860748617486274863748647486574866748677486874869748707487174872748737487474875748767487774878748797488074881748827488374884748857488674887748887488974890748917489274893748947489574896748977489874899749007490174902749037490474905749067490774908749097491074911749127491374914749157491674917749187491974920749217492274923749247492574926749277492874929749307493174932749337493474935749367493774938749397494074941749427494374944749457494674947749487494974950749517495274953749547495574956749577495874959749607496174962749637496474965749667496774968749697497074971749727497374974749757497674977749787497974980749817498274983749847498574986749877498874989749907499174992749937499474995749967499774998749997500075001750027500375004750057500675007750087500975010750117501275013750147501575016750177501875019750207502175022750237502475025750267502775028750297503075031750327503375034750357503675037750387503975040750417504275043750447504575046750477504875049750507505175052750537505475055750567505775058750597506075061750627506375064750657506675067750687506975070750717507275073750747507575076750777507875079750807508175082750837508475085750867508775088750897509075091750927509375094750957509675097750987509975100751017510275103751047510575106751077510875109751107511175112751137511475115751167511775118751197512075121751227512375124751257512675127751287512975130751317513275133751347513575136751377513875139751407514175142751437514475145751467514775148751497515075151751527515375154751557515675157751587515975160751617516275163751647516575166751677516875169751707517175172751737517475175751767517775178751797518075181751827518375184751857518675187751887518975190751917519275193751947519575196751977519875199752007520175202752037520475205752067520775208752097521075211752127521375214752157521675217752187521975220752217522275223752247522575226752277522875229752307523175232752337523475235752367523775238752397524075241752427524375244752457524675247752487524975250752517525275253752547525575256752577525875259752607526175262752637526475265752667526775268752697527075271752727527375274752757527675277752787527975280752817528275283752847528575286752877528875289752907529175292752937529475295752967529775298752997530075301753027530375304753057530675307753087530975310753117531275313753147531575316753177531875319753207532175322753237532475325753267532775328753297533075331753327533375334753357533675337753387533975340753417534275343753447534575346753477534875349753507535175352753537535475355753567535775358753597536075361753627536375364753657536675367753687536975370753717537275373753747537575376753777537875379753807538175382753837538475385753867538775388753897539075391753927539375394753957539675397753987539975400754017540275403754047540575406754077540875409754107541175412754137541475415754167541775418754197542075421754227542375424754257542675427754287542975430754317543275433754347543575436754377543875439754407544175442754437544475445754467544775448754497545075451754527545375454754557545675457754587545975460754617546275463754647546575466754677546875469754707547175472754737547475475754767547775478754797548075481754827548375484754857548675487754887548975490754917549275493754947549575496754977549875499755007550175502755037550475505755067550775508755097551075511755127551375514755157551675517755187551975520755217552275523755247552575526755277552875529755307553175532755337553475535755367553775538755397554075541755427554375544755457554675547755487554975550755517555275553755547555575556755577555875559755607556175562755637556475565755667556775568755697557075571755727557375574755757557675577755787557975580755817558275583755847558575586755877558875589755907559175592755937559475595755967559775598755997560075601756027560375604756057560675607756087560975610756117561275613756147561575616756177561875619756207562175622756237562475625756267562775628756297563075631756327563375634756357563675637756387563975640756417564275643756447564575646756477564875649756507565175652756537565475655756567565775658756597566075661756627566375664756657566675667756687566975670756717567275673756747567575676756777567875679756807568175682756837568475685756867568775688756897569075691756927569375694756957569675697756987569975700757017570275703757047570575706757077570875709757107571175712757137571475715757167571775718757197572075721757227572375724757257572675727757287572975730757317573275733757347573575736757377573875739757407574175742757437574475745757467574775748757497575075751757527575375754757557575675757757587575975760757617576275763757647576575766757677576875769757707577175772757737577475775757767577775778757797578075781757827578375784757857578675787757887578975790757917579275793757947579575796757977579875799758007580175802758037580475805758067580775808758097581075811758127581375814758157581675817758187581975820758217582275823758247582575826758277582875829758307583175832758337583475835758367583775838758397584075841758427584375844758457584675847758487584975850758517585275853758547585575856758577585875859758607586175862758637586475865758667586775868758697587075871758727587375874758757587675877758787587975880758817588275883758847588575886758877588875889758907589175892758937589475895758967589775898758997590075901759027590375904759057590675907759087590975910759117591275913759147591575916759177591875919759207592175922759237592475925759267592775928759297593075931759327593375934759357593675937759387593975940759417594275943759447594575946759477594875949759507595175952759537595475955759567595775958759597596075961759627596375964759657596675967759687596975970759717597275973759747597575976759777597875979759807598175982759837598475985759867598775988759897599075991759927599375994759957599675997759987599976000760017600276003760047600576006760077600876009760107601176012760137601476015760167601776018760197602076021760227602376024760257602676027760287602976030760317603276033760347603576036760377603876039760407604176042760437604476045760467604776048760497605076051760527605376054760557605676057760587605976060760617606276063760647606576066760677606876069760707607176072760737607476075760767607776078760797608076081760827608376084760857608676087760887608976090760917609276093760947609576096760977609876099761007610176102761037610476105761067610776108761097611076111761127611376114761157611676117761187611976120761217612276123761247612576126761277612876129761307613176132761337613476135761367613776138761397614076141761427614376144761457614676147761487614976150761517615276153761547615576156761577615876159761607616176162761637616476165761667616776168761697617076171761727617376174761757617676177761787617976180761817618276183761847618576186761877618876189761907619176192761937619476195761967619776198761997620076201762027620376204762057620676207762087620976210762117621276213762147621576216762177621876219762207622176222762237622476225762267622776228762297623076231762327623376234762357623676237762387623976240762417624276243762447624576246762477624876249762507625176252762537625476255762567625776258762597626076261762627626376264762657626676267762687626976270762717627276273762747627576276762777627876279762807628176282762837628476285762867628776288762897629076291762927629376294762957629676297762987629976300763017630276303763047630576306763077630876309763107631176312763137631476315763167631776318763197632076321763227632376324763257632676327763287632976330763317633276333763347633576336763377633876339763407634176342763437634476345763467634776348763497635076351763527635376354763557635676357763587635976360763617636276363763647636576366763677636876369763707637176372763737637476375763767637776378763797638076381763827638376384763857638676387763887638976390763917639276393763947639576396763977639876399764007640176402764037640476405764067640776408764097641076411764127641376414764157641676417764187641976420764217642276423764247642576426764277642876429764307643176432764337643476435764367643776438764397644076441764427644376444764457644676447764487644976450764517645276453764547645576456764577645876459764607646176462764637646476465764667646776468764697647076471764727647376474764757647676477764787647976480764817648276483764847648576486764877648876489764907649176492764937649476495764967649776498764997650076501765027650376504765057650676507765087650976510765117651276513765147651576516765177651876519765207652176522765237652476525765267652776528765297653076531765327653376534765357653676537765387653976540765417654276543765447654576546765477654876549765507655176552765537655476555765567655776558765597656076561765627656376564765657656676567765687656976570765717657276573765747657576576765777657876579765807658176582765837658476585765867658776588765897659076591765927659376594765957659676597765987659976600766017660276603766047660576606766077660876609766107661176612766137661476615766167661776618766197662076621766227662376624766257662676627766287662976630766317663276633766347663576636766377663876639766407664176642766437664476645766467664776648766497665076651766527665376654766557665676657766587665976660766617666276663766647666576666766677666876669766707667176672766737667476675766767667776678766797668076681766827668376684766857668676687766887668976690766917669276693766947669576696766977669876699767007670176702767037670476705767067670776708767097671076711767127671376714767157671676717767187671976720767217672276723767247672576726767277672876729767307673176732767337673476735767367673776738767397674076741767427674376744767457674676747767487674976750767517675276753767547675576756767577675876759767607676176762767637676476765767667676776768767697677076771767727677376774767757677676777767787677976780767817678276783767847678576786767877678876789767907679176792767937679476795767967679776798767997680076801768027680376804768057680676807768087680976810768117681276813768147681576816768177681876819768207682176822768237682476825768267682776828768297683076831768327683376834768357683676837768387683976840768417684276843768447684576846768477684876849768507685176852768537685476855768567685776858768597686076861768627686376864768657686676867768687686976870768717687276873768747687576876768777687876879768807688176882768837688476885768867688776888768897689076891768927689376894768957689676897768987689976900769017690276903769047690576906769077690876909769107691176912769137691476915769167691776918769197692076921769227692376924769257692676927769287692976930769317693276933769347693576936769377693876939769407694176942769437694476945769467694776948769497695076951769527695376954769557695676957769587695976960769617696276963769647696576966769677696876969769707697176972769737697476975769767697776978769797698076981769827698376984769857698676987769887698976990769917699276993769947699576996769977699876999770007700177002770037700477005770067700777008770097701077011770127701377014770157701677017770187701977020770217702277023770247702577026770277702877029770307703177032770337703477035770367703777038770397704077041770427704377044770457704677047770487704977050770517705277053770547705577056770577705877059770607706177062770637706477065770667706777068770697707077071770727707377074770757707677077770787707977080770817708277083770847708577086770877708877089770907709177092770937709477095770967709777098770997710077101771027710377104771057710677107771087710977110771117711277113771147711577116771177711877119771207712177122771237712477125771267712777128771297713077131771327713377134771357713677137771387713977140771417714277143771447714577146771477714877149771507715177152771537715477155771567715777158771597716077161771627716377164771657716677167771687716977170771717717277173771747717577176771777717877179771807718177182771837718477185771867718777188771897719077191771927719377194771957719677197771987719977200772017720277203772047720577206772077720877209772107721177212772137721477215772167721777218772197722077221772227722377224772257722677227772287722977230772317723277233772347723577236772377723877239772407724177242772437724477245772467724777248772497725077251772527725377254772557725677257772587725977260772617726277263772647726577266772677726877269772707727177272772737727477275772767727777278772797728077281772827728377284772857728677287772887728977290772917729277293772947729577296772977729877299773007730177302773037730477305773067730777308773097731077311773127731377314773157731677317773187731977320773217732277323773247732577326773277732877329773307733177332773337733477335773367733777338773397734077341773427734377344773457734677347773487734977350773517735277353773547735577356773577735877359773607736177362773637736477365773667736777368773697737077371773727737377374773757737677377773787737977380773817738277383773847738577386773877738877389773907739177392773937739477395773967739777398773997740077401774027740377404774057740677407774087740977410774117741277413774147741577416774177741877419774207742177422774237742477425774267742777428774297743077431774327743377434774357743677437774387743977440774417744277443774447744577446774477744877449774507745177452774537745477455774567745777458774597746077461774627746377464774657746677467774687746977470774717747277473774747747577476774777747877479774807748177482774837748477485774867748777488774897749077491774927749377494774957749677497774987749977500775017750277503775047750577506775077750877509775107751177512775137751477515775167751777518775197752077521775227752377524775257752677527775287752977530775317753277533775347753577536775377753877539775407754177542775437754477545775467754777548775497755077551775527755377554775557755677557775587755977560775617756277563775647756577566775677756877569775707757177572775737757477575775767757777578775797758077581775827758377584775857758677587775887758977590775917759277593775947759577596775977759877599776007760177602776037760477605776067760777608776097761077611776127761377614776157761677617776187761977620776217762277623776247762577626776277762877629776307763177632776337763477635776367763777638776397764077641776427764377644776457764677647776487764977650776517765277653776547765577656776577765877659776607766177662776637766477665776667766777668776697767077671776727767377674776757767677677776787767977680776817768277683776847768577686776877768877689776907769177692776937769477695776967769777698776997770077701777027770377704777057770677707777087770977710777117771277713777147771577716777177771877719777207772177722777237772477725777267772777728777297773077731777327773377734777357773677737777387773977740777417774277743777447774577746777477774877749777507775177752777537775477755777567775777758777597776077761777627776377764777657776677767777687776977770777717777277773777747777577776777777777877779777807778177782777837778477785777867778777788777897779077791777927779377794777957779677797777987779977800778017780277803778047780577806778077780877809778107781177812778137781477815778167781777818778197782077821778227782377824778257782677827778287782977830778317783277833778347783577836778377783877839778407784177842778437784477845778467784777848778497785077851778527785377854778557785677857778587785977860778617786277863778647786577866778677786877869778707787177872778737787477875778767787777878778797788077881778827788377884778857788677887778887788977890778917789277893778947789577896778977789877899779007790177902779037790477905779067790777908779097791077911779127791377914779157791677917779187791977920779217792277923779247792577926779277792877929779307793177932779337793477935779367793777938779397794077941779427794377944779457794677947779487794977950779517795277953779547795577956779577795877959779607796177962779637796477965779667796777968779697797077971779727797377974779757797677977779787797977980779817798277983779847798577986779877798877989779907799177992779937799477995779967799777998779997800078001780027800378004780057800678007780087800978010780117801278013780147801578016780177801878019780207802178022780237802478025780267802778028780297803078031780327803378034780357803678037780387803978040780417804278043780447804578046780477804878049780507805178052780537805478055780567805778058780597806078061780627806378064780657806678067780687806978070780717807278073780747807578076780777807878079780807808178082780837808478085780867808778088780897809078091780927809378094780957809678097780987809978100781017810278103781047810578106781077810878109781107811178112781137811478115781167811778118781197812078121781227812378124781257812678127781287812978130781317813278133781347813578136781377813878139781407814178142781437814478145781467814778148781497815078151781527815378154781557815678157781587815978160781617816278163781647816578166781677816878169781707817178172781737817478175781767817778178781797818078181781827818378184781857818678187781887818978190781917819278193781947819578196781977819878199782007820178202782037820478205782067820778208782097821078211782127821378214782157821678217782187821978220782217822278223782247822578226782277822878229782307823178232782337823478235782367823778238782397824078241782427824378244782457824678247782487824978250782517825278253782547825578256782577825878259782607826178262782637826478265782667826778268782697827078271782727827378274782757827678277782787827978280782817828278283782847828578286782877828878289782907829178292782937829478295782967829778298782997830078301783027830378304783057830678307783087830978310783117831278313783147831578316783177831878319783207832178322783237832478325783267832778328783297833078331783327833378334783357833678337783387833978340783417834278343783447834578346783477834878349783507835178352783537835478355783567835778358783597836078361783627836378364783657836678367783687836978370783717837278373783747837578376783777837878379783807838178382783837838478385783867838778388783897839078391783927839378394783957839678397783987839978400784017840278403784047840578406784077840878409784107841178412784137841478415784167841778418784197842078421784227842378424784257842678427784287842978430784317843278433784347843578436784377843878439784407844178442784437844478445784467844778448784497845078451784527845378454784557845678457784587845978460784617846278463784647846578466784677846878469784707847178472784737847478475784767847778478784797848078481784827848378484784857848678487784887848978490784917849278493784947849578496784977849878499785007850178502785037850478505785067850778508785097851078511785127851378514785157851678517785187851978520785217852278523785247852578526785277852878529785307853178532785337853478535785367853778538785397854078541785427854378544785457854678547785487854978550785517855278553785547855578556785577855878559785607856178562785637856478565785667856778568785697857078571785727857378574785757857678577785787857978580785817858278583785847858578586785877858878589785907859178592785937859478595785967859778598785997860078601786027860378604786057860678607786087860978610786117861278613786147861578616786177861878619786207862178622786237862478625786267862778628786297863078631786327863378634786357863678637786387863978640786417864278643786447864578646786477864878649786507865178652786537865478655786567865778658786597866078661786627866378664786657866678667786687866978670786717867278673786747867578676786777867878679786807868178682786837868478685786867868778688786897869078691786927869378694786957869678697786987869978700787017870278703787047870578706787077870878709787107871178712787137871478715787167871778718787197872078721787227872378724787257872678727787287872978730787317873278733787347873578736787377873878739787407874178742787437874478745787467874778748787497875078751787527875378754787557875678757787587875978760787617876278763787647876578766787677876878769787707877178772787737877478775787767877778778787797878078781787827878378784787857878678787787887878978790787917879278793787947879578796787977879878799788007880178802788037880478805788067880778808788097881078811788127881378814788157881678817788187881978820788217882278823788247882578826788277882878829788307883178832788337883478835788367883778838788397884078841788427884378844788457884678847788487884978850788517885278853788547885578856788577885878859788607886178862788637886478865788667886778868788697887078871788727887378874788757887678877788787887978880788817888278883788847888578886788877888878889788907889178892788937889478895788967889778898788997890078901789027890378904789057890678907789087890978910789117891278913789147891578916789177891878919789207892178922789237892478925789267892778928789297893078931789327893378934789357893678937789387893978940789417894278943789447894578946789477894878949789507895178952789537895478955789567895778958789597896078961789627896378964789657896678967789687896978970789717897278973789747897578976789777897878979789807898178982789837898478985789867898778988789897899078991789927899378994789957899678997789987899979000790017900279003790047900579006790077900879009790107901179012790137901479015790167901779018790197902079021790227902379024790257902679027790287902979030790317903279033790347903579036790377903879039790407904179042790437904479045790467904779048790497905079051790527905379054790557905679057790587905979060790617906279063790647906579066790677906879069790707907179072790737907479075790767907779078790797908079081790827908379084790857908679087790887908979090790917909279093790947909579096790977909879099791007910179102791037910479105791067910779108791097911079111791127911379114791157911679117791187911979120791217912279123791247912579126791277912879129791307913179132791337913479135791367913779138791397914079141791427914379144791457914679147791487914979150791517915279153791547915579156791577915879159791607916179162791637916479165791667916779168791697917079171791727917379174791757917679177791787917979180791817918279183791847918579186791877918879189791907919179192791937919479195791967919779198791997920079201792027920379204792057920679207792087920979210792117921279213792147921579216792177921879219792207922179222792237922479225792267922779228792297923079231792327923379234792357923679237792387923979240792417924279243792447924579246792477924879249792507925179252792537925479255792567925779258792597926079261792627926379264792657926679267792687926979270792717927279273792747927579276792777927879279792807928179282792837928479285792867928779288792897929079291792927929379294792957929679297792987929979300793017930279303793047930579306793077930879309793107931179312793137931479315793167931779318793197932079321793227932379324793257932679327793287932979330793317933279333793347933579336793377933879339793407934179342793437934479345793467934779348793497935079351793527935379354793557935679357793587935979360793617936279363793647936579366793677936879369793707937179372793737937479375793767937779378793797938079381793827938379384793857938679387793887938979390793917939279393793947939579396793977939879399794007940179402794037940479405794067940779408794097941079411794127941379414794157941679417794187941979420794217942279423794247942579426794277942879429794307943179432794337943479435794367943779438794397944079441794427944379444794457944679447794487944979450794517945279453794547945579456794577945879459794607946179462794637946479465794667946779468794697947079471794727947379474794757947679477794787947979480794817948279483794847948579486794877948879489794907949179492794937949479495794967949779498794997950079501795027950379504795057950679507795087950979510795117951279513795147951579516795177951879519795207952179522795237952479525795267952779528795297953079531795327953379534795357953679537795387953979540795417954279543795447954579546795477954879549795507955179552795537955479555795567955779558795597956079561795627956379564795657956679567795687956979570795717957279573795747957579576795777957879579795807958179582795837958479585795867958779588795897959079591795927959379594795957959679597795987959979600796017960279603796047960579606796077960879609796107961179612796137961479615796167961779618796197962079621796227962379624796257962679627796287962979630796317963279633796347963579636796377963879639796407964179642796437964479645796467964779648796497965079651796527965379654796557965679657796587965979660796617966279663796647966579666796677966879669796707967179672796737967479675796767967779678796797968079681796827968379684796857968679687796887968979690796917969279693796947969579696796977969879699797007970179702797037970479705797067970779708797097971079711797127971379714797157971679717797187971979720797217972279723797247972579726797277972879729797307973179732797337973479735797367973779738797397974079741797427974379744797457974679747797487974979750797517975279753797547975579756797577975879759797607976179762797637976479765797667976779768797697977079771797727977379774797757977679777797787977979780797817978279783797847978579786797877978879789797907979179792797937979479795797967979779798797997980079801798027980379804798057980679807798087980979810798117981279813798147981579816798177981879819798207982179822798237982479825798267982779828798297983079831798327983379834798357983679837798387983979840798417984279843798447984579846798477984879849798507985179852798537985479855798567985779858798597986079861798627986379864798657986679867798687986979870798717987279873798747987579876798777987879879798807988179882798837988479885798867988779888798897989079891798927989379894798957989679897798987989979900799017990279903799047990579906799077990879909799107991179912799137991479915799167991779918799197992079921799227992379924799257992679927799287992979930799317993279933799347993579936799377993879939799407994179942799437994479945799467994779948799497995079951799527995379954799557995679957799587995979960799617996279963799647996579966799677996879969799707997179972799737997479975799767997779978799797998079981799827998379984799857998679987799887998979990799917999279993799947999579996799977999879999800008000180002800038000480005800068000780008800098001080011800128001380014800158001680017800188001980020800218002280023800248002580026800278002880029800308003180032800338003480035800368003780038800398004080041800428004380044800458004680047800488004980050800518005280053800548005580056800578005880059800608006180062800638006480065800668006780068800698007080071800728007380074800758007680077800788007980080800818008280083800848008580086800878008880089800908009180092800938009480095800968009780098800998010080101801028010380104801058010680107801088010980110801118011280113801148011580116801178011880119801208012180122801238012480125801268012780128801298013080131801328013380134801358013680137801388013980140801418014280143801448014580146801478014880149801508015180152801538015480155801568015780158801598016080161801628016380164801658016680167801688016980170801718017280173801748017580176801778017880179801808018180182801838018480185801868018780188801898019080191801928019380194801958019680197801988019980200802018020280203802048020580206802078020880209802108021180212802138021480215802168021780218802198022080221802228022380224802258022680227802288022980230802318023280233802348023580236802378023880239802408024180242802438024480245802468024780248802498025080251802528025380254802558025680257802588025980260802618026280263802648026580266802678026880269802708027180272802738027480275802768027780278802798028080281802828028380284802858028680287802888028980290802918029280293802948029580296802978029880299803008030180302803038030480305803068030780308803098031080311803128031380314803158031680317803188031980320803218032280323803248032580326803278032880329803308033180332803338033480335803368033780338803398034080341803428034380344803458034680347803488034980350803518035280353803548035580356803578035880359803608036180362803638036480365803668036780368803698037080371803728037380374803758037680377803788037980380803818038280383803848038580386803878038880389803908039180392803938039480395803968039780398803998040080401804028040380404804058040680407804088040980410804118041280413804148041580416804178041880419804208042180422804238042480425804268042780428804298043080431804328043380434804358043680437804388043980440804418044280443804448044580446804478044880449804508045180452804538045480455804568045780458804598046080461804628046380464804658046680467804688046980470804718047280473804748047580476804778047880479804808048180482804838048480485804868048780488804898049080491804928049380494804958049680497804988049980500805018050280503805048050580506805078050880509805108051180512805138051480515805168051780518805198052080521805228052380524805258052680527805288052980530805318053280533805348053580536805378053880539805408054180542805438054480545805468054780548805498055080551805528055380554805558055680557805588055980560805618056280563805648056580566805678056880569805708057180572805738057480575805768057780578805798058080581805828058380584805858058680587805888058980590805918059280593805948059580596805978059880599806008060180602806038060480605806068060780608806098061080611806128061380614806158061680617806188061980620806218062280623806248062580626806278062880629806308063180632806338063480635806368063780638806398064080641806428064380644806458064680647806488064980650806518065280653806548065580656806578065880659806608066180662806638066480665806668066780668806698067080671806728067380674806758067680677806788067980680806818068280683806848068580686806878068880689806908069180692806938069480695806968069780698806998070080701807028070380704807058070680707807088070980710807118071280713807148071580716807178071880719807208072180722807238072480725807268072780728807298073080731807328073380734807358073680737807388073980740807418074280743807448074580746807478074880749807508075180752807538075480755807568075780758807598076080761807628076380764807658076680767807688076980770807718077280773807748077580776807778077880779807808078180782807838078480785807868078780788807898079080791807928079380794807958079680797807988079980800808018080280803808048080580806808078080880809808108081180812808138081480815808168081780818808198082080821808228082380824808258082680827808288082980830808318083280833808348083580836808378083880839808408084180842808438084480845808468084780848808498085080851808528085380854808558085680857808588085980860808618086280863808648086580866808678086880869808708087180872808738087480875808768087780878808798088080881808828088380884808858088680887808888088980890808918089280893808948089580896808978089880899809008090180902809038090480905809068090780908809098091080911809128091380914809158091680917809188091980920809218092280923809248092580926809278092880929809308093180932809338093480935809368093780938809398094080941809428094380944809458094680947809488094980950809518095280953809548095580956809578095880959809608096180962809638096480965809668096780968809698097080971809728097380974809758097680977809788097980980809818098280983809848098580986809878098880989809908099180992809938099480995809968099780998809998100081001810028100381004810058100681007810088100981010810118101281013810148101581016810178101881019810208102181022810238102481025810268102781028810298103081031810328103381034810358103681037810388103981040810418104281043810448104581046810478104881049810508105181052810538105481055810568105781058810598106081061810628106381064810658106681067810688106981070810718107281073810748107581076810778107881079810808108181082810838108481085810868108781088810898109081091810928109381094810958109681097810988109981100811018110281103811048110581106811078110881109811108111181112811138111481115811168111781118811198112081121811228112381124811258112681127811288112981130811318113281133811348113581136811378113881139811408114181142811438114481145811468114781148811498115081151811528115381154811558115681157811588115981160811618116281163811648116581166811678116881169811708117181172811738117481175811768117781178811798118081181811828118381184811858118681187811888118981190811918119281193811948119581196811978119881199812008120181202812038120481205812068120781208812098121081211812128121381214812158121681217812188121981220812218122281223812248122581226812278122881229812308123181232812338123481235812368123781238812398124081241812428124381244812458124681247812488124981250812518125281253812548125581256812578125881259812608126181262812638126481265812668126781268812698127081271812728127381274812758127681277812788127981280812818128281283812848128581286812878128881289812908129181292812938129481295812968129781298812998130081301813028130381304813058130681307813088130981310813118131281313813148131581316813178131881319813208132181322813238132481325813268132781328813298133081331813328133381334813358133681337813388133981340813418134281343813448134581346813478134881349813508135181352813538135481355813568135781358813598136081361813628136381364813658136681367813688136981370813718137281373813748137581376813778137881379813808138181382813838138481385813868138781388813898139081391813928139381394813958139681397813988139981400814018140281403814048140581406814078140881409814108141181412814138141481415814168141781418814198142081421814228142381424814258142681427814288142981430814318143281433814348143581436814378143881439814408144181442814438144481445814468144781448814498145081451814528145381454814558145681457814588145981460814618146281463814648146581466814678146881469814708147181472814738147481475814768147781478814798148081481814828148381484814858148681487814888148981490814918149281493814948149581496814978149881499815008150181502815038150481505815068150781508815098151081511815128151381514815158151681517815188151981520815218152281523815248152581526815278152881529815308153181532815338153481535815368153781538815398154081541815428154381544815458154681547815488154981550815518155281553815548155581556815578155881559815608156181562815638156481565815668156781568815698157081571815728157381574815758157681577815788157981580815818158281583815848158581586815878158881589815908159181592815938159481595815968159781598815998160081601816028160381604816058160681607816088160981610816118161281613816148161581616816178161881619816208162181622816238162481625816268162781628816298163081631816328163381634816358163681637816388163981640816418164281643816448164581646816478164881649816508165181652816538165481655816568165781658816598166081661816628166381664816658166681667816688166981670816718167281673816748167581676816778167881679816808168181682816838168481685816868168781688816898169081691816928169381694816958169681697816988169981700817018170281703817048170581706817078170881709817108171181712817138171481715817168171781718817198172081721817228172381724817258172681727817288172981730817318173281733817348173581736817378173881739817408174181742817438174481745817468174781748817498175081751817528175381754817558175681757817588175981760817618176281763817648176581766817678176881769817708177181772817738177481775817768177781778817798178081781817828178381784817858178681787817888178981790817918179281793817948179581796817978179881799818008180181802818038180481805818068180781808818098181081811818128181381814818158181681817818188181981820818218182281823818248182581826818278182881829818308183181832818338183481835818368183781838818398184081841818428184381844818458184681847818488184981850818518185281853818548185581856818578185881859818608186181862818638186481865818668186781868818698187081871818728187381874818758187681877818788187981880818818188281883818848188581886818878188881889818908189181892818938189481895818968189781898818998190081901819028190381904819058190681907819088190981910819118191281913819148191581916819178191881919819208192181922819238192481925819268192781928819298193081931819328193381934819358193681937819388193981940819418194281943819448194581946819478194881949819508195181952819538195481955819568195781958819598196081961819628196381964819658196681967819688196981970819718197281973819748197581976819778197881979819808198181982819838198481985819868198781988819898199081991819928199381994819958199681997819988199982000820018200282003820048200582006820078200882009820108201182012820138201482015820168201782018820198202082021820228202382024820258202682027820288202982030820318203282033820348203582036820378203882039820408204182042820438204482045820468204782048820498205082051820528205382054820558205682057820588205982060820618206282063820648206582066820678206882069820708207182072820738207482075820768207782078820798208082081820828208382084820858208682087820888208982090820918209282093820948209582096820978209882099821008210182102821038210482105821068210782108821098211082111821128211382114821158211682117821188211982120821218212282123821248212582126821278212882129821308213182132821338213482135821368213782138821398214082141821428214382144821458214682147821488214982150821518215282153821548215582156821578215882159821608216182162821638216482165821668216782168821698217082171821728217382174821758217682177821788217982180821818218282183821848218582186821878218882189821908219182192821938219482195821968219782198821998220082201822028220382204822058220682207822088220982210822118221282213822148221582216822178221882219822208222182222822238222482225822268222782228822298223082231822328223382234822358223682237822388223982240822418224282243822448224582246822478224882249822508225182252822538225482255822568225782258822598226082261822628226382264822658226682267822688226982270822718227282273822748227582276822778227882279822808228182282822838228482285822868228782288822898229082291822928229382294822958229682297822988229982300823018230282303823048230582306823078230882309823108231182312823138231482315823168231782318823198232082321823228232382324823258232682327823288232982330823318233282333823348233582336823378233882339823408234182342823438234482345823468234782348823498235082351823528235382354823558235682357823588235982360823618236282363823648236582366823678236882369823708237182372823738237482375823768237782378823798238082381823828238382384823858238682387823888238982390823918239282393823948239582396823978239882399824008240182402824038240482405824068240782408824098241082411824128241382414824158241682417824188241982420824218242282423824248242582426824278242882429824308243182432824338243482435824368243782438824398244082441824428244382444824458244682447824488244982450824518245282453824548245582456824578245882459824608246182462824638246482465824668246782468824698247082471824728247382474824758247682477824788247982480824818248282483824848248582486824878248882489824908249182492824938249482495824968249782498824998250082501825028250382504825058250682507825088250982510825118251282513825148251582516825178251882519825208252182522825238252482525825268252782528825298253082531825328253382534825358253682537825388253982540825418254282543825448254582546825478254882549825508255182552825538255482555825568255782558825598256082561825628256382564825658256682567825688256982570825718257282573825748257582576825778257882579825808258182582825838258482585825868258782588825898259082591825928259382594825958259682597825988259982600826018260282603826048260582606826078260882609826108261182612826138261482615826168261782618826198262082621826228262382624826258262682627826288262982630826318263282633826348263582636826378263882639826408264182642826438264482645826468264782648826498265082651826528265382654826558265682657826588265982660826618266282663826648266582666826678266882669826708267182672826738267482675826768267782678826798268082681826828268382684826858268682687826888268982690826918269282693826948269582696826978269882699827008270182702
  1. /*!
  2. * DevExtreme (dx.viz.debug.js)
  3. * Version: 19.1.16
  4. * Build date: Tue Oct 18 2022
  5. *
  6. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  7. * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
  8. */
  9. "use strict";
  10. ! function(modules) {
  11. var installedModules = {};
  12. function __webpack_require__(moduleId) {
  13. if (installedModules[moduleId]) {
  14. return installedModules[moduleId].exports
  15. }
  16. var module = installedModules[moduleId] = {
  17. i: moduleId,
  18. l: false,
  19. exports: {}
  20. };
  21. modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. module.l = true;
  23. return module.exports
  24. }
  25. __webpack_require__.m = modules;
  26. __webpack_require__.c = installedModules;
  27. __webpack_require__.d = function(exports, name, getter) {
  28. if (!__webpack_require__.o(exports, name)) {
  29. Object.defineProperty(exports, name, {
  30. configurable: false,
  31. enumerable: true,
  32. get: getter
  33. })
  34. }
  35. };
  36. __webpack_require__.n = function(module) {
  37. var getter = module && module.__esModule ? function() {
  38. return module.default
  39. } : function() {
  40. return module
  41. };
  42. __webpack_require__.d(getter, "a", getter);
  43. return getter
  44. };
  45. __webpack_require__.o = function(object, property) {
  46. return Object.prototype.hasOwnProperty.call(object, property)
  47. };
  48. __webpack_require__.p = "";
  49. return __webpack_require__(__webpack_require__.s = 865)
  50. }([
  51. /*!***************************************************!*\
  52. !*** ./artifacts/transpiled/core/utils/extend.js ***!
  53. \***************************************************/
  54. /*! dynamic exports provided */
  55. /*! all exports used */
  56. function(module, exports, __webpack_require__) {
  57. var isPlainObject = __webpack_require__( /*! ./type */ 1).isPlainObject;
  58. var extendFromObject = function(target, source, overrideExistingValues) {
  59. target = target || {};
  60. for (var prop in source) {
  61. if (Object.prototype.hasOwnProperty.call(source, prop)) {
  62. var value = source[prop];
  63. if (!(prop in target) || overrideExistingValues) {
  64. target[prop] = value
  65. }
  66. }
  67. }
  68. return target
  69. };
  70. var extend = function extend(target) {
  71. target = target || {};
  72. var i = 1;
  73. var deep = false;
  74. if ("boolean" === typeof target) {
  75. deep = target;
  76. target = arguments[1] || {};
  77. i++
  78. }
  79. for (; i < arguments.length; i++) {
  80. var source = arguments[i];
  81. if (null == source) {
  82. continue
  83. }
  84. for (var key in source) {
  85. var targetValue = target[key];
  86. var sourceValue = source[key];
  87. var sourceValueIsArray = false;
  88. var clone;
  89. if ("__proto__" === key || target === sourceValue) {
  90. continue
  91. }
  92. if (deep && sourceValue && (isPlainObject(sourceValue) || (sourceValueIsArray = Array.isArray(sourceValue)))) {
  93. if (sourceValueIsArray) {
  94. clone = targetValue && Array.isArray(targetValue) ? targetValue : []
  95. } else {
  96. clone = targetValue && isPlainObject(targetValue) ? targetValue : {}
  97. }
  98. target[key] = extend(deep, clone, sourceValue)
  99. } else {
  100. if (void 0 !== sourceValue) {
  101. target[key] = sourceValue
  102. }
  103. }
  104. }
  105. }
  106. return target
  107. };
  108. exports.extend = extend;
  109. exports.extendFromObject = extendFromObject
  110. },
  111. /*!*************************************************!*\
  112. !*** ./artifacts/transpiled/core/utils/type.js ***!
  113. \*************************************************/
  114. /*! dynamic exports provided */
  115. /*! all exports used */
  116. function(module, exports, __webpack_require__) {
  117. function _typeof(obj) {
  118. "@babel/helpers - typeof";
  119. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  120. return typeof obj
  121. } : function(obj) {
  122. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  123. }, _typeof(obj)
  124. }
  125. var types = {
  126. "[object Array]": "array",
  127. "[object Date]": "date",
  128. "[object Object]": "object",
  129. "[object String]": "string",
  130. "[object Null]": "null"
  131. };
  132. var type = function(object) {
  133. var typeOfObject = Object.prototype.toString.call(object);
  134. return "object" === _typeof(object) ? types[typeOfObject] || "object" : _typeof(object)
  135. };
  136. var isBoolean = function(object) {
  137. return "boolean" === typeof object
  138. };
  139. var isExponential = function(value) {
  140. return isNumeric(value) && value.toString().indexOf("e") !== -1
  141. };
  142. var isDate = function(object) {
  143. return "date" === type(object)
  144. };
  145. var isDefined = function(object) {
  146. return null !== object && void 0 !== object
  147. };
  148. var isFunction = function(object) {
  149. return "function" === typeof object
  150. };
  151. var isString = function(object) {
  152. return "string" === typeof object
  153. };
  154. var isNumeric = function(object) {
  155. return "number" === typeof object && isFinite(object) || !isNaN(object - parseFloat(object))
  156. };
  157. var isObject = function(object) {
  158. return "object" === type(object)
  159. };
  160. var isEmptyObject = function(object) {
  161. var property;
  162. for (property in object) {
  163. return false
  164. }
  165. return true
  166. };
  167. var isPlainObject = function(object) {
  168. if (!object || "[object Object]" !== Object.prototype.toString.call(object)) {
  169. return false
  170. }
  171. var proto = Object.getPrototypeOf(object);
  172. var ctor = Object.hasOwnProperty.call(proto, "constructor") && proto.constructor;
  173. return "function" === typeof ctor && Object.toString.call(ctor) === Object.toString.call(Object)
  174. };
  175. var isPrimitive = function(value) {
  176. return ["object", "array", "function"].indexOf(type(value)) === -1
  177. };
  178. var isWindow = function(object) {
  179. return null != object && object === object.window
  180. };
  181. var isRenderer = function(object) {
  182. return !!(object.jquery || object.dxRenderer)
  183. };
  184. var isPromise = function(object) {
  185. return object && isFunction(object.then)
  186. };
  187. var isDeferred = function(object) {
  188. return object && isFunction(object.done) && isFunction(object.fail)
  189. };
  190. exports.isBoolean = isBoolean;
  191. exports.isExponential = isExponential;
  192. exports.isDate = isDate;
  193. exports.isDefined = isDefined;
  194. exports.isFunction = isFunction;
  195. exports.isString = isString;
  196. exports.isNumeric = isNumeric;
  197. exports.isObject = isObject;
  198. exports.isEmptyObject = isEmptyObject;
  199. exports.isPlainObject = isPlainObject;
  200. exports.isPrimitive = isPrimitive;
  201. exports.isWindow = isWindow;
  202. exports.isRenderer = isRenderer;
  203. exports.isPromise = isPromise;
  204. exports.isDeferred = isDeferred;
  205. exports.type = type
  206. },
  207. /*!***********************************************!*\
  208. !*** ./artifacts/transpiled/core/renderer.js ***!
  209. \***********************************************/
  210. /*! dynamic exports provided */
  211. /*! all exports used */
  212. function(module, exports, __webpack_require__) {
  213. var rendererBase = __webpack_require__( /*! ./renderer_base */ 253);
  214. module.exports = rendererBase.get()
  215. },
  216. /*!*****************************************************!*\
  217. !*** ./artifacts/transpiled/core/utils/iterator.js ***!
  218. \*****************************************************/
  219. /*! dynamic exports provided */
  220. /*! all exports used */
  221. function(module, exports, __webpack_require__) {
  222. var map = function(values, callback) {
  223. if (Array.isArray(values)) {
  224. return values.map(callback)
  225. }
  226. var result = [];
  227. for (var key in values) {
  228. result.push(callback(values[key], key))
  229. }
  230. return result
  231. };
  232. var each = function(values, callback) {
  233. if (!values) {
  234. return
  235. }
  236. if ("length" in values) {
  237. for (var i = 0; i < values.length; i++) {
  238. if (false === callback.call(values[i], i, values[i])) {
  239. break
  240. }
  241. }
  242. } else {
  243. for (var key in values) {
  244. if (false === callback.call(values[key], key, values[key])) {
  245. break
  246. }
  247. }
  248. }
  249. return values
  250. };
  251. var reverseEach = function(array, callback) {
  252. if (!array || !("length" in array) || 0 === array.length) {
  253. return
  254. }
  255. for (var i = array.length - 1; i >= 0; i--) {
  256. if (false === callback.call(array[i], i, array[i])) {
  257. break
  258. }
  259. }
  260. };
  261. exports.map = map;
  262. exports.each = each;
  263. exports.reverseEach = reverseEach
  264. },
  265. /*!***************************************************!*\
  266. !*** ./artifacts/transpiled/core/utils/common.js ***!
  267. \***************************************************/
  268. /*! dynamic exports provided */
  269. /*! all exports used */
  270. function(module, exports, __webpack_require__) {
  271. var _config = __webpack_require__( /*! ../config */ 31);
  272. var _config2 = _interopRequireDefault(_config);
  273. var _guid = __webpack_require__( /*! ../guid */ 40);
  274. var _guid2 = _interopRequireDefault(_guid);
  275. var _deferred = __webpack_require__( /*! ../utils/deferred */ 6);
  276. var _iterator = __webpack_require__( /*! ./iterator */ 3);
  277. var _data = __webpack_require__( /*! ./data */ 20);
  278. var _type = __webpack_require__( /*! ./type */ 1);
  279. function _interopRequireDefault(obj) {
  280. return obj && obj.__esModule ? obj : {
  281. "default": obj
  282. }
  283. }
  284. function _typeof(obj) {
  285. "@babel/helpers - typeof";
  286. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  287. return typeof obj
  288. } : function(obj) {
  289. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  290. }, _typeof(obj)
  291. }
  292. var ensureDefined = function(value, defaultValue) {
  293. return (0, _type.isDefined)(value) ? value : defaultValue
  294. };
  295. var executeAsync = function(action, context) {
  296. var deferred = new _deferred.Deferred;
  297. var normalizedContext = context || this;
  298. var task = {
  299. promise: deferred.promise(),
  300. abort: function() {
  301. clearTimeout(timerId);
  302. deferred.rejectWith(normalizedContext)
  303. }
  304. };
  305. var callback = function() {
  306. var result = action.call(normalizedContext);
  307. if (result && result.done && (0, _type.isFunction)(result.done)) {
  308. result.done(function() {
  309. deferred.resolveWith(normalizedContext)
  310. })
  311. } else {
  312. deferred.resolveWith(normalizedContext)
  313. }
  314. };
  315. var timerId = (arguments[2] || setTimeout)(callback, "number" === typeof context ? context : 0);
  316. return task
  317. };
  318. var delayedFuncs = [];
  319. var delayedNames = [];
  320. var delayedDeferreds = [];
  321. var executingName;
  322. var deferExecute = function(name, func, deferred) {
  323. if (executingName && executingName !== name) {
  324. delayedFuncs.push(func);
  325. delayedNames.push(name);
  326. deferred = deferred || new _deferred.Deferred;
  327. delayedDeferreds.push(deferred);
  328. return deferred
  329. } else {
  330. var oldExecutingName = executingName;
  331. var currentDelayedCount = delayedDeferreds.length;
  332. executingName = name;
  333. var result = func();
  334. if (!result) {
  335. if (delayedDeferreds.length > currentDelayedCount) {
  336. result = _deferred.when.apply(this, delayedDeferreds.slice(currentDelayedCount))
  337. } else {
  338. if (deferred) {
  339. deferred.resolve()
  340. }
  341. }
  342. }
  343. executingName = oldExecutingName;
  344. if (deferred && result && result.done) {
  345. result.done(deferred.resolve).fail(deferred.reject)
  346. }
  347. if (!executingName && delayedFuncs.length) {
  348. ("render" === delayedNames.shift() ? deferRender : deferUpdate)(delayedFuncs.shift(), delayedDeferreds.shift())
  349. }
  350. return result || (0, _deferred.when)()
  351. }
  352. };
  353. var deferRender = function(func, deferred) {
  354. return deferExecute("render", func, deferred)
  355. };
  356. var deferUpdate = function(func, deferred) {
  357. return deferExecute("update", func, deferred)
  358. };
  359. var deferRenderer = function(func) {
  360. return function() {
  361. var that = this;
  362. return deferExecute("render", function() {
  363. return func.call(that)
  364. })
  365. }
  366. };
  367. var deferUpdater = function(func) {
  368. return function() {
  369. var that = this;
  370. return deferExecute("update", function() {
  371. return func.call(that)
  372. })
  373. }
  374. };
  375. var findBestMatches = function(targetFilter, items, mapFn) {
  376. var bestMatches = [];
  377. var maxMatchCount = 0;
  378. (0, _iterator.each)(items, function(index, itemSrc) {
  379. var matchCount = 0;
  380. var item = mapFn ? mapFn(itemSrc) : itemSrc;
  381. (0, _iterator.each)(targetFilter, function(paramName, targetValue) {
  382. var value = item[paramName];
  383. if (void 0 === value) {
  384. return
  385. }
  386. if (match(value, targetValue)) {
  387. matchCount++;
  388. return
  389. }
  390. matchCount = -1;
  391. return false
  392. });
  393. if (matchCount < maxMatchCount) {
  394. return
  395. }
  396. if (matchCount > maxMatchCount) {
  397. bestMatches.length = 0;
  398. maxMatchCount = matchCount
  399. }
  400. bestMatches.push(itemSrc)
  401. });
  402. return bestMatches
  403. };
  404. var match = function(value, targetValue) {
  405. if (Array.isArray(value) && Array.isArray(targetValue)) {
  406. var mismatch = false;
  407. (0, _iterator.each)(value, function(index, valueItem) {
  408. if (valueItem !== targetValue[index]) {
  409. mismatch = true;
  410. return false
  411. }
  412. });
  413. if (mismatch) {
  414. return false
  415. }
  416. return true
  417. }
  418. if (value === targetValue) {
  419. return true
  420. }
  421. return false
  422. };
  423. var splitPair = function(raw) {
  424. switch (_typeof(raw)) {
  425. case "string":
  426. return raw.split(/\s+/, 2);
  427. case "object":
  428. return [raw.x || raw.h, raw.y || raw.v];
  429. case "number":
  430. return [raw];
  431. default:
  432. return raw
  433. }
  434. };
  435. var normalizeKey = function(id) {
  436. var key = (0, _type.isString)(id) ? id : id.toString();
  437. var arr = key.match(/[^a-zA-Z0-9_]/g);
  438. arr && (0, _iterator.each)(arr, function(_, sign) {
  439. key = key.replace(sign, "__" + sign.charCodeAt() + "__")
  440. });
  441. return key
  442. };
  443. var denormalizeKey = function(key) {
  444. var arr = key.match(/__\d+__/g);
  445. arr && arr.forEach(function(char) {
  446. var charCode = parseInt(char.replace("__", ""));
  447. key = key.replace(char, String.fromCharCode(charCode))
  448. });
  449. return key
  450. };
  451. var isArraysEqualByValue = function(array1, array2, deep) {
  452. if (array1.length !== array2.length) {
  453. return false
  454. }
  455. for (var i = 0; i < array1.length; i++) {
  456. if (!equalByValue(array1[i], array2[i], deep + 1)) {
  457. return false
  458. }
  459. }
  460. return true
  461. };
  462. var isObjectsEqualByValue = function(object1, object2, deep) {
  463. for (var propertyName in object1) {
  464. if (Object.prototype.hasOwnProperty.call(object1, propertyName) && !equalByValue(object1[propertyName], object2[propertyName], deep + 1)) {
  465. return false
  466. }
  467. }
  468. for (var _propertyName in object2) {
  469. if (!(_propertyName in object1)) {
  470. return false
  471. }
  472. }
  473. return true
  474. };
  475. var pairToObject = function(raw, preventRound) {
  476. var pair = splitPair(raw);
  477. var h = preventRound ? parseFloat(pair && pair[0]) : parseInt(pair && pair[0], 10);
  478. var v = preventRound ? parseFloat(pair && pair[1]) : parseInt(pair && pair[1], 10);
  479. if (!isFinite(h)) {
  480. h = 0
  481. }
  482. if (!isFinite(v)) {
  483. v = h
  484. }
  485. return {
  486. h: h,
  487. v: v
  488. }
  489. };
  490. var maxEqualityDeep = 3;
  491. var equalByValue = function(object1, object2, deep) {
  492. deep = deep || 0;
  493. object1 = (0, _data.toComparable)(object1, true);
  494. object2 = (0, _data.toComparable)(object2, true);
  495. if (object1 === object2 || deep >= maxEqualityDeep) {
  496. return true
  497. }
  498. if ((0, _type.isObject)(object1) && (0, _type.isObject)(object2)) {
  499. return isObjectsEqualByValue(object1, object2, deep)
  500. } else {
  501. if (Array.isArray(object1) && Array.isArray(object2)) {
  502. return isArraysEqualByValue(object1, object2, deep)
  503. }
  504. }
  505. return false
  506. };
  507. var getKeyHash = function(key) {
  508. if (key instanceof _guid2.default) {
  509. return key.toString()
  510. } else {
  511. if ((0, _type.isObject)(key) || Array.isArray(key)) {
  512. try {
  513. var keyHash = JSON.stringify(key);
  514. return "{}" === keyHash ? key : keyHash
  515. } catch (e) {
  516. return key
  517. }
  518. }
  519. }
  520. return key
  521. };
  522. var escapeRegExp = function(string) {
  523. return string.replace(/[[\]{}\-()*+?.\\^$|\s]/g, "\\$&")
  524. };
  525. var applyServerDecimalSeparator = function(value) {
  526. var separator = (0, _config2.default)().serverDecimalSeparator;
  527. if ((0, _type.isDefined)(value)) {
  528. value = value.toString().replace(".", separator)
  529. }
  530. return value
  531. };
  532. var noop = function() {};
  533. var asyncNoop = function() {
  534. return (new _deferred.Deferred).resolve().promise()
  535. };
  536. var grep = function(elements, checkFunction, invert) {
  537. var result = [];
  538. var expectedCheck = !invert;
  539. for (var i = 0; i < elements.length; i++) {
  540. var check = !!checkFunction(elements[i], i);
  541. if (check === expectedCheck) {
  542. result.push(elements[i])
  543. }
  544. }
  545. return result
  546. };
  547. exports.ensureDefined = ensureDefined;
  548. exports.executeAsync = executeAsync;
  549. exports.deferRender = deferRender;
  550. exports.deferRenderer = deferRenderer;
  551. exports.deferUpdate = deferUpdate;
  552. exports.deferUpdater = deferUpdater;
  553. exports.pairToObject = pairToObject;
  554. exports.splitPair = splitPair;
  555. exports.findBestMatches = findBestMatches;
  556. exports.normalizeKey = normalizeKey;
  557. exports.denormalizeKey = denormalizeKey;
  558. exports.equalByValue = equalByValue;
  559. exports.getKeyHash = getKeyHash;
  560. exports.escapeRegExp = escapeRegExp;
  561. exports.applyServerDecimalSeparator = applyServerDecimalSeparator;
  562. exports.noop = noop;
  563. exports.asyncNoop = asyncNoop;
  564. exports.grep = grep
  565. },
  566. /*!***********************************************************!*\
  567. !*** ./artifacts/transpiled/events/core/events_engine.js ***!
  568. \***********************************************************/
  569. /*! dynamic exports provided */
  570. /*! all exports used */
  571. function(module, exports, __webpack_require__) {
  572. function _typeof(obj) {
  573. "@babel/helpers - typeof";
  574. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  575. return typeof obj
  576. } : function(obj) {
  577. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  578. }, _typeof(obj)
  579. }
  580. var registerEventCallbacks = __webpack_require__( /*! ./event_registrator_callbacks */ 122);
  581. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  582. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  583. var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
  584. var window = windowUtils.getWindow();
  585. var injector = __webpack_require__( /*! ../../core/utils/dependency_injector */ 54);
  586. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  587. var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
  588. var isWindow = typeUtils.isWindow;
  589. var isFunction = typeUtils.isFunction;
  590. var isString = typeUtils.isString;
  591. var errors = __webpack_require__( /*! ../../core/errors */ 21);
  592. var WeakMap = __webpack_require__( /*! ../../core/polyfills/weak_map */ 176);
  593. var hookTouchProps = __webpack_require__( /*! ../../events/core/hook_touch_props */ 254);
  594. var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 63);
  595. var EMPTY_EVENT_NAME = "dxEmptyEventType";
  596. var NATIVE_EVENTS_TO_SUBSCRIBE = {
  597. mouseenter: "mouseover",
  598. mouseleave: "mouseout",
  599. pointerenter: "pointerover",
  600. pointerleave: "pointerout"
  601. };
  602. var NATIVE_EVENTS_TO_TRIGGER = {
  603. focusin: "focus",
  604. focusout: "blur"
  605. };
  606. var NO_BUBBLE_EVENTS = ["blur", "focus", "load"];
  607. var forcePassiveFalseEventNames = ["touchmove", "wheel", "mousewheel", "touchstart"];
  608. var matchesSafe = function(target, selector) {
  609. return !isWindow(target) && "#document" !== target.nodeName && domAdapter.elementMatches(target, selector)
  610. };
  611. var elementDataMap = new WeakMap;
  612. var guid = 0;
  613. var skipEvent;
  614. var special = function() {
  615. var specialData = {};
  616. registerEventCallbacks.add(function(eventName, eventObject) {
  617. specialData[eventName] = eventObject
  618. });
  619. return {
  620. getField: function(eventName, field) {
  621. return specialData[eventName] && specialData[eventName][field]
  622. },
  623. callMethod: function(eventName, methodName, context, args) {
  624. return specialData[eventName] && specialData[eventName][methodName] && specialData[eventName][methodName].apply(context, args)
  625. }
  626. }
  627. }();
  628. var applyForEach = function applyForEach(args, method) {
  629. var element = args[0];
  630. if (!element) {
  631. return
  632. }
  633. if (domAdapter.isNode(element) || isWindow(element)) {
  634. method.apply(eventsEngine, args)
  635. } else {
  636. if (!isString(element) && "length" in element) {
  637. var itemArgs = Array.prototype.slice.call(args, 0);
  638. Array.prototype.forEach.call(element, function(itemElement) {
  639. itemArgs[0] = itemElement;
  640. applyForEach(itemArgs, method)
  641. })
  642. } else {
  643. throw errors.Error("E0025")
  644. }
  645. }
  646. };
  647. var getHandler = function(method) {
  648. return function() {
  649. applyForEach(arguments, method)
  650. }
  651. };
  652. var detectPassiveEventHandlersSupport = function() {
  653. var isSupported = false;
  654. try {
  655. var options = Object.defineProperty({}, "passive", {
  656. get: function() {
  657. isSupported = true;
  658. return true
  659. }
  660. });
  661. window.addEventListener("test", null, options)
  662. } catch (e) {}
  663. return isSupported
  664. };
  665. var passiveEventHandlersSupported = callOnce(detectPassiveEventHandlersSupport);
  666. var getHandlersController = function(element, eventName) {
  667. var elementData = elementDataMap.get(element);
  668. eventName = eventName || "";
  669. var eventNameParts = eventName.split(".");
  670. var namespaces = eventNameParts.slice(1);
  671. var eventNameIsDefined = !!eventNameParts[0];
  672. eventName = eventNameParts[0] || EMPTY_EVENT_NAME;
  673. if (!elementData) {
  674. elementData = {};
  675. elementDataMap.set(element, elementData)
  676. }
  677. if (!elementData[eventName]) {
  678. elementData[eventName] = {
  679. handleObjects: [],
  680. nativeHandler: null
  681. }
  682. }
  683. var eventData = elementData[eventName];
  684. return {
  685. addHandler: function(handler, selector, data) {
  686. var callHandler = function(e, extraParameters) {
  687. var handlerArgs = [e];
  688. var target = e.currentTarget;
  689. var relatedTarget = e.relatedTarget;
  690. var secondaryTargetIsInside;
  691. var result;
  692. if (eventName in NATIVE_EVENTS_TO_SUBSCRIBE) {
  693. secondaryTargetIsInside = relatedTarget && target && (relatedTarget === target || target.contains(relatedTarget))
  694. }
  695. if (void 0 !== extraParameters) {
  696. handlerArgs.push(extraParameters)
  697. }
  698. special.callMethod(eventName, "handle", element, [e, data]);
  699. if (!secondaryTargetIsInside) {
  700. result = handler.apply(target, handlerArgs)
  701. }
  702. if (false === result) {
  703. e.preventDefault();
  704. e.stopPropagation()
  705. }
  706. };
  707. var wrappedHandler = function(e, extraParameters) {
  708. if (skipEvent && e.type === skipEvent) {
  709. return
  710. }
  711. e.data = data;
  712. e.delegateTarget = element;
  713. if (selector) {
  714. var currentTarget = e.target;
  715. while (currentTarget && currentTarget !== element) {
  716. if (matchesSafe(currentTarget, selector)) {
  717. e.currentTarget = currentTarget;
  718. callHandler(e, extraParameters)
  719. }
  720. currentTarget = currentTarget.parentNode
  721. }
  722. } else {
  723. e.currentTarget = e.delegateTarget || e.target;
  724. callHandler(e, extraParameters)
  725. }
  726. };
  727. var handleObject = {
  728. handler: handler,
  729. wrappedHandler: wrappedHandler,
  730. selector: selector,
  731. type: eventName,
  732. data: data,
  733. namespace: namespaces.join("."),
  734. namespaces: namespaces,
  735. guid: ++guid
  736. };
  737. eventData.handleObjects.push(handleObject);
  738. var firstHandlerForTheType = 1 === eventData.handleObjects.length;
  739. var shouldAddNativeListener = firstHandlerForTheType && eventNameIsDefined;
  740. var nativeListenerOptions;
  741. if (shouldAddNativeListener) {
  742. shouldAddNativeListener = !special.callMethod(eventName, "setup", element, [data, namespaces, handler])
  743. }
  744. if (shouldAddNativeListener) {
  745. eventData.nativeHandler = getNativeHandler(eventName);
  746. if (passiveEventHandlersSupported() && forcePassiveFalseEventNames.indexOf(eventName) > -1) {
  747. nativeListenerOptions = {
  748. passive: false
  749. }
  750. }
  751. eventData.removeListener = domAdapter.listen(element, NATIVE_EVENTS_TO_SUBSCRIBE[eventName] || eventName, eventData.nativeHandler, nativeListenerOptions)
  752. }
  753. special.callMethod(eventName, "add", element, [handleObject])
  754. },
  755. removeHandler: function(handler, selector) {
  756. var removeByEventName = function(eventName) {
  757. var eventData = elementData[eventName];
  758. if (!eventData.handleObjects.length) {
  759. delete elementData[eventName];
  760. return
  761. }
  762. var removedHandler;
  763. eventData.handleObjects = eventData.handleObjects.filter(function(handleObject) {
  764. var skip = namespaces.length && !isSubset(handleObject.namespaces, namespaces) || handler && handleObject.handler !== handler || selector && handleObject.selector !== selector;
  765. if (!skip) {
  766. removedHandler = handleObject.handler;
  767. special.callMethod(eventName, "remove", element, [handleObject])
  768. }
  769. return skip
  770. });
  771. var lastHandlerForTheType = !eventData.handleObjects.length;
  772. var shouldRemoveNativeListener = lastHandlerForTheType && eventName !== EMPTY_EVENT_NAME;
  773. if (shouldRemoveNativeListener) {
  774. special.callMethod(eventName, "teardown", element, [namespaces, removedHandler]);
  775. if (eventData.nativeHandler) {
  776. eventData.removeListener()
  777. }
  778. delete elementData[eventName]
  779. }
  780. };
  781. if (eventNameIsDefined) {
  782. removeByEventName(eventName)
  783. } else {
  784. for (var name in elementData) {
  785. removeByEventName(name)
  786. }
  787. }
  788. var elementDataIsEmpty = 0 === Object.keys(elementData).length;
  789. if (elementDataIsEmpty) {
  790. elementDataMap.delete(element)
  791. }
  792. },
  793. callHandlers: function(event, extraParameters) {
  794. var forceStop = false;
  795. var handleCallback = function(handleObject) {
  796. if (forceStop) {
  797. return
  798. }
  799. if (!namespaces.length || isSubset(handleObject.namespaces, namespaces)) {
  800. handleObject.wrappedHandler(event, extraParameters);
  801. forceStop = event.isImmediatePropagationStopped()
  802. }
  803. };
  804. eventData.handleObjects.forEach(handleCallback);
  805. if (namespaces.length && elementData[EMPTY_EVENT_NAME]) {
  806. elementData[EMPTY_EVENT_NAME].handleObjects.forEach(handleCallback)
  807. }
  808. }
  809. }
  810. };
  811. var getNativeHandler = function(subscribeName) {
  812. return function(event, extraParameters) {
  813. var handlersController = getHandlersController(this, subscribeName);
  814. event = eventsEngine.Event(event);
  815. handlersController.callHandlers(event, extraParameters)
  816. }
  817. };
  818. var isSubset = function(original, checked) {
  819. for (var i = 0; i < checked.length; i++) {
  820. if (original.indexOf(checked[i]) < 0) {
  821. return false
  822. }
  823. }
  824. return true
  825. };
  826. var normalizeOnArguments = function(callback) {
  827. return function(element, eventName, selector, data, handler) {
  828. if (!handler) {
  829. handler = data;
  830. data = void 0
  831. }
  832. if ("string" !== typeof selector) {
  833. data = selector;
  834. selector = void 0
  835. }
  836. if (!handler && "string" === typeof eventName) {
  837. handler = data || selector;
  838. selector = void 0;
  839. data = void 0
  840. }
  841. callback(element, eventName, selector, data, handler)
  842. }
  843. };
  844. var normalizeOffArguments = function(callback) {
  845. return function(element, eventName, selector, handler) {
  846. if ("function" === typeof selector) {
  847. handler = selector;
  848. selector = void 0
  849. }
  850. callback(element, eventName, selector, handler)
  851. }
  852. };
  853. var normalizeTriggerArguments = function(callback) {
  854. return function(element, src, extraParameters) {
  855. if ("string" === typeof src) {
  856. src = {
  857. type: src
  858. }
  859. }
  860. if (!src.target) {
  861. src.target = element
  862. }
  863. src.currentTarget = element;
  864. if (!src.delegateTarget) {
  865. src.delegateTarget = element
  866. }
  867. if (!src.type && src.originalEvent) {
  868. src.type = src.originalEvent.type
  869. }
  870. callback(element, src instanceof eventsEngine.Event ? src : eventsEngine.Event(src), extraParameters)
  871. }
  872. };
  873. var normalizeEventArguments = function(callback) {
  874. return function(src, config) {
  875. if (!(this instanceof eventsEngine.Event)) {
  876. return new eventsEngine.Event(src, config)
  877. }
  878. if (!src) {
  879. src = {}
  880. }
  881. if ("string" === typeof src) {
  882. src = {
  883. type: src
  884. }
  885. }
  886. if (!config) {
  887. config = {}
  888. }
  889. callback.call(this, src, config)
  890. }
  891. };
  892. var iterate = function(callback) {
  893. var iterateEventNames = function(element, eventName) {
  894. if (eventName && eventName.indexOf(" ") > -1) {
  895. var args = Array.prototype.slice.call(arguments, 0);
  896. eventName.split(" ").forEach(function(eventName) {
  897. args[1] = eventName;
  898. callback.apply(this, args)
  899. })
  900. } else {
  901. callback.apply(this, arguments)
  902. }
  903. };
  904. return function(element, eventName) {
  905. if ("object" === _typeof(eventName)) {
  906. var args = Array.prototype.slice.call(arguments, 0);
  907. for (var name in eventName) {
  908. args[1] = name;
  909. args[args.length - 1] = eventName[name];
  910. iterateEventNames.apply(this, args)
  911. }
  912. } else {
  913. iterateEventNames.apply(this, arguments)
  914. }
  915. }
  916. };
  917. var callNativeMethod = function(eventName, element) {
  918. var nativeMethodName = NATIVE_EVENTS_TO_TRIGGER[eventName] || eventName;
  919. var isLinkClickEvent = function(eventName, element) {
  920. return "click" === eventName && "a" === element.localName
  921. };
  922. if (isLinkClickEvent(eventName, element)) {
  923. return
  924. }
  925. if (isFunction(element[nativeMethodName])) {
  926. skipEvent = eventName;
  927. element[nativeMethodName]();
  928. skipEvent = void 0
  929. }
  930. };
  931. var calculateWhich = function(event) {
  932. var setForMouseEvent = function(event) {
  933. var mouseEventRegex = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
  934. return !event.which && void 0 !== event.button && mouseEventRegex.test(event.type)
  935. };
  936. var setForKeyEvent = function(event) {
  937. return null == event.which && 0 === event.type.indexOf("key")
  938. };
  939. if (setForKeyEvent(event)) {
  940. return null != event.charCode ? event.charCode : event.keyCode
  941. }
  942. if (setForMouseEvent(event)) {
  943. var whichByButton = {
  944. 1: 1,
  945. 2: 3,
  946. 3: 1,
  947. 4: 2
  948. };
  949. return whichByButton[event.button]
  950. }
  951. return event.which
  952. };
  953. var eventsEngine = injector({
  954. on: getHandler(normalizeOnArguments(iterate(function(element, eventName, selector, data, handler) {
  955. var handlersController = getHandlersController(element, eventName);
  956. handlersController.addHandler(handler, selector, data)
  957. }))),
  958. one: getHandler(normalizeOnArguments(function(element, eventName, selector, data, handler) {
  959. var oneTimeHandler = function oneTimeHandler() {
  960. eventsEngine.off(element, eventName, selector, oneTimeHandler);
  961. handler.apply(this, arguments)
  962. };
  963. eventsEngine.on(element, eventName, selector, data, oneTimeHandler)
  964. })),
  965. off: getHandler(normalizeOffArguments(iterate(function(element, eventName, selector, handler) {
  966. var handlersController = getHandlersController(element, eventName);
  967. handlersController.removeHandler(handler, selector)
  968. }))),
  969. trigger: getHandler(normalizeTriggerArguments(function(element, event, extraParameters) {
  970. var eventName = event.type;
  971. var handlersController = getHandlersController(element, event.type);
  972. special.callMethod(eventName, "trigger", element, [event, extraParameters]);
  973. handlersController.callHandlers(event, extraParameters);
  974. var noBubble = special.getField(eventName, "noBubble") || event.isPropagationStopped() || NO_BUBBLE_EVENTS.indexOf(eventName) !== -1;
  975. if (!noBubble) {
  976. var parents = [];
  977. var getParents = function getParents(element) {
  978. var parent = element.parentNode;
  979. if (parent) {
  980. parents.push(parent);
  981. getParents(parent)
  982. }
  983. };
  984. getParents(element);
  985. parents.push(window);
  986. var i = 0;
  987. while (parents[i] && !event.isPropagationStopped()) {
  988. var parentDataByEvent = getHandlersController(parents[i], event.type);
  989. parentDataByEvent.callHandlers(extend(event, {
  990. currentTarget: parents[i]
  991. }), extraParameters);
  992. i++
  993. }
  994. }
  995. if (element.nodeType || isWindow(element)) {
  996. special.callMethod(eventName, "_default", element, [event, extraParameters]);
  997. callNativeMethod(eventName, element)
  998. }
  999. })),
  1000. triggerHandler: getHandler(normalizeTriggerArguments(function(element, event, extraParameters) {
  1001. var handlersController = getHandlersController(element, event.type);
  1002. handlersController.callHandlers(event, extraParameters)
  1003. }))
  1004. });
  1005. var initEvent = function(EventClass) {
  1006. if (EventClass) {
  1007. eventsEngine.Event = EventClass;
  1008. eventsEngine.Event.prototype = EventClass.prototype
  1009. }
  1010. };
  1011. initEvent(normalizeEventArguments(function(src, config) {
  1012. var that = this;
  1013. var propagationStopped = false;
  1014. var immediatePropagationStopped = false;
  1015. var defaultPrevented = false;
  1016. extend(that, src);
  1017. if (src instanceof eventsEngine.Event || windowUtils.hasWindow() && src instanceof window.Event) {
  1018. that.originalEvent = src;
  1019. that.currentTarget = void 0
  1020. }
  1021. if (!(src instanceof eventsEngine.Event)) {
  1022. extend(that, {
  1023. isPropagationStopped: function() {
  1024. return !!(propagationStopped || that.originalEvent && that.originalEvent.propagationStopped)
  1025. },
  1026. stopPropagation: function() {
  1027. propagationStopped = true;
  1028. that.originalEvent && that.originalEvent.stopPropagation()
  1029. },
  1030. isImmediatePropagationStopped: function() {
  1031. return immediatePropagationStopped
  1032. },
  1033. stopImmediatePropagation: function() {
  1034. this.stopPropagation();
  1035. immediatePropagationStopped = true;
  1036. that.originalEvent && that.originalEvent.stopImmediatePropagation()
  1037. },
  1038. isDefaultPrevented: function() {
  1039. return !!(defaultPrevented || that.originalEvent && that.originalEvent.defaultPrevented)
  1040. },
  1041. preventDefault: function() {
  1042. defaultPrevented = true;
  1043. that.originalEvent && that.originalEvent.preventDefault()
  1044. }
  1045. })
  1046. }
  1047. addProperty("which", calculateWhich, that);
  1048. if (0 === src.type.indexOf("touch")) {
  1049. delete config.pageX;
  1050. delete config.pageY
  1051. }
  1052. extend(that, config);
  1053. that.guid = ++guid
  1054. }));
  1055. var addProperty = function(propName, hook, eventInstance) {
  1056. Object.defineProperty(eventInstance || eventsEngine.Event.prototype, propName, {
  1057. enumerable: true,
  1058. configurable: true,
  1059. get: function() {
  1060. return this.originalEvent && hook(this.originalEvent)
  1061. },
  1062. set: function(value) {
  1063. Object.defineProperty(this, propName, {
  1064. enumerable: true,
  1065. configurable: true,
  1066. writable: true,
  1067. value: value
  1068. })
  1069. }
  1070. })
  1071. };
  1072. hookTouchProps(addProperty);
  1073. var beforeSetStrategy = Callbacks();
  1074. var afterSetStrategy = Callbacks();
  1075. eventsEngine.set = function(engine) {
  1076. beforeSetStrategy.fire();
  1077. eventsEngine.inject(engine);
  1078. initEvent(engine.Event);
  1079. afterSetStrategy.fire()
  1080. };
  1081. eventsEngine.subscribeGlobal = function() {
  1082. applyForEach(arguments, normalizeOnArguments(function() {
  1083. var args = arguments;
  1084. eventsEngine.on.apply(this, args);
  1085. beforeSetStrategy.add(function() {
  1086. var offArgs = Array.prototype.slice.call(args, 0);
  1087. offArgs.splice(3, 1);
  1088. eventsEngine.off.apply(this, offArgs)
  1089. });
  1090. afterSetStrategy.add(function() {
  1091. eventsEngine.on.apply(this, args)
  1092. })
  1093. }))
  1094. };
  1095. eventsEngine.forcePassiveFalseEventNames = forcePassiveFalseEventNames;
  1096. eventsEngine.passiveEventHandlersSupported = passiveEventHandlersSupported;
  1097. eventsEngine.elementDataMap = elementDataMap;
  1098. eventsEngine.detectPassiveEventHandlersSupport = detectPassiveEventHandlersSupport;
  1099. module.exports = eventsEngine
  1100. },
  1101. /*!*****************************************************!*\
  1102. !*** ./artifacts/transpiled/core/utils/deferred.js ***!
  1103. \*****************************************************/
  1104. /*! dynamic exports provided */
  1105. /*! all exports used */
  1106. function(module, exports, __webpack_require__) {
  1107. var typeUtils = __webpack_require__( /*! ../utils/type */ 1);
  1108. var isPromise = typeUtils.isPromise;
  1109. var isDeferred = typeUtils.isDeferred;
  1110. var extend = __webpack_require__( /*! ../utils/extend */ 0).extend;
  1111. var Callbacks = __webpack_require__( /*! ../utils/callbacks */ 26);
  1112. var deferredConfig = [{
  1113. method: "resolve",
  1114. handler: "done",
  1115. state: "resolved"
  1116. }, {
  1117. method: "reject",
  1118. handler: "fail",
  1119. state: "rejected"
  1120. }, {
  1121. method: "notify",
  1122. handler: "progress"
  1123. }];
  1124. var _Deferred = function() {
  1125. var that = this;
  1126. this._state = "pending";
  1127. this._promise = {};
  1128. deferredConfig.forEach(function(config) {
  1129. var methodName = config.method;
  1130. this[methodName + "Callbacks"] = new Callbacks;
  1131. this[methodName] = function() {
  1132. return this[methodName + "With"](this._promise, arguments)
  1133. }.bind(this);
  1134. this._promise[config.handler] = function(handler) {
  1135. if (!handler) {
  1136. return this
  1137. }
  1138. var callbacks = that[methodName + "Callbacks"];
  1139. if (callbacks.fired()) {
  1140. handler.apply(that[methodName + "Context"], that[methodName + "Args"])
  1141. } else {
  1142. callbacks.add(function(context, args) {
  1143. handler.apply(context, args)
  1144. }.bind(this))
  1145. }
  1146. return this
  1147. }
  1148. }.bind(this));
  1149. this._promise.always = function(handler) {
  1150. return this.done(handler).fail(handler)
  1151. };
  1152. this._promise.catch = function(handler) {
  1153. return this.then(null, handler)
  1154. };
  1155. this._promise.then = function(resolve, reject) {
  1156. var result = new _Deferred;
  1157. ["done", "fail"].forEach(function(method) {
  1158. var callback = "done" === method ? resolve : reject;
  1159. this[method](function() {
  1160. if (!callback) {
  1161. result["done" === method ? "resolve" : "reject"].apply(this, arguments);
  1162. return
  1163. }
  1164. var callbackResult = callback && callback.apply(this, arguments);
  1165. if (isDeferred(callbackResult)) {
  1166. callbackResult.done(result.resolve).fail(result.reject)
  1167. } else {
  1168. if (isPromise(callbackResult)) {
  1169. callbackResult.then(result.resolve, result.reject)
  1170. } else {
  1171. result.resolve.apply(this, typeUtils.isDefined(callbackResult) ? [callbackResult] : arguments)
  1172. }
  1173. }
  1174. })
  1175. }.bind(this));
  1176. return result.promise()
  1177. };
  1178. this._promise.state = function() {
  1179. return that._state
  1180. };
  1181. this._promise.promise = function(args) {
  1182. return args ? extend(args, that._promise) : that._promise
  1183. };
  1184. this._promise.promise(this)
  1185. };
  1186. deferredConfig.forEach(function(config) {
  1187. var methodName = config.method;
  1188. var state = config.state;
  1189. _Deferred.prototype[methodName + "With"] = function(context, args) {
  1190. var callbacks = this[methodName + "Callbacks"];
  1191. if ("pending" === this.state()) {
  1192. this[methodName + "Args"] = args;
  1193. this[methodName + "Context"] = context;
  1194. if (state) {
  1195. this._state = state
  1196. }
  1197. callbacks.fire(context, args)
  1198. }
  1199. return this
  1200. }
  1201. });
  1202. exports.fromPromise = function(promise, context) {
  1203. if (isDeferred(promise)) {
  1204. return promise
  1205. } else {
  1206. if (isPromise(promise)) {
  1207. var d = new _Deferred;
  1208. promise.then(function() {
  1209. d.resolveWith.apply(d, [context].concat([
  1210. [].slice.call(arguments)
  1211. ]))
  1212. }, function() {
  1213. d.rejectWith.apply(d, [context].concat([
  1214. [].slice.call(arguments)
  1215. ]))
  1216. });
  1217. return d
  1218. }
  1219. }
  1220. return (new _Deferred).resolveWith(context, [promise])
  1221. };
  1222. var when = function() {
  1223. if (1 === arguments.length) {
  1224. return exports.fromPromise(arguments[0])
  1225. }
  1226. var values = [].slice.call(arguments);
  1227. var contexts = [];
  1228. var resolvedCount = 0;
  1229. var deferred = new _Deferred;
  1230. var updateState = function(i) {
  1231. return function(value) {
  1232. contexts[i] = this;
  1233. values[i] = arguments.length > 1 ? [].slice.call(arguments) : value;
  1234. resolvedCount++;
  1235. if (resolvedCount === values.length) {
  1236. deferred.resolveWith(contexts, values)
  1237. }
  1238. }
  1239. };
  1240. for (var i = 0; i < values.length; i++) {
  1241. if (isDeferred(values[i])) {
  1242. values[i].promise().done(updateState(i)).fail(deferred.reject)
  1243. } else {
  1244. resolvedCount++
  1245. }
  1246. }
  1247. if (resolvedCount === values.length) {
  1248. deferred.resolveWith(contexts, values)
  1249. }
  1250. return deferred.promise()
  1251. };
  1252. exports.setStrategy = function(value) {
  1253. _Deferred = value.Deferred;
  1254. when = value.when
  1255. };
  1256. exports.Deferred = function() {
  1257. return new _Deferred
  1258. };
  1259. exports.when = function() {
  1260. return when.apply(this, arguments)
  1261. }
  1262. },
  1263. /*!***************************************************!*\
  1264. !*** ./artifacts/transpiled/core/utils/window.js ***!
  1265. \***************************************************/
  1266. /*! dynamic exports provided */
  1267. /*! all exports used */
  1268. function(module, exports, __webpack_require__) {
  1269. var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11);
  1270. var _hasWindow = "undefined" !== typeof window;
  1271. var windowObject = _hasWindow && window;
  1272. if (!windowObject) {
  1273. windowObject = {};
  1274. windowObject.window = windowObject
  1275. }
  1276. module.exports = {
  1277. hasWindow: function() {
  1278. return _hasWindow
  1279. },
  1280. getWindow: function() {
  1281. return windowObject
  1282. },
  1283. hasProperty: function(prop) {
  1284. return this.hasWindow() && prop in windowObject
  1285. },
  1286. defaultScreenFactorFunc: function(width) {
  1287. if (width < 768) {
  1288. return "xs"
  1289. } else {
  1290. if (width < 992) {
  1291. return "sm"
  1292. } else {
  1293. if (width < 1200) {
  1294. return "md"
  1295. } else {
  1296. return "lg"
  1297. }
  1298. }
  1299. }
  1300. },
  1301. getCurrentScreenFactor: function(screenFactorCallback) {
  1302. var screenFactorFunc = screenFactorCallback || this.defaultScreenFactorFunc;
  1303. var windowWidth = domAdapter.getDocumentElement().clientWidth;
  1304. return screenFactorFunc(windowWidth)
  1305. },
  1306. getNavigator: function() {
  1307. return this.hasWindow() ? windowObject.navigator : {
  1308. userAgent: ""
  1309. }
  1310. }
  1311. }
  1312. },
  1313. /*!**********************************************!*\
  1314. !*** ./artifacts/transpiled/events/utils.js ***!
  1315. \**********************************************/
  1316. /*! dynamic exports provided */
  1317. /*! all exports used */
  1318. function(module, exports, __webpack_require__) {
  1319. var _renderer = __webpack_require__( /*! ../core/renderer */ 2);
  1320. var _renderer2 = _interopRequireDefault(_renderer);
  1321. var _events_engine = __webpack_require__( /*! ./core/events_engine */ 5);
  1322. var _events_engine2 = _interopRequireDefault(_events_engine);
  1323. var _errors = __webpack_require__( /*! ../core/errors */ 21);
  1324. var _errors2 = _interopRequireDefault(_errors);
  1325. var _selectors = __webpack_require__( /*! ../ui/widget/selectors */ 66);
  1326. var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
  1327. var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
  1328. function _interopRequireDefault(obj) {
  1329. return obj && obj.__esModule ? obj : {
  1330. "default": obj
  1331. }
  1332. }
  1333. var KEY_MAP = {
  1334. backspace: "backspace",
  1335. tab: "tab",
  1336. enter: "enter",
  1337. escape: "escape",
  1338. pageup: "pageUp",
  1339. pagedown: "pageDown",
  1340. end: "end",
  1341. home: "home",
  1342. arrowleft: "leftArrow",
  1343. arrowup: "upArrow",
  1344. arrowright: "rightArrow",
  1345. arrowdown: "downArrow",
  1346. "delete": "del",
  1347. " ": "space",
  1348. f: "F",
  1349. a: "A",
  1350. "*": "asterisk",
  1351. "-": "minus",
  1352. alt: "alt",
  1353. control: "control",
  1354. shift: "shift",
  1355. left: "leftArrow",
  1356. up: "upArrow",
  1357. right: "rightArrow",
  1358. down: "downArrow",
  1359. multiply: "asterisk",
  1360. spacebar: "space",
  1361. del: "del",
  1362. subtract: "minus",
  1363. esc: "escape"
  1364. };
  1365. var LEGACY_KEY_CODES = {
  1366. 8: "backspace",
  1367. 9: "tab",
  1368. 13: "enter",
  1369. 27: "escape",
  1370. 33: "pageUp",
  1371. 34: "pageDown",
  1372. 35: "end",
  1373. 36: "home",
  1374. 37: "leftArrow",
  1375. 38: "upArrow",
  1376. 39: "rightArrow",
  1377. 40: "downArrow",
  1378. 46: "del",
  1379. 32: "space",
  1380. 70: "F",
  1381. 65: "A",
  1382. 106: "asterisk",
  1383. 109: "minus",
  1384. 189: "minus",
  1385. 173: "minus",
  1386. 16: "shift",
  1387. 17: "control",
  1388. 18: "alt"
  1389. };
  1390. var eventSource = function() {
  1391. var EVENT_SOURCES_REGEX = {
  1392. dx: /^dx/i,
  1393. mouse: /(mouse|wheel)/i,
  1394. touch: /^touch/i,
  1395. keyboard: /^key/i,
  1396. pointer: /^(ms)?pointer/i
  1397. };
  1398. return function(e) {
  1399. var result = "other";
  1400. (0, _iterator.each)(EVENT_SOURCES_REGEX, function(key) {
  1401. if (this.test(e.type)) {
  1402. result = key;
  1403. return false
  1404. }
  1405. });
  1406. return result
  1407. }
  1408. }();
  1409. var isDxEvent = function(e) {
  1410. return "dx" === eventSource(e)
  1411. };
  1412. var isNativeMouseEvent = function(e) {
  1413. return "mouse" === eventSource(e)
  1414. };
  1415. var isNativeTouchEvent = function(e) {
  1416. return "touch" === eventSource(e)
  1417. };
  1418. var isPointerEvent = function(e) {
  1419. return "pointer" === eventSource(e)
  1420. };
  1421. var isMouseEvent = function(e) {
  1422. return isNativeMouseEvent(e) || (isPointerEvent(e) || isDxEvent(e)) && "mouse" === e.pointerType
  1423. };
  1424. var isDxMouseWheelEvent = function(e) {
  1425. return e && "dxmousewheel" === e.type
  1426. };
  1427. var isTouchEvent = function(e) {
  1428. return isNativeTouchEvent(e) || (isPointerEvent(e) || isDxEvent(e)) && "touch" === e.pointerType
  1429. };
  1430. var isKeyboardEvent = function(e) {
  1431. return "keyboard" === eventSource(e)
  1432. };
  1433. var isFakeClickEvent = function(e) {
  1434. return 0 === e.screenX && !e.offsetX && 0 === e.pageX
  1435. };
  1436. var eventData = function(e) {
  1437. return {
  1438. x: e.pageX,
  1439. y: e.pageY,
  1440. time: e.timeStamp
  1441. }
  1442. };
  1443. var eventDelta = function(from, to) {
  1444. return {
  1445. x: to.x - from.x,
  1446. y: to.y - from.y,
  1447. time: to.time - from.time || 1
  1448. }
  1449. };
  1450. var hasTouches = function(e) {
  1451. if (isNativeTouchEvent(e)) {
  1452. return (e.originalEvent.touches || []).length
  1453. }
  1454. if (isDxEvent(e)) {
  1455. return (e.pointers || []).length
  1456. }
  1457. return 0
  1458. };
  1459. var needSkipEvent = function(e) {
  1460. var target = e.target;
  1461. var $target = (0, _renderer2.default)(target);
  1462. var touchInInput = $target.is("input, textarea, select");
  1463. if ($target.is(".dx-skip-gesture-event *, .dx-skip-gesture-event")) {
  1464. return true
  1465. }
  1466. if (isDxMouseWheelEvent(e)) {
  1467. var isTextArea = $target.is("textarea") && $target.hasClass("dx-texteditor-input");
  1468. if (isTextArea) {
  1469. return false
  1470. }
  1471. var isContentEditable = target.isContentEditable || target.hasAttribute("contenteditable");
  1472. if (isContentEditable) {
  1473. return false
  1474. }
  1475. var isInputFocused = $target.is("input[type='number'], textarea, select") && $target.is(":focus");
  1476. return isInputFocused
  1477. }
  1478. if (isMouseEvent(e)) {
  1479. return touchInInput || e.which > 1
  1480. }
  1481. if (isTouchEvent(e)) {
  1482. return touchInInput && (0, _selectors.focused)($target)
  1483. }
  1484. };
  1485. var fixMethod = function(e) {
  1486. return e
  1487. };
  1488. var setEventFixMethod = function(func) {
  1489. fixMethod = func
  1490. };
  1491. var copyEvent = function(originalEvent) {
  1492. return fixMethod(_events_engine2.default.Event(originalEvent, originalEvent), originalEvent)
  1493. };
  1494. var createEvent = function(originalEvent, args) {
  1495. var event = copyEvent(originalEvent);
  1496. if (args) {
  1497. (0, _extend.extend)(event, args)
  1498. }
  1499. return event
  1500. };
  1501. var fireEvent = function(props) {
  1502. var event = createEvent(props.originalEvent, props);
  1503. _events_engine2.default.trigger(props.delegateTarget || event.target, event);
  1504. return event
  1505. };
  1506. var addNamespace = function addNamespace(eventNames, namespace) {
  1507. if (!namespace) {
  1508. throw _errors2.default.Error("E0017")
  1509. }
  1510. if ("string" === typeof eventNames) {
  1511. if (eventNames.indexOf(" ") === -1) {
  1512. return eventNames + "." + namespace
  1513. }
  1514. return addNamespace(eventNames.split(/\s+/g), namespace)
  1515. }(0, _iterator.each)(eventNames, function(index, eventName) {
  1516. eventNames[index] = eventName + "." + namespace
  1517. });
  1518. return eventNames.join(" ")
  1519. };
  1520. var normalizeKeyName = function(event) {
  1521. var isKeySupported = !!event.key;
  1522. var key = isKeySupported ? event.key : event.which;
  1523. if (!key) {
  1524. return
  1525. }
  1526. if (isKeySupported) {
  1527. key = KEY_MAP[key.toLowerCase()] || key
  1528. } else {
  1529. key = LEGACY_KEY_CODES[key] || String.fromCharCode(key)
  1530. }
  1531. return key
  1532. };
  1533. var getChar = function(event) {
  1534. return event.key || String.fromCharCode(event.which)
  1535. };
  1536. module.exports = {
  1537. eventSource: eventSource,
  1538. isPointerEvent: isPointerEvent,
  1539. isMouseEvent: isMouseEvent,
  1540. isDxMouseWheelEvent: isDxMouseWheelEvent,
  1541. isTouchEvent: isTouchEvent,
  1542. isKeyboardEvent: isKeyboardEvent,
  1543. isFakeClickEvent: isFakeClickEvent,
  1544. hasTouches: hasTouches,
  1545. eventData: eventData,
  1546. eventDelta: eventDelta,
  1547. needSkipEvent: needSkipEvent,
  1548. createEvent: createEvent,
  1549. fireEvent: fireEvent,
  1550. addNamespace: addNamespace,
  1551. setEventFixMethod: setEventFixMethod,
  1552. normalizeKeyName: normalizeKeyName,
  1553. getChar: getChar
  1554. }
  1555. },
  1556. /*!************************************************************!*\
  1557. !*** ./artifacts/transpiled/core/component_registrator.js ***!
  1558. \************************************************************/
  1559. /*! dynamic exports provided */
  1560. /*! all exports used */
  1561. function(module, exports, __webpack_require__) {
  1562. var $ = __webpack_require__( /*! ./renderer */ 2);
  1563. var callbacks = __webpack_require__( /*! ./component_registrator_callbacks */ 153);
  1564. var errors = __webpack_require__( /*! ./errors */ 21);
  1565. var publicComponentUtils = __webpack_require__( /*! ./utils/public_component */ 131);
  1566. var registerComponent = function(name, namespace, componentClass) {
  1567. if (!componentClass) {
  1568. componentClass = namespace
  1569. } else {
  1570. namespace[name] = componentClass
  1571. }
  1572. publicComponentUtils.name(componentClass, name);
  1573. callbacks.fire(name, componentClass)
  1574. };
  1575. var registerRendererComponent = function(name, componentClass) {
  1576. $.fn[name] = function(options) {
  1577. var isMemberInvoke = "string" === typeof options;
  1578. var result;
  1579. if (isMemberInvoke) {
  1580. var memberName = options;
  1581. var memberArgs = [].slice.call(arguments).slice(1);
  1582. this.each(function() {
  1583. var instance = componentClass.getInstance(this);
  1584. if (!instance) {
  1585. throw errors.Error("E0009", name)
  1586. }
  1587. var member = instance[memberName];
  1588. var memberValue = member.apply(instance, memberArgs);
  1589. if (void 0 === result) {
  1590. result = memberValue
  1591. }
  1592. })
  1593. } else {
  1594. this.each(function() {
  1595. var instance = componentClass.getInstance(this);
  1596. if (instance) {
  1597. instance.option(options)
  1598. } else {
  1599. new componentClass(this, options)
  1600. }
  1601. });
  1602. result = this
  1603. }
  1604. return result
  1605. }
  1606. };
  1607. callbacks.add(registerRendererComponent);
  1608. module.exports = registerComponent
  1609. },
  1610. /*!************************************************!*\
  1611. !*** ./artifacts/transpiled/viz/core/utils.js ***!
  1612. \************************************************/
  1613. /*! dynamic exports provided */
  1614. /*! all exports used */
  1615. function(module, exports, __webpack_require__) {
  1616. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  1617. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  1618. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  1619. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  1620. var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust;
  1621. var dateToMilliseconds = __webpack_require__( /*! ../../core/utils/date */ 22).dateToMilliseconds;
  1622. var isDefined = typeUtils.isDefined;
  1623. var isNumber = typeUtils.isNumeric;
  1624. var isExponential = typeUtils.isExponential;
  1625. var _math = Math;
  1626. var _round = _math.round;
  1627. var _sqrt = Math.sqrt;
  1628. var PI = Math.PI;
  1629. var MAX_PIXEL_COUNT = 1e10;
  1630. var PI_DIV_180 = PI / 180;
  1631. var LN10 = Math.LN10;
  1632. var cosFunc = Math.cos;
  1633. var sinFunc = Math.sin;
  1634. var abs = Math.abs;
  1635. var log = Math.log;
  1636. var floor = Math.floor;
  1637. var ceil = Math.ceil;
  1638. var max = Math.max;
  1639. var _isNaN = isNaN;
  1640. var _Number = Number;
  1641. var _NaN = NaN;
  1642. var getLog = function(value, base) {
  1643. if (!value) {
  1644. return _NaN
  1645. }
  1646. return Math.log(value) / Math.log(base)
  1647. };
  1648. var getAdjustedLog10 = function(value) {
  1649. return adjust(getLog(value, 10))
  1650. };
  1651. var raiseTo = function(power, base) {
  1652. return Math.pow(base, power)
  1653. };
  1654. var normalizeAngle = function(angle) {
  1655. return (angle % 360 + 360) % 360
  1656. };
  1657. var convertAngleToRendererSpace = function(angle) {
  1658. return 90 - angle
  1659. };
  1660. var degreesToRadians = function(value) {
  1661. return PI * value / 180
  1662. };
  1663. var getCosAndSin = function(angle) {
  1664. var angleInRadians = degreesToRadians(angle);
  1665. return {
  1666. cos: cosFunc(angleInRadians),
  1667. sin: sinFunc(angleInRadians)
  1668. }
  1669. };
  1670. var DECIMAL_ORDER_THRESHOLD = 1e-14;
  1671. var getDistance = function(x1, y1, x2, y2) {
  1672. var diffX = x2 - x1;
  1673. var diffY = y2 - y1;
  1674. return Math.sqrt(diffY * diffY + diffX * diffX)
  1675. };
  1676. var getDecimalOrder = function(number) {
  1677. var n = abs(number);
  1678. var cn;
  1679. if (!_isNaN(n)) {
  1680. if (n > 0) {
  1681. n = log(n) / LN10;
  1682. cn = ceil(n);
  1683. return cn - n < DECIMAL_ORDER_THRESHOLD ? cn : floor(n)
  1684. }
  1685. return 0
  1686. }
  1687. return _NaN
  1688. };
  1689. var getAppropriateFormat = function(start, end, count) {
  1690. var order = max(getDecimalOrder(start), getDecimalOrder(end));
  1691. var precision = -getDecimalOrder(abs(end - start) / count);
  1692. var format;
  1693. if (!_isNaN(order) && !_isNaN(precision)) {
  1694. if (abs(order) <= 4) {
  1695. format = "fixedPoint";
  1696. precision < 0 && (precision = 0);
  1697. precision > 4 && (precision = 4)
  1698. } else {
  1699. format = "exponential";
  1700. precision += order - 1;
  1701. precision > 3 && (precision = 3)
  1702. }
  1703. return {
  1704. type: format,
  1705. precision: precision
  1706. }
  1707. }
  1708. return null
  1709. };
  1710. var roundValue = function(value, precision) {
  1711. if (precision > 20) {
  1712. precision = 20
  1713. }
  1714. if (isNumber(value)) {
  1715. if (isExponential(value)) {
  1716. return _Number(value.toExponential(precision))
  1717. } else {
  1718. return _Number(value.toFixed(precision))
  1719. }
  1720. }
  1721. };
  1722. var getPower = function(value) {
  1723. return value.toExponential().split("e")[1]
  1724. };
  1725. function map(array, callback) {
  1726. var i = 0;
  1727. var len = array.length;
  1728. var result = [];
  1729. while (i < len) {
  1730. var value = callback(array[i], i);
  1731. if (null !== value) {
  1732. result.push(value)
  1733. }
  1734. i++
  1735. }
  1736. return result
  1737. }
  1738. function selectByKeys(object, keys) {
  1739. return map(keys, function(key) {
  1740. return object[key] ? object[key] : null
  1741. })
  1742. }
  1743. function decreaseFields(object, keys, eachDecrease, decrease) {
  1744. var dec = decrease;
  1745. each(keys, function(_, key) {
  1746. if (object[key]) {
  1747. object[key] -= eachDecrease;
  1748. dec -= eachDecrease
  1749. }
  1750. });
  1751. return dec
  1752. }
  1753. function normalizeEnum(value) {
  1754. return String(value).toLowerCase()
  1755. }
  1756. function setCanvasValues(canvas) {
  1757. if (canvas) {
  1758. canvas.originalTop = canvas.top;
  1759. canvas.originalBottom = canvas.bottom;
  1760. canvas.originalLeft = canvas.left;
  1761. canvas.originalRight = canvas.right
  1762. }
  1763. return canvas
  1764. }
  1765. function normalizeBBoxField(value) {
  1766. return -MAX_PIXEL_COUNT < value && value < +MAX_PIXEL_COUNT ? value : 0
  1767. }
  1768. function normalizeBBox(bBox) {
  1769. var xl = normalizeBBoxField(floor(bBox.x));
  1770. var yt = normalizeBBoxField(floor(bBox.y));
  1771. var xr = normalizeBBoxField(ceil(bBox.width + bBox.x));
  1772. var yb = normalizeBBoxField(ceil(bBox.height + bBox.y));
  1773. var result = {
  1774. x: xl,
  1775. y: yt,
  1776. width: xr - xl,
  1777. height: yb - yt
  1778. };
  1779. result.isEmpty = !result.x && !result.y && !result.width && !result.height;
  1780. return result
  1781. }
  1782. function rotateBBox(bBox, center, angle) {
  1783. var cos = _Number(cosFunc(angle * PI_DIV_180).toFixed(3));
  1784. var sin = _Number(sinFunc(angle * PI_DIV_180).toFixed(3));
  1785. var w2 = bBox.width / 2;
  1786. var h2 = bBox.height / 2;
  1787. var centerX = bBox.x + w2;
  1788. var centerY = bBox.y + h2;
  1789. var w2_ = abs(w2 * cos) + abs(h2 * sin);
  1790. var h2_ = abs(w2 * sin) + abs(h2 * cos);
  1791. var centerX_ = center[0] + (centerX - center[0]) * cos + (centerY - center[1]) * sin;
  1792. var centerY_ = center[1] - (centerX - center[0]) * sin + (centerY - center[1]) * cos;
  1793. return normalizeBBox({
  1794. x: centerX_ - w2_,
  1795. y: centerY_ - h2_,
  1796. width: 2 * w2_,
  1797. height: 2 * h2_
  1798. })
  1799. }
  1800. extend(exports, {
  1801. decreaseGaps: function(object, keys, decrease) {
  1802. var arrayGaps;
  1803. do {
  1804. arrayGaps = selectByKeys(object, keys);
  1805. arrayGaps.push(_math.ceil(decrease / arrayGaps.length));
  1806. decrease = decreaseFields(object, keys, _math.min.apply(null, arrayGaps), decrease)
  1807. } while (decrease > 0 && arrayGaps.length > 1);
  1808. return decrease
  1809. },
  1810. normalizeEnum: normalizeEnum,
  1811. parseScalar: function(value, defaultValue) {
  1812. return void 0 !== value ? value : defaultValue
  1813. },
  1814. enumParser: function(values) {
  1815. var stored = {};
  1816. var i;
  1817. var ii;
  1818. for (i = 0, ii = values.length; i < ii; ++i) {
  1819. stored[normalizeEnum(values[i])] = 1
  1820. }
  1821. return function(value, defaultValue) {
  1822. var _value = normalizeEnum(value);
  1823. return stored[_value] ? _value : defaultValue
  1824. }
  1825. },
  1826. patchFontOptions: function(options) {
  1827. var fontOptions = {};
  1828. each(options || {}, function(key, value) {
  1829. if (/^(cursor|opacity)$/i.test(key)) {} else {
  1830. if ("color" === key) {
  1831. key = "fill"
  1832. } else {
  1833. key = "font-" + key
  1834. }
  1835. }
  1836. fontOptions[key] = value
  1837. });
  1838. return fontOptions
  1839. },
  1840. convertPolarToXY: function(centerCoords, startAngle, angle, radius) {
  1841. var shiftAngle = 90;
  1842. angle = isDefined(angle) ? angle + startAngle - shiftAngle : 0;
  1843. var cosSin = getCosAndSin(angle);
  1844. return {
  1845. x: _round(centerCoords.x + radius * cosSin.cos),
  1846. y: _round(centerCoords.y + radius * cosSin.sin)
  1847. }
  1848. },
  1849. convertXYToPolar: function(centerCoords, x, y) {
  1850. var radius = getDistance(centerCoords.x, centerCoords.y, x, y);
  1851. var angle = _math.atan2(y - centerCoords.y, x - centerCoords.x);
  1852. return {
  1853. phi: _round(normalizeAngle(180 * angle / _math.PI)),
  1854. r: _round(radius)
  1855. }
  1856. },
  1857. processSeriesTemplate: function(seriesTemplate, items) {
  1858. var customizeSeries = typeUtils.isFunction(seriesTemplate.customizeSeries) ? seriesTemplate.customizeSeries : noop;
  1859. var nameField = seriesTemplate.nameField;
  1860. var generatedSeries = {};
  1861. var seriesOrder = [];
  1862. var series;
  1863. var i = 0;
  1864. items = items || [];
  1865. for (var length = items.length; i < length; i++) {
  1866. var data = items[i];
  1867. if (nameField in data) {
  1868. series = generatedSeries[data[nameField]];
  1869. if (!series) {
  1870. series = generatedSeries[data[nameField]] = {
  1871. name: data[nameField],
  1872. nameFieldValue: data[nameField]
  1873. };
  1874. seriesOrder.push(series.name)
  1875. }
  1876. }
  1877. }
  1878. return map(seriesOrder, function(orderedName) {
  1879. var group = generatedSeries[orderedName];
  1880. return extend(group, customizeSeries.call(null, group.name))
  1881. })
  1882. },
  1883. getCategoriesInfo: function(categories, startValue, endValue) {
  1884. if (0 === categories.length) {
  1885. return {
  1886. categories: []
  1887. }
  1888. }
  1889. startValue = isDefined(startValue) ? startValue : categories[0];
  1890. endValue = isDefined(endValue) ? endValue : categories[categories.length - 1];
  1891. var categoriesValue = map(categories, function(category) {
  1892. return isDefined(category) ? category.valueOf() : null
  1893. });
  1894. var indexStartValue = categoriesValue.indexOf(startValue.valueOf());
  1895. var indexEndValue = categoriesValue.indexOf(endValue.valueOf());
  1896. var inverted = false;
  1897. indexStartValue < 0 && (indexStartValue = 0);
  1898. indexEndValue < 0 && (indexEndValue = categories.length - 1);
  1899. if (indexEndValue < indexStartValue) {
  1900. var swapBuf = indexEndValue;
  1901. indexEndValue = indexStartValue;
  1902. indexStartValue = swapBuf;
  1903. inverted = true
  1904. }
  1905. var visibleCategories = categories.slice(indexStartValue, indexEndValue + 1);
  1906. var lastIdx = visibleCategories.length - 1;
  1907. return {
  1908. categories: visibleCategories,
  1909. start: visibleCategories[inverted ? lastIdx : 0],
  1910. end: visibleCategories[inverted ? 0 : lastIdx],
  1911. inverted: inverted
  1912. }
  1913. },
  1914. setCanvasValues: setCanvasValues,
  1915. updatePanesCanvases: function(panes, canvas, rotated) {
  1916. var weightSum = 0;
  1917. each(panes, function(_, pane) {
  1918. pane.weight = pane.weight || 1;
  1919. weightSum += pane.weight
  1920. });
  1921. var distributedSpace = 0;
  1922. var padding = panes.padding || 10;
  1923. var paneSpace = rotated ? canvas.width - canvas.left - canvas.right : canvas.height - canvas.top - canvas.bottom;
  1924. var oneWeight = (paneSpace - padding * (panes.length - 1)) / weightSum;
  1925. var startName = rotated ? "left" : "top";
  1926. var endName = rotated ? "right" : "bottom";
  1927. each(panes, function(_, pane) {
  1928. var calcLength = _round(pane.weight * oneWeight);
  1929. pane.canvas = pane.canvas || {};
  1930. extend(pane.canvas, canvas);
  1931. pane.canvas[startName] = canvas[startName] + distributedSpace;
  1932. pane.canvas[endName] = canvas[endName] + (paneSpace - calcLength - distributedSpace);
  1933. distributedSpace = distributedSpace + calcLength + padding;
  1934. setCanvasValues(pane.canvas)
  1935. })
  1936. },
  1937. unique: function(array) {
  1938. var values = {};
  1939. return map(array, function(item) {
  1940. var result = !values[item] ? item : null;
  1941. values[item] = true;
  1942. return result
  1943. })
  1944. },
  1945. map: map,
  1946. getVerticallyShiftedAngularCoords: function(bBox, dy, center) {
  1947. var isPositive = bBox.x + bBox.width / 2 >= center.x;
  1948. var horizontalOffset1 = (isPositive ? bBox.x : bBox.x + bBox.width) - center.x;
  1949. var verticalOffset1 = bBox.y - center.y;
  1950. var verticalOffset2 = verticalOffset1 + dy;
  1951. var horizontalOffset2 = _round(_sqrt(horizontalOffset1 * horizontalOffset1 + verticalOffset1 * verticalOffset1 - verticalOffset2 * verticalOffset2));
  1952. var dx = (isPositive ? +horizontalOffset2 : -horizontalOffset2) || horizontalOffset1;
  1953. return {
  1954. x: center.x + (isPositive ? dx : dx - bBox.width),
  1955. y: bBox.y + dy
  1956. }
  1957. },
  1958. mergeMarginOptions: function(opt1, opt2) {
  1959. return {
  1960. checkInterval: opt1.checkInterval || opt2.checkInterval,
  1961. size: Math.max(opt1.size || 0, opt2.size || 0),
  1962. percentStick: opt1.percentStick || opt2.percentStick,
  1963. sizePointNormalState: Math.max(opt1.sizePointNormalState || 0, opt2.sizePointNormalState || 0)
  1964. }
  1965. }
  1966. });
  1967. function getVizRangeObject(value) {
  1968. if (Array.isArray(value)) {
  1969. return {
  1970. startValue: value[0],
  1971. endValue: value[1]
  1972. }
  1973. } else {
  1974. return value || {}
  1975. }
  1976. }
  1977. function convertVisualRangeObject(visualRange, convertToVisualRange) {
  1978. if (convertToVisualRange) {
  1979. return visualRange
  1980. }
  1981. return [visualRange.startValue, visualRange.endValue]
  1982. }
  1983. function getAddFunction(range, correctZeroLevel) {
  1984. if ("datetime" === range.dataType) {
  1985. return function(rangeValue, marginValue) {
  1986. var sign = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;
  1987. return new Date(rangeValue.getTime() + sign * marginValue)
  1988. }
  1989. }
  1990. if ("logarithmic" === range.axisType) {
  1991. return function(rangeValue, marginValue) {
  1992. var sign = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;
  1993. var log = getLog(rangeValue, range.base) + sign * marginValue;
  1994. return raiseTo(log, range.base)
  1995. }
  1996. }
  1997. return function(rangeValue, marginValue) {
  1998. var sign = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1;
  1999. var newValue = rangeValue + sign * marginValue;
  2000. return correctZeroLevel && newValue * rangeValue <= 0 ? 0 : newValue
  2001. }
  2002. }
  2003. function adjustVisualRange(options, visualRange, wholeRange, dataRange) {
  2004. var minDefined = typeUtils.isDefined(visualRange.startValue);
  2005. var maxDefined = typeUtils.isDefined(visualRange.endValue);
  2006. var nonDiscrete = "discrete" !== options.axisType;
  2007. dataRange = dataRange || wholeRange;
  2008. var add = getAddFunction(options, false);
  2009. var min = minDefined ? visualRange.startValue : dataRange.min;
  2010. var max = maxDefined ? visualRange.endValue : dataRange.max;
  2011. var rangeLength = visualRange.length;
  2012. var categories = dataRange.categories;
  2013. if (nonDiscrete && !typeUtils.isDefined(min) && !typeUtils.isDefined(max)) {
  2014. return {
  2015. startValue: min,
  2016. endValue: max
  2017. }
  2018. }
  2019. if (isDefined(rangeLength)) {
  2020. if (nonDiscrete) {
  2021. if ("datetime" === options.dataType && !isNumber(rangeLength)) {
  2022. rangeLength = dateToMilliseconds(rangeLength)
  2023. }
  2024. if (maxDefined && !minDefined || !maxDefined && !minDefined) {
  2025. isDefined(wholeRange.max) && (max = max > wholeRange.max ? wholeRange.max : max);
  2026. min = add(max, rangeLength, -1)
  2027. } else {
  2028. if (minDefined && !maxDefined) {
  2029. isDefined(wholeRange.min) && (min = min < wholeRange.min ? wholeRange.min : min);
  2030. max = add(min, rangeLength)
  2031. }
  2032. }
  2033. } else {
  2034. rangeLength = parseInt(rangeLength);
  2035. if (!isNaN(rangeLength) && isFinite(rangeLength)) {
  2036. rangeLength--;
  2037. if (!maxDefined && !minDefined) {
  2038. max = categories[categories.length - 1];
  2039. min = categories[categories.length - 1 - rangeLength]
  2040. } else {
  2041. if (minDefined && !maxDefined) {
  2042. var categoriesInfo = exports.getCategoriesInfo(categories, min, void 0);
  2043. max = categoriesInfo.categories[rangeLength]
  2044. } else {
  2045. if (!minDefined && maxDefined) {
  2046. var _categoriesInfo = exports.getCategoriesInfo(categories, void 0, max);
  2047. min = _categoriesInfo.categories[_categoriesInfo.categories.length - 1 - rangeLength]
  2048. }
  2049. }
  2050. }
  2051. }
  2052. }
  2053. }
  2054. if (nonDiscrete) {
  2055. if (isDefined(wholeRange.max) && max > wholeRange.max) {
  2056. max = wholeRange.max
  2057. }
  2058. if (isDefined(wholeRange.min) && min < wholeRange.min) {
  2059. min = wholeRange.min
  2060. }
  2061. }
  2062. return {
  2063. startValue: min,
  2064. endValue: max
  2065. }
  2066. }
  2067. exports.getVizRangeObject = getVizRangeObject;
  2068. exports.convertVisualRangeObject = convertVisualRangeObject;
  2069. exports.adjustVisualRange = adjustVisualRange;
  2070. exports.getAddFunction = getAddFunction;
  2071. exports.getLog = getLog;
  2072. exports.getAdjustedLog10 = getAdjustedLog10;
  2073. exports.raiseTo = raiseTo;
  2074. exports.normalizeAngle = normalizeAngle;
  2075. exports.convertAngleToRendererSpace = convertAngleToRendererSpace;
  2076. exports.degreesToRadians = degreesToRadians;
  2077. exports.getCosAndSin = getCosAndSin;
  2078. exports.getDecimalOrder = getDecimalOrder;
  2079. exports.getAppropriateFormat = getAppropriateFormat;
  2080. exports.getDistance = getDistance;
  2081. exports.roundValue = roundValue;
  2082. exports.getPower = getPower;
  2083. exports.rotateBBox = rotateBBox;
  2084. exports.normalizeBBox = normalizeBBox
  2085. },
  2086. /*!**************************************************!*\
  2087. !*** ./artifacts/transpiled/core/dom_adapter.js ***!
  2088. \**************************************************/
  2089. /*! dynamic exports provided */
  2090. /*! all exports used */
  2091. function(module, exports, __webpack_require__) {
  2092. var _dependency_injector = __webpack_require__( /*! ./utils/dependency_injector */ 54);
  2093. var _dependency_injector2 = _interopRequireDefault(_dependency_injector);
  2094. var _common = __webpack_require__( /*! ./utils/common */ 4);
  2095. function _interopRequireDefault(obj) {
  2096. return obj && obj.__esModule ? obj : {
  2097. "default": obj
  2098. }
  2099. }
  2100. function _typeof(obj) {
  2101. "@babel/helpers - typeof";
  2102. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  2103. return typeof obj
  2104. } : function(obj) {
  2105. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  2106. }, _typeof(obj)
  2107. }
  2108. var ELEMENT_NODE = 1;
  2109. var TEXT_NODE = 3;
  2110. var DOCUMENT_NODE = 9;
  2111. var nativeDOMAdapterStrategy = {
  2112. querySelectorAll: function(element, selector) {
  2113. return element.querySelectorAll(selector)
  2114. },
  2115. elementMatches: function(element, selector) {
  2116. var _this = this;
  2117. var matches = element.matches || element.matchesSelector || element.mozMatchesSelector || element.msMatchesSelector || element.oMatchesSelector || element.webkitMatchesSelector || function(selector) {
  2118. var doc = element.document || element.ownerDocument;
  2119. if (!doc) {
  2120. return false
  2121. }
  2122. var items = _this.querySelectorAll(doc, selector);
  2123. for (var i = 0; i < items.length; i++) {
  2124. if (items[i] === element) {
  2125. return true
  2126. }
  2127. }
  2128. };
  2129. return matches.call(element, selector)
  2130. },
  2131. createElement: function(tagName, context) {
  2132. context = context || this._document;
  2133. return context.createElement(tagName)
  2134. },
  2135. createElementNS: function(ns, tagName, context) {
  2136. context = context || this._document;
  2137. return context.createElementNS(ns, tagName)
  2138. },
  2139. createTextNode: function(text, context) {
  2140. context = context || this._document;
  2141. return context.createTextNode(text)
  2142. },
  2143. isNode: function(element) {
  2144. return "object" === _typeof(element) && "nodeType" in element
  2145. },
  2146. isElementNode: function(element) {
  2147. return element && element.nodeType === ELEMENT_NODE
  2148. },
  2149. isTextNode: function(element) {
  2150. return element && element.nodeType === TEXT_NODE
  2151. },
  2152. isDocument: function(element) {
  2153. return element && element.nodeType === DOCUMENT_NODE
  2154. },
  2155. removeElement: function(element) {
  2156. var parentNode = element && element.parentNode;
  2157. if (parentNode) {
  2158. parentNode.removeChild(element)
  2159. }
  2160. },
  2161. insertElement: function(parentElement, newElement, nextSiblingElement) {
  2162. if (parentElement && newElement && parentElement !== newElement) {
  2163. if (nextSiblingElement) {
  2164. parentElement.insertBefore(newElement, nextSiblingElement)
  2165. } else {
  2166. parentElement.appendChild(newElement)
  2167. }
  2168. }
  2169. },
  2170. getAttribute: function(element, name) {
  2171. return element.getAttribute(name)
  2172. },
  2173. setAttribute: function(element, name, value) {
  2174. element.setAttribute(name, value)
  2175. },
  2176. removeAttribute: function(element, name) {
  2177. element.removeAttribute(name)
  2178. },
  2179. setProperty: function(element, name, value) {
  2180. element[name] = value
  2181. },
  2182. setText: function(element, text) {
  2183. if (element) {
  2184. element.textContent = text
  2185. }
  2186. },
  2187. setClass: function(element, className, isAdd) {
  2188. if (1 === element.nodeType && className) {
  2189. if (element.classList) {
  2190. if (isAdd) {
  2191. element.classList.add(className)
  2192. } else {
  2193. element.classList.remove(className)
  2194. }
  2195. } else {
  2196. var classNameSupported = "string" === typeof element.className;
  2197. var elementClass = classNameSupported ? element.className : this.getAttribute(element, "class") || "";
  2198. var classNames = elementClass.split(" ");
  2199. var classIndex = classNames.indexOf(className);
  2200. var resultClassName;
  2201. if (isAdd && classIndex < 0) {
  2202. resultClassName = elementClass ? elementClass + " " + className : className
  2203. }
  2204. if (!isAdd && classIndex >= 0) {
  2205. classNames.splice(classIndex, 1);
  2206. resultClassName = classNames.join(" ")
  2207. }
  2208. if (void 0 !== resultClassName) {
  2209. if (classNameSupported) {
  2210. element.className = resultClassName
  2211. } else {
  2212. this.setAttribute(element, "class", resultClassName)
  2213. }
  2214. }
  2215. }
  2216. }
  2217. },
  2218. setStyle: function(element, name, value) {
  2219. element.style[name] = value || ""
  2220. },
  2221. _document: "undefined" === typeof document ? void 0 : document,
  2222. getDocument: function() {
  2223. return this._document
  2224. },
  2225. getActiveElement: function() {
  2226. return this._document.activeElement
  2227. },
  2228. getBody: function() {
  2229. return this._document.body
  2230. },
  2231. createDocumentFragment: function() {
  2232. return this._document.createDocumentFragment()
  2233. },
  2234. getDocumentElement: function() {
  2235. return this._document.documentElement
  2236. },
  2237. getLocation: function() {
  2238. return this._document.location
  2239. },
  2240. getSelection: function() {
  2241. return this._document.selection
  2242. },
  2243. getReadyState: function() {
  2244. return this._document.readyState
  2245. },
  2246. getHead: function() {
  2247. return this._document.head
  2248. },
  2249. hasDocumentProperty: function(property) {
  2250. return property in this._document
  2251. },
  2252. listen: function(element, event, callback, options) {
  2253. if (!element || !("addEventListener" in element)) {
  2254. return _common.noop
  2255. }
  2256. element.addEventListener(event, callback, options);
  2257. return function() {
  2258. element.removeEventListener(event, callback)
  2259. }
  2260. }
  2261. };
  2262. module.exports = (0, _dependency_injector2.default)(nativeDOMAdapterStrategy)
  2263. },
  2264. /*!************************************************!*\
  2265. !*** ./artifacts/transpiled/core/utils/dom.js ***!
  2266. \************************************************/
  2267. /*! dynamic exports provided */
  2268. /*! all exports used */
  2269. function(module, exports, __webpack_require__) {
  2270. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  2271. var config = __webpack_require__( /*! ../../core/config */ 31);
  2272. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  2273. var windowUtils = __webpack_require__( /*! ./window */ 7);
  2274. var window = windowUtils.getWindow();
  2275. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  2276. var inArray = __webpack_require__( /*! ./array */ 14).inArray;
  2277. var typeUtils = __webpack_require__( /*! ./type */ 1);
  2278. var isDefined = typeUtils.isDefined;
  2279. var isRenderer = typeUtils.isRenderer;
  2280. var htmlParser = __webpack_require__( /*! ../../core/utils/html_parser */ 255);
  2281. var elementStrategy;
  2282. var resetActiveElement = function() {
  2283. var activeElement = domAdapter.getActiveElement();
  2284. var body = domAdapter.getBody();
  2285. if (activeElement && activeElement !== body && activeElement.blur) {
  2286. try {
  2287. activeElement.blur()
  2288. } catch (e) {
  2289. body.blur()
  2290. }
  2291. }
  2292. };
  2293. var clearSelection = function() {
  2294. var selection = window.getSelection();
  2295. if (!selection) {
  2296. return
  2297. }
  2298. if ("Caret" === selection.type) {
  2299. return
  2300. }
  2301. if (selection.empty) {
  2302. selection.empty()
  2303. } else {
  2304. if (selection.removeAllRanges) {
  2305. try {
  2306. selection.removeAllRanges()
  2307. } catch (e) {}
  2308. }
  2309. }
  2310. };
  2311. var closestCommonParent = function(startTarget, endTarget) {
  2312. var $startTarget = $(startTarget);
  2313. var $endTarget = $(endTarget);
  2314. if ($startTarget[0] === $endTarget[0]) {
  2315. return $startTarget[0]
  2316. }
  2317. var $startParents = $startTarget.parents();
  2318. var $endParents = $endTarget.parents();
  2319. var startingParent = Math.min($startParents.length, $endParents.length);
  2320. for (var i = -startingParent; i < 0; i++) {
  2321. if ($startParents.get(i) === $endParents.get(i)) {
  2322. return $startParents.get(i)
  2323. }
  2324. }
  2325. };
  2326. var triggerVisibilityChangeEvent = function(eventName) {
  2327. var VISIBILITY_CHANGE_SELECTOR = ".dx-visibility-change-handler";
  2328. return function(element) {
  2329. var $element = $(element || "body");
  2330. var changeHandlers = $element.filter(VISIBILITY_CHANGE_SELECTOR).add($element.find(VISIBILITY_CHANGE_SELECTOR));
  2331. for (var i = 0; i < changeHandlers.length; i++) {
  2332. eventsEngine.triggerHandler(changeHandlers[i], eventName)
  2333. }
  2334. }
  2335. };
  2336. var uniqueId = function() {
  2337. var counter = 0;
  2338. return function(prefix) {
  2339. return (prefix || "") + counter++
  2340. }
  2341. }();
  2342. var dataOptionsAttributeName = "data-options";
  2343. var getElementOptions = function(element) {
  2344. var optionsString = $(element).attr(dataOptionsAttributeName) || "";
  2345. return config().optionsParser(optionsString)
  2346. };
  2347. var createComponents = function(elements, componentTypes) {
  2348. var result = [];
  2349. var selector = "[" + dataOptionsAttributeName + "]";
  2350. var $items = elements.find(selector).add(elements.filter(selector));
  2351. $items.each(function(index, element) {
  2352. var $element = $(element);
  2353. var options = getElementOptions(element);
  2354. for (var componentName in options) {
  2355. if (!componentTypes || inArray(componentName, componentTypes) > -1) {
  2356. if ($element[componentName]) {
  2357. $element[componentName](options[componentName]);
  2358. result.push($element[componentName]("instance"))
  2359. }
  2360. }
  2361. }
  2362. });
  2363. return result
  2364. };
  2365. var createMarkupFromString = function(str) {
  2366. if (!window.WinJS) {
  2367. return $(htmlParser.parseHTML(str))
  2368. }
  2369. var tempElement = $("<div>");
  2370. window.WinJS.Utilities.setInnerHTMLUnsafe(tempElement.get(0), str);
  2371. return tempElement.contents()
  2372. };
  2373. var extractTemplateMarkup = function(element) {
  2374. element = $(element);
  2375. var templateTag = element.length && element.filter(function() {
  2376. var $node = $(this);
  2377. return $node.is("script[type]") && $node.attr("type").indexOf("script") < 0
  2378. });
  2379. if (templateTag.length) {
  2380. return templateTag.eq(0).html()
  2381. } else {
  2382. element = $("<div>").append(element);
  2383. return element.html()
  2384. }
  2385. };
  2386. var normalizeTemplateElement = function normalizeTemplateElement(element) {
  2387. var $element = isDefined(element) && (element.nodeType || isRenderer(element)) ? $(element) : $("<div>").html(element).contents();
  2388. if (1 === $element.length) {
  2389. if ($element.is("script")) {
  2390. $element = normalizeTemplateElement($element.html().trim())
  2391. } else {
  2392. if ($element.is("table")) {
  2393. $element = $element.children("tbody").contents()
  2394. }
  2395. }
  2396. }
  2397. return $element
  2398. };
  2399. var clipboardText = function(event, text) {
  2400. var clipboard = event.originalEvent && event.originalEvent.clipboardData || window.clipboardData;
  2401. if (1 === arguments.length) {
  2402. return clipboard && clipboard.getData("Text")
  2403. }
  2404. clipboard && clipboard.setData("Text", text)
  2405. };
  2406. var contains = function(container, element) {
  2407. if (!element) {
  2408. return false
  2409. }
  2410. element = domAdapter.isTextNode(element) ? element.parentNode : element;
  2411. return domAdapter.isDocument(container) ? container.documentElement.contains(element) : container.contains(element)
  2412. };
  2413. var getPublicElement = function($element) {
  2414. return elementStrategy($element)
  2415. };
  2416. var setPublicElementWrapper = function(value) {
  2417. elementStrategy = value
  2418. };
  2419. setPublicElementWrapper(function(element) {
  2420. return element && element.get(0)
  2421. });
  2422. var createTextElementHiddenCopy = function(element, text, options) {
  2423. var elementStyles = window.getComputedStyle($(element).get(0));
  2424. var includePaddings = options && options.includePaddings;
  2425. return $("<div>").text(text).css({
  2426. fontStyle: elementStyles.fontStyle,
  2427. fontVariant: elementStyles.fontVariant,
  2428. fontWeight: elementStyles.fontWeight,
  2429. fontSize: elementStyles.fontSize,
  2430. fontFamily: elementStyles.fontFamily,
  2431. letterSpacing: elementStyles.letterSpacing,
  2432. border: elementStyles.border,
  2433. paddingTop: includePaddings ? elementStyles.paddingTop : "",
  2434. paddingRight: includePaddings ? elementStyles.paddingRight : "",
  2435. paddingBottom: includePaddings ? elementStyles.paddingBottom : "",
  2436. paddingLeft: includePaddings ? elementStyles.paddingLeft : "",
  2437. visibility: "hidden",
  2438. whiteSpace: "nowrap",
  2439. position: "absolute",
  2440. "float": "left"
  2441. })
  2442. };
  2443. exports.setPublicElementWrapper = setPublicElementWrapper;
  2444. exports.resetActiveElement = resetActiveElement;
  2445. exports.createMarkupFromString = createMarkupFromString;
  2446. exports.triggerShownEvent = triggerVisibilityChangeEvent("dxshown");
  2447. exports.triggerHidingEvent = triggerVisibilityChangeEvent("dxhiding");
  2448. exports.triggerResizeEvent = triggerVisibilityChangeEvent("dxresize");
  2449. exports.getElementOptions = getElementOptions;
  2450. exports.createComponents = createComponents;
  2451. exports.extractTemplateMarkup = extractTemplateMarkup;
  2452. exports.normalizeTemplateElement = normalizeTemplateElement;
  2453. exports.clearSelection = clearSelection;
  2454. exports.uniqueId = uniqueId;
  2455. exports.closestCommonParent = closestCommonParent;
  2456. exports.clipboardText = clipboardText;
  2457. exports.contains = contains;
  2458. exports.getPublicElement = getPublicElement;
  2459. exports.createTextElementHiddenCopy = createTextElementHiddenCopy
  2460. },
  2461. /*!******************************************************!*\
  2462. !*** ./artifacts/transpiled/localization/message.js ***!
  2463. \******************************************************/
  2464. /*! dynamic exports provided */
  2465. /*! all exports used */
  2466. function(module, exports, __webpack_require__) {
  2467. var $ = __webpack_require__( /*! ../core/renderer */ 2);
  2468. var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54);
  2469. var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
  2470. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  2471. var stringFormat = __webpack_require__( /*! ../core/utils/string */ 44).format;
  2472. var humanize = __webpack_require__( /*! ../core/utils/inflector */ 33).humanize;
  2473. var coreLocalization = __webpack_require__( /*! ./core */ 87);
  2474. __webpack_require__( /*! ./core */ 87);
  2475. var PARENT_LOCALE_SEPARATOR = "-";
  2476. var baseDictionary = extend(true, {}, __webpack_require__( /*! ./default_messages */ 443));
  2477. var parentLocales = __webpack_require__( /*! ./cldr-data/parentLocales */ 444);
  2478. var getParentLocale = function(locale) {
  2479. var parentLocale = parentLocales[locale];
  2480. if (parentLocale) {
  2481. return "root" !== parentLocale && parentLocale
  2482. }
  2483. return locale.substr(0, locale.lastIndexOf(PARENT_LOCALE_SEPARATOR))
  2484. };
  2485. var getDataByLocale = function(localeData, locale) {
  2486. return localeData[locale] || {}
  2487. };
  2488. var getValueByClosestLocale = function(localeData, locale, key) {
  2489. var value = getDataByLocale(localeData, locale)[key];
  2490. var isRootLocale;
  2491. while (!value && !isRootLocale) {
  2492. locale = getParentLocale(locale);
  2493. if (locale) {
  2494. value = getDataByLocale(localeData, locale)[key]
  2495. } else {
  2496. isRootLocale = true
  2497. }
  2498. }
  2499. return value
  2500. };
  2501. var newMessages = {};
  2502. var messageLocalization = dependencyInjector({
  2503. _dictionary: baseDictionary,
  2504. load: function(messages) {
  2505. extend(true, this._dictionary, messages)
  2506. },
  2507. _localizablePrefix: "@",
  2508. setup: function(localizablePrefix) {
  2509. this._localizablePrefix = localizablePrefix
  2510. },
  2511. localizeString: function(text) {
  2512. var that = this;
  2513. var regex = new RegExp("(^|[^a-zA-Z_0-9" + that._localizablePrefix + "-]+)(" + that._localizablePrefix + "{1,2})([a-zA-Z_0-9-]+)", "g");
  2514. var escapeString = that._localizablePrefix + that._localizablePrefix;
  2515. return text.replace(regex, function(str, prefix, escape, localizationKey) {
  2516. var defaultResult = that._localizablePrefix + localizationKey;
  2517. var result;
  2518. if (escape !== escapeString) {
  2519. result = that.format(localizationKey)
  2520. }
  2521. if (!result) {
  2522. newMessages[localizationKey] = humanize(localizationKey)
  2523. }
  2524. return prefix + (result || defaultResult)
  2525. })
  2526. },
  2527. _messageLoaded: function(key, locale) {
  2528. return void 0 !== getValueByClosestLocale(this._dictionary, locale || coreLocalization.locale(), key)
  2529. },
  2530. localizeNode: function(node) {
  2531. var that = this;
  2532. $(node).each(function(index, nodeItem) {
  2533. if (!nodeItem.nodeType) {
  2534. return
  2535. }
  2536. if (3 === nodeItem.nodeType) {
  2537. nodeItem.nodeValue = that.localizeString(nodeItem.nodeValue)
  2538. } else {
  2539. if (!$(nodeItem).is("iframe")) {
  2540. each(nodeItem.attributes || [], function(index, attr) {
  2541. if ("string" === typeof attr.value) {
  2542. var localizedValue = that.localizeString(attr.value);
  2543. if (attr.value !== localizedValue) {
  2544. attr.value = localizedValue
  2545. }
  2546. }
  2547. });
  2548. $(nodeItem).contents().each(function(index, node) {
  2549. that.localizeNode(node)
  2550. })
  2551. }
  2552. }
  2553. })
  2554. },
  2555. getMessagesByLocales: function() {
  2556. return this._dictionary
  2557. },
  2558. getDictionary: function(onlyNew) {
  2559. if (onlyNew) {
  2560. return newMessages
  2561. }
  2562. return extend({}, newMessages, this.getMessagesByLocales()[coreLocalization.locale()])
  2563. },
  2564. getFormatter: function(key) {
  2565. return this._getFormatterBase(key) || this._getFormatterBase(key, "en")
  2566. },
  2567. _getFormatterBase: function(key, locale) {
  2568. var message = getValueByClosestLocale(this._dictionary, locale || coreLocalization.locale(), key);
  2569. if (message) {
  2570. return function() {
  2571. var args = 1 === arguments.length && Array.isArray(arguments[0]) ? arguments[0].slice(0) : Array.prototype.slice.call(arguments, 0);
  2572. args.unshift(message);
  2573. return stringFormat.apply(this, args)
  2574. }
  2575. }
  2576. },
  2577. format: function(key) {
  2578. var formatter = this.getFormatter(key);
  2579. var values = Array.prototype.slice.call(arguments, 1);
  2580. return formatter && formatter.apply(this, values) || ""
  2581. }
  2582. });
  2583. module.exports = messageLocalization
  2584. },
  2585. /*!**************************************************!*\
  2586. !*** ./artifacts/transpiled/core/utils/array.js ***!
  2587. \**************************************************/
  2588. /*! dynamic exports provided */
  2589. /*! all exports used */
  2590. function(module, exports, __webpack_require__) {
  2591. var isDefined = __webpack_require__( /*! ./type */ 1).isDefined;
  2592. var each = __webpack_require__( /*! ./iterator */ 3).each;
  2593. var objectUtils = __webpack_require__( /*! ./object */ 47);
  2594. var config = __webpack_require__( /*! ../config */ 31);
  2595. var isEmpty = function(entity) {
  2596. return Array.isArray(entity) && !entity.length
  2597. };
  2598. var wrapToArray = function(entity) {
  2599. return Array.isArray(entity) ? entity : [entity]
  2600. };
  2601. var intersection = function(a, b) {
  2602. if (!Array.isArray(a) || 0 === a.length || !Array.isArray(b) || 0 === b.length) {
  2603. return []
  2604. }
  2605. var result = [];
  2606. each(a, function(_, value) {
  2607. var index = inArray(value, b);
  2608. if (index !== -1) {
  2609. result.push(value)
  2610. }
  2611. });
  2612. return result
  2613. };
  2614. var removeDuplicates = function(from, what) {
  2615. if (!Array.isArray(from) || 0 === from.length) {
  2616. return []
  2617. }
  2618. if (!Array.isArray(what) || 0 === what.length) {
  2619. return from.slice()
  2620. }
  2621. var result = [];
  2622. each(from, function(_, value) {
  2623. var index = inArray(value, what);
  2624. if (index === -1) {
  2625. result.push(value)
  2626. }
  2627. });
  2628. return result
  2629. };
  2630. var normalizeIndexes = function(items, indexParameterName, currentItem, needIndexCallback) {
  2631. var indexedItems = {};
  2632. var parameterIndex = 0;
  2633. var useLegacyVisibleIndex = config().useLegacyVisibleIndex;
  2634. each(items, function(index, item) {
  2635. index = item[indexParameterName];
  2636. if (index >= 0) {
  2637. indexedItems[index] = indexedItems[index] || [];
  2638. if (item === currentItem) {
  2639. indexedItems[index].unshift(item)
  2640. } else {
  2641. indexedItems[index].push(item)
  2642. }
  2643. } else {
  2644. item[indexParameterName] = void 0
  2645. }
  2646. });
  2647. if (!useLegacyVisibleIndex) {
  2648. each(items, function() {
  2649. if (!isDefined(this[indexParameterName]) && (!needIndexCallback || needIndexCallback(this))) {
  2650. while (indexedItems[parameterIndex]) {
  2651. parameterIndex++
  2652. }
  2653. indexedItems[parameterIndex] = [this];
  2654. parameterIndex++
  2655. }
  2656. })
  2657. }
  2658. parameterIndex = 0;
  2659. objectUtils.orderEach(indexedItems, function(index, items) {
  2660. each(items, function() {
  2661. if (index >= 0) {
  2662. this[indexParameterName] = parameterIndex++
  2663. }
  2664. })
  2665. });
  2666. if (useLegacyVisibleIndex) {
  2667. each(items, function() {
  2668. if (!isDefined(this[indexParameterName]) && (!needIndexCallback || needIndexCallback(this))) {
  2669. this[indexParameterName] = parameterIndex++
  2670. }
  2671. })
  2672. }
  2673. return parameterIndex
  2674. };
  2675. var inArray = function(value, object) {
  2676. if (!object) {
  2677. return -1
  2678. }
  2679. var array = Array.isArray(object) ? object : object.toArray();
  2680. return array.indexOf(value)
  2681. };
  2682. var merge = function(array1, array2) {
  2683. for (var i = 0; i < array2.length; i++) {
  2684. array1[array1.length] = array2[i]
  2685. }
  2686. return array1
  2687. };
  2688. var find = function(array, condition) {
  2689. for (var i = 0; i < array.length; i++) {
  2690. if (condition(array[i])) {
  2691. return array[i]
  2692. }
  2693. }
  2694. };
  2695. exports.isEmpty = isEmpty;
  2696. exports.wrapToArray = wrapToArray;
  2697. exports.intersection = intersection;
  2698. exports.removeDuplicates = removeDuplicates;
  2699. exports.normalizeIndexes = normalizeIndexes;
  2700. exports.inArray = inArray;
  2701. exports.merge = merge;
  2702. exports.find = find
  2703. },
  2704. /*!********************************************!*\
  2705. !*** ./artifacts/transpiled/core/class.js ***!
  2706. \********************************************/
  2707. /*! dynamic exports provided */
  2708. /*! all exports used */
  2709. function(module, exports, __webpack_require__) {
  2710. var errors = __webpack_require__( /*! ./errors */ 21);
  2711. var typeUtils = __webpack_require__( /*! ./utils/type */ 1);
  2712. var wrapOverridden = function(baseProto, methodName, method) {
  2713. return function() {
  2714. var prevCallBase = this.callBase;
  2715. this.callBase = baseProto[methodName];
  2716. try {
  2717. return method.apply(this, arguments)
  2718. } finally {
  2719. this.callBase = prevCallBase
  2720. }
  2721. }
  2722. };
  2723. var clonePrototype = function(obj) {
  2724. var func = function() {};
  2725. func.prototype = obj.prototype;
  2726. return new func
  2727. };
  2728. var redefine = function(members) {
  2729. var that = this;
  2730. var overridden;
  2731. var memberName;
  2732. var member;
  2733. if (!members) {
  2734. return that
  2735. }
  2736. for (memberName in members) {
  2737. member = members[memberName];
  2738. overridden = "function" === typeof that.prototype[memberName] && "function" === typeof member;
  2739. that.prototype[memberName] = overridden ? wrapOverridden(that.parent.prototype, memberName, member) : member
  2740. }
  2741. return that
  2742. };
  2743. var include = function() {
  2744. var classObj = this;
  2745. var argument;
  2746. var name;
  2747. var i;
  2748. var hasClassObjOwnProperty = Object.prototype.hasOwnProperty.bind(classObj);
  2749. var isES6Class = !hasClassObjOwnProperty("_includedCtors") && !hasClassObjOwnProperty("_includedPostCtors");
  2750. if (isES6Class) {
  2751. classObj._includedCtors = classObj._includedCtors.slice(0);
  2752. classObj._includedPostCtors = classObj._includedPostCtors.slice(0)
  2753. }
  2754. for (i = 0; i < arguments.length; i++) {
  2755. argument = arguments[i];
  2756. if (argument.ctor) {
  2757. classObj._includedCtors.push(argument.ctor)
  2758. }
  2759. if (argument.postCtor) {
  2760. classObj._includedPostCtors.push(argument.postCtor)
  2761. }
  2762. for (name in argument) {
  2763. if ("ctor" === name || "postCtor" === name) {
  2764. continue
  2765. }
  2766. if (name in classObj.prototype) {
  2767. throw errors.Error("E0002", name)
  2768. }
  2769. classObj.prototype[name] = argument[name]
  2770. }
  2771. }
  2772. return classObj
  2773. };
  2774. var subclassOf = function(parentClass) {
  2775. if (this.parent === parentClass) {
  2776. return true
  2777. }
  2778. if (!this.parent || !this.parent.subclassOf) {
  2779. return false
  2780. }
  2781. return this.parent.subclassOf(parentClass)
  2782. };
  2783. var abstract = function() {
  2784. throw errors.Error("E0001")
  2785. };
  2786. var copyStatic = function() {
  2787. var hasOwn = Object.prototype.hasOwnProperty;
  2788. return function(source, destination) {
  2789. for (var key in source) {
  2790. if (!hasOwn.call(source, key)) {
  2791. return
  2792. }
  2793. destination[key] = source[key]
  2794. }
  2795. }
  2796. }();
  2797. var classImpl = function() {};
  2798. classImpl.inherit = function(members) {
  2799. var inheritor = function() {
  2800. if (!this || typeUtils.isWindow(this) || "function" !== typeof this.constructor) {
  2801. throw errors.Error("E0003")
  2802. }
  2803. var instance = this;
  2804. var ctor = instance.ctor;
  2805. var includedCtors = instance.constructor._includedCtors;
  2806. var includedPostCtors = instance.constructor._includedPostCtors;
  2807. var i;
  2808. for (i = 0; i < includedCtors.length; i++) {
  2809. includedCtors[i].call(instance)
  2810. }
  2811. if (ctor) {
  2812. ctor.apply(instance, arguments)
  2813. }
  2814. for (i = 0; i < includedPostCtors.length; i++) {
  2815. includedPostCtors[i].call(instance)
  2816. }
  2817. };
  2818. inheritor.prototype = clonePrototype(this);
  2819. copyStatic(this, inheritor);
  2820. inheritor.inherit = this.inherit;
  2821. inheritor.abstract = abstract;
  2822. inheritor.redefine = redefine;
  2823. inheritor.include = include;
  2824. inheritor.subclassOf = subclassOf;
  2825. inheritor.parent = this;
  2826. inheritor._includedCtors = this._includedCtors ? this._includedCtors.slice(0) : [];
  2827. inheritor._includedPostCtors = this._includedPostCtors ? this._includedPostCtors.slice(0) : [];
  2828. inheritor.prototype.constructor = inheritor;
  2829. inheritor.redefine(members);
  2830. return inheritor
  2831. };
  2832. classImpl.abstract = abstract;
  2833. module.exports = classImpl
  2834. },
  2835. /*!**********************************************!*\
  2836. !*** ./artifacts/transpiled/core/devices.js ***!
  2837. \**********************************************/
  2838. /*! dynamic exports provided */
  2839. /*! all exports used */
  2840. function(module, exports, __webpack_require__) {
  2841. var $ = __webpack_require__( /*! ../core/renderer */ 2);
  2842. var windowUtils = __webpack_require__( /*! ./utils/window */ 7);
  2843. var navigator = windowUtils.getNavigator();
  2844. var window = windowUtils.getWindow();
  2845. var extend = __webpack_require__( /*! ./utils/extend */ 0).extend;
  2846. var isPlainObject = __webpack_require__( /*! ./utils/type */ 1).isPlainObject;
  2847. var each = __webpack_require__( /*! ./utils/iterator */ 3).each;
  2848. var Class = __webpack_require__( /*! ./class */ 15);
  2849. var errors = __webpack_require__( /*! ./errors */ 21);
  2850. var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26);
  2851. var resizeCallbacks = __webpack_require__( /*! ./utils/resize_callbacks */ 130);
  2852. var EventsMixin = __webpack_require__( /*! ./events_mixin */ 82);
  2853. var SessionStorage = __webpack_require__( /*! ./utils/storage */ 280).sessionStorage;
  2854. var viewPort = __webpack_require__( /*! ./utils/view_port */ 78);
  2855. var Config = __webpack_require__( /*! ./config */ 31);
  2856. var KNOWN_UA_TABLE = {
  2857. iPhone: "iPhone",
  2858. iPhone5: "iPhone",
  2859. iPhone6: "iPhone",
  2860. iPhone6plus: "iPhone",
  2861. iPad: "iPad",
  2862. iPadMini: "iPad Mini",
  2863. androidPhone: "Android Mobile",
  2864. androidTablet: "Android",
  2865. win8: "MSAppHost",
  2866. win8Phone: "Windows Phone 8.0",
  2867. msSurface: "Windows ARM Tablet PC",
  2868. desktop: "desktop",
  2869. win10Phone: "Windows Phone 10.0",
  2870. win10: "MSAppHost/3.0"
  2871. };
  2872. var DEFAULT_DEVICE = {
  2873. deviceType: "desktop",
  2874. platform: "generic",
  2875. version: [],
  2876. phone: false,
  2877. tablet: false,
  2878. android: false,
  2879. ios: false,
  2880. win: false,
  2881. generic: true,
  2882. grade: "A",
  2883. mac: false
  2884. };
  2885. var uaParsers = {
  2886. win: function(userAgent) {
  2887. var isPhone = /windows phone/i.test(userAgent) || userAgent.match(/WPDesktop/);
  2888. var isTablet = !isPhone && /Windows(.*)arm(.*)Tablet PC/i.test(userAgent);
  2889. var isDesktop = !isPhone && !isTablet && /msapphost/i.test(userAgent);
  2890. if (!(isPhone || isTablet || isDesktop)) {
  2891. return
  2892. }
  2893. var matches = userAgent.match(/windows phone (\d+).(\d+)/i) || userAgent.match(/windows nt (\d+).(\d+)/i);
  2894. var version = [];
  2895. if (matches) {
  2896. version.push(parseInt(matches[1], 10), parseInt(matches[2], 10))
  2897. } else {
  2898. matches = userAgent.match(/msapphost(\/(\d+).(\d+))?/i);
  2899. matches && version.push(3 === parseInt(matches[2], 10) ? 10 : 8)
  2900. }
  2901. return {
  2902. deviceType: isPhone ? "phone" : isTablet ? "tablet" : "desktop",
  2903. platform: "win",
  2904. version: version,
  2905. grade: "A"
  2906. }
  2907. },
  2908. ios: function(userAgent) {
  2909. if (!/ip(hone|od|ad)/i.test(userAgent)) {
  2910. return
  2911. }
  2912. var isPhone = /ip(hone|od)/i.test(userAgent);
  2913. var matches = userAgent.match(/os (\d+)_(\d+)_?(\d+)?/i);
  2914. var version = matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10), parseInt(matches[3] || 0, 10)] : [];
  2915. var isIPhone4 = 480 === window.screen.height;
  2916. var grade = isIPhone4 ? "B" : "A";
  2917. return {
  2918. deviceType: isPhone ? "phone" : "tablet",
  2919. platform: "ios",
  2920. version: version,
  2921. grade: grade
  2922. }
  2923. },
  2924. android: function(userAgent) {
  2925. if (!/android|htc_|silk/i.test(userAgent)) {
  2926. return
  2927. }
  2928. var isPhone = /mobile/i.test(userAgent);
  2929. var matches = userAgent.match(/android (\d+)\.?(\d+)?\.?(\d+)?/i);
  2930. var version = matches ? [parseInt(matches[1], 10), parseInt(matches[2] || 0, 10), parseInt(matches[3] || 0, 10)] : [];
  2931. var worseThan4_4 = version.length > 1 && (version[0] < 4 || 4 === version[0] && version[1] < 4);
  2932. var grade = worseThan4_4 ? "B" : "A";
  2933. return {
  2934. deviceType: isPhone ? "phone" : "tablet",
  2935. platform: "android",
  2936. version: version,
  2937. grade: grade
  2938. }
  2939. }
  2940. };
  2941. var Devices = Class.inherit({
  2942. ctor: function(options) {
  2943. this._window = options && options.window || window;
  2944. this._realDevice = this._getDevice();
  2945. this._currentDevice = void 0;
  2946. this._currentOrientation = void 0;
  2947. this.changed = Callbacks();
  2948. if (windowUtils.hasWindow()) {
  2949. this._recalculateOrientation();
  2950. resizeCallbacks.add(this._recalculateOrientation.bind(this))
  2951. }
  2952. },
  2953. current: function(deviceOrName) {
  2954. if (deviceOrName) {
  2955. this._currentDevice = this._getDevice(deviceOrName);
  2956. this._forced = true;
  2957. this.changed.fire();
  2958. return
  2959. }
  2960. if (!this._currentDevice) {
  2961. deviceOrName = void 0;
  2962. try {
  2963. deviceOrName = this._getDeviceOrNameFromWindowScope()
  2964. } catch (e) {
  2965. deviceOrName = this._getDeviceNameFromSessionStorage()
  2966. } finally {
  2967. if (!deviceOrName) {
  2968. deviceOrName = this._getDeviceNameFromSessionStorage()
  2969. }
  2970. if (deviceOrName) {
  2971. this._forced = true
  2972. }
  2973. }
  2974. this._currentDevice = this._getDevice(deviceOrName)
  2975. }
  2976. return this._currentDevice
  2977. },
  2978. real: function() {
  2979. var forceDevice = arguments[0];
  2980. if (isPlainObject(forceDevice)) {
  2981. extend(this._realDevice, forceDevice);
  2982. return
  2983. }
  2984. return extend({}, this._realDevice)
  2985. },
  2986. orientation: function() {
  2987. return this._currentOrientation
  2988. },
  2989. isForced: function() {
  2990. return this._forced
  2991. },
  2992. isRippleEmulator: function() {
  2993. return !!this._window.tinyHippos
  2994. },
  2995. _getCssClasses: function(device) {
  2996. var result = [];
  2997. var realDevice = this._realDevice;
  2998. device = device || this.current();
  2999. if (device.deviceType) {
  3000. result.push("dx-device-" + device.deviceType);
  3001. if ("desktop" !== device.deviceType) {
  3002. result.push("dx-device-mobile")
  3003. }
  3004. }
  3005. result.push("dx-device-" + realDevice.platform);
  3006. if (realDevice.version && realDevice.version.length) {
  3007. result.push("dx-device-" + realDevice.platform + "-" + realDevice.version[0])
  3008. }
  3009. if (devices.isSimulator()) {
  3010. result.push("dx-simulator")
  3011. }
  3012. if (Config().rtlEnabled) {
  3013. result.push("dx-rtl")
  3014. }
  3015. return result
  3016. },
  3017. attachCssClasses: function(element, device) {
  3018. this._deviceClasses = this._getCssClasses(device).join(" ");
  3019. $(element).addClass(this._deviceClasses)
  3020. },
  3021. detachCssClasses: function(element) {
  3022. $(element).removeClass(this._deviceClasses)
  3023. },
  3024. isSimulator: function() {
  3025. try {
  3026. return this._isSimulator || windowUtils.hasWindow() && this._window.top !== this._window.self && this._window.top["dx-force-device"] || this.isRippleEmulator()
  3027. } catch (e) {
  3028. return false
  3029. }
  3030. },
  3031. forceSimulator: function() {
  3032. this._isSimulator = true
  3033. },
  3034. _getDevice: function(deviceName) {
  3035. if ("genericPhone" === deviceName) {
  3036. deviceName = {
  3037. deviceType: "phone",
  3038. platform: "generic",
  3039. generic: true
  3040. }
  3041. }
  3042. if (isPlainObject(deviceName)) {
  3043. return this._fromConfig(deviceName)
  3044. } else {
  3045. var ua;
  3046. if (deviceName) {
  3047. ua = KNOWN_UA_TABLE[deviceName];
  3048. if (!ua) {
  3049. throw errors.Error("E0005")
  3050. }
  3051. } else {
  3052. ua = navigator.userAgent
  3053. }
  3054. return this._fromUA(ua)
  3055. }
  3056. },
  3057. _getDeviceOrNameFromWindowScope: function() {
  3058. var result;
  3059. if (windowUtils.hasWindow() && (this._window.top["dx-force-device-object"] || this._window.top["dx-force-device"])) {
  3060. result = this._window.top["dx-force-device-object"] || this._window.top["dx-force-device"]
  3061. }
  3062. return result
  3063. },
  3064. _getDeviceNameFromSessionStorage: function() {
  3065. var sessionStorage = SessionStorage();
  3066. if (!sessionStorage) {
  3067. return
  3068. }
  3069. var deviceOrName = sessionStorage.getItem("dx-force-device");
  3070. try {
  3071. return JSON.parse(deviceOrName)
  3072. } catch (ex) {
  3073. return deviceOrName
  3074. }
  3075. },
  3076. _fromConfig: function(config) {
  3077. var result = extend({}, DEFAULT_DEVICE, this._currentDevice, config);
  3078. var shortcuts = {
  3079. phone: "phone" === result.deviceType,
  3080. tablet: "tablet" === result.deviceType,
  3081. android: "android" === result.platform,
  3082. ios: "ios" === result.platform,
  3083. win: "win" === result.platform,
  3084. generic: "generic" === result.platform
  3085. };
  3086. return extend(result, shortcuts)
  3087. },
  3088. _fromUA: function(ua) {
  3089. var config;
  3090. each(uaParsers, function(platform, parser) {
  3091. config = parser(ua);
  3092. return !config
  3093. });
  3094. if (config) {
  3095. return this._fromConfig(config)
  3096. }
  3097. var isMac = /(mac os)/.test(ua.toLowerCase());
  3098. var deviceWithOS = DEFAULT_DEVICE;
  3099. deviceWithOS.mac = isMac;
  3100. return deviceWithOS
  3101. },
  3102. _changeOrientation: function() {
  3103. var $window = $(this._window);
  3104. var orientation = $window.height() > $window.width() ? "portrait" : "landscape";
  3105. if (this._currentOrientation === orientation) {
  3106. return
  3107. }
  3108. this._currentOrientation = orientation;
  3109. this.fireEvent("orientationChanged", [{
  3110. orientation: orientation
  3111. }])
  3112. },
  3113. _recalculateOrientation: function() {
  3114. var windowWidth = $(this._window).width();
  3115. if (this._currentWidth === windowWidth) {
  3116. return
  3117. }
  3118. this._currentWidth = windowWidth;
  3119. this._changeOrientation()
  3120. }
  3121. }).include(EventsMixin);
  3122. var devices = new Devices;
  3123. viewPort.changeCallback.add(function(viewPort, prevViewport) {
  3124. devices.detachCssClasses(prevViewport);
  3125. devices.attachCssClasses(viewPort)
  3126. });
  3127. if (!devices.isForced() && "win" === devices.current().platform) {
  3128. devices.current({
  3129. version: [10]
  3130. })
  3131. }
  3132. module.exports = devices
  3133. },
  3134. /*!*****************************************************!*\
  3135. !*** ./artifacts/transpiled/ui/widget/ui.errors.js ***!
  3136. \*****************************************************/
  3137. /*! dynamic exports provided */
  3138. /*! all exports used */
  3139. function(module, exports, __webpack_require__) {
  3140. var errorUtils = __webpack_require__( /*! ../../core/utils/error */ 129);
  3141. var errors = __webpack_require__( /*! ../../core/errors */ 21);
  3142. module.exports = errorUtils(errors.ERROR_MESSAGES, {
  3143. E1001: "Module '{0}'. Controller '{1}' is already registered",
  3144. E1002: "Module '{0}'. Controller '{1}' does not inherit from DevExpress.ui.dxDataGrid.Controller",
  3145. E1003: "Module '{0}'. View '{1}' is already registered",
  3146. E1004: "Module '{0}'. View '{1}' does not inherit from DevExpress.ui.dxDataGrid.View",
  3147. E1005: "Public method '{0}' is already registered",
  3148. E1006: "Public method '{0}.{1}' does not exist",
  3149. E1007: "State storing cannot be provided due to the restrictions of the browser",
  3150. E1010: "The template does not contain the TextBox widget",
  3151. E1011: 'Items cannot be deleted from the List. Implement the "remove" function in the data store',
  3152. E1012: "Editing type '{0}' with the name '{1}' is unsupported",
  3153. E1016: "Unexpected type of data source is provided for a lookup column",
  3154. E1018: "The 'collapseAll' method cannot be called if you use a remote data source",
  3155. E1019: "Search mode '{0}' is unavailable",
  3156. E1020: "The type cannot be changed after initialization",
  3157. E1021: "{0} '{1}' you are trying to remove does not exist",
  3158. E1022: 'The "markers" option is given an invalid value. Assign an array instead',
  3159. E1023: 'The "routes" option is given an invalid value. Assign an array instead',
  3160. E1025: "This layout is too complex to render",
  3161. E1026: 'The "calculateCustomSummary" function is missing from a field whose "summaryType" option is set to "custom"',
  3162. E1030: "Unknown ScrollView refresh strategy: '{0}'",
  3163. E1031: "Unknown subscription in the Scheduler widget: '{0}'",
  3164. E1032: "Unknown start date in an appointment: '{0}'",
  3165. E1033: "Unknown step in the date navigator: '{0}'",
  3166. E1034: "The browser does not implement an API for saving files",
  3167. E1035: "The editor cannot be created because of an internal error: {0}",
  3168. E1037: "Invalid structure of grouped data",
  3169. E1038: "The browser does not support local storages for local web pages",
  3170. E1039: "A cell's position cannot be calculated",
  3171. E1040: "The '{0}' key value is not unique within the data array",
  3172. E1041: "The '{0}' script is referenced after the DevExtreme scripts or not referenced at all",
  3173. E1042: "{0} requires the key field to be specified",
  3174. E1043: "Changes cannot be processed due to the incorrectly set key",
  3175. E1044: "The key field specified by the keyExpr option does not match the key field specified in the data store",
  3176. E1045: "Editing requires the key field to be specified in the data store",
  3177. E1046: "The '{0}' key field is not found in data objects",
  3178. E1047: 'The "{0}" field is not found in the fields array',
  3179. E1048: 'The "{0}" operation is not found in the filterOperations array',
  3180. E1049: "Column '{0}': filtering is allowed but the 'dataField' or 'name' option is not specified",
  3181. E1050: "The validationRules option does not apply to third-party editors defined in the editCellTemplate",
  3182. E1051: 'HtmlEditor\'s valueType is "{0}", but the {0} converter was not imported.',
  3183. E1052: '{0} should have the "dataSource" option specified',
  3184. E1053: 'The "buttons" option accepts an array that contains only objects or string values',
  3185. E1054: "All text editor buttons must have names",
  3186. E1055: 'One or several text editor buttons have invalid or non-unique "name" values',
  3187. E1056: 'The {0} widget does not support buttons of the "{1}" type',
  3188. W1001: 'The "key" option cannot be modified after initialization',
  3189. W1002: "An item with the key '{0}' does not exist",
  3190. W1003: "A group with the key '{0}' in which you are trying to select items does not exist",
  3191. W1004: "The item '{0}' you are trying to select in the group '{1}' does not exist",
  3192. W1005: "Due to column data types being unspecified, data has been loaded twice in order to apply initial filter settings. To resolve this issue, specify data types for all grid columns.",
  3193. W1006: "The map service returned the following error: '{0}'",
  3194. W1007: "No item with key {0} was found in the data source, but this key was used as the parent key for item {1}",
  3195. W1008: "Cannot scroll to the '{0}' date because it does not exist on the current view",
  3196. W1009: "Searching works only if data is specified using the dataSource option",
  3197. W1010: "The capability to select all items works with source data of plain structure only",
  3198. W1011: 'The "keyExpr" option is not applied when dataSource is not an array',
  3199. W1012: "The '{0}' key field is not found in data objects",
  3200. W1013: 'The "message" field in the dialog component was renamed to "messageHtml". Change your code correspondingly. In addition, if you used HTML code in the message, make sure that it is secure',
  3201. W1014: "The Floating Action Button exceeds the recommended speed dial action count. If you need to display more speed dial actions, increase the maxSpeedDialActionCount option value in the global config."
  3202. })
  3203. },
  3204. /*!*****************************************************!*\
  3205. !*** ./artifacts/transpiled/ui/widget/ui.widget.js ***!
  3206. \*****************************************************/
  3207. /*! dynamic exports provided */
  3208. /*! all exports used */
  3209. function(module, exports, __webpack_require__) {
  3210. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  3211. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  3212. var errors = __webpack_require__( /*! ./ui.errors */ 17);
  3213. var Action = __webpack_require__( /*! ../../core/action */ 111);
  3214. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  3215. var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  3216. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  3217. var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
  3218. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  3219. var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
  3220. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  3221. var devices = __webpack_require__( /*! ../../core/devices */ 16);
  3222. var DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67);
  3223. var Template = __webpack_require__( /*! ./template */ 462);
  3224. var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
  3225. var FunctionTemplate = __webpack_require__( /*! ./function_template */ 83);
  3226. var EmptyTemplate = __webpack_require__( /*! ./empty_template */ 109);
  3227. var ChildDefaultTemplate = __webpack_require__( /*! ./child_default_template */ 134);
  3228. var KeyboardProcessor = __webpack_require__( /*! ./ui.keyboard_processor */ 167);
  3229. var selectors = __webpack_require__( /*! ./selectors */ 66);
  3230. var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
  3231. var hoverEvents = __webpack_require__( /*! ../../events/hover */ 148);
  3232. var feedbackEvents = __webpack_require__( /*! ../../events/core/emitter.feedback */ 125);
  3233. var clickEvent = __webpack_require__( /*! ../../events/click */ 19);
  3234. var inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
  3235. var UI_FEEDBACK = "UIFeedback";
  3236. var WIDGET_CLASS = "dx-widget";
  3237. var ACTIVE_STATE_CLASS = "dx-state-active";
  3238. var DISABLED_STATE_CLASS = "dx-state-disabled";
  3239. var INVISIBLE_STATE_CLASS = "dx-state-invisible";
  3240. var HOVER_STATE_CLASS = "dx-state-hover";
  3241. var FOCUSED_STATE_CLASS = "dx-state-focused";
  3242. var FEEDBACK_SHOW_TIMEOUT = 30;
  3243. var FEEDBACK_HIDE_TIMEOUT = 400;
  3244. var FOCUS_NAMESPACE = "Focus";
  3245. var ANONYMOUS_TEMPLATE_NAME = "template";
  3246. var TEXT_NODE = 3;
  3247. var TEMPLATE_SELECTOR = "[data-options*='dxTemplate']";
  3248. var TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper";
  3249. var DX_POLYMORPH_WIDGET_TEMPLATE = new FunctionTemplate(function(options) {
  3250. var widgetName = options.model.widget;
  3251. if (widgetName) {
  3252. var widgetElement = $("<div>");
  3253. var widgetOptions = options.model.options || {};
  3254. if ("button" === widgetName || "tabs" === widgetName || "dropDownMenu" === widgetName) {
  3255. var deprecatedName = widgetName;
  3256. widgetName = inflector.camelize("dx-" + widgetName);
  3257. errors.log("W0001", "dxToolbar - 'widget' item field", deprecatedName, "16.1", "Use: '" + widgetName + "' instead")
  3258. }
  3259. if (options.parent) {
  3260. options.parent._createComponent(widgetElement, widgetName, widgetOptions)
  3261. } else {
  3262. widgetElement[widgetName](widgetOptions)
  3263. }
  3264. return widgetElement
  3265. }
  3266. return $()
  3267. });
  3268. var Widget = DOMComponent.inherit({
  3269. _supportedKeys: function() {
  3270. return {}
  3271. },
  3272. _getDefaultOptions: function() {
  3273. return extend(this.callBase(), {
  3274. disabled: false,
  3275. visible: true,
  3276. hint: void 0,
  3277. activeStateEnabled: false,
  3278. onContentReady: null,
  3279. hoverStateEnabled: false,
  3280. focusStateEnabled: false,
  3281. tabIndex: 0,
  3282. accessKey: null,
  3283. onFocusIn: null,
  3284. onFocusOut: null,
  3285. integrationOptions: {
  3286. watchMethod: function(fn, callback, options) {
  3287. options = options || {};
  3288. if (!options.skipImmediate) {
  3289. callback(fn())
  3290. }
  3291. return commonUtils.noop
  3292. },
  3293. templates: {
  3294. "dx-polymorph-widget": DX_POLYMORPH_WIDGET_TEMPLATE
  3295. },
  3296. createTemplate: function(element) {
  3297. return new Template(element)
  3298. }
  3299. },
  3300. _keyboardProcessor: void 0
  3301. })
  3302. },
  3303. _feedbackShowTimeout: FEEDBACK_SHOW_TIMEOUT,
  3304. _feedbackHideTimeout: FEEDBACK_HIDE_TIMEOUT,
  3305. _init: function() {
  3306. this.callBase();
  3307. this._tempTemplates = [];
  3308. this._defaultTemplates = {};
  3309. this._initTemplates();
  3310. this._initContentReadyAction()
  3311. },
  3312. _initTemplates: function() {
  3313. this._extractTemplates();
  3314. this._extractAnonymousTemplate()
  3315. },
  3316. _clearInnerOptionCache: function(optionContainer) {
  3317. this[optionContainer + "Cache"] = {}
  3318. },
  3319. _cacheInnerOptions: function(optionContainer, optionValue) {
  3320. var cacheName = optionContainer + "Cache";
  3321. this[cacheName] = extend(this[cacheName], optionValue)
  3322. },
  3323. _getOptionsFromContainer: function(_ref) {
  3324. var name = _ref.name,
  3325. fullName = _ref.fullName,
  3326. value = _ref.value;
  3327. var options = {};
  3328. if (name === fullName) {
  3329. options = value
  3330. } else {
  3331. var option = fullName.split(".").pop();
  3332. options[option] = value
  3333. }
  3334. return options
  3335. },
  3336. _innerOptionChanged: function(innerWidget, args) {
  3337. var options = this._getOptionsFromContainer(args);
  3338. innerWidget && innerWidget.option(options);
  3339. this._cacheInnerOptions(args.name, options)
  3340. },
  3341. _getInnerOptionsCache: function(optionContainer) {
  3342. return this[optionContainer + "Cache"]
  3343. },
  3344. _initInnerOptionCache: function(optionContainer) {
  3345. this._clearInnerOptionCache(optionContainer);
  3346. this._cacheInnerOptions(optionContainer, this.option(optionContainer))
  3347. },
  3348. _bindInnerWidgetOptions: function(innerWidget, optionsContainer) {
  3349. this._options[optionsContainer] = extend({}, innerWidget.option());
  3350. innerWidget.on("optionChanged", function(e) {
  3351. this._options[optionsContainer] = extend({}, e.component.option())
  3352. }.bind(this))
  3353. },
  3354. _extractTemplates: function() {
  3355. var templateElements = this.$element().contents().filter(TEMPLATE_SELECTOR);
  3356. var templatesMap = {};
  3357. templateElements.each(function(_, template) {
  3358. var templateOptions = domUtils.getElementOptions(template).dxTemplate;
  3359. if (!templateOptions) {
  3360. return
  3361. }
  3362. if (!templateOptions.name) {
  3363. throw errors.Error("E0023")
  3364. }
  3365. $(template).addClass(TEMPLATE_WRAPPER_CLASS).detach();
  3366. templatesMap[templateOptions.name] = templatesMap[templateOptions.name] || [];
  3367. templatesMap[templateOptions.name].push(template)
  3368. });
  3369. each(templatesMap, function(templateName, value) {
  3370. var deviceTemplate = this._findTemplateByDevice(value);
  3371. if (deviceTemplate) {
  3372. this._saveTemplate(templateName, deviceTemplate)
  3373. }
  3374. }.bind(this))
  3375. },
  3376. _saveTemplate: function(name, template) {
  3377. var templates = this.option("integrationOptions.templates");
  3378. templates[name] = this._createTemplate(template)
  3379. },
  3380. _findTemplateByDevice: function(templates) {
  3381. var suitableTemplate = commonUtils.findBestMatches(devices.current(), templates, function(template) {
  3382. return domUtils.getElementOptions(template).dxTemplate
  3383. })[0];
  3384. each(templates, function(index, template) {
  3385. if (template !== suitableTemplate) {
  3386. $(template).remove()
  3387. }
  3388. });
  3389. return suitableTemplate
  3390. },
  3391. _extractAnonymousTemplate: function() {
  3392. var templates = this.option("integrationOptions.templates");
  3393. var anonymousTemplateName = this._getAnonymousTemplateName();
  3394. var $anonymousTemplate = this.$element().contents().detach();
  3395. var $notJunkTemplateContent = $anonymousTemplate.filter(function(_, element) {
  3396. var isTextNode = element.nodeType === TEXT_NODE;
  3397. var isEmptyText = $(element).text().trim().length < 1;
  3398. return !(isTextNode && isEmptyText)
  3399. });
  3400. var onlyJunkTemplateContent = $notJunkTemplateContent.length < 1;
  3401. if (!templates[anonymousTemplateName] && !onlyJunkTemplateContent) {
  3402. templates[anonymousTemplateName] = this._createTemplate($anonymousTemplate)
  3403. }
  3404. },
  3405. _getAriaTarget: function() {
  3406. return this._focusTarget()
  3407. },
  3408. _getAnonymousTemplateName: function() {
  3409. return ANONYMOUS_TEMPLATE_NAME
  3410. },
  3411. _getTemplateByOption: function(optionName) {
  3412. return this._getTemplate(this.option(optionName))
  3413. },
  3414. _getTemplate: function(templateSource) {
  3415. if (typeUtils.isFunction(templateSource)) {
  3416. return new FunctionTemplate(function(options) {
  3417. var templateSourceResult = templateSource.apply(this, this._getNormalizedTemplateArgs(options));
  3418. if (!typeUtils.isDefined(templateSourceResult)) {
  3419. return new EmptyTemplate
  3420. }
  3421. var dispose = false;
  3422. var template = this._acquireTemplate(templateSourceResult, function(templateSource) {
  3423. if (templateSource.nodeType || typeUtils.isRenderer(templateSource) && !$(templateSource).is("script")) {
  3424. return new FunctionTemplate(function() {
  3425. return templateSource
  3426. })
  3427. }
  3428. dispose = true;
  3429. return this._createTemplate(templateSource)
  3430. }.bind(this));
  3431. var result = template.render(options);
  3432. dispose && template.dispose && template.dispose();
  3433. return result
  3434. }.bind(this))
  3435. }
  3436. return this._acquireTemplate(templateSource, this._createTemplateIfNeeded.bind(this))
  3437. },
  3438. _acquireTemplate: function(templateSource, createTemplate) {
  3439. if (null == templateSource) {
  3440. return new EmptyTemplate
  3441. }
  3442. if (templateSource instanceof ChildDefaultTemplate) {
  3443. return this._defaultTemplates[templateSource.name]
  3444. }
  3445. if (templateSource instanceof TemplateBase) {
  3446. return templateSource
  3447. }
  3448. if (typeUtils.isFunction(templateSource.render) && !typeUtils.isRenderer(templateSource)) {
  3449. return this._addOneRenderedCall(templateSource)
  3450. }
  3451. if (templateSource.nodeType || typeUtils.isRenderer(templateSource)) {
  3452. return createTemplate($(templateSource))
  3453. }
  3454. if ("string" === typeof templateSource) {
  3455. var nonIntegrationTemplates = this.option("integrationOptions.skipTemplates") || [];
  3456. var integrationTemplate = null;
  3457. if (nonIntegrationTemplates.indexOf(templateSource) === -1) {
  3458. integrationTemplate = this._renderIntegrationTemplate(templateSource)
  3459. }
  3460. return integrationTemplate || this._defaultTemplates[templateSource] || createTemplate(templateSource)
  3461. }
  3462. return this._acquireTemplate(templateSource.toString(), createTemplate)
  3463. },
  3464. _addOneRenderedCall: function(template) {
  3465. var _render = template.render.bind(template);
  3466. return extend({}, template, {
  3467. render: function(options) {
  3468. var templateResult = _render(options);
  3469. options && options.onRendered && options.onRendered();
  3470. return templateResult
  3471. }
  3472. })
  3473. },
  3474. _renderIntegrationTemplate: function(templateSource) {
  3475. var integrationTemplate = this.option("integrationOptions.templates")[templateSource];
  3476. if (integrationTemplate && !(integrationTemplate instanceof TemplateBase)) {
  3477. var isAsyncTemplate = this.option("templatesRenderAsynchronously");
  3478. if (!isAsyncTemplate) {
  3479. return this._addOneRenderedCall(integrationTemplate)
  3480. }
  3481. }
  3482. return integrationTemplate
  3483. },
  3484. _createTemplateIfNeeded: function(templateSource) {
  3485. var templateKey = function(templateSource) {
  3486. return typeUtils.isRenderer(templateSource) && templateSource[0] || templateSource
  3487. };
  3488. var cachedTemplate = this._tempTemplates.filter(function(t) {
  3489. templateSource = templateKey(templateSource);
  3490. return t.source === templateSource
  3491. })[0];
  3492. if (cachedTemplate) {
  3493. return cachedTemplate.template
  3494. }
  3495. var template = this._createTemplate(templateSource);
  3496. this._tempTemplates.push({
  3497. template: template,
  3498. source: templateKey(templateSource)
  3499. });
  3500. return template
  3501. },
  3502. _createTemplate: function(templateSource) {
  3503. templateSource = "string" === typeof templateSource ? domUtils.normalizeTemplateElement(templateSource) : templateSource;
  3504. return this.option("integrationOptions.createTemplate")(templateSource)
  3505. },
  3506. _getNormalizedTemplateArgs: function(options) {
  3507. var args = [];
  3508. if ("model" in options) {
  3509. args.push(options.model)
  3510. }
  3511. if ("index" in options) {
  3512. args.push(options.index)
  3513. }
  3514. args.push(options.container);
  3515. return args
  3516. },
  3517. _cleanTemplates: function() {
  3518. this._tempTemplates.forEach(function(t) {
  3519. t.template.dispose && t.template.dispose()
  3520. });
  3521. this._tempTemplates = []
  3522. },
  3523. _initContentReadyAction: function() {
  3524. this._contentReadyAction = this._createActionByOption("onContentReady", {
  3525. excludeValidators: ["disabled", "readOnly"]
  3526. })
  3527. },
  3528. _initMarkup: function() {
  3529. this.$element().addClass(WIDGET_CLASS);
  3530. this._toggleDisabledState(this.option("disabled"));
  3531. this._toggleVisibility(this.option("visible"));
  3532. this._renderHint();
  3533. if (this._isFocusable()) {
  3534. this._renderFocusTarget()
  3535. }
  3536. this.callBase()
  3537. },
  3538. _render: function() {
  3539. this.callBase();
  3540. this._renderContent();
  3541. this._renderFocusState();
  3542. this._attachFeedbackEvents();
  3543. this._attachHoverEvents()
  3544. },
  3545. _renderHint: function() {
  3546. var hint = this.option("hint");
  3547. this.$element().attr("title", hint ? hint : null)
  3548. },
  3549. _renderContent: function() {
  3550. var _this = this;
  3551. commonUtils.deferRender(function() {
  3552. if (_this._disposed) {
  3553. return
  3554. }
  3555. return _this._renderContentImpl()
  3556. }).done(function() {
  3557. if (_this._disposed) {
  3558. return
  3559. }
  3560. _this._fireContentReadyAction()
  3561. })
  3562. },
  3563. _renderContentImpl: commonUtils.noop,
  3564. _fireContentReadyAction: commonUtils.deferRenderer(function() {
  3565. this._contentReadyAction()
  3566. }),
  3567. _dispose: function() {
  3568. this._cleanTemplates();
  3569. this._contentReadyAction = null;
  3570. this.callBase()
  3571. },
  3572. _resetActiveState: function() {
  3573. this._toggleActiveState(this._eventBindingTarget(), false)
  3574. },
  3575. _clean: function() {
  3576. this._cleanFocusState();
  3577. this._resetActiveState();
  3578. this.callBase();
  3579. this.$element().empty()
  3580. },
  3581. _toggleVisibility: function(visible) {
  3582. this.$element().toggleClass(INVISIBLE_STATE_CLASS, !visible);
  3583. this.setAria("hidden", !visible || void 0)
  3584. },
  3585. _renderFocusState: function() {
  3586. this._attachKeyboardEvents();
  3587. if (!this._isFocusable()) {
  3588. return
  3589. }
  3590. this._renderFocusTarget();
  3591. this._attachFocusEvents();
  3592. this._renderAccessKey()
  3593. },
  3594. _renderAccessKey: function() {
  3595. var focusTarget = this._focusTarget();
  3596. focusTarget.attr("accesskey", this.option("accessKey"));
  3597. var clickNamespace = eventUtils.addNamespace(clickEvent.name, UI_FEEDBACK);
  3598. eventsEngine.off(focusTarget, clickNamespace);
  3599. this.option("accessKey") && eventsEngine.on(focusTarget, clickNamespace, function(e) {
  3600. if (eventUtils.isFakeClickEvent(e)) {
  3601. e.stopImmediatePropagation();
  3602. this.focus()
  3603. }
  3604. }.bind(this))
  3605. },
  3606. _isFocusable: function() {
  3607. return this.option("focusStateEnabled") && !this.option("disabled")
  3608. },
  3609. _eventBindingTarget: function() {
  3610. return this.$element()
  3611. },
  3612. _focusTarget: function() {
  3613. return this._getActiveElement()
  3614. },
  3615. _getActiveElement: function() {
  3616. var activeElement = this._eventBindingTarget();
  3617. if (this._activeStateUnit) {
  3618. activeElement = activeElement.find(this._activeStateUnit).not("." + DISABLED_STATE_CLASS)
  3619. }
  3620. return activeElement
  3621. },
  3622. _renderFocusTarget: function() {
  3623. this._focusTarget().attr("tabIndex", this.option("tabIndex"))
  3624. },
  3625. _keyboardEventBindingTarget: function() {
  3626. return this._eventBindingTarget()
  3627. },
  3628. _detachFocusEvents: function() {
  3629. var $element = this._focusEventTarget();
  3630. var namespace = this.NAME + FOCUS_NAMESPACE;
  3631. var focusEvents = eventUtils.addNamespace("focusin", namespace);
  3632. focusEvents = focusEvents + " " + eventUtils.addNamespace("focusout", namespace);
  3633. if (domAdapter.hasDocumentProperty("onbeforeactivate")) {
  3634. focusEvents = focusEvents + " " + eventUtils.addNamespace("beforeactivate", namespace)
  3635. }
  3636. eventsEngine.off($element, focusEvents)
  3637. },
  3638. _attachFocusEvents: function() {
  3639. var namespace = this.NAME + FOCUS_NAMESPACE;
  3640. var focusInEvent = eventUtils.addNamespace("focusin", namespace);
  3641. var focusOutEvent = eventUtils.addNamespace("focusout", namespace);
  3642. var $focusTarget = this._focusEventTarget();
  3643. eventsEngine.on($focusTarget, focusInEvent, this._focusInHandler.bind(this));
  3644. eventsEngine.on($focusTarget, focusOutEvent, this._focusOutHandler.bind(this));
  3645. if (domAdapter.hasDocumentProperty("onbeforeactivate")) {
  3646. var beforeActivateEvent = eventUtils.addNamespace("beforeactivate", namespace);
  3647. eventsEngine.on(this._focusEventTarget(), beforeActivateEvent, function(e) {
  3648. if (!$(e.target).is(selectors.focusable)) {
  3649. e.preventDefault()
  3650. }
  3651. })
  3652. }
  3653. },
  3654. _refreshFocusEvent: function() {
  3655. this._detachFocusEvents();
  3656. this._attachFocusEvents()
  3657. },
  3658. _focusEventTarget: function() {
  3659. return this._focusTarget()
  3660. },
  3661. _focusInHandler: function(e) {
  3662. if (e.isDefaultPrevented()) {
  3663. return
  3664. }
  3665. var that = this;
  3666. that._createActionByOption("onFocusIn", {
  3667. beforeExecute: function() {
  3668. that._updateFocusState(e, true)
  3669. },
  3670. excludeValidators: ["readOnly"]
  3671. })({
  3672. event: e
  3673. })
  3674. },
  3675. _focusOutHandler: function(e) {
  3676. if (e.isDefaultPrevented()) {
  3677. return
  3678. }
  3679. var that = this;
  3680. that._createActionByOption("onFocusOut", {
  3681. beforeExecute: function() {
  3682. that._updateFocusState(e, false)
  3683. },
  3684. excludeValidators: ["readOnly", "disabled"]
  3685. })({
  3686. event: e
  3687. })
  3688. },
  3689. _updateFocusState: function(e, isFocused) {
  3690. var target = e.target;
  3691. if (inArray(target, this._focusTarget()) !== -1) {
  3692. this._toggleFocusClass(isFocused, $(target))
  3693. }
  3694. },
  3695. _toggleFocusClass: function(isFocused, $element) {
  3696. var $focusTarget = $element && $element.length ? $element : this._focusTarget();
  3697. $focusTarget.toggleClass(FOCUSED_STATE_CLASS, isFocused)
  3698. },
  3699. _hasFocusClass: function(element) {
  3700. var $focusTarget = $(element || this._focusTarget());
  3701. return $focusTarget.hasClass(FOCUSED_STATE_CLASS)
  3702. },
  3703. _isFocused: function() {
  3704. return this._hasFocusClass()
  3705. },
  3706. _attachKeyboardEvents: function() {
  3707. var processor = this.option("_keyboardProcessor");
  3708. if (processor) {
  3709. this._keyboardProcessor = processor.reinitialize(this._keyboardHandler, this)
  3710. } else {
  3711. if (this.option("focusStateEnabled")) {
  3712. this._disposeKeyboardProcessor();
  3713. this._keyboardProcessor = new KeyboardProcessor({
  3714. element: this._keyboardEventBindingTarget(),
  3715. handler: this._keyboardHandler,
  3716. focusTarget: this._focusTarget(),
  3717. context: this
  3718. })
  3719. }
  3720. }
  3721. },
  3722. _keyboardHandler: function(options) {
  3723. var e = options.originalEvent;
  3724. var keyName = options.keyName;
  3725. var keyCode = options.which;
  3726. var keys = this._supportedKeys(e);
  3727. var func = keys[keyName] || keys[keyCode];
  3728. if (void 0 !== func) {
  3729. var handler = func.bind(this);
  3730. return handler(e) || false
  3731. } else {
  3732. return true
  3733. }
  3734. },
  3735. _refreshFocusState: function() {
  3736. this._cleanFocusState();
  3737. this._renderFocusState()
  3738. },
  3739. _cleanFocusState: function() {
  3740. var $element = this._focusTarget();
  3741. this._detachFocusEvents();
  3742. this._toggleFocusClass(false);
  3743. $element.removeAttr("tabIndex");
  3744. this._disposeKeyboardProcessor()
  3745. },
  3746. _disposeKeyboardProcessor: function() {
  3747. if (this._keyboardProcessor) {
  3748. this._keyboardProcessor.dispose();
  3749. delete this._keyboardProcessor
  3750. }
  3751. },
  3752. _attachHoverEvents: function() {
  3753. var that = this;
  3754. var hoverableSelector = that._activeStateUnit;
  3755. var nameStart = eventUtils.addNamespace(hoverEvents.start, UI_FEEDBACK);
  3756. var nameEnd = eventUtils.addNamespace(hoverEvents.end, UI_FEEDBACK);
  3757. eventsEngine.off(that._eventBindingTarget(), nameStart, hoverableSelector);
  3758. eventsEngine.off(that._eventBindingTarget(), nameEnd, hoverableSelector);
  3759. if (that.option("hoverStateEnabled")) {
  3760. var startAction = new Action(function(args) {
  3761. that._hoverStartHandler(args.event);
  3762. that._refreshHoveredElement($(args.element))
  3763. }, {
  3764. excludeValidators: ["readOnly"]
  3765. });
  3766. var $eventBindingTarget = that._eventBindingTarget();
  3767. eventsEngine.on($eventBindingTarget, nameStart, hoverableSelector, function(e) {
  3768. startAction.execute({
  3769. element: $(e.target),
  3770. event: e
  3771. })
  3772. });
  3773. eventsEngine.on($eventBindingTarget, nameEnd, hoverableSelector, function(e) {
  3774. that._hoverEndHandler(e);
  3775. that._forgetHoveredElement()
  3776. })
  3777. } else {
  3778. that._toggleHoverClass(false)
  3779. }
  3780. },
  3781. _hoverStartHandler: commonUtils.noop,
  3782. _hoverEndHandler: commonUtils.noop,
  3783. _attachFeedbackEvents: function() {
  3784. var that = this;
  3785. var feedbackSelector = that._activeStateUnit;
  3786. var activeEventName = eventUtils.addNamespace(feedbackEvents.active, UI_FEEDBACK);
  3787. var inactiveEventName = eventUtils.addNamespace(feedbackEvents.inactive, UI_FEEDBACK);
  3788. var feedbackAction;
  3789. var feedbackActionDisabled;
  3790. eventsEngine.off(that._eventBindingTarget(), activeEventName, feedbackSelector);
  3791. eventsEngine.off(that._eventBindingTarget(), inactiveEventName, feedbackSelector);
  3792. if (that.option("activeStateEnabled")) {
  3793. var feedbackActionHandler = function(args) {
  3794. var $element = $(args.element);
  3795. var value = args.value;
  3796. var dxEvent = args.event;
  3797. that._toggleActiveState($element, value, dxEvent)
  3798. };
  3799. eventsEngine.on(that._eventBindingTarget(), activeEventName, feedbackSelector, {
  3800. timeout: that._feedbackShowTimeout
  3801. }, function(e) {
  3802. feedbackAction = feedbackAction || new Action(feedbackActionHandler);
  3803. feedbackAction.execute({
  3804. element: $(e.currentTarget),
  3805. value: true,
  3806. event: e
  3807. })
  3808. });
  3809. eventsEngine.on(that._eventBindingTarget(), inactiveEventName, feedbackSelector, {
  3810. timeout: that._feedbackHideTimeout
  3811. }, function(e) {
  3812. feedbackActionDisabled = feedbackActionDisabled || new Action(feedbackActionHandler, {
  3813. excludeValidators: ["disabled", "readOnly"]
  3814. });
  3815. feedbackActionDisabled.execute({
  3816. element: $(e.currentTarget),
  3817. value: false,
  3818. event: e
  3819. })
  3820. })
  3821. }
  3822. },
  3823. _toggleActiveState: function($element, value) {
  3824. this._toggleHoverClass(!value);
  3825. $element.toggleClass(ACTIVE_STATE_CLASS, value)
  3826. },
  3827. _refreshHoveredElement: function(hoveredElement) {
  3828. var selector = this._activeStateUnit || this._eventBindingTarget();
  3829. this._forgetHoveredElement();
  3830. this._hoveredElement = hoveredElement.closest(selector);
  3831. this._toggleHoverClass(true)
  3832. },
  3833. _forgetHoveredElement: function() {
  3834. this._toggleHoverClass(false);
  3835. delete this._hoveredElement
  3836. },
  3837. _toggleHoverClass: function(value) {
  3838. if (this._hoveredElement) {
  3839. this._hoveredElement.toggleClass(HOVER_STATE_CLASS, value && this.option("hoverStateEnabled"))
  3840. }
  3841. },
  3842. _toggleDisabledState: function(value) {
  3843. this.$element().toggleClass(DISABLED_STATE_CLASS, Boolean(value));
  3844. this._toggleHoverClass(!value);
  3845. this.setAria("disabled", value || void 0)
  3846. },
  3847. _setWidgetOption: function(widgetName, args) {
  3848. if (!this[widgetName]) {
  3849. return
  3850. }
  3851. if (typeUtils.isPlainObject(args[0])) {
  3852. each(args[0], function(option, value) {
  3853. this._setWidgetOption(widgetName, [option, value])
  3854. }.bind(this));
  3855. return
  3856. }
  3857. var optionName = args[0];
  3858. var value = args[1];
  3859. if (1 === args.length) {
  3860. value = this.option(optionName)
  3861. }
  3862. var widgetOptionMap = this[widgetName + "OptionMap"];
  3863. this[widgetName].option(widgetOptionMap ? widgetOptionMap(optionName) : optionName, value)
  3864. },
  3865. _optionChanged: function(args) {
  3866. switch (args.name) {
  3867. case "disabled":
  3868. this._toggleDisabledState(args.value);
  3869. this._refreshFocusState();
  3870. break;
  3871. case "hint":
  3872. this._renderHint();
  3873. break;
  3874. case "activeStateEnabled":
  3875. this._attachFeedbackEvents();
  3876. break;
  3877. case "hoverStateEnabled":
  3878. this._attachHoverEvents();
  3879. break;
  3880. case "tabIndex":
  3881. case "_keyboardProcessor":
  3882. case "focusStateEnabled":
  3883. this._refreshFocusState();
  3884. break;
  3885. case "onFocusIn":
  3886. case "onFocusOut":
  3887. break;
  3888. case "accessKey":
  3889. this._renderAccessKey();
  3890. break;
  3891. case "visible":
  3892. var visible = args.value;
  3893. this._toggleVisibility(visible);
  3894. if (this._isVisibilityChangeSupported()) {
  3895. this._checkVisibilityChanged(args.value ? "shown" : "hiding")
  3896. }
  3897. break;
  3898. case "onContentReady":
  3899. this._initContentReadyAction();
  3900. break;
  3901. default:
  3902. this.callBase(args)
  3903. }
  3904. },
  3905. _isVisible: function() {
  3906. return this.callBase() && this.option("visible")
  3907. },
  3908. beginUpdate: function() {
  3909. this._ready(false);
  3910. this.callBase()
  3911. },
  3912. endUpdate: function() {
  3913. this.callBase();
  3914. if (this._initialized) {
  3915. this._ready(true)
  3916. }
  3917. },
  3918. _ready: function(value) {
  3919. if (0 === arguments.length) {
  3920. return this._isReady
  3921. }
  3922. this._isReady = value
  3923. },
  3924. setAria: function() {
  3925. var setAttribute = function(option) {
  3926. var attrName = "role" === option.name || "id" === option.name ? option.name : "aria-" + option.name;
  3927. var attrValue = option.value;
  3928. if (typeUtils.isDefined(attrValue)) {
  3929. attrValue = attrValue.toString()
  3930. } else {
  3931. attrValue = null
  3932. }
  3933. option.target.attr(attrName, attrValue)
  3934. };
  3935. if (!typeUtils.isPlainObject(arguments[0])) {
  3936. setAttribute({
  3937. name: arguments[0],
  3938. value: arguments[1],
  3939. target: arguments[2] || this._getAriaTarget()
  3940. })
  3941. } else {
  3942. var $target = arguments[1] || this._getAriaTarget();
  3943. each(arguments[0], function(key, value) {
  3944. setAttribute({
  3945. name: key,
  3946. value: value,
  3947. target: $target
  3948. })
  3949. })
  3950. }
  3951. },
  3952. isReady: function() {
  3953. return this._ready()
  3954. },
  3955. repaint: function() {
  3956. this._refresh()
  3957. },
  3958. focus: function() {
  3959. eventsEngine.trigger(this._focusTarget(), "focus")
  3960. },
  3961. registerKeyHandler: function(key, handler) {
  3962. var currentKeys = this._supportedKeys();
  3963. var addingKeys = {};
  3964. addingKeys[key] = handler;
  3965. this._supportedKeys = function() {
  3966. return extend(currentKeys, addingKeys)
  3967. }
  3968. }
  3969. });
  3970. module.exports = Widget
  3971. },
  3972. /*!**********************************************!*\
  3973. !*** ./artifacts/transpiled/events/click.js ***!
  3974. \**********************************************/
  3975. /*! dynamic exports provided */
  3976. /*! all exports used */
  3977. function(module, exports, __webpack_require__) {
  3978. var $ = __webpack_require__( /*! ../core/renderer */ 2);
  3979. var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
  3980. var devices = __webpack_require__( /*! ../core/devices */ 16);
  3981. var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
  3982. var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12);
  3983. var animationFrame = __webpack_require__( /*! ../animation/frame */ 112);
  3984. var eventUtils = __webpack_require__( /*! ./utils */ 8);
  3985. var pointerEvents = __webpack_require__( /*! ./pointer */ 23);
  3986. var Emitter = __webpack_require__( /*! ./core/emitter */ 123);
  3987. var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95);
  3988. var compareVersions = __webpack_require__( /*! ../core/utils/version */ 61).compare;
  3989. var CLICK_EVENT_NAME = "dxclick";
  3990. var TOUCH_BOUNDARY = 10;
  3991. var abs = Math.abs;
  3992. var isInput = function(element) {
  3993. return $(element).is("input, textarea, select, button ,:focus, :focus *")
  3994. };
  3995. var misc = {
  3996. requestAnimationFrame: animationFrame.requestAnimationFrame,
  3997. cancelAnimationFrame: animationFrame.cancelAnimationFrame
  3998. };
  3999. var ClickEmitter = Emitter.inherit({
  4000. ctor: function(element) {
  4001. this.callBase(element);
  4002. this._makeElementClickable($(element))
  4003. },
  4004. _makeElementClickable: function($element) {
  4005. if (!$element.attr("onclick")) {
  4006. $element.attr("onclick", "void(0)")
  4007. }
  4008. },
  4009. start: function(e) {
  4010. this._blurPrevented = e.isDefaultPrevented();
  4011. this._startTarget = e.target;
  4012. this._startEventData = eventUtils.eventData(e)
  4013. },
  4014. end: function(e) {
  4015. if (this._eventOutOfElement(e, this.getElement().get(0)) || e.type === pointerEvents.cancel) {
  4016. this._cancel(e);
  4017. return
  4018. }
  4019. if (!isInput(e.target) && !this._blurPrevented) {
  4020. domUtils.resetActiveElement()
  4021. }
  4022. this._accept(e);
  4023. this._clickAnimationFrame = misc.requestAnimationFrame(function() {
  4024. this._fireClickEvent(e)
  4025. }.bind(this))
  4026. },
  4027. _eventOutOfElement: function(e, element) {
  4028. var target = e.target;
  4029. var targetChanged = !domUtils.contains(element, target) && element !== target;
  4030. var gestureDelta = eventUtils.eventDelta(eventUtils.eventData(e), this._startEventData);
  4031. var boundsExceeded = abs(gestureDelta.x) > TOUCH_BOUNDARY || abs(gestureDelta.y) > TOUCH_BOUNDARY;
  4032. return targetChanged || boundsExceeded
  4033. },
  4034. _fireClickEvent: function(e) {
  4035. this._fireEvent(CLICK_EVENT_NAME, e, {
  4036. target: domUtils.closestCommonParent(this._startTarget, e.target)
  4037. })
  4038. },
  4039. dispose: function() {
  4040. misc.cancelAnimationFrame(this._clickAnimationFrame)
  4041. }
  4042. });
  4043. ! function() {
  4044. var NATIVE_CLICK_CLASS = "dx-native-click";
  4045. var realDevice = devices.real();
  4046. var useNativeClick = realDevice.generic || realDevice.ios && compareVersions(realDevice.version, [9, 3]) >= 0 || realDevice.android && compareVersions(realDevice.version, [5]) >= 0;
  4047. var isNativeClickEvent = function(target) {
  4048. return useNativeClick || $(target).closest("." + NATIVE_CLICK_CLASS).length
  4049. };
  4050. var prevented = null;
  4051. var lastFiredEvent = null;
  4052. var clickHandler = function(e) {
  4053. var originalEvent = e.originalEvent;
  4054. var eventAlreadyFired = lastFiredEvent === originalEvent || originalEvent && originalEvent.DXCLICK_FIRED;
  4055. var leftButton = !e.which || 1 === e.which;
  4056. if (leftButton && !prevented && isNativeClickEvent(e.target) && !eventAlreadyFired) {
  4057. if (originalEvent) {
  4058. originalEvent.DXCLICK_FIRED = true
  4059. }
  4060. lastFiredEvent = originalEvent;
  4061. eventUtils.fireEvent({
  4062. type: CLICK_EVENT_NAME,
  4063. originalEvent: e
  4064. })
  4065. }
  4066. };
  4067. ClickEmitter = ClickEmitter.inherit({
  4068. _makeElementClickable: function($element) {
  4069. if (!isNativeClickEvent($element)) {
  4070. this.callBase($element)
  4071. }
  4072. eventsEngine.on($element, "click", clickHandler)
  4073. },
  4074. configure: function(data) {
  4075. this.callBase(data);
  4076. if (data.useNative) {
  4077. this.getElement().addClass(NATIVE_CLICK_CLASS)
  4078. }
  4079. },
  4080. start: function(e) {
  4081. prevented = null;
  4082. if (!isNativeClickEvent(e.target)) {
  4083. this.callBase(e)
  4084. }
  4085. },
  4086. end: function(e) {
  4087. if (!isNativeClickEvent(e.target)) {
  4088. this.callBase(e)
  4089. }
  4090. },
  4091. cancel: function() {
  4092. prevented = true
  4093. },
  4094. dispose: function() {
  4095. this.callBase();
  4096. eventsEngine.off(this.getElement(), "click", clickHandler)
  4097. }
  4098. });
  4099. exports.useNativeClick = useNativeClick
  4100. }();
  4101. ! function() {
  4102. var desktopDevice = devices.real().generic;
  4103. if (!desktopDevice) {
  4104. var startTarget = null;
  4105. var blurPrevented = false;
  4106. var pointerDownHandler = function(e) {
  4107. startTarget = e.target;
  4108. blurPrevented = e.isDefaultPrevented()
  4109. };
  4110. var clickHandler = function(e) {
  4111. var $target = $(e.target);
  4112. if (!blurPrevented && startTarget && !$target.is(startTarget) && !$(startTarget).is("label") && isInput($target)) {
  4113. domUtils.resetActiveElement()
  4114. }
  4115. startTarget = null;
  4116. blurPrevented = false
  4117. };
  4118. var NATIVE_CLICK_FIXER_NAMESPACE = "NATIVE_CLICK_FIXER";
  4119. var document = domAdapter.getDocument();
  4120. eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(pointerEvents.down, NATIVE_CLICK_FIXER_NAMESPACE), pointerDownHandler);
  4121. eventsEngine.subscribeGlobal(document, eventUtils.addNamespace("click", NATIVE_CLICK_FIXER_NAMESPACE), clickHandler)
  4122. }
  4123. }();
  4124. registerEmitter({
  4125. emitter: ClickEmitter,
  4126. bubble: true,
  4127. events: [CLICK_EVENT_NAME]
  4128. });
  4129. exports.name = CLICK_EVENT_NAME;
  4130. exports.misc = misc
  4131. },
  4132. /*!*************************************************!*\
  4133. !*** ./artifacts/transpiled/core/utils/data.js ***!
  4134. \*************************************************/
  4135. /*! dynamic exports provided */
  4136. /*! all exports used */
  4137. function(module, exports, __webpack_require__) {
  4138. var errors = __webpack_require__( /*! ../errors */ 21);
  4139. var Class = __webpack_require__( /*! ../class */ 15);
  4140. var objectUtils = __webpack_require__( /*! ./object */ 47);
  4141. var typeUtils = __webpack_require__( /*! ./type */ 1);
  4142. var each = __webpack_require__( /*! ./iterator */ 3).each;
  4143. var variableWrapper = __webpack_require__( /*! ./variable_wrapper */ 86);
  4144. var unwrapVariable = variableWrapper.unwrap;
  4145. var isWrapped = variableWrapper.isWrapped;
  4146. var assign = variableWrapper.assign;
  4147. var bracketsToDots = function(expr) {
  4148. return expr.replace(/\[/g, ".").replace(/\]/g, "")
  4149. };
  4150. var readPropValue = function(obj, propName, options) {
  4151. options = options || {};
  4152. if ("this" === propName) {
  4153. return unwrap(obj, options)
  4154. }
  4155. return unwrap(obj[propName], options)
  4156. };
  4157. var assignPropValue = function(obj, propName, value, options) {
  4158. if ("this" === propName) {
  4159. throw new errors.Error("E4016")
  4160. }
  4161. var propValue = obj[propName];
  4162. if (options.unwrapObservables && isWrapped(propValue)) {
  4163. assign(propValue, value)
  4164. } else {
  4165. obj[propName] = value
  4166. }
  4167. };
  4168. var prepareOptions = function(options) {
  4169. options = options || {};
  4170. options.unwrapObservables = void 0 !== options.unwrapObservables ? options.unwrapObservables : true;
  4171. return options
  4172. };
  4173. var unwrap = function(value, options) {
  4174. return options.unwrapObservables ? unwrapVariable(value) : value
  4175. };
  4176. var compileGetter = function(expr) {
  4177. if (arguments.length > 1) {
  4178. expr = [].slice.call(arguments)
  4179. }
  4180. if (!expr || "this" === expr) {
  4181. return function(obj) {
  4182. return obj
  4183. }
  4184. }
  4185. if ("string" === typeof expr) {
  4186. expr = bracketsToDots(expr);
  4187. var path = expr.split(".");
  4188. return function(obj, options) {
  4189. options = prepareOptions(options);
  4190. var functionAsIs = options.functionsAsIs;
  4191. var hasDefaultValue = "defaultValue" in options;
  4192. var current = unwrap(obj, options);
  4193. for (var i = 0; i < path.length; i++) {
  4194. if (!current) {
  4195. if (null == current && hasDefaultValue) {
  4196. return options.defaultValue
  4197. }
  4198. break
  4199. }
  4200. var pathPart = path[i];
  4201. if (hasDefaultValue && typeUtils.isObject(current) && !(pathPart in current)) {
  4202. return options.defaultValue
  4203. }
  4204. var next = unwrap(current[pathPart], options);
  4205. if (!functionAsIs && typeUtils.isFunction(next)) {
  4206. next = next.call(current)
  4207. }
  4208. current = next
  4209. }
  4210. return current
  4211. }
  4212. }
  4213. if (Array.isArray(expr)) {
  4214. return combineGetters(expr)
  4215. }
  4216. if (typeUtils.isFunction(expr)) {
  4217. return expr
  4218. }
  4219. };
  4220. var combineGetters = function(getters) {
  4221. var compiledGetters = {};
  4222. for (var i = 0, l = getters.length; i < l; i++) {
  4223. var getter = getters[i];
  4224. compiledGetters[getter] = compileGetter(getter)
  4225. }
  4226. return function(obj, options) {
  4227. var result;
  4228. each(compiledGetters, function(name) {
  4229. var value = this(obj, options);
  4230. var current;
  4231. if (void 0 === value) {
  4232. return
  4233. }
  4234. current = result || (result = {});
  4235. var path = name.split(".");
  4236. var last = path.length - 1;
  4237. for (var _i = 0; _i < last; _i++) {
  4238. var pathItem = path[_i];
  4239. if (!(pathItem in current)) {
  4240. current[pathItem] = {}
  4241. }
  4242. current = current[pathItem]
  4243. }
  4244. current[path[last]] = value
  4245. });
  4246. return result
  4247. }
  4248. };
  4249. var ensurePropValueDefined = function(obj, propName, value, options) {
  4250. if (typeUtils.isDefined(value)) {
  4251. return value
  4252. }
  4253. var newValue = {};
  4254. assignPropValue(obj, propName, newValue, options);
  4255. return newValue
  4256. };
  4257. var compileSetter = function(expr) {
  4258. expr = bracketsToDots(expr || "this").split(".");
  4259. var lastLevelIndex = expr.length - 1;
  4260. return function(obj, value, options) {
  4261. options = prepareOptions(options);
  4262. var currentValue = unwrap(obj, options);
  4263. expr.forEach(function(propertyName, levelIndex) {
  4264. var propertyValue = readPropValue(currentValue, propertyName, options);
  4265. var isPropertyFunc = !options.functionsAsIs && typeUtils.isFunction(propertyValue) && !isWrapped(propertyValue);
  4266. if (levelIndex === lastLevelIndex) {
  4267. if (options.merge && typeUtils.isPlainObject(value) && (!typeUtils.isDefined(propertyValue) || typeUtils.isPlainObject(propertyValue))) {
  4268. propertyValue = ensurePropValueDefined(currentValue, propertyName, propertyValue, options);
  4269. objectUtils.deepExtendArraySafe(propertyValue, value, false, true)
  4270. } else {
  4271. if (isPropertyFunc) {
  4272. currentValue[propertyName](value)
  4273. } else {
  4274. assignPropValue(currentValue, propertyName, value, options)
  4275. }
  4276. }
  4277. } else {
  4278. propertyValue = ensurePropValueDefined(currentValue, propertyName, propertyValue, options);
  4279. if (isPropertyFunc) {
  4280. propertyValue = propertyValue.call(currentValue)
  4281. }
  4282. currentValue = propertyValue
  4283. }
  4284. })
  4285. }
  4286. };
  4287. var toComparable = function(value, caseSensitive) {
  4288. if (value instanceof Date) {
  4289. return value.getTime()
  4290. }
  4291. if (value && value instanceof Class && value.valueOf) {
  4292. return value.valueOf()
  4293. }
  4294. if (!caseSensitive && "string" === typeof value) {
  4295. return value.toLowerCase()
  4296. }
  4297. return value
  4298. };
  4299. exports.compileGetter = compileGetter;
  4300. exports.compileSetter = compileSetter;
  4301. exports.toComparable = toComparable
  4302. },
  4303. /*!*********************************************!*\
  4304. !*** ./artifacts/transpiled/core/errors.js ***!
  4305. \*********************************************/
  4306. /*! dynamic exports provided */
  4307. /*! all exports used */
  4308. function(module, exports, __webpack_require__) {
  4309. var errorUtils = __webpack_require__( /*! ./utils/error */ 129);
  4310. module.exports = errorUtils({
  4311. E0001: "Method is not implemented",
  4312. E0002: "Member name collision: {0}",
  4313. E0003: "A class must be instantiated using the 'new' keyword",
  4314. E0004: "The NAME property of the component is not specified",
  4315. E0005: "Unknown device",
  4316. E0006: "Unknown endpoint key is requested",
  4317. E0007: "'Invalidate' method is called outside the update transaction",
  4318. E0008: "Type of the option name is not appropriate to create an action",
  4319. E0009: "Component '{0}' has not been initialized for an element",
  4320. E0010: "Animation configuration with the '{0}' type requires '{1}' configuration as {2}",
  4321. E0011: "Unknown animation type '{0}'",
  4322. E0012: "jQuery version is too old. Please upgrade jQuery to 1.10.0 or later",
  4323. E0013: "KnockoutJS version is too old. Please upgrade KnockoutJS to 2.3.0 or later",
  4324. E0014: "The 'release' method shouldn't be called for an unlocked Lock object",
  4325. E0015: "Queued task returned an unexpected result",
  4326. E0017: "Event namespace is not defined",
  4327. E0018: "DevExpress.ui.DevExpressPopup widget is required",
  4328. E0020: "Template engine '{0}' is not supported",
  4329. E0021: "Unknown theme is set: {0}",
  4330. E0022: "LINK[rel=DevExpress-theme] tags must go before DevExpress included scripts",
  4331. E0023: "Template name is not specified",
  4332. E0024: "DevExtreme bundle already included",
  4333. E0025: "Unexpected argument type",
  4334. E0100: "Unknown validation type is detected",
  4335. E0101: "Misconfigured range validation rule is detected",
  4336. E0102: "Misconfigured comparison validation rule is detected",
  4337. E0110: "Unknown validation group is detected",
  4338. E0120: "Adapter for a DevExpressValidator component cannot be configured",
  4339. E0121: "The 'customItem' field of the 'onCustomItemCreating' function's parameter should contain a custom item or Promise that is resolved after the item is created.",
  4340. W0000: "'{0}' is deprecated in {1}. {2}",
  4341. W0001: "{0} - '{1}' option is deprecated in {2}. {3}",
  4342. W0002: "{0} - '{1}' method is deprecated in {2}. {3}",
  4343. W0003: "{0} - '{1}' property is deprecated in {2}. {3}",
  4344. W0004: "Timeout for theme loading is over: {0}",
  4345. W0005: "'{0}' event is deprecated in {1}. {2}",
  4346. W0006: "Invalid recurrence rule: '{0}'",
  4347. W0007: "'{0}' Globalize culture is not defined",
  4348. W0008: "Invalid view name: '{0}'",
  4349. W0009: "Invalid time zone name: '{0}'",
  4350. W0010: "{0} is deprecated in {1}. {2}",
  4351. W0011: "Number parsing is invoked while the parser is not defined",
  4352. W0012: "Date parsing is invoked while the parser is not defined",
  4353. W0013: "'{0}' file is deprecated in {1}. {2}",
  4354. W0014: "{0} - '{1}' type is deprecated in {2}. {3}",
  4355. W0015: "Instead of returning a value from the '{0}' function, write it into the '{1}' field of the function's parameter.",
  4356. W0016: 'The "{0}" option does not accept the "{1}" value since v.{2}. {3}.'
  4357. })
  4358. },
  4359. /*!*************************************************!*\
  4360. !*** ./artifacts/transpiled/core/utils/date.js ***!
  4361. \*************************************************/
  4362. /*! dynamic exports provided */
  4363. /*! all exports used */
  4364. function(module, exports, __webpack_require__) {
  4365. var typeUtils = __webpack_require__( /*! ./type */ 1);
  4366. var adjust = __webpack_require__( /*! ./math */ 28).adjust;
  4367. var each = __webpack_require__( /*! ./iterator */ 3).each;
  4368. var camelize = __webpack_require__( /*! ./inflector */ 33).camelize;
  4369. var isObject = typeUtils.isObject;
  4370. var isString = typeUtils.isString;
  4371. var isDate = typeUtils.isDate;
  4372. var isDefined = typeUtils.isDefined;
  4373. var dateUnitIntervals = ["millisecond", "second", "minute", "hour", "day", "week", "month", "quarter", "year"];
  4374. var toMilliseconds = function toMilliseconds(value) {
  4375. switch (value) {
  4376. case "millisecond":
  4377. return 1;
  4378. case "second":
  4379. return 1e3 * toMilliseconds("millisecond");
  4380. case "minute":
  4381. return 60 * toMilliseconds("second");
  4382. case "hour":
  4383. return 60 * toMilliseconds("minute");
  4384. case "day":
  4385. return 24 * toMilliseconds("hour");
  4386. case "week":
  4387. return 7 * toMilliseconds("day");
  4388. case "month":
  4389. return 30 * toMilliseconds("day");
  4390. case "quarter":
  4391. return 3 * toMilliseconds("month");
  4392. case "year":
  4393. return 365 * toMilliseconds("day");
  4394. default:
  4395. return 0
  4396. }
  4397. };
  4398. var getDatesInterval = function(startDate, endDate, intervalUnit) {
  4399. var delta = endDate.getTime() - startDate.getTime();
  4400. var millisecondCount = toMilliseconds(intervalUnit) || 1;
  4401. return Math.floor(delta / millisecondCount)
  4402. };
  4403. var getNextDateUnit = function(unit, withWeeks) {
  4404. var interval = getDateUnitInterval(unit);
  4405. switch (interval) {
  4406. case "millisecond":
  4407. return "second";
  4408. case "second":
  4409. return "minute";
  4410. case "minute":
  4411. return "hour";
  4412. case "hour":
  4413. return "day";
  4414. case "day":
  4415. return withWeeks ? "week" : "month";
  4416. case "week":
  4417. return "month";
  4418. case "month":
  4419. return "quarter";
  4420. case "quarter":
  4421. return "year";
  4422. case "year":
  4423. return "year";
  4424. default:
  4425. return 0
  4426. }
  4427. };
  4428. var convertMillisecondsToDateUnits = function(value) {
  4429. var dateUnitIntervals = ["millisecond", "second", "minute", "hour", "day", "month", "year"];
  4430. var result = {};
  4431. for (var i = dateUnitIntervals.length - 1; i >= 0; i--) {
  4432. var dateUnitInterval = dateUnitIntervals[i];
  4433. var dateUnitCount = Math.floor(value / toMilliseconds(dateUnitInterval));
  4434. if (dateUnitCount > 0) {
  4435. result[dateUnitInterval + "s"] = dateUnitCount;
  4436. value -= convertDateUnitToMilliseconds(dateUnitInterval, dateUnitCount)
  4437. }
  4438. }
  4439. return result
  4440. };
  4441. var dateToMilliseconds = function(tickInterval) {
  4442. var milliseconds = 0;
  4443. if (isObject(tickInterval)) {
  4444. each(tickInterval, function(key, value) {
  4445. milliseconds += convertDateUnitToMilliseconds(key.substr(0, key.length - 1), value)
  4446. })
  4447. }
  4448. if (isString(tickInterval)) {
  4449. milliseconds = convertDateUnitToMilliseconds(tickInterval, 1)
  4450. }
  4451. return milliseconds
  4452. };
  4453. var convertDateUnitToMilliseconds = function(dateUnit, count) {
  4454. return toMilliseconds(dateUnit) * count
  4455. };
  4456. var getDateUnitInterval = function(tickInterval) {
  4457. var maxInterval = -1;
  4458. if (isString(tickInterval)) {
  4459. return tickInterval
  4460. }
  4461. if (isObject(tickInterval)) {
  4462. each(tickInterval, function(key, value) {
  4463. for (var i = 0; i < dateUnitIntervals.length; i++) {
  4464. if (value && (key === dateUnitIntervals[i] + "s" || key === dateUnitIntervals[i]) && maxInterval < i) {
  4465. maxInterval = i
  4466. }
  4467. }
  4468. });
  4469. return dateUnitIntervals[maxInterval]
  4470. }
  4471. return ""
  4472. };
  4473. var tickIntervalToFormatMap = {
  4474. millisecond: "millisecond",
  4475. second: "longtime",
  4476. minute: "shorttime",
  4477. hour: "shorttime",
  4478. day: "day",
  4479. week: "day",
  4480. month: "month",
  4481. quarter: "quarter",
  4482. year: "year"
  4483. };
  4484. function getDateFormatByTickInterval(tickInterval) {
  4485. return tickIntervalToFormatMap[getDateUnitInterval(tickInterval)] || ""
  4486. }
  4487. var getQuarter = function(month) {
  4488. return Math.floor(month / 3)
  4489. };
  4490. var getFirstQuarterMonth = function(month) {
  4491. return 3 * getQuarter(month)
  4492. };
  4493. var correctDateWithUnitBeginning = function(date, dateInterval, withCorrection, firstDayOfWeek) {
  4494. date = new Date(date.getTime());
  4495. var oldDate = new Date(date.getTime());
  4496. var dateUnitInterval = getDateUnitInterval(dateInterval);
  4497. switch (dateUnitInterval) {
  4498. case "second":
  4499. date = new Date(1e3 * Math.floor(oldDate.getTime() / 1e3));
  4500. break;
  4501. case "minute":
  4502. date = new Date(6e4 * Math.floor(oldDate.getTime() / 6e4));
  4503. break;
  4504. case "hour":
  4505. date = new Date(36e5 * Math.floor(oldDate.getTime() / 36e5));
  4506. break;
  4507. case "year":
  4508. date.setMonth(0);
  4509. case "month":
  4510. date.setDate(1);
  4511. case "day":
  4512. date.setHours(0, 0, 0, 0);
  4513. break;
  4514. case "week":
  4515. date = getFirstWeekDate(date, firstDayOfWeek || 0);
  4516. date.setHours(0, 0, 0, 0);
  4517. break;
  4518. case "quarter":
  4519. var firstQuarterMonth = getFirstQuarterMonth(date.getMonth());
  4520. var month = date.getMonth();
  4521. date.setDate(1);
  4522. date.setHours(0, 0, 0, 0);
  4523. if (month !== firstQuarterMonth) {
  4524. date.setMonth(firstQuarterMonth)
  4525. }
  4526. }
  4527. if (withCorrection && "hour" !== dateUnitInterval && "minute" !== dateUnitInterval && "second" !== dateUnitInterval) {
  4528. fixTimezoneGap(oldDate, date)
  4529. }
  4530. return date
  4531. };
  4532. var trimTime = function(date) {
  4533. return dateUtils.correctDateWithUnitBeginning(date, "day")
  4534. };
  4535. var setToDayEnd = function(date) {
  4536. var result = dateUtils.trimTime(date);
  4537. result.setDate(result.getDate() + 1);
  4538. return new Date(result.getTime() - 1)
  4539. };
  4540. var getDatesDifferences = function(date1, date2) {
  4541. var counter = 0;
  4542. var differences = {
  4543. year: date1.getFullYear() !== date2.getFullYear(),
  4544. month: date1.getMonth() !== date2.getMonth(),
  4545. day: date1.getDate() !== date2.getDate(),
  4546. hour: date1.getHours() !== date2.getHours(),
  4547. minute: date1.getMinutes() !== date2.getMinutes(),
  4548. second: date1.getSeconds() !== date2.getSeconds(),
  4549. millisecond: date1.getMilliseconds() !== date2.getMilliseconds()
  4550. };
  4551. each(differences, function(key, value) {
  4552. if (value) {
  4553. counter++
  4554. }
  4555. });
  4556. if (0 === counter && 0 !== getTimezonesDifference(date1, date2)) {
  4557. differences.hour = true;
  4558. counter++
  4559. }
  4560. differences.count = counter;
  4561. return differences
  4562. };
  4563. function addDateInterval(value, interval, dir) {
  4564. var result = new Date(value.getTime());
  4565. var intervalObject = isString(interval) ? getDateIntervalByString(interval.toLowerCase()) : typeUtils.isNumeric(interval) ? convertMillisecondsToDateUnits(interval) : interval;
  4566. if (intervalObject.years) {
  4567. result.setFullYear(result.getFullYear() + intervalObject.years * dir)
  4568. }
  4569. if (intervalObject.quarters) {
  4570. result.setMonth(result.getMonth() + 3 * intervalObject.quarters * dir)
  4571. }
  4572. if (intervalObject.months) {
  4573. result.setMonth(result.getMonth() + intervalObject.months * dir)
  4574. }
  4575. if (intervalObject.weeks) {
  4576. result.setDate(result.getDate() + 7 * intervalObject.weeks * dir)
  4577. }
  4578. if (intervalObject.days) {
  4579. result.setDate(result.getDate() + intervalObject.days * dir)
  4580. }
  4581. if (intervalObject.hours) {
  4582. result.setTime(result.getTime() + 36e5 * intervalObject.hours * dir)
  4583. }
  4584. if (intervalObject.minutes) {
  4585. result.setTime(result.getTime() + 6e4 * intervalObject.minutes * dir)
  4586. }
  4587. if (intervalObject.seconds) {
  4588. result.setTime(result.getTime() + 1e3 * intervalObject.seconds * dir)
  4589. }
  4590. if (intervalObject.milliseconds) {
  4591. result.setTime(result.getTime() + intervalObject.milliseconds * dir)
  4592. }
  4593. return result
  4594. }
  4595. var addInterval = function(value, interval, isNegative) {
  4596. var dir = isNegative ? -1 : 1;
  4597. return isDate(value) ? addDateInterval(value, interval, dir) : adjust(value + interval * dir, interval)
  4598. };
  4599. var getSequenceByInterval = function(min, max, interval) {
  4600. var intervals = [];
  4601. var cur;
  4602. intervals.push(isDate(min) ? new Date(min.getTime()) : min);
  4603. cur = min;
  4604. while (cur < max) {
  4605. cur = addInterval(cur, interval);
  4606. intervals.push(cur)
  4607. }
  4608. return intervals
  4609. };
  4610. var getViewFirstCellDate = function(viewType, date) {
  4611. if ("month" === viewType) {
  4612. return new Date(date.getFullYear(), date.getMonth(), 1)
  4613. }
  4614. if ("year" === viewType) {
  4615. return new Date(date.getFullYear(), 0, date.getDate())
  4616. }
  4617. if ("decade" === viewType) {
  4618. return new Date(getFirstYearInDecade(date), date.getMonth(), date.getDate())
  4619. }
  4620. if ("century" === viewType) {
  4621. return new Date(getFirstDecadeInCentury(date), date.getMonth(), date.getDate())
  4622. }
  4623. };
  4624. var getViewLastCellDate = function(viewType, date) {
  4625. if ("month" === viewType) {
  4626. return new Date(date.getFullYear(), date.getMonth(), getLastMonthDay(date))
  4627. }
  4628. if ("year" === viewType) {
  4629. return new Date(date.getFullYear(), 11, date.getDate())
  4630. }
  4631. if ("decade" === viewType) {
  4632. return new Date(getFirstYearInDecade(date) + 9, date.getMonth(), date.getDate())
  4633. }
  4634. if ("century" === viewType) {
  4635. return new Date(getFirstDecadeInCentury(date) + 90, date.getMonth(), date.getDate())
  4636. }
  4637. };
  4638. var getViewMinBoundaryDate = function(viewType, date) {
  4639. var resultDate = new Date(date.getFullYear(), date.getMonth(), 1);
  4640. if ("month" === viewType) {
  4641. return resultDate
  4642. }
  4643. resultDate.setMonth(0);
  4644. if ("year" === viewType) {
  4645. return resultDate
  4646. }
  4647. if ("decade" === viewType) {
  4648. resultDate.setFullYear(getFirstYearInDecade(date))
  4649. }
  4650. if ("century" === viewType) {
  4651. resultDate.setFullYear(getFirstDecadeInCentury(date))
  4652. }
  4653. return resultDate
  4654. };
  4655. var getViewMaxBoundaryDate = function(viewType, date) {
  4656. var resultDate = new Date(date);
  4657. resultDate.setDate(getLastMonthDay(date));
  4658. if ("month" === viewType) {
  4659. return resultDate
  4660. }
  4661. resultDate.setMonth(11);
  4662. resultDate.setDate(getLastMonthDay(resultDate));
  4663. if ("year" === viewType) {
  4664. return resultDate
  4665. }
  4666. if ("decade" === viewType) {
  4667. resultDate.setFullYear(getFirstYearInDecade(date) + 9)
  4668. }
  4669. if ("century" === viewType) {
  4670. resultDate.setFullYear(getFirstDecadeInCentury(date) + 99)
  4671. }
  4672. return resultDate
  4673. };
  4674. var getLastMonthDay = function(date) {
  4675. var resultDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
  4676. return resultDate.getDate()
  4677. };
  4678. var sameView = function(view, date1, date2) {
  4679. return dateUtils[camelize("same " + view)](date1, date2)
  4680. };
  4681. var getViewUp = function(typeView) {
  4682. switch (typeView) {
  4683. case "month":
  4684. return "year";
  4685. case "year":
  4686. return "decade";
  4687. case "decade":
  4688. return "century"
  4689. }
  4690. };
  4691. var getViewDown = function(typeView) {
  4692. switch (typeView) {
  4693. case "century":
  4694. return "decade";
  4695. case "decade":
  4696. return "year";
  4697. case "year":
  4698. return "month"
  4699. }
  4700. };
  4701. var getDifferenceInMonth = function(typeView) {
  4702. var difference = 1;
  4703. if ("year" === typeView) {
  4704. difference = 12
  4705. }
  4706. if ("decade" === typeView) {
  4707. difference = 120
  4708. }
  4709. if ("century" === typeView) {
  4710. difference = 1200
  4711. }
  4712. return difference
  4713. };
  4714. var getDifferenceInMonthForCells = function(typeView) {
  4715. var difference = 1;
  4716. if ("decade" === typeView) {
  4717. difference = 12
  4718. }
  4719. if ("century" === typeView) {
  4720. difference = 120
  4721. }
  4722. return difference
  4723. };
  4724. var getDateIntervalByString = function(intervalString) {
  4725. var result = {};
  4726. switch (intervalString) {
  4727. case "year":
  4728. result.years = 1;
  4729. break;
  4730. case "month":
  4731. result.months = 1;
  4732. break;
  4733. case "quarter":
  4734. result.months = 3;
  4735. break;
  4736. case "week":
  4737. result.weeks = 1;
  4738. break;
  4739. case "day":
  4740. result.days = 1;
  4741. break;
  4742. case "hour":
  4743. result.hours = 1;
  4744. break;
  4745. case "minute":
  4746. result.minutes = 1;
  4747. break;
  4748. case "second":
  4749. result.seconds = 1;
  4750. break;
  4751. case "millisecond":
  4752. result.milliseconds = 1
  4753. }
  4754. return result
  4755. };
  4756. var sameDate = function(date1, date2) {
  4757. return sameMonthAndYear(date1, date2) && date1.getDate() === date2.getDate()
  4758. };
  4759. var sameMonthAndYear = function(date1, date2) {
  4760. return sameYear(date1, date2) && date1.getMonth() === date2.getMonth()
  4761. };
  4762. var sameYear = function(date1, date2) {
  4763. return date1 && date2 && date1.getFullYear() === date2.getFullYear()
  4764. };
  4765. var sameDecade = function(date1, date2) {
  4766. if (!isDefined(date1) || !isDefined(date2)) {
  4767. return
  4768. }
  4769. var startDecadeDate1 = date1.getFullYear() - date1.getFullYear() % 10;
  4770. var startDecadeDate2 = date2.getFullYear() - date2.getFullYear() % 10;
  4771. return date1 && date2 && startDecadeDate1 === startDecadeDate2
  4772. };
  4773. var sameCentury = function(date1, date2) {
  4774. if (!isDefined(date1) || !isDefined(date2)) {
  4775. return
  4776. }
  4777. var startCenturyDate1 = date1.getFullYear() - date1.getFullYear() % 100;
  4778. var startCenturyDate2 = date2.getFullYear() - date2.getFullYear() % 100;
  4779. return date1 && date2 && startCenturyDate1 === startCenturyDate2
  4780. };
  4781. var getFirstDecadeInCentury = function(date) {
  4782. return date && date.getFullYear() - date.getFullYear() % 100
  4783. };
  4784. var getFirstYearInDecade = function(date) {
  4785. return date && date.getFullYear() - date.getFullYear() % 10
  4786. };
  4787. var getShortDateFormat = function() {
  4788. return "yyyy/MM/dd"
  4789. };
  4790. var getFirstMonthDate = function(date) {
  4791. if (!isDefined(date)) {
  4792. return
  4793. }
  4794. var newDate = new Date(date.getFullYear(), date.getMonth(), 1);
  4795. return newDate
  4796. };
  4797. var getLastMonthDate = function(date) {
  4798. if (!isDefined(date)) {
  4799. return
  4800. }
  4801. var newDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
  4802. return newDate
  4803. };
  4804. var getFirstWeekDate = function(date, firstDayOfWeek) {
  4805. var delta = (date.getDay() - firstDayOfWeek + 7) % 7;
  4806. var result = new Date(date);
  4807. result.setDate(date.getDate() - delta);
  4808. return result
  4809. };
  4810. var normalizeDateByWeek = function(date, currentDate) {
  4811. var differenceInDays = dateUtils.getDatesInterval(date, currentDate, "day");
  4812. var resultDate = new Date(date);
  4813. if (differenceInDays >= 6) {
  4814. resultDate = new Date(resultDate.setDate(resultDate.getDate() + 7))
  4815. }
  4816. return resultDate
  4817. };
  4818. var dateInRange = function(date, min, max, format) {
  4819. if ("date" === format) {
  4820. min = min && dateUtils.correctDateWithUnitBeginning(min, "day");
  4821. max = max && dateUtils.correctDateWithUnitBeginning(max, "day");
  4822. date = date && dateUtils.correctDateWithUnitBeginning(date, "day")
  4823. }
  4824. return normalizeDate(date, min, max) === date
  4825. };
  4826. var dateTimeFromDecimal = function(number) {
  4827. var hours = Math.floor(number);
  4828. var minutes = number % 1 * 60;
  4829. return {
  4830. hours: hours,
  4831. minutes: minutes
  4832. }
  4833. };
  4834. var roundDateByStartDayHour = function(date, startDayHour) {
  4835. var startTime = this.dateTimeFromDecimal(startDayHour);
  4836. var result = new Date(date);
  4837. if (date.getHours() === startTime.hours && date.getMinutes() < startTime.minutes || date.getHours() < startTime.hours) {
  4838. result.setHours(startTime.hours, startTime.minutes, 0, 0)
  4839. }
  4840. return result
  4841. };
  4842. var normalizeDate = function(date, min, max) {
  4843. var normalizedDate = date;
  4844. if (!isDefined(date)) {
  4845. return date
  4846. }
  4847. if (isDefined(min) && date < min) {
  4848. normalizedDate = min
  4849. }
  4850. if (isDefined(max) && date > max) {
  4851. normalizedDate = max
  4852. }
  4853. return normalizedDate
  4854. };
  4855. var fixTimezoneGap = function(oldDate, newDate) {
  4856. if (!isDefined(oldDate)) {
  4857. return
  4858. }
  4859. var diff = newDate.getHours() - oldDate.getHours();
  4860. if (0 === diff) {
  4861. return
  4862. }
  4863. var sign = 1 === diff || diff === -23 ? -1 : 1;
  4864. var trial = new Date(newDate.getTime() + 36e5 * sign);
  4865. if (sign > 0 || trial.getDate() === newDate.getDate()) {
  4866. newDate.setTime(trial.getTime())
  4867. }
  4868. };
  4869. var roundToHour = function(date) {
  4870. date.setHours(date.getHours() + 1);
  4871. date.setMinutes(0);
  4872. return date
  4873. };
  4874. var getTimezonesDifference = function(min, max) {
  4875. return 60 * (max.getTimezoneOffset() - min.getTimezoneOffset()) * 1e3
  4876. };
  4877. var makeDate = function(date) {
  4878. return new Date(date)
  4879. };
  4880. var getDatesOfInterval = function(startDate, endDate, step) {
  4881. var result = [];
  4882. var currentDate = new Date(startDate.getTime());
  4883. if (startDate.getTime() === endDate.getTime()) {
  4884. result.push(new Date(startDate.getTime()))
  4885. }
  4886. while (currentDate < endDate) {
  4887. result.push(new Date(currentDate.getTime()));
  4888. currentDate = this.addInterval(currentDate, step)
  4889. }
  4890. return result
  4891. };
  4892. var dateUtils = {
  4893. dateUnitIntervals: dateUnitIntervals,
  4894. convertMillisecondsToDateUnits: convertMillisecondsToDateUnits,
  4895. dateToMilliseconds: dateToMilliseconds,
  4896. getNextDateUnit: getNextDateUnit,
  4897. convertDateUnitToMilliseconds: convertDateUnitToMilliseconds,
  4898. getDateUnitInterval: getDateUnitInterval,
  4899. getDateFormatByTickInterval: getDateFormatByTickInterval,
  4900. getDatesDifferences: getDatesDifferences,
  4901. correctDateWithUnitBeginning: correctDateWithUnitBeginning,
  4902. trimTime: trimTime,
  4903. setToDayEnd: setToDayEnd,
  4904. roundDateByStartDayHour: roundDateByStartDayHour,
  4905. dateTimeFromDecimal: dateTimeFromDecimal,
  4906. addDateInterval: addDateInterval,
  4907. addInterval: addInterval,
  4908. getSequenceByInterval: getSequenceByInterval,
  4909. getDateIntervalByString: getDateIntervalByString,
  4910. sameDate: sameDate,
  4911. sameMonthAndYear: sameMonthAndYear,
  4912. sameMonth: sameMonthAndYear,
  4913. sameYear: sameYear,
  4914. sameDecade: sameDecade,
  4915. sameCentury: sameCentury,
  4916. sameView: sameView,
  4917. getDifferenceInMonth: getDifferenceInMonth,
  4918. getDifferenceInMonthForCells: getDifferenceInMonthForCells,
  4919. getFirstYearInDecade: getFirstYearInDecade,
  4920. getFirstDecadeInCentury: getFirstDecadeInCentury,
  4921. getShortDateFormat: getShortDateFormat,
  4922. getViewFirstCellDate: getViewFirstCellDate,
  4923. getViewLastCellDate: getViewLastCellDate,
  4924. getViewDown: getViewDown,
  4925. getViewUp: getViewUp,
  4926. getLastMonthDay: getLastMonthDay,
  4927. getLastMonthDate: getLastMonthDate,
  4928. getFirstMonthDate: getFirstMonthDate,
  4929. getFirstWeekDate: getFirstWeekDate,
  4930. normalizeDateByWeek: normalizeDateByWeek,
  4931. getQuarter: getQuarter,
  4932. getFirstQuarterMonth: getFirstQuarterMonth,
  4933. dateInRange: dateInRange,
  4934. roundToHour: roundToHour,
  4935. normalizeDate: normalizeDate,
  4936. getViewMinBoundaryDate: getViewMinBoundaryDate,
  4937. getViewMaxBoundaryDate: getViewMaxBoundaryDate,
  4938. fixTimezoneGap: fixTimezoneGap,
  4939. getTimezonesDifference: getTimezonesDifference,
  4940. makeDate: makeDate,
  4941. getDatesInterval: getDatesInterval,
  4942. getDatesOfInterval: getDatesOfInterval
  4943. };
  4944. module.exports = dateUtils
  4945. },
  4946. /*!************************************************!*\
  4947. !*** ./artifacts/transpiled/events/pointer.js ***!
  4948. \************************************************/
  4949. /*! dynamic exports provided */
  4950. /*! all exports used */
  4951. function(module, exports, __webpack_require__) {
  4952. var _support = __webpack_require__( /*! ../core/utils/support */ 43);
  4953. var _support2 = _interopRequireDefault(_support);
  4954. var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
  4955. var _browser = __webpack_require__( /*! ../core/utils/browser */ 25);
  4956. var _browser2 = _interopRequireDefault(_browser);
  4957. var _devices = __webpack_require__( /*! ../core/devices */ 16);
  4958. var _devices2 = _interopRequireDefault(_devices);
  4959. var _event_registrator = __webpack_require__( /*! ./core/event_registrator */ 71);
  4960. var _event_registrator2 = _interopRequireDefault(_event_registrator);
  4961. var _touch = __webpack_require__( /*! ./pointer/touch */ 265);
  4962. var _touch2 = _interopRequireDefault(_touch);
  4963. var _mspointer = __webpack_require__( /*! ./pointer/mspointer */ 447);
  4964. var _mspointer2 = _interopRequireDefault(_mspointer);
  4965. var _mouse = __webpack_require__( /*! ./pointer/mouse */ 267);
  4966. var _mouse2 = _interopRequireDefault(_mouse);
  4967. var _mouse_and_touch = __webpack_require__( /*! ./pointer/mouse_and_touch */ 448);
  4968. var _mouse_and_touch2 = _interopRequireDefault(_mouse_and_touch);
  4969. function _interopRequireDefault(obj) {
  4970. return obj && obj.__esModule ? obj : {
  4971. "default": obj
  4972. }
  4973. }
  4974. var getStrategy = function(support, device, browser) {
  4975. if (support.pointerEvents && browser.msie) {
  4976. return _mspointer2.default
  4977. }
  4978. var tablet = device.tablet,
  4979. phone = device.phone;
  4980. if (support.touch && !(tablet || phone)) {
  4981. return _mouse_and_touch2.default
  4982. }
  4983. if (support.touch) {
  4984. return _touch2.default
  4985. }
  4986. return _mouse2.default
  4987. };
  4988. var EventStrategy = getStrategy(_support2.default, _devices2.default.real(), _browser2.default);
  4989. (0, _iterator.each)(EventStrategy.map, function(pointerEvent, originalEvents) {
  4990. (0, _event_registrator2.default)(pointerEvent, new EventStrategy(pointerEvent, originalEvents))
  4991. });
  4992. var pointer = {
  4993. down: "dxpointerdown",
  4994. up: "dxpointerup",
  4995. move: "dxpointermove",
  4996. cancel: "dxpointercancel",
  4997. enter: "dxpointerenter",
  4998. leave: "dxpointerleave",
  4999. over: "dxpointerover",
  5000. out: "dxpointerout"
  5001. };
  5002. pointer.getStrategy = getStrategy;
  5003. module.exports = pointer
  5004. }, ,
  5005. /*!****************************************************!*\
  5006. !*** ./artifacts/transpiled/core/utils/browser.js ***!
  5007. \****************************************************/
  5008. /*! dynamic exports provided */
  5009. /*! all exports used */
  5010. function(module, exports, __webpack_require__) {
  5011. var extend = __webpack_require__( /*! ./extend */ 0).extend;
  5012. var windowUtils = __webpack_require__( /*! ./window */ 7);
  5013. var navigator = windowUtils.getNavigator();
  5014. var webkitRegExp = /(webkit)[ \/]([\w.]+)/;
  5015. var ieRegExp = /(msie) (\d{1,2}\.\d)/;
  5016. var ie11RegExp = /(trident).*rv:(\d{1,2}\.\d)/;
  5017. var msEdge = /(edge)\/((\d+)?[\w.]+)/;
  5018. var mozillaRegExp = /(mozilla)(?:.*? rv:([\w.]+))/;
  5019. var browserFromUA = function(ua) {
  5020. ua = ua.toLowerCase();
  5021. var result = {};
  5022. var matches = ieRegExp.exec(ua) || ie11RegExp.exec(ua) || msEdge.exec(ua) || ua.indexOf("compatible") < 0 && mozillaRegExp.exec(ua) || webkitRegExp.exec(ua) || [];
  5023. var browserName = matches[1];
  5024. var browserVersion = matches[2];
  5025. if ("webkit" === browserName) {
  5026. result.webkit = true;
  5027. if (ua.indexOf("chrome") >= 0 || ua.indexOf("crios") >= 0) {
  5028. browserName = "chrome";
  5029. browserVersion = /(?:chrome|crios)\/(\d+\.\d+)/.exec(ua);
  5030. browserVersion = browserVersion && browserVersion[1]
  5031. } else {
  5032. if (ua.indexOf("fxios") >= 0) {
  5033. browserName = "mozilla";
  5034. browserVersion = /fxios\/(\d+\.\d+)/.exec(ua);
  5035. browserVersion = browserVersion && browserVersion[1]
  5036. } else {
  5037. if (ua.indexOf("safari") >= 0 && /version|phantomjs/.test(ua)) {
  5038. browserName = "safari";
  5039. browserVersion = /(?:version|phantomjs)\/([0-9.]+)/.exec(ua);
  5040. browserVersion = browserVersion && browserVersion[1]
  5041. } else {
  5042. browserName = "unknown";
  5043. browserVersion = /applewebkit\/([0-9.]+)/.exec(ua);
  5044. browserVersion = browserVersion && browserVersion[1]
  5045. }
  5046. }
  5047. }
  5048. }
  5049. if ("trident" === browserName || "edge" === browserName) {
  5050. browserName = "msie"
  5051. }
  5052. if (browserName) {
  5053. result[browserName] = true;
  5054. result.version = browserVersion
  5055. }
  5056. return result
  5057. };
  5058. module.exports = extend({
  5059. _fromUA: browserFromUA
  5060. }, browserFromUA(navigator.userAgent))
  5061. },
  5062. /*!******************************************************!*\
  5063. !*** ./artifacts/transpiled/core/utils/callbacks.js ***!
  5064. \******************************************************/
  5065. /*! dynamic exports provided */
  5066. /*! all exports used */
  5067. function(module, exports, __webpack_require__) {
  5068. var Callback = function(options) {
  5069. this._options = options || {};
  5070. this._list = [];
  5071. this._queue = [];
  5072. this._firing = false;
  5073. this._fired = false;
  5074. this._firingIndexes = []
  5075. };
  5076. Callback.prototype._fireCore = function(context, args) {
  5077. var firingIndexes = this._firingIndexes;
  5078. var list = this._list;
  5079. var stopOnFalse = this._options.stopOnFalse;
  5080. var step = firingIndexes.length;
  5081. for (firingIndexes[step] = 0; firingIndexes[step] < list.length; firingIndexes[step]++) {
  5082. var result = list[firingIndexes[step]].apply(context, args);
  5083. if (false === result && stopOnFalse) {
  5084. break
  5085. }
  5086. }
  5087. firingIndexes.pop()
  5088. };
  5089. Callback.prototype.add = function(fn) {
  5090. if ("function" === typeof fn && (!this._options.unique || !this.has(fn))) {
  5091. this._list.push(fn)
  5092. }
  5093. return this
  5094. };
  5095. Callback.prototype.remove = function(fn) {
  5096. var list = this._list;
  5097. var firingIndexes = this._firingIndexes;
  5098. var index = list.indexOf(fn);
  5099. if (index > -1) {
  5100. list.splice(index, 1);
  5101. if (this._firing && firingIndexes.length) {
  5102. for (var step = 0; step < firingIndexes.length; step++) {
  5103. if (index <= firingIndexes[step]) {
  5104. firingIndexes[step]--
  5105. }
  5106. }
  5107. }
  5108. }
  5109. return this
  5110. };
  5111. Callback.prototype.has = function(fn) {
  5112. var list = this._list;
  5113. return fn ? list.indexOf(fn) > -1 : !!list.length
  5114. };
  5115. Callback.prototype.empty = function(fn) {
  5116. this._list = [];
  5117. return this
  5118. };
  5119. Callback.prototype.fireWith = function(context, args) {
  5120. var queue = this._queue;
  5121. args = args || [];
  5122. args = args.slice ? args.slice() : args;
  5123. if (this._options.syncStrategy) {
  5124. this._firing = true;
  5125. this._fireCore(context, args)
  5126. } else {
  5127. queue.push([context, args]);
  5128. if (this._firing) {
  5129. return
  5130. }
  5131. this._firing = true;
  5132. while (queue.length) {
  5133. var memory = queue.shift();
  5134. this._fireCore(memory[0], memory[1])
  5135. }
  5136. }
  5137. this._firing = false;
  5138. this._fired = true;
  5139. return this
  5140. };
  5141. Callback.prototype.fire = function() {
  5142. this.fireWith(this, arguments)
  5143. };
  5144. Callback.prototype.fired = function() {
  5145. return this._fired
  5146. };
  5147. var Callbacks = function(options) {
  5148. return new Callback(options)
  5149. };
  5150. module.exports = Callbacks
  5151. },
  5152. /*!******************************************************!*\
  5153. !*** ./artifacts/transpiled/animation/translator.js ***!
  5154. \******************************************************/
  5155. /*! dynamic exports provided */
  5156. /*! all exports used */
  5157. function(module, exports, __webpack_require__) {
  5158. var dataUtils = __webpack_require__( /*! ../core/element_data */ 39);
  5159. var type = __webpack_require__( /*! ../core/utils/type */ 1).type;
  5160. var TRANSLATOR_DATA_KEY = "dxTranslator";
  5161. var TRANSFORM_MATRIX_REGEX = /matrix(3d)?\((.+?)\)/;
  5162. var TRANSLATE_REGEX = /translate(?:3d)?\((.+?)\)/;
  5163. var locate = function($element) {
  5164. var translate = getTranslate($element);
  5165. return {
  5166. left: translate.x,
  5167. top: translate.y
  5168. }
  5169. };
  5170. var move = function($element, position) {
  5171. var left = position.left;
  5172. var top = position.top;
  5173. var translate;
  5174. if (void 0 === left) {
  5175. translate = getTranslate($element);
  5176. translate.y = top || 0
  5177. } else {
  5178. if (void 0 === top) {
  5179. translate = getTranslate($element);
  5180. translate.x = left || 0
  5181. } else {
  5182. translate = {
  5183. x: left || 0,
  5184. y: top || 0,
  5185. z: 0
  5186. };
  5187. cacheTranslate($element, translate)
  5188. }
  5189. }
  5190. $element.css({
  5191. transform: getTranslateCss(translate)
  5192. });
  5193. if (isPercentValue(left) || isPercentValue(top)) {
  5194. clearCache($element)
  5195. }
  5196. };
  5197. var isPercentValue = function(value) {
  5198. return "string" === type(value) && "%" === value[value.length - 1]
  5199. };
  5200. var getTranslate = function($element) {
  5201. var result = $element.length ? dataUtils.data($element.get(0), TRANSLATOR_DATA_KEY) : null;
  5202. if (!result) {
  5203. var transformValue = $element.css("transform") || getTranslateCss({
  5204. x: 0,
  5205. y: 0
  5206. });
  5207. var matrix = transformValue.match(TRANSFORM_MATRIX_REGEX);
  5208. var is3D = matrix && matrix[1];
  5209. if (matrix) {
  5210. matrix = matrix[2].split(",");
  5211. if ("3d" === is3D) {
  5212. matrix = matrix.slice(12, 15)
  5213. } else {
  5214. matrix.push(0);
  5215. matrix = matrix.slice(4, 7)
  5216. }
  5217. } else {
  5218. matrix = [0, 0, 0]
  5219. }
  5220. result = {
  5221. x: parseFloat(matrix[0]),
  5222. y: parseFloat(matrix[1]),
  5223. z: parseFloat(matrix[2])
  5224. };
  5225. cacheTranslate($element, result)
  5226. }
  5227. return result
  5228. };
  5229. var cacheTranslate = function($element, translate) {
  5230. if ($element.length) {
  5231. dataUtils.data($element.get(0), TRANSLATOR_DATA_KEY, translate)
  5232. }
  5233. };
  5234. var clearCache = function($element) {
  5235. if ($element.length) {
  5236. dataUtils.removeData($element.get(0), TRANSLATOR_DATA_KEY)
  5237. }
  5238. };
  5239. var resetPosition = function($element, finishTransition) {
  5240. var originalTransition;
  5241. var stylesConfig = {
  5242. left: 0,
  5243. top: 0,
  5244. transform: "none"
  5245. };
  5246. if (finishTransition) {
  5247. originalTransition = $element.css("transition");
  5248. stylesConfig.transition = "none"
  5249. }
  5250. $element.css(stylesConfig);
  5251. clearCache($element);
  5252. if (finishTransition) {
  5253. $element.get(0).offsetHeight;
  5254. $element.css("transition", originalTransition)
  5255. }
  5256. };
  5257. var parseTranslate = function(translateString) {
  5258. var result = translateString.match(TRANSLATE_REGEX);
  5259. if (!result || !result[1]) {
  5260. return
  5261. }
  5262. result = result[1].split(",");
  5263. result = {
  5264. x: parseFloat(result[0]),
  5265. y: parseFloat(result[1]),
  5266. z: parseFloat(result[2])
  5267. };
  5268. return result
  5269. };
  5270. var getTranslateCss = function(translate) {
  5271. translate.x = translate.x || 0;
  5272. translate.y = translate.y || 0;
  5273. var xValueString = isPercentValue(translate.x) ? translate.x : translate.x + "px";
  5274. var yValueString = isPercentValue(translate.y) ? translate.y : translate.y + "px";
  5275. return "translate(" + xValueString + ", " + yValueString + ")"
  5276. };
  5277. exports.move = move;
  5278. exports.locate = locate;
  5279. exports.clearCache = clearCache;
  5280. exports.parseTranslate = parseTranslate;
  5281. exports.getTranslate = getTranslate;
  5282. exports.getTranslateCss = getTranslateCss;
  5283. exports.resetPosition = resetPosition
  5284. },
  5285. /*!*************************************************!*\
  5286. !*** ./artifacts/transpiled/core/utils/math.js ***!
  5287. \*************************************************/
  5288. /*! dynamic exports provided */
  5289. /*! all exports used */
  5290. function(module, exports, __webpack_require__) {
  5291. var isExponential = __webpack_require__( /*! ./type */ 1).isExponential;
  5292. var sign = function(value) {
  5293. if (0 === value) {
  5294. return 0
  5295. }
  5296. return value / Math.abs(value)
  5297. };
  5298. var fitIntoRange = function(value, minValue, maxValue) {
  5299. var isMinValueUndefined = !minValue && 0 !== minValue;
  5300. var isMaxValueUndefined = !maxValue && 0 !== maxValue;
  5301. isMinValueUndefined && (minValue = !isMaxValueUndefined ? Math.min(value, maxValue) : value);
  5302. isMaxValueUndefined && (maxValue = !isMinValueUndefined ? Math.max(value, minValue) : value);
  5303. return Math.min(Math.max(value, minValue), maxValue)
  5304. };
  5305. var inRange = function(value, minValue, maxValue) {
  5306. return value >= minValue && value <= maxValue
  5307. };
  5308. function getExponent(value) {
  5309. return Math.abs(parseInt(value.toExponential().split("e")[1]))
  5310. }
  5311. function _isEdgeBug() {
  5312. var value = 3e-4;
  5313. var correctValue = "0.000300";
  5314. var precisionValue = 3;
  5315. return correctValue !== value.toPrecision(precisionValue)
  5316. }
  5317. function adjust(value, interval) {
  5318. var precision = getPrecision(interval || 0) + 2;
  5319. var separatedValue = value.toString().split(".");
  5320. var sourceValue = value;
  5321. var absValue = Math.abs(value);
  5322. var isExponentValue = isExponential(value);
  5323. var integerPart = absValue > 1 ? 10 : 0;
  5324. if (1 === separatedValue.length) {
  5325. return value
  5326. }
  5327. if (!isExponentValue) {
  5328. if (isExponential(interval)) {
  5329. precision = separatedValue[0].length + getExponent(interval)
  5330. }
  5331. value = absValue;
  5332. value = value - Math.floor(value) + integerPart
  5333. }
  5334. precision = _isEdgeBug() && getExponent(value) > 6 || precision > 7 ? 15 : 7;
  5335. if (!isExponentValue) {
  5336. var separatedAdjustedValue = parseFloat(value.toPrecision(precision)).toString().split(".");
  5337. if (separatedAdjustedValue[0] === integerPart.toString()) {
  5338. return parseFloat(separatedValue[0] + "." + separatedAdjustedValue[1])
  5339. }
  5340. }
  5341. return parseFloat(sourceValue.toPrecision(precision))
  5342. }
  5343. function getPrecision(value) {
  5344. var str = value.toString();
  5345. if (str.indexOf(".") < 0) {
  5346. return 0
  5347. }
  5348. var mantissa = str.split(".");
  5349. var positionOfDelimiter = mantissa[1].indexOf("e");
  5350. return positionOfDelimiter >= 0 ? positionOfDelimiter : mantissa[1].length
  5351. }
  5352. function getRoot(x, n) {
  5353. if (x < 0 && n % 2 !== 1) {
  5354. return NaN
  5355. }
  5356. var y = Math.pow(Math.abs(x), 1 / n);
  5357. return n % 2 === 1 && x < 0 ? -y : y
  5358. }
  5359. function solveCubicEquation(a, b, c, d) {
  5360. var min = 1e-8;
  5361. if (Math.abs(a) < min) {
  5362. a = b;
  5363. b = c;
  5364. c = d;
  5365. if (Math.abs(a) < min) {
  5366. a = b;
  5367. b = c;
  5368. if (Math.abs(a) < min) {
  5369. return []
  5370. }
  5371. return [-b / a]
  5372. }
  5373. var D2 = b * b - 4 * a * c;
  5374. if (Math.abs(D2) < min) {
  5375. return [-b / (2 * a)]
  5376. } else {
  5377. if (D2 > 0) {
  5378. return [(-b + Math.sqrt(D2)) / (2 * a), (-b - Math.sqrt(D2)) / (2 * a)]
  5379. }
  5380. }
  5381. return []
  5382. }
  5383. var p = (3 * a * c - b * b) / (3 * a * a);
  5384. var q = (2 * b * b * b - 9 * a * b * c + 27 * a * a * d) / (27 * a * a * a);
  5385. var roots;
  5386. var u;
  5387. if (Math.abs(p) < min) {
  5388. roots = [getRoot(-q, 3)]
  5389. } else {
  5390. if (Math.abs(q) < min) {
  5391. roots = [0].concat(p < 0 ? [Math.sqrt(-p), -Math.sqrt(-p)] : [])
  5392. } else {
  5393. var D3 = q * q / 4 + p * p * p / 27;
  5394. if (Math.abs(D3) < min) {
  5395. roots = [-1.5 * q / p, 3 * q / p]
  5396. } else {
  5397. if (D3 > 0) {
  5398. u = getRoot(-q / 2 - Math.sqrt(D3), 3);
  5399. roots = [u - p / (3 * u)]
  5400. } else {
  5401. u = 2 * Math.sqrt(-p / 3);
  5402. var t = Math.acos(3 * q / p / u) / 3;
  5403. var k = 2 * Math.PI / 3;
  5404. roots = [u * Math.cos(t), u * Math.cos(t - k), u * Math.cos(t - 2 * k)]
  5405. }
  5406. }
  5407. }
  5408. }
  5409. for (var i = 0; i < roots.length; i++) {
  5410. roots[i] -= b / (3 * a)
  5411. }
  5412. return roots
  5413. }
  5414. exports.sign = sign;
  5415. exports.fitIntoRange = fitIntoRange;
  5416. exports.inRange = inRange;
  5417. exports.adjust = adjust;
  5418. exports.getPrecision = getPrecision;
  5419. exports.getExponent = getExponent;
  5420. exports.getRoot = getRoot;
  5421. exports.solveCubicEquation = solveCubicEquation
  5422. }, ,
  5423. /*!*******************************************!*\
  5424. !*** ./artifacts/transpiled/ui/themes.js ***!
  5425. \*******************************************/
  5426. /*! dynamic exports provided */
  5427. /*! all exports used */
  5428. function(module, exports, __webpack_require__) {
  5429. var $ = __webpack_require__( /*! ../core/renderer */ 2);
  5430. var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
  5431. var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
  5432. var window = windowUtils.getWindow();
  5433. var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred;
  5434. var errors = __webpack_require__( /*! ./widget/ui.errors */ 17);
  5435. var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12);
  5436. var readyCallbacks = __webpack_require__( /*! ../core/utils/ready_callbacks */ 48);
  5437. var ready = readyCallbacks.add;
  5438. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  5439. var devices = __webpack_require__( /*! ../core/devices */ 16);
  5440. var viewPortUtils = __webpack_require__( /*! ../core/utils/view_port */ 78);
  5441. var themeReadyCallback = __webpack_require__( /*! ./themes_callback */ 269);
  5442. var viewPort = viewPortUtils.value;
  5443. var Promise = __webpack_require__( /*! ../core/polyfills/promise */ 76);
  5444. var viewPortChanged = viewPortUtils.changeCallback;
  5445. var DX_LINK_SELECTOR = "link[rel=dx-theme]";
  5446. var THEME_ATTR = "data-theme";
  5447. var ACTIVE_ATTR = "data-active";
  5448. var DX_HAIRLINES_CLASS = "dx-hairlines";
  5449. var context;
  5450. var $activeThemeLink;
  5451. var knownThemes;
  5452. var currentThemeName;
  5453. var pendingThemeName;
  5454. var timerId;
  5455. var THEME_MARKER_PREFIX = "dx.";
  5456. function readThemeMarker() {
  5457. if (!windowUtils.hasWindow()) {
  5458. return null
  5459. }
  5460. var element = $("<div>", context).addClass("dx-theme-marker").appendTo(context.documentElement);
  5461. var result;
  5462. try {
  5463. result = element.css("fontFamily");
  5464. if (!result) {
  5465. return null
  5466. }
  5467. result = result.replace(/["']/g, "");
  5468. if (result.substr(0, THEME_MARKER_PREFIX.length) !== THEME_MARKER_PREFIX) {
  5469. return null
  5470. }
  5471. return result.substr(THEME_MARKER_PREFIX.length)
  5472. } finally {
  5473. element.remove()
  5474. }
  5475. }
  5476. function waitForThemeLoad(themeName) {
  5477. var waitStartTime;
  5478. pendingThemeName = themeName;
  5479. function handleLoaded() {
  5480. pendingThemeName = null;
  5481. themeReadyCallback.fire();
  5482. themeReadyCallback.empty()
  5483. }
  5484. if (isPendingThemeLoaded()) {
  5485. handleLoaded()
  5486. } else {
  5487. waitStartTime = Date.now();
  5488. timerId = setInterval(function() {
  5489. var isLoaded = isPendingThemeLoaded();
  5490. var isTimeout = !isLoaded && Date.now() - waitStartTime > 15e3;
  5491. if (isTimeout) {
  5492. errors.log("W0004", pendingThemeName)
  5493. }
  5494. if (isLoaded || isTimeout) {
  5495. clearInterval(timerId);
  5496. timerId = void 0;
  5497. handleLoaded()
  5498. }
  5499. }, 10)
  5500. }
  5501. }
  5502. function isPendingThemeLoaded() {
  5503. return !pendingThemeName || readThemeMarker() === pendingThemeName
  5504. }
  5505. function processMarkup() {
  5506. var $allThemeLinks = $(DX_LINK_SELECTOR, context);
  5507. if (!$allThemeLinks.length) {
  5508. return
  5509. }
  5510. knownThemes = {};
  5511. $activeThemeLink = $(domUtils.createMarkupFromString("<link rel=stylesheet>"), context);
  5512. $allThemeLinks.each(function() {
  5513. var link = $(this, context);
  5514. var fullThemeName = link.attr(THEME_ATTR);
  5515. var url = link.attr("href");
  5516. var isActive = "true" === link.attr(ACTIVE_ATTR);
  5517. knownThemes[fullThemeName] = {
  5518. url: url,
  5519. isActive: isActive
  5520. }
  5521. });
  5522. $allThemeLinks.last().after($activeThemeLink);
  5523. $allThemeLinks.remove()
  5524. }
  5525. function resolveFullThemeName(desiredThemeName) {
  5526. var desiredThemeParts = desiredThemeName.split(".");
  5527. var result = null;
  5528. if (knownThemes) {
  5529. if (desiredThemeName in knownThemes) {
  5530. return desiredThemeName
  5531. }
  5532. each(knownThemes, function(knownThemeName, themeData) {
  5533. var knownThemeParts = knownThemeName.split(".");
  5534. if (knownThemeParts[0] !== desiredThemeParts[0]) {
  5535. return
  5536. }
  5537. if (desiredThemeParts[1] && desiredThemeParts[1] !== knownThemeParts[1]) {
  5538. return
  5539. }
  5540. if (desiredThemeParts[2] && desiredThemeParts[2] !== knownThemeParts[2]) {
  5541. return
  5542. }
  5543. if (!result || themeData.isActive) {
  5544. result = knownThemeName
  5545. }
  5546. if (themeData.isActive) {
  5547. return false
  5548. }
  5549. })
  5550. }
  5551. return result
  5552. }
  5553. function initContext(newContext) {
  5554. try {
  5555. if (newContext !== context) {
  5556. knownThemes = null
  5557. }
  5558. } catch (x) {
  5559. knownThemes = null
  5560. }
  5561. context = newContext
  5562. }
  5563. function init(options) {
  5564. options = options || {};
  5565. initContext(options.context || domAdapter.getDocument());
  5566. if (!context) {
  5567. return
  5568. }
  5569. processMarkup();
  5570. currentThemeName = void 0;
  5571. current(options)
  5572. }
  5573. function current(options) {
  5574. if (!arguments.length) {
  5575. currentThemeName = currentThemeName || readThemeMarker();
  5576. return currentThemeName
  5577. }
  5578. detachCssClasses(viewPort());
  5579. options = options || {};
  5580. if ("string" === typeof options) {
  5581. options = {
  5582. theme: options
  5583. }
  5584. }
  5585. var isAutoInit = options._autoInit;
  5586. var loadCallback = options.loadCallback;
  5587. var currentThemeData;
  5588. currentThemeName = options.theme || currentThemeName;
  5589. if (isAutoInit && !currentThemeName) {
  5590. currentThemeName = themeNameFromDevice(devices.current())
  5591. }
  5592. currentThemeName = resolveFullThemeName(currentThemeName);
  5593. if (currentThemeName) {
  5594. currentThemeData = knownThemes[currentThemeName]
  5595. }
  5596. if (loadCallback) {
  5597. themeReadyCallback.add(loadCallback)
  5598. }
  5599. if (currentThemeData) {
  5600. $activeThemeLink.attr("href", knownThemes[currentThemeName].url);
  5601. if ((themeReadyCallback.has() || options._forceTimeout) && !timerId) {
  5602. waitForThemeLoad(currentThemeName)
  5603. } else {
  5604. if (pendingThemeName) {
  5605. pendingThemeName = currentThemeName
  5606. }
  5607. }
  5608. } else {
  5609. if (isAutoInit) {
  5610. themeReadyCallback.fire();
  5611. themeReadyCallback.empty()
  5612. } else {
  5613. throw errors.Error("E0021", currentThemeName)
  5614. }
  5615. }
  5616. checkThemeDeprecation();
  5617. attachCssClasses(viewPortUtils.originalViewPort(), currentThemeName)
  5618. }
  5619. function themeNameFromDevice(device) {
  5620. var themeName = device.platform;
  5621. switch (themeName) {
  5622. case "ios":
  5623. return "ios7";
  5624. case "android":
  5625. case "win":
  5626. return "generic"
  5627. }
  5628. return themeName
  5629. }
  5630. function getCssClasses(themeName) {
  5631. themeName = themeName || current();
  5632. var result = [];
  5633. var themeNameParts = themeName && themeName.split(".");
  5634. if (themeNameParts) {
  5635. result.push("dx-theme-" + themeNameParts[0], "dx-theme-" + themeNameParts[0] + "-typography");
  5636. if (themeNameParts.length > 1) {
  5637. result.push("dx-color-scheme-" + themeNameParts[1] + (isMaterial(themeName) ? "-" + themeNameParts[2] : ""))
  5638. }
  5639. }
  5640. return result
  5641. }
  5642. var themeClasses;
  5643. function attachCssClasses(element, themeName) {
  5644. themeClasses = getCssClasses(themeName).join(" ");
  5645. $(element).addClass(themeClasses);
  5646. var activateHairlines = function() {
  5647. var pixelRatio = windowUtils.hasWindow() && window.devicePixelRatio;
  5648. if (!pixelRatio || pixelRatio < 2) {
  5649. return
  5650. }
  5651. var $tester = $("<div>");
  5652. $tester.css("border", ".5px solid transparent");
  5653. $("body").append($tester);
  5654. if (1 === $tester.outerHeight()) {
  5655. $(element).addClass(DX_HAIRLINES_CLASS);
  5656. themeClasses += " " + DX_HAIRLINES_CLASS
  5657. }
  5658. $tester.remove()
  5659. };
  5660. activateHairlines()
  5661. }
  5662. function detachCssClasses(element) {
  5663. $(element).removeClass(themeClasses)
  5664. }
  5665. function themeReady(callback) {
  5666. themeReadyCallback.add(callback)
  5667. }
  5668. function isTheme(themeRegExp, themeName) {
  5669. if (!themeName) {
  5670. themeName = currentThemeName || readThemeMarker()
  5671. }
  5672. return new RegExp(themeRegExp).test(themeName)
  5673. }
  5674. function isMaterial(themeName) {
  5675. return isTheme("material", themeName)
  5676. }
  5677. function isIos7(themeName) {
  5678. return isTheme("ios7", themeName)
  5679. }
  5680. function isGeneric(themeName) {
  5681. return isTheme("generic", themeName)
  5682. }
  5683. function checkThemeDeprecation() {
  5684. if (isIos7()) {
  5685. errors.log("W0010", "The 'ios7' theme", "19.1", "Use the 'generic' theme instead.")
  5686. }
  5687. }
  5688. function isWebFontLoaded(text, fontWeight) {
  5689. var testedFont = "Roboto, RobotoFallback, Arial";
  5690. var etalonFont = "Arial";
  5691. var document = domAdapter.getDocument();
  5692. var testElement = document.createElement("span");
  5693. testElement.style.position = "absolute";
  5694. testElement.style.top = "-9999px";
  5695. testElement.style.left = "-9999px";
  5696. testElement.style.visibility = "hidden";
  5697. testElement.style.fontFamily = etalonFont;
  5698. testElement.style.fontSize = "250px";
  5699. testElement.style.fontWeight = fontWeight;
  5700. testElement.innerHTML = text;
  5701. document.body.appendChild(testElement);
  5702. var etalonFontWidth = testElement.offsetWidth;
  5703. testElement.style.fontFamily = testedFont;
  5704. var testedFontWidth = testElement.offsetWidth;
  5705. testElement.parentNode.removeChild(testElement);
  5706. return etalonFontWidth !== testedFontWidth
  5707. }
  5708. function waitWebFont(text, fontWeight) {
  5709. var interval = 15;
  5710. var timeout = 2e3;
  5711. return new Promise(function(resolve) {
  5712. var check = function() {
  5713. if (isWebFontLoaded(text, fontWeight)) {
  5714. clear()
  5715. }
  5716. };
  5717. var clear = function() {
  5718. clearInterval(intervalId);
  5719. clearTimeout(timeoutId);
  5720. resolve()
  5721. };
  5722. var intervalId = setInterval(check, interval);
  5723. var timeoutId = setTimeout(clear, timeout)
  5724. })
  5725. }
  5726. var initDeferred = new Deferred;
  5727. function autoInit() {
  5728. init({
  5729. _autoInit: true,
  5730. _forceTimeout: true
  5731. });
  5732. if ($(DX_LINK_SELECTOR, context).length) {
  5733. throw errors.Error("E0022")
  5734. }
  5735. initDeferred.resolve()
  5736. }
  5737. if (windowUtils.hasWindow()) {
  5738. autoInit()
  5739. } else {
  5740. ready(autoInit)
  5741. }
  5742. viewPortChanged.add(function(viewPort, prevViewPort) {
  5743. initDeferred.done(function() {
  5744. detachCssClasses(prevViewPort);
  5745. attachCssClasses(viewPort)
  5746. })
  5747. });
  5748. devices.changed.add(function() {
  5749. init({
  5750. _autoInit: true
  5751. })
  5752. });
  5753. exports.current = current;
  5754. exports.ready = themeReady;
  5755. exports.init = init;
  5756. exports.attachCssClasses = attachCssClasses;
  5757. exports.detachCssClasses = detachCssClasses;
  5758. exports.themeNameFromDevice = themeNameFromDevice;
  5759. exports.waitForThemeLoad = waitForThemeLoad;
  5760. exports.isMaterial = isMaterial;
  5761. exports.isIos7 = isIos7;
  5762. exports.isGeneric = isGeneric;
  5763. exports.isWebFontLoaded = isWebFontLoaded;
  5764. exports.waitWebFont = waitWebFont;
  5765. exports.resetTheme = function() {
  5766. $activeThemeLink && $activeThemeLink.attr("href", "about:blank");
  5767. currentThemeName = null;
  5768. pendingThemeName = null
  5769. }
  5770. },
  5771. /*!*********************************************!*\
  5772. !*** ./artifacts/transpiled/core/config.js ***!
  5773. \*********************************************/
  5774. /*! dynamic exports provided */
  5775. /*! all exports used */
  5776. function(module, exports, __webpack_require__) {
  5777. var _extend = __webpack_require__( /*! ./utils/extend */ 0);
  5778. var _extend2 = _interopRequireDefault(_extend);
  5779. var _errors = __webpack_require__( /*! ./errors */ 21);
  5780. var _errors2 = _interopRequireDefault(_errors);
  5781. function _interopRequireDefault(obj) {
  5782. return obj && obj.__esModule ? obj : {
  5783. "default": obj
  5784. }
  5785. }
  5786. var config = {
  5787. rtlEnabled: false,
  5788. defaultCurrency: "USD",
  5789. oDataFilterToLower: true,
  5790. serverDecimalSeparator: ".",
  5791. decimalSeparator: ".",
  5792. thousandsSeparator: ",",
  5793. forceIsoDateParsing: true,
  5794. wrapActionsBeforeExecute: true,
  5795. useLegacyStoreResult: false,
  5796. useJQuery: void 0,
  5797. editorStylingMode: void 0,
  5798. useLegacyVisibleIndex: false,
  5799. floatingActionButtonConfig: {
  5800. icon: "add",
  5801. closeIcon: "close",
  5802. position: {
  5803. at: "right bottom",
  5804. my: "right bottom",
  5805. offset: {
  5806. x: -16,
  5807. y: -16
  5808. }
  5809. },
  5810. maxSpeedDialActionCount: 5
  5811. },
  5812. optionsParser: function(optionsString) {
  5813. if ("{" !== optionsString.trim().charAt(0)) {
  5814. optionsString = "{" + optionsString + "}"
  5815. }
  5816. try {
  5817. return new Function("return " + optionsString)()
  5818. } catch (ex) {
  5819. throw _errors2.default.Error("E3018", ex, optionsString)
  5820. }
  5821. }
  5822. };
  5823. var configMethod = function() {
  5824. if (!arguments.length) {
  5825. return config
  5826. }
  5827. _extend2.default.extend(config, arguments.length <= 0 ? void 0 : arguments[0])
  5828. };
  5829. if ("undefined" !== typeof DevExpress && DevExpress.config) {
  5830. configMethod(DevExpress.config)
  5831. }
  5832. module.exports = configMethod
  5833. },
  5834. /*!***************************************************!*\
  5835. !*** ./artifacts/transpiled/localization/date.js ***!
  5836. \***************************************************/
  5837. /*! dynamic exports provided */
  5838. /*! all exports used */
  5839. function(module, exports, __webpack_require__) {
  5840. var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54);
  5841. var isString = __webpack_require__( /*! ../core/utils/type */ 1).isString;
  5842. var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
  5843. var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
  5844. var getLDMLDateFormatter = __webpack_require__( /*! ./ldml/date.formatter */ 257).getFormatter;
  5845. var getLDMLDateFormat = __webpack_require__( /*! ./ldml/date.format */ 208).getFormat;
  5846. var getLDMLDateParser = __webpack_require__( /*! ./ldml/date.parser */ 211).getParser;
  5847. var defaultDateNames = __webpack_require__( /*! ./default_date_names */ 258);
  5848. var numberLocalization = __webpack_require__( /*! ./number */ 51);
  5849. var errors = __webpack_require__( /*! ../core/errors */ 21);
  5850. __webpack_require__( /*! ./core */ 87);
  5851. var FORMATS_TO_PATTERN_MAP = {
  5852. shortdate: "M/d/y",
  5853. shorttime: "h:mm a",
  5854. longdate: "EEEE, MMMM d, y",
  5855. longtime: "h:mm:ss a",
  5856. monthandday: "MMMM d",
  5857. monthandyear: "MMMM y",
  5858. quarterandyear: "QQQ y",
  5859. day: "d",
  5860. year: "y",
  5861. shortdateshorttime: "M/d/y, h:mm a",
  5862. mediumdatemediumtime: "MMMM d, h:mm a",
  5863. longdatelongtime: "EEEE, MMMM d, y, h:mm:ss a",
  5864. month: "LLLL",
  5865. shortyear: "yy",
  5866. dayofweek: "EEEE",
  5867. quarter: "QQQ",
  5868. hour: "HH",
  5869. minute: "mm",
  5870. second: "ss",
  5871. millisecond: "SSS",
  5872. "datetime-local": "yyyy-MM-ddTHH':'mm':'ss"
  5873. };
  5874. var possiblePartPatterns = {
  5875. year: ["y", "yy", "yyyy"],
  5876. day: ["d", "dd"],
  5877. month: ["M", "MM", "MMM", "MMMM"],
  5878. hours: ["H", "HH", "h", "hh", "ah"],
  5879. minutes: ["m", "mm"],
  5880. seconds: ["s", "ss"],
  5881. milliseconds: ["S", "SS", "SSS"]
  5882. };
  5883. var dateLocalization = dependencyInjector({
  5884. _getPatternByFormat: function(format) {
  5885. return FORMATS_TO_PATTERN_MAP[format.toLowerCase()]
  5886. },
  5887. _expandPattern: function(pattern) {
  5888. return this._getPatternByFormat(pattern) || pattern
  5889. },
  5890. formatUsesMonthName: function(format) {
  5891. return this._expandPattern(format).indexOf("MMMM") !== -1
  5892. },
  5893. formatUsesDayName: function(format) {
  5894. return this._expandPattern(format).indexOf("EEEE") !== -1
  5895. },
  5896. getFormatParts: function(format) {
  5897. var pattern = this._getPatternByFormat(format) || format;
  5898. var result = [];
  5899. iteratorUtils.each(pattern.split(/\W+/), function(_, formatPart) {
  5900. iteratorUtils.each(possiblePartPatterns, function(partName, possiblePatterns) {
  5901. if (inArray(formatPart, possiblePatterns) > -1) {
  5902. result.push(partName)
  5903. }
  5904. })
  5905. });
  5906. return result
  5907. },
  5908. getMonthNames: function(format) {
  5909. return defaultDateNames.getMonthNames(format)
  5910. },
  5911. getDayNames: function(format) {
  5912. return defaultDateNames.getDayNames(format)
  5913. },
  5914. getQuarterNames: function(format) {
  5915. return defaultDateNames.getQuarterNames(format)
  5916. },
  5917. getPeriodNames: function(format) {
  5918. return defaultDateNames.getPeriodNames(format)
  5919. },
  5920. getTimeSeparator: function() {
  5921. return ":"
  5922. },
  5923. is24HourFormat: function(format) {
  5924. var amTime = new Date(2017, 0, 20, 11, 0, 0, 0);
  5925. var pmTime = new Date(2017, 0, 20, 23, 0, 0, 0);
  5926. var amTimeFormatted = this.format(amTime, format);
  5927. var pmTimeFormatted = this.format(pmTime, format);
  5928. for (var i = 0; i < amTimeFormatted.length; i++) {
  5929. if (amTimeFormatted[i] !== pmTimeFormatted[i]) {
  5930. return !isNaN(parseInt(amTimeFormatted[i]))
  5931. }
  5932. }
  5933. },
  5934. format: function(date, _format) {
  5935. if (!date) {
  5936. return
  5937. }
  5938. if (!_format) {
  5939. return date
  5940. }
  5941. var formatter;
  5942. if ("function" === typeof _format) {
  5943. formatter = _format
  5944. } else {
  5945. if (_format.formatter) {
  5946. formatter = _format.formatter
  5947. } else {
  5948. _format = _format.type || _format;
  5949. if (isString(_format)) {
  5950. _format = FORMATS_TO_PATTERN_MAP[_format.toLowerCase()] || _format;
  5951. return numberLocalization.convertDigits(getLDMLDateFormatter(_format, this)(date))
  5952. }
  5953. }
  5954. }
  5955. if (!formatter) {
  5956. return
  5957. }
  5958. return formatter(date)
  5959. },
  5960. parse: function(text, format) {
  5961. var that = this;
  5962. var ldmlFormat;
  5963. if (!text) {
  5964. return
  5965. }
  5966. if (!format) {
  5967. return this.parse(text, "shortdate")
  5968. }
  5969. if (format.parser) {
  5970. return format.parser(text)
  5971. }
  5972. if ("string" === typeof format && !FORMATS_TO_PATTERN_MAP[format.toLowerCase()]) {
  5973. ldmlFormat = format
  5974. } else {
  5975. var formatter = function(value) {
  5976. var text = that.format(value, format);
  5977. return numberLocalization.convertDigits(text, true)
  5978. };
  5979. try {
  5980. ldmlFormat = getLDMLDateFormat(formatter)
  5981. } catch (e) {}
  5982. }
  5983. if (ldmlFormat) {
  5984. text = numberLocalization.convertDigits(text, true);
  5985. return getLDMLDateParser(ldmlFormat, this)(text)
  5986. }
  5987. errors.log("W0012");
  5988. var result = new Date(text);
  5989. if (!result || isNaN(result.getTime())) {
  5990. return
  5991. }
  5992. return result
  5993. },
  5994. firstDayOfWeekIndex: function() {
  5995. return 0
  5996. }
  5997. });
  5998. module.exports = dateLocalization
  5999. },
  6000. /*!******************************************************!*\
  6001. !*** ./artifacts/transpiled/core/utils/inflector.js ***!
  6002. \******************************************************/
  6003. /*! dynamic exports provided */
  6004. /*! all exports used */
  6005. function(module, exports, __webpack_require__) {
  6006. var map = __webpack_require__( /*! ./iterator */ 3).map;
  6007. var _normalize = function(text) {
  6008. if (void 0 === text || null === text) {
  6009. return ""
  6010. }
  6011. return String(text)
  6012. };
  6013. var _upperCaseFirst = function(text) {
  6014. return _normalize(text).charAt(0).toUpperCase() + text.substr(1)
  6015. };
  6016. var _chop = function(text) {
  6017. return _normalize(text).replace(/([a-z\d])([A-Z])/g, "$1 $2").split(/[\s_-]+/)
  6018. };
  6019. var dasherize = function(text) {
  6020. return map(_chop(text), function(p) {
  6021. return p.toLowerCase()
  6022. }).join("-")
  6023. };
  6024. var underscore = function(text) {
  6025. return dasherize(text).replace(/-/g, "_")
  6026. };
  6027. var camelize = function(text, upperFirst) {
  6028. return map(_chop(text), function(p, i) {
  6029. p = p.toLowerCase();
  6030. if (upperFirst || i > 0) {
  6031. p = _upperCaseFirst(p)
  6032. }
  6033. return p
  6034. }).join("")
  6035. };
  6036. var humanize = function(text) {
  6037. return _upperCaseFirst(dasherize(text).replace(/-/g, " "))
  6038. };
  6039. var titleize = function(text) {
  6040. return map(_chop(text), function(p) {
  6041. return _upperCaseFirst(p.toLowerCase())
  6042. }).join(" ")
  6043. };
  6044. var DIGIT_CHARS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
  6045. var captionize = function(name) {
  6046. var captionList = [];
  6047. var i;
  6048. var char;
  6049. var isPrevCharNewWord = false;
  6050. var isNewWord = false;
  6051. for (i = 0; i < name.length; i++) {
  6052. char = name.charAt(i);
  6053. isNewWord = char === char.toUpperCase() && "-" !== char && ")" !== char && "/" !== char || char in DIGIT_CHARS;
  6054. if ("_" === char || "." === char) {
  6055. char = " ";
  6056. isNewWord = true
  6057. } else {
  6058. if (0 === i) {
  6059. char = char.toUpperCase();
  6060. isNewWord = true
  6061. } else {
  6062. if (!isPrevCharNewWord && isNewWord) {
  6063. if (captionList.length > 0) {
  6064. captionList.push(" ")
  6065. }
  6066. }
  6067. }
  6068. }
  6069. captionList.push(char);
  6070. isPrevCharNewWord = isNewWord
  6071. }
  6072. return captionList.join("")
  6073. };
  6074. exports.dasherize = dasherize;
  6075. exports.camelize = camelize;
  6076. exports.humanize = humanize;
  6077. exports.titleize = titleize;
  6078. exports.underscore = underscore;
  6079. exports.captionize = captionize
  6080. }, , ,
  6081. /*!*********************************************!*\
  6082. !*** ./artifacts/transpiled/data/errors.js ***!
  6083. \*********************************************/
  6084. /*! dynamic exports provided */
  6085. /*! all exports used */
  6086. function(module, exports, __webpack_require__) {
  6087. var errorUtils = __webpack_require__( /*! ../core/utils/error */ 129);
  6088. var coreErrors = __webpack_require__( /*! ../core/errors */ 21);
  6089. var handlers = {};
  6090. var errors = errorUtils(coreErrors.ERROR_MESSAGES, {
  6091. E4000: "[DevExpress.data]: {0}",
  6092. E4001: "Unknown aggregating function is detected: '{0}'",
  6093. E4002: "Unsupported OData protocol version is used",
  6094. E4003: "Unknown filter operation is used: {0}",
  6095. E4004: "The thenby() method is called before the sortby() method",
  6096. E4005: "Store requires a key expression for this operation",
  6097. E4006: "ArrayStore 'data' option must be an array",
  6098. E4007: "Compound keys cannot be auto-generated",
  6099. E4008: "Attempt to insert an item with the a duplicated key",
  6100. E4009: "Data item cannot be found",
  6101. E4010: "CustomStore does not support creating queries",
  6102. E4011: "Custom Store method is not implemented or is not a function: {0}",
  6103. E4012: "Custom Store method returns an invalid value: {0}",
  6104. E4013: "Local Store requires the 'name' configuration option is specified",
  6105. E4014: "Unknown data type is specified for ODataStore: {0}",
  6106. E4015: "Unknown entity name or alias is used: {0}",
  6107. E4016: "The compileSetter(expr) method is called with 'self' passed as a parameter",
  6108. E4017: "Keys cannot be modified",
  6109. E4018: "The server has returned a non-numeric value in a response to an item count request",
  6110. E4019: "Mixing of group operators inside a single group of filter expression is not allowed",
  6111. E4020: "Unknown store type is detected: {0}",
  6112. E4021: "The server response does not provide the totalCount value",
  6113. E4022: "The server response does not provide the groupCount value",
  6114. E4023: "Could not parse the following XML: {0}",
  6115. W4000: "Data returned from the server has an incorrect structure",
  6116. W4001: 'The {0} field is listed in both "keyType" and "fieldTypes". The value of "fieldTypes" is used.',
  6117. W4002: "Data loading has failed for some cells due to the following error: {0}"
  6118. });
  6119. function handleError(error) {
  6120. var id = "E4000";
  6121. if (error && "__id" in error) {
  6122. id = error.__id
  6123. }
  6124. errors.log(id, error)
  6125. }
  6126. var errorHandler = null;
  6127. var _errorHandler = function(error) {
  6128. handleError(error);
  6129. if (handlers.errorHandler) {
  6130. handlers.errorHandler(error)
  6131. }
  6132. };
  6133. handlers = {
  6134. errors: errors,
  6135. errorHandler: errorHandler,
  6136. _errorHandler: _errorHandler
  6137. };
  6138. module.exports = handlers
  6139. }, ,
  6140. /*!**********************************************!*\
  6141. !*** ./artifacts/transpiled/animation/fx.js ***!
  6142. \**********************************************/
  6143. /*! dynamic exports provided */
  6144. /*! all exports used */
  6145. function(module, exports, __webpack_require__) {
  6146. function _typeof(obj) {
  6147. "@babel/helpers - typeof";
  6148. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  6149. return typeof obj
  6150. } : function(obj) {
  6151. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  6152. }, _typeof(obj)
  6153. }
  6154. var $ = __webpack_require__( /*! ../core/renderer */ 2);
  6155. var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow();
  6156. var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
  6157. var errors = __webpack_require__( /*! ../core/errors */ 21);
  6158. var getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 12).getPublicElement;
  6159. var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
  6160. var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
  6161. var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
  6162. var translator = __webpack_require__( /*! ./translator */ 27);
  6163. var easing = __webpack_require__( /*! ./easing */ 264);
  6164. var animationFrame = __webpack_require__( /*! ./frame */ 112);
  6165. var support = __webpack_require__( /*! ../core/utils/support */ 43);
  6166. var positionUtils = __webpack_require__( /*! ./position */ 77);
  6167. var removeEvent = __webpack_require__( /*! ../core/remove_event */ 132);
  6168. var eventUtils = __webpack_require__( /*! ../events/utils */ 8);
  6169. var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
  6170. var when = deferredUtils.when;
  6171. var Deferred = deferredUtils.Deferred;
  6172. var removeEventName = eventUtils.addNamespace(removeEvent, "dxFX");
  6173. var isFunction = typeUtils.isFunction;
  6174. var isPlainObject = typeUtils.isPlainObject;
  6175. var noop = __webpack_require__( /*! ../core/utils/common */ 4).noop;
  6176. var RELATIVE_VALUE_REGEX = /^([+-])=(.*)/i;
  6177. var ANIM_DATA_KEY = "dxAnimData";
  6178. var ANIM_QUEUE_KEY = "dxAnimQueue";
  6179. var TRANSFORM_PROP = "transform";
  6180. var TransitionAnimationStrategy = {
  6181. initAnimation: function($element, config) {
  6182. $element.css({
  6183. transitionProperty: "none"
  6184. });
  6185. if ("string" === typeof config.from) {
  6186. $element.addClass(config.from)
  6187. } else {
  6188. setProps($element, config.from)
  6189. }
  6190. var that = this;
  6191. var deferred = new Deferred;
  6192. var cleanupWhen = config.cleanupWhen;
  6193. config.transitionAnimation = {
  6194. deferred: deferred,
  6195. finish: function() {
  6196. that._finishTransition($element);
  6197. if (cleanupWhen) {
  6198. when(deferred, cleanupWhen).always(function() {
  6199. that._cleanup($element, config)
  6200. })
  6201. } else {
  6202. that._cleanup($element, config)
  6203. }
  6204. deferred.resolveWith($element, [config, $element])
  6205. }
  6206. };
  6207. this._completeAnimationCallback($element, config).done(function() {
  6208. config.transitionAnimation.finish()
  6209. }).fail(function() {
  6210. deferred.rejectWith($element, [config, $element])
  6211. });
  6212. if (!config.duration) {
  6213. config.transitionAnimation.finish()
  6214. }
  6215. $element.css("transform")
  6216. },
  6217. animate: function($element, config) {
  6218. this._startAnimation($element, config);
  6219. return config.transitionAnimation.deferred.promise()
  6220. },
  6221. _completeAnimationCallback: function($element, config) {
  6222. var that = this;
  6223. var startTime = Date.now() + config.delay;
  6224. var deferred = new Deferred;
  6225. var transitionEndFired = new Deferred;
  6226. var simulatedTransitionEndFired = new Deferred;
  6227. var simulatedEndEventTimer;
  6228. var transitionEndEventName = support.transitionEndEventName() + ".dxFX";
  6229. config.transitionAnimation.cleanup = function() {
  6230. clearTimeout(simulatedEndEventTimer);
  6231. clearTimeout(waitForJSCompleteTimer);
  6232. eventsEngine.off($element, transitionEndEventName);
  6233. eventsEngine.off($element, removeEventName)
  6234. };
  6235. eventsEngine.one($element, transitionEndEventName, function() {
  6236. if (Date.now() - startTime >= config.duration) {
  6237. transitionEndFired.reject()
  6238. }
  6239. });
  6240. eventsEngine.off($element, removeEventName);
  6241. eventsEngine.on($element, removeEventName, function() {
  6242. that.stop($element, config);
  6243. deferred.reject()
  6244. });
  6245. var waitForJSCompleteTimer = setTimeout(function() {
  6246. simulatedEndEventTimer = setTimeout(function() {
  6247. simulatedTransitionEndFired.reject()
  6248. }, config.duration + config.delay + fx._simulatedTransitionEndDelay);
  6249. when(transitionEndFired, simulatedTransitionEndFired).fail(function() {
  6250. deferred.resolve()
  6251. }.bind(this))
  6252. });
  6253. return deferred.promise()
  6254. },
  6255. _startAnimation: function($element, config) {
  6256. $element.css({
  6257. transitionProperty: "all",
  6258. transitionDelay: config.delay + "ms",
  6259. transitionDuration: config.duration + "ms",
  6260. transitionTimingFunction: config.easing
  6261. });
  6262. if ("string" === typeof config.to) {
  6263. $element[0].className += " " + config.to
  6264. } else {
  6265. if (config.to) {
  6266. setProps($element, config.to)
  6267. }
  6268. }
  6269. },
  6270. _finishTransition: function($element) {
  6271. $element.css("transition", "none")
  6272. },
  6273. _cleanup: function($element, config) {
  6274. config.transitionAnimation.cleanup();
  6275. if ("string" === typeof config.from) {
  6276. $element.removeClass(config.from);
  6277. $element.removeClass(config.to)
  6278. }
  6279. },
  6280. stop: function($element, config, jumpToEnd) {
  6281. if (!config) {
  6282. return
  6283. }
  6284. if (jumpToEnd) {
  6285. config.transitionAnimation.finish()
  6286. } else {
  6287. if (isPlainObject(config.to)) {
  6288. iteratorUtils.each(config.to, function(key) {
  6289. $element.css(key, $element.css(key))
  6290. })
  6291. }
  6292. this._finishTransition($element);
  6293. this._cleanup($element, config)
  6294. }
  6295. }
  6296. };
  6297. var FrameAnimationStrategy = {
  6298. initAnimation: function($element, config) {
  6299. setProps($element, config.from)
  6300. },
  6301. animate: function($element, config) {
  6302. var deferred = new Deferred;
  6303. var that = this;
  6304. if (!config) {
  6305. return deferred.reject().promise()
  6306. }
  6307. iteratorUtils.each(config.to, function(prop) {
  6308. if (void 0 === config.from[prop]) {
  6309. config.from[prop] = that._normalizeValue($element.css(prop))
  6310. }
  6311. });
  6312. if (config.to[TRANSFORM_PROP]) {
  6313. config.from[TRANSFORM_PROP] = that._parseTransform(config.from[TRANSFORM_PROP]);
  6314. config.to[TRANSFORM_PROP] = that._parseTransform(config.to[TRANSFORM_PROP])
  6315. }
  6316. config.frameAnimation = {
  6317. to: config.to,
  6318. from: config.from,
  6319. currentValue: config.from,
  6320. easing: easing.convertTransitionTimingFuncToEasing(config.easing),
  6321. duration: config.duration,
  6322. startTime: (new Date).valueOf(),
  6323. finish: function() {
  6324. this.currentValue = this.to;
  6325. this.draw();
  6326. animationFrame.cancelAnimationFrame(config.frameAnimation.animationFrameId);
  6327. deferred.resolve()
  6328. },
  6329. draw: function() {
  6330. if (config.draw) {
  6331. config.draw(this.currentValue);
  6332. return
  6333. }
  6334. var currentValue = extend({}, this.currentValue);
  6335. if (currentValue[TRANSFORM_PROP]) {
  6336. currentValue[TRANSFORM_PROP] = iteratorUtils.map(currentValue[TRANSFORM_PROP], function(value, prop) {
  6337. if ("translate" === prop) {
  6338. return translator.getTranslateCss(value)
  6339. } else {
  6340. if ("scale" === prop) {
  6341. return "scale(" + value + ")"
  6342. } else {
  6343. if ("rotate" === prop.substr(0, prop.length - 1)) {
  6344. return prop + "(" + value + "deg)"
  6345. }
  6346. }
  6347. }
  6348. }).join(" ")
  6349. }
  6350. $element.css(currentValue)
  6351. }
  6352. };
  6353. if (config.delay) {
  6354. config.frameAnimation.startTime += config.delay;
  6355. config.frameAnimation.delayTimeout = setTimeout(function() {
  6356. that._startAnimation($element, config)
  6357. }, config.delay)
  6358. } else {
  6359. that._startAnimation($element, config)
  6360. }
  6361. return deferred.promise()
  6362. },
  6363. _startAnimation: function($element, config) {
  6364. eventsEngine.off($element, removeEventName);
  6365. eventsEngine.on($element, removeEventName, function() {
  6366. if (config.frameAnimation) {
  6367. animationFrame.cancelAnimationFrame(config.frameAnimation.animationFrameId)
  6368. }
  6369. });
  6370. this._animationStep($element, config)
  6371. },
  6372. _parseTransform: function(transformString) {
  6373. var result = {};
  6374. iteratorUtils.each(transformString.match(/\w+\d*\w*\([^)]*\)\s*/g), function(i, part) {
  6375. var translateData = translator.parseTranslate(part);
  6376. var scaleData = part.match(/scale\((.+?)\)/);
  6377. var rotateData = part.match(/(rotate.)\((.+)deg\)/);
  6378. if (translateData) {
  6379. result.translate = translateData
  6380. }
  6381. if (scaleData && scaleData[1]) {
  6382. result.scale = parseFloat(scaleData[1])
  6383. }
  6384. if (rotateData && rotateData[1]) {
  6385. result[rotateData[1]] = parseFloat(rotateData[2])
  6386. }
  6387. });
  6388. return result
  6389. },
  6390. stop: function($element, config, jumpToEnd) {
  6391. var frameAnimation = config && config.frameAnimation;
  6392. if (!frameAnimation) {
  6393. return
  6394. }
  6395. animationFrame.cancelAnimationFrame(frameAnimation.animationFrameId);
  6396. clearTimeout(frameAnimation.delayTimeout);
  6397. if (jumpToEnd) {
  6398. frameAnimation.finish()
  6399. }
  6400. delete config.frameAnimation
  6401. },
  6402. _animationStep: function($element, config) {
  6403. var frameAnimation = config && config.frameAnimation;
  6404. if (!frameAnimation) {
  6405. return
  6406. }
  6407. var now = (new Date).valueOf();
  6408. if (now >= frameAnimation.startTime + frameAnimation.duration) {
  6409. frameAnimation.finish();
  6410. return
  6411. }
  6412. frameAnimation.currentValue = this._calcStepValue(frameAnimation, now - frameAnimation.startTime);
  6413. frameAnimation.draw();
  6414. var that = this;
  6415. frameAnimation.animationFrameId = animationFrame.requestAnimationFrame(function() {
  6416. that._animationStep($element, config)
  6417. })
  6418. },
  6419. _calcStepValue: function(frameAnimation, currentDuration) {
  6420. var calcValueRecursively = function calcValueRecursively(from, to) {
  6421. var result = Array.isArray(to) ? [] : {};
  6422. var calcEasedValue = function(propName) {
  6423. var x = currentDuration / frameAnimation.duration;
  6424. var t = currentDuration;
  6425. var b = 1 * from[propName];
  6426. var c = to[propName] - from[propName];
  6427. var d = frameAnimation.duration;
  6428. return easing.getEasing(frameAnimation.easing)(x, t, b, c, d)
  6429. };
  6430. iteratorUtils.each(to, function(propName, endPropValue) {
  6431. if ("string" === typeof endPropValue && false === parseFloat(endPropValue, 10)) {
  6432. return true
  6433. }
  6434. result[propName] = "object" === _typeof(endPropValue) ? calcValueRecursively(from[propName], endPropValue) : calcEasedValue(propName)
  6435. });
  6436. return result
  6437. };
  6438. return calcValueRecursively(frameAnimation.from, frameAnimation.to)
  6439. },
  6440. _normalizeValue: function(value) {
  6441. var numericValue = parseFloat(value, 10);
  6442. if (false === numericValue) {
  6443. return value
  6444. }
  6445. return numericValue
  6446. }
  6447. };
  6448. var FallbackToNoAnimationStrategy = {
  6449. initAnimation: function() {},
  6450. animate: function() {
  6451. return (new Deferred).resolve().promise()
  6452. },
  6453. stop: noop,
  6454. isSynchronous: true
  6455. };
  6456. var getAnimationStrategy = function(config) {
  6457. config = config || {};
  6458. var animationStrategies = {
  6459. transition: support.transition() ? TransitionAnimationStrategy : FrameAnimationStrategy,
  6460. frame: FrameAnimationStrategy,
  6461. noAnimation: FallbackToNoAnimationStrategy
  6462. };
  6463. var strategy = config.strategy || "transition";
  6464. if ("css" === config.type && !support.transition()) {
  6465. strategy = "noAnimation"
  6466. }
  6467. return animationStrategies[strategy]
  6468. };
  6469. var baseConfigValidator = function(config, animationType, validate, typeMessage) {
  6470. iteratorUtils.each(["from", "to"], function() {
  6471. if (!validate(config[this])) {
  6472. throw errors.Error("E0010", animationType, this, typeMessage)
  6473. }
  6474. })
  6475. };
  6476. var isObjectConfigValidator = function(config, animationType) {
  6477. return baseConfigValidator(config, animationType, function(target) {
  6478. return isPlainObject(target)
  6479. }, "a plain object")
  6480. };
  6481. var isStringConfigValidator = function(config, animationType) {
  6482. return baseConfigValidator(config, animationType, function(target) {
  6483. return "string" === typeof target
  6484. }, "a string")
  6485. };
  6486. var CustomAnimationConfigurator = {
  6487. setup: function() {}
  6488. };
  6489. var CssAnimationConfigurator = {
  6490. validateConfig: function(config) {
  6491. isStringConfigValidator(config, "css")
  6492. },
  6493. setup: function() {}
  6494. };
  6495. var positionAliases = {
  6496. top: {
  6497. my: "bottom center",
  6498. at: "top center"
  6499. },
  6500. bottom: {
  6501. my: "top center",
  6502. at: "bottom center"
  6503. },
  6504. right: {
  6505. my: "left center",
  6506. at: "right center"
  6507. },
  6508. left: {
  6509. my: "right center",
  6510. at: "left center"
  6511. }
  6512. };
  6513. var SlideAnimationConfigurator = {
  6514. validateConfig: function(config) {
  6515. isObjectConfigValidator(config, "slide")
  6516. },
  6517. setup: function($element, config) {
  6518. var location = translator.locate($element);
  6519. if ("slide" !== config.type) {
  6520. var positioningConfig = "slideIn" === config.type ? config.from : config.to;
  6521. positioningConfig.position = extend({
  6522. of: window
  6523. }, positionAliases[config.direction]);
  6524. setupPosition($element, positioningConfig)
  6525. }
  6526. this._setUpConfig(location, config.from);
  6527. this._setUpConfig(location, config.to);
  6528. translator.clearCache($element)
  6529. },
  6530. _setUpConfig: function(location, config) {
  6531. config.left = "left" in config ? config.left : "+=0";
  6532. config.top = "top" in config ? config.top : "+=0";
  6533. this._initNewPosition(location, config)
  6534. },
  6535. _initNewPosition: function(location, config) {
  6536. var position = {
  6537. left: config.left,
  6538. top: config.top
  6539. };
  6540. delete config.left;
  6541. delete config.top;
  6542. var relativeValue = this._getRelativeValue(position.left);
  6543. if (void 0 !== relativeValue) {
  6544. position.left = relativeValue + location.left
  6545. } else {
  6546. config.left = 0
  6547. }
  6548. relativeValue = this._getRelativeValue(position.top);
  6549. if (void 0 !== relativeValue) {
  6550. position.top = relativeValue + location.top
  6551. } else {
  6552. config.top = 0
  6553. }
  6554. config[TRANSFORM_PROP] = translator.getTranslateCss({
  6555. x: position.left,
  6556. y: position.top
  6557. })
  6558. },
  6559. _getRelativeValue: function(value) {
  6560. var relativeValue;
  6561. if ("string" === typeof value && (relativeValue = RELATIVE_VALUE_REGEX.exec(value))) {
  6562. return parseInt(relativeValue[1] + "1") * relativeValue[2]
  6563. }
  6564. }
  6565. };
  6566. var FadeAnimationConfigurator = {
  6567. setup: function($element, config) {
  6568. var from = config.from;
  6569. var fromOpacity = isPlainObject(from) ? config.skipElementInitialStyles ? 0 : $element.css("opacity") : String(from);
  6570. var toOpacity;
  6571. switch (config.type) {
  6572. case "fadeIn":
  6573. toOpacity = 1;
  6574. break;
  6575. case "fadeOut":
  6576. toOpacity = 0;
  6577. break;
  6578. default:
  6579. toOpacity = String(config.to)
  6580. }
  6581. config.from = {
  6582. visibility: "visible",
  6583. opacity: fromOpacity
  6584. };
  6585. config.to = {
  6586. opacity: toOpacity
  6587. }
  6588. }
  6589. };
  6590. var PopAnimationConfigurator = {
  6591. validateConfig: function(config) {
  6592. isObjectConfigValidator(config, "pop")
  6593. },
  6594. setup: function($element, config) {
  6595. var from = config.from;
  6596. var to = config.to;
  6597. var fromOpacity = "opacity" in from ? from.opacity : $element.css("opacity");
  6598. var toOpacity = "opacity" in to ? to.opacity : 1;
  6599. var fromScale = "scale" in from ? from.scale : 0;
  6600. var toScale = "scale" in to ? to.scale : 1;
  6601. config.from = {
  6602. opacity: fromOpacity
  6603. };
  6604. var translate = translator.getTranslate($element);
  6605. config.from[TRANSFORM_PROP] = this._getCssTransform(translate, fromScale);
  6606. config.to = {
  6607. opacity: toOpacity
  6608. };
  6609. config.to[TRANSFORM_PROP] = this._getCssTransform(translate, toScale)
  6610. },
  6611. _getCssTransform: function(translate, scale) {
  6612. return translator.getTranslateCss(translate) + "scale(" + scale + ")"
  6613. }
  6614. };
  6615. var animationConfigurators = {
  6616. custom: CustomAnimationConfigurator,
  6617. slide: SlideAnimationConfigurator,
  6618. slideIn: SlideAnimationConfigurator,
  6619. slideOut: SlideAnimationConfigurator,
  6620. fade: FadeAnimationConfigurator,
  6621. fadeIn: FadeAnimationConfigurator,
  6622. fadeOut: FadeAnimationConfigurator,
  6623. pop: PopAnimationConfigurator,
  6624. css: CssAnimationConfigurator
  6625. };
  6626. var getAnimationConfigurator = function(config) {
  6627. var result = animationConfigurators[config.type];
  6628. if (!result) {
  6629. throw errors.Error("E0011", config.type)
  6630. }
  6631. return result
  6632. };
  6633. var defaultJSConfig = {
  6634. type: "custom",
  6635. from: {},
  6636. to: {},
  6637. duration: 400,
  6638. start: noop,
  6639. complete: noop,
  6640. easing: "ease",
  6641. delay: 0
  6642. };
  6643. var defaultCssConfig = {
  6644. duration: 400,
  6645. easing: "ease",
  6646. delay: 0
  6647. };
  6648. var setupAnimationOnElement = function() {
  6649. var animation = this;
  6650. var $element = animation.element;
  6651. var config = animation.config;
  6652. setupPosition($element, config.from);
  6653. setupPosition($element, config.to);
  6654. animation.configurator.setup($element, config);
  6655. $element.data(ANIM_DATA_KEY, animation);
  6656. if (fx.off) {
  6657. config.duration = 0;
  6658. config.delay = 0
  6659. }
  6660. animation.strategy.initAnimation($element, config);
  6661. if (config.start) {
  6662. var element = getPublicElement($element);
  6663. config.start.apply(this, [element, config])
  6664. }
  6665. };
  6666. var onElementAnimationComplete = function(animation) {
  6667. var $element = animation.element;
  6668. var config = animation.config;
  6669. $element.removeData(ANIM_DATA_KEY);
  6670. if (config.complete) {
  6671. var element = getPublicElement($element);
  6672. config.complete.apply(this, [element, config])
  6673. }
  6674. animation.deferred.resolveWith(this, [$element, config])
  6675. };
  6676. var startAnimationOnElement = function() {
  6677. var animation = this;
  6678. var $element = animation.element;
  6679. var config = animation.config;
  6680. animation.isStarted = true;
  6681. return animation.strategy.animate($element, config).done(function() {
  6682. onElementAnimationComplete(animation)
  6683. }).fail(function() {
  6684. animation.deferred.rejectWith(this, [$element, config])
  6685. })
  6686. };
  6687. var stopAnimationOnElement = function(jumpToEnd) {
  6688. var animation = this;
  6689. var $element = animation.element;
  6690. var config = animation.config;
  6691. clearTimeout(animation.startTimeout);
  6692. if (!animation.isStarted) {
  6693. animation.start()
  6694. }
  6695. animation.strategy.stop($element, config, jumpToEnd)
  6696. };
  6697. var scopedRemoveEvent = eventUtils.addNamespace(removeEvent, "dxFXStartAnimation");
  6698. var subscribeToRemoveEvent = function(animation) {
  6699. eventsEngine.off(animation.element, scopedRemoveEvent);
  6700. eventsEngine.on(animation.element, scopedRemoveEvent, function() {
  6701. fx.stop(animation.element)
  6702. });
  6703. animation.deferred.always(function() {
  6704. eventsEngine.off(animation.element, scopedRemoveEvent)
  6705. })
  6706. };
  6707. var createAnimation = function(element, initialConfig) {
  6708. var defaultConfig = "css" === initialConfig.type ? defaultCssConfig : defaultJSConfig;
  6709. var config = extend(true, {}, defaultConfig, initialConfig);
  6710. var configurator = getAnimationConfigurator(config);
  6711. var strategy = getAnimationStrategy(config);
  6712. var animation = {
  6713. element: $(element),
  6714. config: config,
  6715. configurator: configurator,
  6716. strategy: strategy,
  6717. isSynchronous: strategy.isSynchronous,
  6718. setup: setupAnimationOnElement,
  6719. start: startAnimationOnElement,
  6720. stop: stopAnimationOnElement,
  6721. deferred: new Deferred
  6722. };
  6723. if (isFunction(configurator.validateConfig)) {
  6724. configurator.validateConfig(config)
  6725. }
  6726. subscribeToRemoveEvent(animation);
  6727. return animation
  6728. };
  6729. var animate = function(element, config) {
  6730. var $element = $(element);
  6731. if (!$element.length) {
  6732. return (new Deferred).resolve().promise()
  6733. }
  6734. var animation = createAnimation($element, config);
  6735. pushInAnimationQueue($element, animation);
  6736. return animation.deferred.promise()
  6737. };
  6738. var pushInAnimationQueue = function($element, animation) {
  6739. var queueData = getAnimQueueData($element);
  6740. writeAnimQueueData($element, queueData);
  6741. queueData.push(animation);
  6742. if (!isAnimating($element)) {
  6743. shiftFromAnimationQueue($element, queueData)
  6744. }
  6745. };
  6746. var getAnimQueueData = function($element) {
  6747. return $element.data(ANIM_QUEUE_KEY) || []
  6748. };
  6749. var writeAnimQueueData = function($element, queueData) {
  6750. $element.data(ANIM_QUEUE_KEY, queueData)
  6751. };
  6752. var destroyAnimQueueData = function($element) {
  6753. $element.removeData(ANIM_QUEUE_KEY)
  6754. };
  6755. var isAnimating = function($element) {
  6756. return !!$element.data(ANIM_DATA_KEY)
  6757. };
  6758. var shiftFromAnimationQueue = function shiftFromAnimationQueue($element, queueData) {
  6759. queueData = getAnimQueueData($element);
  6760. if (!queueData.length) {
  6761. return
  6762. }
  6763. var animation = queueData.shift();
  6764. if (0 === queueData.length) {
  6765. destroyAnimQueueData($element)
  6766. }
  6767. executeAnimation(animation).done(function() {
  6768. if (!isAnimating($element)) {
  6769. shiftFromAnimationQueue($element)
  6770. }
  6771. })
  6772. };
  6773. var executeAnimation = function(animation) {
  6774. animation.setup();
  6775. if (fx.off || animation.isSynchronous) {
  6776. animation.start()
  6777. } else {
  6778. animation.startTimeout = setTimeout(function() {
  6779. animation.start()
  6780. })
  6781. }
  6782. return animation.deferred.promise()
  6783. };
  6784. var setupPosition = function($element, config) {
  6785. if (!config || !config.position) {
  6786. return
  6787. }
  6788. var win = $(window);
  6789. var left = 0;
  6790. var top = 0;
  6791. var position = positionUtils.calculate($element, config.position);
  6792. var offset = $element.offset();
  6793. var currentPosition = $element.position();
  6794. if (currentPosition.top > offset.top) {
  6795. top = win.scrollTop()
  6796. }
  6797. if (currentPosition.left > offset.left) {
  6798. left = win.scrollLeft()
  6799. }
  6800. extend(config, {
  6801. left: position.h.location - offset.left + currentPosition.left - left,
  6802. top: position.v.location - offset.top + currentPosition.top - top
  6803. });
  6804. delete config.position
  6805. };
  6806. var setProps = function($element, props) {
  6807. iteratorUtils.each(props, function(key, value) {
  6808. try {
  6809. $element.css(key, typeUtils.isFunction(value) ? value() : value)
  6810. } catch (e) {}
  6811. })
  6812. };
  6813. var stop = function(element, jumpToEnd) {
  6814. var $element = $(element);
  6815. var queueData = getAnimQueueData($element);
  6816. iteratorUtils.each(queueData, function(_, animation) {
  6817. animation.config.delay = 0;
  6818. animation.config.duration = 0;
  6819. animation.isSynchronous = true
  6820. });
  6821. if (!isAnimating($element)) {
  6822. shiftFromAnimationQueue($element, queueData)
  6823. }
  6824. var animation = $element.data(ANIM_DATA_KEY);
  6825. if (animation) {
  6826. animation.stop(jumpToEnd)
  6827. }
  6828. $element.removeData(ANIM_DATA_KEY);
  6829. destroyAnimQueueData($element)
  6830. };
  6831. var fx = {
  6832. off: false,
  6833. animationTypes: animationConfigurators,
  6834. animate: animate,
  6835. createAnimation: createAnimation,
  6836. isAnimating: isAnimating,
  6837. stop: stop,
  6838. _simulatedTransitionEndDelay: 100
  6839. };
  6840. module.exports = fx
  6841. },
  6842. /*!***************************************************!*\
  6843. !*** ./artifacts/transpiled/core/element_data.js ***!
  6844. \***************************************************/
  6845. /*! dynamic exports provided */
  6846. /*! all exports used */
  6847. function(module, exports, __webpack_require__) {
  6848. var WeakMap = __webpack_require__( /*! ./polyfills/weak_map */ 176);
  6849. var domAdapter = __webpack_require__( /*! ./dom_adapter */ 11);
  6850. var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
  6851. var MemorizedCallbacks = __webpack_require__( /*! ./memorized_callbacks */ 177);
  6852. var dataMap = new WeakMap;
  6853. var strategy;
  6854. var strategyChanging = new MemorizedCallbacks;
  6855. var beforeCleanData = function() {};
  6856. var afterCleanData = function() {};
  6857. var setDataStrategy = exports.setDataStrategy = function(value) {
  6858. strategyChanging.fire(value);
  6859. strategy = value;
  6860. var cleanData = strategy.cleanData;
  6861. strategy.cleanData = function(nodes) {
  6862. beforeCleanData(nodes);
  6863. var result = cleanData.call(this, nodes);
  6864. afterCleanData(nodes);
  6865. return result
  6866. }
  6867. };
  6868. setDataStrategy({
  6869. data: function() {
  6870. var element = arguments[0];
  6871. var key = arguments[1];
  6872. var value = arguments[2];
  6873. if (!element) {
  6874. return
  6875. }
  6876. var elementData = dataMap.get(element);
  6877. if (!elementData) {
  6878. elementData = {};
  6879. dataMap.set(element, elementData)
  6880. }
  6881. if (void 0 === key) {
  6882. return elementData
  6883. }
  6884. if (2 === arguments.length) {
  6885. return elementData[key]
  6886. }
  6887. elementData[key] = value;
  6888. return value
  6889. },
  6890. removeData: function(element, key) {
  6891. if (!element) {
  6892. return
  6893. }
  6894. if (void 0 === key) {
  6895. dataMap.delete(element)
  6896. } else {
  6897. var elementData = dataMap.get(element);
  6898. if (elementData) {
  6899. delete elementData[key]
  6900. }
  6901. }
  6902. },
  6903. cleanData: function(elements) {
  6904. for (var i = 0; i < elements.length; i++) {
  6905. eventsEngine.off(elements[i]);
  6906. dataMap.delete(elements[i])
  6907. }
  6908. }
  6909. });
  6910. exports.setDataStrategy = setDataStrategy;
  6911. exports.getDataStrategy = function() {
  6912. return strategy
  6913. };
  6914. exports.data = function() {
  6915. return strategy.data.apply(this, arguments)
  6916. };
  6917. exports.strategyChanging = strategyChanging;
  6918. exports.beforeCleanData = function(callback) {
  6919. beforeCleanData = callback
  6920. };
  6921. exports.afterCleanData = function(callback) {
  6922. afterCleanData = callback
  6923. };
  6924. exports.cleanData = function(nodes) {
  6925. return strategy.cleanData.call(this, nodes)
  6926. };
  6927. exports.removeData = function(element, key) {
  6928. return strategy.removeData.call(this, element, key)
  6929. };
  6930. exports.cleanDataRecursive = function(element, cleanSelf) {
  6931. if (!domAdapter.isElementNode(element)) {
  6932. return
  6933. }
  6934. var childElements = element.getElementsByTagName("*");
  6935. strategy.cleanData(childElements);
  6936. if (cleanSelf) {
  6937. strategy.cleanData([element])
  6938. }
  6939. }
  6940. },
  6941. /*!*******************************************!*\
  6942. !*** ./artifacts/transpiled/core/guid.js ***!
  6943. \*******************************************/
  6944. /*! dynamic exports provided */
  6945. /*! all exports used */
  6946. function(module, exports, __webpack_require__) {
  6947. var Class = __webpack_require__( /*! ./class */ 15);
  6948. var Guid = Class.inherit({
  6949. ctor: function(value) {
  6950. if (value) {
  6951. value = String(value)
  6952. }
  6953. this._value = this._normalize(value || this._generate())
  6954. },
  6955. _normalize: function(value) {
  6956. value = value.replace(/[^a-f0-9]/gi, "").toLowerCase();
  6957. while (value.length < 32) {
  6958. value += "0"
  6959. }
  6960. return [value.substr(0, 8), value.substr(8, 4), value.substr(12, 4), value.substr(16, 4), value.substr(20, 12)].join("-")
  6961. },
  6962. _generate: function() {
  6963. var value = "";
  6964. for (var i = 0; i < 32; i++) {
  6965. value += Math.round(15 * Math.random()).toString(16)
  6966. }
  6967. return value
  6968. },
  6969. toString: function() {
  6970. return this._value
  6971. },
  6972. valueOf: function() {
  6973. return this._value
  6974. },
  6975. toJSON: function() {
  6976. return this._value
  6977. }
  6978. });
  6979. module.exports = Guid
  6980. },
  6981. /*!********************************************!*\
  6982. !*** ./artifacts/transpiled/data/utils.js ***!
  6983. \********************************************/
  6984. /*! dynamic exports provided */
  6985. /*! all exports used */
  6986. function(module, exports, __webpack_require__) {
  6987. var _type = __webpack_require__( /*! ../core/utils/type */ 1);
  6988. var _type2 = _interopRequireDefault(_type);
  6989. var _dom_adapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
  6990. var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
  6991. var _ready_callbacks = __webpack_require__( /*! ../core/utils/ready_callbacks */ 48);
  6992. var _window = __webpack_require__( /*! ../core/utils/window */ 7);
  6993. var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
  6994. var _data = __webpack_require__( /*! ../core/utils/data */ 20);
  6995. var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6);
  6996. function _interopRequireDefault(obj) {
  6997. return obj && obj.__esModule ? obj : {
  6998. "default": obj
  6999. }
  7000. }
  7001. function _toConsumableArray(arr) {
  7002. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread()
  7003. }
  7004. function _nonIterableSpread() {
  7005. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  7006. }
  7007. function _unsupportedIterableToArray(o, minLen) {
  7008. if (!o) {
  7009. return
  7010. }
  7011. if ("string" === typeof o) {
  7012. return _arrayLikeToArray(o, minLen)
  7013. }
  7014. var n = Object.prototype.toString.call(o).slice(8, -1);
  7015. if ("Object" === n && o.constructor) {
  7016. n = o.constructor.name
  7017. }
  7018. if ("Map" === n || "Set" === n) {
  7019. return Array.from(o)
  7020. }
  7021. if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
  7022. return _arrayLikeToArray(o, minLen)
  7023. }
  7024. }
  7025. function _iterableToArray(iter) {
  7026. if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) {
  7027. return Array.from(iter)
  7028. }
  7029. }
  7030. function _arrayWithoutHoles(arr) {
  7031. if (Array.isArray(arr)) {
  7032. return _arrayLikeToArray(arr)
  7033. }
  7034. }
  7035. function _arrayLikeToArray(arr, len) {
  7036. if (null == len || len > arr.length) {
  7037. len = arr.length
  7038. }
  7039. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  7040. arr2[i] = arr[i]
  7041. }
  7042. return arr2
  7043. }
  7044. var XHR_ERROR_UNLOAD = "DEVEXTREME_XHR_ERROR_UNLOAD";
  7045. var normalizeBinaryCriterion = function(crit) {
  7046. return [crit[0], crit.length < 3 ? "=" : String(crit[1]).toLowerCase(), crit.length < 2 ? true : crit[crit.length - 1]]
  7047. };
  7048. var normalizeSortingInfo = function(info) {
  7049. if (!Array.isArray(info)) {
  7050. info = [info]
  7051. }
  7052. return (0, _iterator.map)(info, function(i) {
  7053. var result = {
  7054. selector: (0, _type.isFunction)(i) || "string" === typeof i ? i : i.getter || i.field || i.selector,
  7055. desc: !!(i.desc || "d" === String(i.dir).charAt(0).toLowerCase())
  7056. };
  7057. if (i.compare) {
  7058. result.compare = i.compare
  7059. }
  7060. return result
  7061. })
  7062. };
  7063. var errorMessageFromXhr = function() {
  7064. var textStatusMessages = {
  7065. timeout: "Network connection timeout",
  7066. error: "Unspecified network error",
  7067. parsererror: "Unexpected server response"
  7068. };
  7069. var textStatusDetails = {
  7070. timeout: "possible causes: the remote host is not accessible, overloaded or is not included into the domain white-list when being run in the native container",
  7071. error: "if the remote host is located on another domain, make sure it properly supports cross-origin resource sharing (CORS), or use the JSONP approach instead",
  7072. parsererror: "the remote host did not respond with valid JSON data"
  7073. };
  7074. var explainTextStatus = function(textStatus) {
  7075. var result = textStatusMessages[textStatus];
  7076. if (!result) {
  7077. return textStatus
  7078. }
  7079. result += " (" + textStatusDetails[textStatus] + ")";
  7080. return result
  7081. };
  7082. var unloading;
  7083. (0, _ready_callbacks.add)(function() {
  7084. var window = (0, _window.getWindow)();
  7085. _dom_adapter2.default.listen(window, "beforeunload", function() {
  7086. unloading = true
  7087. })
  7088. });
  7089. return function(xhr, textStatus) {
  7090. if (unloading) {
  7091. return XHR_ERROR_UNLOAD
  7092. }
  7093. if (xhr.status < 400) {
  7094. return explainTextStatus(textStatus)
  7095. }
  7096. return xhr.statusText
  7097. }
  7098. }();
  7099. var aggregators = {
  7100. count: {
  7101. seed: 0,
  7102. step: function(count) {
  7103. return 1 + count
  7104. }
  7105. },
  7106. sum: {
  7107. seed: 0,
  7108. step: function(sum, item) {
  7109. return sum + item
  7110. }
  7111. },
  7112. min: {
  7113. step: function(min, item) {
  7114. return item < min ? item : min
  7115. }
  7116. },
  7117. max: {
  7118. step: function(max, item) {
  7119. return item > max ? item : max
  7120. }
  7121. },
  7122. avg: {
  7123. seed: [0, 0],
  7124. step: function(pair, value) {
  7125. return [pair[0] + value, pair[1] + 1]
  7126. },
  7127. finalize: function(pair) {
  7128. return pair[1] ? pair[0] / pair[1] : NaN
  7129. }
  7130. }
  7131. };
  7132. var processRequestResultLock = function() {
  7133. var lockCount = 0;
  7134. var lockDeferred;
  7135. var obtain = function() {
  7136. if (0 === lockCount) {
  7137. lockDeferred = new _deferred.Deferred
  7138. }
  7139. lockCount++
  7140. };
  7141. var release = function() {
  7142. lockCount--;
  7143. if (lockCount < 1) {
  7144. lockDeferred.resolve()
  7145. }
  7146. };
  7147. var promise = function() {
  7148. var deferred = 0 === lockCount ? (new _deferred.Deferred).resolve() : lockDeferred;
  7149. return deferred.promise()
  7150. };
  7151. var reset = function() {
  7152. lockCount = 0;
  7153. if (lockDeferred) {
  7154. lockDeferred.resolve()
  7155. }
  7156. };
  7157. return {
  7158. obtain: obtain,
  7159. release: release,
  7160. promise: promise,
  7161. reset: reset
  7162. }
  7163. }();
  7164. function isDisjunctiveOperator(condition) {
  7165. return /^(or|\|\||\|)$/i.test(condition)
  7166. }
  7167. function isConjunctiveOperator(condition) {
  7168. return /^(and|&&|&)$/i.test(condition)
  7169. }
  7170. var keysEqual = function(keyExpr, key1, key2) {
  7171. if (Array.isArray(keyExpr)) {
  7172. var names = (0, _iterator.map)(key1, function(v, k) {
  7173. return k
  7174. });
  7175. var name;
  7176. for (var i = 0; i < names.length; i++) {
  7177. name = names[i];
  7178. if ((0, _data.toComparable)(key1[name], true) != (0, _data.toComparable)(key2[name], true)) {
  7179. return false
  7180. }
  7181. }
  7182. return true
  7183. }
  7184. return (0, _data.toComparable)(key1, true) == (0, _data.toComparable)(key2, true)
  7185. };
  7186. var BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  7187. var base64_encode = function(input) {
  7188. if (!Array.isArray(input)) {
  7189. input = stringToByteArray(String(input))
  7190. }
  7191. var result = "";
  7192. function getBase64Char(index) {
  7193. return BASE64_CHARS.charAt(index)
  7194. }
  7195. for (var i = 0; i < input.length; i += 3) {
  7196. var octet1 = input[i];
  7197. var octet2 = input[i + 1];
  7198. var octet3 = input[i + 2];
  7199. result += (0, _iterator.map)([octet1 >> 2, (3 & octet1) << 4 | octet2 >> 4, isNaN(octet2) ? 64 : (15 & octet2) << 2 | octet3 >> 6, isNaN(octet3) ? 64 : 63 & octet3], getBase64Char).join("")
  7200. }
  7201. return result
  7202. };
  7203. var stringToByteArray = function(str) {
  7204. var bytes = [];
  7205. var code;
  7206. var i;
  7207. for (i = 0; i < str.length; i++) {
  7208. code = str.charCodeAt(i);
  7209. if (code < 128) {
  7210. bytes.push(code)
  7211. } else {
  7212. if (code < 2048) {
  7213. bytes.push(192 + (code >> 6), 128 + (63 & code))
  7214. } else {
  7215. if (code < 65536) {
  7216. bytes.push(224 + (code >> 12), 128 + (code >> 6 & 63), 128 + (63 & code))
  7217. } else {
  7218. if (code < 2097152) {
  7219. bytes.push(240 + (code >> 18), 128 + (code >> 12 & 63), 128 + (code >> 6 & 63), 128 + (63 & code))
  7220. }
  7221. }
  7222. }
  7223. }
  7224. }
  7225. return bytes
  7226. };
  7227. var isUnaryOperation = function(crit) {
  7228. return "!" === crit[0] && Array.isArray(crit[1])
  7229. };
  7230. var isGroupOperator = function(value) {
  7231. return "and" === value || "or" === value
  7232. };
  7233. var isGroupCriterion = function(crit) {
  7234. var first = crit[0];
  7235. var second = crit[1];
  7236. if (Array.isArray(first)) {
  7237. return true
  7238. }
  7239. if (_type2.default.isFunction(first)) {
  7240. if (Array.isArray(second) || _type2.default.isFunction(second) || isGroupOperator(second)) {
  7241. return true
  7242. }
  7243. }
  7244. return false
  7245. };
  7246. var trivialPromise = function() {
  7247. var d = new _deferred.Deferred;
  7248. return d.resolve.apply(d, arguments).promise()
  7249. };
  7250. var rejectedPromise = function() {
  7251. var d = new _deferred.Deferred;
  7252. return d.reject.apply(d, arguments).promise()
  7253. };
  7254. function throttle(func, timeout) {
  7255. var timeoutId;
  7256. var lastArgs;
  7257. return function() {
  7258. var _this = this;
  7259. lastArgs = arguments;
  7260. if (!timeoutId) {
  7261. timeoutId = setTimeout(function() {
  7262. timeoutId = void 0;
  7263. if (lastArgs) {
  7264. func.call(_this, lastArgs)
  7265. }
  7266. }, (0, _type.isFunction)(timeout) ? timeout() : timeout)
  7267. }
  7268. return timeoutId
  7269. }
  7270. }
  7271. function throttleChanges(func, timeout) {
  7272. var cache = [];
  7273. var throttled = throttle(function() {
  7274. func.call(this, cache);
  7275. cache = []
  7276. }, timeout);
  7277. return function(changes) {
  7278. if (Array.isArray(changes)) {
  7279. var _cache;
  7280. (_cache = cache).push.apply(_cache, _toConsumableArray(changes))
  7281. }
  7282. return throttled.call(this, cache)
  7283. }
  7284. }
  7285. var utils = {
  7286. XHR_ERROR_UNLOAD: XHR_ERROR_UNLOAD,
  7287. normalizeBinaryCriterion: normalizeBinaryCriterion,
  7288. normalizeSortingInfo: normalizeSortingInfo,
  7289. errorMessageFromXhr: errorMessageFromXhr,
  7290. aggregators: aggregators,
  7291. keysEqual: keysEqual,
  7292. throttleChanges: throttleChanges,
  7293. trivialPromise: trivialPromise,
  7294. rejectedPromise: rejectedPromise,
  7295. isDisjunctiveOperator: isDisjunctiveOperator,
  7296. isConjunctiveOperator: isConjunctiveOperator,
  7297. processRequestResultLock: processRequestResultLock,
  7298. isUnaryOperation: isUnaryOperation,
  7299. isGroupCriterion: isGroupCriterion,
  7300. base64_encode: base64_encode
  7301. };
  7302. module.exports = utils
  7303. },
  7304. /*!********************************************!*\
  7305. !*** ./artifacts/transpiled/data/query.js ***!
  7306. \********************************************/
  7307. /*! dynamic exports provided */
  7308. /*! all exports used */
  7309. function(module, exports, __webpack_require__) {
  7310. var arrayQueryImpl = __webpack_require__( /*! ./array_query */ 155);
  7311. var remoteQueryImpl = __webpack_require__( /*! ./remote_query */ 468);
  7312. var queryImpl = {
  7313. array: arrayQueryImpl,
  7314. remote: remoteQueryImpl
  7315. };
  7316. var query = function() {
  7317. var impl = Array.isArray(arguments[0]) ? "array" : "remote";
  7318. return queryImpl[impl].apply(this, arguments)
  7319. };
  7320. module.exports = query;
  7321. module.exports.queryImpl = queryImpl
  7322. },
  7323. /*!****************************************************!*\
  7324. !*** ./artifacts/transpiled/core/utils/support.js ***!
  7325. \****************************************************/
  7326. /*! dynamic exports provided */
  7327. /*! all exports used */
  7328. function(module, exports, __webpack_require__) {
  7329. var _array = __webpack_require__( /*! ./array */ 14);
  7330. var _dom_adapter = __webpack_require__( /*! ../dom_adapter */ 11);
  7331. var _common = __webpack_require__( /*! ./common */ 4);
  7332. var _call_once = __webpack_require__( /*! ./call_once */ 63);
  7333. var _call_once2 = _interopRequireDefault(_call_once);
  7334. var _window = __webpack_require__( /*! ./window */ 7);
  7335. var _window2 = _interopRequireDefault(_window);
  7336. var _devices = __webpack_require__( /*! ../devices */ 16);
  7337. var _devices2 = _interopRequireDefault(_devices);
  7338. var _style = __webpack_require__( /*! ./style */ 85);
  7339. var _style2 = _interopRequireDefault(_style);
  7340. function _interopRequireDefault(obj) {
  7341. return obj && obj.__esModule ? obj : {
  7342. "default": obj
  7343. }
  7344. }
  7345. var _windowUtils$getNavig = _window2.default.getNavigator(),
  7346. maxTouchPoints = _windowUtils$getNavig.maxTouchPoints,
  7347. msMaxTouchPoints = _windowUtils$getNavig.msMaxTouchPoints,
  7348. pointerEnabled = _windowUtils$getNavig.pointerEnabled;
  7349. var hasProperty = _window2.default.hasProperty.bind(_window2.default);
  7350. var transitionEndEventNames = {
  7351. webkitTransition: "webkitTransitionEnd",
  7352. MozTransition: "transitionend",
  7353. OTransition: "oTransitionEnd",
  7354. msTransition: "MsTransitionEnd",
  7355. transition: "transitionend"
  7356. };
  7357. var supportProp = function(prop) {
  7358. return !!_style2.default.styleProp(prop)
  7359. };
  7360. var isNativeScrollingSupported = function() {
  7361. var _devices$real = _devices2.default.real(),
  7362. platform = _devices$real.platform,
  7363. version = _devices$real.version,
  7364. isMac = _devices$real.mac;
  7365. var isObsoleteAndroid = version && version[0] < 4 && "android" === platform;
  7366. var isNativeScrollDevice = !isObsoleteAndroid && (0, _array.inArray)(platform, ["ios", "android", "win"]) > -1 || isMac;
  7367. return isNativeScrollDevice
  7368. };
  7369. var inputType = function(type) {
  7370. if ("text" === type) {
  7371. return true
  7372. }
  7373. var input = (0, _dom_adapter.createElement)("input");
  7374. try {
  7375. input.setAttribute("type", type);
  7376. input.value = "wrongValue";
  7377. return !input.value
  7378. } catch (e) {
  7379. return false
  7380. }
  7381. };
  7382. var detectTouchEvents = function(hasWindowProperty, maxTouchPoints) {
  7383. return (hasWindowProperty("ontouchstart") || !!maxTouchPoints) && !hasWindowProperty("callPhantom")
  7384. };
  7385. var detectPointerEvent = function(hasWindowProperty, pointerEnabled) {
  7386. var isPointerEnabled = (0, _common.ensureDefined)(pointerEnabled, true);
  7387. var canUsePointerEvent = (0, _common.ensureDefined)(pointerEnabled, false);
  7388. return hasWindowProperty("PointerEvent") && isPointerEnabled || canUsePointerEvent
  7389. };
  7390. var touchEvents = detectTouchEvents(hasProperty, maxTouchPoints);
  7391. var pointerEvents = detectPointerEvent(hasProperty, pointerEnabled);
  7392. var touchPointersPresent = !!maxTouchPoints || !!msMaxTouchPoints;
  7393. exports.detectTouchEvents = detectTouchEvents;
  7394. exports.detectPointerEvent = detectPointerEvent;
  7395. exports.touchEvents = touchEvents;
  7396. exports.pointerEvents = pointerEvents;
  7397. exports.touch = touchEvents || pointerEvents && touchPointersPresent;
  7398. exports.transition = (0, _call_once2.default)(function() {
  7399. return supportProp("transition")
  7400. });
  7401. exports.transitionEndEventName = (0, _call_once2.default)(function() {
  7402. return transitionEndEventNames[_style2.default.styleProp("transition")]
  7403. });
  7404. exports.animation = (0, _call_once2.default)(function() {
  7405. return supportProp("animation")
  7406. });
  7407. exports.nativeScrolling = isNativeScrollingSupported();
  7408. exports.styleProp = _style2.default.styleProp;
  7409. exports.stylePropPrefix = _style2.default.stylePropPrefix;
  7410. exports.supportProp = supportProp;
  7411. exports.inputType = inputType
  7412. },
  7413. /*!***************************************************!*\
  7414. !*** ./artifacts/transpiled/core/utils/string.js ***!
  7415. \***************************************************/
  7416. /*! dynamic exports provided */
  7417. /*! all exports used */
  7418. function(module, exports, __webpack_require__) {
  7419. function _typeof(obj) {
  7420. "@babel/helpers - typeof";
  7421. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  7422. return typeof obj
  7423. } : function(obj) {
  7424. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  7425. }, _typeof(obj)
  7426. }
  7427. var typeUtils = __webpack_require__( /*! ./type */ 1);
  7428. var encodeHtml = function() {
  7429. var encodeRegExp = [new RegExp("&", "g"), new RegExp('"', "g"), new RegExp("'", "g"), new RegExp("<", "g"), new RegExp(">", "g")];
  7430. return function(str) {
  7431. return String(str).replace(encodeRegExp[0], "&amp;").replace(encodeRegExp[1], "&quot;").replace(encodeRegExp[2], "&#39;").replace(encodeRegExp[3], "&lt;").replace(encodeRegExp[4], "&gt;")
  7432. }
  7433. }();
  7434. var splitQuad = function(raw) {
  7435. switch (_typeof(raw)) {
  7436. case "string":
  7437. return raw.split(/\s+/, 4);
  7438. case "object":
  7439. return [raw.x || raw.h || raw.left, raw.y || raw.v || raw.top, raw.x || raw.h || raw.right, raw.y || raw.v || raw.bottom];
  7440. case "number":
  7441. return [raw];
  7442. default:
  7443. return raw
  7444. }
  7445. };
  7446. var quadToObject = function(raw) {
  7447. var quad = splitQuad(raw);
  7448. var left = parseInt(quad && quad[0], 10);
  7449. var top = parseInt(quad && quad[1], 10);
  7450. var right = parseInt(quad && quad[2], 10);
  7451. var bottom = parseInt(quad && quad[3], 10);
  7452. if (!isFinite(left)) {
  7453. left = 0
  7454. }
  7455. if (!isFinite(top)) {
  7456. top = left
  7457. }
  7458. if (!isFinite(right)) {
  7459. right = left
  7460. }
  7461. if (!isFinite(bottom)) {
  7462. bottom = top
  7463. }
  7464. return {
  7465. top: top,
  7466. right: right,
  7467. bottom: bottom,
  7468. left: left
  7469. }
  7470. };
  7471. var stringFormat = function() {
  7472. var s = arguments[0];
  7473. var values = [].slice.call(arguments).slice(1);
  7474. var replaceDollarCount;
  7475. var reg;
  7476. var value;
  7477. if (typeUtils.isFunction(s)) {
  7478. return s.apply(this, values)
  7479. }
  7480. for (var i = 0; i < values.length; i++) {
  7481. reg = new RegExp("\\{" + i + "\\}", "gm");
  7482. value = values[i];
  7483. if ("string" === typeUtils.type(value) && value.indexOf("$") >= 0) {
  7484. replaceDollarCount = "$".replace("$", "$$").length;
  7485. value = value.replace("$", 1 === replaceDollarCount ? "$$$$" : "$$")
  7486. }
  7487. s = s.replace(reg, value)
  7488. }
  7489. return s
  7490. };
  7491. var replaceAll = function() {
  7492. var quote = function(str) {
  7493. return (str + "").replace(/([+*?.[^\]$(){}><|=!:])/g, "\\$1")
  7494. };
  7495. return function(text, searchToken, replacementToken) {
  7496. return text.replace(new RegExp("(" + quote(searchToken) + ")", "gi"), replacementToken)
  7497. }
  7498. }();
  7499. var isEmpty = function() {
  7500. var SPACE_REGEXP = /\s/g;
  7501. return function(text) {
  7502. return !text || !text.replace(SPACE_REGEXP, "")
  7503. }
  7504. }();
  7505. exports.encodeHtml = encodeHtml;
  7506. exports.quadToObject = quadToObject;
  7507. exports.format = stringFormat;
  7508. exports.replaceAll = replaceAll;
  7509. exports.isEmpty = isEmpty
  7510. },
  7511. /*!**************************************************************!*\
  7512. !*** ./artifacts/transpiled/data/data_source/data_source.js ***!
  7513. \**************************************************************/
  7514. /*! dynamic exports provided */
  7515. /*! all exports used */
  7516. function(module, exports, __webpack_require__) {
  7517. var Class = __webpack_require__( /*! ../../core/class */ 15);
  7518. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  7519. var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
  7520. var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  7521. var ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58);
  7522. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  7523. var dataUtils = __webpack_require__( /*! ../utils */ 41);
  7524. var arrayUtils = __webpack_require__( /*! ../array_utils */ 135);
  7525. var Store = __webpack_require__( /*! ../abstract_store */ 98);
  7526. var ArrayStore = __webpack_require__( /*! ../array_store */ 68);
  7527. var CustomStore = __webpack_require__( /*! ../custom_store */ 149);
  7528. var EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 82);
  7529. var errors = __webpack_require__( /*! ../errors */ 36).errors;
  7530. var array = __webpack_require__( /*! ../../core/utils/array */ 14);
  7531. var queue = __webpack_require__( /*! ../../core/utils/queue */ 263);
  7532. var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
  7533. var when = deferredUtils.when;
  7534. var Deferred = deferredUtils.Deferred;
  7535. var __isString = typeUtils.isString;
  7536. var __isNumber = typeUtils.isNumeric;
  7537. var __isBoolean = typeUtils.isBoolean;
  7538. var __isDefined = typeUtils.isDefined;
  7539. var CANCELED_TOKEN = "canceled";
  7540. function OperationManager() {
  7541. this._counter = -1;
  7542. this._deferreds = {}
  7543. }
  7544. OperationManager.prototype.constructor = OperationManager;
  7545. OperationManager.prototype.add = function(deferred) {
  7546. this._counter += 1;
  7547. this._deferreds[this._counter] = deferred;
  7548. return this._counter
  7549. };
  7550. OperationManager.prototype.remove = function(operationId) {
  7551. return delete this._deferreds[operationId]
  7552. };
  7553. OperationManager.prototype.cancel = function(operationId) {
  7554. if (operationId in this._deferreds) {
  7555. this._deferreds[operationId].reject(CANCELED_TOKEN);
  7556. return true
  7557. }
  7558. return false
  7559. };
  7560. OperationManager.prototype.cancelAll = function() {
  7561. while (this._counter > -1) {
  7562. this.cancel(this._counter);
  7563. this._counter--
  7564. }
  7565. };
  7566. function isPending(deferred) {
  7567. return "pending" === deferred.state()
  7568. }
  7569. function normalizeDataSourceOptions(options, normalizationOptions) {
  7570. var store;
  7571. function createCustomStoreFromLoadFunc() {
  7572. var storeConfig = {};
  7573. iteratorUtils.each(["useDefaultSearch", "key", "load", "loadMode", "cacheRawData", "byKey", "lookup", "totalCount", "insert", "update", "remove"], function() {
  7574. storeConfig[this] = options[this];
  7575. delete options[this]
  7576. });
  7577. return new CustomStore(storeConfig)
  7578. }
  7579. function createStoreFromConfig(storeConfig) {
  7580. var alias = storeConfig.type;
  7581. delete storeConfig.type;
  7582. return Store.create(alias, storeConfig)
  7583. }
  7584. function createCustomStoreFromUrl(url) {
  7585. return new CustomStore({
  7586. load: function() {
  7587. return ajax.sendRequest({
  7588. url: url,
  7589. dataType: "json"
  7590. })
  7591. },
  7592. loadMode: normalizationOptions && normalizationOptions.fromUrlLoadMode
  7593. })
  7594. }
  7595. if ("string" === typeof options) {
  7596. options = {
  7597. paginate: false,
  7598. store: createCustomStoreFromUrl(options)
  7599. }
  7600. }
  7601. if (void 0 === options) {
  7602. options = []
  7603. }
  7604. if (Array.isArray(options) || options instanceof Store) {
  7605. options = {
  7606. store: options
  7607. }
  7608. } else {
  7609. options = extend({}, options)
  7610. }
  7611. if (void 0 === options.store) {
  7612. options.store = []
  7613. }
  7614. store = options.store;
  7615. if ("load" in options) {
  7616. store = createCustomStoreFromLoadFunc()
  7617. } else {
  7618. if (Array.isArray(store)) {
  7619. store = new ArrayStore(store)
  7620. } else {
  7621. if (typeUtils.isPlainObject(store)) {
  7622. store = createStoreFromConfig(extend({}, store))
  7623. }
  7624. }
  7625. }
  7626. options.store = store;
  7627. return options
  7628. }
  7629. function normalizeStoreLoadOptionAccessorArguments(originalArguments) {
  7630. switch (originalArguments.length) {
  7631. case 0:
  7632. return;
  7633. case 1:
  7634. return originalArguments[0]
  7635. }
  7636. return [].slice.call(originalArguments)
  7637. }
  7638. function generateStoreLoadOptionAccessor(optionName) {
  7639. return function() {
  7640. var args = normalizeStoreLoadOptionAccessorArguments(arguments);
  7641. if (void 0 === args) {
  7642. return this._storeLoadOptions[optionName]
  7643. }
  7644. this._storeLoadOptions[optionName] = args
  7645. }
  7646. }
  7647. function mapDataRespectingGrouping(items, mapper, groupInfo) {
  7648. function mapRecursive(items, level) {
  7649. if (!Array.isArray(items)) {
  7650. return items
  7651. }
  7652. return level ? mapGroup(items, level) : iteratorUtils.map(items, mapper)
  7653. }
  7654. function mapGroup(group, level) {
  7655. return iteratorUtils.map(group, function(item) {
  7656. var result = {
  7657. key: item.key,
  7658. items: mapRecursive(item.items, level - 1)
  7659. };
  7660. if ("aggregates" in item) {
  7661. result.aggregates = item.aggregates
  7662. }
  7663. return result
  7664. })
  7665. }
  7666. return mapRecursive(items, groupInfo ? dataUtils.normalizeSortingInfo(groupInfo).length : 0)
  7667. }
  7668. function normalizeLoadResult(data, extra) {
  7669. if (data && !Array.isArray(data) && data.data) {
  7670. extra = data;
  7671. data = data.data
  7672. }
  7673. if (!Array.isArray(data)) {
  7674. data = [data]
  7675. }
  7676. return {
  7677. data: data,
  7678. extra: extra
  7679. }
  7680. }
  7681. var DataSource = Class.inherit({
  7682. ctor: function(options) {
  7683. var _this = this;
  7684. var that = this;
  7685. options = normalizeDataSourceOptions(options);
  7686. var onPushHandler = 0 !== options.pushAggregationTimeout ? dataUtils.throttleChanges(this._onPush, function() {
  7687. if (void 0 === options.pushAggregationTimeout) {
  7688. return 5 * that._changedTime
  7689. }
  7690. return options.pushAggregationTimeout
  7691. }) : this._onPush;
  7692. this._changedTime = 0;
  7693. this._onPushHandler = function(changes) {
  7694. _this._aggregationTimeoutId = onPushHandler.call(_this, changes)
  7695. };
  7696. this._store = options.store;
  7697. this._store.on("push", this._onPushHandler);
  7698. this._storeLoadOptions = this._extractLoadOptions(options);
  7699. this._mapFunc = options.map;
  7700. this._postProcessFunc = options.postProcess;
  7701. this._pageIndex = void 0 !== options.pageIndex ? options.pageIndex : 0;
  7702. this._pageSize = void 0 !== options.pageSize ? options.pageSize : 20;
  7703. this._loadingCount = 0;
  7704. this._loadQueue = this._createLoadQueue();
  7705. this._searchValue = "searchValue" in options ? options.searchValue : null;
  7706. this._searchOperation = options.searchOperation || "contains";
  7707. this._searchExpr = options.searchExpr;
  7708. this._paginate = options.paginate;
  7709. this._reshapeOnPush = __isDefined(options.reshapeOnPush) ? options.reshapeOnPush : false;
  7710. iteratorUtils.each(["onChanged", "onLoadError", "onLoadingChanged", "onCustomizeLoadResult", "onCustomizeStoreLoadOptions"], function(_, optionName) {
  7711. if (optionName in options) {
  7712. that.on(optionName.substr(2, 1).toLowerCase() + optionName.substr(3), options[optionName])
  7713. }
  7714. });
  7715. this._operationManager = new OperationManager;
  7716. this._init()
  7717. },
  7718. _init: function() {
  7719. this._items = [];
  7720. this._userData = {};
  7721. this._totalCount = -1;
  7722. this._isLoaded = false;
  7723. if (!__isDefined(this._paginate)) {
  7724. this._paginate = !this.group()
  7725. }
  7726. this._isLastPage = !this._paginate
  7727. },
  7728. dispose: function() {
  7729. this._store.off("push", this._onPushHandler);
  7730. this._disposeEvents();
  7731. clearTimeout(this._aggregationTimeoutId);
  7732. delete this._store;
  7733. if (this._delayedLoadTask) {
  7734. this._delayedLoadTask.abort()
  7735. }
  7736. this._operationManager.cancelAll();
  7737. this._disposed = true
  7738. },
  7739. _extractLoadOptions: function(options) {
  7740. var result = {};
  7741. var names = ["sort", "filter", "select", "group", "requireTotalCount"];
  7742. var customNames = this._store._customLoadOptions();
  7743. if (customNames) {
  7744. names = names.concat(customNames)
  7745. }
  7746. iteratorUtils.each(names, function() {
  7747. result[this] = options[this]
  7748. });
  7749. return result
  7750. },
  7751. loadOptions: function() {
  7752. return this._storeLoadOptions
  7753. },
  7754. items: function() {
  7755. return this._items
  7756. },
  7757. pageIndex: function(newIndex) {
  7758. if (!__isNumber(newIndex)) {
  7759. return this._pageIndex
  7760. }
  7761. this._pageIndex = newIndex;
  7762. this._isLastPage = !this._paginate
  7763. },
  7764. paginate: function(value) {
  7765. if (!__isBoolean(value)) {
  7766. return this._paginate
  7767. }
  7768. if (this._paginate !== value) {
  7769. this._paginate = value;
  7770. this.pageIndex(0)
  7771. }
  7772. },
  7773. pageSize: function(value) {
  7774. if (!__isNumber(value)) {
  7775. return this._pageSize
  7776. }
  7777. this._pageSize = value
  7778. },
  7779. isLastPage: function() {
  7780. return this._isLastPage
  7781. },
  7782. sort: generateStoreLoadOptionAccessor("sort"),
  7783. filter: function() {
  7784. var newFilter = normalizeStoreLoadOptionAccessorArguments(arguments);
  7785. if (void 0 === newFilter) {
  7786. return this._storeLoadOptions.filter
  7787. }
  7788. this._storeLoadOptions.filter = newFilter;
  7789. this.pageIndex(0)
  7790. },
  7791. group: generateStoreLoadOptionAccessor("group"),
  7792. select: generateStoreLoadOptionAccessor("select"),
  7793. requireTotalCount: function(value) {
  7794. if (!__isBoolean(value)) {
  7795. return this._storeLoadOptions.requireTotalCount
  7796. }
  7797. this._storeLoadOptions.requireTotalCount = value
  7798. },
  7799. searchValue: function(value) {
  7800. if (arguments.length < 1) {
  7801. return this._searchValue
  7802. }
  7803. this._searchValue = value;
  7804. this.pageIndex(0)
  7805. },
  7806. searchOperation: function(op) {
  7807. if (!__isString(op)) {
  7808. return this._searchOperation
  7809. }
  7810. this._searchOperation = op;
  7811. this.pageIndex(0)
  7812. },
  7813. searchExpr: function(expr) {
  7814. var argc = arguments.length;
  7815. if (0 === argc) {
  7816. return this._searchExpr
  7817. }
  7818. if (argc > 1) {
  7819. expr = [].slice.call(arguments)
  7820. }
  7821. this._searchExpr = expr;
  7822. this.pageIndex(0)
  7823. },
  7824. store: function() {
  7825. return this._store
  7826. },
  7827. key: function() {
  7828. return this._store && this._store.key()
  7829. },
  7830. totalCount: function() {
  7831. return this._totalCount
  7832. },
  7833. isLoaded: function() {
  7834. return this._isLoaded
  7835. },
  7836. isLoading: function() {
  7837. return this._loadingCount > 0
  7838. },
  7839. beginLoading: function() {
  7840. this._changeLoadingCount(1)
  7841. },
  7842. endLoading: function() {
  7843. this._changeLoadingCount(-1)
  7844. },
  7845. _createLoadQueue: function() {
  7846. return queue.create()
  7847. },
  7848. _changeLoadingCount: function(increment) {
  7849. var oldLoading = this.isLoading();
  7850. this._loadingCount += increment;
  7851. var newLoading = this.isLoading();
  7852. if (oldLoading ^ newLoading) {
  7853. this.fireEvent("loadingChanged", [newLoading])
  7854. }
  7855. },
  7856. _scheduleLoadCallbacks: function(deferred) {
  7857. var that = this;
  7858. that.beginLoading();
  7859. deferred.always(function() {
  7860. that.endLoading()
  7861. })
  7862. },
  7863. _scheduleFailCallbacks: function(deferred) {
  7864. var that = this;
  7865. deferred.fail(function() {
  7866. if (arguments[0] === CANCELED_TOKEN) {
  7867. return
  7868. }
  7869. that.fireEvent("loadError", arguments)
  7870. })
  7871. },
  7872. _fireChanged: function(args) {
  7873. var date = new Date;
  7874. this.fireEvent("changed", args);
  7875. this._changedTime = new Date - date
  7876. },
  7877. _scheduleChangedCallbacks: function(deferred) {
  7878. var _this2 = this;
  7879. deferred.done(function() {
  7880. _this2._fireChanged()
  7881. })
  7882. },
  7883. loadSingle: function(propName, propValue) {
  7884. var that = this;
  7885. var d = new Deferred;
  7886. var key = this.key();
  7887. var store = this._store;
  7888. var options = this._createStoreLoadOptions();
  7889. var handleDone = function(data) {
  7890. if (!__isDefined(data) || array.isEmpty(data)) {
  7891. d.reject(new errors.Error("E4009"))
  7892. } else {
  7893. if (!Array.isArray(data)) {
  7894. data = [data]
  7895. }
  7896. d.resolve(that._applyMapFunction(data)[0])
  7897. }
  7898. };
  7899. this._scheduleFailCallbacks(d);
  7900. if (arguments.length < 2) {
  7901. propValue = propName;
  7902. propName = key
  7903. }
  7904. delete options.skip;
  7905. delete options.group;
  7906. delete options.refresh;
  7907. delete options.pageIndex;
  7908. delete options.searchString;
  7909. function shouldForceByKey() {
  7910. return store instanceof CustomStore && !store._byKeyViaLoad()
  7911. }(function() {
  7912. if (propName === key || shouldForceByKey()) {
  7913. return store.byKey(propValue, options)
  7914. }
  7915. options.take = 1;
  7916. options.filter = options.filter ? [options.filter, [propName, propValue]] : [propName, propValue];
  7917. return store.load(options)
  7918. })().fail(d.reject).done(handleDone);
  7919. return d.promise()
  7920. },
  7921. load: function() {
  7922. var that = this;
  7923. var d = new Deferred;
  7924. function loadTask() {
  7925. if (that._disposed) {
  7926. return
  7927. }
  7928. if (!isPending(d)) {
  7929. return
  7930. }
  7931. return that._loadFromStore(loadOperation, d)
  7932. }
  7933. this._scheduleLoadCallbacks(d);
  7934. this._scheduleFailCallbacks(d);
  7935. this._scheduleChangedCallbacks(d);
  7936. var loadOperation = this._createLoadOperation(d);
  7937. this.fireEvent("customizeStoreLoadOptions", [loadOperation]);
  7938. this._loadQueue.add(function() {
  7939. if ("number" === typeof loadOperation.delay) {
  7940. that._delayedLoadTask = commonUtils.executeAsync(loadTask, loadOperation.delay)
  7941. } else {
  7942. loadTask()
  7943. }
  7944. return d.promise()
  7945. });
  7946. return d.promise({
  7947. operationId: loadOperation.operationId
  7948. })
  7949. },
  7950. _onPush: function(changes) {
  7951. var _this3 = this;
  7952. if (this._reshapeOnPush) {
  7953. this.load()
  7954. } else {
  7955. this.fireEvent("changing", [{
  7956. changes: changes
  7957. }]);
  7958. var group = this.group();
  7959. var items = this.items();
  7960. var groupLevel = 0;
  7961. var dataSourceChanges = this.paginate() || group ? changes.filter(function(item) {
  7962. return "update" === item.type
  7963. }) : changes;
  7964. if (group) {
  7965. groupLevel = Array.isArray(group) ? group.length : 1
  7966. }
  7967. if (this._mapFunc) {
  7968. dataSourceChanges.forEach(function(item) {
  7969. if ("insert" === item.type) {
  7970. item.data = _this3._mapFunc(item.data)
  7971. }
  7972. })
  7973. }
  7974. arrayUtils.applyBatch(this.store(), items, dataSourceChanges, groupLevel, true);
  7975. this._fireChanged([{
  7976. changes: changes
  7977. }])
  7978. }
  7979. },
  7980. _createLoadOperation: function(deferred) {
  7981. var id = this._operationManager.add(deferred);
  7982. var options = this._createStoreLoadOptions();
  7983. deferred.always(function() {
  7984. this._operationManager.remove(id)
  7985. }.bind(this));
  7986. return {
  7987. operationId: id,
  7988. storeLoadOptions: options
  7989. }
  7990. },
  7991. reload: function() {
  7992. var store = this.store();
  7993. if (store instanceof CustomStore) {
  7994. store.clearRawDataCache()
  7995. }
  7996. this._init();
  7997. return this.load()
  7998. },
  7999. cancel: function(operationId) {
  8000. return this._operationManager.cancel(operationId)
  8001. },
  8002. cancelAll: function() {
  8003. return this._operationManager.cancelAll()
  8004. },
  8005. _addSearchOptions: function(storeLoadOptions) {
  8006. if (this._disposed) {
  8007. return
  8008. }
  8009. if (this.store()._useDefaultSearch) {
  8010. this._addSearchFilter(storeLoadOptions)
  8011. } else {
  8012. storeLoadOptions.searchOperation = this._searchOperation;
  8013. storeLoadOptions.searchValue = this._searchValue;
  8014. storeLoadOptions.searchExpr = this._searchExpr
  8015. }
  8016. },
  8017. _createStoreLoadOptions: function() {
  8018. var result = extend({}, this._storeLoadOptions);
  8019. this._addSearchOptions(result);
  8020. if (this._paginate) {
  8021. if (this._pageSize) {
  8022. result.skip = this._pageIndex * this._pageSize;
  8023. result.take = this._pageSize
  8024. }
  8025. }
  8026. result.userData = this._userData;
  8027. return result
  8028. },
  8029. _addSearchFilter: function(storeLoadOptions) {
  8030. var value = this._searchValue;
  8031. var op = this._searchOperation;
  8032. var selector = this._searchExpr;
  8033. var searchFilter = [];
  8034. if (!value) {
  8035. return
  8036. }
  8037. if (!selector) {
  8038. selector = "this"
  8039. }
  8040. if (!Array.isArray(selector)) {
  8041. selector = [selector]
  8042. }
  8043. iteratorUtils.each(selector, function(i, item) {
  8044. if (searchFilter.length) {
  8045. searchFilter.push("or")
  8046. }
  8047. searchFilter.push([item, op, value])
  8048. });
  8049. if (storeLoadOptions.filter) {
  8050. storeLoadOptions.filter = [searchFilter, storeLoadOptions.filter]
  8051. } else {
  8052. storeLoadOptions.filter = searchFilter
  8053. }
  8054. },
  8055. _loadFromStore: function(loadOptions, pendingDeferred) {
  8056. var that = this;
  8057. function handleSuccess(data, extra) {
  8058. function processResult() {
  8059. var loadResult = extend(normalizeLoadResult(data, extra), loadOptions);
  8060. that.fireEvent("customizeLoadResult", [loadResult]);
  8061. when(loadResult.data).done(function(data) {
  8062. loadResult.data = data;
  8063. that._processStoreLoadResult(loadResult, pendingDeferred)
  8064. }).fail(pendingDeferred.reject)
  8065. }
  8066. if (that._disposed) {
  8067. return
  8068. }
  8069. if (!isPending(pendingDeferred)) {
  8070. return
  8071. }
  8072. processResult()
  8073. }
  8074. if (loadOptions.data) {
  8075. return (new Deferred).resolve(loadOptions.data).done(handleSuccess)
  8076. }
  8077. return this.store().load(loadOptions.storeLoadOptions).done(handleSuccess).fail(pendingDeferred.reject)
  8078. },
  8079. _processStoreLoadResult: function(loadResult, pendingDeferred) {
  8080. var that = this;
  8081. var data = loadResult.data;
  8082. var extra = loadResult.extra;
  8083. var storeLoadOptions = loadResult.storeLoadOptions;
  8084. function resolvePendingDeferred() {
  8085. that._isLoaded = true;
  8086. that._totalCount = isFinite(extra.totalCount) ? extra.totalCount : -1;
  8087. return pendingDeferred.resolve(data, extra)
  8088. }
  8089. function proceedLoadingTotalCount() {
  8090. that.store().totalCount(storeLoadOptions).done(function(count) {
  8091. extra.totalCount = count;
  8092. resolvePendingDeferred()
  8093. }).fail(pendingDeferred.reject)
  8094. }
  8095. if (that._disposed) {
  8096. return
  8097. }
  8098. data = that._applyPostProcessFunction(that._applyMapFunction(data));
  8099. if (!typeUtils.isPlainObject(extra)) {
  8100. extra = {}
  8101. }
  8102. that._items = data;
  8103. if (!data.length || !that._paginate || that._pageSize && data.length < that._pageSize) {
  8104. that._isLastPage = true
  8105. }
  8106. if (storeLoadOptions.requireTotalCount && !isFinite(extra.totalCount)) {
  8107. proceedLoadingTotalCount()
  8108. } else {
  8109. resolvePendingDeferred()
  8110. }
  8111. },
  8112. _applyMapFunction: function(data) {
  8113. if (this._mapFunc) {
  8114. return mapDataRespectingGrouping(data, this._mapFunc, this.group())
  8115. }
  8116. return data
  8117. },
  8118. _applyPostProcessFunction: function(data) {
  8119. if (this._postProcessFunc) {
  8120. return this._postProcessFunc(data)
  8121. }
  8122. return data
  8123. }
  8124. }).include(EventsMixin);
  8125. exports.DataSource = DataSource;
  8126. exports.normalizeDataSourceOptions = normalizeDataSourceOptions;
  8127. exports.normalizeLoadResult = normalizeLoadResult
  8128. }, ,
  8129. /*!***************************************************!*\
  8130. !*** ./artifacts/transpiled/core/utils/object.js ***!
  8131. \***************************************************/
  8132. /*! dynamic exports provided */
  8133. /*! all exports used */
  8134. function(module, exports, __webpack_require__) {
  8135. var typeUtils = __webpack_require__( /*! ./type */ 1);
  8136. var variableWrapper = __webpack_require__( /*! ./variable_wrapper */ 86);
  8137. var clone = function() {
  8138. function Clone() {}
  8139. return function(obj) {
  8140. Clone.prototype = obj;
  8141. return new Clone
  8142. }
  8143. }();
  8144. var orderEach = function(map, func) {
  8145. var keys = [];
  8146. var key;
  8147. var i;
  8148. for (key in map) {
  8149. if (Object.prototype.hasOwnProperty.call(map, key)) {
  8150. keys.push(key)
  8151. }
  8152. }
  8153. keys.sort(function(x, y) {
  8154. var isNumberX = typeUtils.isNumeric(x);
  8155. var isNumberY = typeUtils.isNumeric(y);
  8156. if (isNumberX && isNumberY) {
  8157. return x - y
  8158. }
  8159. if (isNumberX && !isNumberY) {
  8160. return -1
  8161. }
  8162. if (!isNumberX && isNumberY) {
  8163. return 1
  8164. }
  8165. if (x < y) {
  8166. return -1
  8167. }
  8168. if (x > y) {
  8169. return 1
  8170. }
  8171. return 0
  8172. });
  8173. for (i = 0; i < keys.length; i++) {
  8174. key = keys[i];
  8175. func(key, map[key])
  8176. }
  8177. };
  8178. var assignValueToProperty = function(target, property, value, assignByReference) {
  8179. if (!assignByReference && variableWrapper.isWrapped(target[property])) {
  8180. variableWrapper.assign(target[property], value)
  8181. } else {
  8182. target[property] = value
  8183. }
  8184. };
  8185. var deepExtendArraySafe = function deepExtendArraySafe(target, changes, extendComplexObject, assignByReference) {
  8186. var prevValue;
  8187. var newValue;
  8188. for (var name in changes) {
  8189. prevValue = target[name];
  8190. newValue = changes[name];
  8191. if ("__proto__" === name || target === newValue) {
  8192. continue
  8193. }
  8194. if (typeUtils.isPlainObject(newValue)) {
  8195. var goDeeper = extendComplexObject ? typeUtils.isObject(prevValue) : typeUtils.isPlainObject(prevValue);
  8196. newValue = deepExtendArraySafe(goDeeper ? prevValue : {}, newValue, extendComplexObject, assignByReference)
  8197. }
  8198. if (void 0 !== newValue && prevValue !== newValue) {
  8199. assignValueToProperty(target, name, newValue, assignByReference)
  8200. }
  8201. }
  8202. return target
  8203. };
  8204. exports.clone = clone;
  8205. exports.orderEach = orderEach;
  8206. exports.deepExtendArraySafe = deepExtendArraySafe
  8207. },
  8208. /*!************************************************************!*\
  8209. !*** ./artifacts/transpiled/core/utils/ready_callbacks.js ***!
  8210. \************************************************************/
  8211. /*! dynamic exports provided */
  8212. /*! all exports used */
  8213. function(module, exports, __webpack_require__) {
  8214. var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11);
  8215. var injector = __webpack_require__( /*! ./dependency_injector */ 54);
  8216. var windowUtils = __webpack_require__( /*! ./window */ 7);
  8217. var callOnce = __webpack_require__( /*! ./call_once */ 63);
  8218. var callbacks = [];
  8219. var isReady = function() {
  8220. return "complete" === domAdapter.getReadyState() || "loading" !== domAdapter.getReadyState() && !domAdapter.getDocumentElement().doScroll
  8221. };
  8222. var subscribeReady = callOnce(function() {
  8223. var removeListener = domAdapter.listen(domAdapter.getDocument(), "DOMContentLoaded", function() {
  8224. readyCallbacks.fire();
  8225. removeListener()
  8226. })
  8227. });
  8228. var readyCallbacks = {
  8229. add: function(callback) {
  8230. var hasWindow = windowUtils.hasWindow();
  8231. if (hasWindow && isReady()) {
  8232. callback()
  8233. } else {
  8234. callbacks.push(callback);
  8235. hasWindow && subscribeReady()
  8236. }
  8237. },
  8238. fire: function() {
  8239. callbacks.forEach(function(callback) {
  8240. return callback()
  8241. });
  8242. callbacks = []
  8243. }
  8244. };
  8245. module.exports = injector(readyCallbacks)
  8246. },
  8247. /*!**************************************************!*\
  8248. !*** ./artifacts/transpiled/ui/editor/editor.js ***!
  8249. \**************************************************/
  8250. /*! dynamic exports provided */
  8251. /*! all exports used */
  8252. function(module, exports, __webpack_require__) {
  8253. var _string = __webpack_require__( /*! ../../core/utils/string */ 44);
  8254. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  8255. var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39);
  8256. var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
  8257. var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
  8258. var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
  8259. var Guid = __webpack_require__( /*! ../../core/guid */ 40);
  8260. var getDefaultAlignment = __webpack_require__( /*! ../../core/utils/position */ 97).getDefaultAlignment;
  8261. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  8262. var Widget = __webpack_require__( /*! ../widget/ui.widget */ 18);
  8263. var ValidationMixin = __webpack_require__( /*! ../validation/validation_mixin */ 172);
  8264. var Overlay = __webpack_require__( /*! ../overlay */ 59);
  8265. var EventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  8266. var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
  8267. var READONLY_STATE_CLASS = "dx-state-readonly";
  8268. var INVALID_CLASS = "dx-invalid";
  8269. var INVALID_MESSAGE = "dx-invalid-message";
  8270. var INVALID_MESSAGE_CONTENT = "dx-invalid-message-content";
  8271. var INVALID_MESSAGE_AUTO = "dx-invalid-message-auto";
  8272. var INVALID_MESSAGE_ALWAYS = "dx-invalid-message-always";
  8273. var VALIDATION_TARGET = "dx-validation-target";
  8274. var VALIDATION_MESSAGE_MIN_WIDTH = 100;
  8275. var READONLY_NAMESPACE = "editorReadOnly";
  8276. var Editor = Widget.inherit({
  8277. ctor: function() {
  8278. this.showValidationMessageTimeout = null;
  8279. this.validationRequest = Callbacks();
  8280. this.callBase.apply(this, arguments);
  8281. var $element = this.$element();
  8282. if ($element) {
  8283. dataUtils.data($element[0], VALIDATION_TARGET, this)
  8284. }
  8285. },
  8286. _init: function() {
  8287. this.callBase();
  8288. this._initInnerOptionCache("validationTooltipOptions")
  8289. },
  8290. _getDefaultOptions: function() {
  8291. return extend(this.callBase(), {
  8292. value: null,
  8293. name: "",
  8294. onValueChanged: null,
  8295. readOnly: false,
  8296. isValid: true,
  8297. validationError: null,
  8298. validationMessageMode: "auto",
  8299. validationBoundary: void 0,
  8300. validationMessageOffset: {
  8301. h: 0,
  8302. v: 0
  8303. },
  8304. validationTooltipOptions: {}
  8305. })
  8306. },
  8307. _attachKeyboardEvents: function() {
  8308. if (this.option("readOnly")) {
  8309. return
  8310. }
  8311. this.callBase();
  8312. if (this._keyboardProcessor) {
  8313. this._attachChildKeyboardEvents()
  8314. }
  8315. },
  8316. _attachChildKeyboardEvents: commonUtils.noop,
  8317. _setOptionsByReference: function() {
  8318. this.callBase();
  8319. extend(this._optionsByReference, {
  8320. validationError: true
  8321. })
  8322. },
  8323. _createValueChangeAction: function() {
  8324. this._valueChangeAction = this._createActionByOption("onValueChanged", {
  8325. excludeValidators: ["disabled", "readOnly"]
  8326. })
  8327. },
  8328. _suppressValueChangeAction: function() {
  8329. this._valueChangeActionSuppressed = true
  8330. },
  8331. _resumeValueChangeAction: function() {
  8332. this._valueChangeActionSuppressed = false
  8333. },
  8334. _initMarkup: function() {
  8335. this._toggleReadOnlyState();
  8336. this._setSubmitElementName(this.option("name"));
  8337. this.callBase();
  8338. this._renderValidationState()
  8339. },
  8340. _raiseValueChangeAction: function(value, previousValue) {
  8341. if (!this._valueChangeAction) {
  8342. this._createValueChangeAction()
  8343. }
  8344. this._valueChangeAction(this._valueChangeArgs(value, previousValue))
  8345. },
  8346. _valueChangeArgs: function(value, previousValue) {
  8347. return {
  8348. value: value,
  8349. previousValue: previousValue,
  8350. event: this._valueChangeEventInstance
  8351. }
  8352. },
  8353. _saveValueChangeEvent: function(e) {
  8354. this._valueChangeEventInstance = e
  8355. },
  8356. _focusInHandler: function(e) {
  8357. var _this = this;
  8358. var isValidationMessageShownOnFocus = "auto" === this.option("validationMessageMode");
  8359. if (this._canValueBeChangedByClick() && isValidationMessageShownOnFocus) {
  8360. this._$validationMessage && this._$validationMessage.removeClass(INVALID_MESSAGE_AUTO);
  8361. clearTimeout(this.showValidationMessageTimeout);
  8362. this.showValidationMessageTimeout = setTimeout(function() {
  8363. return _this._$validationMessage && _this._$validationMessage.addClass(INVALID_MESSAGE_AUTO)
  8364. }, 150)
  8365. }
  8366. return this.callBase(e)
  8367. },
  8368. _canValueBeChangedByClick: function() {
  8369. return false
  8370. },
  8371. _renderValidationState: function() {
  8372. var isValid = this.option("isValid");
  8373. var validationError = this.option("validationError");
  8374. var validationMessageMode = this.option("validationMessageMode");
  8375. var $element = this.$element();
  8376. $element.toggleClass(INVALID_CLASS, !isValid);
  8377. this.setAria("invalid", !isValid || void 0);
  8378. if (!windowUtils.hasWindow()) {
  8379. return
  8380. }
  8381. if (this._$validationMessage) {
  8382. this._$validationMessage.remove();
  8383. this.setAria("describedby", null);
  8384. this._$validationMessage = null
  8385. }
  8386. if (!isValid && validationError && validationError.message) {
  8387. this._$validationMessage = $("<div>").addClass(INVALID_MESSAGE).html((0, _string.encodeHtml)(validationError.message)).appendTo($element);
  8388. var validationTarget = this._getValidationMessageTarget();
  8389. this._validationMessage = this._createComponent(this._$validationMessage, Overlay, extend({
  8390. integrationOptions: {},
  8391. templatesRenderAsynchronously: false,
  8392. target: validationTarget,
  8393. shading: false,
  8394. width: "auto",
  8395. height: "auto",
  8396. container: $element,
  8397. position: this._getValidationMessagePosition("below"),
  8398. closeOnOutsideClick: false,
  8399. closeOnTargetScroll: false,
  8400. animation: null,
  8401. visible: true,
  8402. propagateOutsideClick: true,
  8403. _checkParentVisibility: false
  8404. }, this._getInnerOptionsCache("validationTooltipOptions")));
  8405. this._$validationMessage.toggleClass(INVALID_MESSAGE_AUTO, "auto" === validationMessageMode).toggleClass(INVALID_MESSAGE_ALWAYS, "always" === validationMessageMode);
  8406. var messageId = "dx-" + new Guid;
  8407. this._validationMessage.$content().addClass(INVALID_MESSAGE_CONTENT).attr("id", messageId);
  8408. this.setAria("describedby", messageId);
  8409. this._setValidationMessageMaxWidth();
  8410. this._bindInnerWidgetOptions(this._validationMessage, "validationTooltipOptions")
  8411. }
  8412. },
  8413. _setValidationMessageMaxWidth: function() {
  8414. if (!this._validationMessage) {
  8415. return
  8416. }
  8417. if (0 === this._getValidationMessageTarget().outerWidth()) {
  8418. this._validationMessage.option("maxWidth", "100%");
  8419. return
  8420. }
  8421. var validationMessageMaxWidth = Math.max(VALIDATION_MESSAGE_MIN_WIDTH, this._getValidationMessageTarget().outerWidth());
  8422. this._validationMessage.option("maxWidth", validationMessageMaxWidth)
  8423. },
  8424. _getValidationMessageTarget: function() {
  8425. return this.$element()
  8426. },
  8427. _getValidationMessagePosition: function(positionRequest) {
  8428. var rtlEnabled = this.option("rtlEnabled");
  8429. var messagePositionSide = getDefaultAlignment(rtlEnabled);
  8430. var messageOriginalOffset = this.option("validationMessageOffset");
  8431. var messageOffset = {
  8432. h: messageOriginalOffset.h,
  8433. v: messageOriginalOffset.v
  8434. };
  8435. var verticalPositions = "below" === positionRequest ? [" top", " bottom"] : [" bottom", " top"];
  8436. if (rtlEnabled) {
  8437. messageOffset.h = -messageOffset.h
  8438. }
  8439. if ("below" !== positionRequest) {
  8440. messageOffset.v = -messageOffset.v
  8441. }
  8442. return {
  8443. offset: messageOffset,
  8444. boundary: this.option("validationBoundary"),
  8445. my: messagePositionSide + verticalPositions[0],
  8446. at: messagePositionSide + verticalPositions[1],
  8447. collision: "none flip"
  8448. }
  8449. },
  8450. _toggleReadOnlyState: function() {
  8451. var readOnly = this.option("readOnly");
  8452. this._toggleBackspaceHandler(readOnly);
  8453. this.$element().toggleClass(READONLY_STATE_CLASS, !!readOnly);
  8454. this.setAria("readonly", readOnly || void 0)
  8455. },
  8456. _toggleBackspaceHandler: function(isReadOnly) {
  8457. var $eventTarget = this._keyboardEventBindingTarget();
  8458. var eventName = eventUtils.addNamespace("keydown", READONLY_NAMESPACE);
  8459. EventsEngine.off($eventTarget, eventName);
  8460. if (isReadOnly) {
  8461. EventsEngine.on($eventTarget, eventName, function(e) {
  8462. if ("backspace" === eventUtils.normalizeKeyName(e)) {
  8463. e.preventDefault()
  8464. }
  8465. })
  8466. }
  8467. },
  8468. _dispose: function() {
  8469. var element = this.$element()[0];
  8470. dataUtils.data(element, VALIDATION_TARGET, null);
  8471. clearTimeout(this.showValidationMessageTimeout);
  8472. this.callBase()
  8473. },
  8474. _setSubmitElementName: function(name) {
  8475. var $submitElement = this._getSubmitElement();
  8476. if (!$submitElement) {
  8477. return
  8478. }
  8479. if (name.length > 0) {
  8480. $submitElement.attr("name", name)
  8481. } else {
  8482. $submitElement.removeAttr("name")
  8483. }
  8484. },
  8485. _getSubmitElement: function() {
  8486. return null
  8487. },
  8488. _optionChanged: function(args) {
  8489. switch (args.name) {
  8490. case "onValueChanged":
  8491. this._createValueChangeAction();
  8492. break;
  8493. case "isValid":
  8494. case "validationError":
  8495. case "validationBoundary":
  8496. case "validationMessageMode":
  8497. this._renderValidationState();
  8498. break;
  8499. case "validationTooltipOptions":
  8500. this._innerOptionChanged(this._validationMessage, args);
  8501. break;
  8502. case "readOnly":
  8503. this._toggleReadOnlyState();
  8504. this._refreshFocusState();
  8505. break;
  8506. case "value":
  8507. if (args.value != args.previousValue) {
  8508. this.validationRequest.fire({
  8509. value: args.value,
  8510. editor: this
  8511. })
  8512. }
  8513. if (!this._valueChangeActionSuppressed) {
  8514. this._raiseValueChangeAction(args.value, args.previousValue);
  8515. this._saveValueChangeEvent(void 0)
  8516. }
  8517. break;
  8518. case "width":
  8519. this.callBase(args);
  8520. this._setValidationMessageMaxWidth();
  8521. break;
  8522. case "name":
  8523. this._setSubmitElementName(args.value);
  8524. break;
  8525. default:
  8526. this.callBase(args)
  8527. }
  8528. },
  8529. reset: function() {
  8530. var defaultOptions = this._getDefaultOptions();
  8531. this.option("value", defaultOptions.value)
  8532. }
  8533. }).include(ValidationMixin);
  8534. module.exports = Editor
  8535. },
  8536. /*!********************************************!*\
  8537. !*** ./artifacts/transpiled/viz/themes.js ***!
  8538. \********************************************/
  8539. /*! dynamic exports provided */
  8540. /*! all exports used */
  8541. function(module, exports, __webpack_require__) {
  8542. var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
  8543. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  8544. var vizUtils = __webpack_require__( /*! ./core/utils */ 10);
  8545. var uiThemes = __webpack_require__( /*! ../ui/themes */ 30);
  8546. var themes = {};
  8547. var themesMapping = {};
  8548. var themesSchemeMapping = {};
  8549. var _extend = extend;
  8550. var _each = each;
  8551. var _normalizeEnum = vizUtils.normalizeEnum;
  8552. var currentThemeName = null;
  8553. var defaultTheme;
  8554. var nextCacheUid = 0;
  8555. var widgetsCache = {};
  8556. function getTheme(themeName) {
  8557. var name = _normalizeEnum(themeName);
  8558. return themes[name] || themes[themesMapping[name] || currentTheme()]
  8559. }
  8560. function findThemeNameByName(name, scheme) {
  8561. return themesMapping[name + "." + scheme] || themesSchemeMapping[name + "." + scheme] || themesMapping[name]
  8562. }
  8563. function findThemeNameByPlatform(platform, version, scheme) {
  8564. return findThemeNameByName(platform + version, scheme) || findThemeNameByName(platform, scheme)
  8565. }
  8566. function currentTheme(themeName, colorScheme) {
  8567. if (!arguments.length) {
  8568. return currentThemeName || findThemeNameByName(uiThemes.current()) || defaultTheme
  8569. }
  8570. var scheme = _normalizeEnum(colorScheme);
  8571. currentThemeName = (themeName && themeName.platform ? findThemeNameByPlatform(_normalizeEnum(themeName.platform), themeName.version, scheme) : findThemeNameByName(_normalizeEnum(themeName), scheme)) || currentThemeName;
  8572. return this
  8573. }
  8574. function getThemeInfo(themeName, splitter) {
  8575. var k = themeName.indexOf(splitter);
  8576. return k > 0 ? {
  8577. name: themeName.substring(0, k),
  8578. scheme: themeName.substring(k + 1)
  8579. } : null
  8580. }
  8581. function registerThemeName(themeName, targetThemeName) {
  8582. var themeInfo = getThemeInfo(themeName, ".") || {
  8583. name: themeName
  8584. };
  8585. var name = themeInfo.name;
  8586. var scheme = themeInfo.scheme;
  8587. if (scheme) {
  8588. themesMapping[name] = themesMapping[name] || targetThemeName;
  8589. themesMapping[name + "." + scheme] = targetThemeName
  8590. } else {
  8591. themesMapping[name] = targetThemeName
  8592. }
  8593. }
  8594. function registerTheme(theme, baseThemeName) {
  8595. var themeName = _normalizeEnum(theme && theme.name);
  8596. if (themeName) {
  8597. theme.isDefault && (defaultTheme = themeName);
  8598. registerThemeName(themeName, themeName);
  8599. themes[themeName] = _extend(true, {}, getTheme(baseThemeName), patchTheme(theme))
  8600. }
  8601. }
  8602. function registerThemeAlias(alias, theme) {
  8603. registerThemeName(_normalizeEnum(alias), _normalizeEnum(theme))
  8604. }
  8605. function registerThemeSchemeAlias(from, to) {
  8606. themesSchemeMapping[from] = to
  8607. }
  8608. function mergeScalar(target, field, source, sourceValue) {
  8609. var _value = source ? source[field] : sourceValue;
  8610. if (void 0 !== _value && void 0 === target[field]) {
  8611. target[field] = _value
  8612. }
  8613. }
  8614. function mergeObject(target, field, source, sourceValue) {
  8615. var _value = source ? source[field] : sourceValue;
  8616. if (void 0 !== _value) {
  8617. target[field] = _extend(true, {}, _value, target[field])
  8618. }
  8619. }
  8620. function patchTheme(theme) {
  8621. theme = _extend(true, {
  8622. loadingIndicator: {
  8623. font: {}
  8624. },
  8625. "export": {
  8626. font: {}
  8627. },
  8628. legend: {
  8629. font: {},
  8630. border: {}
  8631. },
  8632. title: {
  8633. font: {}
  8634. },
  8635. tooltip: {
  8636. font: {}
  8637. },
  8638. "chart:common": {},
  8639. "chart:common:axis": {
  8640. grid: {},
  8641. minorGrid: {},
  8642. tick: {},
  8643. minorTick: {},
  8644. title: {
  8645. font: {}
  8646. },
  8647. label: {
  8648. font: {}
  8649. }
  8650. },
  8651. chart: {
  8652. commonSeriesSettings: {
  8653. candlestick: {}
  8654. }
  8655. },
  8656. pie: {},
  8657. polar: {},
  8658. gauge: {
  8659. scale: {
  8660. tick: {},
  8661. minorTick: {},
  8662. label: {
  8663. font: {}
  8664. }
  8665. }
  8666. },
  8667. barGauge: {},
  8668. funnel: {},
  8669. sankey: {},
  8670. map: {
  8671. background: {}
  8672. },
  8673. treeMap: {
  8674. tile: {
  8675. selectionStyle: {
  8676. border: {}
  8677. }
  8678. },
  8679. group: {
  8680. border: {},
  8681. selectionStyle: {
  8682. border: {}
  8683. },
  8684. label: {
  8685. font: {}
  8686. }
  8687. }
  8688. },
  8689. rangeSelector: {
  8690. scale: {
  8691. tick: {},
  8692. minorTick: {},
  8693. label: {
  8694. font: {}
  8695. }
  8696. },
  8697. chart: {}
  8698. },
  8699. sparkline: {},
  8700. bullet: {}
  8701. }, theme);
  8702. mergeScalar(theme.loadingIndicator, "backgroundColor", theme);
  8703. mergeScalar(theme.chart.commonSeriesSettings.candlestick, "innerColor", null, theme.backgroundColor);
  8704. mergeScalar(theme.map.background, "color", null, theme.backgroundColor);
  8705. mergeScalar(theme.title.font, "color", null, theme.primaryTitleColor);
  8706. mergeObject(theme.title, "subtitle", null, theme.title);
  8707. mergeScalar(theme.legend.font, "color", null, theme.secondaryTitleColor);
  8708. mergeScalar(theme.legend.border, "color", null, theme.gridColor);
  8709. patchAxes(theme);
  8710. _each(["chart", "pie", "polar", "gauge", "barGauge", "map", "treeMap", "funnel", "rangeSelector", "sparkline", "bullet", "sankey"], function(_, section) {
  8711. mergeScalar(theme[section], "redrawOnResize", theme);
  8712. mergeScalar(theme[section], "containerBackgroundColor", null, theme.backgroundColor);
  8713. mergeObject(theme[section], "tooltip", theme);
  8714. mergeObject(theme[section], "export", theme)
  8715. });
  8716. _each(["chart", "pie", "polar", "gauge", "barGauge", "map", "treeMap", "funnel", "rangeSelector", "sankey"], function(_, section) {
  8717. mergeObject(theme[section], "loadingIndicator", theme);
  8718. mergeObject(theme[section], "legend", theme);
  8719. mergeObject(theme[section], "title", theme)
  8720. });
  8721. _each(["chart", "pie", "polar"], function(_, section) {
  8722. mergeObject(theme, section, null, theme["chart:common"])
  8723. });
  8724. _each(["chart", "polar"], function(_, section) {
  8725. theme[section] = theme[section] || {};
  8726. mergeObject(theme[section], "commonAxisSettings", null, theme["chart:common:axis"])
  8727. });
  8728. mergeObject(theme.rangeSelector.chart, "commonSeriesSettings", theme.chart);
  8729. mergeObject(theme.rangeSelector.chart, "dataPrepareSettings", theme.chart);
  8730. mergeScalar(theme.treeMap.group.border, "color", null, theme.gridColor);
  8731. mergeScalar(theme.treeMap.tile.selectionStyle.border, "color", null, theme.primaryTitleColor);
  8732. mergeScalar(theme.treeMap.group.selectionStyle.border, "color", null, theme.primaryTitleColor);
  8733. mergeScalar(theme.map.legend, "backgroundColor", theme);
  8734. patchMapLayers(theme);
  8735. return theme
  8736. }
  8737. function patchAxes(theme) {
  8738. var commonAxisSettings = theme["chart:common:axis"];
  8739. var colorFieldName = "color";
  8740. _each([commonAxisSettings.grid, commonAxisSettings.minorGrid], function(_, obj) {
  8741. mergeScalar(obj, colorFieldName, null, theme.gridColor)
  8742. });
  8743. _each([commonAxisSettings, commonAxisSettings.tick, commonAxisSettings.minorTick, commonAxisSettings.label.font], function(_, obj) {
  8744. mergeScalar(obj, colorFieldName, null, theme.axisColor)
  8745. });
  8746. mergeScalar(commonAxisSettings.title.font, colorFieldName, null, theme.secondaryTitleColor);
  8747. mergeScalar(theme.gauge.scale.label.font, colorFieldName, null, theme.axisColor);
  8748. mergeScalar(theme.gauge.scale.tick, colorFieldName, null, theme.backgroundColor);
  8749. mergeScalar(theme.gauge.scale.minorTick, colorFieldName, null, theme.backgroundColor);
  8750. mergeScalar(theme.rangeSelector.scale.label.font, colorFieldName, null, theme.axisColor)
  8751. }
  8752. function patchMapLayers(theme) {
  8753. var map = theme.map;
  8754. _each(["area", "line", "marker"], function(_, section) {
  8755. mergeObject(map, "layer:" + section, null, map.layer)
  8756. });
  8757. _each(["dot", "bubble", "pie", "image"], function(_, section) {
  8758. mergeObject(map, "layer:marker:" + section, null, map["layer:marker"])
  8759. })
  8760. }
  8761. function addCacheItem(target) {
  8762. var cacheUid = ++nextCacheUid;
  8763. target._cache = cacheUid;
  8764. widgetsCache[cacheUid] = target
  8765. }
  8766. function removeCacheItem(target) {
  8767. delete widgetsCache[target._cache]
  8768. }
  8769. function refreshTheme() {
  8770. _each(widgetsCache, function() {
  8771. this.refresh()
  8772. });
  8773. return this
  8774. }
  8775. _extend(exports, {
  8776. currentTheme: currentTheme,
  8777. registerTheme: registerTheme,
  8778. getTheme: getTheme,
  8779. registerThemeAlias: registerThemeAlias,
  8780. registerThemeSchemeAlias: registerThemeSchemeAlias,
  8781. refreshTheme: refreshTheme,
  8782. addCacheItem: addCacheItem,
  8783. removeCacheItem: removeCacheItem
  8784. });
  8785. _extend(exports, {
  8786. themes: themes,
  8787. themesMapping: themesMapping,
  8788. themesSchemeMapping: themesSchemeMapping,
  8789. widgetsCache: widgetsCache,
  8790. resetCurrentTheme: function() {
  8791. currentThemeName = null
  8792. }
  8793. })
  8794. },
  8795. /*!*****************************************************!*\
  8796. !*** ./artifacts/transpiled/localization/number.js ***!
  8797. \*****************************************************/
  8798. /*! dynamic exports provided */
  8799. /*! all exports used */
  8800. function(module, exports, __webpack_require__) {
  8801. function _slicedToArray(arr, i) {
  8802. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest()
  8803. }
  8804. function _nonIterableRest() {
  8805. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  8806. }
  8807. function _unsupportedIterableToArray(o, minLen) {
  8808. if (!o) {
  8809. return
  8810. }
  8811. if ("string" === typeof o) {
  8812. return _arrayLikeToArray(o, minLen)
  8813. }
  8814. var n = Object.prototype.toString.call(o).slice(8, -1);
  8815. if ("Object" === n && o.constructor) {
  8816. n = o.constructor.name
  8817. }
  8818. if ("Map" === n || "Set" === n) {
  8819. return Array.from(o)
  8820. }
  8821. if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
  8822. return _arrayLikeToArray(o, minLen)
  8823. }
  8824. }
  8825. function _arrayLikeToArray(arr, len) {
  8826. if (null == len || len > arr.length) {
  8827. len = arr.length
  8828. }
  8829. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  8830. arr2[i] = arr[i]
  8831. }
  8832. return arr2
  8833. }
  8834. function _iterableToArrayLimit(arr, i) {
  8835. var _i = null == arr ? null : "undefined" !== typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  8836. if (null == _i) {
  8837. return
  8838. }
  8839. var _arr = [];
  8840. var _n = true;
  8841. var _d = false;
  8842. var _s, _e;
  8843. try {
  8844. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  8845. _arr.push(_s.value);
  8846. if (i && _arr.length === i) {
  8847. break
  8848. }
  8849. }
  8850. } catch (err) {
  8851. _d = true;
  8852. _e = err
  8853. } finally {
  8854. try {
  8855. if (!_n && null != _i.return) {
  8856. _i.return()
  8857. }
  8858. } finally {
  8859. if (_d) {
  8860. throw _e
  8861. }
  8862. }
  8863. }
  8864. return _arr
  8865. }
  8866. function _arrayWithHoles(arr) {
  8867. if (Array.isArray(arr)) {
  8868. return arr
  8869. }
  8870. }
  8871. var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54);
  8872. var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
  8873. var escapeRegExp = __webpack_require__( /*! ../core/utils/common */ 4).escapeRegExp;
  8874. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  8875. var isPlainObject = __webpack_require__( /*! ../core/utils/type */ 1).isPlainObject;
  8876. var ldmlNumber = __webpack_require__( /*! ./ldml/number */ 278);
  8877. var config = __webpack_require__( /*! ../core/config */ 31);
  8878. var errors = __webpack_require__( /*! ../core/errors */ 21);
  8879. var toFixed = __webpack_require__( /*! ./utils */ 256).toFixed;
  8880. var MAX_LARGE_NUMBER_POWER = 4;
  8881. var DECIMAL_BASE = 10;
  8882. var NUMERIC_FORMATS = ["currency", "fixedpoint", "exponential", "percent", "decimal"];
  8883. var LargeNumberFormatPostfixes = {
  8884. 1: "K",
  8885. 2: "M",
  8886. 3: "B",
  8887. 4: "T"
  8888. };
  8889. var LargeNumberFormatPowers = {
  8890. largenumber: "auto",
  8891. thousands: 1,
  8892. millions: 2,
  8893. billions: 3,
  8894. trillions: 4
  8895. };
  8896. var numberLocalization = dependencyInjector({
  8897. numericFormats: NUMERIC_FORMATS,
  8898. defaultLargeNumberFormatPostfixes: LargeNumberFormatPostfixes,
  8899. _parseNumberFormatString: function(formatType) {
  8900. var formatObject = {};
  8901. if (!formatType || "string" !== typeof formatType) {
  8902. return
  8903. }
  8904. var formatList = formatType.toLowerCase().split(" ");
  8905. each(formatList, function(index, value) {
  8906. if (inArray(value, NUMERIC_FORMATS) > -1) {
  8907. formatObject.formatType = value
  8908. } else {
  8909. if (value in LargeNumberFormatPowers) {
  8910. formatObject.power = LargeNumberFormatPowers[value]
  8911. }
  8912. }
  8913. });
  8914. if (formatObject.power && !formatObject.formatType) {
  8915. formatObject.formatType = "fixedpoint"
  8916. }
  8917. if (formatObject.formatType) {
  8918. return formatObject
  8919. }
  8920. },
  8921. _calculateNumberPower: function(value, base, minPower, maxPower) {
  8922. var number = Math.abs(value);
  8923. var power = 0;
  8924. if (number > 1) {
  8925. while (number && number >= base && (void 0 === maxPower || power < maxPower)) {
  8926. power++;
  8927. number /= base
  8928. }
  8929. } else {
  8930. if (number > 0 && number < 1) {
  8931. while (number < 1 && (void 0 === minPower || power > minPower)) {
  8932. power--;
  8933. number *= base
  8934. }
  8935. }
  8936. }
  8937. return power
  8938. },
  8939. _getNumberByPower: function(number, power, base) {
  8940. var result = number;
  8941. while (power > 0) {
  8942. result /= base;
  8943. power--
  8944. }
  8945. while (power < 0) {
  8946. result *= base;
  8947. power++
  8948. }
  8949. return result
  8950. },
  8951. _formatNumber: function(value, formatObject, formatConfig) {
  8952. var result;
  8953. if ("auto" === formatObject.power) {
  8954. formatObject.power = this._calculateNumberPower(value, 1e3, 0, MAX_LARGE_NUMBER_POWER)
  8955. }
  8956. if (formatObject.power) {
  8957. value = this._getNumberByPower(value, formatObject.power, 1e3)
  8958. }
  8959. var powerPostfix = this.defaultLargeNumberFormatPostfixes[formatObject.power] || "";
  8960. result = this._formatNumberCore(value, formatObject.formatType, formatConfig);
  8961. result = result.replace(/(\d|.$)(\D*)$/, "$1" + powerPostfix + "$2");
  8962. return result
  8963. },
  8964. _formatNumberExponential: function(value, formatConfig) {
  8965. var power = this._calculateNumberPower(value, DECIMAL_BASE);
  8966. var number = this._getNumberByPower(value, power, DECIMAL_BASE);
  8967. if (void 0 === formatConfig.precision) {
  8968. formatConfig.precision = 1
  8969. }
  8970. if (number.toFixed(formatConfig.precision || 0) >= DECIMAL_BASE) {
  8971. power++;
  8972. number /= DECIMAL_BASE
  8973. }
  8974. var powString = (power >= 0 ? "+" : "") + power.toString();
  8975. return this._formatNumberCore(number, "fixedpoint", formatConfig) + "E" + powString
  8976. },
  8977. _addZeroes: function(value, precision) {
  8978. var multiplier = Math.pow(10, precision);
  8979. var sign = value < 0 ? "-" : "";
  8980. value = (Math.abs(value) * multiplier >>> 0) / multiplier;
  8981. var result = value.toString();
  8982. while (result.length < precision) {
  8983. result = "0" + result
  8984. }
  8985. return sign + result
  8986. },
  8987. _addGroupSeparators: function(value) {
  8988. var parts = value.toString().split(".");
  8989. return parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, config().thousandsSeparator) + (parts[1] ? config().decimalSeparator + parts[1] : "")
  8990. },
  8991. _formatNumberCore: function(value, format, formatConfig) {
  8992. if ("exponential" === format) {
  8993. return this._formatNumberExponential(value, formatConfig)
  8994. }
  8995. if ("decimal" !== format && null !== formatConfig.precision) {
  8996. formatConfig.precision = formatConfig.precision || 0
  8997. }
  8998. if ("percent" === format) {
  8999. value = 100 * value
  9000. }
  9001. if (void 0 !== formatConfig.precision) {
  9002. if ("decimal" === format) {
  9003. value = this._addZeroes(value, formatConfig.precision)
  9004. } else {
  9005. value = null === formatConfig.precision ? value.toPrecision() : toFixed(value, formatConfig.precision)
  9006. }
  9007. }
  9008. if ("decimal" !== format) {
  9009. value = this._addGroupSeparators(value)
  9010. } else {
  9011. value = value.toString().replace(".", config().decimalSeparator)
  9012. }
  9013. if ("percent" === format) {
  9014. value += "%"
  9015. }
  9016. return value
  9017. },
  9018. _normalizeFormat: function(format) {
  9019. if (!format) {
  9020. return {}
  9021. }
  9022. if ("function" === typeof format) {
  9023. return format
  9024. }
  9025. if (!isPlainObject(format)) {
  9026. format = {
  9027. type: format
  9028. }
  9029. }
  9030. return format
  9031. },
  9032. _getSeparators: function() {
  9033. return {
  9034. decimalSeparator: this.getDecimalSeparator(),
  9035. thousandsSeparator: this.getThousandsSeparator()
  9036. }
  9037. },
  9038. getThousandsSeparator: function() {
  9039. return this.format(1e4, "fixedPoint")[2]
  9040. },
  9041. getDecimalSeparator: function() {
  9042. return this.format(1.2, {
  9043. type: "fixedPoint",
  9044. precision: 1
  9045. })[1]
  9046. },
  9047. convertDigits: function(value, toStandard) {
  9048. var digits = this.format(90, "decimal");
  9049. if ("string" !== typeof value || "0" === digits[1]) {
  9050. return value
  9051. }
  9052. var fromFirstDigit = toStandard ? digits[1] : "0";
  9053. var toFirstDigit = toStandard ? "0" : digits[1];
  9054. var fromLastDigit = toStandard ? digits[0] : "9";
  9055. var regExp = new RegExp("[" + fromFirstDigit + "-" + fromLastDigit + "]", "g");
  9056. return value.replace(regExp, function(char) {
  9057. return String.fromCharCode(char.charCodeAt(0) + (toFirstDigit.charCodeAt(0) - fromFirstDigit.charCodeAt(0)))
  9058. })
  9059. },
  9060. getSign: function(text, format) {
  9061. if ("-" === text.replace(/[^0-9-]/g, "").charAt(0)) {
  9062. return -1
  9063. }
  9064. if (!format) {
  9065. return 1
  9066. }
  9067. var separators = this._getSeparators();
  9068. var regExp = new RegExp("[0-9" + escapeRegExp(separators.decimalSeparator + separators.thousandsSeparator) + "]+", "g");
  9069. var negativeEtalon = this.format(-1, format).replace(regExp, "1");
  9070. var cleanedText = text.replace(regExp, "1");
  9071. return cleanedText === negativeEtalon ? -1 : 1
  9072. },
  9073. format: function(value, _format) {
  9074. if ("number" !== typeof value) {
  9075. return value
  9076. }
  9077. if ("number" === typeof _format) {
  9078. return value
  9079. }
  9080. _format = _format && _format.formatter || _format;
  9081. if ("function" === typeof _format) {
  9082. return _format(value)
  9083. }
  9084. _format = this._normalizeFormat(_format);
  9085. if (!_format.type) {
  9086. _format.type = "decimal"
  9087. }
  9088. var numberConfig = this._parseNumberFormatString(_format.type);
  9089. if (!numberConfig) {
  9090. return this.convertDigits(ldmlNumber.getFormatter(_format.type, this._getSeparators())(value))
  9091. }
  9092. return this._formatNumber(value, numberConfig, _format)
  9093. },
  9094. parse: function(text, format) {
  9095. if (!text) {
  9096. return
  9097. }
  9098. if (format && format.parser) {
  9099. return format.parser(text)
  9100. }
  9101. text = this.convertDigits(text, true);
  9102. if (format && "string" !== typeof format) {
  9103. errors.log("W0011")
  9104. }
  9105. var decimalSeparator = this.getDecimalSeparator();
  9106. var regExp = new RegExp("[^0-9" + escapeRegExp(decimalSeparator) + "]", "g");
  9107. var cleanedText = text.replace(regExp, "").replace(decimalSeparator, ".").replace(/\.$/g, "");
  9108. if ("." === cleanedText || "" === cleanedText) {
  9109. return null
  9110. }
  9111. if (this._calcSignificantDigits(cleanedText) > 15) {
  9112. return NaN
  9113. }
  9114. var parsed = +cleanedText;
  9115. return parsed * this.getSign(text, format)
  9116. },
  9117. _calcSignificantDigits: function(text) {
  9118. var _text$split = text.split("."),
  9119. _text$split2 = _slicedToArray(_text$split, 2),
  9120. integer = _text$split2[0],
  9121. fractional = _text$split2[1];
  9122. var calcDigitsAfterLeadingZeros = function(digits) {
  9123. var index = -1;
  9124. for (var i = 0; i < digits.length; i++) {
  9125. if ("0" !== digits[i]) {
  9126. index = i;
  9127. break
  9128. }
  9129. }
  9130. return index > -1 ? digits.length - index : 0
  9131. };
  9132. var result = 0;
  9133. if (integer) {
  9134. result += calcDigitsAfterLeadingZeros(integer.split(""))
  9135. }
  9136. if (fractional) {
  9137. result += calcDigitsAfterLeadingZeros(fractional.split("").reverse())
  9138. }
  9139. return result
  9140. }
  9141. });
  9142. module.exports = numberLocalization
  9143. },
  9144. /*!***************************************************************!*\
  9145. !*** ./artifacts/transpiled/core/utils/date_serialization.js ***!
  9146. \***************************************************************/
  9147. /*! dynamic exports provided */
  9148. /*! all exports used */
  9149. function(module, exports, __webpack_require__) {
  9150. var config = __webpack_require__( /*! ../config */ 31);
  9151. var getLDMLFormatter = __webpack_require__( /*! ../../localization/ldml/date.formatter */ 257).getFormatter;
  9152. var defaultDateNames = __webpack_require__( /*! ../../localization/default_date_names */ 258);
  9153. var typeUtils = __webpack_require__( /*! ./type */ 1);
  9154. var isString = typeUtils.isString;
  9155. var isDate = typeUtils.isDate;
  9156. var isNumber = typeUtils.isNumeric;
  9157. var NUMBER_SERIALIZATION_FORMAT = "number";
  9158. var DATE_SERIALIZATION_FORMAT = "yyyy/MM/dd";
  9159. var DATETIME_SERIALIZATION_FORMAT = "yyyy/MM/dd HH:mm:ss";
  9160. var ISO8601_PATTERN = /^(\d{4,})(-)?(\d{2})(-)?(\d{2})(?:T(\d{2})(:)?(\d{2})?(:)?(\d{2}(?:\.(\d{1,3})\d*)?)?)?(Z|([+-])(\d{2})(:)?(\d{2})?)?$/;
  9161. var ISO8601_TIME_PATTERN = /^(\d{2}):(\d{2})(:(\d{2}))?$/;
  9162. var ISO8601_PATTERN_PARTS = ["", "yyyy", "", "MM", "", "dd", "THH", "", "mm", "", "ss", ".SSS"];
  9163. var MILLISECOND_LENGHT = 3;
  9164. var dateParser = function(text, skipISO8601Parsing) {
  9165. var result;
  9166. var parsedValue;
  9167. if (isString(text) && !skipISO8601Parsing) {
  9168. result = parseISO8601String(text)
  9169. }
  9170. if (!result) {
  9171. parsedValue = !isDate(text) && Date.parse(text);
  9172. result = isNumber(parsedValue) ? new Date(parsedValue) : text
  9173. }
  9174. return result
  9175. };
  9176. var parseISO8601String = function(text) {
  9177. var parts = text.match(ISO8601_PATTERN);
  9178. var timePart = function(part) {
  9179. return +part || 0
  9180. };
  9181. if (!parts) {
  9182. parts = text.match(ISO8601_TIME_PATTERN);
  9183. if (parts) {
  9184. return new Date(0, 0, 0, timePart(parts[1]), timePart(parts[2]), timePart(parts[4]))
  9185. }
  9186. return
  9187. }
  9188. var year = parts[1];
  9189. var month = --parts[3];
  9190. var day = parts[5];
  9191. var timeZoneHour = 0;
  9192. var timeZoneMinute = 0;
  9193. timeZoneHour = timePart(parts[14]);
  9194. timeZoneMinute = timePart(parts[16]);
  9195. if ("-" === parts[13]) {
  9196. timeZoneHour = -timeZoneHour;
  9197. timeZoneMinute = -timeZoneMinute
  9198. }
  9199. var hour = timePart(parts[6]) - timeZoneHour;
  9200. var minute = timePart(parts[8]) - timeZoneMinute;
  9201. var second = timePart(parts[10]);
  9202. var parseMilliseconds = function(part) {
  9203. part = part || "";
  9204. return timePart(part) * Math.pow(10, MILLISECOND_LENGHT - part.length)
  9205. };
  9206. var millisecond = parseMilliseconds(parts[11]);
  9207. if (parts[12]) {
  9208. return new Date(Date.UTC(year, month, day, hour, minute, second, millisecond))
  9209. }
  9210. return new Date(year, month, day, hour, minute, second, millisecond)
  9211. };
  9212. var getIso8601Format = function(text, useUtc) {
  9213. var parts = text.match(ISO8601_PATTERN);
  9214. var result = "";
  9215. if (!parts) {
  9216. parts = text.match(ISO8601_TIME_PATTERN);
  9217. if (parts) {
  9218. return parts[3] ? "HH:mm:ss" : "HH:mm"
  9219. }
  9220. return
  9221. }
  9222. for (var i = 1; i < ISO8601_PATTERN_PARTS.length; i++) {
  9223. if (parts[i]) {
  9224. result += ISO8601_PATTERN_PARTS[i] || parts[i]
  9225. }
  9226. }
  9227. if ("Z" === parts[12]) {
  9228. result += "'Z'"
  9229. }
  9230. if (parts[14]) {
  9231. if (parts[15]) {
  9232. result += "xxx"
  9233. } else {
  9234. if (parts[16]) {
  9235. result += "xx"
  9236. } else {
  9237. result += "x"
  9238. }
  9239. }
  9240. }
  9241. return result
  9242. };
  9243. var deserializeDate = function(value) {
  9244. if ("number" === typeof value) {
  9245. return new Date(value)
  9246. }
  9247. return dateParser(value, !config().forceIsoDateParsing)
  9248. };
  9249. var serializeDate = function(value, serializationFormat) {
  9250. if (!serializationFormat) {
  9251. return value
  9252. }
  9253. if (!isDate(value)) {
  9254. return null
  9255. }
  9256. if (serializationFormat === NUMBER_SERIALIZATION_FORMAT) {
  9257. return value && value.valueOf ? value.valueOf() : null
  9258. }
  9259. return getLDMLFormatter(serializationFormat, defaultDateNames)(value)
  9260. };
  9261. var getDateSerializationFormat = function(value) {
  9262. if ("number" === typeof value) {
  9263. return NUMBER_SERIALIZATION_FORMAT
  9264. } else {
  9265. if (isString(value)) {
  9266. var format;
  9267. if (config().forceIsoDateParsing) {
  9268. format = getIso8601Format(value)
  9269. }
  9270. if (format) {
  9271. return format
  9272. } else {
  9273. if (value.indexOf(":") >= 0) {
  9274. return DATETIME_SERIALIZATION_FORMAT
  9275. } else {
  9276. return DATE_SERIALIZATION_FORMAT
  9277. }
  9278. }
  9279. } else {
  9280. if (value) {
  9281. return null
  9282. }
  9283. }
  9284. }
  9285. };
  9286. module.exports = {
  9287. dateParser: dateParser,
  9288. deserializeDate: deserializeDate,
  9289. serializeDate: serializeDate,
  9290. getDateSerializationFormat: getDateSerializationFormat
  9291. }
  9292. },
  9293. /*!*************************************************************************!*\
  9294. !*** ./artifacts/transpiled/ui/collection/ui.collection_widget.edit.js ***!
  9295. \*************************************************************************/
  9296. /*! dynamic exports provided */
  9297. /*! all exports used */
  9298. function(module, exports, __webpack_require__) {
  9299. var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
  9300. var _renderer2 = _interopRequireDefault(_renderer);
  9301. var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  9302. var _events_engine2 = _interopRequireDefault(_events_engine);
  9303. var _uiCollection_widget = __webpack_require__( /*! ./ui.collection_widget.base */ 467);
  9304. var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget);
  9305. var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17);
  9306. var _ui2 = _interopRequireDefault(_ui);
  9307. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  9308. var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  9309. var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
  9310. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  9311. var _uiCollection_widgetEditStrategy = __webpack_require__( /*! ./ui.collection_widget.edit.strategy.plain */ 182);
  9312. var _uiCollection_widgetEditStrategy2 = _interopRequireDefault(_uiCollection_widgetEditStrategy);
  9313. var _data = __webpack_require__( /*! ../../core/utils/data */ 20);
  9314. var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 45);
  9315. var _selection = __webpack_require__( /*! ../selection/selection */ 283);
  9316. var _selection2 = _interopRequireDefault(_selection);
  9317. var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6);
  9318. function _interopRequireDefault(obj) {
  9319. return obj && obj.__esModule ? obj : {
  9320. "default": obj
  9321. }
  9322. }
  9323. function _toConsumableArray(arr) {
  9324. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread()
  9325. }
  9326. function _nonIterableSpread() {
  9327. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  9328. }
  9329. function _unsupportedIterableToArray(o, minLen) {
  9330. if (!o) {
  9331. return
  9332. }
  9333. if ("string" === typeof o) {
  9334. return _arrayLikeToArray(o, minLen)
  9335. }
  9336. var n = Object.prototype.toString.call(o).slice(8, -1);
  9337. if ("Object" === n && o.constructor) {
  9338. n = o.constructor.name
  9339. }
  9340. if ("Map" === n || "Set" === n) {
  9341. return Array.from(o)
  9342. }
  9343. if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
  9344. return _arrayLikeToArray(o, minLen)
  9345. }
  9346. }
  9347. function _iterableToArray(iter) {
  9348. if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) {
  9349. return Array.from(iter)
  9350. }
  9351. }
  9352. function _arrayWithoutHoles(arr) {
  9353. if (Array.isArray(arr)) {
  9354. return _arrayLikeToArray(arr)
  9355. }
  9356. }
  9357. function _arrayLikeToArray(arr, len) {
  9358. if (null == len || len > arr.length) {
  9359. len = arr.length
  9360. }
  9361. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  9362. arr2[i] = arr[i]
  9363. }
  9364. return arr2
  9365. }
  9366. var ITEM_DELETING_DATA_KEY = "dxItemDeleting";
  9367. var NOT_EXISTING_INDEX = -1;
  9368. var indexExists = function(index) {
  9369. return index !== NOT_EXISTING_INDEX
  9370. };
  9371. var CollectionWidget = _uiCollection_widget2.default.inherit({
  9372. _setOptionsByReference: function() {
  9373. this.callBase();
  9374. (0, _extend.extend)(this._optionsByReference, {
  9375. selectedItem: true
  9376. })
  9377. },
  9378. _getDefaultOptions: function() {
  9379. return (0, _extend.extend)(this.callBase(), {
  9380. selectionMode: "none",
  9381. selectionRequired: false,
  9382. selectionByClick: true,
  9383. selectedItems: [],
  9384. selectedItemKeys: [],
  9385. maxFilterLengthInRequest: 1500,
  9386. keyExpr: null,
  9387. selectedIndex: NOT_EXISTING_INDEX,
  9388. selectedItem: null,
  9389. onSelectionChanged: null,
  9390. onItemReordered: null,
  9391. onItemDeleting: null,
  9392. onItemDeleted: null
  9393. })
  9394. },
  9395. ctor: function(element, options) {
  9396. this._userOptions = options || {};
  9397. this.callBase(element, options)
  9398. },
  9399. _init: function() {
  9400. this._initEditStrategy();
  9401. this.callBase();
  9402. this._initKeyGetter();
  9403. this._initSelectionModule();
  9404. if ("multi" === this.option("selectionMode")) {
  9405. this._showDeprecatedSelectionMode()
  9406. }
  9407. },
  9408. _initKeyGetter: function() {
  9409. this._keyGetter = (0, _data.compileGetter)(this.option("keyExpr"))
  9410. },
  9411. _getKeysByItems: function(selectedItems) {
  9412. return this._editStrategy.getKeysByItems(selectedItems)
  9413. },
  9414. _getItemsByKeys: function(selectedItemKeys, selectedItems) {
  9415. return this._editStrategy.getItemsByKeys(selectedItemKeys, selectedItems)
  9416. },
  9417. _getKeyByIndex: function(index) {
  9418. return this._editStrategy.getKeyByIndex(index)
  9419. },
  9420. _getIndexByKey: function(key) {
  9421. return this._editStrategy.getIndexByKey(key)
  9422. },
  9423. _getIndexByItemData: function(itemData) {
  9424. return this._editStrategy.getIndexByItemData(itemData)
  9425. },
  9426. _isKeySpecified: function() {
  9427. return !!(this._dataSource && this._dataSource.key())
  9428. },
  9429. _getCombinedFilter: function() {
  9430. return this._dataSource && this._dataSource.filter()
  9431. },
  9432. key: function() {
  9433. if (this.option("keyExpr")) {
  9434. return this.option("keyExpr")
  9435. }
  9436. return this._dataSource && this._dataSource.key()
  9437. },
  9438. keyOf: function(item) {
  9439. var key = item;
  9440. var store = this._dataSource && this._dataSource.store();
  9441. if (this.option("keyExpr")) {
  9442. key = this._keyGetter(item)
  9443. } else {
  9444. if (store) {
  9445. key = store.keyOf(item)
  9446. }
  9447. }
  9448. return key
  9449. },
  9450. _nullValueSelectionSupported: function() {
  9451. return false
  9452. },
  9453. _initSelectionModule: function() {
  9454. var that = this;
  9455. var itemsGetter = that._editStrategy.itemsGetter;
  9456. this._selection = new _selection2.default({
  9457. allowNullValue: this._nullValueSelectionSupported(),
  9458. mode: this.option("selectionMode"),
  9459. maxFilterLengthInRequest: this.option("maxFilterLengthInRequest"),
  9460. equalByReference: !this._isKeySpecified(),
  9461. onSelectionChanged: function(args) {
  9462. if (args.addedItemKeys.length || args.removedItemKeys.length) {
  9463. that.option("selectedItems", that._getItemsByKeys(args.selectedItemKeys, args.selectedItems));
  9464. that._updateSelectedItems(args)
  9465. }
  9466. },
  9467. filter: that._getCombinedFilter.bind(that),
  9468. totalCount: function() {
  9469. var items = that.option("items");
  9470. var dataSource = that._dataSource;
  9471. return dataSource && dataSource.totalCount() >= 0 ? dataSource.totalCount() : items.length
  9472. },
  9473. key: that.key.bind(that),
  9474. keyOf: that.keyOf.bind(that),
  9475. load: function(options) {
  9476. if (that._dataSource) {
  9477. var loadOptions = that._dataSource.loadOptions();
  9478. options.customQueryParams = loadOptions.customQueryParams;
  9479. options.userData = that._dataSource._userData
  9480. }
  9481. var store = that._dataSource && that._dataSource.store();
  9482. if (store) {
  9483. return store.load(options).done(function(loadResult) {
  9484. if (that._disposed) {
  9485. return
  9486. }
  9487. var items = (0, _data_source.normalizeLoadResult)(loadResult).data;
  9488. that._dataSource._applyMapFunction(items)
  9489. })
  9490. } else {
  9491. return (new _deferred.Deferred).resolve(this.plainItems())
  9492. }
  9493. },
  9494. dataFields: function() {
  9495. return that._dataSource && that._dataSource.select()
  9496. },
  9497. plainItems: itemsGetter.bind(that._editStrategy)
  9498. })
  9499. },
  9500. _initEditStrategy: function() {
  9501. var Strategy = _uiCollection_widgetEditStrategy2.default;
  9502. this._editStrategy = new Strategy(this)
  9503. },
  9504. _getSelectedItemIndices: function(keys) {
  9505. var that = this;
  9506. var indices = [];
  9507. keys = keys || this._selection.getSelectedItemKeys();
  9508. that._editStrategy.beginCache();
  9509. (0, _iterator.each)(keys, function(_, key) {
  9510. var selectedIndex = that._getIndexByKey(key);
  9511. if (indexExists(selectedIndex)) {
  9512. indices.push(selectedIndex)
  9513. }
  9514. });
  9515. that._editStrategy.endCache();
  9516. return indices
  9517. },
  9518. _initMarkup: function() {
  9519. var _this = this;
  9520. this._rendering = true;
  9521. if (!this._dataSource || !this._dataSource.isLoading()) {
  9522. this._syncSelectionOptions().done(function() {
  9523. return _this._normalizeSelectedItems()
  9524. })
  9525. }
  9526. this.callBase()
  9527. },
  9528. _render: function() {
  9529. this.callBase();
  9530. this._rendering = false
  9531. },
  9532. _fireContentReadyAction: function() {
  9533. this._rendering = false;
  9534. this._rendered = true;
  9535. this.callBase.apply(this, arguments)
  9536. },
  9537. _syncSelectionOptions: function(byOption) {
  9538. byOption = byOption || this._chooseSelectOption();
  9539. var selectedItem;
  9540. var selectedIndex;
  9541. var selectedItemKeys;
  9542. var selectedItems;
  9543. switch (byOption) {
  9544. case "selectedIndex":
  9545. selectedItem = this._editStrategy.getItemDataByIndex(this.option("selectedIndex"));
  9546. if ((0, _type.isDefined)(selectedItem)) {
  9547. this._setOptionSilent("selectedItems", [selectedItem]);
  9548. this._setOptionSilent("selectedItem", selectedItem);
  9549. this._setOptionSilent("selectedItemKeys", this._editStrategy.getKeysByItems([selectedItem]))
  9550. } else {
  9551. this._setOptionSilent("selectedItems", []);
  9552. this._setOptionSilent("selectedItemKeys", []);
  9553. this._setOptionSilent("selectedItem", null)
  9554. }
  9555. break;
  9556. case "selectedItems":
  9557. selectedItems = this.option("selectedItems") || [];
  9558. selectedIndex = this._editStrategy.getIndexByItemData(selectedItems[0]);
  9559. if (this.option("selectionRequired") && !indexExists(selectedIndex)) {
  9560. return this._syncSelectionOptions("selectedIndex")
  9561. }
  9562. this._setOptionSilent("selectedItem", selectedItems[0]);
  9563. this._setOptionSilent("selectedIndex", selectedIndex);
  9564. this._setOptionSilent("selectedItemKeys", this._editStrategy.getKeysByItems(selectedItems));
  9565. break;
  9566. case "selectedItem":
  9567. selectedItem = this.option("selectedItem");
  9568. selectedIndex = this._editStrategy.getIndexByItemData(selectedItem);
  9569. if (this.option("selectionRequired") && !indexExists(selectedIndex)) {
  9570. return this._syncSelectionOptions("selectedIndex")
  9571. }
  9572. if ((0, _type.isDefined)(selectedItem)) {
  9573. this._setOptionSilent("selectedItems", [selectedItem]);
  9574. this._setOptionSilent("selectedIndex", selectedIndex);
  9575. this._setOptionSilent("selectedItemKeys", this._editStrategy.getKeysByItems([selectedItem]))
  9576. } else {
  9577. this._setOptionSilent("selectedItems", []);
  9578. this._setOptionSilent("selectedItemKeys", []);
  9579. this._setOptionSilent("selectedIndex", NOT_EXISTING_INDEX)
  9580. }
  9581. break;
  9582. case "selectedItemKeys":
  9583. selectedItemKeys = this.option("selectedItemKeys");
  9584. if (this.option("selectionRequired")) {
  9585. var selectedItemIndex = this._getIndexByKey(selectedItemKeys[0]);
  9586. if (!indexExists(selectedItemIndex)) {
  9587. return this._syncSelectionOptions("selectedIndex")
  9588. }
  9589. }
  9590. return this._selection.setSelection(selectedItemKeys)
  9591. }
  9592. return (new _deferred.Deferred).resolve().promise()
  9593. },
  9594. _chooseSelectOption: function() {
  9595. var optionName = "selectedIndex";
  9596. var isOptionDefined = function(optionName) {
  9597. var optionValue = this.option(optionName);
  9598. var length = (0, _type.isDefined)(optionValue) && optionValue.length;
  9599. return length || optionName in this._userOptions
  9600. }.bind(this);
  9601. if (isOptionDefined("selectedItems")) {
  9602. optionName = "selectedItems"
  9603. } else {
  9604. if (isOptionDefined("selectedItem")) {
  9605. optionName = "selectedItem"
  9606. } else {
  9607. if (isOptionDefined("selectedItemKeys")) {
  9608. optionName = "selectedItemKeys"
  9609. }
  9610. }
  9611. }
  9612. return optionName
  9613. },
  9614. _compareKeys: function(oldKeys, newKeys) {
  9615. if (oldKeys.length !== newKeys.length) {
  9616. return false
  9617. }
  9618. for (var i = 0; i < newKeys.length; i++) {
  9619. if (oldKeys[i] !== newKeys[i]) {
  9620. return false
  9621. }
  9622. }
  9623. return true
  9624. },
  9625. _normalizeSelectedItems: function() {
  9626. if ("none" === this.option("selectionMode")) {
  9627. this._setOptionSilent("selectedItems", []);
  9628. this._syncSelectionOptions("selectedItems")
  9629. } else {
  9630. if ("single" === this.option("selectionMode")) {
  9631. var newSelection = this.option("selectedItems");
  9632. if (newSelection.length > 1 || !newSelection.length && this.option("selectionRequired") && this.option("items") && this.option("items").length) {
  9633. var currentSelection = this._selection.getSelectedItems();
  9634. var normalizedSelection = void 0 === newSelection[0] ? currentSelection[0] : newSelection[0];
  9635. if (void 0 === normalizedSelection) {
  9636. normalizedSelection = this._editStrategy.itemsGetter()[0]
  9637. }
  9638. if (this.option("grouped") && normalizedSelection && normalizedSelection.items) {
  9639. normalizedSelection.items = [normalizedSelection.items[0]]
  9640. }
  9641. this._selection.setSelection(this._getKeysByItems([normalizedSelection]));
  9642. this._setOptionSilent("selectedItems", [normalizedSelection]);
  9643. return this._syncSelectionOptions("selectedItems")
  9644. } else {
  9645. this._selection.setSelection(this._getKeysByItems(newSelection))
  9646. }
  9647. } else {
  9648. var newKeys = this._getKeysByItems(this.option("selectedItems"));
  9649. var oldKeys = this._selection.getSelectedItemKeys();
  9650. if (!this._compareKeys(oldKeys, newKeys)) {
  9651. this._selection.setSelection(newKeys)
  9652. }
  9653. }
  9654. }
  9655. return (new _deferred.Deferred).resolve().promise()
  9656. },
  9657. _itemClickHandler: function(e) {
  9658. this._createAction(function(e) {
  9659. this._itemSelectHandler(e.event)
  9660. }.bind(this), {
  9661. validatingTargetName: "itemElement"
  9662. })({
  9663. itemElement: (0, _renderer2.default)(e.currentTarget),
  9664. event: e
  9665. });
  9666. this.callBase.apply(this, arguments)
  9667. },
  9668. _itemSelectHandler: function(e) {
  9669. if (!this.option("selectionByClick")) {
  9670. return
  9671. }
  9672. var $itemElement = e.currentTarget;
  9673. if (this.isItemSelected($itemElement)) {
  9674. this.unselectItem(e.currentTarget)
  9675. } else {
  9676. this.selectItem(e.currentTarget)
  9677. }
  9678. },
  9679. _selectedItemElement: function(index) {
  9680. return this._itemElements().eq(index)
  9681. },
  9682. _postprocessRenderItem: function(args) {
  9683. if ("none" !== this.option("selectionMode")) {
  9684. var $itemElement = (0, _renderer2.default)(args.itemElement);
  9685. var normalizedItemIndex = this._editStrategy.getNormalizedIndex($itemElement);
  9686. var isItemSelected = this._isItemSelected(normalizedItemIndex);
  9687. this._processSelectableItem($itemElement, isItemSelected)
  9688. }
  9689. },
  9690. _processSelectableItem: function($itemElement, isSelected) {
  9691. $itemElement.toggleClass(this._selectedItemClass(), isSelected);
  9692. this._setAriaSelected($itemElement, String(isSelected))
  9693. },
  9694. _updateSelectedItems: function(args) {
  9695. var that = this;
  9696. var addedItemKeys = args.addedItemKeys;
  9697. var removedItemKeys = args.removedItemKeys;
  9698. if (that._rendered && (addedItemKeys.length || removedItemKeys.length)) {
  9699. var selectionChangePromise = that._selectionChangePromise;
  9700. if (!that._rendering) {
  9701. var addedSelection = [];
  9702. var normalizedIndex;
  9703. var removedSelection = [];
  9704. that._editStrategy.beginCache();
  9705. for (var i = 0; i < addedItemKeys.length; i++) {
  9706. normalizedIndex = that._getIndexByKey(addedItemKeys[i]);
  9707. addedSelection.push(normalizedIndex);
  9708. that._addSelection(normalizedIndex)
  9709. }
  9710. for (var _i = 0; _i < removedItemKeys.length; _i++) {
  9711. normalizedIndex = that._getIndexByKey(removedItemKeys[_i]);
  9712. removedSelection.push(normalizedIndex);
  9713. that._removeSelection(normalizedIndex)
  9714. }
  9715. that._editStrategy.endCache();
  9716. that._updateSelection(addedSelection, removedSelection)
  9717. }(0, _deferred.when)(selectionChangePromise).done(function() {
  9718. that._fireSelectionChangeEvent(args.addedItems, args.removedItems)
  9719. })
  9720. }
  9721. },
  9722. _fireSelectionChangeEvent: function(addedItems, removedItems) {
  9723. this._createActionByOption("onSelectionChanged", {
  9724. excludeValidators: ["disabled", "readOnly"]
  9725. })({
  9726. addedItems: addedItems,
  9727. removedItems: removedItems
  9728. })
  9729. },
  9730. _updateSelection: _common.noop,
  9731. _setAriaSelected: function($target, value) {
  9732. this.setAria("selected", value, $target)
  9733. },
  9734. _removeSelection: function(normalizedIndex) {
  9735. var $itemElement = this._editStrategy.getItemElement(normalizedIndex);
  9736. if (indexExists(normalizedIndex)) {
  9737. this._processSelectableItem($itemElement, false);
  9738. _events_engine2.default.triggerHandler($itemElement, "stateChanged", false)
  9739. }
  9740. },
  9741. _showDeprecatedSelectionMode: function() {
  9742. _ui2.default.log("W0001", this.NAME, "selectionMode: 'multi'", "16.1", "Use selectionMode: 'multiple' instead");
  9743. this.option("selectionMode", "multiple")
  9744. },
  9745. _addSelection: function(normalizedIndex) {
  9746. var $itemElement = this._editStrategy.getItemElement(normalizedIndex);
  9747. if (indexExists(normalizedIndex)) {
  9748. this._processSelectableItem($itemElement, true);
  9749. _events_engine2.default.triggerHandler($itemElement, "stateChanged", true)
  9750. }
  9751. },
  9752. _isItemSelected: function(index) {
  9753. var key = this._getKeyByIndex(index);
  9754. return this._selection.isItemSelected(key)
  9755. },
  9756. _optionChanged: function(args) {
  9757. var _this2 = this;
  9758. switch (args.name) {
  9759. case "selectionMode":
  9760. if ("multi" === args.value) {
  9761. this._showDeprecatedSelectionMode()
  9762. } else {
  9763. this._invalidate()
  9764. }
  9765. break;
  9766. case "dataSource":
  9767. if (!args.value || Array.isArray(args.value) && !args.value.length) {
  9768. this.option("selectedItemKeys", [])
  9769. }
  9770. this.callBase(args);
  9771. break;
  9772. case "selectedIndex":
  9773. case "selectedItem":
  9774. case "selectedItems":
  9775. case "selectedItemKeys":
  9776. this._syncSelectionOptions(args.name).done(function() {
  9777. return _this2._normalizeSelectedItems()
  9778. });
  9779. break;
  9780. case "keyExpr":
  9781. this._initKeyGetter();
  9782. break;
  9783. case "selectionRequired":
  9784. this._normalizeSelectedItems();
  9785. break;
  9786. case "selectionByClick":
  9787. case "onSelectionChanged":
  9788. case "onItemDeleting":
  9789. case "onItemDeleted":
  9790. case "onItemReordered":
  9791. case "maxFilterLengthInRequest":
  9792. break;
  9793. default:
  9794. this.callBase(args)
  9795. }
  9796. },
  9797. _clearSelectedItems: function() {
  9798. this._setOptionSilent("selectedItems", []);
  9799. this._syncSelectionOptions("selectedItems")
  9800. },
  9801. _waitDeletingPrepare: function($itemElement) {
  9802. if ($itemElement.data(ITEM_DELETING_DATA_KEY)) {
  9803. return (new _deferred.Deferred).resolve().promise()
  9804. }
  9805. $itemElement.data(ITEM_DELETING_DATA_KEY, true);
  9806. var deferred = new _deferred.Deferred;
  9807. var deletingActionArgs = {
  9808. cancel: false
  9809. };
  9810. var deletePromise = this._itemEventHandler($itemElement, "onItemDeleting", deletingActionArgs, {
  9811. excludeValidators: ["disabled", "readOnly"]
  9812. });
  9813. (0, _deferred.when)(deletePromise).always(function(value) {
  9814. var deletePromiseExists = !deletePromise;
  9815. var deletePromiseResolved = !deletePromiseExists && "resolved" === deletePromise.state();
  9816. var argumentsSpecified = !!arguments.length;
  9817. var shouldDelete = deletePromiseExists || deletePromiseResolved && !argumentsSpecified || deletePromiseResolved && value;
  9818. (0, _deferred.when)((0, _deferred.fromPromise)(deletingActionArgs.cancel)).always(function() {
  9819. $itemElement.data(ITEM_DELETING_DATA_KEY, false)
  9820. }).done(function(cancel) {
  9821. shouldDelete && !cancel ? deferred.resolve() : deferred.reject()
  9822. }).fail(deferred.reject)
  9823. }.bind(this));
  9824. return deferred.promise()
  9825. },
  9826. _deleteItemFromDS: function($item) {
  9827. if (!this._dataSource) {
  9828. return (new _deferred.Deferred).resolve().promise()
  9829. }
  9830. var deferred = new _deferred.Deferred;
  9831. var disabledState = this.option("disabled");
  9832. var dataStore = this._dataSource.store();
  9833. this.option("disabled", true);
  9834. if (!dataStore.remove) {
  9835. throw _ui2.default.Error("E1011")
  9836. }
  9837. dataStore.remove(dataStore.keyOf(this._getItemData($item))).done(function(key) {
  9838. if (void 0 !== key) {
  9839. deferred.resolve()
  9840. } else {
  9841. deferred.reject()
  9842. }
  9843. }).fail(function() {
  9844. deferred.reject()
  9845. });
  9846. deferred.always(function() {
  9847. this.option("disabled", disabledState)
  9848. }.bind(this));
  9849. return deferred
  9850. },
  9851. _tryRefreshLastPage: function() {
  9852. var deferred = new _deferred.Deferred;
  9853. if (this._isLastPage() || this.option("grouped")) {
  9854. deferred.resolve()
  9855. } else {
  9856. this._refreshLastPage().done(function() {
  9857. deferred.resolve()
  9858. })
  9859. }
  9860. return deferred.promise()
  9861. },
  9862. _refreshLastPage: function() {
  9863. this._expectLastItemLoading();
  9864. return this._dataSource.load()
  9865. },
  9866. _updateSelectionAfterDelete: function(index) {
  9867. var key = this._getKeyByIndex(index);
  9868. this._selection.deselect([key])
  9869. },
  9870. _updateIndicesAfterIndex: function(index) {
  9871. var itemElements = this._itemElements();
  9872. for (var i = index + 1; i < itemElements.length; i++) {
  9873. (0, _renderer2.default)(itemElements[i]).data(this._itemIndexKey(), i - 1)
  9874. }
  9875. },
  9876. _simulateOptionChange: function(optionName) {
  9877. var optionValue = this.option(optionName);
  9878. if (optionValue instanceof _data_source.DataSource) {
  9879. return
  9880. }
  9881. this._optionChangedAction({
  9882. name: optionName,
  9883. fullName: optionName,
  9884. value: optionValue
  9885. })
  9886. },
  9887. isItemSelected: function(itemElement) {
  9888. return this._isItemSelected(this._editStrategy.getNormalizedIndex(itemElement))
  9889. },
  9890. selectItem: function(itemElement) {
  9891. if ("none" === this.option("selectionMode")) {
  9892. return
  9893. }
  9894. var itemIndex = this._editStrategy.getNormalizedIndex(itemElement);
  9895. if (!indexExists(itemIndex)) {
  9896. return
  9897. }
  9898. var key = this._getKeyByIndex(itemIndex);
  9899. if (this._selection.isItemSelected(key)) {
  9900. return
  9901. }
  9902. if ("single" === this.option("selectionMode")) {
  9903. this._selection.setSelection([key])
  9904. } else {
  9905. var selectedItemKeys = this.option("selectedItemKeys") || [];
  9906. this._selection.setSelection([].concat(_toConsumableArray(selectedItemKeys), [key]))
  9907. }
  9908. },
  9909. unselectItem: function(itemElement) {
  9910. var itemIndex = this._editStrategy.getNormalizedIndex(itemElement);
  9911. if (!indexExists(itemIndex)) {
  9912. return
  9913. }
  9914. var selectedItemKeys = this._selection.getSelectedItemKeys();
  9915. if (this.option("selectionRequired") && selectedItemKeys.length <= 1) {
  9916. return
  9917. }
  9918. var key = this._getKeyByIndex(itemIndex);
  9919. if (!this._selection.isItemSelected(key)) {
  9920. return
  9921. }
  9922. this._selection.deselect([key])
  9923. },
  9924. _deleteItemElementByIndex: function(index) {
  9925. this._updateSelectionAfterDelete(index);
  9926. this._updateIndicesAfterIndex(index);
  9927. this._editStrategy.deleteItemAtIndex(index)
  9928. },
  9929. _afterItemElementDeleted: function($item, deletedActionArgs) {
  9930. var changingOption = this._dataSource ? "dataSource" : "items";
  9931. this._simulateOptionChange(changingOption);
  9932. this._itemEventHandler($item, "onItemDeleted", deletedActionArgs, {
  9933. beforeExecute: function() {
  9934. $item.remove()
  9935. },
  9936. excludeValidators: ["disabled", "readOnly"]
  9937. });
  9938. this._renderEmptyMessage()
  9939. },
  9940. deleteItem: function(itemElement) {
  9941. var that = this;
  9942. var deferred = new _deferred.Deferred;
  9943. var $item = this._editStrategy.getItemElement(itemElement);
  9944. var index = this._editStrategy.getNormalizedIndex(itemElement);
  9945. var itemResponseWaitClass = this._itemResponseWaitClass();
  9946. if (indexExists(index)) {
  9947. this._waitDeletingPrepare($item).done(function() {
  9948. $item.addClass(itemResponseWaitClass);
  9949. var deletedActionArgs = that._extendActionArgs($item);
  9950. that._deleteItemFromDS($item).done(function() {
  9951. that._deleteItemElementByIndex(index);
  9952. that._afterItemElementDeleted($item, deletedActionArgs);
  9953. that._tryRefreshLastPage().done(function() {
  9954. deferred.resolveWith(that)
  9955. })
  9956. }).fail(function() {
  9957. $item.removeClass(itemResponseWaitClass);
  9958. deferred.rejectWith(that)
  9959. })
  9960. }).fail(function() {
  9961. deferred.rejectWith(that)
  9962. })
  9963. } else {
  9964. deferred.rejectWith(that)
  9965. }
  9966. return deferred.promise()
  9967. },
  9968. reorderItem: function(itemElement, toItemElement) {
  9969. var deferred = new _deferred.Deferred;
  9970. var that = this;
  9971. var strategy = this._editStrategy;
  9972. var $movingItem = strategy.getItemElement(itemElement);
  9973. var $destinationItem = strategy.getItemElement(toItemElement);
  9974. var movingIndex = strategy.getNormalizedIndex(itemElement);
  9975. var destinationIndex = strategy.getNormalizedIndex(toItemElement);
  9976. var changingOption = this._dataSource ? "dataSource" : "items";
  9977. var canMoveItems = indexExists(movingIndex) && indexExists(destinationIndex) && movingIndex !== destinationIndex;
  9978. if (canMoveItems) {
  9979. deferred.resolveWith(this)
  9980. } else {
  9981. deferred.rejectWith(this)
  9982. }
  9983. return deferred.promise().done(function() {
  9984. $destinationItem[strategy.itemPlacementFunc(movingIndex, destinationIndex)]($movingItem);
  9985. strategy.moveItemAtIndexToIndex(movingIndex, destinationIndex);
  9986. this._updateIndicesAfterIndex(movingIndex);
  9987. that.option("selectedItems", that._getItemsByKeys(that._selection.getSelectedItemKeys(), that._selection.getSelectedItems()));
  9988. if ("items" === changingOption) {
  9989. that._simulateOptionChange(changingOption)
  9990. }
  9991. that._itemEventHandler($movingItem, "onItemReordered", {
  9992. fromIndex: strategy.getIndex(movingIndex),
  9993. toIndex: strategy.getIndex(destinationIndex)
  9994. }, {
  9995. excludeValidators: ["disabled", "readOnly"]
  9996. })
  9997. })
  9998. }
  9999. });
  10000. module.exports = CollectionWidget
  10001. },
  10002. /*!****************************************************************!*\
  10003. !*** ./artifacts/transpiled/core/utils/dependency_injector.js ***!
  10004. \****************************************************************/
  10005. /*! dynamic exports provided */
  10006. /*! all exports used */
  10007. function(module, exports, __webpack_require__) {
  10008. module.exports = function(object) {
  10009. var extend = __webpack_require__( /*! ./extend */ 0).extend;
  10010. var isFunction = __webpack_require__( /*! ./type */ 1).isFunction;
  10011. var each = __webpack_require__( /*! ./iterator */ 3).each;
  10012. var Class = __webpack_require__( /*! ../class */ 15);
  10013. var BaseClass = Class.inherit(object);
  10014. var InjectedClass = BaseClass;
  10015. var instance = new InjectedClass(object);
  10016. var initialFields = {};
  10017. var injectFields = function(injectionObject, initial) {
  10018. each(injectionObject, function(key) {
  10019. if (isFunction(instance[key])) {
  10020. if (initial || !object[key]) {
  10021. object[key] = function() {
  10022. return instance[key].apply(object, arguments)
  10023. }
  10024. }
  10025. } else {
  10026. if (initial) {
  10027. initialFields[key] = object[key]
  10028. }
  10029. object[key] = instance[key]
  10030. }
  10031. })
  10032. };
  10033. injectFields(object, true);
  10034. object.inject = function(injectionObject) {
  10035. InjectedClass = InjectedClass.inherit(injectionObject);
  10036. instance = new InjectedClass;
  10037. injectFields(injectionObject)
  10038. };
  10039. object.resetInjection = function() {
  10040. extend(object, initialFields);
  10041. InjectedClass = BaseClass;
  10042. instance = new BaseClass
  10043. };
  10044. return object
  10045. }
  10046. },
  10047. /*!********************************!*\
  10048. !*** external "window.jQuery" ***!
  10049. \********************************/
  10050. /*! dynamic exports provided */
  10051. /*! all exports used */
  10052. function(module, exports) {
  10053. module.exports = window.jQuery
  10054. },
  10055. /*!*********************************************!*\
  10056. !*** ./artifacts/transpiled/events/drag.js ***!
  10057. \*********************************************/
  10058. /*! dynamic exports provided */
  10059. /*! all exports used */
  10060. function(module, exports, __webpack_require__) {
  10061. var $ = __webpack_require__( /*! ../core/renderer */ 2);
  10062. var dataUtils = __webpack_require__( /*! ../core/element_data */ 39);
  10063. var wrapToArray = __webpack_require__( /*! ../core/utils/array */ 14).wrapToArray;
  10064. var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
  10065. var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
  10066. var contains = __webpack_require__( /*! ../core/utils/dom */ 12).contains;
  10067. var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71);
  10068. var eventUtils = __webpack_require__( /*! ./utils */ 8);
  10069. var GestureEmitter = __webpack_require__( /*! ./gesture/emitter.gesture */ 158);
  10070. var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95);
  10071. var DRAG_START_EVENT = "dxdragstart";
  10072. var DRAG_EVENT = "dxdrag";
  10073. var DRAG_END_EVENT = "dxdragend";
  10074. var DRAG_ENTER_EVENT = "dxdragenter";
  10075. var DRAG_LEAVE_EVENT = "dxdragleave";
  10076. var DROP_EVENT = "dxdrop";
  10077. var DX_DRAG_EVENTS_COUNT_KEY = "dxDragEventsCount";
  10078. var knownDropTargets = [];
  10079. var knownDropTargetSelectors = [];
  10080. var knownDropTargetConfigs = [];
  10081. var dropTargetRegistration = {
  10082. setup: function(element, data) {
  10083. var knownDropTarget = inArray(element, knownDropTargets) !== -1;
  10084. if (!knownDropTarget) {
  10085. knownDropTargets.push(element);
  10086. knownDropTargetSelectors.push([]);
  10087. knownDropTargetConfigs.push(data || {})
  10088. }
  10089. },
  10090. add: function(element, handleObj) {
  10091. var index = inArray(element, knownDropTargets);
  10092. this.updateEventsCounter(element, handleObj.type, 1);
  10093. var selector = handleObj.selector;
  10094. if (inArray(selector, knownDropTargetSelectors[index]) === -1) {
  10095. knownDropTargetSelectors[index].push(selector)
  10096. }
  10097. },
  10098. updateEventsCounter: function(element, event, value) {
  10099. if ([DRAG_ENTER_EVENT, DRAG_LEAVE_EVENT, DROP_EVENT].indexOf(event) > -1) {
  10100. var eventsCount = dataUtils.data(element, DX_DRAG_EVENTS_COUNT_KEY) || 0;
  10101. dataUtils.data(element, DX_DRAG_EVENTS_COUNT_KEY, Math.max(0, eventsCount + value))
  10102. }
  10103. },
  10104. remove: function(element, handleObj) {
  10105. this.updateEventsCounter(element, handleObj.type, -1)
  10106. },
  10107. teardown: function(element) {
  10108. var handlersCount = dataUtils.data(element, DX_DRAG_EVENTS_COUNT_KEY);
  10109. if (!handlersCount) {
  10110. var index = inArray(element, knownDropTargets);
  10111. knownDropTargets.splice(index, 1);
  10112. knownDropTargetSelectors.splice(index, 1);
  10113. knownDropTargetConfigs.splice(index, 1);
  10114. dataUtils.removeData(element, DX_DRAG_EVENTS_COUNT_KEY)
  10115. }
  10116. }
  10117. };
  10118. registerEvent(DRAG_ENTER_EVENT, dropTargetRegistration);
  10119. registerEvent(DRAG_LEAVE_EVENT, dropTargetRegistration);
  10120. registerEvent(DROP_EVENT, dropTargetRegistration);
  10121. var getItemDelegatedTargets = function($element) {
  10122. var dropTargetIndex = inArray($element.get(0), knownDropTargets);
  10123. var dropTargetSelectors = knownDropTargetSelectors[dropTargetIndex];
  10124. var $delegatedTargets = $element.find(dropTargetSelectors.join(", "));
  10125. if (inArray(void 0, dropTargetSelectors) !== -1) {
  10126. $delegatedTargets = $delegatedTargets.add($element)
  10127. }
  10128. return $delegatedTargets
  10129. };
  10130. var getItemConfig = function($element) {
  10131. var dropTargetIndex = inArray($element.get(0), knownDropTargets);
  10132. return knownDropTargetConfigs[dropTargetIndex]
  10133. };
  10134. var getItemPosition = function(dropTargetConfig, $element) {
  10135. if (dropTargetConfig.itemPositionFunc) {
  10136. return dropTargetConfig.itemPositionFunc($element)
  10137. } else {
  10138. return $element.offset()
  10139. }
  10140. };
  10141. var getItemSize = function(dropTargetConfig, $element) {
  10142. if (dropTargetConfig.itemSizeFunc) {
  10143. return dropTargetConfig.itemSizeFunc($element)
  10144. }
  10145. return {
  10146. width: $element.get(0).getBoundingClientRect().width,
  10147. height: $element.get(0).getBoundingClientRect().height
  10148. }
  10149. };
  10150. var DragEmitter = GestureEmitter.inherit({
  10151. ctor: function(element) {
  10152. this.callBase(element);
  10153. this.direction = "both"
  10154. },
  10155. _init: function(e) {
  10156. this._initEvent = e
  10157. },
  10158. _start: function(e) {
  10159. e = this._fireEvent(DRAG_START_EVENT, this._initEvent);
  10160. this._maxLeftOffset = e.maxLeftOffset;
  10161. this._maxRightOffset = e.maxRightOffset;
  10162. this._maxTopOffset = e.maxTopOffset;
  10163. this._maxBottomOffset = e.maxBottomOffset;
  10164. var dropTargets = wrapToArray(e.targetElements || (null === e.targetElements ? [] : knownDropTargets));
  10165. this._dropTargets = iteratorUtils.map(dropTargets, function(element) {
  10166. return $(element).get(0)
  10167. })
  10168. },
  10169. _move: function(e) {
  10170. var eventData = eventUtils.eventData(e);
  10171. var dragOffset = this._calculateOffset(eventData);
  10172. e = this._fireEvent(DRAG_EVENT, e, {
  10173. offset: dragOffset
  10174. });
  10175. this._processDropTargets(e);
  10176. if (!e._cancelPreventDefault) {
  10177. e.preventDefault()
  10178. }
  10179. },
  10180. _calculateOffset: function(eventData) {
  10181. return {
  10182. x: this._calculateXOffset(eventData),
  10183. y: this._calculateYOffset(eventData)
  10184. }
  10185. },
  10186. _calculateXOffset: function(eventData) {
  10187. if ("vertical" !== this.direction) {
  10188. var offset = eventData.x - this._startEventData.x;
  10189. return this._fitOffset(offset, this._maxLeftOffset, this._maxRightOffset)
  10190. }
  10191. return 0
  10192. },
  10193. _calculateYOffset: function(eventData) {
  10194. if ("horizontal" !== this.direction) {
  10195. var offset = eventData.y - this._startEventData.y;
  10196. return this._fitOffset(offset, this._maxTopOffset, this._maxBottomOffset)
  10197. }
  10198. return 0
  10199. },
  10200. _fitOffset: function(offset, minOffset, maxOffset) {
  10201. if (null != minOffset) {
  10202. offset = Math.max(offset, -minOffset)
  10203. }
  10204. if (null != maxOffset) {
  10205. offset = Math.min(offset, maxOffset)
  10206. }
  10207. return offset
  10208. },
  10209. _processDropTargets: function(e) {
  10210. var target = this._findDropTarget(e);
  10211. var sameTarget = target === this._currentDropTarget;
  10212. if (!sameTarget) {
  10213. this._fireDropTargetEvent(e, DRAG_LEAVE_EVENT);
  10214. this._currentDropTarget = target;
  10215. this._fireDropTargetEvent(e, DRAG_ENTER_EVENT)
  10216. }
  10217. },
  10218. _fireDropTargetEvent: function(event, eventName) {
  10219. if (!this._currentDropTarget) {
  10220. return
  10221. }
  10222. var eventData = {
  10223. type: eventName,
  10224. originalEvent: event,
  10225. draggingElement: this._$element.get(0),
  10226. target: this._currentDropTarget
  10227. };
  10228. eventUtils.fireEvent(eventData)
  10229. },
  10230. _findDropTarget: function(e) {
  10231. var that = this;
  10232. var result;
  10233. iteratorUtils.each(knownDropTargets, function(_, target) {
  10234. if (!that._checkDropTargetActive(target)) {
  10235. return
  10236. }
  10237. var $target = $(target);
  10238. iteratorUtils.each(getItemDelegatedTargets($target), function(_, delegatedTarget) {
  10239. var $delegatedTarget = $(delegatedTarget);
  10240. if (that._checkDropTarget(getItemConfig($target), $delegatedTarget, e)) {
  10241. result = delegatedTarget
  10242. }
  10243. })
  10244. });
  10245. return result
  10246. },
  10247. _checkDropTargetActive: function(target) {
  10248. var active = false;
  10249. iteratorUtils.each(this._dropTargets, function(_, activeTarget) {
  10250. active = active || activeTarget === target || contains(activeTarget, target);
  10251. return !active
  10252. });
  10253. return active
  10254. },
  10255. _checkDropTarget: function(config, $target, e) {
  10256. var isDraggingElement = $target.get(0) === this._$element.get(0);
  10257. if (isDraggingElement) {
  10258. return false
  10259. }
  10260. var targetPosition = getItemPosition(config, $target);
  10261. if (e.pageX < targetPosition.left) {
  10262. return false
  10263. }
  10264. if (e.pageY < targetPosition.top) {
  10265. return false
  10266. }
  10267. var targetSize = getItemSize(config, $target);
  10268. if (e.pageX > targetPosition.left + targetSize.width) {
  10269. return false
  10270. }
  10271. if (e.pageY > targetPosition.top + targetSize.height) {
  10272. return false
  10273. }
  10274. return $target
  10275. },
  10276. _end: function(e) {
  10277. var eventData = eventUtils.eventData(e);
  10278. this._fireEvent(DRAG_END_EVENT, e, {
  10279. offset: this._calculateOffset(eventData)
  10280. });
  10281. this._fireDropTargetEvent(e, DROP_EVENT);
  10282. delete this._currentDropTarget
  10283. }
  10284. });
  10285. registerEmitter({
  10286. emitter: DragEmitter,
  10287. events: [DRAG_START_EVENT, DRAG_EVENT, DRAG_END_EVENT]
  10288. });
  10289. exports.dropTargets = knownDropTargets;
  10290. exports.move = DRAG_EVENT;
  10291. exports.start = DRAG_START_EVENT;
  10292. exports.end = DRAG_END_EVENT;
  10293. exports.enter = DRAG_ENTER_EVENT;
  10294. exports.leave = DRAG_LEAVE_EVENT;
  10295. exports.drop = DROP_EVENT
  10296. }, ,
  10297. /*!*************************************************!*\
  10298. !*** ./artifacts/transpiled/core/utils/ajax.js ***!
  10299. \*************************************************/
  10300. /*! dynamic exports provided */
  10301. /*! all exports used */
  10302. function(module, exports, __webpack_require__) {
  10303. var Deferred = __webpack_require__( /*! ./deferred */ 6).Deferred;
  10304. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  10305. var httpRequest = __webpack_require__( /*! ../../core/http_request */ 439);
  10306. var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
  10307. var window = windowUtils.getWindow();
  10308. var extendFromObject = __webpack_require__( /*! ./extend */ 0).extendFromObject;
  10309. var isDefined = __webpack_require__( /*! ./type */ 1).isDefined;
  10310. var Promise = __webpack_require__( /*! ../polyfills/promise */ 76);
  10311. var injector = __webpack_require__( /*! ./dependency_injector */ 54);
  10312. var SUCCESS = "success";
  10313. var ERROR = "error";
  10314. var TIMEOUT = "timeout";
  10315. var NO_CONTENT = "nocontent";
  10316. var PARSER_ERROR = "parsererror";
  10317. var isStatusSuccess = function(status) {
  10318. return 200 <= status && status < 300
  10319. };
  10320. var hasContent = function(status) {
  10321. return 204 !== status
  10322. };
  10323. var paramsConvert = function(params) {
  10324. var result = [];
  10325. for (var name in params) {
  10326. var value = params[name];
  10327. if (void 0 === value) {
  10328. continue
  10329. }
  10330. if (null === value) {
  10331. value = ""
  10332. }
  10333. result.push(encodeURIComponent(name) + "=" + encodeURIComponent(value))
  10334. }
  10335. return result.join("&")
  10336. };
  10337. var createScript = function(options) {
  10338. var script = domAdapter.createElement("script");
  10339. for (var name in options) {
  10340. script[name] = options[name]
  10341. }
  10342. return script
  10343. };
  10344. var removeScript = function(scriptNode) {
  10345. scriptNode.parentNode.removeChild(scriptNode)
  10346. };
  10347. var appendToHead = function(element) {
  10348. return domAdapter.getHead().appendChild(element)
  10349. };
  10350. var evalScript = function(code) {
  10351. var script = createScript({
  10352. text: code
  10353. });
  10354. appendToHead(script);
  10355. removeScript(script)
  10356. };
  10357. var evalCrossDomainScript = function(url) {
  10358. var script = createScript({
  10359. src: url
  10360. });
  10361. return new Promise(function(resolve, reject) {
  10362. var events = {
  10363. load: resolve,
  10364. error: reject
  10365. };
  10366. var loadHandler = function(e) {
  10367. events[e.type]();
  10368. removeScript(script)
  10369. };
  10370. for (var event in events) {
  10371. domAdapter.listen(script, event, loadHandler)
  10372. }
  10373. appendToHead(script)
  10374. })
  10375. };
  10376. var getAcceptHeader = function(options) {
  10377. var dataType = options.dataType || "*";
  10378. var scriptAccept = "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript";
  10379. var accepts = {
  10380. "*": "*/*",
  10381. text: "text/plain",
  10382. html: "text/html",
  10383. xml: "application/xml, text/xml",
  10384. json: "application/json, text/javascript",
  10385. jsonp: scriptAccept,
  10386. script: scriptAccept
  10387. };
  10388. extendFromObject(accepts, options.accepts, true);
  10389. return accepts[dataType] ? accepts[dataType] + ("*" !== dataType ? ", */*; q=0.01" : "") : accepts["*"]
  10390. };
  10391. var getContentTypeHeader = function(options) {
  10392. var defaultContentType;
  10393. if (options.data && !options.upload && "GET" !== getMethod(options)) {
  10394. defaultContentType = "application/x-www-form-urlencoded;charset=utf-8"
  10395. }
  10396. return options.contentType || defaultContentType
  10397. };
  10398. var getDataFromResponse = function(xhr) {
  10399. return xhr.responseType && "text" !== xhr.responseType || "string" !== typeof xhr.responseText ? xhr.response : xhr.responseText
  10400. };
  10401. var postProcess = function(deferred, xhr, dataType) {
  10402. var data = getDataFromResponse(xhr);
  10403. switch (dataType) {
  10404. case "jsonp":
  10405. evalScript(data);
  10406. break;
  10407. case "script":
  10408. evalScript(data);
  10409. deferred.resolve(data, SUCCESS, xhr);
  10410. break;
  10411. case "json":
  10412. try {
  10413. deferred.resolve(JSON.parse(data), SUCCESS, xhr)
  10414. } catch (e) {
  10415. deferred.reject(xhr, PARSER_ERROR, e)
  10416. }
  10417. break;
  10418. default:
  10419. deferred.resolve(data, SUCCESS, xhr)
  10420. }
  10421. };
  10422. var isCrossDomain = function(url) {
  10423. if (!windowUtils.hasWindow()) {
  10424. return true
  10425. }
  10426. var crossDomain = false;
  10427. var originAnchor = domAdapter.createElement("a");
  10428. var urlAnchor = domAdapter.createElement("a");
  10429. originAnchor.href = window.location.href;
  10430. try {
  10431. urlAnchor.href = url;
  10432. urlAnchor.href = urlAnchor.href;
  10433. crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host
  10434. } catch (e) {
  10435. crossDomain = true
  10436. }
  10437. return crossDomain
  10438. };
  10439. var setHttpTimeout = function(timeout, xhr) {
  10440. return timeout && setTimeout(function() {
  10441. xhr.customStatus = TIMEOUT;
  10442. xhr.abort()
  10443. }, timeout)
  10444. };
  10445. var getJsonpOptions = function(options) {
  10446. if ("jsonp" === options.dataType) {
  10447. var random = Math.random().toString().replace(/\D/g, "");
  10448. var callbackName = options.jsonpCallback || "dxCallback" + Date.now() + "_" + random;
  10449. var callbackParameter = options.jsonp || "callback";
  10450. options.data = options.data || {};
  10451. options.data[callbackParameter] = callbackName;
  10452. return callbackName
  10453. }
  10454. };
  10455. var getRequestOptions = function(options, headers) {
  10456. var params = options.data;
  10457. var paramsAlreadyString = "string" === typeof params;
  10458. var url = options.url || window.location.href;
  10459. if (!paramsAlreadyString && !options.cache) {
  10460. params = params || {};
  10461. params._ = Date.now()
  10462. }
  10463. if (params && !options.upload) {
  10464. if (!paramsAlreadyString) {
  10465. params = paramsConvert(params)
  10466. }
  10467. if ("GET" === getMethod(options)) {
  10468. if ("" !== params) {
  10469. url += (url.indexOf("?") > -1 ? "&" : "?") + params
  10470. }
  10471. params = null
  10472. } else {
  10473. if (headers["Content-Type"] && headers["Content-Type"].indexOf("application/x-www-form-urlencoded") > -1) {
  10474. params = params.replace(/%20/g, "+")
  10475. }
  10476. }
  10477. }
  10478. return {
  10479. url: url,
  10480. parameters: params
  10481. }
  10482. };
  10483. var getMethod = function(options) {
  10484. return (options.method || "GET").toUpperCase()
  10485. };
  10486. var getRequestHeaders = function(options) {
  10487. var headers = options.headers || {};
  10488. headers["Content-Type"] = headers["Content-Type"] || getContentTypeHeader(options);
  10489. headers.Accept = headers.Accept || getAcceptHeader(options);
  10490. if (!options.crossDomain && !headers["X-Requested-With"]) {
  10491. headers["X-Requested-With"] = "XMLHttpRequest"
  10492. }
  10493. return headers
  10494. };
  10495. var sendRequest = function(options) {
  10496. var xhr = httpRequest.getXhr();
  10497. var d = new Deferred;
  10498. var result = d.promise();
  10499. var async = isDefined(options.async) ? options.async : true;
  10500. var dataType = options.dataType;
  10501. var timeout = options.timeout || 0;
  10502. var timeoutId;
  10503. options.crossDomain = isCrossDomain(options.url);
  10504. var needScriptEvaluation = "jsonp" === dataType || "script" === dataType;
  10505. if (void 0 === options.cache) {
  10506. options.cache = !needScriptEvaluation
  10507. }
  10508. var callbackName = getJsonpOptions(options);
  10509. var headers = getRequestHeaders(options);
  10510. var requestOptions = getRequestOptions(options, headers);
  10511. var url = requestOptions.url;
  10512. var parameters = requestOptions.parameters;
  10513. if (callbackName) {
  10514. window[callbackName] = function(data) {
  10515. d.resolve(data, SUCCESS, xhr)
  10516. }
  10517. }
  10518. if (options.crossDomain && needScriptEvaluation) {
  10519. var reject = function() {
  10520. d.reject(xhr, ERROR)
  10521. };
  10522. var resolve = function() {
  10523. if ("jsonp" === dataType) {
  10524. return
  10525. }
  10526. d.resolve(null, SUCCESS, xhr)
  10527. };
  10528. evalCrossDomainScript(url).then(resolve, reject);
  10529. return result
  10530. }
  10531. if (options.crossDomain && !("withCredentials" in xhr)) {
  10532. d.reject(xhr, ERROR);
  10533. return result
  10534. }
  10535. xhr.open(getMethod(options), url, async, options.username, options.password);
  10536. if (async) {
  10537. xhr.timeout = timeout;
  10538. timeoutId = setHttpTimeout(timeout, xhr, d)
  10539. }
  10540. xhr.onreadystatechange = function(e) {
  10541. if (4 === xhr.readyState) {
  10542. clearTimeout(timeoutId);
  10543. if (isStatusSuccess(xhr.status)) {
  10544. if (hasContent(xhr.status)) {
  10545. postProcess(d, xhr, dataType)
  10546. } else {
  10547. d.resolve(null, NO_CONTENT, xhr)
  10548. }
  10549. } else {
  10550. d.reject(xhr, xhr.customStatus || ERROR)
  10551. }
  10552. }
  10553. };
  10554. if (options.upload) {
  10555. xhr.upload.onprogress = options.upload.onprogress;
  10556. xhr.upload.onloadstart = options.upload.onloadstart;
  10557. xhr.upload.onabort = options.upload.onabort
  10558. }
  10559. if (options.xhrFields) {
  10560. for (var field in options.xhrFields) {
  10561. xhr[field] = options.xhrFields[field]
  10562. }
  10563. }
  10564. if ("arraybuffer" === options.responseType) {
  10565. xhr.responseType = options.responseType
  10566. }
  10567. for (var name in headers) {
  10568. if (Object.prototype.hasOwnProperty.call(headers, name) && isDefined(headers[name])) {
  10569. xhr.setRequestHeader(name, headers[name])
  10570. }
  10571. }
  10572. if (options.beforeSend) {
  10573. options.beforeSend(xhr)
  10574. }
  10575. xhr.send(parameters);
  10576. result.abort = function() {
  10577. xhr.abort()
  10578. };
  10579. return result
  10580. };
  10581. module.exports = injector({
  10582. sendRequest: sendRequest
  10583. })
  10584. },
  10585. /*!********************************************!*\
  10586. !*** ./artifacts/transpiled/ui/overlay.js ***!
  10587. \********************************************/
  10588. /*! dynamic exports provided */
  10589. /*! all exports used */
  10590. function(module, exports, __webpack_require__) {
  10591. module.exports = __webpack_require__( /*! ./overlay/ui.overlay */ 464)
  10592. },
  10593. /*!*************************************************!*\
  10594. !*** ./artifacts/transpiled/core/utils/icon.js ***!
  10595. \*************************************************/
  10596. /*! dynamic exports provided */
  10597. /*! all exports used */
  10598. function(module, exports, __webpack_require__) {
  10599. var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
  10600. var _renderer2 = _interopRequireDefault(_renderer);
  10601. function _interopRequireDefault(obj) {
  10602. return obj && obj.__esModule ? obj : {
  10603. "default": obj
  10604. }
  10605. }
  10606. var ICON_CLASS = "dx-icon";
  10607. var SVG_ICON_CLASS = "dx-svg-icon";
  10608. var getImageSourceType = function(source) {
  10609. if (!source || "string" !== typeof source) {
  10610. return false
  10611. }
  10612. if (/^\s*<svg[^>]*>(.|\r?\n)*?<\/svg>\s*$/i.test(source)) {
  10613. return "svg"
  10614. }
  10615. if (/data:.*base64|\.|[^<\s]\//.test(source)) {
  10616. return "image"
  10617. }
  10618. if (/^[\w-_]+$/.test(source)) {
  10619. return "dxIcon"
  10620. }
  10621. if (/^\s?([\w-_]\s?)+$/.test(source)) {
  10622. return "fontIcon"
  10623. }
  10624. return false
  10625. };
  10626. var getImageContainer = function(source) {
  10627. switch (getImageSourceType(source)) {
  10628. case "image":
  10629. return (0, _renderer2.default)("<img>").attr("src", source).addClass(ICON_CLASS);
  10630. case "fontIcon":
  10631. return (0, _renderer2.default)("<i>").addClass("".concat(ICON_CLASS, " ").concat(source));
  10632. case "dxIcon":
  10633. return (0, _renderer2.default)("<i>").addClass("".concat(ICON_CLASS, " ").concat(ICON_CLASS, "-").concat(source));
  10634. case "svg":
  10635. return (0, _renderer2.default)("<i>").addClass("".concat(ICON_CLASS, " ").concat(SVG_ICON_CLASS)).append(source);
  10636. default:
  10637. return null
  10638. }
  10639. };
  10640. exports.getImageSourceType = getImageSourceType;
  10641. exports.getImageContainer = getImageContainer
  10642. },
  10643. /*!****************************************************!*\
  10644. !*** ./artifacts/transpiled/core/utils/version.js ***!
  10645. \****************************************************/
  10646. /*! dynamic exports provided */
  10647. /*! all exports used */
  10648. function(module, exports, __webpack_require__) {
  10649. exports.compare = function(x, y, maxLevel) {
  10650. function normalizeArg(value) {
  10651. if ("string" === typeof value) {
  10652. return value.split(".")
  10653. }
  10654. if ("number" === typeof value) {
  10655. return [value]
  10656. }
  10657. return value
  10658. }
  10659. x = normalizeArg(x);
  10660. y = normalizeArg(y);
  10661. var length = Math.max(x.length, y.length);
  10662. if (isFinite(maxLevel)) {
  10663. length = Math.min(length, maxLevel)
  10664. }
  10665. for (var i = 0; i < length; i++) {
  10666. var xItem = parseInt(x[i] || 0, 10);
  10667. var yItem = parseInt(y[i] || 0, 10);
  10668. if (xItem < yItem) {
  10669. return -1
  10670. }
  10671. if (xItem > yItem) {
  10672. return 1
  10673. }
  10674. }
  10675. return 0
  10676. }
  10677. },
  10678. /*!****************************!*\
  10679. !*** external "window.ko" ***!
  10680. \****************************/
  10681. /*! dynamic exports provided */
  10682. /*! all exports used */
  10683. function(module, exports) {
  10684. module.exports = window.ko
  10685. },
  10686. /*!******************************************************!*\
  10687. !*** ./artifacts/transpiled/core/utils/call_once.js ***!
  10688. \******************************************************/
  10689. /*! dynamic exports provided */
  10690. /*! all exports used */
  10691. function(module, exports, __webpack_require__) {
  10692. var callOnce = function(handler) {
  10693. var result;
  10694. var _wrappedHandler = function() {
  10695. result = handler.apply(this, arguments);
  10696. _wrappedHandler = function() {
  10697. return result
  10698. };
  10699. return result
  10700. };
  10701. return function() {
  10702. return _wrappedHandler.apply(this, arguments)
  10703. }
  10704. };
  10705. module.exports = callOnce
  10706. },
  10707. /*!***********************************************!*\
  10708. !*** ./artifacts/transpiled/format_helper.js ***!
  10709. \***********************************************/
  10710. /*! dynamic exports provided */
  10711. /*! all exports used */
  10712. function(module, exports, __webpack_require__) {
  10713. var typeUtils = __webpack_require__( /*! ./core/utils/type */ 1);
  10714. var dateUtils = __webpack_require__( /*! ./core/utils/date */ 22);
  10715. var numberLocalization = __webpack_require__( /*! ./localization/number */ 51);
  10716. var dateLocalization = __webpack_require__( /*! ./localization/date */ 32);
  10717. var dependencyInjector = __webpack_require__( /*! ./core/utils/dependency_injector */ 54);
  10718. __webpack_require__( /*! ./localization/currency */ 152);
  10719. module.exports = dependencyInjector({
  10720. format: function(value, _format) {
  10721. var formatIsValid = typeUtils.isString(_format) && "" !== _format || typeUtils.isPlainObject(_format) || typeUtils.isFunction(_format);
  10722. var valueIsValid = typeUtils.isNumeric(value) || typeUtils.isDate(value);
  10723. if (!formatIsValid || !valueIsValid) {
  10724. return typeUtils.isDefined(value) ? value.toString() : ""
  10725. }
  10726. if (typeUtils.isFunction(_format)) {
  10727. return _format(value)
  10728. }
  10729. if (typeUtils.isString(_format)) {
  10730. _format = {
  10731. type: _format
  10732. }
  10733. }
  10734. if (typeUtils.isNumeric(value)) {
  10735. return numberLocalization.format(value, _format)
  10736. }
  10737. if (typeUtils.isDate(value)) {
  10738. return dateLocalization.format(value, _format)
  10739. }
  10740. },
  10741. getTimeFormat: function(showSecond) {
  10742. return showSecond ? "longtime" : "shorttime"
  10743. },
  10744. _normalizeFormat: function(format) {
  10745. if (!Array.isArray(format)) {
  10746. return format
  10747. }
  10748. if (1 === format.length) {
  10749. return format[0]
  10750. }
  10751. return function(date) {
  10752. return format.map(function(formatPart) {
  10753. return dateLocalization.format(date, formatPart)
  10754. }).join(" ")
  10755. }
  10756. },
  10757. getDateFormatByDifferences: function(dateDifferences, intervalFormat) {
  10758. var resultFormat = [];
  10759. var needSpecialSecondFormatter = intervalFormat && dateDifferences.millisecond && !(dateDifferences.year || dateDifferences.month || dateDifferences.day);
  10760. if (needSpecialSecondFormatter) {
  10761. var secondFormatter = function(date) {
  10762. return date.getSeconds() + date.getMilliseconds() / 1e3 + "s"
  10763. };
  10764. resultFormat.push(secondFormatter)
  10765. } else {
  10766. if (dateDifferences.millisecond) {
  10767. resultFormat.push("millisecond")
  10768. }
  10769. }
  10770. if (dateDifferences.hour || dateDifferences.minute || !needSpecialSecondFormatter && dateDifferences.second) {
  10771. resultFormat.unshift(this.getTimeFormat(dateDifferences.second))
  10772. }
  10773. if (dateDifferences.year && dateDifferences.month && dateDifferences.day) {
  10774. if (intervalFormat && "month" === intervalFormat) {
  10775. return "monthandyear"
  10776. } else {
  10777. resultFormat.unshift("shortdate");
  10778. return this._normalizeFormat(resultFormat)
  10779. }
  10780. }
  10781. if (dateDifferences.year && dateDifferences.month) {
  10782. return "monthandyear"
  10783. }
  10784. if (dateDifferences.year && dateDifferences.quarter) {
  10785. return "quarterandyear"
  10786. }
  10787. if (dateDifferences.year) {
  10788. return "year"
  10789. }
  10790. if (dateDifferences.quarter) {
  10791. return "quarter"
  10792. }
  10793. if (dateDifferences.month && dateDifferences.day) {
  10794. if (intervalFormat) {
  10795. var monthDayFormatter = function(date) {
  10796. return dateLocalization.getMonthNames("abbreviated")[date.getMonth()] + " " + dateLocalization.format(date, "day")
  10797. };
  10798. resultFormat.unshift(monthDayFormatter)
  10799. } else {
  10800. resultFormat.unshift("monthandday")
  10801. }
  10802. return this._normalizeFormat(resultFormat)
  10803. }
  10804. if (dateDifferences.month) {
  10805. return "month"
  10806. }
  10807. if (dateDifferences.day) {
  10808. if (intervalFormat) {
  10809. resultFormat.unshift("day")
  10810. } else {
  10811. var dayFormatter = function(date) {
  10812. return dateLocalization.format(date, "dayofweek") + ", " + dateLocalization.format(date, "day")
  10813. };
  10814. resultFormat.unshift(dayFormatter)
  10815. }
  10816. return this._normalizeFormat(resultFormat)
  10817. }
  10818. return this._normalizeFormat(resultFormat)
  10819. },
  10820. getDateFormatByTicks: function(ticks) {
  10821. var maxDiff;
  10822. if (ticks.length > 1) {
  10823. maxDiff = dateUtils.getDatesDifferences(ticks[0], ticks[1]);
  10824. for (var i = 1; i < ticks.length - 1; i++) {
  10825. var currentDiff = dateUtils.getDatesDifferences(ticks[i], ticks[i + 1]);
  10826. if (maxDiff.count < currentDiff.count) {
  10827. maxDiff = currentDiff
  10828. }
  10829. }
  10830. } else {
  10831. maxDiff = {
  10832. year: true,
  10833. month: true,
  10834. day: true,
  10835. hour: ticks[0].getHours() > 0,
  10836. minute: ticks[0].getMinutes() > 0,
  10837. second: ticks[0].getSeconds() > 0,
  10838. millisecond: ticks[0].getMilliseconds() > 0
  10839. }
  10840. }
  10841. var resultFormat = this.getDateFormatByDifferences(maxDiff);
  10842. return resultFormat
  10843. },
  10844. getDateFormatByTickInterval: function(startValue, endValue, tickInterval) {
  10845. var dateUnitInterval;
  10846. var dateDifferencesConverter = {
  10847. week: "day"
  10848. };
  10849. var correctDateDifferences = function(dateDifferences, tickInterval, value) {
  10850. switch (tickInterval) {
  10851. case "year":
  10852. case "quarter":
  10853. dateDifferences.month = value;
  10854. case "month":
  10855. dateDifferences.day = value;
  10856. case "week":
  10857. case "day":
  10858. dateDifferences.hour = value;
  10859. case "hour":
  10860. dateDifferences.minute = value;
  10861. case "minute":
  10862. dateDifferences.second = value;
  10863. case "second":
  10864. dateDifferences.millisecond = value
  10865. }
  10866. };
  10867. var correctDifferencesByMaxDate = function(differences, minDate, maxDate) {
  10868. if (!maxDate.getMilliseconds() && maxDate.getSeconds()) {
  10869. if (maxDate.getSeconds() - minDate.getSeconds() === 1) {
  10870. differences.millisecond = true;
  10871. differences.second = false
  10872. }
  10873. } else {
  10874. if (!maxDate.getSeconds() && maxDate.getMinutes()) {
  10875. if (maxDate.getMinutes() - minDate.getMinutes() === 1) {
  10876. differences.second = true;
  10877. differences.minute = false
  10878. }
  10879. } else {
  10880. if (!maxDate.getMinutes() && maxDate.getHours()) {
  10881. if (maxDate.getHours() - minDate.getHours() === 1) {
  10882. differences.minute = true;
  10883. differences.hour = false
  10884. }
  10885. } else {
  10886. if (!maxDate.getHours() && maxDate.getDate() > 1) {
  10887. if (maxDate.getDate() - minDate.getDate() === 1) {
  10888. differences.hour = true;
  10889. differences.day = false
  10890. }
  10891. } else {
  10892. if (1 === maxDate.getDate() && maxDate.getMonth()) {
  10893. if (maxDate.getMonth() - minDate.getMonth() === 1) {
  10894. differences.day = true;
  10895. differences.month = false
  10896. }
  10897. } else {
  10898. if (!maxDate.getMonth() && maxDate.getFullYear()) {
  10899. if (maxDate.getFullYear() - minDate.getFullYear() === 1) {
  10900. differences.month = true;
  10901. differences.year = false
  10902. }
  10903. }
  10904. }
  10905. }
  10906. }
  10907. }
  10908. }
  10909. };
  10910. tickInterval = typeUtils.isString(tickInterval) ? tickInterval.toLowerCase() : tickInterval;
  10911. var dateDifferences = dateUtils.getDatesDifferences(startValue, endValue);
  10912. if (startValue !== endValue) {
  10913. correctDifferencesByMaxDate(dateDifferences, startValue > endValue ? endValue : startValue, startValue > endValue ? startValue : endValue)
  10914. }
  10915. dateUnitInterval = dateUtils.getDateUnitInterval(dateDifferences);
  10916. correctDateDifferences(dateDifferences, dateUnitInterval, true);
  10917. dateUnitInterval = dateUtils.getDateUnitInterval(tickInterval || "second");
  10918. correctDateDifferences(dateDifferences, dateUnitInterval, false);
  10919. dateDifferences[dateDifferencesConverter[dateUnitInterval] || dateUnitInterval] = true;
  10920. var resultFormat = this.getDateFormatByDifferences(dateDifferences);
  10921. return resultFormat
  10922. }
  10923. })
  10924. },
  10925. /*!*************************************************************!*\
  10926. !*** ./artifacts/transpiled/ui/widget/bindable_template.js ***!
  10927. \*************************************************************/
  10928. /*! dynamic exports provided */
  10929. /*! all exports used */
  10930. function(module, exports, __webpack_require__) {
  10931. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  10932. var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
  10933. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  10934. var removeEvent = __webpack_require__( /*! ../../core/remove_event */ 132);
  10935. var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  10936. var isPrimitive = __webpack_require__( /*! ../../core/utils/type */ 1).isPrimitive;
  10937. var watchChanges = function() {
  10938. var start = function(rawData, watchMethod, fields, fieldsMap, callback) {
  10939. var fieldsDispose;
  10940. var globalDispose = globalWatch(rawData, watchMethod, function(dataWithRawFields) {
  10941. fieldsDispose && fieldsDispose();
  10942. if (isPrimitive(dataWithRawFields)) {
  10943. callback(dataWithRawFields);
  10944. return
  10945. }
  10946. fieldsDispose = fieldsWatch(dataWithRawFields, watchMethod, fields, fieldsMap, function(data) {
  10947. callback(data)
  10948. })
  10949. });
  10950. return function() {
  10951. fieldsDispose && fieldsDispose();
  10952. globalDispose && globalDispose()
  10953. }
  10954. };
  10955. var globalWatch = function(data, watchMethod, callback) {
  10956. return watchMethod(function() {
  10957. return data
  10958. }, callback)
  10959. };
  10960. var fieldsWatch = function(data, watchMethod, fields, fieldsMap, callback) {
  10961. var resolvedData = {};
  10962. var missedFields = fields.slice();
  10963. var watchHandlers = iteratorUtils.map(fields, function(name) {
  10964. var fieldGetter = fieldsMap[name];
  10965. return watchMethod(fieldGetter ? function() {
  10966. return fieldGetter(data)
  10967. } : function() {
  10968. return data[name]
  10969. }, function(value) {
  10970. resolvedData[name] = value;
  10971. if (missedFields.length) {
  10972. var index = missedFields.indexOf(name);
  10973. if (index >= 0) {
  10974. missedFields.splice(index, 1)
  10975. }
  10976. }
  10977. if (!missedFields.length) {
  10978. callback(resolvedData)
  10979. }
  10980. })
  10981. });
  10982. return function() {
  10983. iteratorUtils.each(watchHandlers, function(_, dispose) {
  10984. dispose()
  10985. })
  10986. }
  10987. };
  10988. return start
  10989. }();
  10990. module.exports = TemplateBase.inherit({
  10991. ctor: function(render, fields, watchMethod, fieldsMap) {
  10992. this._render = render;
  10993. this._fields = fields;
  10994. this._fieldsMap = fieldsMap || {};
  10995. this._watchMethod = watchMethod
  10996. },
  10997. _renderCore: function(options) {
  10998. var $container = $(options.container);
  10999. var dispose = watchChanges(options.model, this._watchMethod, this._fields, this._fieldsMap, function(data) {
  11000. $container.empty();
  11001. this._render($container, data, options.model)
  11002. }.bind(this));
  11003. eventsEngine.on($container, removeEvent, dispose);
  11004. return $container.contents()
  11005. }
  11006. })
  11007. },
  11008. /*!*****************************************************!*\
  11009. !*** ./artifacts/transpiled/ui/widget/selectors.js ***!
  11010. \*****************************************************/
  11011. /*! dynamic exports provided */
  11012. /*! all exports used */
  11013. function(module, exports, __webpack_require__) {
  11014. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  11015. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  11016. var _focusable = function(element, tabIndex) {
  11017. if (!visible(element)) {
  11018. return false
  11019. }
  11020. var nodeName = element.nodeName.toLowerCase();
  11021. var isTabIndexNotNaN = !isNaN(tabIndex);
  11022. var isDisabled = element.disabled;
  11023. var isDefaultFocus = /^(input|select|textarea|button|object|iframe)$/.test(nodeName);
  11024. var isHyperlink = "a" === nodeName;
  11025. var isFocusable = true;
  11026. var isContentEditable = element.isContentEditable;
  11027. if (isDefaultFocus || isContentEditable) {
  11028. isFocusable = !isDisabled
  11029. } else {
  11030. if (isHyperlink) {
  11031. isFocusable = element.href || isTabIndexNotNaN
  11032. } else {
  11033. isFocusable = isTabIndexNotNaN
  11034. }
  11035. }
  11036. return isFocusable
  11037. };
  11038. var visible = function(element) {
  11039. var $element = $(element);
  11040. return $element.is(":visible") && "hidden" !== $element.css("visibility") && "hidden" !== $element.parents().css("visibility")
  11041. };
  11042. module.exports = {
  11043. focusable: function(index, element) {
  11044. return _focusable(element, $(element).attr("tabIndex"))
  11045. },
  11046. tabbable: function(index, element) {
  11047. var tabIndex = $(element).attr("tabIndex");
  11048. return (isNaN(tabIndex) || tabIndex >= 0) && _focusable(element, tabIndex)
  11049. },
  11050. focused: function($element) {
  11051. var element = $($element).get(0);
  11052. return domAdapter.getActiveElement() === element
  11053. }
  11054. }
  11055. },
  11056. /*!****************************************************!*\
  11057. !*** ./artifacts/transpiled/core/dom_component.js ***!
  11058. \****************************************************/
  11059. /*! dynamic exports provided */
  11060. /*! all exports used */
  11061. function(module, exports, __webpack_require__) {
  11062. var _renderer = __webpack_require__( /*! ../core/renderer */ 2);
  11063. var _renderer2 = _interopRequireDefault(_renderer);
  11064. var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5);
  11065. var _events_engine2 = _interopRequireDefault(_events_engine);
  11066. var _window = __webpack_require__( /*! ../core/utils/window */ 7);
  11067. var _window2 = _interopRequireDefault(_window);
  11068. var _extend = __webpack_require__( /*! ./utils/extend */ 0);
  11069. var _config = __webpack_require__( /*! ./config */ 31);
  11070. var _config2 = _interopRequireDefault(_config);
  11071. var _errors = __webpack_require__( /*! ./errors */ 21);
  11072. var _errors2 = _interopRequireDefault(_errors);
  11073. var _dom = __webpack_require__( /*! ../core/utils/dom */ 12);
  11074. var _resize_callbacks = __webpack_require__( /*! ../core/utils/resize_callbacks */ 130);
  11075. var _resize_callbacks2 = _interopRequireDefault(_resize_callbacks);
  11076. var _common = __webpack_require__( /*! ./utils/common */ 4);
  11077. var _common2 = _interopRequireDefault(_common);
  11078. var _iterator = __webpack_require__( /*! ./utils/iterator */ 3);
  11079. var _type = __webpack_require__( /*! ./utils/type */ 1);
  11080. var _array = __webpack_require__( /*! ./utils/array */ 14);
  11081. var _public_component = __webpack_require__( /*! ./utils/public_component */ 131);
  11082. var _public_component2 = _interopRequireDefault(_public_component);
  11083. var _element_data = __webpack_require__( /*! ./element_data */ 39);
  11084. var _element_data2 = _interopRequireDefault(_element_data);
  11085. var _component = __webpack_require__( /*! ./component */ 133);
  11086. var _component2 = _interopRequireDefault(_component);
  11087. function _interopRequireDefault(obj) {
  11088. return obj && obj.__esModule ? obj : {
  11089. "default": obj
  11090. }
  11091. }
  11092. var abstract = _component2.default.abstract;
  11093. var RTL_DIRECTION_CLASS = "dx-rtl";
  11094. var VISIBILITY_CHANGE_CLASS = "dx-visibility-change-handler";
  11095. var VISIBILITY_CHANGE_EVENTNAMESPACE = "VisibilityChange";
  11096. var DOMComponent = _component2.default.inherit({
  11097. _getDefaultOptions: function() {
  11098. return (0, _extend.extend)(this.callBase(), {
  11099. width: void 0,
  11100. height: void 0,
  11101. rtlEnabled: (0, _config2.default)().rtlEnabled,
  11102. elementAttr: {},
  11103. disabled: false,
  11104. integrationOptions: {}
  11105. })
  11106. },
  11107. ctor: function(element, options) {
  11108. this._$element = (0, _renderer2.default)(element);
  11109. _public_component2.default.attachInstanceToElement(this._$element, this, this._dispose);
  11110. this.callBase(options)
  11111. },
  11112. _getSynchronizableOptionsForCreateComponent: function() {
  11113. return ["rtlEnabled", "disabled", "templatesRenderAsynchronously"]
  11114. },
  11115. _visibilityChanged: abstract,
  11116. _dimensionChanged: abstract,
  11117. _init: function() {
  11118. this.callBase();
  11119. this._attachWindowResizeCallback()
  11120. },
  11121. _setOptionsByDevice: function(instanceCustomRules) {
  11122. this.callBase([].concat(this.constructor._classCustomRules || [], instanceCustomRules || []))
  11123. },
  11124. _isInitialOptionValue: function(name) {
  11125. var isCustomOption = this.constructor._classCustomRules && Object.prototype.hasOwnProperty.call(this._convertRulesToOptions(this.constructor._classCustomRules), name);
  11126. return !isCustomOption && this.callBase(name)
  11127. },
  11128. _attachWindowResizeCallback: function() {
  11129. if (this._isDimensionChangeSupported()) {
  11130. var windowResizeCallBack = this._windowResizeCallBack = this._dimensionChanged.bind(this);
  11131. _resize_callbacks2.default.add(windowResizeCallBack)
  11132. }
  11133. },
  11134. _isDimensionChangeSupported: function() {
  11135. return this._dimensionChanged !== abstract
  11136. },
  11137. _renderComponent: function() {
  11138. this._initMarkup();
  11139. if (_window2.default.hasWindow()) {
  11140. this._render()
  11141. }
  11142. },
  11143. _initMarkup: function() {
  11144. this._renderElementAttributes();
  11145. this._toggleRTLDirection(this.option("rtlEnabled"));
  11146. this._renderVisibilityChange();
  11147. this._renderDimensions()
  11148. },
  11149. _render: function() {
  11150. this._attachVisibilityChangeHandlers()
  11151. },
  11152. _renderElementAttributes: function() {
  11153. var attributes = (0, _extend.extend)({}, this.option("elementAttr"));
  11154. var classNames = attributes.class;
  11155. delete attributes.class;
  11156. this.$element().attr(attributes).addClass(classNames)
  11157. },
  11158. _renderVisibilityChange: function() {
  11159. if (this._isDimensionChangeSupported()) {
  11160. this._attachDimensionChangeHandlers()
  11161. }
  11162. if (!this._isVisibilityChangeSupported()) {
  11163. return
  11164. }
  11165. this.$element().addClass(VISIBILITY_CHANGE_CLASS)
  11166. },
  11167. _renderDimensions: function() {
  11168. var $element = this.$element();
  11169. var element = $element.get(0);
  11170. var width = this._getOptionValue("width", element);
  11171. var height = this._getOptionValue("height", element);
  11172. if (this._isCssUpdateRequired(element, height, width)) {
  11173. $element.css({
  11174. width: null === width ? "" : width,
  11175. height: null === height ? "" : height
  11176. })
  11177. }
  11178. },
  11179. _isCssUpdateRequired: function(element, height, width) {
  11180. return !!((0, _type.isDefined)(width) || (0, _type.isDefined)(height) || element.style.width || element.style.height)
  11181. },
  11182. _attachDimensionChangeHandlers: function() {
  11183. var that = this;
  11184. var resizeEventName = "dxresize." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE;
  11185. _events_engine2.default.off(that.$element(), resizeEventName);
  11186. _events_engine2.default.on(that.$element(), resizeEventName, function() {
  11187. that._dimensionChanged()
  11188. })
  11189. },
  11190. _attachVisibilityChangeHandlers: function() {
  11191. if (!this._isVisibilityChangeSupported()) {
  11192. return
  11193. }
  11194. var that = this;
  11195. var hidingEventName = "dxhiding." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE;
  11196. var shownEventName = "dxshown." + this.NAME + VISIBILITY_CHANGE_EVENTNAMESPACE;
  11197. that._isHidden = !that._isVisible();
  11198. _events_engine2.default.off(that.$element(), hidingEventName);
  11199. _events_engine2.default.on(that.$element(), hidingEventName, function() {
  11200. that._checkVisibilityChanged("hiding")
  11201. });
  11202. _events_engine2.default.off(that.$element(), shownEventName);
  11203. _events_engine2.default.on(that.$element(), shownEventName, function() {
  11204. that._checkVisibilityChanged("shown")
  11205. })
  11206. },
  11207. _isVisible: function() {
  11208. return this.$element().is(":visible")
  11209. },
  11210. _checkVisibilityChanged: function(event) {
  11211. if ("hiding" === event && this._isVisible() && !this._isHidden) {
  11212. this._visibilityChanged(false);
  11213. this._isHidden = true
  11214. } else {
  11215. if ("shown" === event && this._isVisible() && this._isHidden) {
  11216. this._isHidden = false;
  11217. this._visibilityChanged(true)
  11218. }
  11219. }
  11220. },
  11221. _isVisibilityChangeSupported: function() {
  11222. return this._visibilityChanged !== abstract && _window2.default.hasWindow()
  11223. },
  11224. _clean: _common2.default.noop,
  11225. _modelByElement: function() {
  11226. var modelByElement = this.option("modelByElement") || _common2.default.noop;
  11227. return modelByElement(this.$element())
  11228. },
  11229. _invalidate: function() {
  11230. if (!this._updateLockCount) {
  11231. throw _errors2.default.Error("E0007")
  11232. }
  11233. this._requireRefresh = true
  11234. },
  11235. _refresh: function() {
  11236. this._clean();
  11237. this._renderComponent()
  11238. },
  11239. _dispose: function() {
  11240. this.callBase();
  11241. this._clean();
  11242. this._detachWindowResizeCallback()
  11243. },
  11244. _detachWindowResizeCallback: function() {
  11245. if (this._isDimensionChangeSupported()) {
  11246. _resize_callbacks2.default.remove(this._windowResizeCallBack)
  11247. }
  11248. },
  11249. _toggleRTLDirection: function(rtl) {
  11250. this.$element().toggleClass(RTL_DIRECTION_CLASS, rtl)
  11251. },
  11252. _createComponent: function(element, component, config) {
  11253. var _this = this;
  11254. var that = this;
  11255. config = config || {};
  11256. var synchronizableOptions = _common2.default.grep(this._getSynchronizableOptionsForCreateComponent(), function(value) {
  11257. return !(value in config)
  11258. });
  11259. var nestedComponentOptions = that.option("nestedComponentOptions") || _common2.default.noop;
  11260. var nestedComponentConfig = (0, _extend.extend)({
  11261. integrationOptions: this.option("integrationOptions")
  11262. }, nestedComponentOptions(this));
  11263. synchronizableOptions.forEach(function(optionName) {
  11264. nestedComponentConfig[optionName] = _this.option(optionName)
  11265. });
  11266. that._extendConfig(config, nestedComponentConfig);
  11267. var instance;
  11268. if ((0, _type.isString)(component)) {
  11269. var $element = (0, _renderer2.default)(element)[component](config);
  11270. instance = $element[component]("instance")
  11271. } else {
  11272. if (element) {
  11273. instance = component.getInstance(element);
  11274. if (instance) {
  11275. instance.option(config)
  11276. } else {
  11277. instance = new component(element, config)
  11278. }
  11279. }
  11280. }
  11281. if (instance) {
  11282. var optionChangedHandler = function(args) {
  11283. if ((0, _array.inArray)(args.name, synchronizableOptions) >= 0) {
  11284. instance.option(args.name, args.value)
  11285. }
  11286. };
  11287. that.on("optionChanged", optionChangedHandler);
  11288. instance.on("disposing", function() {
  11289. that.off("optionChanged", optionChangedHandler)
  11290. })
  11291. }
  11292. return instance
  11293. },
  11294. _extendConfig: function(config, extendConfig) {
  11295. (0, _iterator.each)(extendConfig, function(key, value) {
  11296. config[key] = Object.prototype.hasOwnProperty.call(config, key) ? config[key] : value
  11297. })
  11298. },
  11299. _defaultActionConfig: function() {
  11300. return (0, _extend.extend)(this.callBase(), {
  11301. context: this._modelByElement(this.$element())
  11302. })
  11303. },
  11304. _defaultActionArgs: function() {
  11305. var model = this._modelByElement(this.$element());
  11306. return (0, _extend.extend)(this.callBase(), {
  11307. element: this.element(),
  11308. model: model
  11309. })
  11310. },
  11311. _optionChanged: function(args) {
  11312. switch (args.name) {
  11313. case "width":
  11314. case "height":
  11315. this._renderDimensions();
  11316. break;
  11317. case "rtlEnabled":
  11318. this._invalidate();
  11319. break;
  11320. case "elementAttr":
  11321. this._renderElementAttributes();
  11322. break;
  11323. case "disabled":
  11324. case "integrationOptions":
  11325. break;
  11326. default:
  11327. this.callBase(args)
  11328. }
  11329. },
  11330. _removeAttributes: function(element) {
  11331. var i = element.attributes.length - 1;
  11332. for (; i >= 0; i--) {
  11333. var attribute = element.attributes[i];
  11334. if (!attribute) {
  11335. return
  11336. }
  11337. var attributeName = attribute.name;
  11338. if (0 === attributeName.indexOf("aria-") || attributeName.indexOf("dx-") !== -1 || "role" === attributeName || "style" === attributeName || "tabindex" === attributeName) {
  11339. element.removeAttribute(attributeName)
  11340. }
  11341. }
  11342. },
  11343. _removeClasses: function(element) {
  11344. var classes = element.className.split(" ").filter(function(cssClass) {
  11345. return 0 !== cssClass.lastIndexOf("dx-", 0)
  11346. });
  11347. element.className = classes.join(" ")
  11348. },
  11349. endUpdate: function() {
  11350. var requireRender = !this._initializing && !this._initialized;
  11351. this.callBase.apply(this, arguments);
  11352. if (!this._updateLockCount) {
  11353. if (requireRender) {
  11354. this._renderComponent()
  11355. } else {
  11356. if (this._requireRefresh) {
  11357. this._requireRefresh = false;
  11358. this._refresh()
  11359. }
  11360. }
  11361. }
  11362. },
  11363. $element: function() {
  11364. return this._$element
  11365. },
  11366. element: function() {
  11367. return (0, _dom.getPublicElement)(this.$element())
  11368. },
  11369. dispose: function() {
  11370. var element = this.$element().get(0);
  11371. _element_data2.default.cleanDataRecursive(element, true);
  11372. element.textContent = "";
  11373. this._removeAttributes(element);
  11374. this._removeClasses(element)
  11375. }
  11376. });
  11377. DOMComponent.getInstance = function(element) {
  11378. return _public_component2.default.getInstanceByElement((0, _renderer2.default)(element), this)
  11379. };
  11380. DOMComponent.defaultOptions = function(rule) {
  11381. this._classCustomRules = this._classCustomRules || [];
  11382. this._classCustomRules.push(rule)
  11383. };
  11384. module.exports = DOMComponent
  11385. },
  11386. /*!**************************************************!*\
  11387. !*** ./artifacts/transpiled/data/array_store.js ***!
  11388. \**************************************************/
  11389. /*! dynamic exports provided */
  11390. /*! all exports used */
  11391. function(module, exports, __webpack_require__) {
  11392. var _utils = __webpack_require__( /*! ./utils */ 41);
  11393. var _query = __webpack_require__( /*! ./query */ 42);
  11394. var _query2 = _interopRequireDefault(_query);
  11395. var _errors = __webpack_require__( /*! ./errors */ 36);
  11396. var _abstract_store = __webpack_require__( /*! ./abstract_store */ 98);
  11397. var _abstract_store2 = _interopRequireDefault(_abstract_store);
  11398. var _array_utils = __webpack_require__( /*! ./array_utils */ 135);
  11399. var _array_utils2 = _interopRequireDefault(_array_utils);
  11400. function _interopRequireDefault(obj) {
  11401. return obj && obj.__esModule ? obj : {
  11402. "default": obj
  11403. }
  11404. }
  11405. var ArrayStore = _abstract_store2.default.inherit({
  11406. ctor: function(options) {
  11407. if (Array.isArray(options)) {
  11408. options = {
  11409. data: options
  11410. }
  11411. } else {
  11412. options = options || {}
  11413. }
  11414. this.callBase(options);
  11415. var initialArray = options.data;
  11416. if (initialArray && !Array.isArray(initialArray)) {
  11417. throw _errors.errors.Error("E4006")
  11418. }
  11419. this._array = initialArray || []
  11420. },
  11421. createQuery: function() {
  11422. return (0, _query2.default)(this._array, {
  11423. errorHandler: this._errorHandler
  11424. })
  11425. },
  11426. _byKeyImpl: function(key) {
  11427. var index = _array_utils2.default.indexByKey(this, this._array, key);
  11428. if (index === -1) {
  11429. return (0, _utils.rejectedPromise)(_errors.errors.Error("E4009"))
  11430. }
  11431. return (0, _utils.trivialPromise)(this._array[index])
  11432. },
  11433. _insertImpl: function(values) {
  11434. return _array_utils2.default.insert(this, this._array, values)
  11435. },
  11436. _pushImpl: function(changes) {
  11437. _array_utils2.default.applyBatch(this, this._array, changes)
  11438. },
  11439. _updateImpl: function(key, values) {
  11440. return _array_utils2.default.update(this, this._array, key, values)
  11441. },
  11442. _removeImpl: function(key) {
  11443. return _array_utils2.default.remove(this, this._array, key)
  11444. },
  11445. clear: function() {
  11446. this.fireEvent("modifying");
  11447. this._array = [];
  11448. this.fireEvent("modified")
  11449. }
  11450. }, "array");
  11451. module.exports = ArrayStore
  11452. }, ,
  11453. /*!************************************************************!*\
  11454. !*** ./artifacts/transpiled/viz/tree_map/tree_map.base.js ***!
  11455. \************************************************************/
  11456. /*! dynamic exports provided */
  11457. /*! all exports used */
  11458. function(module, exports, __webpack_require__) {
  11459. var _common = __webpack_require__( /*! ./common */ 251);
  11460. var _node = __webpack_require__( /*! ./node */ 166);
  11461. var _node2 = _interopRequireDefault(_node);
  11462. var _tiling = __webpack_require__( /*! ./tiling */ 120);
  11463. var _colorizing = __webpack_require__( /*! ./colorizing */ 121);
  11464. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  11465. var _common2 = __webpack_require__( /*! ../../core/utils/common */ 4);
  11466. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  11467. var _extend2 = __webpack_require__( /*! ../../core/utils/extend */ 0);
  11468. function _interopRequireDefault(obj) {
  11469. return obj && obj.__esModule ? obj : {
  11470. "default": obj
  11471. }
  11472. }
  11473. var _max = Math.max;
  11474. var directions = {
  11475. lefttoprightbottom: [1, 1],
  11476. leftbottomrighttop: [1, -1],
  11477. righttopleftbottom: [-1, 1],
  11478. rightbottomlefttop: [-1, -1]
  11479. };
  11480. __webpack_require__( /*! ./tiling.squarified */ 419);
  11481. __webpack_require__( /*! ./tiling */ 120).setDefaultAlgorithm("squarified");
  11482. __webpack_require__( /*! ./colorizing.discrete */ 421);
  11483. __webpack_require__( /*! ./colorizing */ 121).setDefaultColorizer("discrete");
  11484. function pickPositiveInteger(val) {
  11485. return val > 0 ? Math.round(val) : 0
  11486. }
  11487. var dxTreeMap = __webpack_require__( /*! ../core/base_widget */ 96).inherit({
  11488. _handlers: {
  11489. beginBuildNodes: _common2.noop,
  11490. buildNode: _common2.noop,
  11491. endBuildNodes: _common2.noop,
  11492. setTrackerData: _common2.noop,
  11493. calculateState: function(options) {
  11494. return (0, _common.buildRectAppearance)(options)
  11495. }
  11496. },
  11497. _rootClass: "dxtm-tree-map",
  11498. _rootClassPrefix: "dxtm",
  11499. _getDefaultSize: function() {
  11500. return {
  11501. width: 400,
  11502. height: 400
  11503. }
  11504. },
  11505. _setDeprecatedOptions: function() {
  11506. this.callBase.apply(this, arguments);
  11507. (0, _extend2.extend)(this._deprecatedOptions, {
  11508. resolveLabelOverflow: {
  11509. since: "19.1",
  11510. message: "Use the 'tile.label.overflow' and 'group.label.textOverflow' option instead"
  11511. }
  11512. })
  11513. },
  11514. _themeSection: "treeMap",
  11515. _fontFields: ["tile.label.font", "group.label.font"],
  11516. _init: function() {
  11517. var that = this;
  11518. that._rectOffsets = {};
  11519. that._handlers = Object.create(that._handlers);
  11520. that._context = {
  11521. suspend: function() {
  11522. if (!that._applyingChanges) {
  11523. that._suspendChanges()
  11524. }
  11525. },
  11526. resume: function() {
  11527. if (!that._applyingChanges) {
  11528. that._resumeChanges()
  11529. }
  11530. },
  11531. change: function(codes) {
  11532. that._change(codes)
  11533. },
  11534. settings: [{}, {}],
  11535. calculateState: that._handlers.calculateState,
  11536. calculateLabelState: _common.buildTextAppearance
  11537. };
  11538. that._root = that._topNode = {
  11539. nodes: []
  11540. };
  11541. that.callBase.apply(that, arguments)
  11542. },
  11543. _initialChanges: ["DATA_SOURCE"],
  11544. _initCore: function() {
  11545. var that = this;
  11546. var renderer = that._renderer;
  11547. that._createProxyType();
  11548. that._tilesGroup = renderer.g().linkOn(renderer.root, "tiles").linkAppend();
  11549. that._labelsGroup = renderer.g().linkOn(renderer.root, "labels").linkAppend()
  11550. },
  11551. _createProxyType: _common2.noop,
  11552. _disposeCore: function() {
  11553. var that = this;
  11554. that._filter && that._filter.dispose();
  11555. that._labelsGroup.linkOff();
  11556. that._tilesGroup.linkOff()
  11557. },
  11558. _applySize: function(rect) {
  11559. this._tilingRect = rect.slice();
  11560. this._change(["TILING"])
  11561. },
  11562. _optionChangesMap: {
  11563. dataSource: "DATA_SOURCE",
  11564. valueField: "NODES_CREATE",
  11565. childrenField: "NODES_CREATE",
  11566. colorField: "TILES",
  11567. colorizer: "TILES",
  11568. labelField: "LABELS",
  11569. tile: "TILE_SETTINGS",
  11570. group: "GROUP_SETTINGS",
  11571. maxDepth: "MAX_DEPTH",
  11572. layoutAlgorithm: "TILING",
  11573. layoutDirection: "TILING",
  11574. resolveLabelOverflow: "LABEL_OVERFLOW"
  11575. },
  11576. _themeDependentChanges: ["TILE_SETTINGS", "GROUP_SETTINGS", "MAX_DEPTH"],
  11577. _changeDataSource: function() {
  11578. var that = this;
  11579. that._isDataExpected = that._isSyncData = true;
  11580. that._updateDataSource();
  11581. that._isSyncData = false;
  11582. if (that._isDataExpected) {
  11583. that._suspendChanges()
  11584. }
  11585. },
  11586. _dataSourceChangedHandler: function() {
  11587. var that = this;
  11588. if (that._isDataExpected) {
  11589. that._isDataExpected = false;
  11590. that._change(["NODES_CREATE"]);
  11591. if (!that._isSyncData) {
  11592. that._resumeChanges()
  11593. }
  11594. } else {
  11595. that._requestChange(["NODES_CREATE"])
  11596. }
  11597. },
  11598. _optionChangesOrder: ["DATA_SOURCE", "TILE_SETTINGS", "GROUP_SETTINGS", "MAX_DEPTH", "LABEL_OVERFLOW"],
  11599. _change_DATA_SOURCE: function() {
  11600. this._changeDataSource()
  11601. },
  11602. _change_TILE_SETTINGS: function() {
  11603. this._changeTileSettings()
  11604. },
  11605. _change_GROUP_SETTINGS: function() {
  11606. this._changeGroupSettings()
  11607. },
  11608. _change_LABEL_OVERFLOW: function() {
  11609. this._changeTileSettings();
  11610. this._changeGroupSettings()
  11611. },
  11612. _change_MAX_DEPTH: function() {
  11613. this._changeMaxDepth()
  11614. },
  11615. _customChangesOrder: ["NODES_CREATE", "NODES_RESET", "TILES", "LABELS", "TILING", "LABELS_LAYOUT"],
  11616. _change_NODES_CREATE: function() {
  11617. this._buildNodes()
  11618. },
  11619. _change_NODES_RESET: function() {
  11620. this._resetNodes()
  11621. },
  11622. _change_TILES: function() {
  11623. this._applyTilesAppearance()
  11624. },
  11625. _change_LABELS: function() {
  11626. this._applyLabelsAppearance()
  11627. },
  11628. _change_TILING: function() {
  11629. this._performTiling()
  11630. },
  11631. _change_LABELS_LAYOUT: function() {
  11632. this._performLabelsLayout()
  11633. },
  11634. _applyChanges: function() {
  11635. var that = this;
  11636. that.callBase.apply(that, arguments);
  11637. if (!that._isDataExpected) {
  11638. that._drawn()
  11639. }
  11640. that._context.forceReset = false
  11641. },
  11642. _buildNodes: function() {
  11643. var that = this;
  11644. var root = that._root = that._topNode = new _node2.default;
  11645. root._id = 0;
  11646. root.parent = {};
  11647. root.data = {};
  11648. root.level = root.index = -1;
  11649. root.ctx = that._context;
  11650. root.label = null;
  11651. that._nodes = [root];
  11652. that._handlers.beginBuildNodes();
  11653. var processedData = that._processDataSourceItems(that._dataSourceItems() || []);
  11654. traverseDataItems(root, processedData.items, 0, {
  11655. itemsField: !processedData.isPlain && that._getOption("childrenField", true) || "items",
  11656. valueField: that._getOption("valueField", true) || "value",
  11657. buildNode: that._handlers.buildNode,
  11658. ctx: that._context,
  11659. nodes: that._nodes
  11660. });
  11661. that._onNodesCreated();
  11662. that._handlers.endBuildNodes();
  11663. that._change(["NODES_RESET"])
  11664. },
  11665. _onNodesCreated: _common2.noop,
  11666. _processDataSourceItems: function(items) {
  11667. return {
  11668. items: items,
  11669. isPlain: false
  11670. }
  11671. },
  11672. _changeTileSettings: function() {
  11673. var that = this;
  11674. var options = that._getOption("tile");
  11675. var offsets = that._rectOffsets;
  11676. var borderWidth = pickPositiveInteger(options.border.width);
  11677. var edgeOffset = borderWidth / 2;
  11678. var innerOffset = 1 & borderWidth ? .5 : 0;
  11679. var labelOptions = options.label;
  11680. var settings = that._context.settings[0];
  11681. that._change(["TILES", "LABELS"]);
  11682. settings.state = that._handlers.calculateState(options);
  11683. that._filter = that._filter || that._renderer.shadowFilter("-50%", "-50%", "200%", "200%");
  11684. that._filter.attr(labelOptions.shadow);
  11685. that._calculateLabelSettings(settings, labelOptions, that._filter.id);
  11686. if (offsets.tileEdge !== edgeOffset || offsets.tileInner !== innerOffset) {
  11687. offsets.tileEdge = edgeOffset;
  11688. offsets.tileInner = innerOffset;
  11689. that._change(["TILING"])
  11690. }
  11691. },
  11692. _changeGroupSettings: function() {
  11693. var that = this;
  11694. var options = that._getOption("group");
  11695. var labelOptions = options.label;
  11696. var offsets = that._rectOffsets;
  11697. var borderWidth = pickPositiveInteger(options.border.width);
  11698. var edgeOffset = borderWidth / 2;
  11699. var innerOffset = 1 & borderWidth ? .5 : 0;
  11700. var headerHeight = 0;
  11701. var groupPadding = pickPositiveInteger(options.padding);
  11702. var settings = that._context.settings[1];
  11703. that._change(["TILES", "LABELS"]);
  11704. settings.state = that._handlers.calculateState(options);
  11705. that._calculateLabelSettings(settings, labelOptions);
  11706. if (options.headerHeight >= 0) {
  11707. headerHeight = pickPositiveInteger(options.headerHeight)
  11708. } else {
  11709. headerHeight = settings.labelParams.height + 2 * pickPositiveInteger(labelOptions.paddingTopBottom)
  11710. }
  11711. if (that._headerHeight !== headerHeight) {
  11712. that._headerHeight = headerHeight;
  11713. that._change(["TILING"])
  11714. }
  11715. if (that._groupPadding !== groupPadding) {
  11716. that._groupPadding = groupPadding;
  11717. that._change(["TILING"])
  11718. }
  11719. if (offsets.headerEdge !== edgeOffset || offsets.headerInner !== innerOffset) {
  11720. offsets.headerEdge = edgeOffset;
  11721. offsets.headerInner = innerOffset;
  11722. that._change(["TILING"])
  11723. }
  11724. },
  11725. _calculateLabelSettings: function(settings, options, filter) {
  11726. var bBox = this._getTextBBox(options.font);
  11727. var paddingLeftRight = pickPositiveInteger(options.paddingLeftRight);
  11728. var paddingTopBottom = pickPositiveInteger(options.paddingTopBottom);
  11729. var tileLabelOptions = this._getOption("tile.label");
  11730. var groupLabelOptions = this._getOption("group.label");
  11731. settings.labelState = (0, _common.buildTextAppearance)(options, filter);
  11732. settings.labelState.visible = !("visible" in options) || !!options.visible;
  11733. this._suppressDeprecatedWarnings();
  11734. settings.labelParams = {
  11735. height: bBox.height,
  11736. rtlEnabled: this._getOption("rtlEnabled", true),
  11737. paddingTopBottom: paddingTopBottom,
  11738. paddingLeftRight: paddingLeftRight,
  11739. resolveLabelOverflow: this._getOption("resolveLabelOverflow", true),
  11740. tileLabelWordWrap: tileLabelOptions.wordWrap,
  11741. tileLabelOverflow: tileLabelOptions.textOverflow,
  11742. groupLabelOverflow: groupLabelOptions.textOverflow
  11743. };
  11744. this._resumeDeprecatedWarnings()
  11745. },
  11746. _changeMaxDepth: function() {
  11747. var maxDepth = this._getOption("maxDepth", true);
  11748. maxDepth = maxDepth >= 1 ? Math.round(maxDepth) : 1 / 0;
  11749. if (this._maxDepth !== maxDepth) {
  11750. this._maxDepth = maxDepth;
  11751. this._change(["NODES_RESET"])
  11752. }
  11753. },
  11754. _resetNodes: function() {
  11755. var that = this;
  11756. that._tilesGroup.clear();
  11757. that._renderer.initHatching();
  11758. that._context.forceReset = true;
  11759. that._context.minLevel = that._topNode.level + 1;
  11760. that._context.maxLevel = that._context.minLevel + that._maxDepth - 1;
  11761. that._change(["TILES", "LABELS", "TILING"])
  11762. },
  11763. _processNodes: function(context, process) {
  11764. processNodes(context, this._topNode, process)
  11765. },
  11766. _applyTilesAppearance: function() {
  11767. var that = this;
  11768. var colorizer = (0, _colorizing.getColorizer)(that._getOption("colorizer"), that._themeManager, that._topNode);
  11769. that._processNodes({
  11770. renderer: that._renderer,
  11771. group: that._tilesGroup,
  11772. setTrackerData: that._handlers.setTrackerData,
  11773. colorField: that._getOption("colorField", true) || "color",
  11774. getColor: colorizer
  11775. }, processTileAppearance)
  11776. },
  11777. _applyLabelsAppearance: function() {
  11778. var that = this;
  11779. that._labelsGroup.clear();
  11780. that._processNodes({
  11781. renderer: that._renderer,
  11782. group: that._labelsGroup,
  11783. setTrackerData: that._handlers.setTrackerData,
  11784. labelField: that._getOption("labelField", true) || "name"
  11785. }, processLabelAppearance);
  11786. that._change(["LABELS_LAYOUT"])
  11787. },
  11788. _performTiling: function() {
  11789. var that = this;
  11790. var context = {
  11791. algorithm: (0, _tiling.getAlgorithm)(that._getOption("layoutAlgorithm", true)),
  11792. directions: directions[String(that._getOption("layoutDirection", true)).toLowerCase()] || directions.lefttoprightbottom,
  11793. headerHeight: that._headerHeight,
  11794. groupPadding: that._groupPadding,
  11795. rectOffsets: that._rectOffsets
  11796. };
  11797. that._topNode.innerRect = that._tilingRect;
  11798. calculateRects(context, that._topNode);
  11799. that._processNodes(context, processTiling);
  11800. that._change(["LABELS_LAYOUT"]);
  11801. that._onTilingPerformed()
  11802. },
  11803. _onTilingPerformed: _common2.noop,
  11804. _performLabelsLayout: function() {
  11805. this._processNodes(null, processLabelsLayout)
  11806. },
  11807. _getTextBBox: function(fontOptions) {
  11808. var renderer = this._renderer;
  11809. var text = this._textForCalculations || renderer.text("0", 0, 0);
  11810. this._textForCalculations = text;
  11811. text.css((0, _utils.patchFontOptions)(fontOptions)).append(renderer.root);
  11812. var bBox = text.getBBox();
  11813. text.remove();
  11814. return bBox
  11815. }
  11816. });
  11817. function traverseDataItems(root, dataItems, level, params) {
  11818. var nodes = [];
  11819. var allNodes = params.nodes;
  11820. var i;
  11821. var ii = dataItems.length;
  11822. var totalValue = 0;
  11823. for (i = 0; i < ii; ++i) {
  11824. var dataItem = dataItems[i];
  11825. var node = new _node2.default;
  11826. node._id = allNodes.length;
  11827. node.ctx = params.ctx;
  11828. node.parent = root;
  11829. node.level = level;
  11830. node.index = nodes.length;
  11831. node.data = dataItem;
  11832. params.buildNode(node);
  11833. allNodes.push(node);
  11834. nodes.push(node);
  11835. var items = dataItem[params.itemsField];
  11836. if (items && items.length) {
  11837. traverseDataItems(node, items, level + 1, params)
  11838. }
  11839. if (dataItem[params.valueField] > 0) {
  11840. node.value = Number(dataItem[params.valueField])
  11841. }
  11842. totalValue += node.value
  11843. }
  11844. root.nodes = nodes;
  11845. root.value = totalValue
  11846. }
  11847. function processNodes(context, root, process) {
  11848. var nodes = root.nodes;
  11849. var i;
  11850. var ii = nodes.length;
  11851. for (i = 0; i < ii; ++i) {
  11852. var node = nodes[i];
  11853. process(context, node);
  11854. if (node.isNode()) {
  11855. processNodes(context, node, process)
  11856. }
  11857. }
  11858. }
  11859. function processTileAppearance(context, node) {
  11860. node.color = node.data[context.colorField] || context.getColor(node) || node.parent.color;
  11861. node.updateStyles();
  11862. node.tile = !node.ctx.forceReset && node.tile || createTile[Number(node.isNode())](context, node);
  11863. node.applyState()
  11864. }
  11865. var createTile = [createLeaf, createGroup];
  11866. function createLeaf(context, node) {
  11867. var tile = context.renderer.simpleRect().append(context.group);
  11868. context.setTrackerData(node, tile);
  11869. return tile
  11870. }
  11871. function createGroup(context, node) {
  11872. var outer = context.renderer.simpleRect().append(context.group);
  11873. var inner = context.renderer.simpleRect().append(context.group);
  11874. context.setTrackerData(node, inner);
  11875. return {
  11876. outer: outer,
  11877. inner: inner
  11878. }
  11879. }
  11880. function processLabelAppearance(context, node) {
  11881. node.updateLabelStyle();
  11882. if (node.labelState.visible) {
  11883. createLabel(context, node, node.labelState, node.labelParams)
  11884. }
  11885. }
  11886. function createLabel(context, currentNode, settings, params) {
  11887. var textData = currentNode.data[context.labelField];
  11888. currentNode.label = textData ? String(textData) : null;
  11889. textData = currentNode.customLabel || currentNode.label;
  11890. if (textData) {
  11891. currentNode.text = context.renderer.text(textData).attr(settings.attr).css(settings.css).append(context.group);
  11892. context.setTrackerData(currentNode, currentNode.text)
  11893. }
  11894. }
  11895. var emptyRect = [0, 0, 0, 0];
  11896. function calculateRects(context, root) {
  11897. var nodes = root.nodes;
  11898. var items = [];
  11899. var rects = [];
  11900. var sum = 0;
  11901. var i;
  11902. var ii = items.length = rects.length = nodes.length;
  11903. for (i = 0; i < ii; ++i) {
  11904. sum += nodes[i].value;
  11905. items[i] = {
  11906. value: nodes[i].value,
  11907. i: i
  11908. }
  11909. }
  11910. if (sum > 0) {
  11911. context.algorithm({
  11912. items: items.slice(),
  11913. sum: sum,
  11914. rect: root.innerRect.slice(),
  11915. isRotated: 1 & nodes[0].level,
  11916. directions: context.directions
  11917. })
  11918. }
  11919. for (i = 0; i < ii; ++i) {
  11920. rects[i] = items[i].rect || emptyRect
  11921. }
  11922. root.rects = rects
  11923. }
  11924. function processTiling(context, node) {
  11925. var rect = node.parent.rects[node.index];
  11926. var rectOffsets = context.rectOffsets;
  11927. if (node.isNode()) {
  11928. setRectAttrs(node.tile.outer, buildTileRect(rect, node.parent.innerRect, rectOffsets.headerEdge, rectOffsets.headerInner));
  11929. rect = marginateRect(rect, context.groupPadding);
  11930. var headerHeight = Math.min(context.headerHeight, rect[3] - rect[1]);
  11931. node.rect = [rect[0], rect[1], rect[2], rect[1] + headerHeight];
  11932. setRectAttrs(node.tile.inner, marginateRect(node.rect, rectOffsets.headerEdge));
  11933. rect[1] += headerHeight;
  11934. node.innerRect = rect;
  11935. calculateRects(context, node)
  11936. } else {
  11937. node.rect = rect;
  11938. setRectAttrs(node.tile, buildTileRect(rect, node.parent.innerRect, rectOffsets.tileEdge, rectOffsets.tileInner))
  11939. }
  11940. }
  11941. function marginateRect(rect, margin) {
  11942. return [rect[0] + margin, rect[1] + margin, rect[2] - margin, rect[3] - margin]
  11943. }
  11944. function buildTileRect(rect, outer, edgeOffset, innerOffset) {
  11945. return [rect[0] + (rect[0] === outer[0] ? edgeOffset : +innerOffset), rect[1] + (rect[1] === outer[1] ? edgeOffset : +innerOffset), rect[2] - (rect[2] === outer[2] ? edgeOffset : -innerOffset), rect[3] - (rect[3] === outer[3] ? edgeOffset : -innerOffset)]
  11946. }
  11947. function setRectAttrs(element, rect) {
  11948. element.attr({
  11949. x: rect[0],
  11950. y: rect[1],
  11951. width: _max(rect[2] - rect[0], 0),
  11952. height: _max(rect[3] - rect[1], 0)
  11953. })
  11954. }
  11955. function processLabelsLayout(context, node) {
  11956. if (node.text && node.labelState.visible) {
  11957. layoutTextNode(node, node.labelParams)
  11958. }
  11959. }
  11960. function layoutTextNode(node, params) {
  11961. var rect = node.rect;
  11962. var text = node.text;
  11963. var bBox = text.getBBox();
  11964. var paddingLeftRight = params.paddingLeftRight;
  11965. var paddingTopBottom = params.paddingTopBottom;
  11966. var effectiveWidth = rect[2] - rect[0] - 2 * paddingLeftRight;
  11967. var fitByHeight = bBox.height + paddingTopBottom <= rect[3] - rect[1];
  11968. var fitByWidth = bBox.width <= effectiveWidth;
  11969. var resolveLabelOverflow = params.resolveLabelOverflow;
  11970. var groupLabelOverflow = params.groupLabelOverflow;
  11971. var tileLabelOverflow = params.tileLabelOverflow;
  11972. var tileLabelWordWrap = params.tileLabelWordWrap;
  11973. if ((0, _type.isDefined)(resolveLabelOverflow)) {
  11974. if ("ellipsis" === resolveLabelOverflow && fitByHeight) {
  11975. text.setMaxSize(effectiveWidth, void 0, {
  11976. wordWrap: "none",
  11977. textOverflow: "ellipsis"
  11978. });
  11979. if (!fitByWidth) {
  11980. bBox = text.getBBox();
  11981. fitByWidth = bBox.width <= effectiveWidth
  11982. }
  11983. }
  11984. } else {
  11985. fitByWidth = true;
  11986. fitByHeight = true;
  11987. text.setMaxSize(effectiveWidth, rect[3] - rect[1] - paddingTopBottom, node.isNode() ? {
  11988. textOverflow: groupLabelOverflow,
  11989. wordWrap: "none"
  11990. } : {
  11991. textOverflow: tileLabelOverflow,
  11992. wordWrap: tileLabelWordWrap,
  11993. hideOverflowEllipsis: true
  11994. })
  11995. }
  11996. text.attr({
  11997. visibility: fitByHeight && fitByWidth ? "visible" : "hidden"
  11998. });
  11999. if (fitByHeight && fitByWidth) {
  12000. text.move(params.rtlEnabled ? rect[2] - paddingLeftRight - bBox.x - bBox.width : rect[0] + paddingLeftRight - bBox.x, rect[1] + paddingTopBottom - bBox.y)
  12001. }
  12002. }
  12003. __webpack_require__( /*! ../../core/component_registrator */ 9)("dxTreeMap", dxTreeMap);
  12004. module.exports = dxTreeMap;
  12005. dxTreeMap.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin)
  12006. },
  12007. /*!***************************************************************!*\
  12008. !*** ./artifacts/transpiled/events/core/event_registrator.js ***!
  12009. \***************************************************************/
  12010. /*! dynamic exports provided */
  12011. /*! all exports used */
  12012. function(module, exports, __webpack_require__) {
  12013. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  12014. var callbacks = __webpack_require__( /*! ./event_registrator_callbacks */ 122);
  12015. var registerEvent = function(name, eventObject) {
  12016. var strategy = {};
  12017. if ("noBubble" in eventObject) {
  12018. strategy.noBubble = eventObject.noBubble
  12019. }
  12020. if ("bindType" in eventObject) {
  12021. strategy.bindType = eventObject.bindType
  12022. }
  12023. if ("delegateType" in eventObject) {
  12024. strategy.delegateType = eventObject.delegateType
  12025. }
  12026. each(["setup", "teardown", "add", "remove", "trigger", "handle", "_default", "dispose"], function(_, methodName) {
  12027. if (!eventObject[methodName]) {
  12028. return
  12029. }
  12030. strategy[methodName] = function() {
  12031. var args = [].slice.call(arguments);
  12032. args.unshift(this);
  12033. return eventObject[methodName].apply(eventObject, args)
  12034. }
  12035. });
  12036. callbacks.fire(name, strategy)
  12037. };
  12038. registerEvent.callbacks = callbacks;
  12039. module.exports = registerEvent
  12040. },
  12041. /*!***********************************!*\
  12042. !*** external "window.Globalize" ***!
  12043. \***********************************/
  12044. /*! dynamic exports provided */
  12045. /*! all exports used */
  12046. function(module, exports) {
  12047. module.exports = window.Globalize
  12048. },
  12049. /*!****************************************************!*\
  12050. !*** ./artifacts/transpiled/core/utils/console.js ***!
  12051. \****************************************************/
  12052. /*! dynamic exports provided */
  12053. /*! all exports used */
  12054. function(module, exports, __webpack_require__) {
  12055. var isFunction = __webpack_require__( /*! ./type */ 1).isFunction;
  12056. var noop = function() {};
  12057. var getConsoleMethod = function(method) {
  12058. if ("undefined" === typeof console || !isFunction(console[method])) {
  12059. return noop
  12060. }
  12061. return console[method].bind(console)
  12062. };
  12063. var logger = {
  12064. info: getConsoleMethod("info"),
  12065. warn: getConsoleMethod("warn"),
  12066. error: getConsoleMethod("error")
  12067. };
  12068. var debug = function() {
  12069. function assert(condition, message) {
  12070. if (!condition) {
  12071. throw new Error(message)
  12072. }
  12073. }
  12074. function assertParam(parameter, message) {
  12075. assert(null !== parameter && void 0 !== parameter, message)
  12076. }
  12077. return {
  12078. assert: assert,
  12079. assertParam: assertParam
  12080. }
  12081. }();
  12082. exports.logger = logger;
  12083. exports.debug = debug
  12084. },
  12085. /*!************************************************************!*\
  12086. !*** ./artifacts/transpiled/ui/widget/ui.template_base.js ***!
  12087. \************************************************************/
  12088. /*! dynamic exports provided */
  12089. /*! all exports used */
  12090. function(module, exports, __webpack_require__) {
  12091. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  12092. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  12093. var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
  12094. var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
  12095. var Class = __webpack_require__( /*! ../../core/class */ 15);
  12096. var abstract = Class.abstract;
  12097. var renderedCallbacks = Callbacks({
  12098. syncStrategy: true
  12099. });
  12100. var TemplateBase = Class.inherit({
  12101. render: function(options) {
  12102. options = options || {};
  12103. var onRendered = options.onRendered;
  12104. delete options.onRendered;
  12105. var $result = this._renderCore(options);
  12106. this._ensureResultInContainer($result, options.container);
  12107. renderedCallbacks.fire($result, options.container);
  12108. onRendered && onRendered();
  12109. return $result
  12110. },
  12111. _ensureResultInContainer: function($result, container) {
  12112. if (!container) {
  12113. return
  12114. }
  12115. var $container = $(container);
  12116. var resultInContainer = domUtils.contains($container.get(0), $result.get(0));
  12117. $container.append($result);
  12118. if (resultInContainer) {
  12119. return
  12120. }
  12121. var resultInBody = domAdapter.getBody().contains($container.get(0));
  12122. if (!resultInBody) {
  12123. return
  12124. }
  12125. domUtils.triggerShownEvent($result)
  12126. },
  12127. _renderCore: abstract
  12128. });
  12129. module.exports = TemplateBase;
  12130. module.exports.renderedCallbacks = renderedCallbacks
  12131. }, ,
  12132. /*!********************************************************!*\
  12133. !*** ./artifacts/transpiled/core/polyfills/promise.js ***!
  12134. \********************************************************/
  12135. /*! dynamic exports provided */
  12136. /*! all exports used */
  12137. function(module, exports, __webpack_require__) {
  12138. var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
  12139. var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
  12140. var Deferred = deferredUtils.Deferred;
  12141. var when = deferredUtils.when;
  12142. var promise = windowUtils.hasWindow() ? windowUtils.getWindow().Promise : Promise;
  12143. if (!promise) {
  12144. promise = function(resolver) {
  12145. var d = new Deferred;
  12146. resolver(d.resolve.bind(this), d.reject.bind(this));
  12147. return d.promise()
  12148. };
  12149. promise.resolve = function(val) {
  12150. return (new Deferred).resolve(val).promise()
  12151. };
  12152. promise.reject = function(val) {
  12153. return (new Deferred).reject(val).promise()
  12154. };
  12155. promise.all = function(promises) {
  12156. return when.apply(this, promises).then(function() {
  12157. return [].slice.call(arguments)
  12158. })
  12159. }
  12160. }
  12161. module.exports = promise
  12162. },
  12163. /*!****************************************************!*\
  12164. !*** ./artifacts/transpiled/animation/position.js ***!
  12165. \****************************************************/
  12166. /*! dynamic exports provided */
  12167. /*! all exports used */
  12168. function(module, exports, __webpack_require__) {
  12169. var $ = __webpack_require__( /*! ../core/renderer */ 2);
  12170. var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4);
  12171. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  12172. var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
  12173. var window = windowUtils.getWindow();
  12174. var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
  12175. var isWindow = __webpack_require__( /*! ../core/utils/type */ 1).isWindow;
  12176. var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
  12177. var browser = __webpack_require__( /*! ../core/utils/browser */ 25);
  12178. var translator = __webpack_require__( /*! ./translator */ 27);
  12179. var support = __webpack_require__( /*! ../core/utils/support */ 43);
  12180. var horzRe = /left|right/;
  12181. var vertRe = /top|bottom/;
  12182. var collisionRe = /fit|flip|none/;
  12183. var IS_SAFARI = browser.safari;
  12184. var normalizeAlign = function(raw) {
  12185. var result = {
  12186. h: "center",
  12187. v: "center"
  12188. };
  12189. var pair = commonUtils.splitPair(raw);
  12190. if (pair) {
  12191. each(pair, function() {
  12192. var w = String(this).toLowerCase();
  12193. if (horzRe.test(w)) {
  12194. result.h = w
  12195. } else {
  12196. if (vertRe.test(w)) {
  12197. result.v = w
  12198. }
  12199. }
  12200. })
  12201. }
  12202. return result
  12203. };
  12204. var normalizeOffset = function(raw) {
  12205. return commonUtils.pairToObject(raw)
  12206. };
  12207. var normalizeCollision = function(raw) {
  12208. var pair = commonUtils.splitPair(raw);
  12209. var h = String(pair && pair[0]).toLowerCase();
  12210. var v = String(pair && pair[1]).toLowerCase();
  12211. if (!collisionRe.test(h)) {
  12212. h = "none"
  12213. }
  12214. if (!collisionRe.test(v)) {
  12215. v = h
  12216. }
  12217. return {
  12218. h: h,
  12219. v: v
  12220. }
  12221. };
  12222. var getAlignFactor = function(align) {
  12223. switch (align) {
  12224. case "center":
  12225. return .5;
  12226. case "right":
  12227. case "bottom":
  12228. return 1;
  12229. default:
  12230. return 0
  12231. }
  12232. };
  12233. var inverseAlign = function(align) {
  12234. switch (align) {
  12235. case "left":
  12236. return "right";
  12237. case "right":
  12238. return "left";
  12239. case "top":
  12240. return "bottom";
  12241. case "bottom":
  12242. return "top";
  12243. default:
  12244. return align
  12245. }
  12246. };
  12247. var calculateOversize = function(data, bounds) {
  12248. var oversize = 0;
  12249. if (data.myLocation < bounds.min) {
  12250. oversize += bounds.min - data.myLocation
  12251. }
  12252. if (data.myLocation > bounds.max) {
  12253. oversize += data.myLocation - bounds.max
  12254. }
  12255. return oversize
  12256. };
  12257. var collisionSide = function(direction, data, bounds) {
  12258. if (data.myLocation < bounds.min) {
  12259. return "h" === direction ? "left" : "top"
  12260. }
  12261. if (data.myLocation > bounds.max) {
  12262. return "h" === direction ? "right" : "bottom"
  12263. }
  12264. return "none"
  12265. };
  12266. var initMyLocation = function(data) {
  12267. data.myLocation = data.atLocation + getAlignFactor(data.atAlign) * data.atSize - getAlignFactor(data.myAlign) * data.mySize + data.offset
  12268. };
  12269. var collisionResolvers = {
  12270. fit: function(data, bounds) {
  12271. var result = false;
  12272. if (data.myLocation > bounds.max) {
  12273. data.myLocation = bounds.max;
  12274. result = true
  12275. }
  12276. if (data.myLocation < bounds.min) {
  12277. data.myLocation = bounds.min;
  12278. result = true
  12279. }
  12280. data.fit = result
  12281. },
  12282. flip: function(data, bounds) {
  12283. data.flip = false;
  12284. if ("center" === data.myAlign && "center" === data.atAlign) {
  12285. return
  12286. }
  12287. if (data.myLocation < bounds.min || data.myLocation > bounds.max) {
  12288. var inverseData = extend({}, data, {
  12289. myAlign: inverseAlign(data.myAlign),
  12290. atAlign: inverseAlign(data.atAlign),
  12291. offset: -data.offset
  12292. });
  12293. initMyLocation(inverseData);
  12294. inverseData.oversize = calculateOversize(inverseData, bounds);
  12295. if (inverseData.myLocation >= bounds.min && inverseData.myLocation <= bounds.max || data.oversize > inverseData.oversize) {
  12296. data.myLocation = inverseData.myLocation;
  12297. data.oversize = inverseData.oversize;
  12298. data.flip = true
  12299. }
  12300. }
  12301. },
  12302. flipfit: function(data, bounds) {
  12303. this.flip(data, bounds);
  12304. this.fit(data, bounds)
  12305. },
  12306. none: function(data) {
  12307. data.oversize = 0
  12308. }
  12309. };
  12310. var scrollbarWidth;
  12311. var calculateScrollbarWidth = function() {
  12312. var $scrollDiv = $("<div>").css({
  12313. width: 100,
  12314. height: 100,
  12315. overflow: "scroll",
  12316. position: "absolute",
  12317. top: -9999
  12318. }).appendTo($("body"));
  12319. var result = $scrollDiv.get(0).offsetWidth - $scrollDiv.get(0).clientWidth;
  12320. $scrollDiv.remove();
  12321. scrollbarWidth = result
  12322. };
  12323. var defaultPositionResult = {
  12324. h: {
  12325. location: 0,
  12326. flip: false,
  12327. fit: false,
  12328. oversize: 0
  12329. },
  12330. v: {
  12331. location: 0,
  12332. flip: false,
  12333. fit: false,
  12334. oversize: 0
  12335. }
  12336. };
  12337. var calculatePosition = function(what, options) {
  12338. var $what = $(what);
  12339. var currentOffset = $what.offset();
  12340. var result = extend(true, {}, defaultPositionResult, {
  12341. h: {
  12342. location: currentOffset.left
  12343. },
  12344. v: {
  12345. location: currentOffset.top
  12346. }
  12347. });
  12348. if (!options) {
  12349. return result
  12350. }
  12351. var my = normalizeAlign(options.my);
  12352. var at = normalizeAlign(options.at);
  12353. var of = $(options.of).length && options.of || window;
  12354. var offset = normalizeOffset(options.offset);
  12355. var collision = normalizeCollision(options.collision);
  12356. var boundary = options.boundary;
  12357. var boundaryOffset = normalizeOffset(options.boundaryOffset);
  12358. var h = {
  12359. mySize: $what.outerWidth(),
  12360. myAlign: my.h,
  12361. atAlign: at.h,
  12362. offset: offset.h,
  12363. collision: collision.h,
  12364. boundaryOffset: boundaryOffset.h
  12365. };
  12366. var v = {
  12367. mySize: $what.outerHeight(),
  12368. myAlign: my.v,
  12369. atAlign: at.v,
  12370. offset: offset.v,
  12371. collision: collision.v,
  12372. boundaryOffset: boundaryOffset.v
  12373. };
  12374. if (of.preventDefault) {
  12375. h.atLocation = of.pageX;
  12376. v.atLocation = of.pageY;
  12377. h.atSize = 0;
  12378. v.atSize = 0
  12379. } else {
  12380. of = $(of);
  12381. if (isWindow(of [0])) {
  12382. h.atLocation = of.scrollLeft();
  12383. v.atLocation = of.scrollTop();
  12384. h.atSize = of [0].innerWidth >= of [0].outerWidth ? of [0].innerWidth : of.width();
  12385. v.atSize = of [0].innerHeight >= of [0].outerHeight || IS_SAFARI ? of [0].innerHeight : of.height()
  12386. } else {
  12387. if (9 === of [0].nodeType) {
  12388. h.atLocation = 0;
  12389. v.atLocation = 0;
  12390. h.atSize = of.width();
  12391. v.atSize = of.height()
  12392. } else {
  12393. var o = of.offset();
  12394. h.atLocation = o.left;
  12395. v.atLocation = o.top;
  12396. h.atSize = of.outerWidth();
  12397. v.atSize = of.outerHeight()
  12398. }
  12399. }
  12400. }
  12401. initMyLocation(h);
  12402. initMyLocation(v);
  12403. var bounds = function() {
  12404. var win = $(window);
  12405. var windowWidth = win.width();
  12406. var windowHeight = win.height();
  12407. var left = win.scrollLeft();
  12408. var top = win.scrollTop();
  12409. var documentElement = domAdapter.getDocumentElement();
  12410. var hZoomLevel = support.touch ? documentElement.clientWidth / windowWidth : 1;
  12411. var vZoomLevel = support.touch ? documentElement.clientHeight / windowHeight : 1;
  12412. if (void 0 === scrollbarWidth) {
  12413. calculateScrollbarWidth()
  12414. }
  12415. var boundaryWidth = windowWidth;
  12416. var boundaryHeight = windowHeight;
  12417. if (boundary) {
  12418. var $boundary = $(boundary);
  12419. var boundaryPosition = $boundary.offset();
  12420. left = boundaryPosition.left;
  12421. top = boundaryPosition.top;
  12422. boundaryWidth = $boundary.width();
  12423. boundaryHeight = $boundary.height()
  12424. }
  12425. return {
  12426. h: {
  12427. min: left + h.boundaryOffset,
  12428. max: left + boundaryWidth / hZoomLevel - h.mySize - h.boundaryOffset
  12429. },
  12430. v: {
  12431. min: top + v.boundaryOffset,
  12432. max: top + boundaryHeight / vZoomLevel - v.mySize - v.boundaryOffset
  12433. }
  12434. }
  12435. }();
  12436. h.oversize = calculateOversize(h, bounds.h);
  12437. v.oversize = calculateOversize(v, bounds.v);
  12438. h.collisionSide = collisionSide("h", h, bounds.h);
  12439. v.collisionSide = collisionSide("v", v, bounds.v);
  12440. if (collisionResolvers[h.collision]) {
  12441. collisionResolvers[h.collision](h, bounds.h)
  12442. }
  12443. if (collisionResolvers[v.collision]) {
  12444. collisionResolvers[v.collision](v, bounds.v)
  12445. }
  12446. var preciser = function(number) {
  12447. return options.precise ? number : Math.round(number)
  12448. };
  12449. extend(true, result, {
  12450. h: {
  12451. location: preciser(h.myLocation),
  12452. oversize: preciser(h.oversize),
  12453. fit: h.fit,
  12454. flip: h.flip,
  12455. collisionSide: h.collisionSide
  12456. },
  12457. v: {
  12458. location: preciser(v.myLocation),
  12459. oversize: preciser(v.oversize),
  12460. fit: v.fit,
  12461. flip: v.flip,
  12462. collisionSide: v.collisionSide
  12463. },
  12464. precise: options.precise
  12465. });
  12466. return result
  12467. };
  12468. var position = function(what, options) {
  12469. var $what = $(what);
  12470. if (!options) {
  12471. return $what.offset()
  12472. }
  12473. translator.resetPosition($what, true);
  12474. var offset = $what.offset();
  12475. var targetPosition = options.h && options.v ? options : calculatePosition($what, options);
  12476. var preciser = function(number) {
  12477. return options.precise ? number : Math.round(number)
  12478. };
  12479. translator.move($what, {
  12480. left: targetPosition.h.location - preciser(offset.left),
  12481. top: targetPosition.v.location - preciser(offset.top)
  12482. });
  12483. return targetPosition
  12484. };
  12485. var offset = function(element) {
  12486. element = $(element).get(0);
  12487. if (isWindow(element)) {
  12488. return null
  12489. } else {
  12490. if (element && "pageY" in element && "pageX" in element) {
  12491. return {
  12492. top: element.pageY,
  12493. left: element.pageX
  12494. }
  12495. }
  12496. }
  12497. return $(element).offset()
  12498. };
  12499. if (!position.inverseAlign) {
  12500. position.inverseAlign = inverseAlign
  12501. }
  12502. if (!position.normalizeAlign) {
  12503. position.normalizeAlign = normalizeAlign
  12504. }
  12505. module.exports = {
  12506. calculateScrollbarWidth: calculateScrollbarWidth,
  12507. calculate: calculatePosition,
  12508. setup: position,
  12509. offset: offset
  12510. }
  12511. },
  12512. /*!******************************************************!*\
  12513. !*** ./artifacts/transpiled/core/utils/view_port.js ***!
  12514. \******************************************************/
  12515. /*! dynamic exports provided */
  12516. /*! all exports used */
  12517. function(module, exports, __webpack_require__) {
  12518. var $ = __webpack_require__( /*! ../renderer */ 2);
  12519. var readyCallbacks = __webpack_require__( /*! ./ready_callbacks */ 48);
  12520. var ready = readyCallbacks.add;
  12521. var changeCallback = __webpack_require__( /*! ./callbacks */ 26)();
  12522. var $originalViewPort = $();
  12523. var value = function() {
  12524. var $current;
  12525. return function(element) {
  12526. if (!arguments.length) {
  12527. return $current
  12528. }
  12529. var $element = $(element);
  12530. $originalViewPort = $element;
  12531. var isNewViewportFound = !!$element.length;
  12532. var prevViewPort = value();
  12533. $current = isNewViewportFound ? $element : $("body");
  12534. changeCallback.fire(isNewViewportFound ? value() : $(), prevViewPort)
  12535. }
  12536. }();
  12537. ready(function() {
  12538. value(".dx-viewport")
  12539. });
  12540. exports.value = value;
  12541. exports.changeCallback = changeCallback;
  12542. exports.originalViewPort = function() {
  12543. return $originalViewPort
  12544. }
  12545. },
  12546. /*!*****************************************************************!*\
  12547. !*** ./artifacts/transpiled/exporter/excel/excel.tag_helper.js ***!
  12548. \*****************************************************************/
  12549. /*! dynamic exports provided */
  12550. /*! all exports used */
  12551. function(module, exports, __webpack_require__) {
  12552. Object.defineProperty(exports, "__esModule", {
  12553. value: true
  12554. });
  12555. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  12556. var tagHelper = {
  12557. toXml: function(tagName, attributes, content) {
  12558. var result = ["<", tagName];
  12559. for (var attributeName in attributes) {
  12560. var attributeValue = attributes[attributeName];
  12561. if ((0, _type.isDefined)(attributeValue)) {
  12562. result.push(" ", attributeName, '="', attributeValue, '"')
  12563. }
  12564. }
  12565. if ((0, _type.isDefined)(content) && "" !== content) {
  12566. result.push(">", content, "</", tagName, ">")
  12567. } else {
  12568. result.push(" />")
  12569. }
  12570. return result.join("")
  12571. }
  12572. };
  12573. exports.default = tagHelper
  12574. },
  12575. /*!***************************************************************!*\
  12576. !*** ./artifacts/transpiled/integration/jquery/use_jquery.js ***!
  12577. \***************************************************************/
  12578. /*! dynamic exports provided */
  12579. /*! all exports used */
  12580. function(module, exports, __webpack_require__) {
  12581. var jQuery = __webpack_require__( /*! jquery */ 55);
  12582. var config = __webpack_require__( /*! ../../core/config */ 31);
  12583. var useJQuery = config().useJQuery;
  12584. if (jQuery && false !== useJQuery) {
  12585. config({
  12586. useJQuery: true
  12587. })
  12588. }
  12589. module.exports = function() {
  12590. return jQuery && config().useJQuery
  12591. }
  12592. },
  12593. /*!***************************************************!*\
  12594. !*** ./artifacts/transpiled/data/store_helper.js ***!
  12595. \***************************************************/
  12596. /*! dynamic exports provided */
  12597. /*! all exports used */
  12598. function(module, exports, __webpack_require__) {
  12599. var grep = __webpack_require__( /*! ../core/utils/common */ 4).grep;
  12600. var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
  12601. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  12602. var arrayQuery = __webpack_require__( /*! ./array_query */ 155);
  12603. var normalizeSortingInfo = __webpack_require__( /*! ./utils */ 41).normalizeSortingInfo;
  12604. function multiLevelGroup(query, groupInfo) {
  12605. query = query.groupBy(groupInfo[0].selector);
  12606. if (groupInfo.length > 1) {
  12607. query = query.select(function(g) {
  12608. return extend({}, g, {
  12609. items: multiLevelGroup(arrayQuery(g.items), groupInfo.slice(1)).toArray()
  12610. })
  12611. })
  12612. }
  12613. return query
  12614. }
  12615. function arrangeSortingInfo(groupInfo, sortInfo) {
  12616. var filteredGroup = [];
  12617. each(groupInfo, function(_, group) {
  12618. var collision = grep(sortInfo, function(sort) {
  12619. return group.selector === sort.selector
  12620. });
  12621. if (collision.length < 1) {
  12622. filteredGroup.push(group)
  12623. }
  12624. });
  12625. return filteredGroup.concat(sortInfo)
  12626. }
  12627. function queryByOptions(query, options, isCountQuery) {
  12628. options = options || {};
  12629. var filter = options.filter;
  12630. if (filter) {
  12631. query = query.filter(filter)
  12632. }
  12633. if (isCountQuery) {
  12634. return query
  12635. }
  12636. var sort = options.sort;
  12637. var select = options.select;
  12638. var group = options.group;
  12639. var skip = options.skip;
  12640. var take = options.take;
  12641. if (group) {
  12642. group = normalizeSortingInfo(group);
  12643. group.keepInitialKeyOrder = !!options.group.keepInitialKeyOrder
  12644. }
  12645. if (sort || group) {
  12646. sort = normalizeSortingInfo(sort || []);
  12647. if (group && !group.keepInitialKeyOrder) {
  12648. sort = arrangeSortingInfo(group, sort)
  12649. }
  12650. each(sort, function(index) {
  12651. query = query[index ? "thenBy" : "sortBy"](this.selector, this.desc, this.compare)
  12652. })
  12653. }
  12654. if (select) {
  12655. query = query.select(select)
  12656. }
  12657. if (group) {
  12658. query = multiLevelGroup(query, group)
  12659. }
  12660. if (take || skip) {
  12661. query = query.slice(skip || 0, take)
  12662. }
  12663. return query
  12664. }
  12665. module.exports = {
  12666. multiLevelGroup: multiLevelGroup,
  12667. arrangeSortingInfo: arrangeSortingInfo,
  12668. queryByOptions: queryByOptions
  12669. }
  12670. },
  12671. /*!***************************************************!*\
  12672. !*** ./artifacts/transpiled/core/events_mixin.js ***!
  12673. \***************************************************/
  12674. /*! dynamic exports provided */
  12675. /*! all exports used */
  12676. function(module, exports, __webpack_require__) {
  12677. var DefaultEventsStrategy = __webpack_require__( /*! ./events_strategy */ 445);
  12678. var each = __webpack_require__( /*! ./utils/iterator */ 3).each;
  12679. var isPlainObject = __webpack_require__( /*! ./utils/type */ 1).isPlainObject;
  12680. module.exports = {
  12681. ctor: function() {
  12682. this._events = {};
  12683. this.setEventsStrategy(new DefaultEventsStrategy(this))
  12684. },
  12685. setEventsStrategy: function(strategy) {
  12686. if ("function" === typeof strategy) {
  12687. strategy = strategy(this)
  12688. }
  12689. this._eventsStrategy = strategy
  12690. },
  12691. hasEvent: function(eventName) {
  12692. return this._eventsStrategy.hasEvent(eventName)
  12693. },
  12694. fireEvent: function(eventName, eventArgs) {
  12695. this._eventsStrategy.fireEvent(eventName, eventArgs);
  12696. return this
  12697. },
  12698. on: function(eventName, eventHandler) {
  12699. if (isPlainObject(eventName)) {
  12700. each(eventName, function(e, h) {
  12701. this.on(e, h)
  12702. }.bind(this))
  12703. } else {
  12704. this._eventsStrategy.on(eventName, eventHandler)
  12705. }
  12706. return this
  12707. },
  12708. off: function(eventName, eventHandler) {
  12709. this._eventsStrategy.off(eventName, eventHandler);
  12710. return this
  12711. },
  12712. _disposeEvents: function() {
  12713. this._eventsStrategy.dispose()
  12714. }
  12715. }
  12716. },
  12717. /*!*************************************************************!*\
  12718. !*** ./artifacts/transpiled/ui/widget/function_template.js ***!
  12719. \*************************************************************/
  12720. /*! dynamic exports provided */
  12721. /*! all exports used */
  12722. function(module, exports, __webpack_require__) {
  12723. var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
  12724. var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
  12725. var FunctionTemplate = TemplateBase.inherit({
  12726. ctor: function(render) {
  12727. this._render = render
  12728. },
  12729. _renderCore: function(options) {
  12730. return domUtils.normalizeTemplateElement(this._render(options))
  12731. }
  12732. });
  12733. module.exports = FunctionTemplate
  12734. },
  12735. /*!*********************************************!*\
  12736. !*** ./artifacts/transpiled/data_helper.js ***!
  12737. \*********************************************/
  12738. /*! dynamic exports provided */
  12739. /*! all exports used */
  12740. function(module, exports, __webpack_require__) {
  12741. var DataSource = __webpack_require__( /*! ./data/data_source/data_source */ 45).DataSource;
  12742. var extend = __webpack_require__( /*! ./core/utils/extend */ 0).extend;
  12743. var normalizeDataSourceOptions = __webpack_require__( /*! ./data/data_source/data_source */ 45).normalizeDataSourceOptions;
  12744. var DATA_SOURCE_OPTIONS_METHOD = "_dataSourceOptions";
  12745. var DATA_SOURCE_CHANGED_METHOD = "_dataSourceChangedHandler";
  12746. var DATA_SOURCE_LOAD_ERROR_METHOD = "_dataSourceLoadErrorHandler";
  12747. var DATA_SOURCE_LOADING_CHANGED_METHOD = "_dataSourceLoadingChangedHandler";
  12748. var DATA_SOURCE_FROM_URL_LOAD_MODE_METHOD = "_dataSourceFromUrlLoadMode";
  12749. var SPECIFIC_DATA_SOURCE_OPTION = "_getSpecificDataSourceOption";
  12750. var DataHelperMixin = {
  12751. postCtor: function() {
  12752. this.on("disposing", function() {
  12753. this._disposeDataSource()
  12754. }.bind(this))
  12755. },
  12756. _refreshDataSource: function() {
  12757. this._initDataSource();
  12758. this._loadDataSource()
  12759. },
  12760. _initDataSource: function() {
  12761. var dataSourceOptions = SPECIFIC_DATA_SOURCE_OPTION in this ? this[SPECIFIC_DATA_SOURCE_OPTION]() : this.option("dataSource");
  12762. var widgetDataSourceOptions;
  12763. var dataSourceType;
  12764. this._disposeDataSource();
  12765. if (dataSourceOptions) {
  12766. if (dataSourceOptions instanceof DataSource) {
  12767. this._isSharedDataSource = true;
  12768. this._dataSource = dataSourceOptions
  12769. } else {
  12770. widgetDataSourceOptions = DATA_SOURCE_OPTIONS_METHOD in this ? this[DATA_SOURCE_OPTIONS_METHOD]() : {};
  12771. dataSourceType = this._dataSourceType ? this._dataSourceType() : DataSource;
  12772. dataSourceOptions = normalizeDataSourceOptions(dataSourceOptions, {
  12773. fromUrlLoadMode: DATA_SOURCE_FROM_URL_LOAD_MODE_METHOD in this && this[DATA_SOURCE_FROM_URL_LOAD_MODE_METHOD]()
  12774. });
  12775. this._dataSource = new dataSourceType(extend(true, {}, widgetDataSourceOptions, dataSourceOptions))
  12776. }
  12777. this._addDataSourceHandlers()
  12778. }
  12779. },
  12780. _addDataSourceHandlers: function() {
  12781. if (DATA_SOURCE_CHANGED_METHOD in this) {
  12782. this._addDataSourceChangeHandler()
  12783. }
  12784. if (DATA_SOURCE_LOAD_ERROR_METHOD in this) {
  12785. this._addDataSourceLoadErrorHandler()
  12786. }
  12787. if (DATA_SOURCE_LOADING_CHANGED_METHOD in this) {
  12788. this._addDataSourceLoadingChangedHandler()
  12789. }
  12790. this._addReadyWatcher()
  12791. },
  12792. _addReadyWatcher: function() {
  12793. this._dataSource.on("loadingChanged", function(isLoading) {
  12794. this._ready && this._ready(!isLoading)
  12795. }.bind(this))
  12796. },
  12797. _addDataSourceChangeHandler: function() {
  12798. var dataSource = this._dataSource;
  12799. this._proxiedDataSourceChangedHandler = function(e) {
  12800. this[DATA_SOURCE_CHANGED_METHOD](dataSource.items(), e)
  12801. }.bind(this);
  12802. dataSource.on("changed", this._proxiedDataSourceChangedHandler)
  12803. },
  12804. _addDataSourceLoadErrorHandler: function() {
  12805. this._proxiedDataSourceLoadErrorHandler = this[DATA_SOURCE_LOAD_ERROR_METHOD].bind(this);
  12806. this._dataSource.on("loadError", this._proxiedDataSourceLoadErrorHandler)
  12807. },
  12808. _addDataSourceLoadingChangedHandler: function() {
  12809. this._proxiedDataSourceLoadingChangedHandler = this[DATA_SOURCE_LOADING_CHANGED_METHOD].bind(this);
  12810. this._dataSource.on("loadingChanged", this._proxiedDataSourceLoadingChangedHandler)
  12811. },
  12812. _loadDataSource: function() {
  12813. if (this._dataSource) {
  12814. var dataSource = this._dataSource;
  12815. if (dataSource.isLoaded()) {
  12816. this._proxiedDataSourceChangedHandler && this._proxiedDataSourceChangedHandler()
  12817. } else {
  12818. dataSource.load()
  12819. }
  12820. }
  12821. },
  12822. _loadSingle: function(key, value) {
  12823. key = "this" === key ? this._dataSource.key() || "this" : key;
  12824. return this._dataSource.loadSingle(key, value)
  12825. },
  12826. _isLastPage: function() {
  12827. return !this._dataSource || this._dataSource.isLastPage() || !this._dataSource._pageSize
  12828. },
  12829. _isDataSourceLoading: function() {
  12830. return this._dataSource && this._dataSource.isLoading()
  12831. },
  12832. _disposeDataSource: function() {
  12833. if (this._dataSource) {
  12834. if (this._isSharedDataSource) {
  12835. delete this._isSharedDataSource;
  12836. this._proxiedDataSourceChangedHandler && this._dataSource.off("changed", this._proxiedDataSourceChangedHandler);
  12837. this._proxiedDataSourceLoadErrorHandler && this._dataSource.off("loadError", this._proxiedDataSourceLoadErrorHandler);
  12838. this._proxiedDataSourceLoadingChangedHandler && this._dataSource.off("loadingChanged", this._proxiedDataSourceLoadingChangedHandler)
  12839. } else {
  12840. this._dataSource.dispose()
  12841. }
  12842. delete this._dataSource;
  12843. delete this._proxiedDataSourceChangedHandler;
  12844. delete this._proxiedDataSourceLoadErrorHandler;
  12845. delete this._proxiedDataSourceLoadingChangedHandler
  12846. }
  12847. },
  12848. getDataSource: function() {
  12849. return this._dataSource || null
  12850. }
  12851. };
  12852. module.exports = DataHelperMixin
  12853. },
  12854. /*!**************************************************!*\
  12855. !*** ./artifacts/transpiled/core/utils/style.js ***!
  12856. \**************************************************/
  12857. /*! dynamic exports provided */
  12858. /*! all exports used */
  12859. function(module, exports, __webpack_require__) {
  12860. var camelize = __webpack_require__( /*! ./inflector */ 33).camelize;
  12861. var callOnce = __webpack_require__( /*! ./call_once */ 63);
  12862. var typeUtils = __webpack_require__( /*! ./type */ 1);
  12863. var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11);
  12864. var jsPrefixes = ["", "Webkit", "Moz", "O", "Ms"];
  12865. var cssPrefixes = {
  12866. "": "",
  12867. Webkit: "-webkit-",
  12868. Moz: "-moz-",
  12869. O: "-o-",
  12870. ms: "-ms-"
  12871. };
  12872. var getStyles = callOnce(function() {
  12873. return domAdapter.createElement("dx").style
  12874. });
  12875. var forEachPrefixes = function(prop, callBack) {
  12876. prop = camelize(prop, true);
  12877. var result;
  12878. for (var i = 0, cssPrefixesCount = jsPrefixes.length; i < cssPrefixesCount; i++) {
  12879. var jsPrefix = jsPrefixes[i];
  12880. var prefixedProp = jsPrefix + prop;
  12881. var lowerPrefixedProp = camelize(prefixedProp);
  12882. result = callBack(lowerPrefixedProp, jsPrefix);
  12883. if (void 0 === result) {
  12884. result = callBack(prefixedProp, jsPrefix)
  12885. }
  12886. if (void 0 !== result) {
  12887. break
  12888. }
  12889. }
  12890. return result || ""
  12891. };
  12892. var styleProp = function(name) {
  12893. if (name in getStyles()) {
  12894. return name
  12895. }
  12896. var originalName = name;
  12897. name = name.charAt(0).toUpperCase() + name.substr(1);
  12898. for (var i = 1; i < jsPrefixes.length; i++) {
  12899. var prefixedProp = jsPrefixes[i].toLowerCase() + name;
  12900. if (prefixedProp in getStyles()) {
  12901. return prefixedProp
  12902. }
  12903. }
  12904. return originalName
  12905. };
  12906. var stylePropPrefix = function(prop) {
  12907. return forEachPrefixes(prop, function(specific, jsPrefix) {
  12908. if (specific in getStyles()) {
  12909. return cssPrefixes[jsPrefix]
  12910. }
  12911. })
  12912. };
  12913. var pxExceptions = ["fillOpacity", "columnCount", "flexGrow", "flexShrink", "fontWeight", "lineHeight", "opacity", "zIndex", "zoom"];
  12914. var normalizeStyleProp = function(prop, value) {
  12915. if (typeUtils.isNumeric(value) && pxExceptions.indexOf(prop) === -1) {
  12916. value += "px"
  12917. }
  12918. return value
  12919. };
  12920. var setDimensionProperty = function(elements, propertyName, value) {
  12921. if (elements) {
  12922. value = typeUtils.isNumeric(value) ? value += "px" : value;
  12923. for (var i = 0; i < elements.length; ++i) {
  12924. elements[i].style[propertyName] = value
  12925. }
  12926. }
  12927. };
  12928. var setWidth = function(elements, value) {
  12929. setDimensionProperty(elements, "width", value)
  12930. };
  12931. var setHeight = function(elements, value) {
  12932. setDimensionProperty(elements, "height", value)
  12933. };
  12934. exports.styleProp = styleProp;
  12935. exports.stylePropPrefix = stylePropPrefix;
  12936. exports.normalizeStyleProp = normalizeStyleProp;
  12937. exports.setWidth = setWidth;
  12938. exports.setHeight = setHeight
  12939. },
  12940. /*!*************************************************************!*\
  12941. !*** ./artifacts/transpiled/core/utils/variable_wrapper.js ***!
  12942. \*************************************************************/
  12943. /*! dynamic exports provided */
  12944. /*! all exports used */
  12945. function(module, exports, __webpack_require__) {
  12946. var logger = __webpack_require__( /*! ./console */ 73).logger;
  12947. var dependencyInjector = __webpack_require__( /*! ./dependency_injector */ 54);
  12948. module.exports = dependencyInjector({
  12949. isWrapped: function() {
  12950. return false
  12951. },
  12952. isWritableWrapped: function() {
  12953. return false
  12954. },
  12955. wrap: function(value) {
  12956. return value
  12957. },
  12958. unwrap: function(value) {
  12959. return value
  12960. },
  12961. assign: function() {
  12962. logger.error("Method 'assign' should not be used for not wrapped variables. Use 'isWrapped' method for ensuring.")
  12963. }
  12964. })
  12965. },
  12966. /*!***************************************************!*\
  12967. !*** ./artifacts/transpiled/localization/core.js ***!
  12968. \***************************************************/
  12969. /*! dynamic exports provided */
  12970. /*! all exports used */
  12971. function(module, exports, __webpack_require__) {
  12972. var dependencyInjector = __webpack_require__( /*! ../core/utils/dependency_injector */ 54);
  12973. module.exports = dependencyInjector({
  12974. locale: function() {
  12975. var currentLocale = "en";
  12976. return function(locale) {
  12977. if (!locale) {
  12978. return currentLocale
  12979. }
  12980. currentLocale = locale
  12981. }
  12982. }()
  12983. })
  12984. },
  12985. /*!*********************************************!*\
  12986. !*** ./artifacts/transpiled/events/hold.js ***!
  12987. \*********************************************/
  12988. /*! dynamic exports provided */
  12989. /*! all exports used */
  12990. function(module, exports, __webpack_require__) {
  12991. var eventUtils = __webpack_require__( /*! ./utils */ 8);
  12992. var Emitter = __webpack_require__( /*! ./core/emitter */ 123);
  12993. var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95);
  12994. var abs = Math.abs;
  12995. var HOLD_EVENT_NAME = "dxhold";
  12996. var HOLD_TIMEOUT = 750;
  12997. var TOUCH_BOUNDARY = 5;
  12998. var HoldEmitter = Emitter.inherit({
  12999. start: function(e) {
  13000. this._startEventData = eventUtils.eventData(e);
  13001. this._startTimer(e)
  13002. },
  13003. _startTimer: function(e) {
  13004. var holdTimeout = "timeout" in this ? this.timeout : HOLD_TIMEOUT;
  13005. this._holdTimer = setTimeout(function() {
  13006. this._requestAccept(e);
  13007. this._fireEvent(HOLD_EVENT_NAME, e, {
  13008. target: e.target
  13009. });
  13010. this._forgetAccept()
  13011. }.bind(this), holdTimeout)
  13012. },
  13013. move: function(e) {
  13014. if (this._touchWasMoved(e)) {
  13015. this._cancel(e)
  13016. }
  13017. },
  13018. _touchWasMoved: function(e) {
  13019. var delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e));
  13020. return abs(delta.x) > TOUCH_BOUNDARY || abs(delta.y) > TOUCH_BOUNDARY
  13021. },
  13022. end: function() {
  13023. this._stopTimer()
  13024. },
  13025. _stopTimer: function() {
  13026. clearTimeout(this._holdTimer)
  13027. },
  13028. cancel: function() {
  13029. this._stopTimer()
  13030. },
  13031. dispose: function() {
  13032. this._stopTimer()
  13033. }
  13034. });
  13035. registerEmitter({
  13036. emitter: HoldEmitter,
  13037. bubble: true,
  13038. events: [HOLD_EVENT_NAME]
  13039. });
  13040. module.exports = {
  13041. name: HOLD_EVENT_NAME
  13042. }
  13043. }, , , , ,
  13044. /*!*************************************************!*\
  13045. !*** ./artifacts/transpiled/viz/core/export.js ***!
  13046. \*************************************************/
  13047. /*! dynamic exports provided */
  13048. /*! all exports used */
  13049. function(module, exports, __webpack_require__) {
  13050. Object.defineProperty(exports, "__esModule", {
  13051. value: true
  13052. });
  13053. exports.plugin = exports.ExportMenu = exports.combineMarkups = exports.exportWidgets = exports.getMarkup = exports.exportFromMarkup = void 0;
  13054. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  13055. var _window = __webpack_require__( /*! ../../core/utils/window */ 7);
  13056. var _utils = __webpack_require__( /*! ./utils */ 10);
  13057. var _exporter = __webpack_require__( /*! ../../exporter */ 170);
  13058. var _exporter2 = _interopRequireDefault(_exporter);
  13059. var _message = __webpack_require__( /*! ../../localization/message */ 13);
  13060. var _message2 = _interopRequireDefault(_message);
  13061. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  13062. var _themes = __webpack_require__( /*! ../themes */ 50);
  13063. var _themes2 = _interopRequireDefault(_themes);
  13064. var _hover = __webpack_require__( /*! ../../events/hover */ 148);
  13065. var _hover2 = _interopRequireDefault(_hover);
  13066. var _pointer = __webpack_require__( /*! ../../events/pointer */ 23);
  13067. var _pointer2 = _interopRequireDefault(_pointer);
  13068. function _interopRequireDefault(obj) {
  13069. return obj && obj.__esModule ? obj : {
  13070. "default": obj
  13071. }
  13072. }
  13073. var imageExporter = _exporter2.default.image;
  13074. var svgExporter = _exporter2.default.svg;
  13075. var pdfExporter = _exporter2.default.pdf;
  13076. var pointerActions = [_pointer2.default.down, _pointer2.default.move].join(" ");
  13077. var BUTTON_SIZE = 35;
  13078. var ICON_COORDS = [
  13079. [9, 12, 26, 12, 26, 14, 9, 14],
  13080. [9, 17, 26, 17, 26, 19, 9, 19],
  13081. [9, 22, 26, 22, 26, 24, 9, 24]
  13082. ];
  13083. var LIST_PADDING_TOP = 4;
  13084. var LIST_WIDTH = 120;
  13085. var VERTICAL_TEXT_MARGIN = 8;
  13086. var HORIZONTAL_TEXT_MARGIN = 15;
  13087. var MENU_ITEM_HEIGHT = 30;
  13088. var LIST_STROKE_WIDTH = 1;
  13089. var MARGIN = 10;
  13090. var SHADOW_OFFSET = 2;
  13091. var SHADOW_BLUR = 3;
  13092. var DEFAULT_EXPORT_FORMAT = "PNG";
  13093. var ALLOWED_IMAGE_FORMATS = [DEFAULT_EXPORT_FORMAT, "JPEG", "GIF"];
  13094. var ALLOWED_EXTRA_FORMATS = ["PDF", "SVG"];
  13095. var EXPORT_CSS_CLASS = "dx-export-menu";
  13096. var EXPORT_DATA_KEY = "export-element-type";
  13097. var FORMAT_DATA_KEY = "export-element-format";
  13098. var GET_COLOR_REGEX = /data-backgroundcolor="([^"]*)"/;
  13099. function getValidFormats() {
  13100. var imageFormats = imageExporter.testFormats(ALLOWED_IMAGE_FORMATS);
  13101. return {
  13102. unsupported: imageFormats.unsupported,
  13103. supported: imageFormats.supported.concat(ALLOWED_EXTRA_FORMATS)
  13104. }
  13105. }
  13106. function validateFormat(format, incidentOccurred, validFormats) {
  13107. validFormats = validFormats || getValidFormats();
  13108. format = String(format).toUpperCase();
  13109. if (validFormats.supported.indexOf(format) !== -1) {
  13110. return format
  13111. }
  13112. if (validFormats.unsupported.indexOf(format) !== -1) {
  13113. incidentOccurred && incidentOccurred("W2108", [format])
  13114. }
  13115. }
  13116. function getCreatorFunc(format) {
  13117. if ("SVG" === format) {
  13118. return svgExporter.getData
  13119. } else {
  13120. if ("PDF" === format) {
  13121. return pdfExporter.getData
  13122. } else {
  13123. return imageExporter.getData
  13124. }
  13125. }
  13126. }
  13127. function _print(imageSrc, options) {
  13128. var document = (0, _window.getWindow)().document;
  13129. var iFrame = document.createElement("iframe");
  13130. iFrame.onload = setPrint(imageSrc, options);
  13131. iFrame.style.visibility = "hidden";
  13132. iFrame.style.position = "fixed";
  13133. iFrame.style.right = "0";
  13134. iFrame.style.bottom = "0";
  13135. document.body.appendChild(iFrame)
  13136. }
  13137. function setPrint(imageSrc, options) {
  13138. return function() {
  13139. var _this = this;
  13140. var window = this.contentWindow;
  13141. var img = window.document.createElement("img");
  13142. window.document.body.appendChild(img);
  13143. var origImageSrc = imageSrc;
  13144. if (options.__test) {
  13145. imageSrc = options.__test.imageSrc;
  13146. window = options.__test.mockWindow
  13147. }
  13148. var removeFrame = function() {
  13149. options.__test && options.__test.checkAssertions();
  13150. _this.parentElement.removeChild(_this);
  13151. options.__test && options.__test.deferred.resolve(origImageSrc)
  13152. };
  13153. img.addEventListener("load", function() {
  13154. window.focus();
  13155. window.print();
  13156. removeFrame()
  13157. });
  13158. img.addEventListener("error", removeFrame);
  13159. img.src = imageSrc
  13160. }
  13161. }
  13162. function getItemAttributes(options, type, itemIndex) {
  13163. var x = BUTTON_SIZE - LIST_WIDTH;
  13164. var y = BUTTON_SIZE + LIST_PADDING_TOP + LIST_STROKE_WIDTH + itemIndex * MENU_ITEM_HEIGHT;
  13165. var attr = {
  13166. rect: {
  13167. width: LIST_WIDTH - 2 * LIST_STROKE_WIDTH,
  13168. height: MENU_ITEM_HEIGHT,
  13169. x: x + LIST_STROKE_WIDTH,
  13170. y: y
  13171. },
  13172. text: {
  13173. x: x + (options.rtl ? LIST_WIDTH - HORIZONTAL_TEXT_MARGIN : HORIZONTAL_TEXT_MARGIN),
  13174. y: y + MENU_ITEM_HEIGHT - VERTICAL_TEXT_MARGIN
  13175. }
  13176. };
  13177. if ("printing" === type) {
  13178. attr.separator = {
  13179. stroke: options.button.default.borderColor,
  13180. "stroke-width": LIST_STROKE_WIDTH,
  13181. cursor: "pointer",
  13182. sharp: "v",
  13183. d: "M " + x + " " + (y + MENU_ITEM_HEIGHT - LIST_STROKE_WIDTH) + " L " + (x + LIST_WIDTH) + " " + (y + MENU_ITEM_HEIGHT - LIST_STROKE_WIDTH)
  13184. }
  13185. }
  13186. return attr
  13187. }
  13188. function createMenuItem(renderer, options, settings) {
  13189. var itemData = {};
  13190. var type = settings.type;
  13191. var format = settings.format;
  13192. var attr = getItemAttributes(options, type, settings.itemIndex);
  13193. var fontStyle = (0, _utils.patchFontOptions)(options.font);
  13194. fontStyle["pointer-events"] = "none";
  13195. var menuItem = renderer.g().attr({
  13196. "class": EXPORT_CSS_CLASS + "-list-item"
  13197. });
  13198. itemData[EXPORT_DATA_KEY] = type;
  13199. if (format) {
  13200. itemData[FORMAT_DATA_KEY] = format
  13201. }
  13202. var rect = renderer.rect();
  13203. rect.attr(attr.rect).css({
  13204. cursor: "pointer",
  13205. "pointer-events": "all"
  13206. }).data(itemData);
  13207. rect.on(_hover2.default.start + ".export", function() {
  13208. return rect.attr({
  13209. fill: options.button.hover.backgroundColor
  13210. })
  13211. }).on(_hover2.default.end + ".export", function() {
  13212. return rect.attr({
  13213. fill: null
  13214. })
  13215. });
  13216. rect.append(menuItem);
  13217. var text = renderer.text(settings.text).css(fontStyle).attr(attr.text).append(menuItem);
  13218. if ("printing" === type) {
  13219. renderer.path(null, "line").attr(attr.separator).append(menuItem)
  13220. }
  13221. return {
  13222. g: menuItem,
  13223. rect: rect,
  13224. resetState: function() {
  13225. return rect.attr({
  13226. fill: null
  13227. })
  13228. },
  13229. fixPosition: function() {
  13230. var textBBox = text.getBBox();
  13231. text.move(attr.text.x - textBBox.x - (options.rtl ? textBBox.width : 0))
  13232. }
  13233. }
  13234. }
  13235. function createMenuItems(renderer, options) {
  13236. var items = [];
  13237. if (options.printingEnabled) {
  13238. items.push(createMenuItem(renderer, options, {
  13239. type: "printing",
  13240. text: _message2.default.format("vizExport-printingButtonText"),
  13241. itemIndex: items.length
  13242. }))
  13243. }
  13244. items = options.formats.reduce(function(r, format) {
  13245. r.push(createMenuItem(renderer, options, {
  13246. type: "exporting",
  13247. text: _message2.default.getFormatter("vizExport-exportButtonText")(format),
  13248. format: format,
  13249. itemIndex: r.length
  13250. }));
  13251. return r
  13252. }, items);
  13253. return items
  13254. }
  13255. function getBackgroundColorFromMarkup(markup) {
  13256. var parsedMarkup = GET_COLOR_REGEX.exec(markup);
  13257. return parsedMarkup ? parsedMarkup[1] : void 0
  13258. }
  13259. var exportFromMarkup = exports.exportFromMarkup = function(markup, options) {
  13260. options.format = validateFormat(options.format) || DEFAULT_EXPORT_FORMAT;
  13261. options.fileName = options.fileName || "file";
  13262. options.exportingAction = options.onExporting;
  13263. options.exportedAction = options.onExported;
  13264. options.fileSavingAction = options.onFileSaving;
  13265. options.margin = (0, _type.isDefined)(options.margin) ? options.margin : MARGIN;
  13266. options.backgroundColor = (0, _type.isDefined)(options.backgroundColor) ? options.backgroundColor : getBackgroundColorFromMarkup(markup);
  13267. _exporter2.default.export(markup, options, getCreatorFunc(options.format))
  13268. };
  13269. exports.getMarkup = function(widgets) {
  13270. return combineMarkups(widgets).markup
  13271. };
  13272. exports.exportWidgets = function(widgets, options) {
  13273. options = options || {};
  13274. var markupInfo = exports.combineMarkups(widgets, {
  13275. gridLayout: options.gridLayout,
  13276. verticalAlignment: options.verticalAlignment,
  13277. horizontalAlignment: options.horizontalAlignment
  13278. });
  13279. options.width = markupInfo.width;
  13280. options.height = markupInfo.height;
  13281. exportFromMarkup(markupInfo.markup, options)
  13282. };
  13283. var combineMarkups = exports.combineMarkups = function(widgets) {
  13284. var options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
  13285. if (!Array.isArray(widgets)) {
  13286. widgets = [
  13287. [widgets]
  13288. ]
  13289. } else {
  13290. if (!Array.isArray(widgets[0])) {
  13291. widgets = widgets.map(function(item) {
  13292. return [item]
  13293. })
  13294. }
  13295. }
  13296. var compactView = !options.gridLayout;
  13297. var exportItems = widgets.reduce(function(r, row, rowIndex) {
  13298. var rowInfo = row.reduce(function(r, item, colIndex) {
  13299. var size = item.getSize();
  13300. var backgroundColor = item.option("backgroundColor") || _themes2.default.getTheme(item.option("theme")).backgroundColor;
  13301. backgroundColor && r.backgroundColors.indexOf(backgroundColor) === -1 && r.backgroundColors.push(backgroundColor);
  13302. r.hOffset = r.width;
  13303. r.width += size.width;
  13304. r.height = Math.max(r.height, size.height);
  13305. r.itemWidth = Math.max(r.itemWidth, size.width);
  13306. r.items.push({
  13307. markup: item.svg(),
  13308. width: size.width,
  13309. height: size.height,
  13310. c: colIndex,
  13311. r: rowIndex,
  13312. hOffset: r.hOffset
  13313. });
  13314. return r
  13315. }, {
  13316. items: [],
  13317. height: 0,
  13318. itemWidth: 0,
  13319. hOffset: 0,
  13320. width: 0,
  13321. backgroundColors: r.backgroundColors
  13322. });
  13323. r.rowOffsets.push(r.totalHeight);
  13324. r.rowHeights.push(rowInfo.height);
  13325. r.totalHeight += rowInfo.height;
  13326. r.items = r.items.concat(rowInfo.items);
  13327. r.itemWidth = Math.max(r.itemWidth, rowInfo.itemWidth);
  13328. r.maxItemLen = Math.max(r.maxItemLen, rowInfo.items.length);
  13329. r.totalWidth = compactView ? Math.max(r.totalWidth, rowInfo.width) : r.maxItemLen * r.itemWidth;
  13330. return r
  13331. }, {
  13332. items: [],
  13333. rowOffsets: [],
  13334. rowHeights: [],
  13335. itemWidth: 0,
  13336. totalHeight: 0,
  13337. maxItemLen: 0,
  13338. totalWidth: 0,
  13339. backgroundColors: []
  13340. });
  13341. var backgroundColor = 'data-backgroundcolor="'.concat(1 === exportItems.backgroundColors.length ? exportItems.backgroundColors[0] : "", '" ');
  13342. var getVOffset = function(item) {
  13343. var align = options.verticalAlignment;
  13344. var dy = exportItems.rowHeights[item.r] - item.height;
  13345. return exportItems.rowOffsets[item.r] + ("bottom" === align ? dy : "center" === align ? dy / 2 : 0)
  13346. };
  13347. var getHOffset = function(item) {
  13348. if (compactView) {
  13349. return item.hOffset
  13350. }
  13351. var align = options.horizontalAlignment;
  13352. var colWidth = exportItems.itemWidth;
  13353. var dx = colWidth - item.width;
  13354. return item.c * colWidth + ("right" === align ? dx : "center" === align ? dx / 2 : 0)
  13355. };
  13356. var totalHeight = exportItems.totalHeight;
  13357. var totalWidth = exportItems.totalWidth;
  13358. return {
  13359. markup: "<svg " + backgroundColor + 'height="' + totalHeight + '" width="' + totalWidth + '" version="1.1" xmlns="http://www.w3.org/2000/svg">' + exportItems.items.map(function(item) {
  13360. return '<g transform="translate('.concat(getHOffset(item), ",").concat(getVOffset(item), ')">').concat(item.markup, "</g>")
  13361. }).join("") + "</svg>",
  13362. width: totalWidth,
  13363. height: totalHeight
  13364. }
  13365. };
  13366. var ExportMenu = exports.ExportMenu = function(params) {
  13367. var renderer = this._renderer = params.renderer;
  13368. this._incidentOccurred = params.incidentOccurred;
  13369. this._exportTo = params.exportTo;
  13370. this._print = params.print;
  13371. this._shadow = renderer.shadowFilter("-50%", "-50%", "200%", "200%", SHADOW_OFFSET, 6, SHADOW_BLUR);
  13372. this._shadow.attr({
  13373. opacity: .8
  13374. });
  13375. this._group = renderer.g().attr({
  13376. "class": EXPORT_CSS_CLASS,
  13377. "hidden-for-export": true
  13378. }).linkOn(renderer.root, {
  13379. name: "export-menu",
  13380. after: "peripheral"
  13381. });
  13382. this._buttonGroup = renderer.g().attr({
  13383. "class": EXPORT_CSS_CLASS + "-button"
  13384. }).append(this._group);
  13385. this._listGroup = renderer.g().attr({
  13386. "class": EXPORT_CSS_CLASS + "-list"
  13387. }).append(this._group);
  13388. this._overlay = renderer.rect(-LIST_WIDTH + BUTTON_SIZE, BUTTON_SIZE + LIST_PADDING_TOP, LIST_WIDTH, 0);
  13389. this._overlay.attr({
  13390. "stroke-width": LIST_STROKE_WIDTH,
  13391. cursor: "pointer",
  13392. rx: 4,
  13393. ry: 4,
  13394. filter: this._shadow.id
  13395. });
  13396. this._overlay.data({
  13397. "export-element-type": "list"
  13398. });
  13399. this.validFormats = getValidFormats();
  13400. this._subscribeEvents()
  13401. };
  13402. (0, _extend.extend)(ExportMenu.prototype, {
  13403. getLayoutOptions: function() {
  13404. if (this._hiddenDueToLayout) {
  13405. return {
  13406. width: 0,
  13407. height: 0,
  13408. cutSide: "vertical",
  13409. cutLayoutSide: "top"
  13410. }
  13411. }
  13412. var bBox = this._buttonGroup.getBBox();
  13413. bBox.cutSide = "vertical";
  13414. bBox.cutLayoutSide = "top";
  13415. bBox.height += MARGIN;
  13416. bBox.position = {
  13417. vertical: "top",
  13418. horizontal: "right"
  13419. };
  13420. bBox.verticalAlignment = "top";
  13421. bBox.horizontalAlignment = "right";
  13422. return bBox
  13423. },
  13424. probeDraw: function() {
  13425. this._fillSpace();
  13426. this.show()
  13427. },
  13428. shift: function(_, y) {
  13429. this._group.attr({
  13430. translateY: this._group.attr("translateY") + y
  13431. })
  13432. },
  13433. draw: function(width, height, canvas) {
  13434. this._group.move(width - BUTTON_SIZE - SHADOW_OFFSET - SHADOW_BLUR + canvas.left, Math.floor(height / 2 - BUTTON_SIZE / 2));
  13435. var layoutOptions = this.getLayoutOptions();
  13436. if (layoutOptions.width > width || layoutOptions.height > height) {
  13437. this.freeSpace()
  13438. }
  13439. return this
  13440. },
  13441. show: function() {
  13442. this._group.linkAppend()
  13443. },
  13444. hide: function() {
  13445. this._group.linkRemove()
  13446. },
  13447. setOptions: function(options) {
  13448. var _this2 = this;
  13449. this._options = options;
  13450. if (options.formats) {
  13451. options.formats = options.formats.reduce(function(r, format) {
  13452. format = validateFormat(format, _this2._incidentOccurred, _this2.validFormats);
  13453. format && r.push(format);
  13454. return r
  13455. }, [])
  13456. } else {
  13457. options.formats = this.validFormats.supported.slice()
  13458. }
  13459. options.printingEnabled = void 0 === options.printingEnabled ? true : options.printingEnabled;
  13460. if (options.enabled && (options.formats.length || options.printingEnabled)) {
  13461. this.show();
  13462. this._updateButton();
  13463. this._updateList();
  13464. this._hideList()
  13465. } else {
  13466. this.hide()
  13467. }
  13468. },
  13469. dispose: function() {
  13470. this._unsubscribeEvents();
  13471. this._group.linkRemove().linkOff();
  13472. this._group.dispose();
  13473. this._shadow.dispose()
  13474. },
  13475. layoutOptions: function() {
  13476. return this._options.enabled && {
  13477. horizontalAlignment: "right",
  13478. verticalAlignment: "top",
  13479. weak: true
  13480. }
  13481. },
  13482. measure: function() {
  13483. this._fillSpace();
  13484. var margin = this._options.button.margin;
  13485. return [BUTTON_SIZE + margin.left + margin.right, BUTTON_SIZE + margin.top + margin.bottom]
  13486. },
  13487. move: function(rect) {
  13488. var margin = this._options.button.margin;
  13489. this._group.attr({
  13490. translateX: Math.round(rect[0]) + margin.left,
  13491. translateY: Math.round(rect[1]) + margin.top
  13492. })
  13493. },
  13494. _fillSpace: function() {
  13495. this._hiddenDueToLayout = false;
  13496. this.show()
  13497. },
  13498. freeSpace: function() {
  13499. this._incidentOccurred("W2107");
  13500. this._hiddenDueToLayout = true;
  13501. this.hide()
  13502. },
  13503. _hideList: function() {
  13504. this._listGroup.remove();
  13505. this._listShown = false;
  13506. this._setButtonState("default");
  13507. this._menuItems.forEach(function(item) {
  13508. return item.resetState()
  13509. })
  13510. },
  13511. _showList: function() {
  13512. this._listGroup.append(this._group);
  13513. this._listShown = true;
  13514. this._menuItems.forEach(function(item) {
  13515. return item.fixPosition()
  13516. })
  13517. },
  13518. _setButtonState: function(state) {
  13519. var style = this._options.button[state];
  13520. this._button.attr({
  13521. stroke: style.borderColor,
  13522. fill: style.backgroundColor
  13523. });
  13524. this._icon.attr({
  13525. fill: style.color
  13526. })
  13527. },
  13528. _subscribeEvents: function() {
  13529. var _this3 = this;
  13530. this._renderer.root.on(_pointer2.default.up + ".export", function(e) {
  13531. var elementType = e.target[EXPORT_DATA_KEY];
  13532. if (!elementType) {
  13533. if (_this3._button) {
  13534. _this3._hideList()
  13535. }
  13536. return
  13537. }
  13538. if ("button" === elementType) {
  13539. if (_this3._listShown) {
  13540. _this3._setButtonState("default");
  13541. _this3._hideList()
  13542. } else {
  13543. _this3._setButtonState("focus");
  13544. _this3._showList()
  13545. }
  13546. } else {
  13547. if ("printing" === elementType) {
  13548. _this3._print();
  13549. _this3._hideList()
  13550. } else {
  13551. if ("exporting" === elementType) {
  13552. _this3._exportTo(e.target[FORMAT_DATA_KEY]);
  13553. _this3._hideList()
  13554. }
  13555. }
  13556. }
  13557. });
  13558. this._listGroup.on(pointerActions, function(e) {
  13559. return e.stopPropagation()
  13560. });
  13561. this._buttonGroup.on(_pointer2.default.enter, function() {
  13562. return _this3._setButtonState("hover")
  13563. });
  13564. this._buttonGroup.on(_pointer2.default.leave, function() {
  13565. return _this3._setButtonState(_this3._listShown ? "focus" : "default")
  13566. });
  13567. this._buttonGroup.on(_pointer2.default.down + ".export", function() {
  13568. return _this3._setButtonState("active")
  13569. })
  13570. },
  13571. _unsubscribeEvents: function() {
  13572. this._renderer.root.off(".export");
  13573. this._listGroup.off();
  13574. this._buttonGroup.off()
  13575. },
  13576. _updateButton: function() {
  13577. var renderer = this._renderer;
  13578. var options = this._options;
  13579. var exportData = {
  13580. "export-element-type": "button"
  13581. };
  13582. if (!this._button) {
  13583. this._button = renderer.rect(0, 0, BUTTON_SIZE, BUTTON_SIZE).append(this._buttonGroup);
  13584. this._button.attr({
  13585. rx: 4,
  13586. ry: 4,
  13587. fill: options.button.default.backgroundColor,
  13588. stroke: options.button.default.borderColor,
  13589. "stroke-width": 1,
  13590. cursor: "pointer"
  13591. });
  13592. this._button.data(exportData);
  13593. this._icon = renderer.path(ICON_COORDS).append(this._buttonGroup);
  13594. this._icon.attr({
  13595. fill: options.button.default.color,
  13596. cursor: "pointer"
  13597. });
  13598. this._icon.data(exportData);
  13599. this._buttonGroup.setTitle(_message2.default.format("vizExport-titleMenuText"))
  13600. }
  13601. },
  13602. _updateList: function() {
  13603. var options = this._options;
  13604. var buttonDefault = options.button.default;
  13605. var listGroup = this._listGroup;
  13606. var items = createMenuItems(this._renderer, options);
  13607. this._shadow.attr({
  13608. color: options.shadowColor
  13609. });
  13610. this._overlay.attr({
  13611. height: items.length * MENU_ITEM_HEIGHT + 2 * LIST_STROKE_WIDTH,
  13612. fill: buttonDefault.backgroundColor,
  13613. stroke: buttonDefault.borderColor
  13614. });
  13615. listGroup.clear();
  13616. this._overlay.append(listGroup);
  13617. items.forEach(function(item) {
  13618. return item.g.append(listGroup)
  13619. });
  13620. this._menuItems = items
  13621. }
  13622. });
  13623. function getExportOptions(widget, exportOptions, fileName, format) {
  13624. if (format || exportOptions.format) {
  13625. format = validateFormat(format || exportOptions.format, widget._incidentOccurred)
  13626. }
  13627. return {
  13628. format: format || DEFAULT_EXPORT_FORMAT,
  13629. fileName: fileName || exportOptions.fileName || "file",
  13630. proxyUrl: exportOptions.proxyUrl,
  13631. backgroundColor: exportOptions.backgroundColor,
  13632. width: widget._canvas.width,
  13633. height: widget._canvas.height,
  13634. margin: exportOptions.margin,
  13635. forceProxy: exportOptions.forceProxy,
  13636. exportingAction: widget._createActionByOption("onExporting"),
  13637. exportedAction: widget._createActionByOption("onExported"),
  13638. fileSavingAction: widget._createActionByOption("onFileSaving")
  13639. }
  13640. }
  13641. exports.plugin = {
  13642. name: "export",
  13643. init: function() {
  13644. var _this4 = this;
  13645. this._exportMenu = new exports.ExportMenu({
  13646. renderer: this._renderer,
  13647. incidentOccurred: this._incidentOccurred,
  13648. print: function() {
  13649. return _this4.print()
  13650. },
  13651. exportTo: function(format) {
  13652. return _this4.exportTo(void 0, format)
  13653. }
  13654. });
  13655. this._layout.add(this._exportMenu)
  13656. },
  13657. dispose: function() {
  13658. this._exportMenu.dispose()
  13659. },
  13660. members: {
  13661. _getExportMenuOptions: function() {
  13662. return (0, _extend.extend)({}, this._getOption("export"), {
  13663. rtl: this._getOption("rtlEnabled", true)
  13664. })
  13665. },
  13666. _disablePointerEvents: function() {
  13667. var pointerEventsValue = this._renderer.root.attr("pointer-events");
  13668. this._renderer.root.attr({
  13669. "pointer-events": "none"
  13670. });
  13671. return pointerEventsValue
  13672. },
  13673. exportTo: function(fileName, format) {
  13674. var _this5 = this;
  13675. var menu = this._exportMenu;
  13676. var options = getExportOptions(this, this._getOption("export") || {}, fileName, format);
  13677. menu && menu.hide();
  13678. var pointerEventsValue = this._disablePointerEvents();
  13679. _exporter2.default.export(this._renderer.root.element, options, getCreatorFunc(options.format)).done(function() {
  13680. _this5._renderer.root.attr({
  13681. "pointer-events": pointerEventsValue
  13682. })
  13683. });
  13684. menu && menu.show()
  13685. },
  13686. print: function() {
  13687. var _this6 = this;
  13688. var menu = this._exportMenu;
  13689. var options = getExportOptions(this, this._getOption("export") || {});
  13690. options.__test = this._getOption("export").__test;
  13691. options.exportingAction = null;
  13692. options.exportedAction = null;
  13693. options.margin = 0;
  13694. options.format = "PNG";
  13695. options.forceProxy = true;
  13696. options.fileSavingAction = function(eventArgs) {
  13697. _print("data:image/png;base64,".concat(eventArgs.data), {
  13698. __test: options.__test
  13699. });
  13700. eventArgs.cancel = true
  13701. };
  13702. var pointerEventsValue = this._disablePointerEvents();
  13703. menu && menu.hide();
  13704. _exporter2.default.export(this._renderer.root.element, options, getCreatorFunc(options.format)).done(function() {
  13705. _this6._renderer.root.attr({
  13706. "pointer-events": pointerEventsValue
  13707. })
  13708. });
  13709. menu && menu.show()
  13710. }
  13711. },
  13712. customize: function(constructor) {
  13713. var proto = constructor.prototype;
  13714. constructor.addChange({
  13715. code: "EXPORT",
  13716. handler: function() {
  13717. this._exportMenu.setOptions(this._getExportMenuOptions());
  13718. this._change(["LAYOUT"])
  13719. },
  13720. isThemeDependent: true,
  13721. isOptionChange: true,
  13722. option: "export"
  13723. });
  13724. proto._optionChangesMap.onExporting = "EXPORT";
  13725. proto._optionChangesMap.onExported = "EXPORT";
  13726. proto._optionChangesMap.onFileSaving = "EXPORT"
  13727. },
  13728. fontFields: ["export.font"]
  13729. }
  13730. },
  13731. /*!***************************************!*\
  13732. !*** ./artifacts/transpiled/color.js ***!
  13733. \***************************************/
  13734. /*! dynamic exports provided */
  13735. /*! all exports used */
  13736. function(module, exports, __webpack_require__) {
  13737. var standardColorNames = {
  13738. aliceblue: "f0f8ff",
  13739. antiquewhite: "faebd7",
  13740. aqua: "00ffff",
  13741. aquamarine: "7fffd4",
  13742. azure: "f0ffff",
  13743. beige: "f5f5dc",
  13744. bisque: "ffe4c4",
  13745. black: "000000",
  13746. blanchedalmond: "ffebcd",
  13747. blue: "0000ff",
  13748. blueviolet: "8a2be2",
  13749. brown: "a52a2a",
  13750. burlywood: "deb887",
  13751. cadetblue: "5f9ea0",
  13752. chartreuse: "7fff00",
  13753. chocolate: "d2691e",
  13754. coral: "ff7f50",
  13755. cornflowerblue: "6495ed",
  13756. cornsilk: "fff8dc",
  13757. crimson: "dc143c",
  13758. cyan: "00ffff",
  13759. darkblue: "00008b",
  13760. darkcyan: "008b8b",
  13761. darkgoldenrod: "b8860b",
  13762. darkgray: "a9a9a9",
  13763. darkgreen: "006400",
  13764. darkkhaki: "bdb76b",
  13765. darkmagenta: "8b008b",
  13766. darkolivegreen: "556b2f",
  13767. darkorange: "ff8c00",
  13768. darkorchid: "9932cc",
  13769. darkred: "8b0000",
  13770. darksalmon: "e9967a",
  13771. darkseagreen: "8fbc8f",
  13772. darkslateblue: "483d8b",
  13773. darkslategray: "2f4f4f",
  13774. darkturquoise: "00ced1",
  13775. darkviolet: "9400d3",
  13776. deeppink: "ff1493",
  13777. deepskyblue: "00bfff",
  13778. dimgray: "696969",
  13779. dodgerblue: "1e90ff",
  13780. feldspar: "d19275",
  13781. firebrick: "b22222",
  13782. floralwhite: "fffaf0",
  13783. forestgreen: "228b22",
  13784. fuchsia: "ff00ff",
  13785. gainsboro: "dcdcdc",
  13786. ghostwhite: "f8f8ff",
  13787. gold: "ffd700",
  13788. goldenrod: "daa520",
  13789. gray: "808080",
  13790. green: "008000",
  13791. greenyellow: "adff2f",
  13792. honeydew: "f0fff0",
  13793. hotpink: "ff69b4",
  13794. indianred: "cd5c5c",
  13795. indigo: "4b0082",
  13796. ivory: "fffff0",
  13797. khaki: "f0e68c",
  13798. lavender: "e6e6fa",
  13799. lavenderblush: "fff0f5",
  13800. lawngreen: "7cfc00",
  13801. lemonchiffon: "fffacd",
  13802. lightblue: "add8e6",
  13803. lightcoral: "f08080",
  13804. lightcyan: "e0ffff",
  13805. lightgoldenrodyellow: "fafad2",
  13806. lightgrey: "d3d3d3",
  13807. lightgreen: "90ee90",
  13808. lightpink: "ffb6c1",
  13809. lightsalmon: "ffa07a",
  13810. lightseagreen: "20b2aa",
  13811. lightskyblue: "87cefa",
  13812. lightslateblue: "8470ff",
  13813. lightslategray: "778899",
  13814. lightsteelblue: "b0c4de",
  13815. lightyellow: "ffffe0",
  13816. lime: "00ff00",
  13817. limegreen: "32cd32",
  13818. linen: "faf0e6",
  13819. magenta: "ff00ff",
  13820. maroon: "800000",
  13821. mediumaquamarine: "66cdaa",
  13822. mediumblue: "0000cd",
  13823. mediumorchid: "ba55d3",
  13824. mediumpurple: "9370d8",
  13825. mediumseagreen: "3cb371",
  13826. mediumslateblue: "7b68ee",
  13827. mediumspringgreen: "00fa9a",
  13828. mediumturquoise: "48d1cc",
  13829. mediumvioletred: "c71585",
  13830. midnightblue: "191970",
  13831. mintcream: "f5fffa",
  13832. mistyrose: "ffe4e1",
  13833. moccasin: "ffe4b5",
  13834. navajowhite: "ffdead",
  13835. navy: "000080",
  13836. oldlace: "fdf5e6",
  13837. olive: "808000",
  13838. olivedrab: "6b8e23",
  13839. orange: "ffa500",
  13840. orangered: "ff4500",
  13841. orchid: "da70d6",
  13842. palegoldenrod: "eee8aa",
  13843. palegreen: "98fb98",
  13844. paleturquoise: "afeeee",
  13845. palevioletred: "d87093",
  13846. papayawhip: "ffefd5",
  13847. peachpuff: "ffdab9",
  13848. peru: "cd853f",
  13849. pink: "ffc0cb",
  13850. plum: "dda0dd",
  13851. powderblue: "b0e0e6",
  13852. purple: "800080",
  13853. rebeccapurple: "663399",
  13854. red: "ff0000",
  13855. rosybrown: "bc8f8f",
  13856. royalblue: "4169e1",
  13857. saddlebrown: "8b4513",
  13858. salmon: "fa8072",
  13859. sandybrown: "f4a460",
  13860. seagreen: "2e8b57",
  13861. seashell: "fff5ee",
  13862. sienna: "a0522d",
  13863. silver: "c0c0c0",
  13864. skyblue: "87ceeb",
  13865. slateblue: "6a5acd",
  13866. slategray: "708090",
  13867. snow: "fffafa",
  13868. springgreen: "00ff7f",
  13869. steelblue: "4682b4",
  13870. tan: "d2b48c",
  13871. teal: "008080",
  13872. thistle: "d8bfd8",
  13873. tomato: "ff6347",
  13874. turquoise: "40e0d0",
  13875. violet: "ee82ee",
  13876. violetred: "d02090",
  13877. wheat: "f5deb3",
  13878. white: "ffffff",
  13879. whitesmoke: "f5f5f5",
  13880. yellow: "ffff00",
  13881. yellowgreen: "9acd32"
  13882. };
  13883. var standardColorTypes = [{
  13884. re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
  13885. process: function(colorString) {
  13886. return [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10)]
  13887. }
  13888. }, {
  13889. re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d*\.*\d+)\)$/,
  13890. process: function(colorString) {
  13891. return [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10), parseFloat(colorString[4])]
  13892. }
  13893. }, {
  13894. re: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/,
  13895. process: function(colorString) {
  13896. return [parseInt(colorString[1], 16), parseInt(colorString[2], 16), parseInt(colorString[3], 16)]
  13897. }
  13898. }, {
  13899. re: /^#([a-f0-9]{1})([a-f0-9]{1})([a-f0-9]{1})$/,
  13900. process: function(colorString) {
  13901. return [parseInt(colorString[1] + colorString[1], 16), parseInt(colorString[2] + colorString[2], 16), parseInt(colorString[3] + colorString[3], 16)]
  13902. }
  13903. }, {
  13904. re: /^hsv\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
  13905. process: function(colorString) {
  13906. var h = parseInt(colorString[1], 10);
  13907. var s = parseInt(colorString[2], 10);
  13908. var v = parseInt(colorString[3], 10);
  13909. var rgb = hsvToRgb(h, s, v);
  13910. return [rgb[0], rgb[1], rgb[2], 1, [h, s, v]]
  13911. }
  13912. }, {
  13913. re: /^hsl\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
  13914. process: function(colorString) {
  13915. var h = parseInt(colorString[1], 10);
  13916. var s = parseInt(colorString[2], 10);
  13917. var l = parseInt(colorString[3], 10);
  13918. var rgb = hslToRgb(h, s, l);
  13919. return [rgb[0], rgb[1], rgb[2], 1, null, [h, s, l]]
  13920. }
  13921. }];
  13922. function Color(value) {
  13923. this.baseColor = value;
  13924. var color;
  13925. if (value) {
  13926. color = String(value).toLowerCase().replace(/ /g, "");
  13927. color = standardColorNames[color] ? "#" + standardColorNames[color] : color;
  13928. color = parseColor(color)
  13929. }
  13930. if (!color) {
  13931. this.colorIsInvalid = true
  13932. }
  13933. color = color || {};
  13934. this.r = normalize(color[0]);
  13935. this.g = normalize(color[1]);
  13936. this.b = normalize(color[2]);
  13937. this.a = normalize(color[3], 1, 1);
  13938. if (color[4]) {
  13939. this.hsv = {
  13940. h: color[4][0],
  13941. s: color[4][1],
  13942. v: color[4][2]
  13943. }
  13944. } else {
  13945. this.hsv = toHsvFromRgb(this.r, this.g, this.b)
  13946. }
  13947. if (color[5]) {
  13948. this.hsl = {
  13949. h: color[5][0],
  13950. s: color[5][1],
  13951. l: color[5][2]
  13952. }
  13953. } else {
  13954. this.hsl = toHslFromRgb(this.r, this.g, this.b)
  13955. }
  13956. }
  13957. function parseColor(color) {
  13958. if ("transparent" === color) {
  13959. return [0, 0, 0, 0]
  13960. }
  13961. var i = 0;
  13962. var ii = standardColorTypes.length;
  13963. var str;
  13964. for (; i < ii; ++i) {
  13965. str = standardColorTypes[i].re.exec(color);
  13966. if (str) {
  13967. return standardColorTypes[i].process(str)
  13968. }
  13969. }
  13970. return null
  13971. }
  13972. function normalize(colorComponent, def, max) {
  13973. def = def || 0;
  13974. max = max || 255;
  13975. return colorComponent < 0 || isNaN(colorComponent) ? def : colorComponent > max ? max : colorComponent
  13976. }
  13977. function toHexFromRgb(r, g, b) {
  13978. return "#" + (16777216 | r << 16 | g << 8 | b).toString(16).slice(1)
  13979. }
  13980. function toHsvFromRgb(r, g, b) {
  13981. var max = Math.max(r, g, b);
  13982. var min = Math.min(r, g, b);
  13983. var delta = max - min;
  13984. var H;
  13985. var S;
  13986. var V;
  13987. V = max;
  13988. S = 0 === max ? 0 : 1 - min / max;
  13989. if (max === min) {
  13990. H = 0
  13991. } else {
  13992. switch (max) {
  13993. case r:
  13994. H = 60 * ((g - b) / delta);
  13995. if (g < b) {
  13996. H += 360
  13997. }
  13998. break;
  13999. case g:
  14000. H = 60 * ((b - r) / delta) + 120;
  14001. break;
  14002. case b:
  14003. H = 60 * ((r - g) / delta) + 240
  14004. }
  14005. }
  14006. S *= 100;
  14007. V *= 100 / 255;
  14008. return {
  14009. h: Math.round(H),
  14010. s: Math.round(S),
  14011. v: Math.round(V)
  14012. }
  14013. }
  14014. function hsvToRgb(h, s, v) {
  14015. var r;
  14016. var g;
  14017. var b;
  14018. var index = Math.floor(h % 360 / 60);
  14019. var vMin = (100 - s) * v / 100;
  14020. var a = (v - vMin) * (h % 60 / 60);
  14021. var vInc = vMin + a;
  14022. var vDec = v - a;
  14023. switch (index) {
  14024. case 0:
  14025. r = v;
  14026. g = vInc;
  14027. b = vMin;
  14028. break;
  14029. case 1:
  14030. r = vDec;
  14031. g = v;
  14032. b = vMin;
  14033. break;
  14034. case 2:
  14035. r = vMin;
  14036. g = v;
  14037. b = vInc;
  14038. break;
  14039. case 3:
  14040. r = vMin;
  14041. g = vDec;
  14042. b = v;
  14043. break;
  14044. case 4:
  14045. r = vInc;
  14046. g = vMin;
  14047. b = v;
  14048. break;
  14049. case 5:
  14050. r = v;
  14051. g = vMin;
  14052. b = vDec
  14053. }
  14054. return [Math.round(2.55 * r), Math.round(2.55 * g), Math.round(2.55 * b)]
  14055. }
  14056. function calculateHue(r, g, b, delta) {
  14057. var max = Math.max(r, g, b);
  14058. switch (max) {
  14059. case r:
  14060. return (g - b) / delta + (g < b ? 6 : 0);
  14061. case g:
  14062. return (b - r) / delta + 2;
  14063. case b:
  14064. return (r - g) / delta + 4
  14065. }
  14066. }
  14067. function toHslFromRgb(r, g, b) {
  14068. r = convertTo01Bounds(r, 255);
  14069. g = convertTo01Bounds(g, 255);
  14070. b = convertTo01Bounds(b, 255);
  14071. var max = Math.max(r, g, b);
  14072. var min = Math.min(r, g, b);
  14073. var maxMinSum = max + min;
  14074. var h;
  14075. var s;
  14076. var l = maxMinSum / 2;
  14077. if (max === min) {
  14078. h = s = 0
  14079. } else {
  14080. var delta = max - min;
  14081. if (l > .5) {
  14082. s = delta / (2 - maxMinSum)
  14083. } else {
  14084. s = delta / maxMinSum
  14085. }
  14086. h = calculateHue(r, g, b, delta);
  14087. h /= 6
  14088. }
  14089. return {
  14090. h: _round(360 * h),
  14091. s: _round(100 * s),
  14092. l: _round(100 * l)
  14093. }
  14094. }
  14095. function makeColorTint(colorPart, h) {
  14096. var colorTint = h;
  14097. if ("r" === colorPart) {
  14098. colorTint = h + 1 / 3
  14099. }
  14100. if ("b" === colorPart) {
  14101. colorTint = h - 1 / 3
  14102. }
  14103. return colorTint
  14104. }
  14105. function modifyColorTint(colorTint) {
  14106. if (colorTint < 0) {
  14107. colorTint += 1
  14108. }
  14109. if (colorTint > 1) {
  14110. colorTint -= 1
  14111. }
  14112. return colorTint
  14113. }
  14114. function hueToRgb(p, q, colorTint) {
  14115. colorTint = modifyColorTint(colorTint);
  14116. if (colorTint < 1 / 6) {
  14117. return p + 6 * (q - p) * colorTint
  14118. }
  14119. if (colorTint < .5) {
  14120. return q
  14121. }
  14122. if (colorTint < 2 / 3) {
  14123. return p + (q - p) * (2 / 3 - colorTint) * 6
  14124. }
  14125. return p
  14126. }
  14127. function hslToRgb(h, s, l) {
  14128. var r;
  14129. var g;
  14130. var b;
  14131. h = convertTo01Bounds(h, 360);
  14132. s = convertTo01Bounds(s, 100);
  14133. l = convertTo01Bounds(l, 100);
  14134. if (0 === s) {
  14135. r = g = b = l
  14136. } else {
  14137. var q = l < .5 ? l * (1 + s) : l + s - l * s;
  14138. var p = 2 * l - q;
  14139. r = hueToRgb(p, q, makeColorTint("r", h));
  14140. g = hueToRgb(p, q, makeColorTint("g", h));
  14141. b = hueToRgb(p, q, makeColorTint("b", h))
  14142. }
  14143. return [_round(255 * r), _round(255 * g), _round(255 * b)]
  14144. }
  14145. function convertTo01Bounds(n, max) {
  14146. n = Math.min(max, Math.max(0, parseFloat(n)));
  14147. if (Math.abs(n - max) < 1e-6) {
  14148. return 1
  14149. }
  14150. return n % max / parseFloat(max)
  14151. }
  14152. function isIntegerBetweenMinAndMax(number, min, max) {
  14153. min = min || 0;
  14154. max = max || 255;
  14155. if (number % 1 !== 0 || number < min || number > max || "number" !== typeof number || isNaN(number)) {
  14156. return false
  14157. }
  14158. return true
  14159. }
  14160. var _round = Math.round;
  14161. Color.prototype = {
  14162. constructor: Color,
  14163. highlight: function(step) {
  14164. step = step || 10;
  14165. return this.alter(step).toHex()
  14166. },
  14167. darken: function(step) {
  14168. step = step || 10;
  14169. return this.alter(-step).toHex()
  14170. },
  14171. alter: function(step) {
  14172. var result = new Color;
  14173. result.r = normalize(this.r + step);
  14174. result.g = normalize(this.g + step);
  14175. result.b = normalize(this.b + step);
  14176. return result
  14177. },
  14178. blend: function(blendColor, opacity) {
  14179. var other = blendColor instanceof Color ? blendColor : new Color(blendColor);
  14180. var result = new Color;
  14181. result.r = normalize(_round(this.r * (1 - opacity) + other.r * opacity));
  14182. result.g = normalize(_round(this.g * (1 - opacity) + other.g * opacity));
  14183. result.b = normalize(_round(this.b * (1 - opacity) + other.b * opacity));
  14184. return result
  14185. },
  14186. toHex: function() {
  14187. return toHexFromRgb(this.r, this.g, this.b)
  14188. },
  14189. getPureColor: function() {
  14190. var rgb = hsvToRgb(this.hsv.h, 100, 100);
  14191. return new Color("rgb(" + rgb.join(",") + ")")
  14192. },
  14193. isValidHex: function(hex) {
  14194. return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex)
  14195. },
  14196. isValidRGB: function(r, g, b) {
  14197. if (!isIntegerBetweenMinAndMax(r) || !isIntegerBetweenMinAndMax(g) || !isIntegerBetweenMinAndMax(b)) {
  14198. return false
  14199. }
  14200. return true
  14201. },
  14202. isValidAlpha: function(a) {
  14203. if (isNaN(a) || a < 0 || a > 1 || "number" !== typeof a) {
  14204. return false
  14205. }
  14206. return true
  14207. },
  14208. colorIsInvalid: false,
  14209. fromHSL: function(hsl) {
  14210. var color = new Color;
  14211. var rgb = hslToRgb(hsl.h, hsl.s, hsl.l);
  14212. color.r = rgb[0];
  14213. color.g = rgb[1];
  14214. color.b = rgb[2];
  14215. return color
  14216. }
  14217. };
  14218. module.exports = Color
  14219. },
  14220. /*!*****************************************************************!*\
  14221. !*** ./artifacts/transpiled/events/core/emitter_registrator.js ***!
  14222. \*****************************************************************/
  14223. /*! dynamic exports provided */
  14224. /*! all exports used */
  14225. function(module, exports, __webpack_require__) {
  14226. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  14227. var readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48);
  14228. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  14229. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  14230. var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39);
  14231. var Class = __webpack_require__( /*! ../../core/class */ 15);
  14232. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  14233. var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  14234. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  14235. var registerEvent = __webpack_require__( /*! ./event_registrator */ 71);
  14236. var eventUtils = __webpack_require__( /*! ../utils */ 8);
  14237. var pointerEvents = __webpack_require__( /*! ../pointer */ 23);
  14238. var wheelEvent = __webpack_require__( /*! ./wheel */ 124);
  14239. var MANAGER_EVENT = "dxEventManager";
  14240. var EMITTER_DATA = "dxEmitter";
  14241. var EventManager = Class.inherit({
  14242. ctor: function() {
  14243. this._attachHandlers();
  14244. this.reset();
  14245. this._proxiedCancelHandler = this._cancelHandler.bind(this);
  14246. this._proxiedAcceptHandler = this._acceptHandler.bind(this)
  14247. },
  14248. _attachHandlers: function() {
  14249. readyCallbacks.add(function() {
  14250. var document = domAdapter.getDocument();
  14251. eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(pointerEvents.down, MANAGER_EVENT), this._pointerDownHandler.bind(this));
  14252. eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(pointerEvents.move, MANAGER_EVENT), this._pointerMoveHandler.bind(this));
  14253. eventsEngine.subscribeGlobal(document, eventUtils.addNamespace([pointerEvents.up, pointerEvents.cancel].join(" "), MANAGER_EVENT), this._pointerUpHandler.bind(this));
  14254. eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(wheelEvent.name, MANAGER_EVENT), this._mouseWheelHandler.bind(this))
  14255. }.bind(this))
  14256. },
  14257. _eachEmitter: function(callback) {
  14258. var activeEmitters = this._activeEmitters || [];
  14259. var i = 0;
  14260. while (activeEmitters.length > i) {
  14261. var emitter = activeEmitters[i];
  14262. if (false === callback(emitter)) {
  14263. break
  14264. }
  14265. if (activeEmitters[i] === emitter) {
  14266. i++
  14267. }
  14268. }
  14269. },
  14270. _applyToEmitters: function(method, arg) {
  14271. this._eachEmitter(function(emitter) {
  14272. emitter[method].call(emitter, arg)
  14273. })
  14274. },
  14275. reset: function() {
  14276. this._eachEmitter(this._proxiedCancelHandler);
  14277. this._activeEmitters = []
  14278. },
  14279. resetEmitter: function(emitter) {
  14280. this._proxiedCancelHandler(emitter)
  14281. },
  14282. _pointerDownHandler: function(e) {
  14283. if (eventUtils.isMouseEvent(e) && e.which > 1) {
  14284. return
  14285. }
  14286. this._updateEmitters(e)
  14287. },
  14288. _updateEmitters: function(e) {
  14289. if (!this._isSetChanged(e)) {
  14290. return
  14291. }
  14292. this._cleanEmitters(e);
  14293. this._fetchEmitters(e)
  14294. },
  14295. _isSetChanged: function(e) {
  14296. var currentSet = this._closestEmitter(e);
  14297. var previousSet = this._emittersSet || [];
  14298. var setChanged = currentSet.length !== previousSet.length;
  14299. each(currentSet, function(index, emitter) {
  14300. setChanged = setChanged || previousSet[index] !== emitter;
  14301. return !setChanged
  14302. });
  14303. this._emittersSet = currentSet;
  14304. return setChanged
  14305. },
  14306. _closestEmitter: function(e) {
  14307. var that = this;
  14308. var result = [];
  14309. var $element = $(e.target);
  14310. function handleEmitter(_, emitter) {
  14311. if (!!emitter && emitter.validatePointers(e) && emitter.validate(e)) {
  14312. emitter.addCancelCallback(that._proxiedCancelHandler);
  14313. emitter.addAcceptCallback(that._proxiedAcceptHandler);
  14314. result.push(emitter)
  14315. }
  14316. }
  14317. while ($element.length) {
  14318. var emitters = dataUtils.data($element.get(0), EMITTER_DATA) || [];
  14319. each(emitters, handleEmitter);
  14320. $element = $element.parent()
  14321. }
  14322. return result
  14323. },
  14324. _acceptHandler: function(acceptedEmitter, e) {
  14325. var that = this;
  14326. this._eachEmitter(function(emitter) {
  14327. if (emitter !== acceptedEmitter) {
  14328. that._cancelEmitter(emitter, e)
  14329. }
  14330. })
  14331. },
  14332. _cancelHandler: function(canceledEmitter, e) {
  14333. this._cancelEmitter(canceledEmitter, e)
  14334. },
  14335. _cancelEmitter: function(emitter, e) {
  14336. var activeEmitters = this._activeEmitters;
  14337. if (e) {
  14338. emitter.cancel(e)
  14339. } else {
  14340. emitter.reset()
  14341. }
  14342. emitter.removeCancelCallback();
  14343. emitter.removeAcceptCallback();
  14344. var emitterIndex = inArray(emitter, activeEmitters);
  14345. if (emitterIndex > -1) {
  14346. activeEmitters.splice(emitterIndex, 1)
  14347. }
  14348. },
  14349. _cleanEmitters: function(e) {
  14350. this._applyToEmitters("end", e);
  14351. this.reset(e)
  14352. },
  14353. _fetchEmitters: function(e) {
  14354. this._activeEmitters = this._emittersSet.slice();
  14355. this._applyToEmitters("start", e)
  14356. },
  14357. _pointerMoveHandler: function(e) {
  14358. this._applyToEmitters("move", e)
  14359. },
  14360. _pointerUpHandler: function(e) {
  14361. this._updateEmitters(e)
  14362. },
  14363. _mouseWheelHandler: function(e) {
  14364. if (!this._allowInterruptionByMouseWheel()) {
  14365. return
  14366. }
  14367. e.pointers = [null];
  14368. this._pointerDownHandler(e);
  14369. this._adjustWheelEvent(e);
  14370. this._pointerMoveHandler(e);
  14371. e.pointers = [];
  14372. this._pointerUpHandler(e)
  14373. },
  14374. _allowInterruptionByMouseWheel: function() {
  14375. var allowInterruption = true;
  14376. this._eachEmitter(function(emitter) {
  14377. allowInterruption = emitter.allowInterruptionByMouseWheel() && allowInterruption;
  14378. return allowInterruption
  14379. });
  14380. return allowInterruption
  14381. },
  14382. _adjustWheelEvent: function(e) {
  14383. var closestGestureEmitter = null;
  14384. this._eachEmitter(function(emitter) {
  14385. if (!emitter.gesture) {
  14386. return
  14387. }
  14388. var direction = emitter.getDirection(e);
  14389. if ("horizontal" !== direction && !e.shiftKey || "vertical" !== direction && e.shiftKey) {
  14390. closestGestureEmitter = emitter;
  14391. return false
  14392. }
  14393. });
  14394. if (!closestGestureEmitter) {
  14395. return
  14396. }
  14397. var direction = closestGestureEmitter.getDirection(e);
  14398. var verticalGestureDirection = "both" === direction && !e.shiftKey || "vertical" === direction;
  14399. var prop = verticalGestureDirection ? "pageY" : "pageX";
  14400. e[prop] += e.delta
  14401. },
  14402. isActive: function(element) {
  14403. var result = false;
  14404. this._eachEmitter(function(emitter) {
  14405. result = result || emitter.getElement().is(element)
  14406. });
  14407. return result
  14408. }
  14409. });
  14410. var eventManager = new EventManager;
  14411. var EMITTER_SUBSCRIPTION_DATA = "dxEmitterSubscription";
  14412. var registerEmitter = function(emitterConfig) {
  14413. var emitterClass = emitterConfig.emitter;
  14414. var emitterName = emitterConfig.events[0];
  14415. var emitterEvents = emitterConfig.events;
  14416. each(emitterEvents, function(_, eventName) {
  14417. registerEvent(eventName, {
  14418. noBubble: !emitterConfig.bubble,
  14419. setup: function(element) {
  14420. var subscriptions = dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA) || {};
  14421. var emitters = dataUtils.data(element, EMITTER_DATA) || {};
  14422. var emitter = emitters[emitterName] || new emitterClass(element);
  14423. subscriptions[eventName] = true;
  14424. emitters[emitterName] = emitter;
  14425. dataUtils.data(element, EMITTER_DATA, emitters);
  14426. dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA, subscriptions)
  14427. },
  14428. add: function(element, handleObj) {
  14429. var emitters = dataUtils.data(element, EMITTER_DATA);
  14430. var emitter = emitters[emitterName];
  14431. emitter.configure(extend({
  14432. delegateSelector: handleObj.selector
  14433. }, handleObj.data), handleObj.type)
  14434. },
  14435. teardown: function(element) {
  14436. var subscriptions = dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA);
  14437. var emitters = dataUtils.data(element, EMITTER_DATA);
  14438. var emitter = emitters[emitterName];
  14439. delete subscriptions[eventName];
  14440. var disposeEmitter = true;
  14441. each(emitterEvents, function(_, eventName) {
  14442. disposeEmitter = disposeEmitter && !subscriptions[eventName];
  14443. return disposeEmitter
  14444. });
  14445. if (disposeEmitter) {
  14446. if (eventManager.isActive(element)) {
  14447. eventManager.resetEmitter(emitter)
  14448. }
  14449. emitter && emitter.dispose();
  14450. delete emitters[emitterName]
  14451. }
  14452. }
  14453. })
  14454. })
  14455. };
  14456. module.exports = registerEmitter
  14457. },
  14458. /*!******************************************************!*\
  14459. !*** ./artifacts/transpiled/viz/core/base_widget.js ***!
  14460. \******************************************************/
  14461. /*! dynamic exports provided */
  14462. /*! all exports used */
  14463. function(module, exports, __webpack_require__) {
  14464. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  14465. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  14466. var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
  14467. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  14468. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  14469. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  14470. var version = __webpack_require__( /*! ../../core/version */ 157);
  14471. var _windowResizeCallbacks = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 130);
  14472. var _stringFormat = __webpack_require__( /*! ../../core/utils/string */ 44).format;
  14473. var _isObject = __webpack_require__( /*! ../../core/utils/type */ 1).isObject;
  14474. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  14475. var themeManagerModule = __webpack_require__( /*! ../core/base_theme_manager */ 241);
  14476. var _floor = Math.floor;
  14477. var DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67);
  14478. var helpers = __webpack_require__( /*! ./helpers */ 142);
  14479. var _parseScalar = __webpack_require__( /*! ./utils */ 10).parseScalar;
  14480. var errors = __webpack_require__( /*! ./errors_warnings */ 764);
  14481. var _log = errors.log;
  14482. var rendererModule = __webpack_require__( /*! ./renderers/renderer */ 175);
  14483. var _Layout = __webpack_require__( /*! ./layout */ 766);
  14484. var devices = __webpack_require__( /*! ../../core/devices */ 16);
  14485. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  14486. var OPTION_RTL_ENABLED = "rtlEnabled";
  14487. var SIZED_ELEMENT_CLASS = "dx-sized-element";
  14488. var _option = DOMComponent.prototype.option;
  14489. function getTrue() {
  14490. return true
  14491. }
  14492. function getFalse() {
  14493. return false
  14494. }
  14495. function areCanvasesDifferent(canvas1, canvas2) {
  14496. return !(canvas1.width === canvas2.width && canvas1.height === canvas2.height && canvas1.left === canvas2.left && canvas1.top === canvas2.top && canvas1.right === canvas2.right && canvas1.bottom === canvas2.bottom)
  14497. }
  14498. function createResizeHandler(callback) {
  14499. var timeout;
  14500. var handler = function() {
  14501. clearTimeout(timeout);
  14502. timeout = setTimeout(callback, 100)
  14503. };
  14504. handler.dispose = function() {
  14505. clearTimeout(timeout);
  14506. return this
  14507. };
  14508. return handler
  14509. }
  14510. function defaultOnIncidentOccurred(e) {
  14511. if (!e.component.hasEvent("incidentOccurred")) {
  14512. _log.apply(null, [e.target.id].concat(e.target.args || []))
  14513. }
  14514. }
  14515. var createIncidentOccurred = function(widgetName, eventTrigger) {
  14516. return function(id, args) {
  14517. eventTrigger("incidentOccurred", {
  14518. target: {
  14519. id: id,
  14520. type: "E" === id[0] ? "error" : "warning",
  14521. args: args,
  14522. text: _stringFormat.apply(null, [errors.ERROR_MESSAGES[id]].concat(args || [])),
  14523. widget: widgetName,
  14524. version: version
  14525. }
  14526. })
  14527. }
  14528. };
  14529. function pickPositiveValue(values) {
  14530. return values.reduce(function(result, value) {
  14531. return value > 0 && !result ? value : result
  14532. }, 0)
  14533. }
  14534. var getEmptyComponent = function() {
  14535. var emptyComponentConfig = {};
  14536. emptyComponentConfig.ctor = function(element, options) {
  14537. this.callBase(element, options);
  14538. var sizedElement = domAdapter.createElement("div");
  14539. var width = options && typeUtils.isNumeric(options.width) ? options.width + "px" : "100%";
  14540. var height = options && typeUtils.isNumeric(options.height) ? options.height + "px" : this._getDefaultSize().height + "px";
  14541. domAdapter.setStyle(sizedElement, "width", width);
  14542. domAdapter.setStyle(sizedElement, "height", height);
  14543. domAdapter.setClass(sizedElement, SIZED_ELEMENT_CLASS);
  14544. domAdapter.insertElement(element, sizedElement)
  14545. };
  14546. var EmptyComponent = DOMComponent.inherit(emptyComponentConfig);
  14547. var originalInherit = EmptyComponent.inherit;
  14548. EmptyComponent.inherit = function(config) {
  14549. for (var field in config) {
  14550. if (typeUtils.isFunction(config[field]) && "_" !== field.substr(0, 1) || "_dispose" === field || "_optionChanged" === field) {
  14551. config[field] = noop
  14552. }
  14553. }
  14554. return originalInherit.call(this, config)
  14555. };
  14556. return EmptyComponent
  14557. };
  14558. var isServerSide = !windowUtils.hasWindow();
  14559. function sizeIsValid(value) {
  14560. return typeUtils.isDefined(value) && value > 0
  14561. }
  14562. module.exports = isServerSide ? getEmptyComponent() : DOMComponent.inherit({
  14563. _eventsMap: {
  14564. onIncidentOccurred: {
  14565. name: "incidentOccurred"
  14566. },
  14567. onDrawn: {
  14568. name: "drawn"
  14569. }
  14570. },
  14571. _getDefaultOptions: function() {
  14572. return extend(this.callBase(), {
  14573. onIncidentOccurred: defaultOnIncidentOccurred
  14574. })
  14575. },
  14576. _useLinks: true,
  14577. _init: function() {
  14578. var that = this;
  14579. that._$element.children("." + SIZED_ELEMENT_CLASS).remove();
  14580. that.callBase.apply(that, arguments);
  14581. that._changesLocker = 0;
  14582. that._optionChangedLocker = 0;
  14583. that._changes = helpers.changes();
  14584. that._suspendChanges();
  14585. that._themeManager = that._createThemeManager();
  14586. that._themeManager.setCallback(function() {
  14587. that._requestChange(that._themeDependentChanges)
  14588. });
  14589. that._renderElementAttributes();
  14590. that._initRenderer();
  14591. var linkTarget = that._useLinks && that._renderer.root;
  14592. linkTarget && linkTarget.enableLinks().virtualLink("core").virtualLink("peripheral");
  14593. that._renderVisibilityChange();
  14594. that._attachVisibilityChangeHandlers();
  14595. that._toggleParentsScrollSubscription(this._isVisible());
  14596. that._initEventTrigger();
  14597. that._incidentOccurred = createIncidentOccurred(that.NAME, that._eventTrigger);
  14598. that._layout = new _Layout;
  14599. linkTarget && linkTarget.linkAfter("core");
  14600. that._initPlugins();
  14601. that._initCore();
  14602. linkTarget && linkTarget.linkAfter();
  14603. that._change(that._initialChanges)
  14604. },
  14605. _createThemeManager: function() {
  14606. return new themeManagerModule.BaseThemeManager(this._getThemeManagerOptions())
  14607. },
  14608. _getThemeManagerOptions: function() {
  14609. return {
  14610. themeSection: this._themeSection,
  14611. fontFields: this._fontFields
  14612. }
  14613. },
  14614. _initialChanges: ["LAYOUT", "RESIZE_HANDLER", "THEME", "DISABLED"],
  14615. _initPlugins: function() {
  14616. var that = this;
  14617. each(that._plugins, function(_, plugin) {
  14618. plugin.init.call(that)
  14619. })
  14620. },
  14621. _disposePlugins: function() {
  14622. var that = this;
  14623. each(that._plugins.slice().reverse(), function(_, plugin) {
  14624. plugin.dispose.call(that)
  14625. })
  14626. },
  14627. _change: function(codes) {
  14628. this._changes.add(codes)
  14629. },
  14630. _suspendChanges: function() {
  14631. ++this._changesLocker
  14632. },
  14633. _resumeChanges: function() {
  14634. var that = this;
  14635. if (0 === --that._changesLocker && that._changes.count() > 0 && !that._applyingChanges) {
  14636. that._renderer.lock();
  14637. that._applyingChanges = true;
  14638. that._applyChanges();
  14639. that._changes.reset();
  14640. that._applyingChanges = false;
  14641. that._renderer.unlock();
  14642. if (that._optionsQueue) {
  14643. that._applyQueuedOptions()
  14644. }
  14645. that._optionChangedLocker++;
  14646. that._notify();
  14647. that._optionChangedLocker--
  14648. }
  14649. },
  14650. _applyQueuedOptions: function() {
  14651. var that = this;
  14652. var queue = that._optionsQueue;
  14653. that._optionsQueue = null;
  14654. that.beginUpdate();
  14655. each(queue, function(_, action) {
  14656. action()
  14657. });
  14658. that.endUpdate()
  14659. },
  14660. _requestChange: function(codes) {
  14661. this._suspendChanges();
  14662. this._change(codes);
  14663. this._resumeChanges()
  14664. },
  14665. _applyChanges: function() {
  14666. var that = this;
  14667. var changes = that._changes;
  14668. var order = that._totalChangesOrder;
  14669. var i;
  14670. var ii = order.length;
  14671. for (i = 0; i < ii; ++i) {
  14672. if (changes.has(order[i])) {
  14673. that["_change_" + order[i]]()
  14674. }
  14675. }
  14676. },
  14677. _optionChangesOrder: ["EVENTS", "THEME", "RENDERER", "RESIZE_HANDLER"],
  14678. _layoutChangesOrder: ["ELEMENT_ATTR", "CONTAINER_SIZE", "LAYOUT"],
  14679. _customChangesOrder: ["DISABLED"],
  14680. _change_EVENTS: function() {
  14681. this._eventTrigger.applyChanges()
  14682. },
  14683. _change_THEME: function() {
  14684. this._setThemeAndRtl()
  14685. },
  14686. _change_RENDERER: function() {
  14687. this._setRendererOptions()
  14688. },
  14689. _change_RESIZE_HANDLER: function() {
  14690. this._setupResizeHandler()
  14691. },
  14692. _change_ELEMENT_ATTR: function() {
  14693. this._renderElementAttributes();
  14694. this._change(["CONTAINER_SIZE"])
  14695. },
  14696. _change_CONTAINER_SIZE: function() {
  14697. this._updateSize()
  14698. },
  14699. _change_LAYOUT: function() {
  14700. this._setContentSize()
  14701. },
  14702. _change_DISABLED: function() {
  14703. var renderer = this._renderer;
  14704. var root = renderer.root;
  14705. if (this.option("disabled")) {
  14706. this._initDisabledState = root.attr("pointer-events");
  14707. root.attr({
  14708. "pointer-events": "none",
  14709. filter: renderer.getGrayScaleFilter().id
  14710. })
  14711. } else {
  14712. if ("none" === root.attr("pointer-events")) {
  14713. root.attr({
  14714. "pointer-events": typeUtils.isDefined(this._initDisabledState) ? this._initDisabledState : null,
  14715. filter: null
  14716. })
  14717. }
  14718. }
  14719. },
  14720. _themeDependentChanges: ["RENDERER"],
  14721. _initRenderer: function() {
  14722. var that = this;
  14723. that._canvas = that._calculateCanvas();
  14724. that._renderer = new rendererModule.Renderer({
  14725. cssClass: that._rootClassPrefix + " " + that._rootClass,
  14726. pathModified: that.option("pathModified"),
  14727. container: that._$element[0]
  14728. });
  14729. that._renderer.resize(that._canvas.width, that._canvas.height)
  14730. },
  14731. _disposeRenderer: function() {
  14732. this._useLinks && this._renderer.root.checkLinks();
  14733. this._renderer.dispose()
  14734. },
  14735. _getAnimationOptions: noop,
  14736. render: function() {
  14737. this._requestChange(["CONTAINER_SIZE"]);
  14738. var visible = this._isVisible();
  14739. this._toggleParentsScrollSubscription(visible);
  14740. !visible && this._stopCurrentHandling()
  14741. },
  14742. _toggleParentsScrollSubscription: function(subscribe) {
  14743. var $parents = $(this._renderer.root.element).parents();
  14744. var scrollEvents = "scroll.viz_widgets";
  14745. if ("generic" === devices.real().platform) {
  14746. $parents = $parents.add(windowUtils.getWindow())
  14747. }
  14748. this._proxiedTargetParentsScrollHandler = this._proxiedTargetParentsScrollHandler || function() {
  14749. this._stopCurrentHandling()
  14750. }.bind(this);
  14751. eventsEngine.off($().add(this._$prevRootParents), scrollEvents, this._proxiedTargetParentsScrollHandler);
  14752. if (subscribe) {
  14753. eventsEngine.on($parents, scrollEvents, this._proxiedTargetParentsScrollHandler);
  14754. this._$prevRootParents = $parents
  14755. }
  14756. },
  14757. _stopCurrentHandling: noop,
  14758. _dispose: function() {
  14759. var that = this;
  14760. that.callBase.apply(that, arguments);
  14761. that._toggleParentsScrollSubscription(false);
  14762. that._removeResizeHandler();
  14763. that._layout.dispose();
  14764. that._eventTrigger.dispose();
  14765. that._disposeCore();
  14766. that._disposePlugins();
  14767. that._disposeRenderer();
  14768. that._themeManager.dispose();
  14769. that._themeManager = that._renderer = that._eventTrigger = null
  14770. },
  14771. _initEventTrigger: function() {
  14772. var that = this;
  14773. that._eventTrigger = createEventTrigger(that._eventsMap, function(name) {
  14774. return that._createActionByOption(name)
  14775. })
  14776. },
  14777. _calculateCanvas: function() {
  14778. var that = this;
  14779. var size = that.option("size") || {};
  14780. var margin = that.option("margin") || {};
  14781. var defaultCanvas = that._getDefaultSize() || {};
  14782. var elementWidth = !sizeIsValid(size.width) && windowUtils.hasWindow() ? that._$element.width() : 0;
  14783. var elementHeight = !sizeIsValid(size.height) && windowUtils.hasWindow() ? that._$element.height() : 0;
  14784. var canvas = {
  14785. width: size.width <= 0 ? 0 : _floor(pickPositiveValue([size.width, elementWidth, defaultCanvas.width])),
  14786. height: size.height <= 0 ? 0 : _floor(pickPositiveValue([size.height, elementHeight, defaultCanvas.height])),
  14787. left: pickPositiveValue([margin.left, defaultCanvas.left]),
  14788. top: pickPositiveValue([margin.top, defaultCanvas.top]),
  14789. right: pickPositiveValue([margin.right, defaultCanvas.right]),
  14790. bottom: pickPositiveValue([margin.bottom, defaultCanvas.bottom])
  14791. };
  14792. if (canvas.width - canvas.left - canvas.right <= 0 || canvas.height - canvas.top - canvas.bottom <= 0) {
  14793. canvas = {
  14794. width: 0,
  14795. height: 0
  14796. }
  14797. }
  14798. return canvas
  14799. },
  14800. _updateSize: function() {
  14801. var that = this;
  14802. var canvas = that._calculateCanvas();
  14803. that._renderer.fixPlacement();
  14804. if (areCanvasesDifferent(that._canvas, canvas) || that.__forceRender) {
  14805. that._canvas = canvas;
  14806. that._recreateSizeDependentObjects(true);
  14807. that._renderer.resize(canvas.width, canvas.height);
  14808. that._change(["LAYOUT"])
  14809. }
  14810. },
  14811. _recreateSizeDependentObjects: noop,
  14812. _getMinSize: function() {
  14813. return [0, 0]
  14814. },
  14815. _getAlignmentRect: noop,
  14816. _setContentSize: function() {
  14817. var canvas = this._canvas;
  14818. var layout = this._layout;
  14819. var rect = canvas.width > 0 && canvas.height > 0 ? [canvas.left, canvas.top, canvas.width - canvas.right, canvas.height - canvas.bottom] : [0, 0, 0, 0];
  14820. rect = layout.forward(rect, this._getMinSize());
  14821. var nextRect = this._applySize(rect) || rect;
  14822. layout.backward(nextRect, this._getAlignmentRect() || nextRect)
  14823. },
  14824. DEBUG_getCanvas: function() {
  14825. return this._canvas
  14826. },
  14827. DEBUG_getEventTrigger: function() {
  14828. return this._eventTrigger
  14829. },
  14830. _getOption: function(name, isScalar) {
  14831. var theme = this._themeManager.theme(name);
  14832. var option = this.option(name);
  14833. return isScalar ? void 0 !== option ? option : theme : extend(true, {}, theme, option)
  14834. },
  14835. _setupResizeHandler: function() {
  14836. var that = this;
  14837. var redrawOnResize = _parseScalar(this._getOption("redrawOnResize", true), true);
  14838. if (that._resizeHandler) {
  14839. that._removeResizeHandler()
  14840. }
  14841. that._resizeHandler = createResizeHandler(function() {
  14842. if (redrawOnResize) {
  14843. that._requestChange(["CONTAINER_SIZE"])
  14844. } else {
  14845. that._renderer.fixPlacement()
  14846. }
  14847. });
  14848. _windowResizeCallbacks.add(that._resizeHandler)
  14849. },
  14850. _removeResizeHandler: function() {
  14851. if (this._resizeHandler) {
  14852. _windowResizeCallbacks.remove(this._resizeHandler);
  14853. this._resizeHandler.dispose();
  14854. this._resizeHandler = null
  14855. }
  14856. },
  14857. _onBeginUpdate: noop,
  14858. beginUpdate: function() {
  14859. var that = this;
  14860. if (that._initialized && 0 === that._updateLockCount) {
  14861. that._onBeginUpdate();
  14862. that._suspendChanges()
  14863. }
  14864. that.callBase.apply(that, arguments);
  14865. return that
  14866. },
  14867. endUpdate: function() {
  14868. var that = this;
  14869. that.callBase.apply(that, arguments);
  14870. if (0 === that._updateLockCount) {
  14871. that._resumeChanges()
  14872. }
  14873. return that
  14874. },
  14875. option: function(name) {
  14876. var that = this;
  14877. if (that._initialized && that._applyingChanges && (arguments.length > 1 || _isObject(name))) {
  14878. that._optionsQueue = that._optionsQueue || [];
  14879. that._optionsQueue.push(that._getActionForUpdating(arguments))
  14880. } else {
  14881. return _option.apply(that, arguments)
  14882. }
  14883. },
  14884. _getActionForUpdating: function(args) {
  14885. var that = this;
  14886. return that._deprecatedOptionsSuppressed ? function() {
  14887. that._suppressDeprecatedWarnings();
  14888. _option.apply(that, args);
  14889. that._resumeDeprecatedWarnings()
  14890. } : function() {
  14891. _option.apply(that, args)
  14892. }
  14893. },
  14894. _clean: noop,
  14895. _render: noop,
  14896. _optionChanged: function(arg) {
  14897. var that = this;
  14898. if (that._optionChangedLocker) {
  14899. return
  14900. }
  14901. var partialChanges = that.getPartialChangeOptionsName(arg);
  14902. var changes = [];
  14903. if (partialChanges.length > 0) {
  14904. partialChanges.forEach(function(pc) {
  14905. return changes.push(that._partialOptionChangesMap[pc])
  14906. })
  14907. } else {
  14908. changes.push(that._optionChangesMap[arg.name])
  14909. }
  14910. changes = changes.filter(function(c) {
  14911. return !!c
  14912. });
  14913. if (that._eventTrigger.change(arg.name)) {
  14914. that._change(["EVENTS"])
  14915. } else {
  14916. if (changes.length > 0) {
  14917. that._change(changes)
  14918. } else {
  14919. that.callBase.apply(that, arguments)
  14920. }
  14921. }
  14922. },
  14923. _notify: noop,
  14924. _optionChangesMap: {
  14925. size: "CONTAINER_SIZE",
  14926. margin: "CONTAINER_SIZE",
  14927. redrawOnResize: "RESIZE_HANDLER",
  14928. theme: "THEME",
  14929. rtlEnabled: "THEME",
  14930. encodeHtml: "THEME",
  14931. elementAttr: "ELEMENT_ATTR",
  14932. disabled: "DISABLED"
  14933. },
  14934. _partialOptionChangesMap: {},
  14935. _partialOptionChangesPath: {},
  14936. getPartialChangeOptionsName: function(changedOption) {
  14937. var that = this;
  14938. var fullName = changedOption.fullName;
  14939. var sections = fullName.split(/[.]/);
  14940. var name = changedOption.name;
  14941. var value = changedOption.value;
  14942. var options = this._partialOptionChangesPath[name];
  14943. var partialChangeOptionsName = [];
  14944. if (options) {
  14945. if (true === options) {
  14946. partialChangeOptionsName.push(name)
  14947. } else {
  14948. options.forEach(function(op) {
  14949. fullName.indexOf(op) >= 0 && partialChangeOptionsName.push(op)
  14950. });
  14951. if (1 === sections.length) {
  14952. if ("object" === typeUtils.type(value)) {
  14953. that._addOptionsNameForPartialUpdate(value, options, partialChangeOptionsName)
  14954. } else {
  14955. if ("array" === typeUtils.type(value)) {
  14956. if (value.length > 0 && value.every(function(item) {
  14957. return that._checkOptionsForPartialUpdate(item, options)
  14958. })) {
  14959. value.forEach(function(item) {
  14960. return that._addOptionsNameForPartialUpdate(item, options, partialChangeOptionsName)
  14961. })
  14962. }
  14963. }
  14964. }
  14965. }
  14966. }
  14967. }
  14968. return partialChangeOptionsName.filter(function(value, index, self) {
  14969. return self.indexOf(value) === index
  14970. })
  14971. },
  14972. _checkOptionsForPartialUpdate: function(optionObject, options) {
  14973. return !Object.keys(optionObject).some(function(key) {
  14974. return options.indexOf(key) === -1
  14975. })
  14976. },
  14977. _addOptionsNameForPartialUpdate: function(optionObject, options, partialChangeOptionsName) {
  14978. var optionKeys = Object.keys(optionObject);
  14979. if (this._checkOptionsForPartialUpdate(optionObject, options)) {
  14980. optionKeys.forEach(function(key) {
  14981. return options.indexOf(key) > -1 && partialChangeOptionsName.push(key)
  14982. })
  14983. }
  14984. },
  14985. _visibilityChanged: function() {
  14986. this.render()
  14987. },
  14988. _setThemeAndRtl: function() {
  14989. this._themeManager.setTheme(this.option("theme"), this.option(OPTION_RTL_ENABLED))
  14990. },
  14991. _getRendererOptions: function() {
  14992. return {
  14993. rtl: this.option(OPTION_RTL_ENABLED),
  14994. encodeHtml: this.option("encodeHtml"),
  14995. animation: this._getAnimationOptions()
  14996. }
  14997. },
  14998. _setRendererOptions: function() {
  14999. this._renderer.setOptions(this._getRendererOptions())
  15000. },
  15001. svg: function() {
  15002. return this._renderer.svg()
  15003. },
  15004. getSize: function() {
  15005. var canvas = this._canvas || {};
  15006. return {
  15007. width: canvas.width,
  15008. height: canvas.height
  15009. }
  15010. },
  15011. isReady: getFalse,
  15012. _dataIsReady: getTrue,
  15013. _resetIsReady: function() {
  15014. this.isReady = getFalse
  15015. },
  15016. _drawn: function() {
  15017. var that = this;
  15018. that.isReady = getFalse;
  15019. if (that._dataIsReady()) {
  15020. that._renderer.onEndAnimation(function() {
  15021. that.isReady = getTrue
  15022. })
  15023. }
  15024. that._eventTrigger("drawn", {})
  15025. }
  15026. });
  15027. helpers.replaceInherit(module.exports);
  15028. function createEventTrigger(eventsMap, callbackGetter) {
  15029. var triggers = {};
  15030. each(eventsMap, function(name, info) {
  15031. if (info.name) {
  15032. createEvent(name)
  15033. }
  15034. });
  15035. var changes;
  15036. triggerEvent.change = function(name) {
  15037. var eventInfo = eventsMap[name];
  15038. if (eventInfo) {
  15039. (changes = changes || {})[name] = eventInfo
  15040. }
  15041. return !!eventInfo
  15042. };
  15043. triggerEvent.applyChanges = function() {
  15044. if (changes) {
  15045. each(changes, function(name, eventInfo) {
  15046. createEvent(eventInfo.newName || name)
  15047. });
  15048. changes = null
  15049. }
  15050. };
  15051. triggerEvent.dispose = function() {
  15052. eventsMap = callbackGetter = triggers = null
  15053. };
  15054. return triggerEvent;
  15055. function createEvent(name) {
  15056. var eventInfo = eventsMap[name];
  15057. triggers[eventInfo.name] = callbackGetter(name)
  15058. }
  15059. function triggerEvent(name, arg, complete) {
  15060. triggers[name](arg);
  15061. complete && complete()
  15062. }
  15063. }
  15064. module.exports.DEBUG_createEventTrigger = createEventTrigger;
  15065. module.exports.DEBUG_createIncidentOccurred = createIncidentOccurred;
  15066. module.exports.DEBUG_stub_createIncidentOccurred = function(stub) {
  15067. createIncidentOccurred = stub
  15068. };
  15069. module.exports.DEBUG_restore_createIncidentOccurred = function() {
  15070. createIncidentOccurred = module.exports.DEBUG_createIncidentOccurred
  15071. };
  15072. module.exports.DEBUG_createResizeHandler = createResizeHandler
  15073. },
  15074. /*!*****************************************************!*\
  15075. !*** ./artifacts/transpiled/core/utils/position.js ***!
  15076. \*****************************************************/
  15077. /*! dynamic exports provided */
  15078. /*! all exports used */
  15079. function(module, exports, __webpack_require__) {
  15080. var _config = __webpack_require__( /*! ../config */ 31);
  15081. var _config2 = _interopRequireDefault(_config);
  15082. function _interopRequireDefault(obj) {
  15083. return obj && obj.__esModule ? obj : {
  15084. "default": obj
  15085. }
  15086. }
  15087. var getDefaultAlignment = function(isRtlEnabled) {
  15088. var rtlEnabled = null !== isRtlEnabled && void 0 !== isRtlEnabled ? isRtlEnabled : (0, _config2.default)().rtlEnabled;
  15089. return rtlEnabled ? "right" : "left"
  15090. };
  15091. exports.getDefaultAlignment = getDefaultAlignment
  15092. },
  15093. /*!*****************************************************!*\
  15094. !*** ./artifacts/transpiled/data/abstract_store.js ***!
  15095. \*****************************************************/
  15096. /*! dynamic exports provided */
  15097. /*! all exports used */
  15098. function(module, exports, __webpack_require__) {
  15099. var Class = __webpack_require__( /*! ../core/class */ 15);
  15100. var abstract = Class.abstract;
  15101. var EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 82);
  15102. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  15103. var errorsModule = __webpack_require__( /*! ./errors */ 36);
  15104. var dataUtils = __webpack_require__( /*! ./utils */ 41);
  15105. var compileGetter = __webpack_require__( /*! ../core/utils/data */ 20).compileGetter;
  15106. var storeHelper = __webpack_require__( /*! ./store_helper */ 81);
  15107. var queryByOptions = storeHelper.queryByOptions;
  15108. var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred;
  15109. var noop = __webpack_require__( /*! ../core/utils/common */ 4).noop;
  15110. var storeImpl = {};
  15111. var Store = Class.inherit({
  15112. ctor: function(options) {
  15113. var that = this;
  15114. options = options || {};
  15115. each(["onLoaded", "onLoading", "onInserted", "onInserting", "onUpdated", "onUpdating", "onPush", "onRemoved", "onRemoving", "onModified", "onModifying"], function(_, optionName) {
  15116. if (optionName in options) {
  15117. that.on(optionName.slice(2).toLowerCase(), options[optionName])
  15118. }
  15119. });
  15120. this._key = options.key;
  15121. this._errorHandler = options.errorHandler;
  15122. this._useDefaultSearch = true
  15123. },
  15124. _customLoadOptions: function() {
  15125. return null
  15126. },
  15127. key: function() {
  15128. return this._key
  15129. },
  15130. keyOf: function(obj) {
  15131. if (!this._keyGetter) {
  15132. this._keyGetter = compileGetter(this.key())
  15133. }
  15134. return this._keyGetter(obj)
  15135. },
  15136. _requireKey: function() {
  15137. if (!this.key()) {
  15138. throw errorsModule.errors.Error("E4005")
  15139. }
  15140. },
  15141. load: function(options) {
  15142. var that = this;
  15143. options = options || {};
  15144. this.fireEvent("loading", [options]);
  15145. return this._withLock(this._loadImpl(options)).done(function(result) {
  15146. that.fireEvent("loaded", [result, options])
  15147. })
  15148. },
  15149. _loadImpl: function(options) {
  15150. return queryByOptions(this.createQuery(options), options).enumerate()
  15151. },
  15152. _withLock: function(task) {
  15153. var result = new Deferred;
  15154. task.done(function() {
  15155. var that = this;
  15156. var args = arguments;
  15157. dataUtils.processRequestResultLock.promise().done(function() {
  15158. result.resolveWith(that, args)
  15159. })
  15160. }).fail(function() {
  15161. result.rejectWith(this, arguments)
  15162. });
  15163. return result
  15164. },
  15165. createQuery: abstract,
  15166. totalCount: function(options) {
  15167. return this._totalCountImpl(options)
  15168. },
  15169. _totalCountImpl: function(options) {
  15170. return queryByOptions(this.createQuery(options), options, true).count()
  15171. },
  15172. byKey: function(key, extraOptions) {
  15173. return this._addFailHandlers(this._withLock(this._byKeyImpl(key, extraOptions)))
  15174. },
  15175. _byKeyImpl: abstract,
  15176. insert: function(values) {
  15177. var that = this;
  15178. that.fireEvent("modifying");
  15179. that.fireEvent("inserting", [values]);
  15180. return that._addFailHandlers(that._insertImpl(values).done(function(callbackValues, callbackKey) {
  15181. that.fireEvent("inserted", [callbackValues, callbackKey]);
  15182. that.fireEvent("modified")
  15183. }))
  15184. },
  15185. _insertImpl: abstract,
  15186. update: function(key, values) {
  15187. var that = this;
  15188. that.fireEvent("modifying");
  15189. that.fireEvent("updating", [key, values]);
  15190. return that._addFailHandlers(that._updateImpl(key, values).done(function() {
  15191. that.fireEvent("updated", [key, values]);
  15192. that.fireEvent("modified")
  15193. }))
  15194. },
  15195. _updateImpl: abstract,
  15196. push: function(changes) {
  15197. this._pushImpl(changes);
  15198. this.fireEvent("push", [changes])
  15199. },
  15200. _pushImpl: noop,
  15201. remove: function(key) {
  15202. var that = this;
  15203. that.fireEvent("modifying");
  15204. that.fireEvent("removing", [key]);
  15205. return that._addFailHandlers(that._removeImpl(key).done(function(callbackKey) {
  15206. that.fireEvent("removed", [callbackKey]);
  15207. that.fireEvent("modified")
  15208. }))
  15209. },
  15210. _removeImpl: abstract,
  15211. _addFailHandlers: function(deferred) {
  15212. return deferred.fail(this._errorHandler).fail(errorsModule._errorHandler)
  15213. }
  15214. }).include(EventsMixin);
  15215. Store.create = function(alias, options) {
  15216. if (!(alias in storeImpl)) {
  15217. throw errorsModule.errors.Error("E4020", alias)
  15218. }
  15219. return new storeImpl[alias](options)
  15220. };
  15221. Store.registerClass = function(type, alias) {
  15222. if (alias) {
  15223. storeImpl[alias] = type
  15224. }
  15225. return type
  15226. };
  15227. Store.inherit = function(inheritor) {
  15228. return function(members, alias) {
  15229. var type = inheritor.apply(this, [members]);
  15230. Store.registerClass(type, alias);
  15231. return type
  15232. }
  15233. }(Store.inherit);
  15234. module.exports = Store
  15235. },
  15236. /*!******************************************************!*\
  15237. !*** ./artifacts/transpiled/ui/validation_engine.js ***!
  15238. \******************************************************/
  15239. /*! dynamic exports provided */
  15240. /*! all exports used */
  15241. function(module, exports, __webpack_require__) {
  15242. var Class = __webpack_require__( /*! ../core/class */ 15);
  15243. var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
  15244. var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
  15245. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  15246. var EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 82);
  15247. var errors = __webpack_require__( /*! ../core/errors */ 21);
  15248. var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4);
  15249. var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
  15250. var numberLocalization = __webpack_require__( /*! ../localization/number */ 51);
  15251. var messageLocalization = __webpack_require__( /*! ../localization/message */ 13);
  15252. var BaseRuleValidator = Class.inherit({
  15253. NAME: "base",
  15254. defaultMessage: function(value) {
  15255. return messageLocalization.getFormatter("validation-" + this.NAME)(value)
  15256. },
  15257. defaultFormattedMessage: function(value) {
  15258. return messageLocalization.getFormatter("validation-" + this.NAME + "-formatted")(value)
  15259. },
  15260. _isValueEmpty: function(value) {
  15261. return !rulesValidators.required.validate(value, {})
  15262. },
  15263. validate: function(value, rule) {
  15264. var valueArray = Array.isArray(value) ? value : [value];
  15265. var result = true;
  15266. if (valueArray.length) {
  15267. valueArray.every(function(itemValue) {
  15268. result = this._validate(itemValue, rule);
  15269. return result
  15270. }, this)
  15271. } else {
  15272. result = this._validate(null, rule)
  15273. }
  15274. return result
  15275. }
  15276. });
  15277. var RequiredRuleValidator = BaseRuleValidator.inherit({
  15278. NAME: "required",
  15279. _validate: function(value, rule) {
  15280. if (!typeUtils.isDefined(value)) {
  15281. return false
  15282. }
  15283. if (false === value) {
  15284. return false
  15285. }
  15286. value = String(value);
  15287. if (rule.trim || !typeUtils.isDefined(rule.trim)) {
  15288. value = value.trim()
  15289. }
  15290. return "" !== value
  15291. }
  15292. });
  15293. var NumericRuleValidator = BaseRuleValidator.inherit({
  15294. NAME: "numeric",
  15295. _validate: function(value, rule) {
  15296. if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
  15297. return true
  15298. }
  15299. if (rule.useCultureSettings && typeUtils.isString(value)) {
  15300. return !isNaN(numberLocalization.parse(value))
  15301. } else {
  15302. return typeUtils.isNumeric(value)
  15303. }
  15304. }
  15305. });
  15306. var RangeRuleValidator = BaseRuleValidator.inherit({
  15307. NAME: "range",
  15308. _validate: function(value, rule) {
  15309. if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
  15310. return true
  15311. }
  15312. var validNumber = rulesValidators.numeric.validate(value, rule);
  15313. var validValue = typeUtils.isDefined(value) && "" !== value;
  15314. var number = validNumber ? parseFloat(value) : validValue && value.valueOf();
  15315. var min = rule.min;
  15316. var max = rule.max;
  15317. if (!(validNumber || typeUtils.isDate(value)) && !validValue) {
  15318. return false
  15319. }
  15320. if (typeUtils.isDefined(min)) {
  15321. if (typeUtils.isDefined(max)) {
  15322. return number >= min && number <= max
  15323. }
  15324. return number >= min
  15325. } else {
  15326. if (typeUtils.isDefined(max)) {
  15327. return number <= max
  15328. } else {
  15329. throw errors.Error("E0101")
  15330. }
  15331. }
  15332. }
  15333. });
  15334. var StringLengthRuleValidator = BaseRuleValidator.inherit({
  15335. NAME: "stringLength",
  15336. _validate: function(value, rule) {
  15337. value = typeUtils.isDefined(value) ? String(value) : "";
  15338. if (rule.trim || !typeUtils.isDefined(rule.trim)) {
  15339. value = value.trim()
  15340. }
  15341. if (rule.ignoreEmptyValue && this._isValueEmpty(value)) {
  15342. return true
  15343. }
  15344. return rulesValidators.range.validate(value.length, extend({}, rule))
  15345. }
  15346. });
  15347. var CustomRuleValidator = BaseRuleValidator.inherit({
  15348. NAME: "custom",
  15349. validate: function(value, rule) {
  15350. if (rule.ignoreEmptyValue && this._isValueEmpty(value)) {
  15351. return true
  15352. }
  15353. var validator = rule.validator;
  15354. var dataGetter = validator && typeUtils.isFunction(validator.option) && validator.option("dataGetter");
  15355. var data = typeUtils.isFunction(dataGetter) && dataGetter();
  15356. var params = {
  15357. value: value,
  15358. validator: validator,
  15359. rule: rule
  15360. };
  15361. if (data) {
  15362. params.data = data
  15363. }
  15364. return rule.validationCallback(params)
  15365. }
  15366. });
  15367. var CompareRuleValidator = BaseRuleValidator.inherit({
  15368. NAME: "compare",
  15369. _validate: function(value, rule) {
  15370. if (!rule.comparisonTarget) {
  15371. throw errors.Error("E0102")
  15372. }
  15373. if (rule.ignoreEmptyValue && this._isValueEmpty(value)) {
  15374. return true
  15375. }
  15376. extend(rule, {
  15377. reevaluate: true
  15378. });
  15379. var otherValue = rule.comparisonTarget();
  15380. var type = rule.comparisonType || "==";
  15381. switch (type) {
  15382. case "==":
  15383. return value == otherValue;
  15384. case "!=":
  15385. return value != otherValue;
  15386. case "===":
  15387. return value === otherValue;
  15388. case "!==":
  15389. return value !== otherValue;
  15390. case ">":
  15391. return value > otherValue;
  15392. case ">=":
  15393. return value >= otherValue;
  15394. case "<":
  15395. return value < otherValue;
  15396. case "<=":
  15397. return value <= otherValue
  15398. }
  15399. }
  15400. });
  15401. var PatternRuleValidator = BaseRuleValidator.inherit({
  15402. NAME: "pattern",
  15403. _validate: function(value, rule) {
  15404. if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
  15405. return true
  15406. }
  15407. var pattern = rule.pattern;
  15408. if (typeUtils.isString(pattern)) {
  15409. pattern = new RegExp(pattern)
  15410. }
  15411. return pattern.test(value)
  15412. }
  15413. });
  15414. var EmailRuleValidator = BaseRuleValidator.inherit({
  15415. NAME: "email",
  15416. _validate: function(value, rule) {
  15417. if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
  15418. return true
  15419. }
  15420. return rulesValidators.pattern.validate(value, extend({}, rule, {
  15421. pattern: /^[\d\w._-]+@[\d\w._-]+\.[\w]+$/i
  15422. }))
  15423. }
  15424. });
  15425. var rulesValidators = {
  15426. required: new RequiredRuleValidator,
  15427. numeric: new NumericRuleValidator,
  15428. range: new RangeRuleValidator,
  15429. stringLength: new StringLengthRuleValidator,
  15430. custom: new CustomRuleValidator,
  15431. compare: new CompareRuleValidator,
  15432. pattern: new PatternRuleValidator,
  15433. email: new EmailRuleValidator
  15434. };
  15435. var GroupConfig = Class.inherit({
  15436. ctor: function(group) {
  15437. this.group = group;
  15438. this.validators = []
  15439. },
  15440. validate: function() {
  15441. var result = {
  15442. isValid: true,
  15443. brokenRules: [],
  15444. validators: []
  15445. };
  15446. each(this.validators, function(_, validator) {
  15447. var validatorResult = validator.validate();
  15448. result.isValid = result.isValid && validatorResult.isValid;
  15449. if (validatorResult.brokenRule) {
  15450. result.brokenRules.push(validatorResult.brokenRule)
  15451. }
  15452. result.validators.push(validator)
  15453. });
  15454. this.fireEvent("validated", [{
  15455. validators: result.validators,
  15456. brokenRules: result.brokenRules,
  15457. isValid: result.isValid
  15458. }]);
  15459. return result
  15460. },
  15461. reset: function() {
  15462. each(this.validators, function(_, validator) {
  15463. validator.reset()
  15464. })
  15465. }
  15466. }).include(EventsMixin);
  15467. var ValidationEngine = {
  15468. groups: [],
  15469. getGroupConfig: function(group) {
  15470. var result = commonUtils.grep(this.groups, function(config) {
  15471. return config.group === group
  15472. });
  15473. if (result.length) {
  15474. return result[0]
  15475. }
  15476. },
  15477. initGroups: function() {
  15478. this.groups = [];
  15479. this.addGroup()
  15480. },
  15481. addGroup: function(group) {
  15482. var config = this.getGroupConfig(group);
  15483. if (!config) {
  15484. config = new GroupConfig(group);
  15485. this.groups.push(config)
  15486. }
  15487. return config
  15488. },
  15489. removeGroup: function(group) {
  15490. var config = this.getGroupConfig(group);
  15491. var index = inArray(config, this.groups);
  15492. if (index > -1) {
  15493. this.groups.splice(index, 1)
  15494. }
  15495. return config
  15496. },
  15497. _setDefaultMessage: function(rule, validator, name) {
  15498. if (!typeUtils.isDefined(rule.message)) {
  15499. if (validator.defaultFormattedMessage && typeUtils.isDefined(name)) {
  15500. rule.message = validator.defaultFormattedMessage(name)
  15501. } else {
  15502. rule.message = validator.defaultMessage()
  15503. }
  15504. }
  15505. },
  15506. validate: function(value, rules, name) {
  15507. var result = {
  15508. name: name,
  15509. value: value,
  15510. brokenRule: null,
  15511. isValid: true,
  15512. validationRules: rules
  15513. };
  15514. var that = this;
  15515. each(rules || [], function(_, rule) {
  15516. var ruleValidator = rulesValidators[rule.type];
  15517. var ruleValidationResult;
  15518. if (ruleValidator) {
  15519. if (typeUtils.isDefined(rule.isValid) && rule.value === value && !rule.reevaluate) {
  15520. if (!rule.isValid) {
  15521. result.isValid = false;
  15522. result.brokenRule = rule;
  15523. return false
  15524. }
  15525. return true
  15526. }
  15527. rule.value = value;
  15528. ruleValidationResult = ruleValidator.validate(value, rule);
  15529. rule.isValid = ruleValidationResult;
  15530. if (!ruleValidationResult) {
  15531. result.isValid = false;
  15532. that._setDefaultMessage(rule, ruleValidator, name);
  15533. result.brokenRule = rule
  15534. }
  15535. if (!rule.isValid) {
  15536. return false
  15537. }
  15538. } else {
  15539. throw errors.Error("E0100")
  15540. }
  15541. });
  15542. return result
  15543. },
  15544. registerValidatorInGroup: function(group, validator) {
  15545. var groupConfig = ValidationEngine.addGroup(group);
  15546. if (inArray(validator, groupConfig.validators) < 0) {
  15547. groupConfig.validators.push(validator)
  15548. }
  15549. },
  15550. _shouldRemoveGroup: function(group, validatorsInGroup) {
  15551. var isDefaultGroup = void 0 === group;
  15552. var isValidationGroupInstance = group && "dxValidationGroup" === group.NAME;
  15553. return !isDefaultGroup && !isValidationGroupInstance && !validatorsInGroup.length
  15554. },
  15555. removeRegisteredValidator: function(group, validator) {
  15556. var config = ValidationEngine.getGroupConfig(group);
  15557. var validatorsInGroup = config && config.validators;
  15558. var index = inArray(validator, validatorsInGroup);
  15559. if (index > -1) {
  15560. validatorsInGroup.splice(index, 1);
  15561. if (this._shouldRemoveGroup(group, validatorsInGroup)) {
  15562. this.removeGroup(group)
  15563. }
  15564. }
  15565. },
  15566. validateGroup: function(group) {
  15567. var groupConfig = ValidationEngine.getGroupConfig(group);
  15568. if (!groupConfig) {
  15569. throw errors.Error("E0110")
  15570. }
  15571. return groupConfig.validate()
  15572. },
  15573. resetGroup: function(group) {
  15574. var groupConfig = ValidationEngine.getGroupConfig(group);
  15575. if (!groupConfig) {
  15576. throw errors.Error("E0110")
  15577. }
  15578. return groupConfig.reset()
  15579. }
  15580. };
  15581. ValidationEngine.initGroups();
  15582. module.exports = ValidationEngine
  15583. }, , , , , ,
  15584. /*!************************************************!*\
  15585. !*** ./artifacts/transpiled/viz/core/title.js ***!
  15586. \************************************************/
  15587. /*! dynamic exports provided */
  15588. /*! all exports used */
  15589. function(module, exports, __webpack_require__) {
  15590. var _Number = Number;
  15591. var _isString = __webpack_require__( /*! ../../core/utils/type */ 1).isString;
  15592. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  15593. var _patchFontOptions = __webpack_require__( /*! ./utils */ 10).patchFontOptions;
  15594. var parseHorizontalAlignment = __webpack_require__( /*! ./utils */ 10).enumParser(["left", "center", "right"]);
  15595. var parseVerticalAlignment = __webpack_require__( /*! ./utils */ 10).enumParser(["top", "bottom"]);
  15596. var DEFAULT_MARGIN = 10;
  15597. function hasText(text) {
  15598. return !!(text && String(text).length > 0)
  15599. }
  15600. function processTitleLength(elem, text, width, options, placeholderSize) {
  15601. if (elem.attr({
  15602. text: text
  15603. }).setMaxSize(width, placeholderSize, options).textChanged) {
  15604. elem.setTitle(text)
  15605. }
  15606. }
  15607. function pickMarginValue(value) {
  15608. return value >= 0 ? _Number(value) : DEFAULT_MARGIN
  15609. }
  15610. function validateMargin(margin) {
  15611. var result;
  15612. if (margin >= 0) {
  15613. result = {
  15614. left: _Number(margin),
  15615. top: _Number(margin),
  15616. right: _Number(margin),
  15617. bottom: _Number(margin)
  15618. }
  15619. } else {
  15620. margin = margin || {};
  15621. result = {
  15622. left: pickMarginValue(margin.left),
  15623. top: pickMarginValue(margin.top),
  15624. right: pickMarginValue(margin.right),
  15625. bottom: pickMarginValue(margin.bottom)
  15626. }
  15627. }
  15628. return result
  15629. }
  15630. function checkRect(rect, boundingRect) {
  15631. return rect[2] - rect[0] < boundingRect.width || rect[3] - rect[1] < boundingRect.height
  15632. }
  15633. function Title(params) {
  15634. this._params = params;
  15635. this._group = params.renderer.g().attr({
  15636. "class": params.cssClass
  15637. }).linkOn(params.root || params.renderer.root, "title");
  15638. this._hasText = false
  15639. }
  15640. extend(Title.prototype, __webpack_require__( /*! ./layout_element */ 242).LayoutElement.prototype, {
  15641. dispose: function() {
  15642. var that = this;
  15643. that._group.linkRemove();
  15644. that._group.linkOff();
  15645. if (that._titleElement) {
  15646. that._clipRect.dispose();
  15647. that._titleElement = that._subtitleElement = that._clipRect = null
  15648. }
  15649. that._params = that._group = that._options = null
  15650. },
  15651. _updateOptions: function(options) {
  15652. this._options = options;
  15653. this._options.horizontalAlignment = parseHorizontalAlignment(options.horizontalAlignment, "center");
  15654. this._options.verticalAlignment = parseVerticalAlignment(options.verticalAlignment, "top");
  15655. this._options.margin = validateMargin(options.margin)
  15656. },
  15657. _updateStructure: function() {
  15658. var that = this;
  15659. var renderer = that._params.renderer;
  15660. var group = that._group;
  15661. var options = that._options;
  15662. var align = options.horizontalAlignment;
  15663. if (!that._titleElement) {
  15664. that._titleElement = renderer.text().append(group);
  15665. that._subtitleElement = renderer.text();
  15666. that._clipRect = renderer.clipRect();
  15667. group.attr({
  15668. "clip-path": that._clipRect.id
  15669. })
  15670. }
  15671. that._titleElement.attr({
  15672. align: align,
  15673. "class": options.cssClass
  15674. });
  15675. that._subtitleElement.attr({
  15676. align: align,
  15677. "class": options.subtitle.cssClass
  15678. });
  15679. group.linkAppend();
  15680. hasText(options.subtitle.text) ? that._subtitleElement.append(group) : that._subtitleElement.remove()
  15681. },
  15682. _updateTexts: function() {
  15683. var that = this;
  15684. var options = that._options;
  15685. var subtitleOptions = options.subtitle;
  15686. var titleElement = that._titleElement;
  15687. var subtitleElement = that._subtitleElement;
  15688. var testText = "A";
  15689. var titleBox;
  15690. titleElement.attr({
  15691. text: testText,
  15692. y: 0
  15693. }).css(_patchFontOptions(options.font));
  15694. titleBox = titleElement.getBBox();
  15695. that._baseLineCorrection = titleBox.height + titleBox.y;
  15696. titleElement.attr({
  15697. text: options.text
  15698. });
  15699. titleBox = titleElement.getBBox();
  15700. var y = -titleBox.y;
  15701. titleElement.attr({
  15702. y: y
  15703. });
  15704. if (hasText(subtitleOptions.text)) {
  15705. subtitleElement.attr({
  15706. text: subtitleOptions.text,
  15707. y: 0
  15708. }).css(_patchFontOptions(subtitleOptions.font))
  15709. }
  15710. },
  15711. _shiftSubtitle: function() {
  15712. var that = this;
  15713. var titleBox = that._titleElement.getBBox();
  15714. var element = that._subtitleElement;
  15715. var offset = that._options.subtitle.offset;
  15716. element.move(0, titleBox.y + titleBox.height - element.getBBox().y - offset)
  15717. },
  15718. _updateBoundingRectAlignment: function() {
  15719. var boundingRect = this._boundingRect;
  15720. var options = this._options;
  15721. boundingRect.verticalAlignment = options.verticalAlignment;
  15722. boundingRect.horizontalAlignment = options.horizontalAlignment;
  15723. boundingRect.cutLayoutSide = options.verticalAlignment;
  15724. boundingRect.cutSide = "vertical";
  15725. boundingRect.position = {
  15726. horizontal: options.horizontalAlignment,
  15727. vertical: options.verticalAlignment
  15728. }
  15729. },
  15730. hasText: function() {
  15731. return this._hasText
  15732. },
  15733. update: function(themeOptions, userOptions) {
  15734. var that = this;
  15735. var options = extend(true, {}, themeOptions, processTitleOptions(userOptions));
  15736. var _hasText = hasText(options.text);
  15737. var isLayoutChanged = _hasText || _hasText !== that._hasText;
  15738. that._baseLineCorrection = 0;
  15739. that._updateOptions(options);
  15740. that._boundingRect = {};
  15741. if (_hasText) {
  15742. that._updateStructure();
  15743. that._updateTexts()
  15744. } else {
  15745. that._group.linkRemove()
  15746. }
  15747. that._updateBoundingRect();
  15748. that._updateBoundingRectAlignment();
  15749. that._hasText = _hasText;
  15750. return isLayoutChanged
  15751. },
  15752. draw: function(width, height) {
  15753. var that = this;
  15754. if (that._hasText) {
  15755. that._group.linkAppend();
  15756. that._correctTitleLength(width);
  15757. if (that._group.getBBox().height > height) {
  15758. this.freeSpace()
  15759. }
  15760. }
  15761. return that
  15762. },
  15763. probeDraw: function(width, height) {
  15764. this.draw(width, height);
  15765. return this
  15766. },
  15767. _correctTitleLength: function(width) {
  15768. var that = this;
  15769. var options = that._options;
  15770. var margin = options.margin;
  15771. var maxWidth = width - margin.left - margin.right;
  15772. var placeholderSize = options.placeholderSize;
  15773. processTitleLength(that._titleElement, options.text, maxWidth, options, placeholderSize);
  15774. if (that._subtitleElement) {
  15775. if (_Number(placeholderSize) > 0) {
  15776. placeholderSize -= that._titleElement.getBBox().height
  15777. }
  15778. processTitleLength(that._subtitleElement, options.subtitle.text, maxWidth, options.subtitle, placeholderSize);
  15779. that._shiftSubtitle()
  15780. }
  15781. that._updateBoundingRect();
  15782. var _this$getCorrectedLay = this.getCorrectedLayoutOptions(),
  15783. x = _this$getCorrectedLay.x,
  15784. y = _this$getCorrectedLay.y,
  15785. height = _this$getCorrectedLay.height;
  15786. this._clipRect.attr({
  15787. x: x,
  15788. y: y,
  15789. width: width,
  15790. height: height
  15791. })
  15792. },
  15793. getLayoutOptions: function() {
  15794. return this._boundingRect || null
  15795. },
  15796. shift: function(x, y) {
  15797. var that = this;
  15798. var box = that.getLayoutOptions();
  15799. that._group.move(x - box.x, y - box.y);
  15800. return that
  15801. },
  15802. _updateBoundingRect: function() {
  15803. var that = this;
  15804. var options = that._options;
  15805. var margin = options.margin;
  15806. var boundingRect = that._boundingRect;
  15807. var box = that._hasText ? that._group.getBBox() : {
  15808. width: 0,
  15809. height: 0,
  15810. x: 0,
  15811. y: 0,
  15812. isEmpty: true
  15813. };
  15814. if (!box.isEmpty) {
  15815. box.height += margin.top + margin.bottom - that._baseLineCorrection;
  15816. box.width += margin.left + margin.right;
  15817. box.x -= margin.left;
  15818. box.y += that._baseLineCorrection - margin.top
  15819. }
  15820. if (options.placeholderSize > 0) {
  15821. box.height = options.placeholderSize
  15822. }
  15823. boundingRect.height = box.height;
  15824. boundingRect.width = box.width;
  15825. boundingRect.x = box.x;
  15826. boundingRect.y = box.y
  15827. },
  15828. getCorrectedLayoutOptions: function() {
  15829. var srcBox = this.getLayoutOptions();
  15830. var correction = this._baseLineCorrection;
  15831. return extend({}, srcBox, {
  15832. y: srcBox.y - correction,
  15833. height: srcBox.height + correction
  15834. })
  15835. },
  15836. layoutOptions: function() {
  15837. if (!this._hasText) {
  15838. return null
  15839. }
  15840. return {
  15841. horizontalAlignment: this._boundingRect.horizontalAlignment,
  15842. verticalAlignment: this._boundingRect.verticalAlignment,
  15843. priority: 0
  15844. }
  15845. },
  15846. measure: function(size) {
  15847. this.draw(size[0], size[1]);
  15848. return [this._boundingRect.width, this._boundingRect.height]
  15849. },
  15850. move: function(rect, fitRect) {
  15851. var boundingRect = this._boundingRect;
  15852. if (checkRect(rect, boundingRect)) {
  15853. this.shift(fitRect[0], fitRect[1])
  15854. } else {
  15855. this.shift(Math.round(rect[0]), Math.round(rect[1]))
  15856. }
  15857. },
  15858. freeSpace: function() {
  15859. var that = this;
  15860. that._params.incidentOccurred("W2103");
  15861. that._group.linkRemove();
  15862. that._boundingRect.width = that._boundingRect.height = 0
  15863. },
  15864. getOptions: function() {
  15865. return this._options
  15866. },
  15867. changeLink: function(root) {
  15868. this._group.linkRemove();
  15869. this._group.linkOn(root, "title")
  15870. }
  15871. });
  15872. exports.Title = Title;
  15873. Title.prototype.DEBUG_getOptions = function() {
  15874. return this._options
  15875. };
  15876. function processTitleOptions(options) {
  15877. var newOptions = _isString(options) ? {
  15878. text: options
  15879. } : options || {};
  15880. newOptions.subtitle = _isString(newOptions.subtitle) ? {
  15881. text: newOptions.subtitle
  15882. } : newOptions.subtitle || {};
  15883. return newOptions
  15884. }
  15885. exports.plugin = {
  15886. name: "title",
  15887. init: function() {
  15888. var that = this;
  15889. that._title = new exports.Title({
  15890. renderer: that._renderer,
  15891. cssClass: that._rootClassPrefix + "-title",
  15892. incidentOccurred: that._incidentOccurred
  15893. });
  15894. that._layout.add(that._title)
  15895. },
  15896. dispose: function() {
  15897. this._title.dispose();
  15898. this._title = null
  15899. },
  15900. customize: function(constructor) {
  15901. constructor.addChange({
  15902. code: "TITLE",
  15903. handler: function() {
  15904. if (this._title.update(this._themeManager.theme("title"), this.option("title"))) {
  15905. this._change(["LAYOUT"])
  15906. }
  15907. },
  15908. isThemeDependent: true,
  15909. option: "title",
  15910. isOptionChange: true
  15911. })
  15912. },
  15913. fontFields: ["title.font", "title.subtitle.font"]
  15914. }
  15915. },
  15916. /*!***********************************************************!*\
  15917. !*** ./artifacts/transpiled/viz/series/scatter_series.js ***!
  15918. \***********************************************************/
  15919. /*! dynamic exports provided */
  15920. /*! all exports used */
  15921. function(module, exports, __webpack_require__) {
  15922. function _defineProperty(obj, key, value) {
  15923. if (key in obj) {
  15924. Object.defineProperty(obj, key, {
  15925. value: value,
  15926. enumerable: true,
  15927. configurable: true,
  15928. writable: true
  15929. })
  15930. } else {
  15931. obj[key] = value
  15932. }
  15933. return obj
  15934. }
  15935. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  15936. var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  15937. var _each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  15938. var rangeCalculator = __webpack_require__( /*! ./helpers/range_data_calculator */ 247);
  15939. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  15940. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  15941. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  15942. var _isDefined = typeUtils.isDefined;
  15943. var _isString = typeUtils.isString;
  15944. var _map = vizUtils.map;
  15945. var _normalizeEnum = vizUtils.normalizeEnum;
  15946. var math = Math;
  15947. var _abs = math.abs;
  15948. var _sqrt = math.sqrt;
  15949. var _max = math.max;
  15950. var DEFAULT_TRACKER_WIDTH = 12;
  15951. var DEFAULT_DURATION = 400;
  15952. var HIGH_ERROR = "highError";
  15953. var LOW_ERROR = "lowError";
  15954. var VARIANCE = "variance";
  15955. var STANDARD_DEVIATION = "stddeviation";
  15956. var STANDARD_ERROR = "stderror";
  15957. var PERCENT = "percent";
  15958. var FIXED = "fixed";
  15959. var UNDEFINED = "undefined";
  15960. var DISCRETE = "discrete";
  15961. var LOGARITHMIC = "logarithmic";
  15962. var DATETIME = "datetime";
  15963. exports.chart = {};
  15964. exports.polar = {};
  15965. function sum(array) {
  15966. var result = 0;
  15967. _each(array, function(_, value) {
  15968. result += value
  15969. });
  15970. return result
  15971. }
  15972. function isErrorBarTypeCorrect(type) {
  15973. return inArray(type, [FIXED, PERCENT, VARIANCE, STANDARD_DEVIATION, STANDARD_ERROR]) !== -1
  15974. }
  15975. function variance(array, expectedValue) {
  15976. return sum(_map(array, function(value) {
  15977. return (value - expectedValue) * (value - expectedValue)
  15978. })) / array.length
  15979. }
  15980. function calculateAvgErrorBars(result, data, series) {
  15981. var errorBarsOptions = series.getOptions().valueErrorBar;
  15982. var valueField = series.getValueFields()[0];
  15983. var lowValueField = errorBarsOptions.lowValueField || LOW_ERROR;
  15984. var highValueField = errorBarsOptions.highValueField || HIGH_ERROR;
  15985. if (series.areErrorBarsVisible() && void 0 === errorBarsOptions.type) {
  15986. var fusionData = data.reduce(function(result, item) {
  15987. if (_isDefined(item[lowValueField])) {
  15988. result[0] += item[valueField] - item[lowValueField];
  15989. result[1]++
  15990. }
  15991. if (_isDefined(item[highValueField])) {
  15992. result[2] += item[highValueField] - item[valueField];
  15993. result[3]++
  15994. }
  15995. return result
  15996. }, [0, 0, 0, 0]);
  15997. if (fusionData[1]) {
  15998. result[lowValueField] = result[valueField] - fusionData[0] / fusionData[1]
  15999. }
  16000. if (fusionData[2]) {
  16001. result[highValueField] = result[valueField] + fusionData[2] / fusionData[3]
  16002. }
  16003. }
  16004. return result
  16005. }
  16006. function calculateSumErrorBars(result, data, series) {
  16007. var errorBarsOptions = series.getOptions().valueErrorBar;
  16008. var lowValueField = errorBarsOptions.lowValueField || LOW_ERROR;
  16009. var highValueField = errorBarsOptions.highValueField || HIGH_ERROR;
  16010. if (series.areErrorBarsVisible() && void 0 === errorBarsOptions.type) {
  16011. result[lowValueField] = 0;
  16012. result[highValueField] = 0;
  16013. result = data.reduce(function(result, item) {
  16014. result[lowValueField] += item[lowValueField];
  16015. result[highValueField] += item[highValueField];
  16016. return result
  16017. }, result)
  16018. }
  16019. return result
  16020. }
  16021. function getMinMaxAggregator(compare) {
  16022. return function(_ref, series) {
  16023. var intervalStart = _ref.intervalStart,
  16024. data = _ref.data;
  16025. var valueField = series.getValueFields()[0];
  16026. var targetData = data[0];
  16027. targetData = data.reduce(function(result, item) {
  16028. var value = item[valueField];
  16029. if (null === result[valueField]) {
  16030. result = item
  16031. }
  16032. if (null !== value && compare(value, result[valueField])) {
  16033. return item
  16034. }
  16035. return result
  16036. }, targetData);
  16037. return _extend({}, targetData, _defineProperty({}, series.getArgumentField(), intervalStart))
  16038. }
  16039. }
  16040. function checkFields(data, fieldsToCheck, skippedFields) {
  16041. var allFieldsIsValid = true;
  16042. for (var field in fieldsToCheck) {
  16043. var isArgument = "argument" === field;
  16044. if (isArgument || "size" === field ? !_isDefined(data[field]) : void 0 === data[field]) {
  16045. var selector = fieldsToCheck[field];
  16046. if (!isArgument) {
  16047. skippedFields[selector] = (skippedFields[selector] || 0) + 1
  16048. }
  16049. allFieldsIsValid = false
  16050. }
  16051. }
  16052. return allFieldsIsValid
  16053. }
  16054. var baseScatterMethods = {
  16055. _defaultDuration: DEFAULT_DURATION,
  16056. _defaultTrackerWidth: DEFAULT_TRACKER_WIDTH,
  16057. _applyStyle: _noop,
  16058. _updateOptions: _noop,
  16059. _parseStyle: _noop,
  16060. _prepareSegment: _noop,
  16061. _drawSegment: _noop,
  16062. _appendInGroup: function() {
  16063. this._group.append(this._extGroups.seriesGroup)
  16064. },
  16065. _createLegendState: function(styleOptions, defaultColor) {
  16066. return {
  16067. fill: styleOptions.color || defaultColor,
  16068. hatching: styleOptions.hatching ? _extend({}, styleOptions.hatching, {
  16069. direction: "right"
  16070. }) : void 0
  16071. }
  16072. },
  16073. _applyElementsClipRect: function(settings) {
  16074. settings["clip-path"] = this._paneClipRectID
  16075. },
  16076. _applyMarkerClipRect: function(settings) {
  16077. settings["clip-path"] = this._forceClipping ? this._paneClipRectID : null
  16078. },
  16079. _createGroup: function(groupName, parent, target, settings) {
  16080. var group = parent[groupName] = parent[groupName] || this._renderer.g();
  16081. target && group.append(target);
  16082. settings && group.attr(settings)
  16083. },
  16084. _applyClearingSettings: function(settings) {
  16085. settings.opacity = null;
  16086. settings.scale = null;
  16087. if (this._options.rotated) {
  16088. settings.translateX = null
  16089. } else {
  16090. settings.translateY = null
  16091. }
  16092. },
  16093. _createGroups: function() {
  16094. var that = this;
  16095. that._createGroup("_markersGroup", that, that._group);
  16096. that._createGroup("_labelsGroup", that)
  16097. },
  16098. _setMarkerGroupSettings: function() {
  16099. var that = this;
  16100. var settings = that._createPointStyles(that._getMarkerGroupOptions()).normal;
  16101. settings.class = "dxc-markers";
  16102. settings.opacity = 1;
  16103. that._applyMarkerClipRect(settings);
  16104. that._markersGroup.attr(settings)
  16105. },
  16106. getVisibleArea: function() {
  16107. return this._visibleArea
  16108. },
  16109. areErrorBarsVisible: function() {
  16110. var errorBarOptions = this._options.valueErrorBar;
  16111. return errorBarOptions && this._errorBarsEnabled() && "none" !== errorBarOptions.displayMode && (isErrorBarTypeCorrect(_normalizeEnum(errorBarOptions.type)) || _isDefined(errorBarOptions.lowValueField) || _isDefined(errorBarOptions.highValueField))
  16112. },
  16113. groupPointsByCoords: function(rotated) {
  16114. var cat = [];
  16115. _each(this.getVisiblePoints(), function(_, p) {
  16116. var pointCoord = parseInt(rotated ? p.vy : p.vx);
  16117. if (!cat[pointCoord]) {
  16118. cat[pointCoord] = p
  16119. } else {
  16120. Array.isArray(cat[pointCoord]) ? cat[pointCoord].push(p) : cat[pointCoord] = [cat[pointCoord], p]
  16121. }
  16122. });
  16123. return cat
  16124. },
  16125. _createErrorBarGroup: function(animationEnabled) {
  16126. var that = this;
  16127. var errorBarOptions = that._options.valueErrorBar;
  16128. var settings;
  16129. if (that.areErrorBarsVisible()) {
  16130. settings = {
  16131. "class": "dxc-error-bars",
  16132. stroke: errorBarOptions.color,
  16133. "stroke-width": errorBarOptions.lineWidth,
  16134. opacity: animationEnabled ? .001 : errorBarOptions.opacity || 1,
  16135. "stroke-linecap": "square",
  16136. sharp: true,
  16137. "clip-path": that._forceClipping ? that._paneClipRectID : that._widePaneClipRectID
  16138. };
  16139. that._createGroup("_errorBarGroup", that, that._group, settings)
  16140. }
  16141. },
  16142. _setGroupsSettings: function(animationEnabled) {
  16143. var that = this;
  16144. that._setMarkerGroupSettings();
  16145. that._setLabelGroupSettings(animationEnabled);
  16146. that._createErrorBarGroup(animationEnabled)
  16147. },
  16148. _getCreatingPointOptions: function() {
  16149. var that = this;
  16150. var defaultPointOptions;
  16151. var creatingPointOptions = that._predefinedPointOptions;
  16152. var normalStyle;
  16153. if (!creatingPointOptions) {
  16154. defaultPointOptions = that._getPointOptions();
  16155. that._predefinedPointOptions = creatingPointOptions = _extend(true, {
  16156. styles: {}
  16157. }, defaultPointOptions);
  16158. normalStyle = defaultPointOptions.styles && defaultPointOptions.styles.normal || {};
  16159. creatingPointOptions.styles = creatingPointOptions.styles || {};
  16160. creatingPointOptions.styles.normal = {
  16161. "stroke-width": normalStyle["stroke-width"],
  16162. r: normalStyle.r,
  16163. opacity: normalStyle.opacity
  16164. }
  16165. }
  16166. return creatingPointOptions
  16167. },
  16168. _getPointOptions: function() {
  16169. return this._parsePointOptions(this._preparePointOptions(), this._options.label)
  16170. },
  16171. _getOptionsForPoint: function() {
  16172. return this._options.point
  16173. },
  16174. _parsePointStyle: function(style, defaultColor, defaultBorderColor, defaultSize) {
  16175. var border = style.border || {};
  16176. var sizeValue = void 0 !== style.size ? style.size : defaultSize;
  16177. return {
  16178. fill: style.color || defaultColor,
  16179. stroke: border.color || defaultBorderColor,
  16180. "stroke-width": border.visible ? border.width : 0,
  16181. r: sizeValue / 2 + (border.visible && 0 !== sizeValue ? ~~(border.width / 2) || 0 : 0)
  16182. }
  16183. },
  16184. _createPointStyles: function(pointOptions) {
  16185. var that = this;
  16186. var mainPointColor = pointOptions.color || that._options.mainSeriesColor;
  16187. var containerColor = that._options.containerBackgroundColor;
  16188. var normalStyle = that._parsePointStyle(pointOptions, mainPointColor, mainPointColor);
  16189. normalStyle.visibility = pointOptions.visible ? "visible" : "hidden";
  16190. return {
  16191. normal: normalStyle,
  16192. hover: that._parsePointStyle(pointOptions.hoverStyle, containerColor, mainPointColor, pointOptions.size),
  16193. selection: that._parsePointStyle(pointOptions.selectionStyle, containerColor, mainPointColor, pointOptions.size)
  16194. }
  16195. },
  16196. _checkData: function(data, skippedFields, fieldsToCheck) {
  16197. fieldsToCheck = fieldsToCheck || {
  16198. value: this.getValueFields()[0]
  16199. };
  16200. fieldsToCheck.argument = this.getArgumentField();
  16201. return checkFields(data, fieldsToCheck, skippedFields || {}) && data.value === data.value
  16202. },
  16203. getValueRangeInitialValue: function() {
  16204. return
  16205. },
  16206. _getRangeData: function() {
  16207. return rangeCalculator.getRangeData(this)
  16208. },
  16209. _getPointDataSelector: function() {
  16210. var _this = this;
  16211. var valueField = this.getValueFields()[0];
  16212. var argumentField = this.getArgumentField();
  16213. var tagField = this.getTagField();
  16214. var areErrorBarsVisible = this.areErrorBarsVisible();
  16215. var lowValueField;
  16216. var highValueField;
  16217. if (areErrorBarsVisible) {
  16218. var errorBarOptions = this._options.valueErrorBar;
  16219. lowValueField = errorBarOptions.lowValueField || LOW_ERROR;
  16220. highValueField = errorBarOptions.highValueField || HIGH_ERROR
  16221. }
  16222. return function(data) {
  16223. var pointData = {
  16224. value: _this._processEmptyValue(data[valueField]),
  16225. argument: data[argumentField],
  16226. tag: data[tagField],
  16227. data: data
  16228. };
  16229. if (areErrorBarsVisible) {
  16230. pointData.lowError = data[lowValueField];
  16231. pointData.highError = data[highValueField]
  16232. }
  16233. return pointData
  16234. }
  16235. },
  16236. _errorBarsEnabled: function() {
  16237. return this.valueAxisType !== DISCRETE && this.valueAxisType !== LOGARITHMIC && this.valueType !== DATETIME
  16238. },
  16239. _drawPoint: function(options) {
  16240. var point = options.point;
  16241. if (point.isInVisibleArea()) {
  16242. point.clearVisibility();
  16243. point.draw(this._renderer, options.groups, options.hasAnimation, options.firstDrawing);
  16244. this._drawnPoints.push(point)
  16245. } else {
  16246. point.setInvisibility()
  16247. }
  16248. },
  16249. _animateComplete: function() {
  16250. var that = this;
  16251. var animationSettings = {
  16252. duration: that._defaultDuration
  16253. };
  16254. that._labelsGroup && that._labelsGroup.animate({
  16255. opacity: 1
  16256. }, animationSettings);
  16257. that._errorBarGroup && that._errorBarGroup.animate({
  16258. opacity: that._options.valueErrorBar.opacity || 1
  16259. }, animationSettings)
  16260. },
  16261. _animate: function() {
  16262. var that = this;
  16263. var lastPointIndex = that._drawnPoints.length - 1;
  16264. _each(that._drawnPoints || [], function(i, p) {
  16265. p.animate(i === lastPointIndex ? function() {
  16266. that._animateComplete()
  16267. } : void 0, {
  16268. translateX: p.x,
  16269. translateY: p.y
  16270. })
  16271. })
  16272. },
  16273. _defaultAggregator: "avg",
  16274. _aggregators: {
  16275. avg: function(_ref2, series) {
  16276. var _calculateAvgErrorBar;
  16277. var data = _ref2.data,
  16278. intervalStart = _ref2.intervalStart;
  16279. if (!data.length) {
  16280. return
  16281. }
  16282. var valueField = series.getValueFields()[0];
  16283. var aggregationResult = data.reduce(function(result, item) {
  16284. var value = item[valueField];
  16285. if (_isDefined(value)) {
  16286. result[0] += value;
  16287. result[1]++
  16288. } else {
  16289. if (null === value) {
  16290. result[2]++
  16291. }
  16292. }
  16293. return result
  16294. }, [0, 0, 0]);
  16295. return calculateAvgErrorBars((_calculateAvgErrorBar = {}, _defineProperty(_calculateAvgErrorBar, valueField, aggregationResult[2] === data.length ? null : aggregationResult[0] / aggregationResult[1]), _defineProperty(_calculateAvgErrorBar, series.getArgumentField(), intervalStart), _calculateAvgErrorBar), data, series)
  16296. },
  16297. sum: function(_ref3, series) {
  16298. var _calculateSumErrorBar;
  16299. var intervalStart = _ref3.intervalStart,
  16300. data = _ref3.data;
  16301. if (!data.length) {
  16302. return
  16303. }
  16304. var valueField = series.getValueFields()[0];
  16305. var aggregationResult = data.reduce(function(result, item) {
  16306. var value = item[valueField];
  16307. if (void 0 !== value) {
  16308. result[0] += value
  16309. }
  16310. if (null === value) {
  16311. result[1]++
  16312. } else {
  16313. if (void 0 === value) {
  16314. result[2]++
  16315. }
  16316. }
  16317. return result
  16318. }, [0, 0, 0]);
  16319. var value = aggregationResult[0];
  16320. if (aggregationResult[1] === data.length) {
  16321. value = null
  16322. }
  16323. if (aggregationResult[2] === data.length) {
  16324. return
  16325. }
  16326. return calculateSumErrorBars((_calculateSumErrorBar = {}, _defineProperty(_calculateSumErrorBar, valueField, value), _defineProperty(_calculateSumErrorBar, series.getArgumentField(), intervalStart), _calculateSumErrorBar), data, series)
  16327. },
  16328. count: function(_ref4, series) {
  16329. var _ref5;
  16330. var data = _ref4.data,
  16331. intervalStart = _ref4.intervalStart;
  16332. var valueField = series.getValueFields()[0];
  16333. return _ref5 = {}, _defineProperty(_ref5, series.getArgumentField(), intervalStart), _defineProperty(_ref5, valueField, data.filter(function(i) {
  16334. return void 0 !== i[valueField]
  16335. }).length), _ref5
  16336. },
  16337. min: getMinMaxAggregator(function(a, b) {
  16338. return a < b
  16339. }),
  16340. max: getMinMaxAggregator(function(a, b) {
  16341. return a > b
  16342. })
  16343. },
  16344. _endUpdateData: function() {
  16345. delete this._predefinedPointOptions
  16346. },
  16347. getArgumentField: function() {
  16348. return this._options.argumentField || "arg"
  16349. },
  16350. getValueFields: function() {
  16351. var options = this._options;
  16352. var errorBarsOptions = options.valueErrorBar;
  16353. var valueFields = [options.valueField || "val"];
  16354. var lowValueField;
  16355. var highValueField;
  16356. if (errorBarsOptions) {
  16357. lowValueField = errorBarsOptions.lowValueField;
  16358. highValueField = errorBarsOptions.highValueField;
  16359. _isString(lowValueField) && valueFields.push(lowValueField);
  16360. _isString(highValueField) && valueFields.push(highValueField)
  16361. }
  16362. return valueFields
  16363. },
  16364. _calculateErrorBars: function(data) {
  16365. if (!this.areErrorBarsVisible()) {
  16366. return
  16367. }
  16368. var that = this;
  16369. var options = that._options;
  16370. var errorBarsOptions = options.valueErrorBar;
  16371. var errorBarType = _normalizeEnum(errorBarsOptions.type);
  16372. var floatErrorValue = parseFloat(errorBarsOptions.value);
  16373. var valueField = that.getValueFields()[0];
  16374. var value;
  16375. var lowValueField = errorBarsOptions.lowValueField || LOW_ERROR;
  16376. var highValueField = errorBarsOptions.highValueField || HIGH_ERROR;
  16377. var valueArray;
  16378. var valueArrayLength;
  16379. var meanValue;
  16380. var processDataItem;
  16381. var addSubError = function(_i, item) {
  16382. value = item.value;
  16383. item.lowError = value - floatErrorValue;
  16384. item.highError = value + floatErrorValue
  16385. };
  16386. switch (errorBarType) {
  16387. case FIXED:
  16388. processDataItem = addSubError;
  16389. break;
  16390. case PERCENT:
  16391. processDataItem = function(_, item) {
  16392. value = item.value;
  16393. var error = value * floatErrorValue / 100;
  16394. item.lowError = value - error;
  16395. item.highError = value + error
  16396. };
  16397. break;
  16398. case UNDEFINED:
  16399. processDataItem = function(_, item) {
  16400. item.lowError = item.data[lowValueField];
  16401. item.highError = item.data[highValueField]
  16402. };
  16403. break;
  16404. default:
  16405. valueArray = _map(data, function(item) {
  16406. return _isDefined(item.data[valueField]) ? item.data[valueField] : null
  16407. });
  16408. valueArrayLength = valueArray.length;
  16409. floatErrorValue = floatErrorValue || 1;
  16410. switch (errorBarType) {
  16411. case VARIANCE:
  16412. floatErrorValue = variance(valueArray, sum(valueArray) / valueArrayLength) * floatErrorValue;
  16413. processDataItem = addSubError;
  16414. break;
  16415. case STANDARD_DEVIATION:
  16416. meanValue = sum(valueArray) / valueArrayLength;
  16417. floatErrorValue = _sqrt(variance(valueArray, meanValue)) * floatErrorValue;
  16418. processDataItem = function(_, item) {
  16419. item.lowError = meanValue - floatErrorValue;
  16420. item.highError = meanValue + floatErrorValue
  16421. };
  16422. break;
  16423. case STANDARD_ERROR:
  16424. floatErrorValue = _sqrt(variance(valueArray, sum(valueArray) / valueArrayLength) / valueArrayLength) * floatErrorValue;
  16425. processDataItem = addSubError
  16426. }
  16427. }
  16428. processDataItem && _each(data, processDataItem)
  16429. },
  16430. _patchMarginOptions: function(options) {
  16431. var pointOptions = this._getCreatingPointOptions();
  16432. var styles = pointOptions.styles;
  16433. var maxSize = [styles.normal, styles.hover, styles.selection].reduce(function(max, style) {
  16434. return _max(max, 2 * style.r + style["stroke-width"])
  16435. }, 0);
  16436. options.size = pointOptions.visible ? maxSize : 0;
  16437. options.sizePointNormalState = pointOptions.visible ? 2 * styles.normal.r + styles.normal["stroke-width"] : 2;
  16438. return options
  16439. },
  16440. usePointsToDefineAutoHiding: function() {
  16441. return true
  16442. }
  16443. };
  16444. exports.chart = _extend({}, baseScatterMethods, {
  16445. drawTrackers: function() {
  16446. var that = this;
  16447. var trackers;
  16448. var trackersGroup;
  16449. var segments = that._segments || [];
  16450. var rotated = that._options.rotated;
  16451. if (!that.isVisible()) {
  16452. return
  16453. }
  16454. if (segments.length) {
  16455. trackers = that._trackers = that._trackers || [];
  16456. trackersGroup = that._trackersGroup = (that._trackersGroup || that._renderer.g().attr({
  16457. fill: "gray",
  16458. opacity: .001,
  16459. stroke: "gray",
  16460. "class": "dxc-trackers"
  16461. })).attr({
  16462. "clip-path": this._paneClipRectID || null
  16463. }).append(that._group);
  16464. _each(segments, function(i, segment) {
  16465. if (!trackers[i]) {
  16466. trackers[i] = that._drawTrackerElement(segment).data({
  16467. "chart-data-series": that
  16468. }).append(trackersGroup)
  16469. } else {
  16470. that._updateTrackerElement(segment, trackers[i])
  16471. }
  16472. })
  16473. }
  16474. that._trackersTranslator = that.groupPointsByCoords(rotated)
  16475. },
  16476. checkAxisVisibleAreaCoord: function(isArgument, coord) {
  16477. var axis = isArgument ? this.getArgumentAxis() : this.getValueAxis();
  16478. var visibleArea = axis.getVisibleArea();
  16479. return _isDefined(coord) && visibleArea[0] <= coord && visibleArea[1] >= coord
  16480. },
  16481. checkSeriesViewportCoord: function(axis, coord) {
  16482. return true
  16483. },
  16484. getSeriesPairCoord: function(coord, isArgument) {
  16485. var oppositeCoord = null;
  16486. var isOpposite = !isArgument && !this._options.rotated || isArgument && this._options.rotated;
  16487. var coordName = !isOpposite ? "vx" : "vy";
  16488. var oppositeCoordName = !isOpposite ? "vy" : "vx";
  16489. var points = this.getVisiblePoints();
  16490. for (var i = 0; i < points.length; i++) {
  16491. var p = points[i];
  16492. var tmpCoord = p[coordName] === coord ? p[oppositeCoordName] : void 0;
  16493. if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
  16494. oppositeCoord = tmpCoord;
  16495. break
  16496. }
  16497. }
  16498. return oppositeCoord
  16499. },
  16500. getNearestPointsByCoord: function(coord, isArgument) {
  16501. var that = this;
  16502. var rotated = that.getOptions().rotated;
  16503. var isOpposite = !isArgument && !rotated || isArgument && rotated;
  16504. var coordName = isOpposite ? "vy" : "vx";
  16505. var points = that.getVisiblePoints();
  16506. var allPoints = that.getPoints();
  16507. var nearestPoints = [];
  16508. if (that.isVisible() && allPoints.length > 0) {
  16509. if (allPoints.length > 1) {
  16510. that.findNeighborPointsByCoord(coord, coordName, points.slice(0), allPoints, function(point, nextPoint) {
  16511. nearestPoints.push([point, nextPoint])
  16512. })
  16513. } else {
  16514. if (allPoints[0][coordName] === coord) {
  16515. nearestPoints.push([allPoints[0], allPoints[0]])
  16516. }
  16517. }
  16518. }
  16519. return nearestPoints
  16520. },
  16521. findNeighborPointsByCoord: function(coord, coordName, points, allPoints, pushNeighborPoints) {
  16522. var searchPoints = allPoints;
  16523. if (points.length > 0) {
  16524. points.splice(0, 0, allPoints[allPoints.indexOf(points[0]) - 1]);
  16525. points.splice(points.length, 0, allPoints[allPoints.indexOf(points[points.length - 1]) + 1]);
  16526. searchPoints = points
  16527. }
  16528. searchPoints.forEach(function(p, i) {
  16529. var np = searchPoints[i + 1];
  16530. if (p && np && (p[coordName] <= coord && np[coordName] >= coord || p[coordName] >= coord && np[coordName] <= coord)) {
  16531. pushNeighborPoints(p, np)
  16532. }
  16533. })
  16534. },
  16535. getNeighborPoint: function(x, y) {
  16536. var pCoord = this._options.rotated ? y : x;
  16537. var nCoord = pCoord;
  16538. var cat = this._trackersTranslator;
  16539. var point = null;
  16540. var minDistance;
  16541. var oppositeCoord = this._options.rotated ? x : y;
  16542. var oppositeCoordName = this._options.rotated ? "vx" : "vy";
  16543. if (this.isVisible() && cat) {
  16544. point = cat[pCoord];
  16545. do {
  16546. point = cat[nCoord] || cat[pCoord];
  16547. pCoord--;
  16548. nCoord++
  16549. } while ((pCoord >= 0 || nCoord < cat.length) && !point);
  16550. if (Array.isArray(point)) {
  16551. minDistance = _abs(point[0][oppositeCoordName] - oppositeCoord);
  16552. _each(point, function(i, p) {
  16553. var distance = _abs(p[oppositeCoordName] - oppositeCoord);
  16554. if (minDistance >= distance) {
  16555. minDistance = distance;
  16556. point = p
  16557. }
  16558. })
  16559. }
  16560. }
  16561. return point
  16562. },
  16563. _applyVisibleArea: function() {
  16564. var that = this;
  16565. var rotated = that._options.rotated;
  16566. var visibleX = (rotated ? that.getValueAxis() : that.getArgumentAxis()).getVisibleArea();
  16567. var visibleY = (rotated ? that.getArgumentAxis() : that.getValueAxis()).getVisibleArea();
  16568. that._visibleArea = {
  16569. minX: visibleX[0],
  16570. maxX: visibleX[1],
  16571. minY: visibleY[0],
  16572. maxY: visibleY[1]
  16573. }
  16574. },
  16575. getPointCenterByArg: function(arg) {
  16576. var point = this.getPointsByArg(arg)[0];
  16577. return point ? point.getCenterCoord() : void 0
  16578. }
  16579. });
  16580. exports.polar = _extend({}, baseScatterMethods, {
  16581. drawTrackers: function() {
  16582. exports.chart.drawTrackers.call(this);
  16583. var cat = this._trackersTranslator;
  16584. var index;
  16585. if (!this.isVisible()) {
  16586. return
  16587. }
  16588. _each(cat, function(i, category) {
  16589. if (category) {
  16590. index = i;
  16591. return false
  16592. }
  16593. });
  16594. cat[index + 360] = cat[index]
  16595. },
  16596. getNeighborPoint: function(x, y) {
  16597. var pos = vizUtils.convertXYToPolar(this.getValueAxis().getCenter(), x, y);
  16598. return exports.chart.getNeighborPoint.call(this, pos.phi, pos.r)
  16599. },
  16600. _applyVisibleArea: function() {
  16601. var that = this;
  16602. var canvas = that.getValueAxis().getCanvas();
  16603. that._visibleArea = {
  16604. minX: canvas.left,
  16605. maxX: canvas.width - canvas.right,
  16606. minY: canvas.top,
  16607. maxY: canvas.height - canvas.bottom
  16608. }
  16609. }
  16610. })
  16611. },
  16612. /*!**************************************************!*\
  16613. !*** ./artifacts/transpiled/viz/core/tooltip.js ***!
  16614. \**************************************************/
  16615. /*! dynamic exports provided */
  16616. /*! all exports used */
  16617. function(module, exports, __webpack_require__) {
  16618. var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  16619. var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
  16620. var _window = __webpack_require__( /*! ../../core/utils/window */ 7);
  16621. var _window2 = _interopRequireDefault(_window);
  16622. var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
  16623. var _inflector2 = _interopRequireDefault(_inflector);
  16624. var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
  16625. var _renderer2 = _interopRequireDefault(_renderer);
  16626. var _renderer3 = __webpack_require__( /*! ./renderers/renderer */ 175);
  16627. var _renderer4 = _interopRequireDefault(_renderer3);
  16628. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  16629. var _type2 = _interopRequireDefault(_type);
  16630. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  16631. var _utils = __webpack_require__( /*! ./utils */ 10);
  16632. var _utils2 = _interopRequireDefault(_utils);
  16633. var _format_helper = __webpack_require__( /*! ../../format_helper */ 64);
  16634. var _plaque = __webpack_require__( /*! ./plaque */ 403);
  16635. function _interopRequireDefault(obj) {
  16636. return obj && obj.__esModule ? obj : {
  16637. "default": obj
  16638. }
  16639. }
  16640. var mathCeil = Math.ceil;
  16641. var mathMax = Math.max;
  16642. var mathMin = Math.min;
  16643. var window = _window2.default.getWindow();
  16644. function hideElement($element) {
  16645. $element.css({
  16646. left: "-9999px"
  16647. }).detach()
  16648. }
  16649. function getSpecialFormatOptions(options, specialFormat) {
  16650. var result = options;
  16651. switch (specialFormat) {
  16652. case "argument":
  16653. result = {
  16654. format: options.argumentFormat
  16655. };
  16656. break;
  16657. case "percent":
  16658. result = {
  16659. format: {
  16660. type: "percent",
  16661. precision: options.format && options.format.percentPrecision
  16662. }
  16663. }
  16664. }
  16665. return result
  16666. }
  16667. function Tooltip(params) {
  16668. var that = this;
  16669. var renderer;
  16670. that._eventTrigger = params.eventTrigger;
  16671. that._widgetRoot = params.widgetRoot;
  16672. that._wrapper = (0, _renderer2.default)("<div>").css({
  16673. position: "absolute",
  16674. overflow: "hidden",
  16675. pointerEvents: "none"
  16676. }).addClass(params.cssClass);
  16677. that._renderer = renderer = new _renderer4.default.Renderer({
  16678. pathModified: params.pathModified,
  16679. container: that._wrapper[0]
  16680. });
  16681. var root = renderer.root;
  16682. root.attr({
  16683. "pointer-events": "none"
  16684. });
  16685. that._text = renderer.text(void 0, 0, 0);
  16686. that._textGroupHtml = (0, _renderer2.default)("<div>").css({
  16687. position: "absolute",
  16688. padding: 0,
  16689. margin: 0,
  16690. border: "0px solid transparent"
  16691. }).appendTo(that._wrapper);
  16692. that._textHtml = (0, _renderer2.default)("<div>").css({
  16693. position: "relative",
  16694. display: "inline-block",
  16695. padding: 0,
  16696. margin: 0,
  16697. border: "0px solid transparent"
  16698. }).appendTo(that._textGroupHtml)
  16699. }
  16700. Tooltip.prototype = {
  16701. constructor: Tooltip,
  16702. dispose: function() {
  16703. this._wrapper.remove();
  16704. this._renderer.dispose();
  16705. this._options = this._widgetRoot = null
  16706. },
  16707. _getContainer: function() {
  16708. var options = this._options;
  16709. var container = (0, _renderer2.default)(this._widgetRoot).closest(options.container);
  16710. if (0 === container.length) {
  16711. container = (0, _renderer2.default)(options.container)
  16712. }
  16713. return (container.length ? container : (0, _renderer2.default)("body")).get(0)
  16714. },
  16715. setOptions: function(options) {
  16716. var _this = this;
  16717. options = options || {};
  16718. var that = this;
  16719. that._options = options;
  16720. that._textFontStyles = _utils2.default.patchFontOptions(options.font);
  16721. that._textFontStyles.color = options.font.color;
  16722. that._wrapper.css({
  16723. zIndex: options.zIndex
  16724. });
  16725. that._customizeTooltip = options.customizeTooltip;
  16726. var textGroupHtml = that._textGroupHtml;
  16727. var textHtml = that._textHtml;
  16728. if (this.plaque) {
  16729. this.plaque.clear()
  16730. }
  16731. this.plaque = new _plaque.Plaque({
  16732. opacity: that._options.opacity,
  16733. color: that._options.color,
  16734. border: that._options.border,
  16735. paddingLeftRight: that._options.paddingLeftRight,
  16736. paddingTopBottom: that._options.paddingTopBottom,
  16737. arrowLength: that._options.arrowLength,
  16738. arrowWidth: 20,
  16739. shadow: that._options.shadow,
  16740. cornerRadius: that._options.cornerRadius
  16741. }, that, that._renderer.root, function(tooltip, group) {
  16742. var state = tooltip._state;
  16743. if (state.html) {
  16744. if (!state.isRendered) {
  16745. that._text.attr({
  16746. text: ""
  16747. });
  16748. textGroupHtml.css({
  16749. color: state.textColor,
  16750. width: null
  16751. });
  16752. textHtml.html(state.html);
  16753. state.isRendered = true
  16754. }
  16755. } else {
  16756. that._text.css({
  16757. fill: state.textColor
  16758. }).attr({
  16759. text: state.text,
  16760. "class": options.cssClass
  16761. }).append(group.attr({
  16762. align: options.textAlignment
  16763. }))
  16764. }
  16765. _this.plaque.customizeCloud({
  16766. fill: state.color,
  16767. stroke: state.borderColor
  16768. })
  16769. }, true, function(tooltip, g) {
  16770. var state = tooltip._state;
  16771. if (state.html) {
  16772. var bBox;
  16773. var getComputedStyle = window.getComputedStyle;
  16774. if (getComputedStyle) {
  16775. bBox = getComputedStyle(textHtml.get(0));
  16776. bBox = {
  16777. x: 0,
  16778. y: 0,
  16779. width: mathCeil(parseFloat(bBox.width)),
  16780. height: mathCeil(parseFloat(bBox.height))
  16781. }
  16782. } else {
  16783. bBox = textHtml.get(0).getBoundingClientRect();
  16784. bBox = {
  16785. x: 0,
  16786. y: 0,
  16787. width: mathCeil(bBox.width ? bBox.width : bBox.right - bBox.left),
  16788. height: mathCeil(bBox.height ? bBox.height : bBox.bottom - bBox.top)
  16789. }
  16790. }
  16791. return bBox
  16792. }
  16793. return g.getBBox()
  16794. }, function(tooltip, g, x, y) {
  16795. var state = tooltip._state;
  16796. if (state.html) {
  16797. that._textGroupHtml.css({
  16798. left: x,
  16799. top: y
  16800. })
  16801. } else {
  16802. g.move(x, y)
  16803. }
  16804. });
  16805. return that
  16806. },
  16807. setRendererOptions: function(options) {
  16808. this._renderer.setOptions(options);
  16809. this._textGroupHtml.css({
  16810. direction: options.rtl ? "rtl" : "ltr"
  16811. });
  16812. return this
  16813. },
  16814. render: function() {
  16815. var that = this;
  16816. hideElement(that._wrapper);
  16817. var normalizedCSS = {};
  16818. for (var name in that._textFontStyles) {
  16819. normalizedCSS[_inflector2.default.camelize(name)] = that._textFontStyles[name]
  16820. }
  16821. that._textGroupHtml.css(normalizedCSS);
  16822. that._text.css(that._textFontStyles);
  16823. that._eventData = null;
  16824. return that
  16825. },
  16826. update: function(options) {
  16827. return this.setOptions(options).render()
  16828. },
  16829. _prepare: function(formatObject, state) {
  16830. var customizeTooltip = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this._customizeTooltip;
  16831. var options = this._options;
  16832. var customize = {};
  16833. if (_type2.default.isFunction(customizeTooltip)) {
  16834. customize = customizeTooltip.call(formatObject, formatObject);
  16835. customize = _type2.default.isPlainObject(customize) ? customize : {};
  16836. if ("text" in customize) {
  16837. state.text = _type2.default.isDefined(customize.text) ? String(customize.text) : ""
  16838. }
  16839. if ("html" in customize) {
  16840. state.html = _type2.default.isDefined(customize.html) ? String(customize.html) : ""
  16841. }
  16842. }
  16843. if (!("text" in state) && !("html" in state)) {
  16844. state.text = formatObject.valueText || formatObject.description || ""
  16845. }
  16846. state.color = customize.color || options.color;
  16847. state.borderColor = customize.borderColor || (options.border || {}).color;
  16848. state.textColor = customize.fontColor || (options.font || {}).color;
  16849. return !!state.text || !!state.html
  16850. },
  16851. show: function(formatObject, params, eventData, customizeTooltip) {
  16852. var that = this;
  16853. var state = {};
  16854. if (!that._prepare(formatObject, state, customizeTooltip)) {
  16855. return false
  16856. }
  16857. that._state = state;
  16858. that._wrapper.appendTo(that._getContainer());
  16859. that._textHtml.html("");
  16860. this.plaque.clear().draw((0, _extend.extend)({}, that._options, {
  16861. canvas: that._getCanvas()
  16862. }, state, {
  16863. x: params.x,
  16864. y: params.y,
  16865. offset: params.offset
  16866. }));
  16867. that.moveWrapper();
  16868. that._eventData && that._eventTrigger("tooltipHidden", that._eventData);
  16869. that._eventData = eventData;
  16870. that._eventTrigger("tooltipShown", that._eventData);
  16871. return true
  16872. },
  16873. hide: function() {
  16874. var that = this;
  16875. hideElement(that._wrapper);
  16876. that._eventData && that._eventTrigger("tooltipHidden", that._eventData);
  16877. that._eventData = null
  16878. },
  16879. move: function(x, y, offset) {
  16880. this.plaque.draw({
  16881. x: x,
  16882. y: y,
  16883. offset: offset,
  16884. canvas: this._getCanvas()
  16885. });
  16886. this.moveWrapper()
  16887. },
  16888. moveWrapper: function() {
  16889. var that = this;
  16890. var plaqueBBox = this.plaque.getBBox();
  16891. that._renderer.resize(plaqueBBox.width, plaqueBBox.height);
  16892. var offset = that._wrapper.css({
  16893. left: 0,
  16894. top: 0
  16895. }).offset();
  16896. var left = plaqueBBox.x;
  16897. var top = plaqueBBox.y;
  16898. that._wrapper.css({
  16899. left: left - offset.left,
  16900. top: top - offset.top
  16901. });
  16902. this.plaque.moveRoot(-left, -top);
  16903. if (this._state.html) {
  16904. that._textHtml.css({
  16905. left: -left,
  16906. top: -top
  16907. });
  16908. that._textGroupHtml.css({
  16909. width: plaqueBBox.width
  16910. })
  16911. }
  16912. },
  16913. formatValue: function(value, _specialFormat) {
  16914. var options = _specialFormat ? getSpecialFormatOptions(this._options, _specialFormat) : this._options;
  16915. return (0, _format_helper.format)(value, options.format)
  16916. },
  16917. getLocation: function() {
  16918. return _utils2.default.normalizeEnum(this._options.location)
  16919. },
  16920. isEnabled: function() {
  16921. return !!this._options.enabled
  16922. },
  16923. isShared: function() {
  16924. return !!this._options.shared
  16925. },
  16926. _getCanvas: function() {
  16927. var container = this._getContainer();
  16928. var containerBox = container.getBoundingClientRect();
  16929. var html = _dom_adapter2.default.getDocumentElement();
  16930. var document = _dom_adapter2.default.getDocument();
  16931. var left = window.pageXOffset || html.scrollLeft || 0;
  16932. var top = window.pageYOffset || html.scrollTop || 0;
  16933. var box = {
  16934. left: left,
  16935. top: top,
  16936. width: html.clientWidth + left || 0,
  16937. height: mathMax(document.body.scrollHeight, html.scrollHeight, document.body.offsetHeight, html.offsetHeight, document.body.clientHeight, html.clientHeight) || 0,
  16938. right: 0,
  16939. bottom: 0
  16940. };
  16941. if (container !== _dom_adapter2.default.getBody()) {
  16942. left = mathMax(box.left, box.left + containerBox.left);
  16943. top = mathMax(box.top, box.top + containerBox.top);
  16944. box.width = mathMin(containerBox.width, box.width) + left + box.left;
  16945. box.height = mathMin(containerBox.height, box.height) + top + box.top;
  16946. box.left = left;
  16947. box.top = top
  16948. }
  16949. return box
  16950. }
  16951. };
  16952. exports.Tooltip = Tooltip;
  16953. exports.plugin = {
  16954. name: "tooltip",
  16955. init: function() {
  16956. this._initTooltip()
  16957. },
  16958. dispose: function() {
  16959. this._disposeTooltip()
  16960. },
  16961. members: {
  16962. _initTooltip: function() {
  16963. this._tooltip = new exports.Tooltip({
  16964. cssClass: this._rootClassPrefix + "-tooltip",
  16965. eventTrigger: this._eventTrigger,
  16966. pathModified: this.option("pathModified"),
  16967. widgetRoot: this.element()
  16968. })
  16969. },
  16970. _disposeTooltip: function() {
  16971. this._tooltip.dispose();
  16972. this._tooltip = null
  16973. },
  16974. _setTooltipRendererOptions: function() {
  16975. this._tooltip.setRendererOptions(this._getRendererOptions())
  16976. },
  16977. _setTooltipOptions: function() {
  16978. this._tooltip.update(this._getOption("tooltip"))
  16979. }
  16980. },
  16981. extenders: {
  16982. _stopCurrentHandling: function() {
  16983. this._tooltip && this._tooltip.hide()
  16984. }
  16985. },
  16986. customize: function(constructor) {
  16987. var proto = constructor.prototype;
  16988. proto._eventsMap.onTooltipShown = {
  16989. name: "tooltipShown"
  16990. };
  16991. proto._eventsMap.onTooltipHidden = {
  16992. name: "tooltipHidden"
  16993. };
  16994. constructor.addChange({
  16995. code: "TOOLTIP_RENDERER",
  16996. handler: function() {
  16997. this._setTooltipRendererOptions()
  16998. },
  16999. isThemeDependent: true,
  17000. isOptionChange: true
  17001. });
  17002. constructor.addChange({
  17003. code: "TOOLTIP",
  17004. handler: function() {
  17005. this._setTooltipOptions()
  17006. },
  17007. isThemeDependent: true,
  17008. isOptionChange: true,
  17009. option: "tooltip"
  17010. })
  17011. },
  17012. fontFields: ["tooltip.font"]
  17013. }
  17014. },
  17015. /*!*******************************************************!*\
  17016. !*** ./artifacts/transpiled/viz/translators/range.js ***!
  17017. \*******************************************************/
  17018. /*! dynamic exports provided */
  17019. /*! all exports used */
  17020. function(module, exports, __webpack_require__) {
  17021. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  17022. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  17023. var _isDefined = typeUtils.isDefined;
  17024. var _isDate = typeUtils.isDate;
  17025. var _isFunction = typeUtils.isFunction;
  17026. var unique = __webpack_require__( /*! ../core/utils */ 10).unique;
  17027. var minSelector = "min";
  17028. var maxSelector = "max";
  17029. var minVisibleSelector = "minVisible";
  17030. var maxVisibleSelector = "maxVisible";
  17031. var baseSelector = "base";
  17032. var axisTypeSelector = "axisType";
  17033. function otherLessThan(thisValue, otherValue) {
  17034. return otherValue < thisValue
  17035. }
  17036. function otherGreaterThan(thisValue, otherValue) {
  17037. return otherValue > thisValue
  17038. }
  17039. function compareAndReplace(thisValue, otherValue, setValue, compare) {
  17040. var otherValueDefined = _isDefined(otherValue);
  17041. if (_isDefined(thisValue)) {
  17042. if (otherValueDefined && compare(thisValue, otherValue)) {
  17043. setValue(otherValue)
  17044. }
  17045. } else {
  17046. if (otherValueDefined) {
  17047. setValue(otherValue)
  17048. }
  17049. }
  17050. }
  17051. var _Range = exports.Range = function(range) {
  17052. range && extend(this, range)
  17053. };
  17054. _Range.prototype = {
  17055. constructor: _Range,
  17056. addRange: function(otherRange) {
  17057. var that = this;
  17058. var categories = that.categories;
  17059. var otherCategories = otherRange.categories;
  17060. var compareAndReplaceByField = function(field, compare) {
  17061. compareAndReplace(that[field], otherRange[field], function(value) {
  17062. that[field] = value
  17063. }, compare)
  17064. };
  17065. var controlValuesByVisibleBounds = function(valueField, visibleValueField, compare) {
  17066. compareAndReplace(that[valueField], that[visibleValueField], function(value) {
  17067. _isDefined(that[valueField]) && (that[valueField] = value)
  17068. }, compare)
  17069. };
  17070. var checkField = function(field) {
  17071. that[field] = that[field] || otherRange[field]
  17072. };
  17073. checkField("invert");
  17074. checkField(axisTypeSelector);
  17075. checkField("dataType");
  17076. checkField("isSpacedMargin"), checkField("checkMinDataVisibility");
  17077. checkField("checkMaxDataVisibility");
  17078. if ("logarithmic" === that[axisTypeSelector]) {
  17079. checkField(baseSelector)
  17080. } else {
  17081. that[baseSelector] = void 0
  17082. }
  17083. compareAndReplaceByField(minSelector, otherLessThan);
  17084. compareAndReplaceByField(maxSelector, otherGreaterThan);
  17085. if ("discrete" === that[axisTypeSelector]) {
  17086. checkField(minVisibleSelector);
  17087. checkField(maxVisibleSelector)
  17088. } else {
  17089. compareAndReplaceByField(minVisibleSelector, otherLessThan);
  17090. compareAndReplaceByField(maxVisibleSelector, otherGreaterThan)
  17091. }
  17092. compareAndReplaceByField("interval", otherLessThan);
  17093. controlValuesByVisibleBounds(minSelector, minVisibleSelector, otherLessThan);
  17094. controlValuesByVisibleBounds(minSelector, maxVisibleSelector, otherLessThan);
  17095. controlValuesByVisibleBounds(maxSelector, maxVisibleSelector, otherGreaterThan);
  17096. controlValuesByVisibleBounds(maxSelector, minVisibleSelector, otherGreaterThan);
  17097. if (void 0 === categories) {
  17098. that.categories = otherCategories
  17099. } else {
  17100. that.categories = otherCategories ? unique(categories.concat(otherCategories)) : categories
  17101. }
  17102. return that
  17103. },
  17104. isEmpty: function() {
  17105. return (!_isDefined(this[minSelector]) || !_isDefined(this[maxSelector])) && (!this.categories || 0 === this.categories.length)
  17106. },
  17107. correctValueZeroLevel: function() {
  17108. var that = this;
  17109. if ("logarithmic" === that[axisTypeSelector] || _isDate(that[maxSelector]) || _isDate(that[minSelector])) {
  17110. return that
  17111. }
  17112. function setZeroLevel(min, max) {
  17113. that[min] < 0 && that[max] < 0 && (that[max] = 0);
  17114. that[min] > 0 && that[max] > 0 && (that[min] = 0)
  17115. }
  17116. setZeroLevel(minSelector, maxSelector);
  17117. setZeroLevel(minVisibleSelector, maxVisibleSelector);
  17118. return that
  17119. },
  17120. sortCategories: function(sort) {
  17121. if (false === sort || !this.categories) {
  17122. return
  17123. }
  17124. if (Array.isArray(sort)) {
  17125. var sortValues = sort.map(function(item) {
  17126. return item.valueOf()
  17127. });
  17128. var filteredSeriesCategories = this.categories.filter(function(item) {
  17129. return sortValues.indexOf(item.valueOf()) === -1
  17130. });
  17131. this.categories = sort.concat(filteredSeriesCategories)
  17132. } else {
  17133. var notAFunction = !_isFunction(sort);
  17134. if (notAFunction && "string" !== this.dataType) {
  17135. sort = function(a, b) {
  17136. return a.valueOf() - b.valueOf()
  17137. }
  17138. } else {
  17139. if (notAFunction) {
  17140. sort = false
  17141. }
  17142. }
  17143. sort && this.categories.sort(sort)
  17144. }
  17145. }
  17146. }
  17147. },
  17148. /*!**********************************************************!*\
  17149. !*** ./artifacts/transpiled/ui/widget/empty_template.js ***!
  17150. \**********************************************************/
  17151. /*! dynamic exports provided */
  17152. /*! all exports used */
  17153. function(module, exports, __webpack_require__) {
  17154. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  17155. var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
  17156. var EmptyTemplate = TemplateBase.inherit({
  17157. _renderCore: function() {
  17158. return $()
  17159. }
  17160. });
  17161. module.exports = EmptyTemplate
  17162. },
  17163. /*!**************************************************!*\
  17164. !*** ./artifacts/transpiled/data/odata/utils.js ***!
  17165. \**************************************************/
  17166. /*! dynamic exports provided */
  17167. /*! all exports used */
  17168. function(module, exports, __webpack_require__) {
  17169. function _typeof(obj) {
  17170. "@babel/helpers - typeof";
  17171. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  17172. return typeof obj
  17173. } : function(obj) {
  17174. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  17175. }, _typeof(obj)
  17176. }
  17177. var Class = __webpack_require__( /*! ../../core/class */ 15);
  17178. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  17179. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  17180. var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  17181. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  17182. var ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58);
  17183. var _Guid = __webpack_require__( /*! ../../core/guid */ 40);
  17184. var isDefined = typeUtils.isDefined;
  17185. var isPlainObject = typeUtils.isPlainObject;
  17186. var grep = __webpack_require__( /*! ../../core/utils/common */ 4).grep;
  17187. var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred;
  17188. var errors = __webpack_require__( /*! ../errors */ 36).errors;
  17189. var dataUtils = __webpack_require__( /*! ../utils */ 41);
  17190. var GUID_REGEX = /^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$/;
  17191. var VERBOSE_DATE_REGEX = /^\/Date\((-?\d+)((\+|-)?(\d+)?)\)\/$/;
  17192. var ISO8601_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[-+]{1}\d{2}(:?)(\d{2})?)?$/;
  17193. var JSON_VERBOSE_MIME_TYPE = "application/json;odata=verbose";
  17194. var makeArray = function(value) {
  17195. return "string" === typeUtils.type(value) ? value.split() : value
  17196. };
  17197. var hasDot = function(x) {
  17198. return /\./.test(x)
  17199. };
  17200. var pad = function(text, length, right) {
  17201. text = String(text);
  17202. while (text.length < length) {
  17203. text = right ? text + "0" : "0" + text
  17204. }
  17205. return text
  17206. };
  17207. function formatISO8601(date, skipZeroTime, skipTimezone) {
  17208. var bag = [];
  17209. var isZeroTime = function() {
  17210. return date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds() < 1
  17211. };
  17212. var padLeft2 = function(text) {
  17213. return pad(text, 2)
  17214. };
  17215. bag.push(date.getFullYear());
  17216. bag.push("-");
  17217. bag.push(padLeft2(date.getMonth() + 1));
  17218. bag.push("-");
  17219. bag.push(padLeft2(date.getDate()));
  17220. if (!(skipZeroTime && isZeroTime())) {
  17221. bag.push("T");
  17222. bag.push(padLeft2(date.getHours()));
  17223. bag.push(":");
  17224. bag.push(padLeft2(date.getMinutes()));
  17225. bag.push(":");
  17226. bag.push(padLeft2(date.getSeconds()));
  17227. if (date.getMilliseconds()) {
  17228. bag.push(".");
  17229. bag.push(pad(date.getMilliseconds(), 3))
  17230. }
  17231. if (!skipTimezone) {
  17232. bag.push("Z")
  17233. }
  17234. }
  17235. return bag.join("")
  17236. }
  17237. function parseISO8601(isoString) {
  17238. var result = new Date(60 * new Date(0).getTimezoneOffset() * 1e3);
  17239. var chunks = isoString.replace("Z", "").split("T");
  17240. var date = /(\d{4})-(\d{2})-(\d{2})/.exec(chunks[0]);
  17241. var time = /(\d{2}):(\d{2}):(\d{2})\.?(\d{0,7})?/.exec(chunks[1]);
  17242. result.setFullYear(Number(date[1]));
  17243. result.setMonth(Number(date[2]) - 1);
  17244. result.setDate(Number(date[3]));
  17245. if (Array.isArray(time) && time.length) {
  17246. result.setHours(Number(time[1]));
  17247. result.setMinutes(Number(time[2]));
  17248. result.setSeconds(Number(time[3]));
  17249. var fractional = (time[4] || "").slice(0, 3);
  17250. fractional = pad(fractional, 3, true);
  17251. result.setMilliseconds(Number(fractional))
  17252. }
  17253. return result
  17254. }
  17255. function isAbsoluteUrl(url) {
  17256. return /^(?:[a-z]+:)?\/\//i.test(url)
  17257. }
  17258. function toAbsoluteUrl(basePath, relativePath) {
  17259. var part;
  17260. var baseParts = stripParams(basePath).split("/");
  17261. var relativeParts = relativePath.split("/");
  17262. function stripParams(url) {
  17263. var index = url.indexOf("?");
  17264. if (index > -1) {
  17265. return url.substr(0, index)
  17266. }
  17267. return url
  17268. }
  17269. baseParts.pop();
  17270. while (relativeParts.length) {
  17271. part = relativeParts.shift();
  17272. if (".." === part) {
  17273. baseParts.pop()
  17274. } else {
  17275. baseParts.push(part)
  17276. }
  17277. }
  17278. return baseParts.join("/")
  17279. }
  17280. var param = function(params) {
  17281. var result = [];
  17282. for (var name in params) {
  17283. result.push(name + "=" + params[name])
  17284. }
  17285. return result.join("&")
  17286. };
  17287. var ajaxOptionsForRequest = function(protocolVersion, request, options) {
  17288. request = extend({
  17289. async: true,
  17290. method: "get",
  17291. url: "",
  17292. params: {},
  17293. payload: null,
  17294. headers: {},
  17295. timeout: 3e4
  17296. }, request);
  17297. options = options || {};
  17298. var beforeSend = options.beforeSend;
  17299. if (beforeSend) {
  17300. beforeSend(request)
  17301. }
  17302. var method = (request.method || "get").toLowerCase();
  17303. var isGet = "get" === method;
  17304. var useJsonp = isGet && options.jsonp;
  17305. var params = extend({}, request.params);
  17306. var ajaxData = isGet ? params : formatPayload(request.payload);
  17307. var qs = !isGet && param(params);
  17308. var url = request.url;
  17309. var contentType = !isGet && JSON_VERBOSE_MIME_TYPE;
  17310. if (qs) {
  17311. url += (url.indexOf("?") > -1 ? "&" : "?") + qs
  17312. }
  17313. if (useJsonp) {
  17314. ajaxData.$format = "json"
  17315. }
  17316. return {
  17317. url: url,
  17318. data: ajaxData,
  17319. dataType: useJsonp ? "jsonp" : "json",
  17320. jsonp: useJsonp && "$callback",
  17321. method: method,
  17322. async: request.async,
  17323. timeout: request.timeout,
  17324. headers: request.headers,
  17325. contentType: contentType,
  17326. accepts: {
  17327. json: [JSON_VERBOSE_MIME_TYPE, "text/plain"].join()
  17328. },
  17329. xhrFields: {
  17330. withCredentials: options.withCredentials
  17331. }
  17332. };
  17333. function formatPayload(payload) {
  17334. return JSON.stringify(payload, function(key, value) {
  17335. if (!(this[key] instanceof Date)) {
  17336. return value
  17337. }
  17338. value = formatISO8601(this[key]);
  17339. switch (protocolVersion) {
  17340. case 2:
  17341. return value.substr(0, value.length - 1);
  17342. case 3:
  17343. case 4:
  17344. return value;
  17345. default:
  17346. throw errors.Error("E4002")
  17347. }
  17348. })
  17349. }
  17350. };
  17351. var sendRequest = function sendRequest(protocolVersion, request, options) {
  17352. var d = new Deferred;
  17353. var ajaxOptions = ajaxOptionsForRequest(protocolVersion, request, options);
  17354. ajax.sendRequest(ajaxOptions).always(function(obj, textStatus) {
  17355. var transformOptions = {
  17356. deserializeDates: options.deserializeDates,
  17357. fieldTypes: options.fieldTypes
  17358. };
  17359. var tuple = interpretJsonFormat(obj, textStatus, transformOptions, ajaxOptions);
  17360. var error = tuple.error;
  17361. var data = tuple.data;
  17362. var nextUrl = tuple.nextUrl;
  17363. var extra;
  17364. if (error) {
  17365. if (error.message !== dataUtils.XHR_ERROR_UNLOAD) {
  17366. d.reject(error)
  17367. }
  17368. } else {
  17369. if (options.countOnly) {
  17370. if (isFinite(tuple.count)) {
  17371. d.resolve(tuple.count)
  17372. } else {
  17373. d.reject(new errors.Error("E4018"))
  17374. }
  17375. } else {
  17376. if (nextUrl && !options.isPaged) {
  17377. if (!isAbsoluteUrl(nextUrl)) {
  17378. nextUrl = toAbsoluteUrl(ajaxOptions.url, nextUrl)
  17379. }
  17380. sendRequest(protocolVersion, {
  17381. url: nextUrl
  17382. }, options).fail(d.reject).done(function(nextData) {
  17383. d.resolve(data.concat(nextData))
  17384. })
  17385. } else {
  17386. if (isFinite(tuple.count)) {
  17387. extra = {
  17388. totalCount: tuple.count
  17389. }
  17390. }
  17391. d.resolve(data, extra)
  17392. }
  17393. }
  17394. }
  17395. });
  17396. return d.promise()
  17397. };
  17398. var formatDotNetError = function(errorObj) {
  17399. var message;
  17400. var currentError = errorObj;
  17401. if ("message" in errorObj) {
  17402. if (errorObj.message.value) {
  17403. message = errorObj.message.value
  17404. } else {
  17405. message = errorObj.message
  17406. }
  17407. }
  17408. while (currentError = currentError.innererror || currentError.internalexception) {
  17409. message = currentError.message;
  17410. if (currentError.internalexception && message.indexOf("inner exception") === -1) {
  17411. break
  17412. }
  17413. }
  17414. return message
  17415. };
  17416. var errorFromResponse = function(obj, textStatus, ajaxOptions) {
  17417. if ("nocontent" === textStatus) {
  17418. return null
  17419. }
  17420. var message = "Unknown error";
  17421. var response = obj;
  17422. var httpStatus = 200;
  17423. var errorData = {
  17424. requestOptions: ajaxOptions
  17425. };
  17426. if ("success" !== textStatus) {
  17427. httpStatus = obj.status;
  17428. message = dataUtils.errorMessageFromXhr(obj, textStatus);
  17429. try {
  17430. response = JSON.parse(obj.responseText)
  17431. } catch (x) {}
  17432. }
  17433. var errorObj = response && (response.then && response || response.error || response["odata.error"] || response["@odata.error"]);
  17434. if (errorObj) {
  17435. message = formatDotNetError(errorObj) || message;
  17436. errorData.errorDetails = errorObj;
  17437. if (200 === httpStatus) {
  17438. httpStatus = 500
  17439. }
  17440. var customCode = Number(errorObj.code);
  17441. if (isFinite(customCode) && customCode >= 400) {
  17442. httpStatus = customCode
  17443. }
  17444. }
  17445. if (httpStatus >= 400 || 0 === httpStatus) {
  17446. errorData.httpStatus = httpStatus;
  17447. return extend(Error(message), errorData)
  17448. }
  17449. return null
  17450. };
  17451. var interpretJsonFormat = function(obj, textStatus, transformOptions, ajaxOptions) {
  17452. var error = errorFromResponse(obj, textStatus, ajaxOptions);
  17453. var value;
  17454. if (error) {
  17455. return {
  17456. error: error
  17457. }
  17458. }
  17459. if (!isPlainObject(obj)) {
  17460. return {
  17461. data: obj
  17462. }
  17463. }
  17464. if ("d" in obj && (Array.isArray(obj.d) || typeUtils.isObject(obj.d))) {
  17465. value = interpretVerboseJsonFormat(obj, textStatus)
  17466. } else {
  17467. value = interpretLightJsonFormat(obj, textStatus)
  17468. }
  17469. transformTypes(value, transformOptions);
  17470. return value
  17471. };
  17472. var interpretVerboseJsonFormat = function(obj) {
  17473. var data = obj.d;
  17474. if (!isDefined(data)) {
  17475. return {
  17476. error: Error("Malformed or unsupported JSON response received")
  17477. }
  17478. }
  17479. if (isDefined(data.results)) {
  17480. data = data.results
  17481. }
  17482. return {
  17483. data: data,
  17484. nextUrl: obj.d.__next,
  17485. count: parseInt(obj.d.__count, 10)
  17486. }
  17487. };
  17488. var interpretLightJsonFormat = function(obj) {
  17489. var data = obj;
  17490. if (isDefined(data.value)) {
  17491. data = data.value
  17492. }
  17493. return {
  17494. data: data,
  17495. nextUrl: obj["@odata.nextLink"],
  17496. count: parseInt(obj["@odata.count"], 10)
  17497. }
  17498. };
  17499. var EdmLiteral = Class.inherit({
  17500. ctor: function(value) {
  17501. this._value = value
  17502. },
  17503. valueOf: function() {
  17504. return this._value
  17505. }
  17506. });
  17507. var transformTypes = function transformTypes(obj, options) {
  17508. options = options || {};
  17509. each(obj, function(key, value) {
  17510. if (null !== value && "object" === _typeof(value)) {
  17511. if ("results" in value) {
  17512. obj[key] = value.results
  17513. }
  17514. transformTypes(obj[key], options)
  17515. } else {
  17516. if ("string" === typeof value) {
  17517. var fieldTypes = options.fieldTypes;
  17518. var canBeGuid = !fieldTypes || "String" !== fieldTypes[key];
  17519. if (canBeGuid && GUID_REGEX.test(value)) {
  17520. obj[key] = new _Guid(value)
  17521. }
  17522. if (false !== options.deserializeDates) {
  17523. if (value.match(VERBOSE_DATE_REGEX)) {
  17524. var date = new Date(Number(RegExp.$1) + 60 * RegExp.$2 * 1e3);
  17525. obj[key] = new Date(date.valueOf() + 60 * date.getTimezoneOffset() * 1e3)
  17526. } else {
  17527. if (ISO8601_DATE_REGEX.test(value)) {
  17528. obj[key] = new Date(parseISO8601(obj[key]).valueOf())
  17529. }
  17530. }
  17531. }
  17532. }
  17533. }
  17534. })
  17535. };
  17536. var serializeDate = function(date) {
  17537. return "datetime'" + formatISO8601(date, true, true) + "'"
  17538. };
  17539. var serializeString = function(value) {
  17540. return "'" + value.replace(/'/g, "''") + "'"
  17541. };
  17542. var serializePropName = function(propName) {
  17543. if (propName instanceof EdmLiteral) {
  17544. return propName.valueOf()
  17545. }
  17546. return propName.replace(/\./g, "/")
  17547. };
  17548. var serializeValueV4 = function serializeValueV4(value) {
  17549. if (value instanceof Date) {
  17550. return formatISO8601(value, false, false)
  17551. }
  17552. if (value instanceof _Guid) {
  17553. return value.valueOf()
  17554. }
  17555. if (Array.isArray(value)) {
  17556. return "[" + value.map(function(item) {
  17557. return serializeValueV4(item)
  17558. }).join(",") + "]"
  17559. }
  17560. return serializeValueV2(value)
  17561. };
  17562. var serializeValueV2 = function(value) {
  17563. if (value instanceof Date) {
  17564. return serializeDate(value)
  17565. }
  17566. if (value instanceof _Guid) {
  17567. return "guid'" + value + "'"
  17568. }
  17569. if (value instanceof EdmLiteral) {
  17570. return value.valueOf()
  17571. }
  17572. if ("string" === typeof value) {
  17573. return serializeString(value)
  17574. }
  17575. return String(value)
  17576. };
  17577. var serializeValue = function(value, protocolVersion) {
  17578. switch (protocolVersion) {
  17579. case 2:
  17580. case 3:
  17581. return serializeValueV2(value);
  17582. case 4:
  17583. return serializeValueV4(value);
  17584. default:
  17585. throw errors.Error("E4002")
  17586. }
  17587. };
  17588. var serializeKey = function(key, protocolVersion) {
  17589. if (isPlainObject(key)) {
  17590. var parts = [];
  17591. each(key, function(k, v) {
  17592. parts.push(serializePropName(k) + "=" + serializeValue(v, protocolVersion))
  17593. });
  17594. return parts.join()
  17595. }
  17596. return serializeValue(key, protocolVersion)
  17597. };
  17598. var keyConverters = {
  17599. String: function(value) {
  17600. return value + ""
  17601. },
  17602. Int32: function(value) {
  17603. return Math.floor(value)
  17604. },
  17605. Int64: function(value) {
  17606. if (value instanceof EdmLiteral) {
  17607. return value
  17608. }
  17609. return new EdmLiteral(value + "L")
  17610. },
  17611. Guid: function(value) {
  17612. if (value instanceof _Guid) {
  17613. return value
  17614. }
  17615. return new _Guid(value)
  17616. },
  17617. Boolean: function(value) {
  17618. return !!value
  17619. },
  17620. Single: function(value) {
  17621. if (value instanceof EdmLiteral) {
  17622. return value
  17623. }
  17624. return new EdmLiteral(value + "f")
  17625. },
  17626. Decimal: function(value) {
  17627. if (value instanceof EdmLiteral) {
  17628. return value
  17629. }
  17630. return new EdmLiteral(value + "m")
  17631. }
  17632. };
  17633. var convertPrimitiveValue = function(type, value) {
  17634. if (null === value) {
  17635. return null
  17636. }
  17637. var converter = keyConverters[type];
  17638. if (!converter) {
  17639. throw errors.Error("E4014", type)
  17640. }
  17641. return converter(value)
  17642. };
  17643. var generateSelect = function(oDataVersion, select) {
  17644. if (!select) {
  17645. return
  17646. }
  17647. if (oDataVersion < 4) {
  17648. return serializePropName(select.join())
  17649. }
  17650. return grep(select, hasDot, true).join()
  17651. };
  17652. var generateExpand = function(oDataVersion, expand, select) {
  17653. var generatorV2 = function() {
  17654. var hash = {};
  17655. if (expand) {
  17656. iteratorUtils.each(makeArray(expand), function() {
  17657. hash[serializePropName(this)] = 1
  17658. })
  17659. }
  17660. if (select) {
  17661. iteratorUtils.each(makeArray(select), function() {
  17662. var path = this.split(".");
  17663. if (path.length < 2) {
  17664. return
  17665. }
  17666. path.pop();
  17667. hash[serializePropName(path.join("."))] = 1
  17668. })
  17669. }
  17670. return iteratorUtils.map(hash, function(k, v) {
  17671. return v
  17672. }).join()
  17673. };
  17674. var generatorV4 = function() {
  17675. var format = function(hash) {
  17676. var formatCore = function formatCore(hash) {
  17677. var result = "";
  17678. var selectValue = [];
  17679. var expandValue = [];
  17680. iteratorUtils.each(hash, function(key, value) {
  17681. if (Array.isArray(value)) {
  17682. [].push.apply(selectValue, value)
  17683. }
  17684. if (isPlainObject(value)) {
  17685. expandValue.push(key + formatCore(value))
  17686. }
  17687. });
  17688. if (selectValue.length || expandValue.length) {
  17689. result += "(";
  17690. if (selectValue.length) {
  17691. result += "$select=" + iteratorUtils.map(selectValue, serializePropName).join()
  17692. }
  17693. if (expandValue.length) {
  17694. if (selectValue.length) {
  17695. result += ";"
  17696. }
  17697. result += "$expand=" + iteratorUtils.map(expandValue, serializePropName).join()
  17698. }
  17699. result += ")"
  17700. }
  17701. return result
  17702. };
  17703. var result = [];
  17704. iteratorUtils.each(hash, function(key, value) {
  17705. result.push(key + formatCore(value))
  17706. });
  17707. return result.join()
  17708. };
  17709. var parseTree = function(exprs, root, stepper) {
  17710. var parseCore = function parseCore(exprParts, root, stepper) {
  17711. var result = stepper(root, exprParts.shift(), exprParts);
  17712. if (false === result) {
  17713. return
  17714. }
  17715. parseCore(exprParts, result, stepper)
  17716. };
  17717. iteratorUtils.each(exprs, function(_, x) {
  17718. parseCore(x.split("."), root, stepper)
  17719. })
  17720. };
  17721. var hash = {};
  17722. if (expand || select) {
  17723. if (expand) {
  17724. parseTree(makeArray(expand), hash, function(node, key, path) {
  17725. node[key] = node[key] || {};
  17726. if (!path.length) {
  17727. return false
  17728. }
  17729. return node[key]
  17730. })
  17731. }
  17732. if (select) {
  17733. parseTree(grep(makeArray(select), hasDot), hash, function(node, key, path) {
  17734. if (!path.length) {
  17735. node[key] = node[key] || [];
  17736. node[key].push(key);
  17737. return false
  17738. }
  17739. return node[key] = node[key] || {}
  17740. })
  17741. }
  17742. return format(hash)
  17743. }
  17744. };
  17745. if (oDataVersion < 4) {
  17746. return generatorV2()
  17747. }
  17748. return generatorV4()
  17749. };
  17750. exports.sendRequest = sendRequest;
  17751. exports.serializePropName = serializePropName;
  17752. exports.serializeValue = serializeValue;
  17753. exports.serializeKey = serializeKey;
  17754. exports.keyConverters = keyConverters;
  17755. exports.convertPrimitiveValue = convertPrimitiveValue;
  17756. exports.generateExpand = generateExpand;
  17757. exports.generateSelect = generateSelect;
  17758. exports.EdmLiteral = EdmLiteral;
  17759. exports.OData__internals = {
  17760. interpretJsonFormat: interpretJsonFormat
  17761. }
  17762. },
  17763. /*!*********************************************!*\
  17764. !*** ./artifacts/transpiled/core/action.js ***!
  17765. \*********************************************/
  17766. /*! dynamic exports provided */
  17767. /*! all exports used */
  17768. function(module, exports, __webpack_require__) {
  17769. var $ = __webpack_require__( /*! ./renderer */ 2);
  17770. var config = __webpack_require__( /*! ./config */ 31);
  17771. var window = __webpack_require__( /*! ./utils/window */ 7).getWindow();
  17772. var typeUtils = __webpack_require__( /*! ./utils/type */ 1);
  17773. var each = __webpack_require__( /*! ./utils/iterator */ 3).each;
  17774. var Class = __webpack_require__( /*! ./class */ 15);
  17775. var errors = __webpack_require__( /*! ./errors */ 21);
  17776. var Action = Class.inherit({
  17777. ctor: function(action, config) {
  17778. config = config || {};
  17779. this._action = action;
  17780. this._context = config.context || window;
  17781. this._beforeExecute = config.beforeExecute;
  17782. this._afterExecute = config.afterExecute;
  17783. this._component = config.component;
  17784. this._validatingTargetName = config.validatingTargetName;
  17785. var excludeValidators = this._excludeValidators = {};
  17786. if (config.excludeValidators) {
  17787. for (var i = 0; i < config.excludeValidators.length; i++) {
  17788. excludeValidators[config.excludeValidators[i]] = true
  17789. }
  17790. }
  17791. },
  17792. execute: function() {
  17793. var e = {
  17794. action: this._action,
  17795. args: Array.prototype.slice.call(arguments),
  17796. context: this._context,
  17797. component: this._component,
  17798. validatingTargetName: this._validatingTargetName,
  17799. cancel: false,
  17800. handled: false
  17801. };
  17802. var beforeExecute = this._beforeExecute;
  17803. var afterExecute = this._afterExecute;
  17804. var argsBag = e.args[0] || {};
  17805. if ("jQueryEvent" in argsBag && !argsBag.event) {
  17806. throw "The jQueryEvent field is deprecated. Please, use the `event` field instead"
  17807. }
  17808. if (!("jQueryEvent" in argsBag) && argsBag.event && config().useJQuery) {
  17809. Object.defineProperty(argsBag, "jQueryEvent", {
  17810. get: function() {
  17811. errors.log("W0003", "Handler argument", "jQueryEvent", "17.2", "Use the 'event' field instead");
  17812. return argsBag.event
  17813. },
  17814. set: function(value) {
  17815. errors.log("W0003", "Handler argument", "jQueryEvent", "17.2", "Use the 'event' field instead");
  17816. argsBag.event = value
  17817. }
  17818. })
  17819. }
  17820. if (!this._validateAction(e)) {
  17821. return
  17822. }
  17823. beforeExecute && beforeExecute.call(this._context, e);
  17824. if (e.cancel) {
  17825. return
  17826. }
  17827. var result = this._executeAction(e);
  17828. if (argsBag.cancel) {
  17829. return
  17830. }
  17831. afterExecute && afterExecute.call(this._context, e);
  17832. return result
  17833. },
  17834. _validateAction: function(e) {
  17835. var excludeValidators = this._excludeValidators;
  17836. var executors = Action.executors;
  17837. for (var name in executors) {
  17838. if (!excludeValidators[name]) {
  17839. var executor = executors[name];
  17840. if (executor.validate) {
  17841. executor.validate(e)
  17842. }
  17843. if (e.cancel) {
  17844. return false
  17845. }
  17846. }
  17847. }
  17848. return true
  17849. },
  17850. _executeAction: function(e) {
  17851. var result;
  17852. var executors = Action.executors;
  17853. for (var name in executors) {
  17854. var executor = executors[name];
  17855. if (executor.execute) {
  17856. executor.execute(e)
  17857. }
  17858. if (e.handled) {
  17859. result = e.result;
  17860. break
  17861. }
  17862. }
  17863. return result
  17864. }
  17865. });
  17866. Action.executors = {};
  17867. Action.registerExecutor = function(name, executor) {
  17868. if (typeUtils.isPlainObject(name)) {
  17869. each(name, Action.registerExecutor);
  17870. return
  17871. }
  17872. Action.executors[name] = executor
  17873. };
  17874. Action.unregisterExecutor = function() {
  17875. var args = [].slice.call(arguments);
  17876. each(args, function() {
  17877. delete Action.executors[this]
  17878. })
  17879. };
  17880. Action.registerExecutor({
  17881. undefined: {
  17882. execute: function(e) {
  17883. if (!e.action) {
  17884. e.result = void 0;
  17885. e.handled = true
  17886. }
  17887. }
  17888. },
  17889. func: {
  17890. execute: function(e) {
  17891. if (typeUtils.isFunction(e.action)) {
  17892. e.result = e.action.call(e.context, e.args[0]);
  17893. e.handled = true
  17894. }
  17895. }
  17896. }
  17897. });
  17898. var createValidatorByTargetElement = function(condition) {
  17899. return function(e) {
  17900. if (!e.args.length) {
  17901. return
  17902. }
  17903. var args = e.args[0];
  17904. var element = args[e.validatingTargetName] || args.element;
  17905. if (element && condition($(element))) {
  17906. e.cancel = true
  17907. }
  17908. }
  17909. };
  17910. Action.registerExecutor({
  17911. disabled: {
  17912. validate: createValidatorByTargetElement(function($target) {
  17913. return $target.is(".dx-state-disabled, .dx-state-disabled *")
  17914. })
  17915. },
  17916. readOnly: {
  17917. validate: createValidatorByTargetElement(function($target) {
  17918. return $target.is(".dx-state-readonly, .dx-state-readonly *")
  17919. })
  17920. }
  17921. });
  17922. module.exports = Action
  17923. },
  17924. /*!*************************************************!*\
  17925. !*** ./artifacts/transpiled/animation/frame.js ***!
  17926. \*************************************************/
  17927. /*! dynamic exports provided */
  17928. /*! all exports used */
  17929. function(module, exports, __webpack_require__) {
  17930. var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
  17931. var window = windowUtils.hasWindow() ? windowUtils.getWindow() : {};
  17932. var callOnce = __webpack_require__( /*! ../core/utils/call_once */ 63);
  17933. var FRAME_ANIMATION_STEP_TIME = 1e3 / 60;
  17934. var request = function(callback) {
  17935. return setTimeout(callback, FRAME_ANIMATION_STEP_TIME)
  17936. };
  17937. var cancel = function(requestID) {
  17938. clearTimeout(requestID)
  17939. };
  17940. var setAnimationFrameMethods = callOnce(function() {
  17941. var nativeRequest = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame;
  17942. var nativeCancel = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame;
  17943. if (nativeRequest && nativeCancel) {
  17944. request = nativeRequest;
  17945. cancel = nativeCancel
  17946. }
  17947. if (nativeRequest && !nativeCancel) {
  17948. var canceledRequests = {};
  17949. request = function(callback) {
  17950. var requestId = nativeRequest.call(window, function() {
  17951. try {
  17952. if (requestId in canceledRequests) {
  17953. return
  17954. }
  17955. callback.apply(this, arguments)
  17956. } finally {
  17957. delete canceledRequests[requestId]
  17958. }
  17959. });
  17960. return requestId
  17961. };
  17962. cancel = function(requestId) {
  17963. canceledRequests[requestId] = true
  17964. }
  17965. }
  17966. });
  17967. exports.requestAnimationFrame = function() {
  17968. setAnimationFrameMethods();
  17969. return request.apply(window, arguments)
  17970. };
  17971. exports.cancelAnimationFrame = function() {
  17972. setAnimationFrameMethods();
  17973. cancel.apply(window, arguments)
  17974. }
  17975. }, , , , ,
  17976. /*!*******************************************************!*\
  17977. !*** ./artifacts/transpiled/viz/components/consts.js ***!
  17978. \*******************************************************/
  17979. /*! dynamic exports provided */
  17980. /*! all exports used */
  17981. function(module, exports, __webpack_require__) {
  17982. module.exports = {
  17983. events: {
  17984. mouseover: "mouseover",
  17985. mouseout: "mouseout",
  17986. mousemove: "mousemove",
  17987. touchstart: "touchstart",
  17988. touchmove: "touchmove",
  17989. touchend: "touchend",
  17990. mousedown: "mousedown",
  17991. mouseup: "mouseup",
  17992. click: "click",
  17993. selectSeries: "selectseries",
  17994. deselectSeries: "deselectseries",
  17995. selectPoint: "selectpoint",
  17996. deselectPoint: "deselectpoint",
  17997. showPointTooltip: "showpointtooltip",
  17998. hidePointTooltip: "hidepointtooltip"
  17999. },
  18000. states: {
  18001. hover: "hover",
  18002. normal: "normal",
  18003. selection: "selection",
  18004. normalMark: 0,
  18005. hoverMark: 1,
  18006. selectedMark: 2,
  18007. applyHover: "applyHover",
  18008. applySelected: "applySelected",
  18009. resetItem: "resetItem"
  18010. },
  18011. radialLabelIndent: 30,
  18012. pieLabelSpacing: 10,
  18013. pieSeriesSpacing: 4
  18014. }
  18015. },
  18016. /*!****************************************************************!*\
  18017. !*** ./artifacts/transpiled/viz/series/points/symbol_point.js ***!
  18018. \****************************************************************/
  18019. /*! dynamic exports provided */
  18020. /*! all exports used */
  18021. function(module, exports, __webpack_require__) {
  18022. var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
  18023. var each = __webpack_require__( /*! ../../../core/utils/iterator */ 3).each;
  18024. var noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop;
  18025. var windowUtils = __webpack_require__( /*! ../../../core/utils/window */ 7);
  18026. var window = windowUtils.getWindow();
  18027. var labelModule = __webpack_require__( /*! ./label */ 246);
  18028. var _extend = extend;
  18029. var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
  18030. var _normalizeEnum = __webpack_require__( /*! ../../core/utils */ 10).normalizeEnum;
  18031. var _math = Math;
  18032. var _round = _math.round;
  18033. var _floor = _math.floor;
  18034. var _ceil = _math.ceil;
  18035. var DEFAULT_IMAGE_WIDTH = 20;
  18036. var DEFAULT_IMAGE_HEIGHT = 20;
  18037. var LABEL_OFFSET = 10;
  18038. var CANVAS_POSITION_DEFAULT = "canvas_position_default";
  18039. function getSquareMarkerCoords(radius) {
  18040. return [-radius, -radius, radius, -radius, radius, radius, -radius, radius, -radius, -radius]
  18041. }
  18042. function getPolygonMarkerCoords(radius) {
  18043. var r = _ceil(radius);
  18044. return [-r, 0, 0, -r, r, 0, 0, r, -r, 0]
  18045. }
  18046. function getCrossMarkerCoords(radius) {
  18047. var r = _ceil(radius);
  18048. var floorHalfRadius = _floor(r / 2);
  18049. var ceilHalfRadius = _ceil(r / 2);
  18050. return [-r, -floorHalfRadius, -floorHalfRadius, -r, 0, -ceilHalfRadius, floorHalfRadius, -r, r, -floorHalfRadius, ceilHalfRadius, 0, r, floorHalfRadius, floorHalfRadius, r, 0, ceilHalfRadius, -floorHalfRadius, r, -r, floorHalfRadius, -ceilHalfRadius, 0]
  18051. }
  18052. function getTriangleDownMarkerCoords(radius) {
  18053. return [-radius, -radius, radius, -radius, 0, radius, -radius, -radius]
  18054. }
  18055. function getTriangleUpMarkerCoords(radius) {
  18056. return [-radius, radius, radius, radius, 0, -radius, -radius, radius]
  18057. }
  18058. module.exports = {
  18059. deleteLabel: function() {
  18060. this._label.dispose();
  18061. this._label = null
  18062. },
  18063. _hasGraphic: function() {
  18064. return this.graphic
  18065. },
  18066. clearVisibility: function() {
  18067. var that = this;
  18068. var graphic = that.graphic;
  18069. if (graphic && graphic.attr("visibility")) {
  18070. graphic.attr({
  18071. visibility: null
  18072. })
  18073. }
  18074. },
  18075. isVisible: function() {
  18076. return this.inVisibleArea && this.series.isVisible()
  18077. },
  18078. setInvisibility: function() {
  18079. var that = this;
  18080. var graphic = that.graphic;
  18081. if (graphic && "hidden" !== graphic.attr("visibility")) {
  18082. graphic.attr({
  18083. visibility: "hidden"
  18084. })
  18085. }
  18086. that._errorBar && that._errorBar.attr({
  18087. visibility: "hidden"
  18088. });
  18089. that._label.draw(false)
  18090. },
  18091. clearMarker: function() {
  18092. var graphic = this.graphic;
  18093. graphic && graphic.attr(this._emptySettings)
  18094. },
  18095. _createLabel: function() {
  18096. this._label = new labelModule.Label({
  18097. renderer: this.series._renderer,
  18098. labelsGroup: this.series._labelsGroup,
  18099. point: this
  18100. })
  18101. },
  18102. _updateLabelData: function() {
  18103. this._label.setData(this._getLabelFormatObject())
  18104. },
  18105. _updateLabelOptions: function() {
  18106. !this._label && this._createLabel();
  18107. this._label.setOptions(this._options.label)
  18108. },
  18109. _checkImage: function(image) {
  18110. return _isDefined(image) && ("string" === typeof image || _isDefined(image.url))
  18111. },
  18112. _fillStyle: function() {
  18113. this._styles = this._options.styles
  18114. },
  18115. _checkSymbol: function(oldOptions, newOptions) {
  18116. var oldSymbol = oldOptions.symbol;
  18117. var newSymbol = newOptions.symbol;
  18118. var symbolChanged = "circle" === oldSymbol && "circle" !== newSymbol || "circle" !== oldSymbol && "circle" === newSymbol;
  18119. var imageChanged = this._checkImage(oldOptions.image) !== this._checkImage(newOptions.image);
  18120. return !!(symbolChanged || imageChanged)
  18121. },
  18122. _populatePointShape: function(symbol, radius) {
  18123. switch (symbol) {
  18124. case "square":
  18125. return getSquareMarkerCoords(radius);
  18126. case "polygon":
  18127. return getPolygonMarkerCoords(radius);
  18128. case "triangle":
  18129. case "triangleDown":
  18130. return getTriangleDownMarkerCoords(radius);
  18131. case "triangleUp":
  18132. return getTriangleUpMarkerCoords(radius);
  18133. case "cross":
  18134. return getCrossMarkerCoords(radius)
  18135. }
  18136. },
  18137. hasCoords: function() {
  18138. return null !== this.x && null !== this.y
  18139. },
  18140. correctValue: function(correction) {
  18141. var that = this;
  18142. var axis = that.series.getValueAxis();
  18143. if (that.hasValue()) {
  18144. that.value = that.properValue = axis.validateUnit(that.initialValue.valueOf() + correction.valueOf());
  18145. that.minValue = axis.validateUnit(correction)
  18146. }
  18147. },
  18148. resetCorrection: function() {
  18149. this.value = this.properValue = this.initialValue;
  18150. this.minValue = CANVAS_POSITION_DEFAULT
  18151. },
  18152. resetValue: function() {
  18153. var that = this;
  18154. if (that.hasValue()) {
  18155. that.value = that.properValue = that.initialValue = 0;
  18156. that.minValue = 0;
  18157. that._label.setDataField("value", that.value)
  18158. }
  18159. },
  18160. _getTranslates: function(animationEnabled) {
  18161. var translateX = this.x;
  18162. var translateY = this.y;
  18163. if (animationEnabled) {
  18164. if (this._options.rotated) {
  18165. translateX = this.defaultX
  18166. } else {
  18167. translateY = this.defaultY
  18168. }
  18169. }
  18170. return {
  18171. x: translateX,
  18172. y: translateY
  18173. }
  18174. },
  18175. _createImageMarker: function(renderer, settings, options) {
  18176. var width = options.width || DEFAULT_IMAGE_WIDTH;
  18177. var height = options.height || DEFAULT_IMAGE_HEIGHT;
  18178. return renderer.image(-_round(.5 * width), -_round(.5 * height), width, height, options.url ? options.url.toString() : options.toString(), "center").attr({
  18179. translateX: settings.translateX,
  18180. translateY: settings.translateY,
  18181. visibility: settings.visibility
  18182. })
  18183. },
  18184. _createSymbolMarker: function(renderer, pointSettings) {
  18185. var marker;
  18186. var symbol = this._options.symbol;
  18187. if ("circle" === symbol) {
  18188. delete pointSettings.points;
  18189. marker = renderer.circle().attr(pointSettings)
  18190. } else {
  18191. if ("square" === symbol || "polygon" === symbol || "triangle" === symbol || "triangleDown" === symbol || "triangleUp" === symbol || "cross" === symbol) {
  18192. marker = renderer.path([], "area").attr(pointSettings).sharp()
  18193. }
  18194. }
  18195. return marker
  18196. },
  18197. _createMarker: function(renderer, group, image, settings) {
  18198. var that = this;
  18199. var marker = that._checkImage(image) ? that._createImageMarker(renderer, settings, image) : that._createSymbolMarker(renderer, settings);
  18200. if (marker) {
  18201. marker.data({
  18202. "chart-data-point": that
  18203. }).append(group)
  18204. }
  18205. return marker
  18206. },
  18207. _getSymbolBBox: function(x, y, r) {
  18208. return {
  18209. x: x - r,
  18210. y: y - r,
  18211. width: 2 * r,
  18212. height: 2 * r
  18213. }
  18214. },
  18215. _getImageBBox: function(x, y) {
  18216. var image = this._options.image;
  18217. var width = image.width || DEFAULT_IMAGE_WIDTH;
  18218. var height = image.height || DEFAULT_IMAGE_HEIGHT;
  18219. return {
  18220. x: x - _round(width / 2),
  18221. y: y - _round(height / 2),
  18222. width: width,
  18223. height: height
  18224. }
  18225. },
  18226. _getGraphicBBox: function() {
  18227. var that = this;
  18228. var options = that._options;
  18229. var x = that.x;
  18230. var y = that.y;
  18231. var bBox;
  18232. if (options.visible) {
  18233. bBox = that._checkImage(options.image) ? that._getImageBBox(x, y) : that._getSymbolBBox(x, y, options.styles.normal.r)
  18234. } else {
  18235. bBox = {
  18236. x: x,
  18237. y: y,
  18238. width: 0,
  18239. height: 0
  18240. }
  18241. }
  18242. return bBox
  18243. },
  18244. hideInsideLabel: noop,
  18245. _getShiftLabelCoords: function(label) {
  18246. var coord = this._addLabelAlignmentAndOffset(label, this._getLabelCoords(label));
  18247. return this._checkLabelPosition(label, coord)
  18248. },
  18249. _drawLabel: function() {
  18250. var that = this;
  18251. var customVisibility = that._getCustomLabelVisibility();
  18252. var label = that._label;
  18253. var isVisible = that._showForZeroValues() && that.hasValue() && false !== customVisibility && (that.series.getLabelVisibility() || customVisibility);
  18254. label.draw(!!isVisible)
  18255. },
  18256. correctLabelPosition: function(label) {
  18257. var that = this;
  18258. var coord = that._getShiftLabelCoords(label);
  18259. if (!that.hideInsideLabel(label, coord)) {
  18260. label.setFigureToDrawConnector(that._getLabelConnector(label.pointPosition));
  18261. label.shift(_round(coord.x), _round(coord.y))
  18262. }
  18263. },
  18264. _showForZeroValues: function() {
  18265. return true
  18266. },
  18267. _getLabelConnector: function(pointPosition) {
  18268. var bBox = this._getGraphicBBox(pointPosition);
  18269. var w2 = bBox.width / 2;
  18270. var h2 = bBox.height / 2;
  18271. return {
  18272. x: bBox.x + w2,
  18273. y: bBox.y + h2,
  18274. r: this._options.visible ? Math.max(w2, h2) : 0
  18275. }
  18276. },
  18277. _getPositionFromLocation: function() {
  18278. return {
  18279. x: this.x,
  18280. y: this.y
  18281. }
  18282. },
  18283. _isPointInVisibleArea: function(visibleArea, graphicBBox) {
  18284. return visibleArea.minX <= graphicBBox.x + graphicBBox.width && visibleArea.maxX >= graphicBBox.x && visibleArea.minY <= graphicBBox.y + graphicBBox.height && visibleArea.maxY >= graphicBBox.y
  18285. },
  18286. _checkLabelPosition: function(label, coord) {
  18287. var that = this;
  18288. var visibleArea = that._getVisibleArea();
  18289. var labelBBox = label.getBoundingRect();
  18290. var graphicBBox = that._getGraphicBBox(label.pointPosition);
  18291. var offset = LABEL_OFFSET;
  18292. if (that._isPointInVisibleArea(visibleArea, graphicBBox)) {
  18293. if (!that._options.rotated) {
  18294. if (visibleArea.minX > coord.x) {
  18295. coord.x = visibleArea.minX
  18296. }
  18297. if (visibleArea.maxX < coord.x + labelBBox.width) {
  18298. coord.x = visibleArea.maxX - labelBBox.width
  18299. }
  18300. if (visibleArea.minY > coord.y) {
  18301. coord.y = graphicBBox.y + graphicBBox.height + offset
  18302. }
  18303. if (visibleArea.maxY < coord.y + labelBBox.height) {
  18304. coord.y = graphicBBox.y - labelBBox.height - offset
  18305. }
  18306. } else {
  18307. if (visibleArea.minX > coord.x) {
  18308. coord.x = graphicBBox.x + graphicBBox.width + offset
  18309. }
  18310. if (visibleArea.maxX < coord.x + labelBBox.width) {
  18311. coord.x = graphicBBox.x - offset - labelBBox.width
  18312. }
  18313. if (visibleArea.minY > coord.y) {
  18314. coord.y = visibleArea.minY
  18315. }
  18316. if (visibleArea.maxY < coord.y + labelBBox.height) {
  18317. coord.y = visibleArea.maxY - labelBBox.height
  18318. }
  18319. }
  18320. }
  18321. return coord
  18322. },
  18323. _addLabelAlignmentAndOffset: function(label, coord) {
  18324. var labelBBox = label.getBoundingRect();
  18325. var labelOptions = label.getLayoutOptions();
  18326. if (!this._options.rotated) {
  18327. if ("left" === labelOptions.alignment) {
  18328. coord.x += labelBBox.width / 2
  18329. } else {
  18330. if ("right" === labelOptions.alignment) {
  18331. coord.x -= labelBBox.width / 2
  18332. }
  18333. }
  18334. }
  18335. coord.x += labelOptions.horizontalOffset;
  18336. coord.y += labelOptions.verticalOffset;
  18337. return coord
  18338. },
  18339. _getLabelCoords: function(label) {
  18340. return this._getLabelCoordOfPosition(label, this._getLabelPosition(label.pointPosition))
  18341. },
  18342. _getLabelCoordOfPosition: function(label, position) {
  18343. var that = this;
  18344. var labelBBox = label.getBoundingRect();
  18345. var graphicBBox = that._getGraphicBBox(label.pointPosition);
  18346. var offset = LABEL_OFFSET;
  18347. var centerY = graphicBBox.height / 2 - labelBBox.height / 2;
  18348. var centerX = graphicBBox.width / 2 - labelBBox.width / 2;
  18349. var x = graphicBBox.x;
  18350. var y = graphicBBox.y;
  18351. switch (position) {
  18352. case "left":
  18353. x -= labelBBox.width + offset;
  18354. y += centerY;
  18355. break;
  18356. case "right":
  18357. x += graphicBBox.width + offset;
  18358. y += centerY;
  18359. break;
  18360. case "top":
  18361. x += centerX;
  18362. y -= labelBBox.height + offset;
  18363. break;
  18364. case "bottom":
  18365. x += centerX;
  18366. y += graphicBBox.height + offset;
  18367. break;
  18368. case "inside":
  18369. x += centerX;
  18370. y += centerY
  18371. }
  18372. return {
  18373. x: x,
  18374. y: y
  18375. }
  18376. },
  18377. _drawMarker: function(renderer, group, animationEnabled) {
  18378. var that = this;
  18379. var options = that._options;
  18380. var translates = that._getTranslates(animationEnabled);
  18381. var style = that._getStyle();
  18382. that.graphic = that._createMarker(renderer, group, options.image, _extend({
  18383. translateX: translates.x,
  18384. translateY: translates.y,
  18385. points: that._populatePointShape(options.symbol, style.r)
  18386. }, style))
  18387. },
  18388. _getErrorBarSettings: function() {
  18389. return {
  18390. visibility: "visible"
  18391. }
  18392. },
  18393. _getErrorBarBaseEdgeLength: function() {
  18394. return 2 * this.getPointRadius()
  18395. },
  18396. _drawErrorBar: function(renderer, group) {
  18397. if (!this._options.errorBars) {
  18398. return
  18399. }
  18400. var that = this;
  18401. var options = that._options;
  18402. var errorBarOptions = options.errorBars;
  18403. var points = [];
  18404. var settings;
  18405. var pos = that._errorBarPos;
  18406. var high = that._highErrorCoord;
  18407. var low = that._lowErrorCoord;
  18408. var displayMode = _normalizeEnum(errorBarOptions.displayMode);
  18409. var isHighDisplayMode = "high" === displayMode;
  18410. var isLowDisplayMode = "low" === displayMode;
  18411. var highErrorOnly = (isHighDisplayMode || !_isDefined(low)) && _isDefined(high) && !isLowDisplayMode;
  18412. var lowErrorOnly = (isLowDisplayMode || !_isDefined(high)) && _isDefined(low) && !isHighDisplayMode;
  18413. var edgeLength = errorBarOptions.edgeLength;
  18414. if (edgeLength <= 1 && edgeLength > 0) {
  18415. edgeLength = this._getErrorBarBaseEdgeLength() * errorBarOptions.edgeLength
  18416. }
  18417. edgeLength = _floor(parseInt(edgeLength) / 2);
  18418. highErrorOnly && (low = that._baseErrorBarPos);
  18419. lowErrorOnly && (high = that._baseErrorBarPos);
  18420. if ("none" !== displayMode && _isDefined(high) && _isDefined(low) && _isDefined(pos)) {
  18421. !lowErrorOnly && points.push([pos - edgeLength, high, pos + edgeLength, high]);
  18422. points.push([pos, high, pos, low]);
  18423. !highErrorOnly && points.push([pos + edgeLength, low, pos - edgeLength, low]);
  18424. options.rotated && each(points, function(_, p) {
  18425. p.reverse()
  18426. });
  18427. settings = that._getErrorBarSettings(errorBarOptions);
  18428. if (!that._errorBar) {
  18429. that._errorBar = renderer.path(points, "line").attr(settings).append(group)
  18430. } else {
  18431. settings.points = points;
  18432. that._errorBar.attr(settings)
  18433. }
  18434. } else {
  18435. that._errorBar && that._errorBar.attr({
  18436. visibility: "hidden"
  18437. })
  18438. }
  18439. },
  18440. getTooltipParams: function() {
  18441. var that = this;
  18442. var graphic = that.graphic;
  18443. return {
  18444. x: that.x,
  18445. y: that.y,
  18446. offset: graphic ? graphic.getBBox().height / 2 : 0
  18447. }
  18448. },
  18449. setPercentValue: function(absTotal, total, leftHoleTotal, rightHoleTotal) {
  18450. var that = this;
  18451. var valuePercent = that.value / absTotal || 0;
  18452. var minValuePercent = that.minValue / absTotal || 0;
  18453. var percent = valuePercent - minValuePercent;
  18454. that._label.setDataField("percent", percent);
  18455. that._label.setDataField("total", total);
  18456. if (that.series.isFullStackedSeries() && that.hasValue()) {
  18457. if (that.leftHole) {
  18458. that.leftHole /= absTotal - leftHoleTotal;
  18459. that.minLeftHole /= absTotal - leftHoleTotal
  18460. }
  18461. if (that.rightHole) {
  18462. that.rightHole /= absTotal - rightHoleTotal;
  18463. that.minRightHole /= absTotal - rightHoleTotal
  18464. }
  18465. that.value = that.properValue = valuePercent;
  18466. that.minValue = !minValuePercent ? that.minValue : minValuePercent
  18467. }
  18468. },
  18469. _storeTrackerR: function() {
  18470. var that = this;
  18471. var navigator = window.navigator;
  18472. var r = that._options.styles.normal.r;
  18473. navigator = that.__debug_navigator || navigator;
  18474. that.__debug_browserNavigator = navigator;
  18475. var minTrackerSize = windowUtils.hasProperty("ontouchstart") || navigator.msPointerEnabled && navigator.msMaxTouchPoints || navigator.pointerEnabled && navigator.maxTouchPoints ? 20 : 6;
  18476. that._options.trackerR = r < minTrackerSize ? minTrackerSize : r;
  18477. return that._options.trackerR
  18478. },
  18479. _translateErrorBars: function() {
  18480. var that = this;
  18481. var options = that._options;
  18482. var rotated = options.rotated;
  18483. var errorBars = options.errorBars;
  18484. var translator = that._getValTranslator();
  18485. if (!errorBars) {
  18486. return
  18487. }
  18488. _isDefined(that.lowError) && (that._lowErrorCoord = translator.translate(that.lowError));
  18489. _isDefined(that.highError) && (that._highErrorCoord = translator.translate(that.highError));
  18490. that._errorBarPos = _floor(rotated ? that.vy : that.vx);
  18491. that._baseErrorBarPos = "stdDeviation" === errorBars.type ? that._lowErrorCoord + (that._highErrorCoord - that._lowErrorCoord) / 2 : rotated ? that.vx : that.vy
  18492. },
  18493. _translate: function() {
  18494. var that = this;
  18495. var valTranslator = that._getValTranslator();
  18496. var argTranslator = that._getArgTranslator();
  18497. if (that._options.rotated) {
  18498. that.vx = that.x = valTranslator.translate(that.value);
  18499. that.vy = that.y = argTranslator.translate(that.argument);
  18500. that.minX = valTranslator.translate(that.minValue);
  18501. that.defaultX = valTranslator.translate(CANVAS_POSITION_DEFAULT)
  18502. } else {
  18503. that.vy = that.y = valTranslator.translate(that.value);
  18504. that.vx = that.x = argTranslator.translate(that.argument);
  18505. that.minY = valTranslator.translate(that.minValue);
  18506. that.defaultY = valTranslator.translate(CANVAS_POSITION_DEFAULT)
  18507. }
  18508. that._translateErrorBars();
  18509. that._calculateVisibility(that.x, that.y)
  18510. },
  18511. _updateData: function(data) {
  18512. var that = this;
  18513. that.value = that.properValue = that.initialValue = that.originalValue = data.value;
  18514. that.minValue = that.initialMinValue = that.originalMinValue = _isDefined(data.minValue) ? data.minValue : CANVAS_POSITION_DEFAULT
  18515. },
  18516. _getImageSettings: function(image) {
  18517. return {
  18518. href: image.url || image.toString(),
  18519. width: image.width || DEFAULT_IMAGE_WIDTH,
  18520. height: image.height || DEFAULT_IMAGE_HEIGHT
  18521. }
  18522. },
  18523. getCrosshairData: function() {
  18524. var that = this;
  18525. var r = that._options.rotated;
  18526. var value = that.properValue;
  18527. var argument = that.argument;
  18528. return {
  18529. x: that.vx,
  18530. y: that.vy,
  18531. xValue: r ? value : argument,
  18532. yValue: r ? argument : value,
  18533. axis: that.series.axis
  18534. }
  18535. },
  18536. getPointRadius: function() {
  18537. var style = this._getStyle();
  18538. var options = this._options;
  18539. var r = style.r;
  18540. var extraSpace;
  18541. var symbol = options.symbol;
  18542. var isSquare = "square" === symbol;
  18543. var isTriangle = "triangle" === symbol || "triangleDown" === symbol || "triangleUp" === symbol;
  18544. if (options.visible && !options.image && r) {
  18545. extraSpace = style["stroke-width"] / 2;
  18546. return (isSquare || isTriangle ? 1.4 * r : r) + extraSpace
  18547. }
  18548. return 0
  18549. },
  18550. _updateMarker: function(animationEnabled, style) {
  18551. var that = this;
  18552. var options = that._options;
  18553. var settings;
  18554. var image = options.image;
  18555. var visibility = !that.isVisible() ? {
  18556. visibility: "hidden"
  18557. } : {};
  18558. if (that._checkImage(image)) {
  18559. settings = _extend({}, {
  18560. visibility: style.visibility
  18561. }, visibility, that._getImageSettings(image))
  18562. } else {
  18563. settings = _extend({}, style, visibility, {
  18564. points: that._populatePointShape(options.symbol, style.r)
  18565. })
  18566. }
  18567. if (!animationEnabled) {
  18568. settings.translateX = that.x;
  18569. settings.translateY = that.y
  18570. }
  18571. that.graphic.attr(settings).sharp()
  18572. },
  18573. _getLabelFormatObject: function() {
  18574. var that = this;
  18575. return {
  18576. argument: that.initialArgument,
  18577. value: that.initialValue,
  18578. originalArgument: that.originalArgument,
  18579. originalValue: that.originalValue,
  18580. seriesName: that.series.name,
  18581. lowErrorValue: that.lowError,
  18582. highErrorValue: that.highError,
  18583. point: that
  18584. }
  18585. },
  18586. _getLabelPosition: function() {
  18587. var rotated = this._options.rotated;
  18588. if (this.initialValue > 0) {
  18589. return rotated ? "right" : "top"
  18590. } else {
  18591. return rotated ? "left" : "bottom"
  18592. }
  18593. },
  18594. _getFormatObject: function(tooltip) {
  18595. var that = this;
  18596. var labelFormatObject = that._label.getData();
  18597. return _extend({}, labelFormatObject, {
  18598. argumentText: tooltip.formatValue(that.initialArgument, "argument"),
  18599. valueText: tooltip.formatValue(that.initialValue)
  18600. }, _isDefined(labelFormatObject.percent) ? {
  18601. percentText: tooltip.formatValue(labelFormatObject.percent, "percent")
  18602. } : {}, _isDefined(labelFormatObject.total) ? {
  18603. totalText: tooltip.formatValue(labelFormatObject.total)
  18604. } : {})
  18605. },
  18606. getMarkerVisibility: function() {
  18607. return this._options.visible
  18608. },
  18609. coordsIn: function(x, y) {
  18610. var trackerRadius = this._storeTrackerR();
  18611. return x >= this.x - trackerRadius && x <= this.x + trackerRadius && y >= this.y - trackerRadius && y <= this.y + trackerRadius
  18612. },
  18613. getMinValue: function(noErrorBar) {
  18614. var errorBarOptions = this._options.errorBars;
  18615. if (errorBarOptions && !noErrorBar) {
  18616. var displayMode = errorBarOptions.displayMode;
  18617. var lowValue = "high" !== displayMode && _isDefined(this.lowError) ? this.lowError : this.value;
  18618. var highValue = "low" !== displayMode && _isDefined(this.highError) ? this.highError : this.value;
  18619. return lowValue < highValue ? lowValue : highValue
  18620. } else {
  18621. return this.value
  18622. }
  18623. },
  18624. getMaxValue: function(noErrorBar) {
  18625. var errorBarOptions = this._options.errorBars;
  18626. if (errorBarOptions && !noErrorBar) {
  18627. var displayMode = errorBarOptions.displayMode;
  18628. var lowValue = "high" !== displayMode && _isDefined(this.lowError) ? this.lowError : this.value;
  18629. var highValue = "low" !== displayMode && _isDefined(this.highError) ? this.highError : this.value;
  18630. return lowValue > highValue ? lowValue : highValue
  18631. } else {
  18632. return this.value
  18633. }
  18634. }
  18635. }
  18636. },
  18637. /*!************************************************************!*\
  18638. !*** ./artifacts/transpiled/viz/core/loading_indicator.js ***!
  18639. \************************************************************/
  18640. /*! dynamic exports provided */
  18641. /*! all exports used */
  18642. function(module, exports, __webpack_require__) {
  18643. var _patchFontOptions = __webpack_require__( /*! ./utils */ 10).patchFontOptions;
  18644. var STATE_HIDDEN = 0;
  18645. var STATE_SHOWN = 1;
  18646. var ANIMATION_EASING = "linear";
  18647. var ANIMATION_DURATION = 400;
  18648. var LOADING_INDICATOR_READY = "loadingIndicatorReady";
  18649. function LoadingIndicator(parameters) {
  18650. var that = this;
  18651. var renderer = parameters.renderer;
  18652. that._group = renderer.g().attr({
  18653. "class": "dx-loading-indicator"
  18654. }).linkOn(renderer.root, {
  18655. name: "loading-indicator",
  18656. after: "peripheral"
  18657. });
  18658. that._rect = renderer.rect().attr({
  18659. opacity: 0
  18660. }).append(that._group);
  18661. that._text = renderer.text().attr({
  18662. align: "center"
  18663. }).append(that._group);
  18664. that._createStates(parameters.eventTrigger, that._group, renderer.root, parameters.notify)
  18665. }
  18666. LoadingIndicator.prototype = {
  18667. constructor: LoadingIndicator,
  18668. _createStates: function(eventTrigger, group, root, notify) {
  18669. var that = this;
  18670. that._states = [{
  18671. opacity: 0,
  18672. start: function() {
  18673. notify(false)
  18674. },
  18675. complete: function() {
  18676. group.linkRemove();
  18677. root.css({
  18678. "pointer-events": ""
  18679. });
  18680. eventTrigger(LOADING_INDICATOR_READY)
  18681. }
  18682. }, {
  18683. opacity: .85,
  18684. start: function() {
  18685. group.linkAppend();
  18686. root.css({
  18687. "pointer-events": "none"
  18688. });
  18689. notify(true)
  18690. },
  18691. complete: function() {
  18692. eventTrigger(LOADING_INDICATOR_READY)
  18693. }
  18694. }];
  18695. that._state = STATE_HIDDEN
  18696. },
  18697. setSize: function(size) {
  18698. var width = size.width;
  18699. var height = size.height;
  18700. this._rect.attr({
  18701. width: width,
  18702. height: height
  18703. });
  18704. this._text.attr({
  18705. x: width / 2,
  18706. y: height / 2
  18707. })
  18708. },
  18709. setOptions: function(options) {
  18710. this._rect.attr({
  18711. fill: options.backgroundColor
  18712. });
  18713. this._text.css(_patchFontOptions(options.font)).attr({
  18714. text: options.text,
  18715. "class": options.cssClass
  18716. });
  18717. this[options.show ? "show" : "hide"]()
  18718. },
  18719. dispose: function() {
  18720. var that = this;
  18721. that._group.linkRemove().linkOff();
  18722. that._group = that._rect = that._text = that._states = null
  18723. },
  18724. _transit: function(stateId) {
  18725. var that = this;
  18726. var state;
  18727. if (that._state !== stateId) {
  18728. that._state = stateId;
  18729. that._isHiding = false;
  18730. state = that._states[stateId];
  18731. that._rect.stopAnimation().animate({
  18732. opacity: state.opacity
  18733. }, {
  18734. complete: state.complete,
  18735. easing: ANIMATION_EASING,
  18736. duration: ANIMATION_DURATION,
  18737. unstoppable: true
  18738. });
  18739. that._noHiding = true;
  18740. state.start();
  18741. that._noHiding = false
  18742. }
  18743. },
  18744. show: function() {
  18745. this._transit(STATE_SHOWN)
  18746. },
  18747. hide: function() {
  18748. this._transit(STATE_HIDDEN)
  18749. },
  18750. scheduleHiding: function() {
  18751. if (!this._noHiding) {
  18752. this._isHiding = true
  18753. }
  18754. },
  18755. fulfillHiding: function() {
  18756. if (this._isHiding) {
  18757. this.hide()
  18758. }
  18759. }
  18760. };
  18761. exports.LoadingIndicator = LoadingIndicator;
  18762. exports.plugin = {
  18763. name: "loading_indicator",
  18764. init: function() {
  18765. var that = this;
  18766. that._loadingIndicator = new exports.LoadingIndicator({
  18767. eventTrigger: that._eventTrigger,
  18768. renderer: that._renderer,
  18769. notify: notify
  18770. });
  18771. that._scheduleLoadingIndicatorHiding();
  18772. function notify(state) {
  18773. that._skipLoadingIndicatorOptions = true;
  18774. that.option("loadingIndicator", {
  18775. show: state
  18776. });
  18777. that._skipLoadingIndicatorOptions = false;
  18778. if (state) {
  18779. that._stopCurrentHandling()
  18780. }
  18781. }
  18782. },
  18783. dispose: function() {
  18784. this._loadingIndicator.dispose();
  18785. this._loadingIndicator = null
  18786. },
  18787. members: {
  18788. _scheduleLoadingIndicatorHiding: function() {
  18789. this._loadingIndicator.scheduleHiding()
  18790. },
  18791. _fulfillLoadingIndicatorHiding: function() {
  18792. this._loadingIndicator.fulfillHiding()
  18793. },
  18794. showLoadingIndicator: function() {
  18795. this._loadingIndicator.show()
  18796. },
  18797. hideLoadingIndicator: function() {
  18798. this._loadingIndicator.hide()
  18799. },
  18800. _onBeginUpdate: function() {
  18801. if (!this._optionChangedLocker) {
  18802. this._scheduleLoadingIndicatorHiding()
  18803. }
  18804. }
  18805. },
  18806. extenders: {
  18807. _dataSourceLoadingChangedHandler: function(isLoading) {
  18808. if (isLoading && (this._options.loadingIndicator || {}).enabled) {
  18809. this._loadingIndicator.show()
  18810. }
  18811. },
  18812. _setContentSize: function() {
  18813. this._loadingIndicator.setSize(this._canvas)
  18814. },
  18815. endUpdate: function() {
  18816. if (this._initialized && this._dataIsReady()) {
  18817. this._fulfillLoadingIndicatorHiding()
  18818. }
  18819. }
  18820. },
  18821. customize: function(constructor) {
  18822. var proto = constructor.prototype;
  18823. if (proto._dataSourceChangedHandler) {
  18824. var _dataSourceChangedHandler = proto._dataSourceChangedHandler;
  18825. proto._dataSourceChangedHandler = function() {
  18826. this._scheduleLoadingIndicatorHiding();
  18827. _dataSourceChangedHandler.apply(this, arguments)
  18828. }
  18829. }
  18830. constructor.addChange({
  18831. code: "LOADING_INDICATOR",
  18832. handler: function() {
  18833. if (!this._skipLoadingIndicatorOptions) {
  18834. this._loadingIndicator.setOptions(this._getOption("loadingIndicator"))
  18835. }
  18836. this._scheduleLoadingIndicatorHiding()
  18837. },
  18838. isThemeDependent: true,
  18839. option: "loadingIndicator",
  18840. isOptionChange: true
  18841. });
  18842. proto._eventsMap.onLoadingIndicatorReady = {
  18843. name: "loadingIndicatorReady"
  18844. };
  18845. var _drawn = proto._drawn;
  18846. proto._drawn = function() {
  18847. _drawn.apply(this, arguments);
  18848. if (this._dataIsReady()) {
  18849. this._fulfillLoadingIndicatorHiding()
  18850. }
  18851. }
  18852. },
  18853. fontFields: ["loadingIndicator.font"]
  18854. }
  18855. },
  18856. /*!*****************************************************!*\
  18857. !*** ./artifacts/transpiled/viz/tree_map/tiling.js ***!
  18858. \*****************************************************/
  18859. /*! dynamic exports provided */
  18860. /*! all exports used */
  18861. function(module, exports, __webpack_require__) {
  18862. var _isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
  18863. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  18864. var _round = Math.round;
  18865. var algorithms = {};
  18866. var defaultAlgorithm;
  18867. exports.getAlgorithm = function(value) {
  18868. return algorithms[_normalizeEnum(value)] || _isFunction(value) && value || defaultAlgorithm
  18869. };
  18870. exports.addAlgorithm = function(name, callback) {
  18871. algorithms[name] = callback
  18872. };
  18873. exports.setDefaultAlgorithm = function(name) {
  18874. defaultAlgorithm = algorithms[name]
  18875. };
  18876. var directionToIndexOffsets = {};
  18877. directionToIndexOffsets[-1] = [2, 0];
  18878. directionToIndexOffsets[1] = [0, 2];
  18879. var getStaticSideIndex = function(rect) {
  18880. return rect[2] - rect[0] < rect[3] - rect[1] ? 0 : 1
  18881. };
  18882. exports.getStaticSideIndex = getStaticSideIndex;
  18883. exports.buildSidesData = function(rect, directions, _staticSideIndex) {
  18884. var staticSideIndex = void 0 !== _staticSideIndex ? _staticSideIndex : getStaticSideIndex(rect);
  18885. var variedSideIndex = 1 - staticSideIndex;
  18886. var staticSideDirection = directions[staticSideIndex];
  18887. var variedSideDirection = directions[variedSideIndex];
  18888. var staticSideIndexOffsets = directionToIndexOffsets[staticSideDirection];
  18889. var variedSideIndexOffsets = directionToIndexOffsets[variedSideDirection];
  18890. return {
  18891. staticSide: rect[2 + staticSideIndex] - rect[staticSideIndex],
  18892. variedSide: rect[2 + variedSideIndex] - rect[variedSideIndex],
  18893. static1: staticSideIndex + staticSideIndexOffsets[0],
  18894. static2: staticSideIndex + staticSideIndexOffsets[1],
  18895. varied1: variedSideIndex + variedSideIndexOffsets[0],
  18896. varied2: variedSideIndex + variedSideIndexOffsets[1],
  18897. staticDir: staticSideDirection,
  18898. variedDir: variedSideDirection
  18899. }
  18900. };
  18901. exports.calculateRectangles = function(nodes, head, totalRect, sidesData, rowData) {
  18902. var i;
  18903. var ii;
  18904. var variedSidePart = [0, 0, 0, 0];
  18905. var static1 = sidesData.static1;
  18906. var static2 = sidesData.static2;
  18907. var position = totalRect[static1];
  18908. var dir = sidesData.staticDir;
  18909. var side = sidesData.staticSide;
  18910. var sum = rowData.sum;
  18911. var rect;
  18912. var delta;
  18913. variedSidePart[sidesData.varied1] = totalRect[sidesData.varied1];
  18914. variedSidePart[sidesData.varied2] = totalRect[sidesData.varied1] + sidesData.variedDir * rowData.side;
  18915. for (i = head, ii = head + rowData.count; i < ii; ++i) {
  18916. rect = variedSidePart.slice();
  18917. rect[static1] = position;
  18918. delta = _round(side * nodes[i].value / sum) || 0;
  18919. sum -= nodes[i].value;
  18920. side -= delta;
  18921. position += dir * delta;
  18922. rect[static2] = position;
  18923. nodes[i].rect = rect
  18924. }
  18925. totalRect[sidesData.varied1] = variedSidePart[sidesData.varied2]
  18926. }
  18927. },
  18928. /*!*********************************************************!*\
  18929. !*** ./artifacts/transpiled/viz/tree_map/colorizing.js ***!
  18930. \*********************************************************/
  18931. /*! dynamic exports provided */
  18932. /*! all exports used */
  18933. function(module, exports, __webpack_require__) {
  18934. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  18935. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  18936. var colorizers = {};
  18937. var defaultColorizerName;
  18938. function wrapLeafColorGetter(getter) {
  18939. return function(node) {
  18940. return !node.isNode() ? getter(node) : void 0
  18941. }
  18942. }
  18943. function wrapGroupColorGetter(getter) {
  18944. return function(node) {
  18945. var parent = !node.isNode() && node.parent;
  18946. return parent ? parent._groupColor = parent._groupColor || getter(parent) : void 0
  18947. }
  18948. }
  18949. exports.getColorizer = function(options, themeManager, root) {
  18950. var type = _normalizeEnum(options.type || defaultColorizerName);
  18951. var colorizer = colorizers[type] && colorizers[type](options, themeManager, root);
  18952. return colorizer ? (options.colorizeGroups ? wrapGroupColorGetter : wrapLeafColorGetter)(colorizer) : _noop
  18953. };
  18954. exports.addColorizer = function(name, colorizer) {
  18955. colorizers[name] = colorizer
  18956. };
  18957. exports.setDefaultColorizer = function(name) {
  18958. defaultColorizerName = name
  18959. };
  18960. function getValueAsColorCode(node) {
  18961. return node.value
  18962. }
  18963. function createColorCodeGetter(colorCodeField) {
  18964. return function(node) {
  18965. return Number(node.data[colorCodeField])
  18966. }
  18967. }
  18968. exports.createColorCodeGetter = function(options) {
  18969. return options.colorCodeField ? createColorCodeGetter(options.colorCodeField) : getValueAsColorCode
  18970. }
  18971. },
  18972. /*!*************************************************************************!*\
  18973. !*** ./artifacts/transpiled/events/core/event_registrator_callbacks.js ***!
  18974. \*************************************************************************/
  18975. /*! dynamic exports provided */
  18976. /*! all exports used */
  18977. function(module, exports, __webpack_require__) {
  18978. var MemorizedCallbacks = __webpack_require__( /*! ../../core/memorized_callbacks */ 177);
  18979. module.exports = new MemorizedCallbacks
  18980. },
  18981. /*!*****************************************************!*\
  18982. !*** ./artifacts/transpiled/events/core/emitter.js ***!
  18983. \*****************************************************/
  18984. /*! dynamic exports provided */
  18985. /*! all exports used */
  18986. function(module, exports, __webpack_require__) {
  18987. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  18988. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  18989. var Class = __webpack_require__( /*! ../../core/class */ 15);
  18990. var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
  18991. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  18992. var eventUtils = __webpack_require__( /*! ../utils */ 8);
  18993. var Emitter = Class.inherit({
  18994. ctor: function(element) {
  18995. this._$element = $(element);
  18996. this._cancelCallback = Callbacks();
  18997. this._acceptCallback = Callbacks()
  18998. },
  18999. getElement: function() {
  19000. return this._$element
  19001. },
  19002. validate: function(e) {
  19003. return !eventUtils.isDxMouseWheelEvent(e)
  19004. },
  19005. validatePointers: function(e) {
  19006. return 1 === eventUtils.hasTouches(e)
  19007. },
  19008. allowInterruptionByMouseWheel: function() {
  19009. return true
  19010. },
  19011. configure: function(data) {
  19012. extend(this, data)
  19013. },
  19014. addCancelCallback: function(callback) {
  19015. this._cancelCallback.add(callback)
  19016. },
  19017. removeCancelCallback: function() {
  19018. this._cancelCallback.empty()
  19019. },
  19020. _cancel: function(e) {
  19021. this._cancelCallback.fire(this, e)
  19022. },
  19023. addAcceptCallback: function(callback) {
  19024. this._acceptCallback.add(callback)
  19025. },
  19026. removeAcceptCallback: function() {
  19027. this._acceptCallback.empty()
  19028. },
  19029. _accept: function(e) {
  19030. this._acceptCallback.fire(this, e)
  19031. },
  19032. _requestAccept: function(e) {
  19033. this._acceptRequestEvent = e
  19034. },
  19035. _forgetAccept: function() {
  19036. this._accept(this._acceptRequestEvent);
  19037. this._acceptRequestEvent = null
  19038. },
  19039. start: noop,
  19040. move: noop,
  19041. end: noop,
  19042. cancel: noop,
  19043. reset: function() {
  19044. if (this._acceptRequestEvent) {
  19045. this._accept(this._acceptRequestEvent)
  19046. }
  19047. },
  19048. _fireEvent: function(eventName, e, params) {
  19049. var eventData = extend({
  19050. type: eventName,
  19051. originalEvent: e,
  19052. target: this._getEmitterTarget(e),
  19053. delegateTarget: this.getElement().get(0)
  19054. }, params);
  19055. e = eventUtils.fireEvent(eventData);
  19056. if (e.cancel) {
  19057. this._cancel(e)
  19058. }
  19059. return e
  19060. },
  19061. _getEmitterTarget: function(e) {
  19062. return (this.delegateSelector ? $(e.target).closest(this.delegateSelector) : this.getElement()).get(0)
  19063. },
  19064. dispose: noop
  19065. });
  19066. module.exports = Emitter
  19067. },
  19068. /*!***************************************************!*\
  19069. !*** ./artifacts/transpiled/events/core/wheel.js ***!
  19070. \***************************************************/
  19071. /*! dynamic exports provided */
  19072. /*! all exports used */
  19073. function(module, exports, __webpack_require__) {
  19074. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  19075. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  19076. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  19077. var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 63);
  19078. var registerEvent = __webpack_require__( /*! ./event_registrator */ 71);
  19079. var eventUtils = __webpack_require__( /*! ../utils */ 8);
  19080. var EVENT_NAME = "dxmousewheel";
  19081. var EVENT_NAMESPACE = "dxWheel";
  19082. var getWheelEventName = callOnce(function() {
  19083. return domAdapter.hasDocumentProperty("onwheel") ? "wheel" : "mousewheel"
  19084. });
  19085. var wheel = {
  19086. setup: function(element) {
  19087. var $element = $(element);
  19088. eventsEngine.on($element, eventUtils.addNamespace(getWheelEventName(), EVENT_NAMESPACE), wheel._wheelHandler.bind(wheel))
  19089. },
  19090. teardown: function(element) {
  19091. eventsEngine.off(element, "." + EVENT_NAMESPACE)
  19092. },
  19093. _wheelHandler: function(e) {
  19094. var delta = this._getWheelDelta(e.originalEvent);
  19095. eventUtils.fireEvent({
  19096. type: EVENT_NAME,
  19097. originalEvent: e,
  19098. delta: delta,
  19099. pointerType: "mouse"
  19100. });
  19101. e.stopPropagation()
  19102. },
  19103. _getWheelDelta: function(event) {
  19104. return event.wheelDelta ? event.wheelDelta : 30 * -event.deltaY
  19105. }
  19106. };
  19107. registerEvent(EVENT_NAME, wheel);
  19108. exports.name = EVENT_NAME
  19109. },
  19110. /*!**************************************************************!*\
  19111. !*** ./artifacts/transpiled/events/core/emitter.feedback.js ***!
  19112. \**************************************************************/
  19113. /*! dynamic exports provided */
  19114. /*! all exports used */
  19115. function(module, exports, __webpack_require__) {
  19116. var Class = __webpack_require__( /*! ../../core/class */ 15);
  19117. var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
  19118. var contains = __webpack_require__( /*! ../../core/utils/dom */ 12).contains;
  19119. var devices = __webpack_require__( /*! ../../core/devices */ 16);
  19120. var eventUtils = __webpack_require__( /*! ../utils */ 8);
  19121. var pointerEvents = __webpack_require__( /*! ../pointer */ 23);
  19122. var Emitter = __webpack_require__( /*! ./emitter */ 123);
  19123. var registerEmitter = __webpack_require__( /*! ./emitter_registrator */ 95);
  19124. var ACTIVE_EVENT_NAME = "dxactive";
  19125. var INACTIVE_EVENT_NAME = "dxinactive";
  19126. var ACTIVE_TIMEOUT = 30;
  19127. var INACTIVE_TIMEOUT = 400;
  19128. var FeedbackEvent = Class.inherit({
  19129. ctor: function(timeout, fire) {
  19130. this._timeout = timeout;
  19131. this._fire = fire
  19132. },
  19133. start: function() {
  19134. var that = this;
  19135. this._schedule(function() {
  19136. that.force()
  19137. })
  19138. },
  19139. _schedule: function(fn) {
  19140. this.stop();
  19141. this._timer = setTimeout(fn, this._timeout)
  19142. },
  19143. stop: function() {
  19144. clearTimeout(this._timer)
  19145. },
  19146. force: function() {
  19147. if (this._fired) {
  19148. return
  19149. }
  19150. this.stop();
  19151. this._fire();
  19152. this._fired = true
  19153. },
  19154. fired: function() {
  19155. return this._fired
  19156. }
  19157. });
  19158. var activeFeedback;
  19159. var FeedbackEmitter = Emitter.inherit({
  19160. ctor: function() {
  19161. this.callBase.apply(this, arguments);
  19162. this._active = new FeedbackEvent(0, commonUtils.noop);
  19163. this._inactive = new FeedbackEvent(0, commonUtils.noop)
  19164. },
  19165. configure: function(data, eventName) {
  19166. switch (eventName) {
  19167. case ACTIVE_EVENT_NAME:
  19168. data.activeTimeout = data.timeout;
  19169. break;
  19170. case INACTIVE_EVENT_NAME:
  19171. data.inactiveTimeout = data.timeout
  19172. }
  19173. this.callBase(data)
  19174. },
  19175. start: function(e) {
  19176. if (activeFeedback) {
  19177. var activeChildExists = contains(this.getElement().get(0), activeFeedback.getElement().get(0));
  19178. var childJustActivated = !activeFeedback._active.fired();
  19179. if (activeChildExists && childJustActivated) {
  19180. this._cancel();
  19181. return
  19182. }
  19183. activeFeedback._inactive.force()
  19184. }
  19185. activeFeedback = this;
  19186. this._initEvents(e);
  19187. this._active.start()
  19188. },
  19189. _initEvents: function(e) {
  19190. var that = this;
  19191. var eventTarget = this._getEmitterTarget(e);
  19192. var mouseEvent = eventUtils.isMouseEvent(e);
  19193. var isSimulator = devices.isSimulator();
  19194. var deferFeedback = isSimulator || !mouseEvent;
  19195. var activeTimeout = commonUtils.ensureDefined(this.activeTimeout, ACTIVE_TIMEOUT);
  19196. var inactiveTimeout = commonUtils.ensureDefined(this.inactiveTimeout, INACTIVE_TIMEOUT);
  19197. this._active = new FeedbackEvent(deferFeedback ? activeTimeout : 0, function() {
  19198. that._fireEvent(ACTIVE_EVENT_NAME, e, {
  19199. target: eventTarget
  19200. })
  19201. });
  19202. this._inactive = new FeedbackEvent(deferFeedback ? inactiveTimeout : 0, function() {
  19203. that._fireEvent(INACTIVE_EVENT_NAME, e, {
  19204. target: eventTarget
  19205. });
  19206. activeFeedback = null
  19207. })
  19208. },
  19209. cancel: function(e) {
  19210. this.end(e)
  19211. },
  19212. end: function(e) {
  19213. var skipTimers = e.type !== pointerEvents.up;
  19214. if (skipTimers) {
  19215. this._active.stop()
  19216. } else {
  19217. this._active.force()
  19218. }
  19219. this._inactive.start();
  19220. if (skipTimers) {
  19221. this._inactive.force()
  19222. }
  19223. },
  19224. dispose: function() {
  19225. this._active.stop();
  19226. this._inactive.stop();
  19227. this.callBase()
  19228. },
  19229. lockInactive: function() {
  19230. this._active.force();
  19231. this._inactive.stop();
  19232. activeFeedback = null;
  19233. this._cancel();
  19234. return this._inactive.force.bind(this._inactive)
  19235. }
  19236. });
  19237. FeedbackEmitter.lock = function(deferred) {
  19238. var lockInactive = activeFeedback ? activeFeedback.lockInactive() : commonUtils.noop;
  19239. deferred.done(lockInactive)
  19240. };
  19241. registerEmitter({
  19242. emitter: FeedbackEmitter,
  19243. events: [ACTIVE_EVENT_NAME, INACTIVE_EVENT_NAME]
  19244. });
  19245. exports.lock = FeedbackEmitter.lock;
  19246. exports.active = ACTIVE_EVENT_NAME;
  19247. exports.inactive = INACTIVE_EVENT_NAME
  19248. },
  19249. /*!****************************************************!*\
  19250. !*** ./artifacts/transpiled/ui/collection/item.js ***!
  19251. \****************************************************/
  19252. /*! dynamic exports provided */
  19253. /*! all exports used */
  19254. function(module, exports, __webpack_require__) {
  19255. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  19256. var Class = __webpack_require__( /*! ../../core/class */ 15);
  19257. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  19258. var publicComponentUtils = __webpack_require__( /*! ../../core/utils/public_component */ 131);
  19259. var INVISIBLE_STATE_CLASS = "dx-state-invisible";
  19260. var DISABLED_STATE_CLASS = "dx-state-disabled";
  19261. var ITEM_CONTENT_PLACEHOLDER_CLASS = "dx-item-content-placeholder";
  19262. var forcibleWatcher = function(watchMethod, fn, callback) {
  19263. var filteredCallback = function() {
  19264. var oldValue;
  19265. return function(value) {
  19266. if (oldValue !== value) {
  19267. callback(value, oldValue);
  19268. oldValue = value
  19269. }
  19270. }
  19271. }();
  19272. return {
  19273. dispose: watchMethod(fn, filteredCallback),
  19274. force: function() {
  19275. filteredCallback(fn())
  19276. }
  19277. }
  19278. };
  19279. var CollectionItem = Class.inherit({
  19280. ctor: function($element, options, rawData) {
  19281. this._$element = $element;
  19282. this._options = options;
  19283. this._rawData = rawData;
  19284. publicComponentUtils.attachInstanceToElement($element, this, this._dispose);
  19285. this._render()
  19286. },
  19287. _render: function() {
  19288. var $placeholder = $("<div>").addClass(ITEM_CONTENT_PLACEHOLDER_CLASS);
  19289. this._$element.append($placeholder);
  19290. this._watchers = [];
  19291. this._renderWatchers()
  19292. },
  19293. _renderWatchers: function() {
  19294. this._startWatcher("disabled", this._renderDisabled.bind(this));
  19295. this._startWatcher("visible", this._renderVisible.bind(this))
  19296. },
  19297. _startWatcher: function(field, render) {
  19298. var rawData = this._rawData;
  19299. var exprGetter = this._options.fieldGetter(field);
  19300. var watcher = forcibleWatcher(this._options.watchMethod(), function() {
  19301. return exprGetter(rawData)
  19302. }, function(value, oldValue) {
  19303. this._dirty = true;
  19304. render(value, oldValue)
  19305. }.bind(this));
  19306. this._watchers.push(watcher)
  19307. },
  19308. setDataField: function() {
  19309. this._dirty = false;
  19310. each(this._watchers, function(_, watcher) {
  19311. watcher.force()
  19312. });
  19313. if (this._dirty) {
  19314. return true
  19315. }
  19316. },
  19317. _renderDisabled: function(value, oldValue) {
  19318. this._$element.toggleClass(DISABLED_STATE_CLASS, !!value);
  19319. this._updateOwnerFocus(value)
  19320. },
  19321. _updateOwnerFocus: function(isDisabled) {
  19322. var ownerComponent = this._options.owner;
  19323. if (ownerComponent && isDisabled) {
  19324. ownerComponent._resetItemFocus(this._$element)
  19325. }
  19326. },
  19327. _renderVisible: function(value, oldValue) {
  19328. this._$element.toggleClass(INVISIBLE_STATE_CLASS, void 0 !== value && !value)
  19329. },
  19330. _dispose: function() {
  19331. each(this._watchers, function(_, watcher) {
  19332. watcher.dispose()
  19333. })
  19334. }
  19335. });
  19336. CollectionItem.getInstance = function($element) {
  19337. return publicComponentUtils.getInstanceByElement($element, this)
  19338. };
  19339. module.exports = CollectionItem
  19340. },
  19341. /*!*************************************************************!*\
  19342. !*** ./artifacts/transpiled/localization/globalize/core.js ***!
  19343. \*************************************************************/
  19344. /*! dynamic exports provided */
  19345. /*! all exports used */
  19346. function(module, exports, __webpack_require__) {
  19347. var Globalize = __webpack_require__( /*! globalize */ 72);
  19348. var coreLocalization = __webpack_require__( /*! ../core */ 87);
  19349. if (Globalize && Globalize.load) {
  19350. var likelySubtags = {
  19351. supplemental: {
  19352. version: {
  19353. _cldrVersion: "28",
  19354. _unicodeVersion: "8.0.0",
  19355. _number: "$Revision: 11965 $"
  19356. },
  19357. likelySubtags: {
  19358. en: "en-Latn-US",
  19359. de: "de-Latn-DE",
  19360. ru: "ru-Cyrl-RU",
  19361. ja: "ja-Jpan-JP"
  19362. }
  19363. }
  19364. };
  19365. if (!Globalize.locale()) {
  19366. Globalize.load(likelySubtags);
  19367. Globalize.locale("en")
  19368. }
  19369. coreLocalization.inject({
  19370. locale: function(_locale) {
  19371. if (!_locale) {
  19372. return Globalize.locale().locale
  19373. }
  19374. Globalize.locale(_locale)
  19375. }
  19376. })
  19377. }
  19378. },
  19379. /*!*****************************************************!*\
  19380. !*** ./artifacts/transpiled/events/double_click.js ***!
  19381. \*****************************************************/
  19382. /*! dynamic exports provided */
  19383. /*! all exports used */
  19384. function(module, exports, __webpack_require__) {
  19385. var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
  19386. var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12);
  19387. var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
  19388. var Class = __webpack_require__( /*! ../core/class */ 15);
  19389. var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71);
  19390. var clickEvent = __webpack_require__( /*! ./click */ 19);
  19391. var eventUtils = __webpack_require__( /*! ./utils */ 8);
  19392. var DBLCLICK_EVENT_NAME = "dxdblclick";
  19393. var DBLCLICK_NAMESPACE = "dxDblClick";
  19394. var NAMESPACED_CLICK_EVENT = eventUtils.addNamespace(clickEvent.name, DBLCLICK_NAMESPACE);
  19395. var DBLCLICK_TIMEOUT = 300;
  19396. var DblClick = Class.inherit({
  19397. ctor: function() {
  19398. this._handlerCount = 0;
  19399. this._forgetLastClick()
  19400. },
  19401. _forgetLastClick: function() {
  19402. this._firstClickTarget = null;
  19403. this._lastClickTimeStamp = -DBLCLICK_TIMEOUT
  19404. },
  19405. add: function() {
  19406. if (this._handlerCount <= 0) {
  19407. eventsEngine.on(domAdapter.getDocument(), NAMESPACED_CLICK_EVENT, this._clickHandler.bind(this))
  19408. }
  19409. this._handlerCount++
  19410. },
  19411. _clickHandler: function(e) {
  19412. var timeStamp = e.timeStamp || Date.now();
  19413. if (timeStamp - this._lastClickTimeStamp < DBLCLICK_TIMEOUT) {
  19414. eventUtils.fireEvent({
  19415. type: DBLCLICK_EVENT_NAME,
  19416. target: domUtils.closestCommonParent(this._firstClickTarget, e.target),
  19417. originalEvent: e
  19418. });
  19419. this._forgetLastClick()
  19420. } else {
  19421. this._firstClickTarget = e.target;
  19422. this._lastClickTimeStamp = timeStamp
  19423. }
  19424. },
  19425. remove: function() {
  19426. this._handlerCount--;
  19427. if (this._handlerCount <= 0) {
  19428. this._forgetLastClick();
  19429. eventsEngine.off(domAdapter.getDocument(), NAMESPACED_CLICK_EVENT)
  19430. }
  19431. }
  19432. });
  19433. registerEvent(DBLCLICK_EVENT_NAME, new DblClick);
  19434. exports.name = DBLCLICK_EVENT_NAME
  19435. },
  19436. /*!**************************************************!*\
  19437. !*** ./artifacts/transpiled/core/utils/error.js ***!
  19438. \**************************************************/
  19439. /*! dynamic exports provided */
  19440. /*! all exports used */
  19441. function(module, exports, __webpack_require__) {
  19442. var extend = __webpack_require__( /*! ./extend */ 0).extend;
  19443. var consoleUtils = __webpack_require__( /*! ./console */ 73);
  19444. var stringUtils = __webpack_require__( /*! ./string */ 44);
  19445. var version = __webpack_require__( /*! ../version */ 157);
  19446. var ERROR_URL = "http://js.devexpress.com/error/" + version.split(".").slice(0, 2).join("_") + "/";
  19447. module.exports = function(baseErrors, errors) {
  19448. var exports = {
  19449. ERROR_MESSAGES: extend(errors, baseErrors),
  19450. Error: function() {
  19451. return makeError([].slice.call(arguments))
  19452. },
  19453. log: function(id) {
  19454. var method = "log";
  19455. if (/^E\d+$/.test(id)) {
  19456. method = "error"
  19457. } else {
  19458. if (/^W\d+$/.test(id)) {
  19459. method = "warn"
  19460. }
  19461. }
  19462. consoleUtils.logger[method]("log" === method ? id : combineMessage([].slice.call(arguments)))
  19463. }
  19464. };
  19465. var combineMessage = function(args) {
  19466. var id = args[0];
  19467. args = args.slice(1);
  19468. return formatMessage(id, formatDetails(id, args))
  19469. };
  19470. var formatDetails = function(id, args) {
  19471. args = [exports.ERROR_MESSAGES[id]].concat(args);
  19472. return stringUtils.format.apply(this, args).replace(/\.*\s*?$/, "")
  19473. };
  19474. var formatMessage = function(id, details) {
  19475. return stringUtils.format.apply(this, ["{0} - {1}. See:\n{2}", id, details, getErrorUrl(id)])
  19476. };
  19477. var makeError = function(args) {
  19478. var id = args[0];
  19479. args = args.slice(1);
  19480. var details = formatDetails(id, args);
  19481. var url = getErrorUrl(id);
  19482. var message = formatMessage(id, details);
  19483. return extend(new Error(message), {
  19484. __id: id,
  19485. __details: details,
  19486. url: url
  19487. })
  19488. };
  19489. var getErrorUrl = function(id) {
  19490. return ERROR_URL + id
  19491. };
  19492. return exports
  19493. }
  19494. },
  19495. /*!*************************************************************!*\
  19496. !*** ./artifacts/transpiled/core/utils/resize_callbacks.js ***!
  19497. \*************************************************************/
  19498. /*! dynamic exports provided */
  19499. /*! all exports used */
  19500. function(module, exports, __webpack_require__) {
  19501. var windowUtils = __webpack_require__( /*! ./window */ 7);
  19502. var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11);
  19503. var Callbacks = __webpack_require__( /*! ./callbacks */ 26);
  19504. var readyCallbacks = __webpack_require__( /*! ./ready_callbacks */ 48);
  19505. var callOnce = __webpack_require__( /*! ./call_once */ 63);
  19506. var resizeCallbacks = function() {
  19507. var prevSize;
  19508. var callbacks = Callbacks();
  19509. var originalCallbacksAdd = callbacks.add;
  19510. var originalCallbacksRemove = callbacks.remove;
  19511. if (!windowUtils.hasWindow()) {
  19512. return callbacks
  19513. }
  19514. var formatSize = function() {
  19515. var window = windowUtils.getWindow();
  19516. return {
  19517. width: window.innerWidth,
  19518. height: window.innerHeight
  19519. }
  19520. };
  19521. var handleResize = function() {
  19522. var now = formatSize();
  19523. if (now.width === prevSize.width && now.height === prevSize.height) {
  19524. return
  19525. }
  19526. var changedDimension;
  19527. if (now.width === prevSize.width) {
  19528. changedDimension = "height"
  19529. }
  19530. if (now.height === prevSize.height) {
  19531. changedDimension = "width"
  19532. }
  19533. prevSize = now;
  19534. callbacks.fire(changedDimension)
  19535. };
  19536. var setPrevSize = callOnce(function() {
  19537. prevSize = formatSize()
  19538. });
  19539. var removeListener;
  19540. callbacks.add = function() {
  19541. var result = originalCallbacksAdd.apply(callbacks, arguments);
  19542. setPrevSize();
  19543. readyCallbacks.add(function() {
  19544. if (!removeListener && callbacks.has()) {
  19545. removeListener = domAdapter.listen(windowUtils.getWindow(), "resize", handleResize)
  19546. }
  19547. });
  19548. return result
  19549. };
  19550. callbacks.remove = function() {
  19551. var result = originalCallbacksRemove.apply(callbacks, arguments);
  19552. if (!callbacks.has() && removeListener) {
  19553. removeListener();
  19554. removeListener = void 0
  19555. }
  19556. return result
  19557. };
  19558. return callbacks
  19559. }();
  19560. module.exports = resizeCallbacks
  19561. },
  19562. /*!*************************************************************!*\
  19563. !*** ./artifacts/transpiled/core/utils/public_component.js ***!
  19564. \*************************************************************/
  19565. /*! dynamic exports provided */
  19566. /*! all exports used */
  19567. function(module, exports, __webpack_require__) {
  19568. var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39);
  19569. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  19570. var WeakMap = __webpack_require__( /*! ../polyfills/weak_map */ 176);
  19571. var isDefined = __webpack_require__( /*! ./type */ 1).isDefined;
  19572. var removeEvent = __webpack_require__( /*! ../remove_event */ 132);
  19573. var COMPONENT_NAMES_DATA_KEY = "dxComponents";
  19574. var ANONYMOUS_COMPONENT_DATA_KEY = "dxPrivateComponent";
  19575. var componentNames = new WeakMap;
  19576. var nextAnonymousComponent = 0;
  19577. var getName = exports.name = function(componentClass, newName) {
  19578. if (isDefined(newName)) {
  19579. componentNames.set(componentClass, newName);
  19580. return
  19581. }
  19582. if (!componentNames.has(componentClass)) {
  19583. var generatedName = ANONYMOUS_COMPONENT_DATA_KEY + nextAnonymousComponent++;
  19584. componentNames.set(componentClass, generatedName);
  19585. return generatedName
  19586. }
  19587. return componentNames.get(componentClass)
  19588. };
  19589. exports.attachInstanceToElement = function($element, componentInstance, disposeFn) {
  19590. var data = dataUtils.data($element.get(0));
  19591. var name = getName(componentInstance.constructor);
  19592. data[name] = componentInstance;
  19593. if (disposeFn) {
  19594. eventsEngine.one($element, removeEvent, function() {
  19595. disposeFn.call(componentInstance)
  19596. })
  19597. }
  19598. if (!data[COMPONENT_NAMES_DATA_KEY]) {
  19599. data[COMPONENT_NAMES_DATA_KEY] = []
  19600. }
  19601. data[COMPONENT_NAMES_DATA_KEY].push(name)
  19602. };
  19603. exports.getInstanceByElement = function($element, componentClass) {
  19604. var name = getName(componentClass);
  19605. return dataUtils.data($element.get(0), name)
  19606. }
  19607. },
  19608. /*!***************************************************!*\
  19609. !*** ./artifacts/transpiled/core/remove_event.js ***!
  19610. \***************************************************/
  19611. /*! dynamic exports provided */
  19612. /*! all exports used */
  19613. function(module, exports, __webpack_require__) {
  19614. var $ = __webpack_require__( /*! ./renderer */ 2);
  19615. var beforeCleanData = __webpack_require__( /*! ./element_data */ 39).beforeCleanData;
  19616. var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
  19617. var registerEvent = __webpack_require__( /*! ../events/core/event_registrator */ 71);
  19618. var eventName = "dxremove";
  19619. var eventPropName = "dxRemoveEvent";
  19620. beforeCleanData(function(elements) {
  19621. elements = [].slice.call(elements);
  19622. for (var i = 0; i < elements.length; i++) {
  19623. var $element = $(elements[i]);
  19624. if ($element.prop(eventPropName)) {
  19625. $element[0][eventPropName] = null;
  19626. eventsEngine.triggerHandler($element, eventName)
  19627. }
  19628. }
  19629. });
  19630. registerEvent(eventName, {
  19631. noBubble: true,
  19632. setup: function(element) {
  19633. $(element).prop(eventPropName, true)
  19634. }
  19635. });
  19636. module.exports = eventName
  19637. },
  19638. /*!************************************************!*\
  19639. !*** ./artifacts/transpiled/core/component.js ***!
  19640. \************************************************/
  19641. /*! dynamic exports provided */
  19642. /*! all exports used */
  19643. function(module, exports, __webpack_require__) {
  19644. function _typeof(obj) {
  19645. "@babel/helpers - typeof";
  19646. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  19647. return typeof obj
  19648. } : function(obj) {
  19649. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  19650. }, _typeof(obj)
  19651. }
  19652. function _toConsumableArray(arr) {
  19653. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread()
  19654. }
  19655. function _nonIterableSpread() {
  19656. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  19657. }
  19658. function _unsupportedIterableToArray(o, minLen) {
  19659. if (!o) {
  19660. return
  19661. }
  19662. if ("string" === typeof o) {
  19663. return _arrayLikeToArray(o, minLen)
  19664. }
  19665. var n = Object.prototype.toString.call(o).slice(8, -1);
  19666. if ("Object" === n && o.constructor) {
  19667. n = o.constructor.name
  19668. }
  19669. if ("Map" === n || "Set" === n) {
  19670. return Array.from(o)
  19671. }
  19672. if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
  19673. return _arrayLikeToArray(o, minLen)
  19674. }
  19675. }
  19676. function _iterableToArray(iter) {
  19677. if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) {
  19678. return Array.from(iter)
  19679. }
  19680. }
  19681. function _arrayWithoutHoles(arr) {
  19682. if (Array.isArray(arr)) {
  19683. return _arrayLikeToArray(arr)
  19684. }
  19685. }
  19686. function _arrayLikeToArray(arr, len) {
  19687. if (null == len || len > arr.length) {
  19688. len = arr.length
  19689. }
  19690. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  19691. arr2[i] = arr[i]
  19692. }
  19693. return arr2
  19694. }
  19695. function _classCallCheck(instance, Constructor) {
  19696. if (!(instance instanceof Constructor)) {
  19697. throw new TypeError("Cannot call a class as a function")
  19698. }
  19699. }
  19700. function _defineProperties(target, props) {
  19701. for (var i = 0; i < props.length; i++) {
  19702. var descriptor = props[i];
  19703. descriptor.enumerable = descriptor.enumerable || false;
  19704. descriptor.configurable = true;
  19705. if ("value" in descriptor) {
  19706. descriptor.writable = true
  19707. }
  19708. Object.defineProperty(target, descriptor.key, descriptor)
  19709. }
  19710. }
  19711. function _createClass(Constructor, protoProps, staticProps) {
  19712. if (protoProps) {
  19713. _defineProperties(Constructor.prototype, protoProps)
  19714. }
  19715. if (staticProps) {
  19716. _defineProperties(Constructor, staticProps)
  19717. }
  19718. Object.defineProperty(Constructor, "prototype", {
  19719. writable: false
  19720. });
  19721. return Constructor
  19722. }
  19723. var Config = __webpack_require__( /*! ./config */ 31);
  19724. var domAdapter = __webpack_require__( /*! ./dom_adapter */ 11);
  19725. var extend = __webpack_require__( /*! ./utils/extend */ 0).extend;
  19726. var Class = __webpack_require__( /*! ./class */ 15);
  19727. var Action = __webpack_require__( /*! ./action */ 111);
  19728. var errors = __webpack_require__( /*! ./errors */ 21);
  19729. var coreDataUtils = __webpack_require__( /*! ./utils/data */ 20);
  19730. var commonUtils = __webpack_require__( /*! ./utils/common */ 4);
  19731. var typeUtils = __webpack_require__( /*! ./utils/type */ 1);
  19732. var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
  19733. var Deferred = deferredUtils.Deferred;
  19734. var when = deferredUtils.when;
  19735. var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26);
  19736. var EventsMixin = __webpack_require__( /*! ./events_mixin */ 82);
  19737. var publicComponentUtils = __webpack_require__( /*! ./utils/public_component */ 131);
  19738. var devices = __webpack_require__( /*! ./devices */ 16);
  19739. var isFunction = typeUtils.isFunction;
  19740. var noop = commonUtils.noop;
  19741. var cachedGetters = {};
  19742. var cachedSetters = {};
  19743. var PostponedOperations = function() {
  19744. function PostponedOperations() {
  19745. _classCallCheck(this, PostponedOperations);
  19746. this._postponedOperations = {}
  19747. }
  19748. _createClass(PostponedOperations, [{
  19749. key: "add",
  19750. value: function(key, fn, postponedPromise) {
  19751. if (key in this._postponedOperations) {
  19752. postponedPromise && this._postponedOperations[key].promises.push(postponedPromise)
  19753. } else {
  19754. var completePromise = new Deferred;
  19755. this._postponedOperations[key] = {
  19756. fn: fn,
  19757. completePromise: completePromise,
  19758. promises: postponedPromise ? [postponedPromise] : []
  19759. }
  19760. }
  19761. return this._postponedOperations[key].completePromise.promise()
  19762. }
  19763. }, {
  19764. key: "callPostponedOperations",
  19765. value: function() {
  19766. for (var key in this._postponedOperations) {
  19767. var operation = this._postponedOperations[key];
  19768. if (typeUtils.isDefined(operation)) {
  19769. if (operation.promises && operation.promises.length) {
  19770. when.apply(void 0, _toConsumableArray(operation.promises)).done(operation.fn).then(operation.completePromise.resolve)
  19771. } else {
  19772. operation.fn().done(operation.completePromise.resolve)
  19773. }
  19774. }
  19775. }
  19776. this._postponedOperations = {}
  19777. }
  19778. }]);
  19779. return PostponedOperations
  19780. }();
  19781. var Component = Class.inherit({
  19782. _setDeprecatedOptions: function() {
  19783. this._deprecatedOptions = {}
  19784. },
  19785. _getDeprecatedOptions: function() {
  19786. return this._deprecatedOptions
  19787. },
  19788. _getOptionAliasesByName: function(optionName) {
  19789. var _this = this;
  19790. return Object.keys(this._deprecatedOptions).filter(function(aliasName) {
  19791. return optionName === _this._deprecatedOptions[aliasName].alias
  19792. })
  19793. },
  19794. _getDefaultOptions: function() {
  19795. return {
  19796. onInitialized: null,
  19797. onOptionChanged: null,
  19798. onDisposing: null,
  19799. defaultOptionsRules: null
  19800. }
  19801. },
  19802. _setDefaultOptions: function() {
  19803. this._options = this._getDefaultOptions()
  19804. },
  19805. _defaultOptionsRules: function() {
  19806. return []
  19807. },
  19808. _setOptionsByDevice: function(customRules) {
  19809. var rules = this._defaultOptionsRules();
  19810. if (Array.isArray(customRules)) {
  19811. rules = rules.concat(customRules)
  19812. }
  19813. var rulesOptions = this._convertRulesToOptions(rules);
  19814. extend(true, this._options, rulesOptions);
  19815. for (var fieldName in this._optionsByReference) {
  19816. if (Object.prototype.hasOwnProperty.call(rulesOptions, fieldName)) {
  19817. this._options[fieldName] = rulesOptions[fieldName]
  19818. }
  19819. }
  19820. },
  19821. _convertRulesToOptions: function(rules) {
  19822. var options = {};
  19823. var currentDevice = devices.current();
  19824. var deviceMatch = function(device, filter) {
  19825. var filterArray = [];
  19826. Array.prototype.push.call(filterArray, filter);
  19827. return 1 === filterArray.length && typeUtils.isEmptyObject(filterArray[0]) || commonUtils.findBestMatches(device, filterArray).length > 0
  19828. };
  19829. for (var i = 0; i < rules.length; i++) {
  19830. var rule = rules[i];
  19831. var deviceFilter = rule.device || {};
  19832. var match;
  19833. if (isFunction(deviceFilter)) {
  19834. match = deviceFilter(currentDevice)
  19835. } else {
  19836. match = deviceMatch(currentDevice, deviceFilter)
  19837. }
  19838. if (match) {
  19839. extend(options, rule.options)
  19840. }
  19841. }
  19842. return options
  19843. },
  19844. _isInitialOptionValue: function(name) {
  19845. var optionValue = this.option(name);
  19846. var initialOptionValue = this.initialOption(name);
  19847. var isInitialOption = isFunction(optionValue) && isFunction(initialOptionValue) ? optionValue.toString() === initialOptionValue.toString() : commonUtils.equalByValue(optionValue, initialOptionValue);
  19848. return isInitialOption
  19849. },
  19850. _setOptionsByReference: function() {
  19851. this._optionsByReference = {}
  19852. },
  19853. _getOptionsByReference: function() {
  19854. return this._optionsByReference
  19855. },
  19856. ctor: function(options) {
  19857. this.NAME = publicComponentUtils.name(this.constructor);
  19858. options = options || {};
  19859. if (options.eventsStrategy) {
  19860. this.setEventsStrategy(options.eventsStrategy)
  19861. }
  19862. this._options = {};
  19863. this._updateLockCount = 0;
  19864. this._optionChangedCallbacks = options._optionChangedCallbacks || Callbacks();
  19865. this._disposingCallbacks = options._disposingCallbacks || Callbacks();
  19866. this.postponedOperations = new PostponedOperations;
  19867. this.beginUpdate();
  19868. try {
  19869. this._suppressDeprecatedWarnings();
  19870. this._setOptionsByReference();
  19871. this._setDeprecatedOptions();
  19872. this._setDefaultOptions();
  19873. if (options && options.onInitializing) {
  19874. options.onInitializing.apply(this, [options])
  19875. }
  19876. this._setOptionsByDevice(options.defaultOptionsRules);
  19877. this._resumeDeprecatedWarnings();
  19878. this._initOptions(options)
  19879. } finally {
  19880. this.endUpdate()
  19881. }
  19882. },
  19883. _initOptions: function(options) {
  19884. this.option(options)
  19885. },
  19886. _optionValuesEqual: function(name, oldValue, newValue) {
  19887. oldValue = coreDataUtils.toComparable(oldValue, true);
  19888. newValue = coreDataUtils.toComparable(newValue, true);
  19889. if (oldValue && newValue && typeUtils.isRenderer(oldValue) && typeUtils.isRenderer(newValue)) {
  19890. return newValue.is(oldValue)
  19891. }
  19892. var oldValueIsNaN = oldValue !== oldValue;
  19893. var newValueIsNaN = newValue !== newValue;
  19894. if (oldValueIsNaN && newValueIsNaN) {
  19895. return true
  19896. }
  19897. if (null === oldValue || "object" !== _typeof(oldValue) || domAdapter.isElementNode(oldValue)) {
  19898. return oldValue === newValue
  19899. }
  19900. return false
  19901. },
  19902. _init: function() {
  19903. this._createOptionChangedAction();
  19904. this.on("disposing", function(args) {
  19905. this._disposingCallbacks.fireWith(this, [args])
  19906. }.bind(this))
  19907. },
  19908. _createOptionChangedAction: function() {
  19909. this._optionChangedAction = this._createActionByOption("onOptionChanged", {
  19910. excludeValidators: ["disabled", "readOnly"]
  19911. })
  19912. },
  19913. _createDisposingAction: function() {
  19914. this._disposingAction = this._createActionByOption("onDisposing", {
  19915. excludeValidators: ["disabled", "readOnly"]
  19916. })
  19917. },
  19918. _optionChanged: function(args) {
  19919. switch (args.name) {
  19920. case "onDisposing":
  19921. case "onInitialized":
  19922. break;
  19923. case "onOptionChanged":
  19924. this._createOptionChangedAction();
  19925. break;
  19926. case "defaultOptionsRules":
  19927. }
  19928. },
  19929. _dispose: function() {
  19930. this._optionChangedCallbacks.empty();
  19931. this._createDisposingAction();
  19932. this._disposingAction();
  19933. this._disposeEvents();
  19934. this._disposed = true
  19935. },
  19936. instance: function() {
  19937. return this
  19938. },
  19939. beginUpdate: function() {
  19940. this._updateLockCount++
  19941. },
  19942. endUpdate: function() {
  19943. this._updateLockCount = Math.max(this._updateLockCount - 1, 0);
  19944. if (!this._updateLockCount) {
  19945. this.postponedOperations.callPostponedOperations();
  19946. if (!this._initializing && !this._initialized) {
  19947. this._initializing = true;
  19948. try {
  19949. this._init()
  19950. } finally {
  19951. this._initializing = false;
  19952. this._updateLockCount++;
  19953. this._createActionByOption("onInitialized", {
  19954. excludeValidators: ["disabled", "readOnly"]
  19955. })();
  19956. this._updateLockCount--;
  19957. this._initialized = true
  19958. }
  19959. }
  19960. }
  19961. },
  19962. _logWarningIfDeprecated: function(option) {
  19963. var info = this._deprecatedOptions[option];
  19964. if (info && !this._deprecatedOptionsSuppressed) {
  19965. this._logDeprecatedWarning(option, info)
  19966. }
  19967. },
  19968. _logDeprecatedWarningCount: 0,
  19969. _logDeprecatedWarning: function(option, info) {
  19970. var message = info.message || "Use the '" + info.alias + "' option instead";
  19971. errors.log("W0001", this.NAME, option, info.since, message);
  19972. ++this._logDeprecatedWarningCount
  19973. },
  19974. _suppressDeprecatedWarnings: function() {
  19975. this._deprecatedOptionsSuppressed = true
  19976. },
  19977. _resumeDeprecatedWarnings: function() {
  19978. this._deprecatedOptionsSuppressed = false
  19979. },
  19980. _optionChanging: noop,
  19981. _notifyOptionChanged: function(option, value, previousValue) {
  19982. var that = this;
  19983. if (this._initialized) {
  19984. var optionNames = [option].concat(that._getOptionAliasesByName(option));
  19985. for (var i = 0; i < optionNames.length; i++) {
  19986. var name = optionNames[i];
  19987. var args = {
  19988. name: name.split(/[.[]/)[0],
  19989. fullName: name,
  19990. value: value,
  19991. previousValue: previousValue
  19992. };
  19993. that._optionChangedCallbacks.fireWith(that, [extend(that._defaultActionArgs(), args)]);
  19994. that._optionChangedAction(extend({}, args));
  19995. if (!that._disposed && this._cancelOptionChange !== args.name) {
  19996. that._optionChanged(args)
  19997. }
  19998. }
  19999. }
  20000. },
  20001. initialOption: function(optionName) {
  20002. var currentOptions;
  20003. var currentInitialized = this._initialized;
  20004. if (!this._initialOptions) {
  20005. currentOptions = this._options;
  20006. this._options = {};
  20007. this._initialized = false;
  20008. this._setDefaultOptions();
  20009. this._setOptionsByDevice(currentOptions.defaultOptionsRules);
  20010. this._initialOptions = this._options;
  20011. this._options = currentOptions;
  20012. this._initialized = currentInitialized
  20013. }
  20014. return this._initialOptions[optionName]
  20015. },
  20016. _defaultActionConfig: function() {
  20017. return {
  20018. context: this,
  20019. component: this
  20020. }
  20021. },
  20022. _defaultActionArgs: function() {
  20023. return {
  20024. component: this
  20025. }
  20026. },
  20027. _createAction: function(actionSource, config) {
  20028. var that = this;
  20029. var action;
  20030. return function(e) {
  20031. if (!arguments.length) {
  20032. e = {}
  20033. }
  20034. if (!typeUtils.isPlainObject(e)) {
  20035. e = {
  20036. actionValue: e
  20037. }
  20038. }
  20039. action = action || new Action(actionSource, extend(config, that._defaultActionConfig()));
  20040. return action.execute.call(action, extend(e, that._defaultActionArgs()))
  20041. }
  20042. },
  20043. _createActionByOption: function(optionName, config) {
  20044. var that = this;
  20045. var action;
  20046. var eventName;
  20047. var actionFunc;
  20048. var result = function() {
  20049. if (!eventName) {
  20050. config = config || {};
  20051. if ("string" !== typeof optionName) {
  20052. throw errors.Error("E0008")
  20053. }
  20054. if (0 === optionName.indexOf("on")) {
  20055. eventName = that._getEventName(optionName)
  20056. }
  20057. if (0 !== optionName.indexOf("on")) {
  20058. throw Error("The '" + optionName + "' option name should start with 'on' prefix")
  20059. }
  20060. actionFunc = that.option(optionName)
  20061. }
  20062. if (!action && !actionFunc && !config.beforeExecute && !config.afterExecute && !that.hasEvent(eventName)) {
  20063. return
  20064. }
  20065. if (!action) {
  20066. var beforeExecute = config.beforeExecute;
  20067. config.beforeExecute = function(args) {
  20068. beforeExecute && beforeExecute.apply(that, arguments);
  20069. that.fireEvent(eventName, args.args)
  20070. };
  20071. that._suppressDeprecatedWarnings();
  20072. action = that._createAction(actionFunc, config);
  20073. that._resumeDeprecatedWarnings()
  20074. }
  20075. if (Config().wrapActionsBeforeExecute) {
  20076. var beforeActionExecute = that.option("beforeActionExecute") || noop;
  20077. var wrappedAction = beforeActionExecute(that, action, config) || action;
  20078. return wrappedAction.apply(that, arguments)
  20079. }
  20080. return action.apply(that, arguments)
  20081. };
  20082. if (!Config().wrapActionsBeforeExecute) {
  20083. var onActionCreated = that.option("onActionCreated") || noop;
  20084. result = onActionCreated(that, result, config) || result
  20085. }
  20086. return result
  20087. },
  20088. _getEventName: function(actionName) {
  20089. return actionName.charAt(2).toLowerCase() + actionName.substr(3)
  20090. },
  20091. hasActionSubscription: function(actionName) {
  20092. return !!this.option(actionName) || this.hasEvent(this._getEventName(actionName))
  20093. },
  20094. isOptionDeprecated: function(name) {
  20095. var deprecatedOptions = this._getDeprecatedOptions();
  20096. return Object.prototype.hasOwnProperty.call(deprecatedOptions, name)
  20097. },
  20098. _setOptionSilent: function(name, value) {
  20099. this._cancelOptionChange = name;
  20100. this.option(name, value);
  20101. this._cancelOptionChange = false
  20102. },
  20103. option: function() {
  20104. var normalizeOptionName = function(that, name) {
  20105. var deprecate;
  20106. if (name) {
  20107. if (!that._cachedDeprecateNames) {
  20108. that._cachedDeprecateNames = [];
  20109. for (var optionName in that._deprecatedOptions) {
  20110. that._cachedDeprecateNames.push(optionName)
  20111. }
  20112. }
  20113. for (var i = 0; i < that._cachedDeprecateNames.length; i++) {
  20114. if (that._cachedDeprecateNames[i] === name) {
  20115. deprecate = that._deprecatedOptions[name];
  20116. break
  20117. }
  20118. }
  20119. if (deprecate) {
  20120. that._logWarningIfDeprecated(name);
  20121. var alias = deprecate.alias;
  20122. if (alias) {
  20123. name = alias
  20124. }
  20125. }
  20126. }
  20127. return name
  20128. };
  20129. var getPreviousName = function(fullName) {
  20130. var splitNames = fullName.split(".");
  20131. splitNames.pop();
  20132. return splitNames.join(".")
  20133. };
  20134. var getFieldName = function(fullName) {
  20135. var splitNames = fullName.split(".");
  20136. return splitNames[splitNames.length - 1]
  20137. };
  20138. var getOptionValue = function(options, name, unwrapObservables) {
  20139. var getter = cachedGetters[name];
  20140. if (!getter) {
  20141. getter = cachedGetters[name] = coreDataUtils.compileGetter(name)
  20142. }
  20143. return getter(options, {
  20144. functionsAsIs: true,
  20145. unwrapObservables: unwrapObservables
  20146. })
  20147. };
  20148. var clearOptionsField = function(options, name) {
  20149. delete options[name];
  20150. var previousFieldName = getPreviousName(name);
  20151. var fieldName = getFieldName(name);
  20152. var fieldObject = previousFieldName ? getOptionValue(options, previousFieldName, false) : options;
  20153. if (fieldObject) {
  20154. delete fieldObject[fieldName]
  20155. }
  20156. };
  20157. var setOptionsField = function(options, fullName, value) {
  20158. var fieldName = "";
  20159. var fieldObject;
  20160. do {
  20161. if (fieldName) {
  20162. fieldName = "." + fieldName
  20163. }
  20164. fieldName = getFieldName(fullName) + fieldName;
  20165. fullName = getPreviousName(fullName);
  20166. fieldObject = fullName ? getOptionValue(options, fullName, false) : options
  20167. } while (!fieldObject);
  20168. fieldObject[fieldName] = value
  20169. };
  20170. var normalizeOptionValue = function(that, options, name, value) {
  20171. if (name) {
  20172. var alias = normalizeOptionName(that, name);
  20173. if (alias && alias !== name) {
  20174. setOptionsField(options, alias, value);
  20175. clearOptionsField(options, name)
  20176. }
  20177. }
  20178. };
  20179. var prepareOption = function prepareOption(that, options, name, value) {
  20180. if (typeUtils.isPlainObject(value)) {
  20181. for (var valueName in value) {
  20182. prepareOption(that, options, name + "." + valueName, value[valueName])
  20183. }
  20184. }
  20185. normalizeOptionValue(that, options, name, value)
  20186. };
  20187. var setOptionValue = function(that, name, value) {
  20188. if (!cachedSetters[name]) {
  20189. cachedSetters[name] = coreDataUtils.compileSetter(name)
  20190. }
  20191. var path = name.split(/[.[]/);
  20192. cachedSetters[name](that._options, value, {
  20193. functionsAsIs: true,
  20194. merge: !that._getOptionsByReference()[name],
  20195. unwrapObservables: path.length > 1 && !!that._getOptionsByReference()[path[0]]
  20196. })
  20197. };
  20198. var setOption = function(that, name, value) {
  20199. var previousValue = getOptionValue(that._options, name, false);
  20200. if (that._optionValuesEqual(name, previousValue, value)) {
  20201. return
  20202. }
  20203. if (that._initialized) {
  20204. that._optionChanging(name, previousValue, value)
  20205. }
  20206. setOptionValue(that, name, value);
  20207. that._notifyOptionChanged(name, value, previousValue)
  20208. };
  20209. return function(options, value) {
  20210. var that = this;
  20211. var name = options;
  20212. if (arguments.length < 2 && "object" !== typeUtils.type(name)) {
  20213. name = normalizeOptionName(that, name);
  20214. return getOptionValue(that._options, name)
  20215. }
  20216. if ("string" === typeof name) {
  20217. options = {};
  20218. options[name] = value
  20219. }
  20220. that.beginUpdate();
  20221. try {
  20222. var optionName;
  20223. for (optionName in options) {
  20224. prepareOption(that, options, optionName, options[optionName])
  20225. }
  20226. for (optionName in options) {
  20227. setOption(that, optionName, options[optionName])
  20228. }
  20229. } finally {
  20230. that.endUpdate()
  20231. }
  20232. }
  20233. }(),
  20234. _getOptionValue: function(name, context) {
  20235. var value = this.option(name);
  20236. if (isFunction(value)) {
  20237. return value.bind(context)()
  20238. }
  20239. return value
  20240. }
  20241. }).include(EventsMixin);
  20242. module.exports = Component;
  20243. module.exports.PostponedOperations = PostponedOperations
  20244. },
  20245. /*!******************************************************************!*\
  20246. !*** ./artifacts/transpiled/ui/widget/child_default_template.js ***!
  20247. \******************************************************************/
  20248. /*! dynamic exports provided */
  20249. /*! all exports used */
  20250. function(module, exports, __webpack_require__) {
  20251. var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
  20252. module.exports = TemplateBase.inherit({
  20253. ctor: function(name) {
  20254. this.name = name
  20255. }
  20256. })
  20257. },
  20258. /*!**************************************************!*\
  20259. !*** ./artifacts/transpiled/data/array_utils.js ***!
  20260. \**************************************************/
  20261. /*! dynamic exports provided */
  20262. /*! all exports used */
  20263. function(module, exports, __webpack_require__) {
  20264. var _type = __webpack_require__( /*! ../core/utils/type */ 1);
  20265. var _config = __webpack_require__( /*! ../core/config */ 31);
  20266. var _config2 = _interopRequireDefault(_config);
  20267. var _guid = __webpack_require__( /*! ../core/guid */ 40);
  20268. var _guid2 = _interopRequireDefault(_guid);
  20269. var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
  20270. var _errors = __webpack_require__( /*! ./errors */ 36);
  20271. var _object = __webpack_require__( /*! ../core/utils/object */ 47);
  20272. var _object2 = _interopRequireDefault(_object);
  20273. var _utils = __webpack_require__( /*! ./utils */ 41);
  20274. function _interopRequireDefault(obj) {
  20275. return obj && obj.__esModule ? obj : {
  20276. "default": obj
  20277. }
  20278. }
  20279. function _typeof(obj) {
  20280. "@babel/helpers - typeof";
  20281. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  20282. return typeof obj
  20283. } : function(obj) {
  20284. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  20285. }, _typeof(obj)
  20286. }
  20287. function hasKey(target, keyOrKeys) {
  20288. var keys = "string" === typeof keyOrKeys ? keyOrKeys.split() : keyOrKeys.slice();
  20289. while (keys.length) {
  20290. var key = keys.shift();
  20291. if (key in target) {
  20292. return true
  20293. }
  20294. }
  20295. return false
  20296. }
  20297. function findItems(keyInfo, items, key, groupCount) {
  20298. if (groupCount) {
  20299. for (var i = 0; i < items.length; i++) {
  20300. var childItems = items[i].items || items[i].collapsedItems || [];
  20301. var result = findItems(keyInfo, childItems || [], key, groupCount - 1);
  20302. if (result) {
  20303. return result
  20304. }
  20305. }
  20306. } else {
  20307. if (indexByKey(keyInfo, items, key) >= 0) {
  20308. return items
  20309. }
  20310. }
  20311. }
  20312. function getItems(keyInfo, items, key, groupCount) {
  20313. if (groupCount) {
  20314. return findItems(keyInfo, items, key, groupCount) || []
  20315. }
  20316. return items
  20317. }
  20318. function generateDataByKeyMap(keyInfo, array) {
  20319. if (keyInfo.key() && !array._dataByKeyMap) {
  20320. var dataByKeyMap = {};
  20321. for (var i = 0, arrayLength = array.length; i < arrayLength; i++) {
  20322. dataByKeyMap[JSON.stringify(keyInfo.keyOf(array[i]))] = array[i]
  20323. }
  20324. array._dataByKeyMap = dataByKeyMap
  20325. }
  20326. }
  20327. function getCacheValue(array, key) {
  20328. if (array._dataByKeyMap) {
  20329. return array._dataByKeyMap[JSON.stringify(key)]
  20330. }
  20331. }
  20332. function getHasKeyCacheValue(array, key) {
  20333. if (array._dataByKeyMap) {
  20334. return array._dataByKeyMap[JSON.stringify(key)]
  20335. }
  20336. return true
  20337. }
  20338. function setDataByKeyMapValue(array, key, data) {
  20339. if (array._dataByKeyMap) {
  20340. array._dataByKeyMap[JSON.stringify(key)] = data
  20341. }
  20342. }
  20343. function applyBatch(keyInfo, array, batchData, groupCount, useInsertIndex) {
  20344. batchData.forEach(function(item) {
  20345. var items = "insert" === item.type ? array : getItems(keyInfo, array, item.key, groupCount);
  20346. generateDataByKeyMap(keyInfo, items);
  20347. switch (item.type) {
  20348. case "update":
  20349. update(keyInfo, items, item.key, item.data, true);
  20350. break;
  20351. case "insert":
  20352. insert(keyInfo, items, item.data, useInsertIndex && (0, _type.isDefined)(item.index) ? item.index : -1, true);
  20353. break;
  20354. case "remove":
  20355. remove(keyInfo, items, item.key, true)
  20356. }
  20357. })
  20358. }
  20359. function update(keyInfo, array, key, data, isBatch) {
  20360. var target;
  20361. var extendComplexObject = true;
  20362. var keyExpr = keyInfo.key();
  20363. if (keyExpr) {
  20364. if (hasKey(data, keyExpr) && !(0, _utils.keysEqual)(keyExpr, key, keyInfo.keyOf(data))) {
  20365. return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4017"))
  20366. }
  20367. target = getCacheValue(array, key);
  20368. if (!target) {
  20369. var index = indexByKey(keyInfo, array, key);
  20370. if (index < 0) {
  20371. return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4009"))
  20372. }
  20373. target = array[index]
  20374. }
  20375. } else {
  20376. target = key
  20377. }
  20378. _object2.default.deepExtendArraySafe(target, data, extendComplexObject);
  20379. if (!isBatch) {
  20380. if ((0, _config2.default)().useLegacyStoreResult) {
  20381. return (0, _utils.trivialPromise)(key, data)
  20382. } else {
  20383. return (0, _utils.trivialPromise)(target, key)
  20384. }
  20385. }
  20386. }
  20387. function insert(keyInfo, array, data, index, isBatch) {
  20388. var keyValue;
  20389. var keyExpr = keyInfo.key();
  20390. var obj = (0, _type.isPlainObject)(data) ? (0, _extend.extend)({}, data) : data;
  20391. if (keyExpr) {
  20392. keyValue = keyInfo.keyOf(obj);
  20393. if (void 0 === keyValue || "object" === _typeof(keyValue) && (0, _type.isEmptyObject)(keyValue)) {
  20394. if (Array.isArray(keyExpr)) {
  20395. throw _errors.errors.Error("E4007")
  20396. }
  20397. keyValue = obj[keyExpr] = String(new _guid2.default)
  20398. } else {
  20399. if (void 0 !== array[indexByKey(keyInfo, array, keyValue)]) {
  20400. return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4008"))
  20401. }
  20402. }
  20403. } else {
  20404. keyValue = obj
  20405. }
  20406. if (index >= 0) {
  20407. array.splice(index, 0, obj)
  20408. } else {
  20409. array.push(obj)
  20410. }
  20411. setDataByKeyMapValue(array, keyValue, obj);
  20412. if (!isBatch) {
  20413. return (0, _utils.trivialPromise)((0, _config2.default)().useLegacyStoreResult ? data : obj, keyValue)
  20414. }
  20415. }
  20416. function remove(keyInfo, array, key, isBatch) {
  20417. var index = indexByKey(keyInfo, array, key);
  20418. if (index > -1) {
  20419. array.splice(index, 1)
  20420. }
  20421. if (!isBatch) {
  20422. return (0, _utils.trivialPromise)(key)
  20423. }
  20424. }
  20425. function indexByKey(keyInfo, array, key) {
  20426. var keyExpr = keyInfo.key();
  20427. if (!getHasKeyCacheValue(array, key)) {
  20428. return -1
  20429. }
  20430. for (var i = 0, arrayLength = array.length; i < arrayLength; i++) {
  20431. if ((0, _utils.keysEqual)(keyExpr, keyInfo.keyOf(array[i]), key)) {
  20432. return i
  20433. }
  20434. }
  20435. return -1
  20436. }
  20437. module.exports.applyBatch = applyBatch;
  20438. module.exports.update = update;
  20439. module.exports.insert = insert;
  20440. module.exports.remove = remove;
  20441. module.exports.indexByKey = indexByKey
  20442. }, , , , , , ,
  20443. /*!**************************************************!*\
  20444. !*** ./artifacts/transpiled/viz/core/helpers.js ***!
  20445. \**************************************************/
  20446. /*! dynamic exports provided */
  20447. /*! all exports used */
  20448. function(module, exports, __webpack_require__) {
  20449. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  20450. var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
  20451. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  20452. var isServerSide = !windowUtils.hasWindow();
  20453. function Flags() {
  20454. this.reset()
  20455. }
  20456. Flags.prototype = {
  20457. constructor: Flags,
  20458. add: function(codes) {
  20459. var i;
  20460. var ii = codes.length;
  20461. var flags = this._flags;
  20462. for (i = 0; i < ii; ++i) {
  20463. flags[codes[i]] = 1
  20464. }
  20465. this._k += ii
  20466. },
  20467. has: function(code) {
  20468. return this._flags[code] > 0
  20469. },
  20470. count: function() {
  20471. return this._k
  20472. },
  20473. reset: function() {
  20474. this._flags = {};
  20475. this._k = 0
  20476. }
  20477. };
  20478. function combineMaps(baseMap, thisMap) {
  20479. return baseMap !== thisMap ? _extend({}, baseMap, thisMap) : _extend({}, baseMap)
  20480. }
  20481. function combineLists(baseList, thisList) {
  20482. return baseList !== thisList ? baseList.concat(thisList) : baseList.slice()
  20483. }
  20484. function buildTotalChanges(proto) {
  20485. proto._totalChangesOrder = proto._optionChangesOrder.concat(proto._layoutChangesOrder, proto._customChangesOrder)
  20486. }
  20487. function addChange(settings) {
  20488. var proto = this.prototype;
  20489. var code = settings.code;
  20490. proto["_change_" + code] = settings.handler;
  20491. if (settings.isThemeDependent) {
  20492. proto._themeDependentChanges.push(code)
  20493. }
  20494. if (settings.option) {
  20495. proto._optionChangesMap[settings.option] = code
  20496. }(settings.isOptionChange ? proto._optionChangesOrder : proto._customChangesOrder).push(code);
  20497. buildTotalChanges(proto)
  20498. }
  20499. function createChainExecutor() {
  20500. var executeChain = function executeChain() {
  20501. var i;
  20502. var ii = executeChain._chain.length;
  20503. var result;
  20504. for (i = 0; i < ii; ++i) {
  20505. result = executeChain._chain[i].apply(this, arguments)
  20506. }
  20507. return result
  20508. };
  20509. executeChain._chain = [];
  20510. executeChain.add = function(item) {
  20511. executeChain._chain.push(item)
  20512. };
  20513. executeChain.copy = function(executor) {
  20514. executeChain._chain = executor._chain.slice()
  20515. };
  20516. return executeChain
  20517. }
  20518. function expand(target, name, expander) {
  20519. var current = target[name];
  20520. if (!current) {
  20521. current = expander
  20522. } else {
  20523. if (!current.add) {
  20524. current = createChainExecutor();
  20525. current.add(target[name]);
  20526. current.add(expander)
  20527. } else {
  20528. if (false === Object.prototype.hasOwnProperty.call(target, name)) {
  20529. current = createChainExecutor();
  20530. current.copy(target[name])
  20531. }
  20532. current.add(expander)
  20533. }
  20534. }
  20535. target[name] = current
  20536. }
  20537. function addPlugin(plugin) {
  20538. var proto = this.prototype;
  20539. proto._plugins.push(plugin);
  20540. plugin.fontFields && proto._fontFields.push.apply(proto._fontFields, plugin.fontFields);
  20541. if (plugin.members) {
  20542. _extend(this.prototype, plugin.members)
  20543. }
  20544. if (plugin.customize) {
  20545. plugin.customize(this)
  20546. }
  20547. if (plugin.extenders) {
  20548. Object.keys(plugin.extenders).forEach(function(key) {
  20549. var func = plugin.extenders[key];
  20550. expand(proto, key, func)
  20551. }, this)
  20552. }
  20553. }
  20554. exports.replaceInherit = isServerSide ? function(widget) {
  20555. var _inherit = widget.inherit;
  20556. widget.inherit = function() {
  20557. var result = _inherit.apply(this, arguments);
  20558. var proto = result.prototype;
  20559. ["_plugins", "_eventsMap", "_initialChanges", "_themeDependentChanges", "_optionChangesMap", "_optionChangesOrder", "_layoutChangesOrder", "_customChangesOrder", "_totalChangesOrder"].forEach(function(key) {
  20560. proto[key] = {}
  20561. });
  20562. result.addPlugin = noop;
  20563. return result
  20564. };
  20565. widget.addChange = noop;
  20566. widget.addPlugin = noop
  20567. } : function(widget) {
  20568. var _inherit = widget.inherit;
  20569. widget.inherit = function() {
  20570. var proto = this.prototype;
  20571. var plugins = proto._plugins;
  20572. var fontFields = proto._fontFields;
  20573. var eventsMap = proto._eventsMap;
  20574. var initialChanges = proto._initialChanges;
  20575. var themeDependentChanges = proto._themeDependentChanges;
  20576. var optionChangesMap = proto._optionChangesMap;
  20577. var partialOptionChangesMap = proto._partialOptionChangesMap;
  20578. var partialOptionChangesPath = proto._partialOptionChangesPath;
  20579. var optionChangesOrder = proto._optionChangesOrder;
  20580. var layoutChangesOrder = proto._layoutChangesOrder;
  20581. var customChangesOrder = proto._customChangesOrder;
  20582. var result = _inherit.apply(this, arguments);
  20583. proto = result.prototype;
  20584. proto._plugins = combineLists(plugins, proto._plugins);
  20585. proto._fontFields = combineLists(fontFields, proto._fontFields);
  20586. proto._eventsMap = combineMaps(eventsMap, proto._eventsMap);
  20587. proto._initialChanges = combineLists(initialChanges, proto._initialChanges);
  20588. proto._themeDependentChanges = combineLists(themeDependentChanges, proto._themeDependentChanges);
  20589. proto._optionChangesMap = combineMaps(optionChangesMap, proto._optionChangesMap);
  20590. proto._partialOptionChangesMap = combineMaps(partialOptionChangesMap, proto._partialOptionChangesMap);
  20591. proto._partialOptionChangesPath = combineMaps(partialOptionChangesPath, proto._partialOptionChangesPath);
  20592. proto._optionChangesOrder = combineLists(optionChangesOrder, proto._optionChangesOrder);
  20593. proto._layoutChangesOrder = combineLists(layoutChangesOrder, proto._layoutChangesOrder);
  20594. proto._customChangesOrder = combineLists(customChangesOrder, proto._customChangesOrder);
  20595. buildTotalChanges(proto);
  20596. result.addPlugin = addPlugin;
  20597. return result
  20598. };
  20599. widget.prototype._plugins = [];
  20600. widget.prototype._fontFields = [];
  20601. widget.addChange = addChange;
  20602. widget.addPlugin = addPlugin
  20603. };
  20604. exports.changes = function() {
  20605. return new Flags
  20606. };
  20607. exports.expand = expand
  20608. },
  20609. /*!*******************************************************!*\
  20610. !*** ./artifacts/transpiled/viz/series/bar_series.js ***!
  20611. \*******************************************************/
  20612. /*! dynamic exports provided */
  20613. /*! all exports used */
  20614. function(module, exports, __webpack_require__) {
  20615. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  20616. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  20617. var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106);
  20618. var areaSeries = __webpack_require__( /*! ./area_series */ 165).chart.area;
  20619. var chartSeries = scatterSeries.chart;
  20620. var polarSeries = scatterSeries.polar;
  20621. var _extend = extend;
  20622. var _each = each;
  20623. exports.chart = {};
  20624. exports.polar = {};
  20625. var baseBarSeriesMethods = {
  20626. _createLegendState: function(styleOptions, defaultColor) {
  20627. return {
  20628. fill: styleOptions.color || defaultColor,
  20629. hatching: styleOptions.hatching
  20630. }
  20631. },
  20632. _parsePointStyle: function(style, defaultColor, defaultBorderColor) {
  20633. var color = style.color || defaultColor;
  20634. var base = chartSeries._parsePointStyle.call(this, style, color, defaultBorderColor);
  20635. base.fill = color;
  20636. base.hatching = style.hatching;
  20637. base.dashStyle = style.border && style.border.dashStyle || "solid";
  20638. delete base.r;
  20639. return base
  20640. },
  20641. _applyMarkerClipRect: function(settings) {
  20642. settings["clip-path"] = null
  20643. },
  20644. _setGroupsSettings: function(animationEnabled, firstDrawing) {
  20645. var that = this;
  20646. var settings = {};
  20647. chartSeries._setGroupsSettings.apply(that, arguments);
  20648. if (animationEnabled && firstDrawing) {
  20649. settings = this._getAffineCoordOptions()
  20650. } else {
  20651. if (!animationEnabled) {
  20652. settings = {
  20653. scaleX: 1,
  20654. scaleY: 1,
  20655. translateX: 0,
  20656. translateY: 0
  20657. }
  20658. }
  20659. }
  20660. that._markersGroup.attr(settings)
  20661. },
  20662. _drawPoint: function(options) {
  20663. options.hasAnimation = options.hasAnimation && !options.firstDrawing;
  20664. options.firstDrawing = false;
  20665. chartSeries._drawPoint.call(this, options)
  20666. },
  20667. _getMainColor: function() {
  20668. return this._options.mainSeriesColor
  20669. },
  20670. _createPointStyles: function(pointOptions) {
  20671. var that = this;
  20672. var mainColor = pointOptions.color || that._getMainColor();
  20673. return {
  20674. normal: that._parsePointStyle(pointOptions, mainColor, mainColor),
  20675. hover: that._parsePointStyle(pointOptions.hoverStyle || {}, mainColor, mainColor),
  20676. selection: that._parsePointStyle(pointOptions.selectionStyle || {}, mainColor, mainColor)
  20677. }
  20678. },
  20679. _updatePointsVisibility: function() {
  20680. var visibility = this._options.visible;
  20681. each(this._points, function(_, point) {
  20682. point._options.visible = visibility
  20683. })
  20684. },
  20685. _getOptionsForPoint: function() {
  20686. return this._options
  20687. },
  20688. _animate: function(firstDrawing) {
  20689. var that = this;
  20690. var complete = function() {
  20691. that._animateComplete()
  20692. };
  20693. var animateFunc = function(drawnPoints, complete) {
  20694. var lastPointIndex = drawnPoints.length - 1;
  20695. _each(drawnPoints || [], function(i, point) {
  20696. point.animate(i === lastPointIndex ? complete : void 0, point.getMarkerCoords())
  20697. })
  20698. };
  20699. that._animatePoints(firstDrawing, complete, animateFunc)
  20700. },
  20701. getValueRangeInitialValue: areaSeries.getValueRangeInitialValue,
  20702. _patchMarginOptions: function(options) {
  20703. options.checkInterval = true;
  20704. return options
  20705. },
  20706. _defaultAggregator: "sum",
  20707. _defineDrawingState: function() {},
  20708. usePointsToDefineAutoHiding: function() {
  20709. return false
  20710. }
  20711. };
  20712. exports.chart.bar = _extend({}, chartSeries, baseBarSeriesMethods, {
  20713. _getAffineCoordOptions: function() {
  20714. var rotated = this._options.rotated;
  20715. var direction = rotated ? "X" : "Y";
  20716. var settings = {
  20717. scaleX: rotated ? .001 : 1,
  20718. scaleY: rotated ? 1 : .001
  20719. };
  20720. settings["translate" + direction] = this.getValueAxis().getTranslator().translate("canvas_position_default");
  20721. return settings
  20722. },
  20723. _animatePoints: function(firstDrawing, complete, animateFunc) {
  20724. var that = this;
  20725. that._markersGroup.animate({
  20726. scaleX: 1,
  20727. scaleY: 1,
  20728. translateY: 0,
  20729. translateX: 0
  20730. }, void 0, complete);
  20731. if (!firstDrawing) {
  20732. animateFunc(that._drawnPoints, complete)
  20733. }
  20734. },
  20735. checkSeriesViewportCoord: function(axis, coord) {
  20736. if (0 === this._points.length) {
  20737. return false
  20738. }
  20739. if (axis.isArgumentAxis) {
  20740. return true
  20741. }
  20742. var translator = axis.getTranslator();
  20743. var range = this.getViewport();
  20744. var min = translator.translate(range.categories ? range.categories[0] : range.min);
  20745. var max = translator.translate(range.categories ? range.categories[range.categories.length - 1] : range.max);
  20746. var rotated = this.getOptions().rotated;
  20747. var inverted = axis.getOptions().inverted;
  20748. return rotated && !inverted || !rotated && inverted ? coord >= min && coord <= max : coord >= max && coord <= min
  20749. },
  20750. getSeriesPairCoord: function(coord, isArgument) {
  20751. var oppositeCoord = null;
  20752. var rotated = this._options.rotated;
  20753. var isOpposite = !isArgument && !rotated || isArgument && rotated;
  20754. var coordName = isOpposite ? "vy" : "vx";
  20755. var oppositeCoordName = isOpposite ? "vx" : "vy";
  20756. var points = this.getPoints();
  20757. for (var i = 0; i < points.length; i++) {
  20758. var p = points[i];
  20759. var tmpCoord = void 0;
  20760. if (isArgument) {
  20761. tmpCoord = p.getCenterCoord()[coordName[1]] === coord ? p[oppositeCoordName] : void 0
  20762. } else {
  20763. tmpCoord = p[coordName] === coord ? p[oppositeCoordName] : void 0
  20764. }
  20765. if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
  20766. oppositeCoord = tmpCoord;
  20767. break
  20768. }
  20769. }
  20770. return oppositeCoord
  20771. }
  20772. });
  20773. exports.polar.bar = _extend({}, polarSeries, baseBarSeriesMethods, {
  20774. _animatePoints: function(firstDrawing, complete, animateFunc) {
  20775. animateFunc(this._drawnPoints, complete)
  20776. },
  20777. _setGroupsSettings: chartSeries._setGroupsSettings,
  20778. _drawPoint: function(point, groups, animationEnabled) {
  20779. chartSeries._drawPoint.call(this, point, groups, animationEnabled)
  20780. },
  20781. _parsePointStyle: function(style) {
  20782. var base = baseBarSeriesMethods._parsePointStyle.apply(this, arguments);
  20783. base.opacity = style.opacity;
  20784. return base
  20785. },
  20786. _createGroups: chartSeries._createGroups,
  20787. _setMarkerGroupSettings: function() {
  20788. var that = this;
  20789. var markersSettings = that._createPointStyles(that._getMarkerGroupOptions()).normal;
  20790. markersSettings.class = "dxc-markers";
  20791. that._applyMarkerClipRect(markersSettings);
  20792. var groupSettings = _extend({}, markersSettings);
  20793. delete groupSettings.opacity;
  20794. that._markersGroup.attr(groupSettings)
  20795. },
  20796. _createLegendState: areaSeries._createLegendState
  20797. })
  20798. },
  20799. /*!******************************************************!*\
  20800. !*** ./artifacts/transpiled/viz/core/data_source.js ***!
  20801. \******************************************************/
  20802. /*! dynamic exports provided */
  20803. /*! all exports used */
  20804. function(module, exports, __webpack_require__) {
  20805. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  20806. var DataHelperMixin = __webpack_require__( /*! ../../data_helper */ 84);
  20807. var postCtor = DataHelperMixin.postCtor;
  20808. var name;
  20809. var members = {
  20810. _dataSourceLoadErrorHandler: function() {
  20811. this._dataSourceChangedHandler()
  20812. },
  20813. _dataSourceOptions: function() {
  20814. return {
  20815. paginate: false
  20816. }
  20817. },
  20818. _updateDataSource: function() {
  20819. this._refreshDataSource();
  20820. if (!this.option("dataSource")) {
  20821. this._dataSourceChangedHandler()
  20822. }
  20823. },
  20824. _dataIsLoaded: function() {
  20825. return !this._dataSource || this._dataSource.isLoaded()
  20826. },
  20827. _dataSourceItems: function() {
  20828. return this._dataSource && this._dataSource.items()
  20829. }
  20830. };
  20831. for (name in DataHelperMixin) {
  20832. if ("postCtor" === name) {
  20833. continue
  20834. }
  20835. members[name] = DataHelperMixin[name]
  20836. }
  20837. exports.plugin = {
  20838. name: "data_source",
  20839. init: function() {
  20840. postCtor.call(this)
  20841. },
  20842. dispose: noop,
  20843. members: members
  20844. }
  20845. },
  20846. /*!*******************************************************!*\
  20847. !*** ./artifacts/transpiled/viz/gauges/base_gauge.js ***!
  20848. \*******************************************************/
  20849. /*! dynamic exports provided */
  20850. /*! all exports used */
  20851. function(module, exports, __webpack_require__) {
  20852. var _Number = Number;
  20853. var _getAppropriateFormat = __webpack_require__( /*! ../core/utils */ 10).getAppropriateFormat;
  20854. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  20855. var translator1DModule = __webpack_require__( /*! ../translators/translator1d */ 412);
  20856. var _extend = extend;
  20857. var BaseWidget = __webpack_require__( /*! ../core/base_widget */ 96);
  20858. var themeManagerModule = __webpack_require__( /*! ./theme_manager */ 794);
  20859. var Tracker = __webpack_require__( /*! ./tracker */ 795);
  20860. var dxBaseGauge = BaseWidget.inherit({
  20861. _rootClassPrefix: "dxg",
  20862. _themeSection: "gauge",
  20863. _createThemeManager: function() {
  20864. return new themeManagerModule.ThemeManager(this._getThemeManagerOptions())
  20865. },
  20866. _initCore: function() {
  20867. var that = this;
  20868. var root = that._renderer.root;
  20869. that._valueChangingLocker = 0;
  20870. that._translator = that._factory.createTranslator();
  20871. that._tracker = that._factory.createTracker({
  20872. renderer: that._renderer,
  20873. container: root
  20874. });
  20875. that._setTrackerCallbacks()
  20876. },
  20877. _beginValueChanging: function() {
  20878. this._resetIsReady();
  20879. this._onBeginUpdate();
  20880. ++this._valueChangingLocker
  20881. },
  20882. _endValueChanging: function() {
  20883. if (0 === --this._valueChangingLocker) {
  20884. this._drawn()
  20885. }
  20886. },
  20887. _setTrackerCallbacks: function() {
  20888. var that = this;
  20889. var renderer = that._renderer;
  20890. var tooltip = that._tooltip;
  20891. that._tracker.setCallbacks({
  20892. "tooltip-show": function(target, info) {
  20893. var tooltipParameters = target.getTooltipParameters();
  20894. var offset = renderer.getRootOffset();
  20895. var formatObject = _extend({
  20896. value: tooltipParameters.value,
  20897. valueText: tooltip.formatValue(tooltipParameters.value),
  20898. color: tooltipParameters.color
  20899. }, info);
  20900. return tooltip.show(formatObject, {
  20901. x: tooltipParameters.x + offset.left,
  20902. y: tooltipParameters.y + offset.top,
  20903. offset: tooltipParameters.offset
  20904. }, {
  20905. target: info
  20906. })
  20907. },
  20908. "tooltip-hide": function() {
  20909. return tooltip.hide()
  20910. }
  20911. })
  20912. },
  20913. _dispose: function() {
  20914. this._cleanCore();
  20915. this.callBase.apply(this, arguments)
  20916. },
  20917. _disposeCore: function() {
  20918. var that = this;
  20919. that._themeManager.dispose();
  20920. that._tracker.dispose();
  20921. that._translator = that._tracker = null
  20922. },
  20923. _cleanCore: function() {
  20924. var that = this;
  20925. that._tracker.deactivate();
  20926. that._cleanContent()
  20927. },
  20928. _renderCore: function() {
  20929. var that = this;
  20930. if (!that._isValidDomain) {
  20931. return
  20932. }
  20933. that._renderContent();
  20934. that._tracker.setTooltipState(that._tooltip.isEnabled());
  20935. that._tracker.activate();
  20936. that._noAnimation = false;
  20937. that._debug_rendered && that._debug_rendered()
  20938. },
  20939. _applyChanges: function() {
  20940. this.callBase.apply(this, arguments);
  20941. this._resizing = this._noAnimation = false
  20942. },
  20943. _setContentSize: function() {
  20944. var that = this;
  20945. that._resizing = that._noAnimation = 2 === that._changes.count();
  20946. that.callBase.apply(that, arguments)
  20947. },
  20948. _applySize: function(rect) {
  20949. var that = this;
  20950. that._DEBUG_rootRect = rect;
  20951. that._innerRect = {
  20952. left: rect[0],
  20953. top: rect[1],
  20954. right: rect[2],
  20955. bottom: rect[3]
  20956. };
  20957. var layoutCache = that._layout._cache;
  20958. that._cleanCore();
  20959. that._renderCore();
  20960. that._layout._cache = that._layout._cache || layoutCache;
  20961. return [rect[0], that._innerRect.top, rect[2], that._innerRect.bottom]
  20962. },
  20963. _initialChanges: ["DOMAIN"],
  20964. _themeDependentChanges: ["DOMAIN"],
  20965. _optionChangesMap: {
  20966. subtitle: "MOSTLY_TOTAL",
  20967. indicator: "MOSTLY_TOTAL",
  20968. geometry: "MOSTLY_TOTAL",
  20969. animation: "MOSTLY_TOTAL",
  20970. startValue: "DOMAIN",
  20971. endValue: "DOMAIN"
  20972. },
  20973. _optionChangesOrder: ["DOMAIN", "MOSTLY_TOTAL"],
  20974. _change_DOMAIN: function() {
  20975. this._setupDomain()
  20976. },
  20977. _change_MOSTLY_TOTAL: function() {
  20978. this._applyMostlyTotalChange()
  20979. },
  20980. _setupDomain: function() {
  20981. var that = this;
  20982. that._setupDomainCore();
  20983. that._isValidDomain = isFinite(1 / (that._translator.getDomain()[1] - that._translator.getDomain()[0]));
  20984. if (!that._isValidDomain) {
  20985. that._incidentOccurred("W2301")
  20986. }
  20987. that._change(["MOSTLY_TOTAL"])
  20988. },
  20989. _applyMostlyTotalChange: function() {
  20990. var that = this;
  20991. that._setupCodomain();
  20992. that._setupAnimationSettings();
  20993. that._setupDefaultFormat();
  20994. that._change(["LAYOUT"])
  20995. },
  20996. _setupAnimationSettings: function() {
  20997. var that = this;
  20998. var option = that.option("animation");
  20999. that._animationSettings = null;
  21000. if (void 0 === option || option) {
  21001. option = _extend({
  21002. enabled: true,
  21003. duration: 1e3,
  21004. easing: "easeOutCubic"
  21005. }, option);
  21006. if (option.enabled && option.duration > 0) {
  21007. that._animationSettings = {
  21008. duration: _Number(option.duration),
  21009. easing: option.easing
  21010. }
  21011. }
  21012. }
  21013. that._containerBackgroundColor = that.option("containerBackgroundColor") || that._themeManager.theme().containerBackgroundColor
  21014. },
  21015. _setupDefaultFormat: function() {
  21016. var domain = this._translator.getDomain();
  21017. this._defaultFormatOptions = _getAppropriateFormat(domain[0], domain[1], this._getApproximateScreenRange())
  21018. },
  21019. _setupDomainCore: null,
  21020. _calculateSize: null,
  21021. _cleanContent: null,
  21022. _renderContent: null,
  21023. _setupCodomain: null,
  21024. _getApproximateScreenRange: null,
  21025. _factory: {
  21026. createTranslator: function() {
  21027. return new translator1DModule.Translator1D
  21028. },
  21029. createTracker: function(parameters) {
  21030. return new Tracker(parameters)
  21031. }
  21032. }
  21033. });
  21034. exports.dxBaseGauge = dxBaseGauge;
  21035. var _format = __webpack_require__( /*! ../../format_helper */ 64).format;
  21036. var formatValue = function(value, options, extra) {
  21037. options = options || {};
  21038. var text = _format(value, options.format);
  21039. var formatObject;
  21040. if ("function" === typeof options.customizeText) {
  21041. formatObject = _extend({
  21042. value: value,
  21043. valueText: text
  21044. }, extra);
  21045. return String(options.customizeText.call(formatObject, formatObject))
  21046. }
  21047. return text
  21048. };
  21049. var getSampleText = function(translator, options) {
  21050. var text1 = formatValue(translator.getDomainStart(), options);
  21051. var text2 = formatValue(translator.getDomainEnd(), options);
  21052. return text1.length >= text2.length ? text1 : text2
  21053. };
  21054. exports.formatValue = formatValue;
  21055. exports.getSampleText = getSampleText;
  21056. exports.compareArrays = function(array1, array2) {
  21057. return array1 && array2 && array1.length === array2.length && compareArraysElements(array1, array2)
  21058. };
  21059. function compareArraysElements(array1, array2) {
  21060. var i;
  21061. var ii = array1.length;
  21062. var array1ValueIsNaN;
  21063. var array2ValueIsNaN;
  21064. for (i = 0; i < ii; ++i) {
  21065. array1ValueIsNaN = array1[i] !== array1[i];
  21066. array2ValueIsNaN = array2[i] !== array2[i];
  21067. if (array1ValueIsNaN && array2ValueIsNaN) {
  21068. continue
  21069. }
  21070. if (array1[i] !== array2[i]) {
  21071. return false
  21072. }
  21073. }
  21074. return true
  21075. }
  21076. dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/export */ 93).plugin);
  21077. dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/title */ 105).plugin);
  21078. dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin);
  21079. dxBaseGauge.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 119).plugin);
  21080. var _setTooltipOptions = dxBaseGauge.prototype._setTooltipOptions;
  21081. dxBaseGauge.prototype._setTooltipOptions = function() {
  21082. _setTooltipOptions.apply(this, arguments);
  21083. this._tracker && this._tracker.setTooltipState(this._tooltip.isEnabled())
  21084. }
  21085. },
  21086. /*!**************************************************!*\
  21087. !*** ./artifacts/transpiled/viz/tree_map/api.js ***!
  21088. \**************************************************/
  21089. /*! dynamic exports provided */
  21090. /*! all exports used */
  21091. function(module, exports, __webpack_require__) {
  21092. var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
  21093. var nodeProto = __webpack_require__( /*! ./node */ 166).prototype;
  21094. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  21095. proto._eventsMap.onNodesInitialized = {
  21096. name: "nodesInitialized"
  21097. };
  21098. proto._eventsMap.onNodesRendering = {
  21099. name: "nodesRendering"
  21100. };
  21101. proto._createProxyType = function() {
  21102. var that = this;
  21103. var nodes;
  21104. Proxy.prototype = {
  21105. constructor: Proxy,
  21106. getParent: function() {
  21107. return nodes[this._id].parent.proxy || null
  21108. },
  21109. getChild: function(index) {
  21110. var _nodes = nodes[this._id].nodes;
  21111. return _nodes ? _nodes[index].proxy : null
  21112. },
  21113. getChildrenCount: function() {
  21114. var _nodes = nodes[this._id].nodes;
  21115. return _nodes ? _nodes.length : 0
  21116. },
  21117. getAllChildren: function() {
  21118. var _nodes = nodes[this._id].nodes;
  21119. var i;
  21120. var ii = _nodes && _nodes.length;
  21121. var list = [];
  21122. for (i = 0; i < ii; ++i) {
  21123. list.push(_nodes[i].proxy)
  21124. }
  21125. return list
  21126. },
  21127. getAllNodes: function() {
  21128. var list = [];
  21129. collectNodes(nodes[this._id], list);
  21130. return list
  21131. },
  21132. isLeaf: function() {
  21133. return !nodes[this._id].isNode()
  21134. },
  21135. isActive: function() {
  21136. return nodes[this._id].isActive()
  21137. },
  21138. value: function(arg) {
  21139. var node = nodes[this._id];
  21140. var result;
  21141. if (void 0 !== arg) {
  21142. updateValue(node, arg > 0 ? Number(arg) : 0);
  21143. change(node, ["TILING"]);
  21144. result = this
  21145. } else {
  21146. result = node.value
  21147. }
  21148. return result
  21149. },
  21150. label: function(arg) {
  21151. var node = nodes[this._id];
  21152. var result;
  21153. if (void 0 !== arg) {
  21154. node.customLabel = arg ? String(arg) : null;
  21155. change(node, ["LABELS"]);
  21156. result = this
  21157. } else {
  21158. result = node.customLabel || node.label
  21159. }
  21160. return result
  21161. },
  21162. customize: function(settings) {
  21163. var node = nodes[this._id];
  21164. if (settings) {
  21165. node._custom = node._custom || {};
  21166. _extend(true, node._custom, settings);
  21167. node._partialState = node._partialLabelState = null
  21168. }
  21169. change(node, ["TILES", "LABELS"]);
  21170. return this
  21171. },
  21172. resetCustomization: function() {
  21173. var node = nodes[this._id];
  21174. node._custom = node._partialState = node._partialLabelState = null;
  21175. change(node, ["TILES", "LABELS"]);
  21176. return this
  21177. }
  21178. };
  21179. that._extendProxyType(Proxy.prototype);
  21180. function Proxy(node) {
  21181. var that = this;
  21182. node.proxy = that;
  21183. that._id = node._id;
  21184. that.level = node.level;
  21185. that.index = node.index;
  21186. that.data = node.data
  21187. }
  21188. that._handlers.beginBuildNodes = function() {
  21189. nodes = that._nodes;
  21190. new Proxy(that._root)
  21191. };
  21192. that._handlers.buildNode = function(node) {
  21193. new Proxy(node)
  21194. };
  21195. that._handlers.endBuildNodes = function() {
  21196. that._eventTrigger("nodesInitialized", {
  21197. root: that._root.proxy
  21198. })
  21199. }
  21200. };
  21201. function change(node, codes) {
  21202. var ctx = node.ctx;
  21203. ctx.suspend();
  21204. ctx.change(codes);
  21205. ctx.resume()
  21206. }
  21207. function collectNodes(node, list) {
  21208. var nodes = node.nodes;
  21209. var i;
  21210. var ii = nodes && nodes.length;
  21211. for (i = 0; i < ii; ++i) {
  21212. list.push(nodes[i].proxy);
  21213. collectNodes(nodes[i], list)
  21214. }
  21215. }
  21216. function updateValue(node, value) {
  21217. var delta = value - node.value;
  21218. while (node) {
  21219. node.value += delta;
  21220. node = node.parent
  21221. }
  21222. }
  21223. proto._extendProxyType = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  21224. var _resetNodes = proto._resetNodes;
  21225. proto._resetNodes = function() {
  21226. _resetNodes.call(this);
  21227. this._eventTrigger("nodesRendering", {
  21228. node: this._topNode.proxy
  21229. })
  21230. };
  21231. var _updateStyles = nodeProto.updateStyles;
  21232. nodeProto.updateStyles = function() {
  21233. var that = this;
  21234. _updateStyles.call(that);
  21235. if (that._custom) {
  21236. that._partialState = !that.ctx.forceReset && that._partialState || that.ctx.calculateState(that._custom);
  21237. _extend(true, that.state, that._partialState)
  21238. }
  21239. };
  21240. var _updateLabelStyle = nodeProto.updateLabelStyle;
  21241. nodeProto.updateLabelStyle = function() {
  21242. var that = this;
  21243. var custom = that._custom;
  21244. _updateLabelStyle.call(that);
  21245. if (custom && custom.label) {
  21246. that._partialLabelState = !that.ctx.forceReset && that._partialLabelState || calculatePartialLabelState(that, custom.label);
  21247. that.labelState = _extend(true, {}, that.labelState, that._partialLabelState)
  21248. }
  21249. };
  21250. function calculatePartialLabelState(node, settings) {
  21251. var state = node.ctx.calculateLabelState(settings);
  21252. if ("visible" in settings) {
  21253. state.visible = !!settings.visible
  21254. }
  21255. return state
  21256. }
  21257. proto.getRootNode = function() {
  21258. return this._root.proxy
  21259. };
  21260. proto.resetNodes = function() {
  21261. var context = this._context;
  21262. context.suspend();
  21263. context.change(["NODES_CREATE"]);
  21264. context.resume();
  21265. return this
  21266. }
  21267. },
  21268. /*!******************************************************!*\
  21269. !*** ./artifacts/transpiled/bundles/modules/core.js ***!
  21270. \******************************************************/
  21271. /*! dynamic exports provided */
  21272. /*! all exports used */
  21273. function(module, exports, __webpack_require__) {
  21274. var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
  21275. var window = windowUtils.getWindow();
  21276. var DevExpress = window.DevExpress = window.DevExpress || {};
  21277. var errors = DevExpress.errors = __webpack_require__( /*! ../../core/errors */ 21);
  21278. if (DevExpress._DEVEXTREME_BUNDLE_INITIALIZED) {
  21279. throw errors.Error("E0024")
  21280. }
  21281. DevExpress._DEVEXTREME_BUNDLE_INITIALIZED = true;
  21282. DevExpress.clientExporter = __webpack_require__( /*! ../../exporter */ 170);
  21283. DevExpress.excelExporter = __webpack_require__( /*! ../../exporter/exceljs/excelExporter */ 441);
  21284. DevExpress.VERSION = __webpack_require__( /*! ../../core/version */ 157);
  21285. DevExpress.Class = __webpack_require__( /*! ../../core/class */ 15);
  21286. DevExpress.DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67);
  21287. DevExpress.Component = __webpack_require__( /*! ../../core/component */ 133);
  21288. DevExpress.registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9);
  21289. DevExpress.devices = __webpack_require__( /*! ../../core/devices */ 16);
  21290. DevExpress.Color = __webpack_require__( /*! ../../color */ 94);
  21291. var animationFrame = __webpack_require__( /*! ../../animation/frame */ 112);
  21292. DevExpress.EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 82);
  21293. DevExpress.utils = {};
  21294. DevExpress.utils.requestAnimationFrame = animationFrame.requestAnimationFrame;
  21295. DevExpress.utils.cancelAnimationFrame = animationFrame.cancelAnimationFrame;
  21296. DevExpress.utils.initMobileViewport = __webpack_require__( /*! ../../mobile/init_mobile_viewport/init_mobile_viewport */ 446).initMobileViewport;
  21297. DevExpress.utils.extendFromObject = __webpack_require__( /*! ../../core/utils/extend */ 0).extendFromObject;
  21298. DevExpress.utils.createComponents = __webpack_require__( /*! ../../core/utils/dom */ 12).createComponents;
  21299. DevExpress.utils.triggerShownEvent = __webpack_require__( /*! ../../core/utils/dom */ 12).triggerShownEvent;
  21300. DevExpress.utils.triggerHidingEvent = __webpack_require__( /*! ../../core/utils/dom */ 12).triggerHidingEvent;
  21301. DevExpress.utils.resetActiveElement = __webpack_require__( /*! ../../core/utils/dom */ 12).resetActiveElement;
  21302. DevExpress.utils.findBestMatches = __webpack_require__( /*! ../../core/utils/common */ 4).findBestMatches;
  21303. DevExpress.createQueue = __webpack_require__( /*! ../../core/utils/queue */ 263).create;
  21304. DevExpress.utils.dom = __webpack_require__( /*! ../../core/utils/dom */ 12);
  21305. DevExpress.utils.common = __webpack_require__( /*! ../../core/utils/common */ 4);
  21306. DevExpress.utils.date = __webpack_require__( /*! ../../core/utils/date */ 22);
  21307. DevExpress.utils.browser = __webpack_require__( /*! ../../core/utils/browser */ 25);
  21308. DevExpress.utils.inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
  21309. DevExpress.utils.iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  21310. DevExpress.utils.readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48);
  21311. DevExpress.utils.resizeCallbacks = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 130);
  21312. DevExpress.utils.console = __webpack_require__( /*! ../../core/utils/console */ 73);
  21313. DevExpress.utils.string = __webpack_require__( /*! ../../core/utils/string */ 44);
  21314. DevExpress.utils.support = __webpack_require__( /*! ../../core/utils/support */ 43);
  21315. DevExpress.utils.ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58);
  21316. DevExpress.viewPort = __webpack_require__( /*! ../../core/utils/view_port */ 78).value;
  21317. DevExpress.hideTopOverlay = __webpack_require__( /*! ../../mobile/hide_top_overlay */ 213);
  21318. DevExpress.formatHelper = __webpack_require__( /*! ../../format_helper */ 64);
  21319. DevExpress.config = __webpack_require__( /*! ../../core/config */ 31);
  21320. DevExpress.animationPresets = __webpack_require__( /*! ../../animation/presets/presets */ 179).presets;
  21321. DevExpress.fx = __webpack_require__( /*! ../../animation/fx */ 38);
  21322. DevExpress.TransitionExecutor = __webpack_require__( /*! ../../animation/transition_executor/transition_executor */ 281).TransitionExecutor;
  21323. DevExpress.AnimationPresetCollection = __webpack_require__( /*! ../../animation/presets/presets */ 179).PresetCollection;
  21324. DevExpress.events = __webpack_require__( /*! ../../events */ 282);
  21325. DevExpress.events.click = __webpack_require__( /*! ../../events/click */ 19);
  21326. DevExpress.events.utils = __webpack_require__( /*! ../../events/utils */ 8);
  21327. DevExpress.events.GestureEmitter = __webpack_require__( /*! ../../events/gesture/emitter.gesture */ 158);
  21328. DevExpress.localization = __webpack_require__( /*! ../../localization */ 449);
  21329. module.exports = DevExpress
  21330. },
  21331. /*!**********************************************!*\
  21332. !*** ./artifacts/transpiled/events/hover.js ***!
  21333. \**********************************************/
  21334. /*! dynamic exports provided */
  21335. /*! all exports used */
  21336. function(module, exports, __webpack_require__) {
  21337. var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
  21338. var dataUtils = __webpack_require__( /*! ../core/element_data */ 39);
  21339. var Class = __webpack_require__( /*! ../core/class */ 15);
  21340. var devices = __webpack_require__( /*! ../core/devices */ 16);
  21341. var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71);
  21342. var eventUtils = __webpack_require__( /*! ./utils */ 8);
  21343. var pointerEvents = __webpack_require__( /*! ./pointer */ 23);
  21344. var HOVERSTART_NAMESPACE = "dxHoverStart";
  21345. var HOVERSTART = "dxhoverstart";
  21346. var POINTERENTER_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.enter, HOVERSTART_NAMESPACE);
  21347. var HOVEREND_NAMESPACE = "dxHoverEnd";
  21348. var HOVEREND = "dxhoverend";
  21349. var POINTERLEAVE_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.leave, HOVEREND_NAMESPACE);
  21350. var Hover = Class.inherit({
  21351. noBubble: true,
  21352. ctor: function() {
  21353. this._handlerArrayKeyPath = this._eventNamespace + "_HandlerStore"
  21354. },
  21355. setup: function(element) {
  21356. dataUtils.data(element, this._handlerArrayKeyPath, {})
  21357. },
  21358. add: function(element, handleObj) {
  21359. var that = this;
  21360. var handler = function(e) {
  21361. that._handler(e)
  21362. };
  21363. eventsEngine.on(element, this._originalEventName, handleObj.selector, handler);
  21364. dataUtils.data(element, this._handlerArrayKeyPath)[handleObj.guid] = handler
  21365. },
  21366. _handler: function(e) {
  21367. if (eventUtils.isTouchEvent(e) || devices.isSimulator()) {
  21368. return
  21369. }
  21370. eventUtils.fireEvent({
  21371. type: this._eventName,
  21372. originalEvent: e,
  21373. delegateTarget: e.delegateTarget
  21374. })
  21375. },
  21376. remove: function(element, handleObj) {
  21377. var handler = dataUtils.data(element, this._handlerArrayKeyPath)[handleObj.guid];
  21378. eventsEngine.off(element, this._originalEventName, handleObj.selector, handler)
  21379. },
  21380. teardown: function(element) {
  21381. dataUtils.removeData(element, this._handlerArrayKeyPath)
  21382. }
  21383. });
  21384. var HoverStart = Hover.inherit({
  21385. ctor: function() {
  21386. this._eventNamespace = HOVERSTART_NAMESPACE;
  21387. this._eventName = HOVERSTART;
  21388. this._originalEventName = POINTERENTER_NAMESPACED_EVENT_NAME;
  21389. this.callBase()
  21390. },
  21391. _handler: function(e) {
  21392. var pointers = e.pointers || [];
  21393. if (!pointers.length) {
  21394. this.callBase(e)
  21395. }
  21396. }
  21397. });
  21398. var HoverEnd = Hover.inherit({
  21399. ctor: function() {
  21400. this._eventNamespace = HOVEREND_NAMESPACE;
  21401. this._eventName = HOVEREND;
  21402. this._originalEventName = POINTERLEAVE_NAMESPACED_EVENT_NAME;
  21403. this.callBase()
  21404. }
  21405. });
  21406. registerEvent(HOVERSTART, new HoverStart);
  21407. registerEvent(HOVEREND, new HoverEnd);
  21408. exports.start = HOVERSTART;
  21409. exports.end = HOVEREND
  21410. },
  21411. /*!***************************************************!*\
  21412. !*** ./artifacts/transpiled/data/custom_store.js ***!
  21413. \***************************************************/
  21414. /*! dynamic exports provided */
  21415. /*! all exports used */
  21416. function(module, exports, __webpack_require__) {
  21417. var $ = __webpack_require__( /*! ../core/renderer */ 2);
  21418. var dataUtils = __webpack_require__( /*! ./utils */ 41);
  21419. var arrayUtils = __webpack_require__( /*! ./array_utils */ 135);
  21420. var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction;
  21421. var config = __webpack_require__( /*! ../core/config */ 31);
  21422. var errors = __webpack_require__( /*! ./errors */ 36).errors;
  21423. var Store = __webpack_require__( /*! ./abstract_store */ 98);
  21424. var arrayQuery = __webpack_require__( /*! ./array_query */ 155);
  21425. var queryByOptions = __webpack_require__( /*! ./store_helper */ 81).queryByOptions;
  21426. var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
  21427. var Deferred = deferredUtils.Deferred;
  21428. var when = deferredUtils.when;
  21429. var fromPromise = deferredUtils.fromPromise;
  21430. var TOTAL_COUNT = "totalCount";
  21431. var LOAD = "load";
  21432. var BY_KEY = "byKey";
  21433. var INSERT = "insert";
  21434. var UPDATE = "update";
  21435. var REMOVE = "remove";
  21436. function isPromise(obj) {
  21437. return obj && isFunction(obj.then)
  21438. }
  21439. function trivialPromise(value) {
  21440. return (new Deferred).resolve(value).promise()
  21441. }
  21442. function ensureRequiredFuncOption(name, obj) {
  21443. if (!isFunction(obj)) {
  21444. throw errors.Error("E4011", name)
  21445. }
  21446. }
  21447. function throwInvalidUserFuncResult(name) {
  21448. throw errors.Error("E4012", name)
  21449. }
  21450. function createUserFuncFailureHandler(pendingDeferred) {
  21451. function errorMessageFromXhr(promiseArguments) {
  21452. var xhr = promiseArguments[0];
  21453. var textStatus = promiseArguments[1];
  21454. if (!xhr || !xhr.getResponseHeader) {
  21455. return null
  21456. }
  21457. return dataUtils.errorMessageFromXhr(xhr, textStatus)
  21458. }
  21459. return function(arg) {
  21460. var error;
  21461. if (arg instanceof Error) {
  21462. error = arg
  21463. } else {
  21464. error = new Error(errorMessageFromXhr(arguments) || arg && String(arg) || "Unknown error")
  21465. }
  21466. if (error.message !== dataUtils.XHR_ERROR_UNLOAD) {
  21467. pendingDeferred.reject(error)
  21468. }
  21469. }
  21470. }
  21471. function invokeUserLoad(store, options) {
  21472. var userFunc = store._loadFunc;
  21473. var userResult;
  21474. ensureRequiredFuncOption(LOAD, userFunc);
  21475. userResult = userFunc.apply(store, [options]);
  21476. if (Array.isArray(userResult)) {
  21477. userResult = trivialPromise(userResult)
  21478. } else {
  21479. if (null === userResult || void 0 === userResult) {
  21480. userResult = trivialPromise([])
  21481. } else {
  21482. if (!isPromise(userResult)) {
  21483. throwInvalidUserFuncResult(LOAD)
  21484. }
  21485. }
  21486. }
  21487. return fromPromise(userResult)
  21488. }
  21489. function invokeUserTotalCountFunc(store, options) {
  21490. var userFunc = store._totalCountFunc;
  21491. var userResult;
  21492. if (!isFunction(userFunc)) {
  21493. throw errors.Error("E4021")
  21494. }
  21495. userResult = userFunc.apply(store, [options]);
  21496. if (!isPromise(userResult)) {
  21497. userResult = Number(userResult);
  21498. if (!isFinite(userResult)) {
  21499. throwInvalidUserFuncResult(TOTAL_COUNT)
  21500. }
  21501. userResult = trivialPromise(userResult)
  21502. }
  21503. return fromPromise(userResult)
  21504. }
  21505. function invokeUserByKeyFunc(store, key, extraOptions) {
  21506. var userFunc = store._byKeyFunc;
  21507. var userResult;
  21508. ensureRequiredFuncOption(BY_KEY, userFunc);
  21509. userResult = userFunc.apply(store, [key, extraOptions]);
  21510. if (!isPromise(userResult)) {
  21511. userResult = trivialPromise(userResult)
  21512. }
  21513. return fromPromise(userResult)
  21514. }
  21515. function runRawLoad(pendingDeferred, store, userFuncOptions, continuation) {
  21516. if (store.__rawData) {
  21517. continuation(store.__rawData)
  21518. } else {
  21519. var loadPromise = store.__rawDataPromise || invokeUserLoad(store, userFuncOptions);
  21520. if (store._cacheRawData) {
  21521. store.__rawDataPromise = loadPromise
  21522. }
  21523. loadPromise.always(function() {
  21524. delete store.__rawDataPromise
  21525. }).done(function(rawData) {
  21526. if (store._cacheRawData) {
  21527. store.__rawData = rawData
  21528. }
  21529. continuation(rawData)
  21530. }).fail(createUserFuncFailureHandler(pendingDeferred))
  21531. }
  21532. }
  21533. function runRawLoadWithQuery(pendingDeferred, store, options, countOnly) {
  21534. options = options || {};
  21535. var userFuncOptions = {};
  21536. if ("userData" in options) {
  21537. userFuncOptions.userData = options.userData
  21538. }
  21539. runRawLoad(pendingDeferred, store, userFuncOptions, function(rawData) {
  21540. var rawDataQuery = arrayQuery(rawData, {
  21541. errorHandler: store._errorHandler
  21542. });
  21543. var itemsQuery;
  21544. var totalCountQuery;
  21545. var waitList = [];
  21546. var items;
  21547. var totalCount;
  21548. if (!countOnly) {
  21549. itemsQuery = queryByOptions(rawDataQuery, options);
  21550. if (itemsQuery === rawDataQuery) {
  21551. items = rawData.slice(0)
  21552. } else {
  21553. waitList.push(itemsQuery.enumerate().done(function(asyncResult) {
  21554. items = asyncResult
  21555. }))
  21556. }
  21557. }
  21558. if (options.requireTotalCount || countOnly) {
  21559. totalCountQuery = queryByOptions(rawDataQuery, options, true);
  21560. if (totalCountQuery === rawDataQuery) {
  21561. totalCount = rawData.length
  21562. } else {
  21563. waitList.push(totalCountQuery.count().done(function(asyncResult) {
  21564. totalCount = asyncResult
  21565. }))
  21566. }
  21567. }
  21568. when.apply($, waitList).done(function() {
  21569. if (countOnly) {
  21570. pendingDeferred.resolve(totalCount)
  21571. } else {
  21572. if (options.requireTotalCount) {
  21573. pendingDeferred.resolve(items, {
  21574. totalCount: totalCount
  21575. })
  21576. } else {
  21577. pendingDeferred.resolve(items)
  21578. }
  21579. }
  21580. }).fail(function(x) {
  21581. pendingDeferred.reject(x)
  21582. })
  21583. })
  21584. }
  21585. function runRawLoadWithKey(pendingDeferred, store, key) {
  21586. runRawLoad(pendingDeferred, store, {}, function(rawData) {
  21587. var keyExpr = store.key();
  21588. var item;
  21589. for (var i = 0, len = rawData.length; i < len; i++) {
  21590. item = rawData[i];
  21591. if (dataUtils.keysEqual(keyExpr, store.keyOf(rawData[i]), key)) {
  21592. pendingDeferred.resolve(item);
  21593. return
  21594. }
  21595. }
  21596. pendingDeferred.reject(errors.Error("E4009"))
  21597. })
  21598. }
  21599. var CustomStore = Store.inherit({
  21600. ctor: function(options) {
  21601. options = options || {};
  21602. this.callBase(options);
  21603. this._useDefaultSearch = !!options.useDefaultSearch || "raw" === options.loadMode;
  21604. this._loadMode = options.loadMode;
  21605. this._cacheRawData = false !== options.cacheRawData;
  21606. this._loadFunc = options[LOAD];
  21607. this._totalCountFunc = options[TOTAL_COUNT];
  21608. this._byKeyFunc = options[BY_KEY];
  21609. this._insertFunc = options[INSERT];
  21610. this._updateFunc = options[UPDATE];
  21611. this._removeFunc = options[REMOVE]
  21612. },
  21613. createQuery: function() {
  21614. throw errors.Error("E4010")
  21615. },
  21616. clearRawDataCache: function() {
  21617. delete this.__rawData
  21618. },
  21619. _totalCountImpl: function(options) {
  21620. var d = new Deferred;
  21621. if ("raw" === this._loadMode && !this._totalCountFunc) {
  21622. runRawLoadWithQuery(d, this, options, true)
  21623. } else {
  21624. invokeUserTotalCountFunc(this, options).done(function(count) {
  21625. d.resolve(Number(count))
  21626. }).fail(createUserFuncFailureHandler(d));
  21627. d = this._addFailHandlers(d)
  21628. }
  21629. return d.promise()
  21630. },
  21631. _pushImpl: function(changes) {
  21632. if (this.__rawData) {
  21633. arrayUtils.applyBatch(this, this.__rawData, changes)
  21634. }
  21635. },
  21636. _loadImpl: function(options) {
  21637. var d = new Deferred;
  21638. if ("raw" === this._loadMode) {
  21639. runRawLoadWithQuery(d, this, options, false)
  21640. } else {
  21641. invokeUserLoad(this, options).done(function(data, extra) {
  21642. d.resolve(data, extra)
  21643. }).fail(createUserFuncFailureHandler(d));
  21644. d = this._addFailHandlers(d)
  21645. }
  21646. return d.promise()
  21647. },
  21648. _byKeyImpl: function(key, extraOptions) {
  21649. var d = new Deferred;
  21650. if (this._byKeyViaLoad()) {
  21651. this._requireKey();
  21652. runRawLoadWithKey(d, this, key)
  21653. } else {
  21654. invokeUserByKeyFunc(this, key, extraOptions).done(function(obj) {
  21655. d.resolve(obj)
  21656. }).fail(createUserFuncFailureHandler(d))
  21657. }
  21658. return d.promise()
  21659. },
  21660. _byKeyViaLoad: function() {
  21661. return "raw" === this._loadMode && !this._byKeyFunc
  21662. },
  21663. _insertImpl: function(values) {
  21664. var that = this;
  21665. var userFunc = that._insertFunc;
  21666. var userResult;
  21667. var d = new Deferred;
  21668. ensureRequiredFuncOption(INSERT, userFunc);
  21669. userResult = userFunc.apply(that, [values]);
  21670. if (!isPromise(userResult)) {
  21671. userResult = trivialPromise(userResult)
  21672. }
  21673. fromPromise(userResult).done(function(serverResponse) {
  21674. if (config().useLegacyStoreResult) {
  21675. d.resolve(values, serverResponse)
  21676. } else {
  21677. d.resolve(serverResponse || values, that.keyOf(serverResponse))
  21678. }
  21679. }).fail(createUserFuncFailureHandler(d));
  21680. return d.promise()
  21681. },
  21682. _updateImpl: function(key, values) {
  21683. var userFunc = this._updateFunc;
  21684. var userResult;
  21685. var d = new Deferred;
  21686. ensureRequiredFuncOption(UPDATE, userFunc);
  21687. userResult = userFunc.apply(this, [key, values]);
  21688. if (!isPromise(userResult)) {
  21689. userResult = trivialPromise(userResult)
  21690. }
  21691. fromPromise(userResult).done(function(serverResponse) {
  21692. if (config().useLegacyStoreResult) {
  21693. d.resolve(key, values)
  21694. } else {
  21695. d.resolve(serverResponse || values, key)
  21696. }
  21697. }).fail(createUserFuncFailureHandler(d));
  21698. return d.promise()
  21699. },
  21700. _removeImpl: function(key) {
  21701. var userFunc = this._removeFunc;
  21702. var userResult;
  21703. var d = new Deferred;
  21704. ensureRequiredFuncOption(REMOVE, userFunc);
  21705. userResult = userFunc.apply(this, [key]);
  21706. if (!isPromise(userResult)) {
  21707. userResult = trivialPromise()
  21708. }
  21709. fromPromise(userResult).done(function() {
  21710. d.resolve(key)
  21711. }).fail(createUserFuncFailureHandler(d));
  21712. return d.promise()
  21713. }
  21714. });
  21715. module.exports = CustomStore
  21716. },
  21717. /*!************************************************************!*\
  21718. !*** ./artifacts/transpiled/ui/widget/swatch_container.js ***!
  21719. \************************************************************/
  21720. /*! dynamic exports provided */
  21721. /*! all exports used */
  21722. function(module, exports, __webpack_require__) {
  21723. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  21724. var viewPortUtils = __webpack_require__( /*! ../../core/utils/view_port */ 78);
  21725. var SWATCH_CONTAINER_CLASS_PREFIX = "dx-swatch-";
  21726. var getSwatchContainer = function(element) {
  21727. var $element = $(element);
  21728. var swatchContainer = $element.closest('[class^="'.concat(SWATCH_CONTAINER_CLASS_PREFIX, '"], [class*=" ').concat(SWATCH_CONTAINER_CLASS_PREFIX, '"]'));
  21729. var viewport = viewPortUtils.value();
  21730. if (!swatchContainer.length) {
  21731. return viewport
  21732. }
  21733. var swatchClassRegex = new RegExp("(\\s|^)(".concat(SWATCH_CONTAINER_CLASS_PREFIX, ".*?)(\\s|$)"));
  21734. var swatchClass = swatchContainer[0].className.match(swatchClassRegex)[2];
  21735. var viewportSwatchContainer = viewport.children("." + swatchClass);
  21736. if (!viewportSwatchContainer.length) {
  21737. viewportSwatchContainer = $("<div>").addClass(swatchClass).appendTo(viewport)
  21738. }
  21739. return viewportSwatchContainer
  21740. };
  21741. module.exports = {
  21742. getSwatchContainer: getSwatchContainer
  21743. }
  21744. }, ,
  21745. /*!*******************************************************!*\
  21746. !*** ./artifacts/transpiled/localization/currency.js ***!
  21747. \*******************************************************/
  21748. /*! dynamic exports provided */
  21749. /*! all exports used */
  21750. function(module, exports, __webpack_require__) {
  21751. var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
  21752. var numberLocalization = __webpack_require__( /*! ./number */ 51);
  21753. numberLocalization.inject({
  21754. _formatNumberCore: function(value, format, formatConfig) {
  21755. if ("currency" === format) {
  21756. formatConfig.precision = formatConfig.precision || 0;
  21757. var result = this.format(value, extend({}, formatConfig, {
  21758. type: "fixedpoint"
  21759. }));
  21760. var currencyPart = this.getCurrencySymbol().symbol.replace("$", "$$$$");
  21761. result = result.replace(/^(\D*)(\d.*)/, "$1" + currencyPart + "$2");
  21762. return result
  21763. }
  21764. return this.callBase.apply(this, arguments)
  21765. },
  21766. getCurrencySymbol: function() {
  21767. return {
  21768. symbol: "$"
  21769. }
  21770. },
  21771. getOpenXmlCurrencyFormat: function() {
  21772. return "$#,##0{0}_);\\($#,##0{0}\\)"
  21773. }
  21774. })
  21775. },
  21776. /*!**********************************************************************!*\
  21777. !*** ./artifacts/transpiled/core/component_registrator_callbacks.js ***!
  21778. \**********************************************************************/
  21779. /*! dynamic exports provided */
  21780. /*! all exports used */
  21781. function(module, exports, __webpack_require__) {
  21782. var MemorizedCallbacks = __webpack_require__( /*! ./memorized_callbacks */ 177);
  21783. module.exports = new MemorizedCallbacks
  21784. },
  21785. /*!*****************************************************!*\
  21786. !*** ./artifacts/transpiled/events/pointer/base.js ***!
  21787. \*****************************************************/
  21788. /*! dynamic exports provided */
  21789. /*! all exports used */
  21790. function(module, exports, __webpack_require__) {
  21791. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  21792. var browser = __webpack_require__( /*! ../../core/utils/browser */ 25);
  21793. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  21794. var Class = __webpack_require__( /*! ../../core/class */ 15);
  21795. var eventUtils = __webpack_require__( /*! ../utils */ 8);
  21796. var POINTER_EVENTS_NAMESPACE = "dxPointerEvents";
  21797. var BaseStrategy = Class.inherit({
  21798. ctor: function(eventName, originalEvents) {
  21799. this._eventName = eventName;
  21800. this._originalEvents = eventUtils.addNamespace(originalEvents, POINTER_EVENTS_NAMESPACE);
  21801. this._handlerCount = 0;
  21802. this.noBubble = this._isNoBubble()
  21803. },
  21804. _isNoBubble: function() {
  21805. var eventName = this._eventName;
  21806. return "dxpointerenter" === eventName || "dxpointerleave" === eventName
  21807. },
  21808. _handler: function(e) {
  21809. var delegateTarget = this._getDelegateTarget(e);
  21810. return this._fireEvent({
  21811. type: this._eventName,
  21812. pointerType: e.pointerType || eventUtils.eventSource(e),
  21813. originalEvent: e,
  21814. delegateTarget: delegateTarget,
  21815. timeStamp: browser.mozilla ? (new Date).getTime() : e.timeStamp
  21816. })
  21817. },
  21818. _getDelegateTarget: function(e) {
  21819. var delegateTarget;
  21820. if (this.noBubble) {
  21821. delegateTarget = e.delegateTarget
  21822. }
  21823. return delegateTarget
  21824. },
  21825. _fireEvent: function(args) {
  21826. return eventUtils.fireEvent(args)
  21827. },
  21828. _setSelector: function(handleObj) {
  21829. this._selector = this.noBubble && handleObj ? handleObj.selector : null
  21830. },
  21831. _getSelector: function() {
  21832. return this._selector
  21833. },
  21834. setup: function() {
  21835. return true
  21836. },
  21837. add: function(element, handleObj) {
  21838. if (this._handlerCount <= 0 || this.noBubble) {
  21839. element = this.noBubble ? element : domAdapter.getDocument();
  21840. this._setSelector(handleObj);
  21841. var that = this;
  21842. eventsEngine.on(element, this._originalEvents, this._getSelector(), function(e) {
  21843. that._handler(e)
  21844. })
  21845. }
  21846. if (!this.noBubble) {
  21847. this._handlerCount++
  21848. }
  21849. },
  21850. remove: function(handleObj) {
  21851. this._setSelector(handleObj);
  21852. if (!this.noBubble) {
  21853. this._handlerCount--
  21854. }
  21855. },
  21856. teardown: function(element) {
  21857. if (this._handlerCount && !this.noBubble) {
  21858. return
  21859. }
  21860. element = this.noBubble ? element : domAdapter.getDocument();
  21861. if (this._originalEvents !== "." + POINTER_EVENTS_NAMESPACE) {
  21862. eventsEngine.off(element, this._originalEvents, this._getSelector())
  21863. }
  21864. },
  21865. dispose: function(element) {
  21866. element = this.noBubble ? element : domAdapter.getDocument();
  21867. eventsEngine.off(element, this._originalEvents)
  21868. }
  21869. });
  21870. module.exports = BaseStrategy
  21871. },
  21872. /*!**************************************************!*\
  21873. !*** ./artifacts/transpiled/data/array_query.js ***!
  21874. \**************************************************/
  21875. /*! dynamic exports provided */
  21876. /*! all exports used */
  21877. function(module, exports, __webpack_require__) {
  21878. var Class = __webpack_require__( /*! ../core/class */ 15);
  21879. var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
  21880. var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
  21881. var compileGetter = __webpack_require__( /*! ../core/utils/data */ 20).compileGetter;
  21882. var toComparable = __webpack_require__( /*! ../core/utils/data */ 20).toComparable;
  21883. var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred;
  21884. var errorsModule = __webpack_require__( /*! ./errors */ 36);
  21885. var dataUtils = __webpack_require__( /*! ./utils */ 41);
  21886. var Iterator = Class.inherit({
  21887. toArray: function() {
  21888. var result = [];
  21889. this.reset();
  21890. while (this.next()) {
  21891. result.push(this.current())
  21892. }
  21893. return result
  21894. },
  21895. countable: function() {
  21896. return false
  21897. }
  21898. });
  21899. var ArrayIterator = Iterator.inherit({
  21900. ctor: function(array) {
  21901. this.array = array;
  21902. this.index = -1
  21903. },
  21904. next: function() {
  21905. if (this.index + 1 < this.array.length) {
  21906. this.index++;
  21907. return true
  21908. }
  21909. return false
  21910. },
  21911. current: function() {
  21912. return this.array[this.index]
  21913. },
  21914. reset: function() {
  21915. this.index = -1
  21916. },
  21917. toArray: function() {
  21918. return this.array.slice(0)
  21919. },
  21920. countable: function() {
  21921. return true
  21922. },
  21923. count: function() {
  21924. return this.array.length
  21925. }
  21926. });
  21927. var WrappedIterator = Iterator.inherit({
  21928. ctor: function(iter) {
  21929. this.iter = iter
  21930. },
  21931. next: function() {
  21932. return this.iter.next()
  21933. },
  21934. current: function() {
  21935. return this.iter.current()
  21936. },
  21937. reset: function() {
  21938. return this.iter.reset()
  21939. }
  21940. });
  21941. var MapIterator = WrappedIterator.inherit({
  21942. ctor: function(iter, mapper) {
  21943. this.callBase(iter);
  21944. this.index = -1;
  21945. this.mapper = mapper
  21946. },
  21947. current: function() {
  21948. return this.mapper(this.callBase(), this.index)
  21949. },
  21950. next: function() {
  21951. var hasNext = this.callBase();
  21952. if (hasNext) {
  21953. this.index++
  21954. }
  21955. return hasNext
  21956. }
  21957. });
  21958. var defaultCompare = function(xValue, yValue) {
  21959. xValue = toComparable(xValue);
  21960. yValue = toComparable(yValue);
  21961. if (null === xValue && null !== yValue) {
  21962. return -1
  21963. }
  21964. if (null !== xValue && null === yValue) {
  21965. return 1
  21966. }
  21967. if (void 0 === xValue && void 0 !== yValue) {
  21968. return 1
  21969. }
  21970. if (void 0 !== xValue && void 0 === yValue) {
  21971. return -1
  21972. }
  21973. if (xValue < yValue) {
  21974. return -1
  21975. }
  21976. if (xValue > yValue) {
  21977. return 1
  21978. }
  21979. return 0
  21980. };
  21981. var SortIterator = Iterator.inherit({
  21982. ctor: function(iter, getter, desc, compare) {
  21983. if (!(iter instanceof MapIterator)) {
  21984. iter = new MapIterator(iter, this._wrap)
  21985. }
  21986. this.iter = iter;
  21987. this.rules = [{
  21988. getter: getter,
  21989. desc: desc,
  21990. compare: compare
  21991. }]
  21992. },
  21993. thenBy: function(getter, desc, compare) {
  21994. var result = new SortIterator(this.sortedIter || this.iter, getter, desc, compare);
  21995. if (!this.sortedIter) {
  21996. result.rules = this.rules.concat(result.rules)
  21997. }
  21998. return result
  21999. },
  22000. next: function() {
  22001. this._ensureSorted();
  22002. return this.sortedIter.next()
  22003. },
  22004. current: function() {
  22005. this._ensureSorted();
  22006. return this.sortedIter.current()
  22007. },
  22008. reset: function() {
  22009. delete this.sortedIter
  22010. },
  22011. countable: function() {
  22012. return this.sortedIter || this.iter.countable()
  22013. },
  22014. count: function() {
  22015. if (this.sortedIter) {
  22016. return this.sortedIter.count()
  22017. }
  22018. return this.iter.count()
  22019. },
  22020. _ensureSorted: function() {
  22021. var that = this;
  22022. if (that.sortedIter) {
  22023. return
  22024. }
  22025. iteratorUtils.each(that.rules, function() {
  22026. this.getter = compileGetter(this.getter)
  22027. });
  22028. that.sortedIter = new MapIterator(new ArrayIterator(this.iter.toArray().sort(function(x, y) {
  22029. return that._compare(x, y)
  22030. })), that._unwrap)
  22031. },
  22032. _wrap: function(record, index) {
  22033. return {
  22034. index: index,
  22035. value: record
  22036. }
  22037. },
  22038. _unwrap: function(wrappedItem) {
  22039. return wrappedItem.value
  22040. },
  22041. _compare: function(x, y) {
  22042. var xIndex = x.index;
  22043. var yIndex = y.index;
  22044. x = x.value;
  22045. y = y.value;
  22046. if (x === y) {
  22047. return xIndex - yIndex
  22048. }
  22049. for (var i = 0, rulesCount = this.rules.length; i < rulesCount; i++) {
  22050. var rule = this.rules[i];
  22051. var xValue = rule.getter(x);
  22052. var yValue = rule.getter(y);
  22053. var compare = rule.compare || defaultCompare;
  22054. var compareResult = compare(xValue, yValue);
  22055. if (compareResult) {
  22056. return rule.desc ? -compareResult : compareResult
  22057. }
  22058. }
  22059. return xIndex - yIndex
  22060. }
  22061. });
  22062. var compileCriteria = function() {
  22063. var compileGroup = function(crit) {
  22064. var ops = [];
  22065. var isConjunctiveOperator = false;
  22066. var isConjunctiveNextOperator = false;
  22067. iteratorUtils.each(crit, function() {
  22068. if (Array.isArray(this) || typeUtils.isFunction(this)) {
  22069. if (ops.length > 1 && isConjunctiveOperator !== isConjunctiveNextOperator) {
  22070. throw new errorsModule.errors.Error("E4019")
  22071. }
  22072. ops.push(compileCriteria(this));
  22073. isConjunctiveOperator = isConjunctiveNextOperator;
  22074. isConjunctiveNextOperator = true
  22075. } else {
  22076. isConjunctiveNextOperator = dataUtils.isConjunctiveOperator(this)
  22077. }
  22078. });
  22079. return function(d) {
  22080. var result = isConjunctiveOperator;
  22081. for (var i = 0; i < ops.length; i++) {
  22082. if (ops[i](d) !== isConjunctiveOperator) {
  22083. result = !isConjunctiveOperator;
  22084. break
  22085. }
  22086. }
  22087. return result
  22088. }
  22089. };
  22090. var toString = function(value) {
  22091. return typeUtils.isDefined(value) ? value.toString() : ""
  22092. };
  22093. var compileBinary = function(crit) {
  22094. crit = dataUtils.normalizeBinaryCriterion(crit);
  22095. var getter = compileGetter(crit[0]);
  22096. var op = crit[1];
  22097. var value = crit[2];
  22098. value = toComparable(value);
  22099. switch (op.toLowerCase()) {
  22100. case "=":
  22101. return compileEquals(getter, value);
  22102. case "<>":
  22103. return compileEquals(getter, value, true);
  22104. case ">":
  22105. return function(obj) {
  22106. return toComparable(getter(obj)) > value
  22107. };
  22108. case "<":
  22109. return function(obj) {
  22110. return toComparable(getter(obj)) < value
  22111. };
  22112. case ">=":
  22113. return function(obj) {
  22114. return toComparable(getter(obj)) >= value
  22115. };
  22116. case "<=":
  22117. return function(obj) {
  22118. return toComparable(getter(obj)) <= value
  22119. };
  22120. case "startswith":
  22121. return function(obj) {
  22122. return 0 === toComparable(toString(getter(obj))).indexOf(value)
  22123. };
  22124. case "endswith":
  22125. return function(obj) {
  22126. var getterValue = toComparable(toString(getter(obj)));
  22127. var searchValue = toString(value);
  22128. if (getterValue.length < searchValue.length) {
  22129. return false
  22130. }
  22131. var index = getterValue.lastIndexOf(value);
  22132. return index !== -1 && index === getterValue.length - value.length
  22133. };
  22134. case "contains":
  22135. return function(obj) {
  22136. return toComparable(toString(getter(obj))).indexOf(value) > -1
  22137. };
  22138. case "notcontains":
  22139. return function(obj) {
  22140. return toComparable(toString(getter(obj))).indexOf(value) === -1
  22141. }
  22142. }
  22143. throw errorsModule.errors.Error("E4003", op)
  22144. };
  22145. function compileEquals(getter, value, negate) {
  22146. return function(obj) {
  22147. obj = toComparable(getter(obj));
  22148. var result = useStrictComparison(value) ? obj === value : obj == value;
  22149. if (negate) {
  22150. result = !result
  22151. }
  22152. return result
  22153. }
  22154. }
  22155. function useStrictComparison(value) {
  22156. return "" === value || 0 === value || false === value
  22157. }
  22158. function compileUnary(crit) {
  22159. var op = crit[0];
  22160. var criteria = compileCriteria(crit[1]);
  22161. if ("!" === op) {
  22162. return function(obj) {
  22163. return !criteria(obj)
  22164. }
  22165. }
  22166. throw errorsModule.errors.Error("E4003", op)
  22167. }
  22168. return function(crit) {
  22169. if (typeUtils.isFunction(crit)) {
  22170. return crit
  22171. }
  22172. if (dataUtils.isGroupCriterion(crit)) {
  22173. return compileGroup(crit)
  22174. }
  22175. if (dataUtils.isUnaryOperation(crit)) {
  22176. return compileUnary(crit)
  22177. }
  22178. return compileBinary(crit)
  22179. }
  22180. }();
  22181. var FilterIterator = WrappedIterator.inherit({
  22182. ctor: function(iter, criteria) {
  22183. this.callBase(iter);
  22184. this.criteria = compileCriteria(criteria)
  22185. },
  22186. next: function() {
  22187. while (this.iter.next()) {
  22188. if (this.criteria(this.current())) {
  22189. return true
  22190. }
  22191. }
  22192. return false
  22193. }
  22194. });
  22195. var GroupIterator = Iterator.inherit({
  22196. ctor: function(iter, getter) {
  22197. this.iter = iter;
  22198. this.getter = getter
  22199. },
  22200. next: function() {
  22201. this._ensureGrouped();
  22202. return this.groupedIter.next()
  22203. },
  22204. current: function() {
  22205. this._ensureGrouped();
  22206. return this.groupedIter.current()
  22207. },
  22208. reset: function() {
  22209. delete this.groupedIter
  22210. },
  22211. countable: function() {
  22212. return !!this.groupedIter
  22213. },
  22214. count: function() {
  22215. return this.groupedIter.count()
  22216. },
  22217. _ensureGrouped: function() {
  22218. if (this.groupedIter) {
  22219. return
  22220. }
  22221. var hash = {};
  22222. var keys = [];
  22223. var iter = this.iter;
  22224. var getter = compileGetter(this.getter);
  22225. iter.reset();
  22226. while (iter.next()) {
  22227. var current = iter.current();
  22228. var key = getter(current);
  22229. if (key in hash) {
  22230. hash[key].push(current)
  22231. } else {
  22232. hash[key] = [current];
  22233. keys.push(key)
  22234. }
  22235. }
  22236. this.groupedIter = new ArrayIterator(iteratorUtils.map(keys, function(key) {
  22237. return {
  22238. key: key,
  22239. items: hash[key]
  22240. }
  22241. }))
  22242. }
  22243. });
  22244. var SelectIterator = WrappedIterator.inherit({
  22245. ctor: function(iter, getter) {
  22246. this.callBase(iter);
  22247. this.getter = compileGetter(getter)
  22248. },
  22249. current: function() {
  22250. return this.getter(this.callBase())
  22251. },
  22252. countable: function() {
  22253. return this.iter.countable()
  22254. },
  22255. count: function() {
  22256. return this.iter.count()
  22257. }
  22258. });
  22259. var SliceIterator = WrappedIterator.inherit({
  22260. ctor: function(iter, skip, take) {
  22261. this.callBase(iter);
  22262. this.skip = Math.max(0, skip);
  22263. this.take = Math.max(0, take);
  22264. this.pos = 0
  22265. },
  22266. next: function() {
  22267. if (this.pos >= this.skip + this.take) {
  22268. return false
  22269. }
  22270. while (this.pos < this.skip && this.iter.next()) {
  22271. this.pos++
  22272. }
  22273. this.pos++;
  22274. return this.iter.next()
  22275. },
  22276. reset: function() {
  22277. this.callBase();
  22278. this.pos = 0
  22279. },
  22280. countable: function() {
  22281. return this.iter.countable()
  22282. },
  22283. count: function() {
  22284. return Math.min(this.iter.count() - this.skip, this.take)
  22285. }
  22286. });
  22287. var arrayQueryImpl = function arrayQueryImpl(iter, queryOptions) {
  22288. queryOptions = queryOptions || {};
  22289. if (!(iter instanceof Iterator)) {
  22290. iter = new ArrayIterator(iter)
  22291. }
  22292. var handleError = function(error) {
  22293. var handler = queryOptions.errorHandler;
  22294. if (handler) {
  22295. handler(error)
  22296. }
  22297. errorsModule._errorHandler(error)
  22298. };
  22299. var aggregateCore = function(aggregator) {
  22300. var d = (new Deferred).fail(handleError);
  22301. var seed;
  22302. var step = aggregator.step;
  22303. var finalize = aggregator.finalize;
  22304. try {
  22305. iter.reset();
  22306. if ("seed" in aggregator) {
  22307. seed = aggregator.seed
  22308. } else {
  22309. seed = iter.next() ? iter.current() : NaN
  22310. }
  22311. var accumulator = seed;
  22312. while (iter.next()) {
  22313. accumulator = step(accumulator, iter.current())
  22314. }
  22315. d.resolve(finalize ? finalize(accumulator) : accumulator)
  22316. } catch (x) {
  22317. d.reject(x)
  22318. }
  22319. return d.promise()
  22320. };
  22321. var aggregate = function(seed, step, finalize) {
  22322. if (arguments.length < 2) {
  22323. return aggregateCore({
  22324. step: arguments[0]
  22325. })
  22326. }
  22327. return aggregateCore({
  22328. seed: seed,
  22329. step: step,
  22330. finalize: finalize
  22331. })
  22332. };
  22333. var standardAggregate = function(name) {
  22334. return aggregateCore(dataUtils.aggregators[name])
  22335. };
  22336. var select = function(getter) {
  22337. if (!typeUtils.isFunction(getter) && !Array.isArray(getter)) {
  22338. getter = [].slice.call(arguments)
  22339. }
  22340. return chainQuery(new SelectIterator(iter, getter))
  22341. };
  22342. var selectProp = function(name) {
  22343. return select(compileGetter(name))
  22344. };
  22345. var chainQuery = function(iter) {
  22346. return arrayQueryImpl(iter, queryOptions)
  22347. };
  22348. return {
  22349. toArray: function() {
  22350. return iter.toArray()
  22351. },
  22352. enumerate: function() {
  22353. var d = (new Deferred).fail(handleError);
  22354. try {
  22355. d.resolve(iter.toArray())
  22356. } catch (x) {
  22357. d.reject(x)
  22358. }
  22359. return d.promise()
  22360. },
  22361. sortBy: function(getter, desc, compare) {
  22362. return chainQuery(new SortIterator(iter, getter, desc, compare))
  22363. },
  22364. thenBy: function(getter, desc, compare) {
  22365. if (iter instanceof SortIterator) {
  22366. return chainQuery(iter.thenBy(getter, desc, compare))
  22367. }
  22368. throw errorsModule.errors.Error("E4004")
  22369. },
  22370. filter: function(criteria) {
  22371. if (!Array.isArray(criteria)) {
  22372. criteria = [].slice.call(arguments)
  22373. }
  22374. return chainQuery(new FilterIterator(iter, criteria))
  22375. },
  22376. slice: function(skip, take) {
  22377. if (void 0 === take) {
  22378. take = Number.MAX_VALUE
  22379. }
  22380. return chainQuery(new SliceIterator(iter, skip, take))
  22381. },
  22382. select: select,
  22383. groupBy: function(getter) {
  22384. return chainQuery(new GroupIterator(iter, getter))
  22385. },
  22386. aggregate: aggregate,
  22387. count: function() {
  22388. if (iter.countable()) {
  22389. var d = (new Deferred).fail(handleError);
  22390. try {
  22391. d.resolve(iter.count())
  22392. } catch (x) {
  22393. d.reject(x)
  22394. }
  22395. return d.promise()
  22396. }
  22397. return standardAggregate("count")
  22398. },
  22399. sum: function(getter) {
  22400. if (getter) {
  22401. return selectProp(getter).sum()
  22402. }
  22403. return standardAggregate("sum")
  22404. },
  22405. min: function(getter) {
  22406. if (getter) {
  22407. return selectProp(getter).min()
  22408. }
  22409. return standardAggregate("min")
  22410. },
  22411. max: function(getter) {
  22412. if (getter) {
  22413. return selectProp(getter).max()
  22414. }
  22415. return standardAggregate("max")
  22416. },
  22417. avg: function(getter) {
  22418. if (getter) {
  22419. return selectProp(getter).avg()
  22420. }
  22421. return standardAggregate("avg")
  22422. }
  22423. }
  22424. };
  22425. module.exports = arrayQueryImpl
  22426. },
  22427. /*!**********************************************************!*\
  22428. !*** ./artifacts/transpiled/data/odata/query_adapter.js ***!
  22429. \**********************************************************/
  22430. /*! dynamic exports provided */
  22431. /*! all exports used */
  22432. function(module, exports, __webpack_require__) {
  22433. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  22434. var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  22435. var config = __webpack_require__( /*! ../../core/config */ 31);
  22436. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  22437. var queryAdapters = __webpack_require__( /*! ../query_adapters */ 181);
  22438. var odataUtils = __webpack_require__( /*! ./utils */ 110);
  22439. var serializePropName = odataUtils.serializePropName;
  22440. var errors = __webpack_require__( /*! ../errors */ 36).errors;
  22441. var dataUtils = __webpack_require__( /*! ../utils */ 41);
  22442. var isFunction = typeUtils.isFunction;
  22443. var DEFAULT_PROTOCOL_VERSION = 2;
  22444. var compileCriteria = function() {
  22445. var protocolVersion;
  22446. var forceLowerCase;
  22447. var fieldTypes;
  22448. var createBinaryOperationFormatter = function(op) {
  22449. return function(prop, val) {
  22450. return prop + " " + op + " " + val
  22451. }
  22452. };
  22453. var createStringFuncFormatter = function(op, reverse) {
  22454. return function(prop, val) {
  22455. var bag = [op, "("];
  22456. if (forceLowerCase) {
  22457. prop = prop.indexOf("tolower(") === -1 ? "tolower(" + prop + ")" : prop;
  22458. val = val.toLowerCase()
  22459. }
  22460. if (reverse) {
  22461. bag.push(val, ",", prop)
  22462. } else {
  22463. bag.push(prop, ",", val)
  22464. }
  22465. bag.push(")");
  22466. return bag.join("")
  22467. }
  22468. };
  22469. var formatters = {
  22470. "=": createBinaryOperationFormatter("eq"),
  22471. "<>": createBinaryOperationFormatter("ne"),
  22472. ">": createBinaryOperationFormatter("gt"),
  22473. ">=": createBinaryOperationFormatter("ge"),
  22474. "<": createBinaryOperationFormatter("lt"),
  22475. "<=": createBinaryOperationFormatter("le"),
  22476. startswith: createStringFuncFormatter("startswith"),
  22477. endswith: createStringFuncFormatter("endswith")
  22478. };
  22479. var formattersV2 = extend({}, formatters, {
  22480. contains: createStringFuncFormatter("substringof", true),
  22481. notcontains: createStringFuncFormatter("not substringof", true)
  22482. });
  22483. var formattersV4 = extend({}, formatters, {
  22484. contains: createStringFuncFormatter("contains"),
  22485. notcontains: createStringFuncFormatter("not contains")
  22486. });
  22487. var compileBinary = function(criteria) {
  22488. criteria = dataUtils.normalizeBinaryCriterion(criteria);
  22489. var op = criteria[1];
  22490. var formatters = 4 === protocolVersion ? formattersV4 : formattersV2;
  22491. var formatter = formatters[op.toLowerCase()];
  22492. if (!formatter) {
  22493. throw errors.Error("E4003", op)
  22494. }
  22495. var fieldName = criteria[0];
  22496. var value = criteria[2];
  22497. if (fieldTypes && fieldTypes[fieldName]) {
  22498. value = odataUtils.convertPrimitiveValue(fieldTypes[fieldName], value)
  22499. }
  22500. return formatter(serializePropName(fieldName), odataUtils.serializeValue(value, protocolVersion))
  22501. };
  22502. var compileUnary = function(criteria) {
  22503. var op = criteria[0];
  22504. var crit = compileCore(criteria[1]);
  22505. if ("!" === op) {
  22506. return "not (" + crit + ")"
  22507. }
  22508. throw errors.Error("E4003", op)
  22509. };
  22510. var compileGroup = function(criteria) {
  22511. var bag = [];
  22512. var groupOperator;
  22513. var nextGroupOperator;
  22514. iteratorUtils.each(criteria, function(index, criterion) {
  22515. if (Array.isArray(criterion)) {
  22516. if (bag.length > 1 && groupOperator !== nextGroupOperator) {
  22517. throw new errors.Error("E4019")
  22518. }
  22519. bag.push("(" + compileCore(criterion) + ")");
  22520. groupOperator = nextGroupOperator;
  22521. nextGroupOperator = "and"
  22522. } else {
  22523. nextGroupOperator = dataUtils.isConjunctiveOperator(this) ? "and" : "or"
  22524. }
  22525. });
  22526. return bag.join(" " + groupOperator + " ")
  22527. };
  22528. var compileCore = function(criteria) {
  22529. if (Array.isArray(criteria[0])) {
  22530. return compileGroup(criteria)
  22531. }
  22532. if (dataUtils.isUnaryOperation(criteria)) {
  22533. return compileUnary(criteria)
  22534. }
  22535. return compileBinary(criteria)
  22536. };
  22537. return function(criteria, version, types, filterToLower) {
  22538. fieldTypes = types;
  22539. forceLowerCase = typeUtils.isDefined(filterToLower) ? filterToLower : config().oDataFilterToLower;
  22540. protocolVersion = version;
  22541. return compileCore(criteria)
  22542. }
  22543. }();
  22544. var createODataQueryAdapter = function(queryOptions) {
  22545. var _sorting = [];
  22546. var _criteria = [];
  22547. var _expand = queryOptions.expand;
  22548. var _select;
  22549. var _skip;
  22550. var _take;
  22551. var _countQuery;
  22552. var _oDataVersion = queryOptions.version || DEFAULT_PROTOCOL_VERSION;
  22553. var hasSlice = function() {
  22554. return _skip || void 0 !== _take
  22555. };
  22556. var hasFunction = function hasFunction(criterion) {
  22557. for (var i = 0; i < criterion.length; i++) {
  22558. if (isFunction(criterion[i])) {
  22559. return true
  22560. }
  22561. if (Array.isArray(criterion[i]) && hasFunction(criterion[i])) {
  22562. return true
  22563. }
  22564. }
  22565. return false
  22566. };
  22567. var requestData = function() {
  22568. var result = {};
  22569. if (!_countQuery) {
  22570. if (_sorting.length) {
  22571. result.$orderby = _sorting.join(",")
  22572. }
  22573. if (_skip) {
  22574. result.$skip = _skip
  22575. }
  22576. if (void 0 !== _take) {
  22577. result.$top = _take
  22578. }
  22579. result.$select = odataUtils.generateSelect(_oDataVersion, _select) || void 0;
  22580. result.$expand = odataUtils.generateExpand(_oDataVersion, _expand, _select) || void 0
  22581. }
  22582. if (_criteria.length) {
  22583. var criteria = _criteria.length < 2 ? _criteria[0] : _criteria;
  22584. var fieldTypes = queryOptions && queryOptions.fieldTypes;
  22585. var filterToLower = queryOptions && queryOptions.filterToLower;
  22586. result.$filter = compileCriteria(criteria, _oDataVersion, fieldTypes, filterToLower)
  22587. }
  22588. if (_countQuery) {
  22589. result.$top = 0
  22590. }
  22591. if (queryOptions.requireTotalCount || _countQuery) {
  22592. if (4 !== _oDataVersion) {
  22593. result.$inlinecount = "allpages"
  22594. } else {
  22595. result.$count = "true"
  22596. }
  22597. }
  22598. return result
  22599. };
  22600. function tryLiftSelect(tasks) {
  22601. var selectIndex = -1;
  22602. for (var i = 0; i < tasks.length; i++) {
  22603. if ("select" === tasks[i].name) {
  22604. selectIndex = i;
  22605. break
  22606. }
  22607. }
  22608. if (selectIndex < 0 || !isFunction(tasks[selectIndex].args[0])) {
  22609. return
  22610. }
  22611. var nextTask = tasks[1 + selectIndex];
  22612. if (!nextTask || "slice" !== nextTask.name) {
  22613. return
  22614. }
  22615. tasks[1 + selectIndex] = tasks[selectIndex];
  22616. tasks[selectIndex] = nextTask
  22617. }
  22618. return {
  22619. optimize: function(tasks) {
  22620. tryLiftSelect(tasks)
  22621. },
  22622. exec: function(url) {
  22623. return odataUtils.sendRequest(_oDataVersion, {
  22624. url: url,
  22625. params: extend(requestData(), queryOptions && queryOptions.params)
  22626. }, {
  22627. beforeSend: queryOptions.beforeSend,
  22628. jsonp: queryOptions.jsonp,
  22629. withCredentials: queryOptions.withCredentials,
  22630. countOnly: _countQuery,
  22631. deserializeDates: queryOptions.deserializeDates,
  22632. fieldTypes: queryOptions.fieldTypes,
  22633. isPaged: isFinite(_take)
  22634. })
  22635. },
  22636. multiSort: function(args) {
  22637. var rules;
  22638. if (hasSlice()) {
  22639. return false
  22640. }
  22641. for (var i = 0; i < args.length; i++) {
  22642. var getter = args[i][0];
  22643. var desc = !!args[i][1];
  22644. var rule;
  22645. if ("string" !== typeof getter) {
  22646. return false
  22647. }
  22648. rule = serializePropName(getter);
  22649. if (desc) {
  22650. rule += " desc"
  22651. }
  22652. rules = rules || [];
  22653. rules.push(rule)
  22654. }
  22655. _sorting = rules
  22656. },
  22657. slice: function(skipCount, takeCount) {
  22658. if (hasSlice()) {
  22659. return false
  22660. }
  22661. _skip = skipCount;
  22662. _take = takeCount
  22663. },
  22664. filter: function(criterion) {
  22665. if (hasSlice()) {
  22666. return false
  22667. }
  22668. if (!Array.isArray(criterion)) {
  22669. criterion = [].slice.call(arguments)
  22670. }
  22671. if (hasFunction(criterion)) {
  22672. return false
  22673. }
  22674. if (_criteria.length) {
  22675. _criteria.push("and")
  22676. }
  22677. _criteria.push(criterion)
  22678. },
  22679. select: function(expr) {
  22680. if (_select || isFunction(expr)) {
  22681. return false
  22682. }
  22683. if (!Array.isArray(expr)) {
  22684. expr = [].slice.call(arguments)
  22685. }
  22686. _select = expr
  22687. },
  22688. count: function() {
  22689. _countQuery = true
  22690. }
  22691. }
  22692. };
  22693. queryAdapters.odata = createODataQueryAdapter;
  22694. exports.odata = createODataQueryAdapter
  22695. },
  22696. /*!**********************************************!*\
  22697. !*** ./artifacts/transpiled/core/version.js ***!
  22698. \**********************************************/
  22699. /*! dynamic exports provided */
  22700. /*! all exports used */
  22701. function(module, exports, __webpack_require__) {
  22702. module.exports = "19.1.16"
  22703. },
  22704. /*!****************************************************************!*\
  22705. !*** ./artifacts/transpiled/events/gesture/emitter.gesture.js ***!
  22706. \****************************************************************/
  22707. /*! dynamic exports provided */
  22708. /*! all exports used */
  22709. function(module, exports, __webpack_require__) {
  22710. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  22711. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  22712. var devices = __webpack_require__( /*! ../../core/devices */ 16);
  22713. var styleUtils = __webpack_require__( /*! ../../core/utils/style */ 85);
  22714. var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 63);
  22715. var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
  22716. var readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48);
  22717. var ready = readyCallbacks.add;
  22718. var mathUtils = __webpack_require__( /*! ../../core/utils/math */ 28);
  22719. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  22720. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  22721. var eventUtils = __webpack_require__( /*! ../utils */ 8);
  22722. var Emitter = __webpack_require__( /*! ../core/emitter */ 123);
  22723. var sign = mathUtils.sign;
  22724. var abs = Math.abs;
  22725. var SLEEP = 0;
  22726. var INITED = 1;
  22727. var STARTED = 2;
  22728. var TOUCH_BOUNDARY = 10;
  22729. var IMMEDIATE_TOUCH_BOUNDARY = 0;
  22730. var IMMEDIATE_TIMEOUT = 180;
  22731. var supportPointerEvents = function() {
  22732. return styleUtils.styleProp("pointer-events")
  22733. };
  22734. var setGestureCover = callOnce(function() {
  22735. var GESTURE_COVER_CLASS = "dx-gesture-cover";
  22736. var isDesktop = "generic" === devices.real().platform;
  22737. if (!supportPointerEvents() || !isDesktop) {
  22738. return noop
  22739. }
  22740. var $cover = $("<div>").addClass(GESTURE_COVER_CLASS).css("pointerEvents", "none");
  22741. eventsEngine.subscribeGlobal($cover, "dxmousewheel", function(e) {
  22742. e.preventDefault()
  22743. });
  22744. ready(function() {
  22745. $cover.appendTo("body")
  22746. });
  22747. return function(toggle, cursor) {
  22748. $cover.css("pointerEvents", toggle ? "all" : "none");
  22749. toggle && $cover.css("cursor", cursor)
  22750. }
  22751. });
  22752. var gestureCover = function(toggle, cursor) {
  22753. var gestureCoverStrategy = setGestureCover();
  22754. gestureCoverStrategy(toggle, cursor)
  22755. };
  22756. var GestureEmitter = Emitter.inherit({
  22757. gesture: true,
  22758. configure: function(data) {
  22759. this.getElement().css("msTouchAction", data.immediate ? "pinch-zoom" : "");
  22760. this.callBase(data)
  22761. },
  22762. allowInterruptionByMouseWheel: function() {
  22763. return this._stage !== STARTED
  22764. },
  22765. getDirection: function() {
  22766. return this.direction
  22767. },
  22768. _cancel: function() {
  22769. this.callBase.apply(this, arguments);
  22770. this._toggleGestureCover(false);
  22771. this._stage = SLEEP
  22772. },
  22773. start: function(e) {
  22774. if (e._needSkipEvent || eventUtils.needSkipEvent(e)) {
  22775. this._cancel(e);
  22776. return
  22777. }
  22778. this._startEvent = eventUtils.createEvent(e);
  22779. this._startEventData = eventUtils.eventData(e);
  22780. this._stage = INITED;
  22781. this._init(e);
  22782. this._setupImmediateTimer()
  22783. },
  22784. _setupImmediateTimer: function() {
  22785. clearTimeout(this._immediateTimer);
  22786. this._immediateAccepted = false;
  22787. if (!this.immediate) {
  22788. return
  22789. }
  22790. this._immediateTimer = setTimeout(function() {
  22791. this._immediateAccepted = true
  22792. }.bind(this), IMMEDIATE_TIMEOUT)
  22793. },
  22794. move: function(e) {
  22795. if (this._stage === INITED && this._directionConfirmed(e)) {
  22796. this._stage = STARTED;
  22797. this._resetActiveElement();
  22798. this._toggleGestureCover(true);
  22799. this._clearSelection(e);
  22800. this._adjustStartEvent(e);
  22801. this._start(this._startEvent);
  22802. if (this._stage === SLEEP) {
  22803. return
  22804. }
  22805. this._requestAccept(e);
  22806. this._move(e);
  22807. this._forgetAccept()
  22808. } else {
  22809. if (this._stage === STARTED) {
  22810. this._clearSelection(e);
  22811. this._move(e)
  22812. }
  22813. }
  22814. },
  22815. _directionConfirmed: function(e) {
  22816. var touchBoundary = this._getTouchBoundary(e);
  22817. var delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e));
  22818. var deltaX = abs(delta.x);
  22819. var deltaY = abs(delta.y);
  22820. var horizontalMove = this._validateMove(touchBoundary, deltaX, deltaY);
  22821. var verticalMove = this._validateMove(touchBoundary, deltaY, deltaX);
  22822. var direction = this.getDirection(e);
  22823. var bothAccepted = "both" === direction && (horizontalMove || verticalMove);
  22824. var horizontalAccepted = "horizontal" === direction && horizontalMove;
  22825. var verticalAccepted = "vertical" === direction && verticalMove;
  22826. return bothAccepted || horizontalAccepted || verticalAccepted || this._immediateAccepted
  22827. },
  22828. _validateMove: function(touchBoundary, mainAxis, crossAxis) {
  22829. return mainAxis && mainAxis >= touchBoundary && (this.immediate ? mainAxis >= crossAxis : true)
  22830. },
  22831. _getTouchBoundary: function(e) {
  22832. return this.immediate || eventUtils.isDxMouseWheelEvent(e) ? IMMEDIATE_TOUCH_BOUNDARY : TOUCH_BOUNDARY
  22833. },
  22834. _adjustStartEvent: function(e) {
  22835. var touchBoundary = this._getTouchBoundary(e);
  22836. var delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e));
  22837. this._startEvent.pageX += sign(delta.x) * touchBoundary;
  22838. this._startEvent.pageY += sign(delta.y) * touchBoundary
  22839. },
  22840. _resetActiveElement: function() {
  22841. if ("ios" === devices.real().platform && this.getElement().find(":focus").length) {
  22842. domUtils.resetActiveElement()
  22843. }
  22844. },
  22845. _toggleGestureCover: function(toggle) {
  22846. this._toggleGestureCoverImpl(toggle)
  22847. },
  22848. _toggleGestureCoverImpl: function(toggle) {
  22849. var isStarted = this._stage === STARTED;
  22850. if (isStarted) {
  22851. gestureCover(toggle, this.getElement().css("cursor"))
  22852. }
  22853. },
  22854. _clearSelection: function(e) {
  22855. if (eventUtils.isDxMouseWheelEvent(e) || eventUtils.isTouchEvent(e)) {
  22856. return
  22857. }
  22858. domUtils.clearSelection()
  22859. },
  22860. end: function(e) {
  22861. this._toggleGestureCover(false);
  22862. if (this._stage === STARTED) {
  22863. this._end(e)
  22864. } else {
  22865. if (this._stage === INITED) {
  22866. this._stop(e)
  22867. }
  22868. }
  22869. this._stage = SLEEP
  22870. },
  22871. dispose: function() {
  22872. clearTimeout(this._immediateTimer);
  22873. this.callBase.apply(this, arguments);
  22874. this._toggleGestureCover(false)
  22875. },
  22876. _init: noop,
  22877. _start: noop,
  22878. _move: noop,
  22879. _stop: noop,
  22880. _end: noop
  22881. });
  22882. GestureEmitter.initialTouchBoundary = TOUCH_BOUNDARY;
  22883. GestureEmitter.touchBoundary = function(newBoundary) {
  22884. if (isDefined(newBoundary)) {
  22885. TOUCH_BOUNDARY = newBoundary;
  22886. return
  22887. }
  22888. return TOUCH_BOUNDARY
  22889. };
  22890. module.exports = GestureEmitter
  22891. }, , , , , ,
  22892. /*!*********************************************!*\
  22893. !*** ./artifacts/transpiled/viz/palette.js ***!
  22894. \*********************************************/
  22895. /*! dynamic exports provided */
  22896. /*! all exports used */
  22897. function(module, exports, __webpack_require__) {
  22898. Object.defineProperty(exports, "__esModule", {
  22899. value: true
  22900. });
  22901. exports._DEBUG_palettes = void 0;
  22902. var _palettes;
  22903. exports.currentPalette = currentPalette;
  22904. exports.generateColors = generateColors;
  22905. exports.getPalette = getPalette;
  22906. exports.registerPalette = registerPalette;
  22907. exports.getAccentColor = getAccentColor;
  22908. exports.createPalette = createPalette;
  22909. exports.getDiscretePalette = getDiscretePalette;
  22910. exports.getGradientPalette = getGradientPalette;
  22911. var _utils = __webpack_require__( /*! ./core/utils */ 10);
  22912. var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
  22913. var _errors = __webpack_require__( /*! ../core/errors */ 21);
  22914. var _errors2 = _interopRequireDefault(_errors);
  22915. function _interopRequireDefault(obj) {
  22916. return obj && obj.__esModule ? obj : {
  22917. "default": obj
  22918. }
  22919. }
  22920. function _defineProperty(obj, key, value) {
  22921. if (key in obj) {
  22922. Object.defineProperty(obj, key, {
  22923. value: value,
  22924. enumerable: true,
  22925. configurable: true,
  22926. writable: true
  22927. })
  22928. } else {
  22929. obj[key] = value
  22930. }
  22931. return obj
  22932. }
  22933. var _floor = Math.floor;
  22934. var _ceil = Math.ceil;
  22935. var _Color = __webpack_require__( /*! ../color */ 94);
  22936. var _isArray = Array.isArray;
  22937. var _isString = __webpack_require__( /*! ../core/utils/type */ 1).isString;
  22938. var HIGHLIGHTING_STEP = 50;
  22939. var DEFAULT_PALETTE = "material";
  22940. var officePalette = {
  22941. simpleSet: ["#5f8b95", "#ba4d51", "#af8a53", "#955f71", "#859666", "#7e688c"],
  22942. indicatingSet: ["#a3b97c", "#e1b676", "#ec7f83"],
  22943. gradientSet: ["#5f8b95", "#ba4d51"],
  22944. accentColor: "#ba4d51"
  22945. };
  22946. var palettes = (_palettes = {}, _defineProperty(_palettes, DEFAULT_PALETTE, {
  22947. simpleSet: ["#1db2f5", "#f5564a", "#97c95c", "#ffc720", "#eb3573", "#a63db8"],
  22948. indicatingSet: ["#97c95c", "#ffc720", "#f5564a"],
  22949. gradientSet: ["#1db2f5", "#97c95c"],
  22950. accentColor: "#1db2f5"
  22951. }), _defineProperty(_palettes, "default", officePalette), _defineProperty(_palettes, "office", officePalette), _defineProperty(_palettes, "harmony light", {
  22952. simpleSet: ["#fcb65e", "#679ec5", "#ad79ce", "#7abd5c", "#e18e92", "#b6d623", "#b7abea", "#85dbd5"],
  22953. indicatingSet: ["#b6d623", "#fcb65e", "#e18e92"],
  22954. gradientSet: ["#7abd5c", "#fcb65e"],
  22955. accentColor: "#679ec5"
  22956. }), _defineProperty(_palettes, "soft pastel", {
  22957. simpleSet: ["#60a69f", "#78b6d9", "#6682bb", "#a37182", "#eeba69", "#90ba58", "#456c68", "#7565a4"],
  22958. indicatingSet: ["#90ba58", "#eeba69", "#a37182"],
  22959. gradientSet: ["#78b6d9", "#eeba69"],
  22960. accentColor: "#60a69f"
  22961. }), _defineProperty(_palettes, "pastel", {
  22962. simpleSet: ["#bb7862", "#70b3a1", "#bb626a", "#057d85", "#ab394b", "#dac599", "#153459", "#b1d2c6"],
  22963. indicatingSet: ["#70b3a1", "#dac599", "#bb626a"],
  22964. gradientSet: ["#bb7862", "#70b3a1"],
  22965. accentColor: "#bb7862"
  22966. }), _defineProperty(_palettes, "bright", {
  22967. simpleSet: ["#70c92f", "#f8ca00", "#bd1550", "#e97f02", "#9d419c", "#7e4452", "#9ab57e", "#36a3a6"],
  22968. indicatingSet: ["#70c92f", "#f8ca00", "#bd1550"],
  22969. gradientSet: ["#e97f02", "#f8ca00"],
  22970. accentColor: "#e97f02"
  22971. }), _defineProperty(_palettes, "soft", {
  22972. simpleSet: ["#cbc87b", "#9ab57e", "#e55253", "#7e4452", "#e8c267", "#565077", "#6babac", "#ad6082"],
  22973. indicatingSet: ["#9ab57e", "#e8c267", "#e55253"],
  22974. gradientSet: ["#9ab57e", "#e8c267"],
  22975. accentColor: "#565077"
  22976. }), _defineProperty(_palettes, "ocean", {
  22977. simpleSet: ["#75c099", "#acc371", "#378a8a", "#5fa26a", "#064970", "#38c5d2", "#00a7c6", "#6f84bb"],
  22978. indicatingSet: ["#c8e394", "#7bc59d", "#397c8b"],
  22979. gradientSet: ["#acc371", "#38c5d2"],
  22980. accentColor: "#378a8a"
  22981. }), _defineProperty(_palettes, "vintage", {
  22982. simpleSet: ["#dea484", "#efc59c", "#cb715e", "#eb9692", "#a85c4c", "#f2c0b5", "#c96374", "#dd956c"],
  22983. indicatingSet: ["#ffe5c6", "#f4bb9d", "#e57660"],
  22984. gradientSet: ["#efc59c", "#cb715e"],
  22985. accentColor: "#cb715e"
  22986. }), _defineProperty(_palettes, "violet", {
  22987. simpleSet: ["#d1a1d1", "#eeacc5", "#7b5685", "#7e7cad", "#a13d73", "#5b41ab", "#e287e2", "#689cc1"],
  22988. indicatingSet: ["#d8e2f6", "#d0b2da", "#d56a8a"],
  22989. gradientSet: ["#eeacc5", "#7b5685"],
  22990. accentColor: "#7b5685"
  22991. }), _defineProperty(_palettes, "carmine", {
  22992. simpleSet: ["#fb7764", "#73d47f", "#fed85e", "#d47683", "#dde392", "#757ab2"],
  22993. indicatingSet: ["#5cb85c", "#f0ad4e", "#d9534f"],
  22994. gradientSet: ["#fb7764", "#73d47f"],
  22995. accentColor: "#f05b41"
  22996. }), _defineProperty(_palettes, "dark moon", {
  22997. simpleSet: ["#4ddac1", "#f4c99a", "#80dd9b", "#f998b3", "#4aaaa0", "#a5aef1"],
  22998. indicatingSet: ["#59d8a4", "#f0ad4e", "#f9517e"],
  22999. gradientSet: ["#4ddac1", "#f4c99a"],
  23000. accentColor: "#3debd3"
  23001. }), _defineProperty(_palettes, "soft blue", {
  23002. simpleSet: ["#7ab8eb", "#97da97", "#facb86", "#e78683", "#839bda", "#4db7be"],
  23003. indicatingSet: ["#5cb85c", "#f0ad4e", "#d9534f"],
  23004. gradientSet: ["#7ab8eb", "#97da97"],
  23005. accentColor: "#7ab8eb"
  23006. }), _defineProperty(_palettes, "dark violet", {
  23007. simpleSet: ["#9c63ff", "#64c064", "#eead51", "#d2504b", "#4b6bbf", "#2da7b0"],
  23008. indicatingSet: ["#5cb85c", "#f0ad4e", "#d9534f"],
  23009. gradientSet: ["#9c63ff", "#64c064"],
  23010. accentColor: "#9c63ff"
  23011. }), _defineProperty(_palettes, "green mist", {
  23012. simpleSet: ["#3cbab2", "#8ed962", "#5b9d95", "#efcc7c", "#f1929f", "#4d8dab"],
  23013. indicatingSet: ["#72d63c", "#ffc852", "#f74a5e"],
  23014. gradientSet: ["#3cbab2", "#8ed962"],
  23015. accentColor: "#3cbab2"
  23016. }), _palettes);
  23017. var currentPaletteName;
  23018. function currentPalette(name) {
  23019. if (void 0 === name) {
  23020. return currentPaletteName || DEFAULT_PALETTE
  23021. } else {
  23022. name = (0, _utils.normalizeEnum)(name);
  23023. currentPaletteName = name in palettes ? name : void 0
  23024. }
  23025. }
  23026. function generateColors(palette, count) {
  23027. var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {
  23028. keepLastColorInEnd: false
  23029. };
  23030. options.type = options.baseColorSet;
  23031. options.extensionMode = options.paletteExtensionMode;
  23032. return createPalette(palette, options).generateColors(count)
  23033. }
  23034. function getPalette(palette, parameters) {
  23035. parameters = parameters || {};
  23036. palette = selectPaletteOnSeniority(palette, parameters.themeDefault);
  23037. var result;
  23038. var type = parameters.type;
  23039. if (_isArray(palette)) {
  23040. return palette.slice(0)
  23041. } else {
  23042. if (_isString(palette)) {
  23043. result = palettes[(0, _utils.normalizeEnum)(palette)]
  23044. }
  23045. if (!result) {
  23046. result = palettes[currentPalette()]
  23047. }
  23048. }
  23049. return type ? result[type].slice(0) : result
  23050. }
  23051. function registerPalette(name, palette) {
  23052. var item = {};
  23053. var paletteName;
  23054. if (_isArray(palette)) {
  23055. item.simpleSet = palette.slice(0)
  23056. } else {
  23057. if (palette) {
  23058. item.simpleSet = _isArray(palette.simpleSet) ? palette.simpleSet.slice(0) : void 0;
  23059. item.indicatingSet = _isArray(palette.indicatingSet) ? palette.indicatingSet.slice(0) : void 0;
  23060. item.gradientSet = _isArray(palette.gradientSet) ? palette.gradientSet.slice(0) : void 0;
  23061. item.accentColor = palette.accentColor
  23062. }
  23063. }
  23064. if (!item.accentColor) {
  23065. item.accentColor = item.simpleSet && item.simpleSet[0]
  23066. }
  23067. if (item.simpleSet || item.indicatingSet || item.gradientSet) {
  23068. paletteName = (0, _utils.normalizeEnum)(name);
  23069. (0, _extend.extend)(palettes[paletteName] = palettes[paletteName] || {}, item)
  23070. }
  23071. }
  23072. function getAccentColor(palette, themeDefault) {
  23073. palette = getPalette(palette, {
  23074. themeDefault: themeDefault
  23075. });
  23076. return palette.accentColor || palette[0]
  23077. }
  23078. function RingBuf(buf) {
  23079. var ind = 0;
  23080. this.next = function() {
  23081. var res = buf[ind++];
  23082. if (ind === buf.length) {
  23083. this.reset()
  23084. }
  23085. return res
  23086. };
  23087. this.reset = function() {
  23088. ind = 0
  23089. }
  23090. }
  23091. function getAlternateColorsStrategy(palette, parameters) {
  23092. var stepHighlight = parameters.useHighlight ? HIGHLIGHTING_STEP : 0;
  23093. var paletteSteps = new RingBuf([0, stepHighlight, -stepHighlight]);
  23094. var currentPalette = [];
  23095. function _reset() {
  23096. var step = paletteSteps.next();
  23097. currentPalette = step ? getAlteredPalette(palette, step) : palette.slice(0)
  23098. }
  23099. return {
  23100. getColor: function(index) {
  23101. var color = currentPalette[index % palette.length];
  23102. if (index % palette.length === palette.length - 1) {
  23103. _reset()
  23104. }
  23105. return color
  23106. },
  23107. generateColors: function(count) {
  23108. var colors = [];
  23109. count = count || parameters.count;
  23110. for (var i = 0; i < count; i++) {
  23111. colors.push(this.getColor(i))
  23112. }
  23113. return colors
  23114. },
  23115. reset: function() {
  23116. paletteSteps.reset();
  23117. _reset()
  23118. }
  23119. }
  23120. }
  23121. function getExtrapolateColorsStrategy(palette, parameters) {
  23122. function convertColor(color, cycleIndex, cycleCount) {
  23123. var hsl = new _Color(color).hsl;
  23124. var l = hsl.l / 100;
  23125. var diapason = cycleCount - 1 / cycleCount;
  23126. var minL = l - .5 * diapason;
  23127. var maxL = l + .5 * diapason;
  23128. var cycleMiddle = (cycleCount - 1) / 2;
  23129. var cycleDiff = cycleIndex - cycleMiddle;
  23130. if (minL < Math.min(.5, .9 * l)) {
  23131. minL = Math.min(.5, .9 * l)
  23132. }
  23133. if (maxL > Math.max(.8, l + .15 * (1 - l))) {
  23134. maxL = Math.max(.8, l + .15 * (1 - l))
  23135. }
  23136. if (cycleDiff < 0) {
  23137. l -= (minL - l) * cycleDiff / cycleMiddle
  23138. } else {
  23139. l += (maxL - l) * (cycleDiff / cycleMiddle)
  23140. }
  23141. hsl.l = 100 * l;
  23142. return _Color.prototype.fromHSL(hsl).toHex()
  23143. }
  23144. return {
  23145. getColor: function(index, count) {
  23146. var paletteCount = palette.length;
  23147. var cycles = _floor((count - 1) / paletteCount + 1);
  23148. var color = palette[index % paletteCount];
  23149. if (cycles > 1) {
  23150. return convertColor(color, _floor(index / paletteCount), cycles)
  23151. }
  23152. return color
  23153. },
  23154. generateColors: function(count) {
  23155. var colors = [];
  23156. count = count || parameters.count;
  23157. for (var i = 0; i < count; i++) {
  23158. colors.push(this.getColor(i, count))
  23159. }
  23160. return colors
  23161. },
  23162. reset: function() {}
  23163. }
  23164. }
  23165. function getColorMixer(palette, parameters) {
  23166. var paletteCount = palette.length;
  23167. var extendedPalette = [];
  23168. function distributeColors(count, colorsCount, startIndex, distribution) {
  23169. var groupSize = Math.floor(count / colorsCount);
  23170. var extraItems = count - colorsCount * groupSize;
  23171. var i = startIndex;
  23172. var middleIndex;
  23173. var size;
  23174. while (i < startIndex + count) {
  23175. size = groupSize;
  23176. if (extraItems > 0) {
  23177. size += 1;
  23178. extraItems--
  23179. }
  23180. middleIndex = size > 2 ? Math.floor(size / 2) : 0;
  23181. distribution.push(i + middleIndex);
  23182. i += size
  23183. }
  23184. return distribution.sort(function(a, b) {
  23185. return a - b
  23186. })
  23187. }
  23188. function getColorAndDistance(arr, startIndex, count) {
  23189. startIndex = (count + startIndex) % count;
  23190. var distance = 0;
  23191. for (var i = startIndex; i < 2 * count; i += 1) {
  23192. var index = (count + i) % count;
  23193. if (arr[index]) {
  23194. return [arr[index], distance]
  23195. }
  23196. distance++
  23197. }
  23198. }
  23199. function blendColors(paletteWithEmptyColors, paletteLength) {
  23200. for (var i = 0; i < paletteLength; i++) {
  23201. var color = paletteWithEmptyColors[i];
  23202. if (!color) {
  23203. var color1 = paletteWithEmptyColors[i - 1];
  23204. if (!color1) {
  23205. continue
  23206. } else {
  23207. var c2 = getColorAndDistance(paletteWithEmptyColors, i, paletteLength);
  23208. var color2 = new _Color(c2[0]);
  23209. color1 = new _Color(color1);
  23210. for (var j = 0; j < c2[1]; j++, i++) {
  23211. paletteWithEmptyColors[i] = color1.blend(color2, (j + 1) / (c2[1] + 1)).toHex()
  23212. }
  23213. }
  23214. }
  23215. }
  23216. return paletteWithEmptyColors
  23217. }
  23218. function extendPalette(count) {
  23219. if (count <= paletteCount) {
  23220. return palette
  23221. }
  23222. var result = [];
  23223. var colorInGroups = paletteCount - 2;
  23224. var currentColorIndex = 0;
  23225. var cleanColorIndices = [];
  23226. if (parameters.keepLastColorInEnd) {
  23227. cleanColorIndices = distributeColors(count - 2, colorInGroups, 1, [0, count - 1])
  23228. } else {
  23229. cleanColorIndices = distributeColors(count - 1, paletteCount - 1, 1, [0])
  23230. }
  23231. for (var i = 0; i < count; i++) {
  23232. if (cleanColorIndices.indexOf(i) > -1) {
  23233. result[i] = palette[currentColorIndex++]
  23234. }
  23235. }
  23236. result = blendColors(result, count);
  23237. return result
  23238. }
  23239. return {
  23240. getColor: function(index, count) {
  23241. count = count || parameters.count || paletteCount;
  23242. if (extendedPalette.length !== count) {
  23243. extendedPalette = extendPalette(count)
  23244. }
  23245. return extendedPalette[index % count]
  23246. },
  23247. generateColors: function(count, repeat) {
  23248. count = count || parameters.count || paletteCount;
  23249. if (repeat && count > paletteCount) {
  23250. var colors = extendPalette(paletteCount);
  23251. for (var i = 0; i < count - paletteCount; i++) {
  23252. colors.push(colors[i])
  23253. }
  23254. return colors
  23255. } else {
  23256. return paletteCount > 0 ? extendPalette(count).slice(0, count) : []
  23257. }
  23258. },
  23259. reset: function() {}
  23260. }
  23261. }
  23262. function createPalette(palette, parameters, themeDefaultPalette) {
  23263. var paletteObj = {
  23264. dispose: function() {
  23265. this._extensionStrategy = null
  23266. },
  23267. getNextColor: function(count) {
  23268. return this._extensionStrategy.getColor(this._currentColor++, count)
  23269. },
  23270. generateColors: function(count, parameters) {
  23271. return this._extensionStrategy.generateColors(count, (parameters || {}).repeat)
  23272. },
  23273. reset: function() {
  23274. this._currentColor = 0;
  23275. this._extensionStrategy.reset();
  23276. return this
  23277. }
  23278. };
  23279. parameters = parameters || {};
  23280. var extensionMode = (parameters.extensionMode || "").toLowerCase();
  23281. var colors = getPalette(palette, {
  23282. type: parameters.type || "simpleSet",
  23283. themeDefault: themeDefaultPalette
  23284. });
  23285. if ("alternate" === extensionMode) {
  23286. paletteObj._extensionStrategy = getAlternateColorsStrategy(colors, parameters)
  23287. } else {
  23288. if ("extrapolate" === extensionMode) {
  23289. paletteObj._extensionStrategy = getExtrapolateColorsStrategy(colors, parameters)
  23290. } else {
  23291. paletteObj._extensionStrategy = getColorMixer(colors, parameters)
  23292. }
  23293. }
  23294. paletteObj.reset();
  23295. return paletteObj
  23296. }
  23297. function getAlteredPalette(originalPalette, step) {
  23298. var palette = [];
  23299. var i;
  23300. var ii = originalPalette.length;
  23301. for (i = 0; i < ii; ++i) {
  23302. palette.push(getNewColor(originalPalette[i], step))
  23303. }
  23304. return palette
  23305. }
  23306. function getNewColor(currentColor, step) {
  23307. var newColor = new _Color(currentColor).alter(step);
  23308. var lightness = getLightness(newColor);
  23309. if (lightness > 200 || lightness < 55) {
  23310. newColor = new _Color(currentColor).alter(-step / 2)
  23311. }
  23312. return newColor.toHex()
  23313. }
  23314. function getLightness(color) {
  23315. return .3 * color.r + .59 * color.g + .11 * color.b
  23316. }
  23317. function getDiscretePalette(source, size, themeDefaultPalette) {
  23318. var palette = size > 0 ? createDiscreteColors(getPalette(source, {
  23319. type: "gradientSet",
  23320. themeDefault: themeDefaultPalette
  23321. }), size) : [];
  23322. return {
  23323. getColor: function(index) {
  23324. return palette[index] || null
  23325. }
  23326. }
  23327. }
  23328. function createDiscreteColors(source, count) {
  23329. var colorCount = count - 1;
  23330. var sourceCount = source.length - 1;
  23331. var colors = [];
  23332. var gradient = [];
  23333. var i;
  23334. function addColor(pos) {
  23335. var k = sourceCount * pos;
  23336. var kl = _floor(k);
  23337. var kr = _ceil(k);
  23338. gradient.push(colors[kl].blend(colors[kr], k - kl).toHex())
  23339. }
  23340. for (i = 0; i <= sourceCount; ++i) {
  23341. colors.push(new _Color(source[i]))
  23342. }
  23343. if (colorCount > 0) {
  23344. for (i = 0; i <= colorCount; ++i) {
  23345. addColor(i / colorCount)
  23346. }
  23347. } else {
  23348. addColor(.5)
  23349. }
  23350. return gradient
  23351. }
  23352. function getGradientPalette(source, themeDefaultPalette) {
  23353. var palette = getPalette(source, {
  23354. type: "gradientSet",
  23355. themeDefault: themeDefaultPalette
  23356. });
  23357. var color1 = new _Color(palette[0]);
  23358. var color2 = new _Color(palette[1]);
  23359. return {
  23360. getColor: function(ratio) {
  23361. return 0 <= ratio && ratio <= 1 ? color1.blend(color2, ratio).toHex() : null
  23362. }
  23363. }
  23364. }
  23365. function selectPaletteOnSeniority(source, themeDefaultPalette) {
  23366. var result = source || (void 0 === currentPaletteName ? themeDefaultPalette : currentPalette());
  23367. if ("default" === result) {
  23368. _errors2.default.log("W0016", '"palette"', "Default", "18.1", 'Use the "Office" value instead.')
  23369. }
  23370. return result
  23371. }
  23372. exports._DEBUG_palettes = palettes
  23373. },
  23374. /*!********************************************************!*\
  23375. !*** ./artifacts/transpiled/viz/series/area_series.js ***!
  23376. \********************************************************/
  23377. /*! dynamic exports provided */
  23378. /*! all exports used */
  23379. function(module, exports, __webpack_require__) {
  23380. var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
  23381. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  23382. var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106).chart;
  23383. var lineSeries = __webpack_require__( /*! ./line_series */ 203);
  23384. var chartLineSeries = lineSeries.chart.line;
  23385. var polarLineSeries = lineSeries.polar.line;
  23386. var _map = __webpack_require__( /*! ../core/utils */ 10).map;
  23387. var _extend = extend;
  23388. var calculateBezierPoints = lineSeries.chart.spline._calculateBezierPoints;
  23389. exports.chart = {};
  23390. exports.polar = {};
  23391. var baseAreaMethods = {
  23392. _createBorderElement: chartLineSeries._createMainElement,
  23393. _createLegendState: function(styleOptions, defaultColor) {
  23394. return {
  23395. fill: styleOptions.color || defaultColor,
  23396. opacity: styleOptions.opacity,
  23397. hatching: styleOptions.hatching
  23398. }
  23399. },
  23400. getValueRangeInitialValue: function() {
  23401. if ("logarithmic" !== this.valueAxisType && "datetime" !== this.valueType && false !== this.showZero) {
  23402. return 0
  23403. } else {
  23404. return scatterSeries.getValueRangeInitialValue.call(this)
  23405. }
  23406. },
  23407. _getDefaultSegment: function(segment) {
  23408. var defaultSegment = chartLineSeries._getDefaultSegment(segment);
  23409. defaultSegment.area = defaultSegment.line.concat(defaultSegment.line.slice().reverse());
  23410. return defaultSegment
  23411. },
  23412. _updateElement: function(element, segment, animate, complete) {
  23413. var lineParams = {
  23414. points: segment.line
  23415. };
  23416. var areaParams = {
  23417. points: segment.area
  23418. };
  23419. var borderElement = element.line;
  23420. if (animate) {
  23421. borderElement && borderElement.animate(lineParams);
  23422. element.area.animate(areaParams, {}, complete)
  23423. } else {
  23424. borderElement && borderElement.attr(lineParams);
  23425. element.area.attr(areaParams)
  23426. }
  23427. },
  23428. _removeElement: function(element) {
  23429. element.line && element.line.remove();
  23430. element.area.remove()
  23431. },
  23432. _drawElement: function(segment) {
  23433. return {
  23434. line: this._bordersGroup && this._createBorderElement(segment.line, {
  23435. "stroke-width": this._styles.normal.border["stroke-width"]
  23436. }).append(this._bordersGroup),
  23437. area: this._createMainElement(segment.area).append(this._elementsGroup)
  23438. }
  23439. },
  23440. _applyStyle: function(style) {
  23441. var that = this;
  23442. that._elementsGroup && that._elementsGroup.smartAttr(style.elements);
  23443. that._bordersGroup && that._bordersGroup.attr(style.border);
  23444. (that._graphics || []).forEach(function(graphic) {
  23445. graphic.line && graphic.line.attr({
  23446. "stroke-width": style.border["stroke-width"]
  23447. }).sharp()
  23448. })
  23449. },
  23450. _parseStyle: function(options, defaultColor, defaultBorderColor) {
  23451. var borderOptions = options.border || {};
  23452. var borderStyle = chartLineSeries._parseLineOptions(borderOptions, defaultBorderColor);
  23453. borderStyle.stroke = borderOptions.visible && borderStyle["stroke-width"] ? borderStyle.stroke : "none";
  23454. borderStyle["stroke-width"] = borderStyle["stroke-width"] || 1;
  23455. return {
  23456. border: borderStyle,
  23457. elements: {
  23458. stroke: "none",
  23459. fill: options.color || defaultColor,
  23460. hatching: options.hatching,
  23461. opacity: options.opacity
  23462. }
  23463. }
  23464. },
  23465. _areBordersVisible: function() {
  23466. var options = this._options;
  23467. return options.border.visible || options.hoverStyle.border.visible || options.selectionStyle.border.visible
  23468. },
  23469. _createMainElement: function(points, settings) {
  23470. return this._renderer.path(points, "area").attr(settings)
  23471. },
  23472. _getTrackerSettings: function(segment) {
  23473. return {
  23474. "stroke-width": segment.singlePointSegment ? this._defaultTrackerWidth : 0
  23475. }
  23476. },
  23477. _getMainPointsFromSegment: function(segment) {
  23478. return segment.area
  23479. }
  23480. };
  23481. function createAreaPoints(points) {
  23482. return _map(points, function(pt) {
  23483. return pt.getCoords()
  23484. }).concat(_map(points.slice().reverse(), function(pt) {
  23485. return pt.getCoords(true)
  23486. }))
  23487. }
  23488. var areaSeries = exports.chart.area = _extend({}, chartLineSeries, baseAreaMethods, {
  23489. _prepareSegment: function(points, rotated) {
  23490. var that = this;
  23491. var processedPoints = that._processSinglePointsAreaSegment(points, rotated);
  23492. var areaPoints = createAreaPoints(processedPoints);
  23493. var argAxis = that.getArgumentAxis();
  23494. if (argAxis.getAxisPosition) {
  23495. var argAxisPosition = argAxis.getAxisPosition();
  23496. var axisOptions = argAxis.getOptions();
  23497. var edgeOffset = (!rotated ? -1 : 1) * Math.round(axisOptions.width / 2);
  23498. if (axisOptions.visible) {
  23499. areaPoints.forEach(function(p, i) {
  23500. if (p) {
  23501. var index = 1 === points.length ? 0 : i < points.length ? i : areaPoints.length - 1 - i;
  23502. rotated && p.x === points[index].defaultX && p.x === argAxisPosition - argAxis.getAxisShift() && (p.x += edgeOffset);
  23503. !rotated && p.y === points[index].defaultY && p.y === argAxisPosition - argAxis.getAxisShift() && (p.y += edgeOffset)
  23504. }
  23505. })
  23506. }
  23507. }
  23508. return {
  23509. line: processedPoints,
  23510. area: areaPoints,
  23511. singlePointSegment: processedPoints !== points
  23512. }
  23513. },
  23514. _processSinglePointsAreaSegment: function(points, rotated) {
  23515. if (points && 1 === points.length) {
  23516. var p = points[0];
  23517. var p1 = objectUtils.clone(p);
  23518. p1[rotated ? "y" : "x"] += 1;
  23519. p1.argument = null;
  23520. return [p, p1]
  23521. }
  23522. return points
  23523. }
  23524. });
  23525. exports.polar.area = _extend({}, polarLineSeries, baseAreaMethods, {
  23526. _prepareSegment: function(points, rotated, lastSegment) {
  23527. lastSegment && polarLineSeries._closeSegment.call(this, points);
  23528. return areaSeries._prepareSegment.call(this, points)
  23529. },
  23530. _processSinglePointsAreaSegment: function(points) {
  23531. return lineSeries.polar.line._prepareSegment.call(this, points).line
  23532. }
  23533. });
  23534. exports.chart.steparea = _extend({}, areaSeries, {
  23535. _prepareSegment: function(points, rotated) {
  23536. var stepLineSeries = lineSeries.chart.stepline;
  23537. points = areaSeries._processSinglePointsAreaSegment(points, rotated);
  23538. return areaSeries._prepareSegment.call(this, stepLineSeries._calculateStepLinePoints.call(this, points), rotated)
  23539. },
  23540. getSeriesPairCoord: lineSeries.chart.stepline.getSeriesPairCoord
  23541. });
  23542. exports.chart.splinearea = _extend({}, areaSeries, {
  23543. _areaPointsToSplineAreaPoints: function(areaPoints) {
  23544. var previousMiddlePoint = areaPoints[areaPoints.length / 2 - 1];
  23545. var middlePoint = areaPoints[areaPoints.length / 2];
  23546. areaPoints.splice(areaPoints.length / 2, 0, {
  23547. x: previousMiddlePoint.x,
  23548. y: previousMiddlePoint.y
  23549. }, {
  23550. x: middlePoint.x,
  23551. y: middlePoint.y
  23552. });
  23553. if (previousMiddlePoint.defaultCoords) {
  23554. areaPoints[areaPoints.length / 2].defaultCoords = true
  23555. }
  23556. if (middlePoint.defaultCoords) {
  23557. areaPoints[areaPoints.length / 2 - 1].defaultCoords = true
  23558. }
  23559. },
  23560. _prepareSegment: function(points, rotated) {
  23561. var processedPoints = areaSeries._processSinglePointsAreaSegment(points, rotated);
  23562. var areaSegment = areaSeries._prepareSegment.call(this, calculateBezierPoints(processedPoints, rotated));
  23563. this._areaPointsToSplineAreaPoints(areaSegment.area);
  23564. areaSegment.singlePointSegment = processedPoints !== points;
  23565. return areaSegment
  23566. },
  23567. _getDefaultSegment: function(segment) {
  23568. var areaDefaultSegment = areaSeries._getDefaultSegment(segment);
  23569. this._areaPointsToSplineAreaPoints(areaDefaultSegment.area);
  23570. return areaDefaultSegment
  23571. },
  23572. _createMainElement: function(points, settings) {
  23573. return this._renderer.path(points, "bezierarea").attr(settings)
  23574. },
  23575. _createBorderElement: lineSeries.chart.spline._createMainElement,
  23576. getSeriesPairCoord: lineSeries.chart.spline.getSeriesPairCoord,
  23577. getNearestPointsByCoord: lineSeries.chart.spline.getNearestPointsByCoord,
  23578. obtainCubicBezierTCoef: lineSeries.chart.spline.obtainCubicBezierTCoef
  23579. })
  23580. },
  23581. /*!***************************************************!*\
  23582. !*** ./artifacts/transpiled/viz/tree_map/node.js ***!
  23583. \***************************************************/
  23584. /*! dynamic exports provided */
  23585. /*! all exports used */
  23586. function(module, exports, __webpack_require__) {
  23587. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  23588. function Node() {}
  23589. _extend(Node.prototype, {
  23590. value: 0,
  23591. isNode: function() {
  23592. return !!(this.nodes && this.level < this.ctx.maxLevel)
  23593. },
  23594. isActive: function() {
  23595. var ctx = this.ctx;
  23596. return this.level >= ctx.minLevel && this.level <= ctx.maxLevel
  23597. },
  23598. updateStyles: function() {
  23599. var that = this;
  23600. var isNode = Number(that.isNode());
  23601. that.state = that._buildState(that.ctx.settings[isNode].state, !isNode && that.color && {
  23602. fill: that.color
  23603. })
  23604. },
  23605. _buildState: function(state, extra) {
  23606. var base = _extend({}, state);
  23607. return extra ? _extend(base, extra) : base
  23608. },
  23609. updateLabelStyle: function() {
  23610. var settings = this.ctx.settings[Number(this.isNode())];
  23611. this.labelState = settings.labelState;
  23612. this.labelParams = settings.labelParams
  23613. },
  23614. _getState: function() {
  23615. return this.state
  23616. },
  23617. applyState: function() {
  23618. updateTile[Number(this.isNode())](this.tile, this._getState())
  23619. }
  23620. });
  23621. var updateTile = [updateLeaf, updateGroup];
  23622. function updateLeaf(content, attrs) {
  23623. content.smartAttr(attrs)
  23624. }
  23625. function updateGroup(content, attrs) {
  23626. content.outer.attr({
  23627. stroke: attrs.stroke,
  23628. "stroke-width": attrs["stroke-width"],
  23629. "stroke-opacity": attrs["stroke-opacity"]
  23630. });
  23631. content.inner.smartAttr({
  23632. fill: attrs.fill,
  23633. opacity: attrs.opacity,
  23634. hatching: attrs.hatching
  23635. })
  23636. }
  23637. module.exports = Node
  23638. },
  23639. /*!*****************************************************************!*\
  23640. !*** ./artifacts/transpiled/ui/widget/ui.keyboard_processor.js ***!
  23641. \*****************************************************************/
  23642. /*! dynamic exports provided */
  23643. /*! all exports used */
  23644. function(module, exports, __webpack_require__) {
  23645. var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
  23646. var _renderer2 = _interopRequireDefault(_renderer);
  23647. var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  23648. var _events_engine2 = _interopRequireDefault(_events_engine);
  23649. var _class = __webpack_require__( /*! ../../core/class */ 15);
  23650. var _class2 = _interopRequireDefault(_class);
  23651. var _array = __webpack_require__( /*! ../../core/utils/array */ 14);
  23652. var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  23653. var _utils = __webpack_require__( /*! ../../events/utils */ 8);
  23654. function _interopRequireDefault(obj) {
  23655. return obj && obj.__esModule ? obj : {
  23656. "default": obj
  23657. }
  23658. }
  23659. var COMPOSITION_START_EVENT = "compositionstart";
  23660. var COMPOSITION_END_EVENT = "compositionend";
  23661. var KEYDOWN_EVENT = "keydown";
  23662. var NAMESPACE = "KeyboardProcessor";
  23663. var KeyboardProcessor = _class2.default.inherit({
  23664. _keydown: (0, _utils.addNamespace)(KEYDOWN_EVENT, NAMESPACE),
  23665. _compositionStart: (0, _utils.addNamespace)(COMPOSITION_START_EVENT, NAMESPACE),
  23666. _compositionEnd: (0, _utils.addNamespace)(COMPOSITION_END_EVENT, NAMESPACE),
  23667. ctor: function(options) {
  23668. var _this = this;
  23669. options = options || {};
  23670. if (options.element) {
  23671. this._element = (0, _renderer2.default)(options.element)
  23672. }
  23673. if (options.focusTarget) {
  23674. this._focusTarget = options.focusTarget
  23675. }
  23676. this._handler = options.handler;
  23677. this._context = options.context;
  23678. this._childProcessors = [];
  23679. if (this._element) {
  23680. this._processFunction = function(e) {
  23681. var isNotFocusTarget = _this._focusTarget && _this._focusTarget !== e.target && (0, _array.inArray)(e.target, _this._focusTarget) < 0;
  23682. var shouldSkipProcessing = _this._isComposingJustFinished && 229 === e.which || _this._isComposing || isNotFocusTarget;
  23683. _this._isComposingJustFinished = false;
  23684. if (!shouldSkipProcessing) {
  23685. _this.process(e)
  23686. }
  23687. };
  23688. this._toggleProcessingWithContext = this.toggleProcessing.bind(this);
  23689. _events_engine2.default.on(this._element, this._keydown, this._processFunction);
  23690. _events_engine2.default.on(this._element, this._compositionStart, this._toggleProcessingWithContext);
  23691. _events_engine2.default.on(this._element, this._compositionEnd, this._toggleProcessingWithContext)
  23692. }
  23693. },
  23694. dispose: function() {
  23695. if (this._element) {
  23696. _events_engine2.default.off(this._element, this._keydown, this._processFunction);
  23697. _events_engine2.default.off(this._element, this._compositionStart, this._toggleProcessingWithContext);
  23698. _events_engine2.default.off(this._element, this._compositionEnd, this._toggleProcessingWithContext)
  23699. }
  23700. this._element = void 0;
  23701. this._handler = void 0;
  23702. this._context = void 0;
  23703. this._childProcessors = void 0
  23704. },
  23705. clearChildren: function() {
  23706. this._childProcessors = []
  23707. },
  23708. push: function(child) {
  23709. if (!this._childProcessors) {
  23710. this.clearChildren()
  23711. }
  23712. this._childProcessors.push(child);
  23713. return child
  23714. },
  23715. attachChildProcessor: function() {
  23716. var childProcessor = new KeyboardProcessor;
  23717. this._childProcessors.push(childProcessor);
  23718. return childProcessor
  23719. },
  23720. reinitialize: function(childHandler, childContext) {
  23721. this._context = childContext;
  23722. this._handler = childHandler;
  23723. return this
  23724. },
  23725. process: function(e) {
  23726. var args = {
  23727. keyName: (0, _utils.normalizeKeyName)(e),
  23728. key: e.key,
  23729. code: e.code,
  23730. ctrl: e.ctrlKey,
  23731. location: e.location,
  23732. metaKey: e.metaKey,
  23733. shift: e.shiftKey,
  23734. alt: e.altKey,
  23735. which: e.which,
  23736. originalEvent: e
  23737. };
  23738. var handlerResult = this._handler && this._handler.call(this._context, args);
  23739. if (handlerResult && this._childProcessors) {
  23740. (0, _iterator.each)(this._childProcessors, function(index, childProcessor) {
  23741. childProcessor.process(e)
  23742. })
  23743. }
  23744. },
  23745. toggleProcessing: function(_ref) {
  23746. var type = _ref.type;
  23747. this._isComposing = type === COMPOSITION_START_EVENT;
  23748. this._isComposingJustFinished = !this._isComposing
  23749. }
  23750. });
  23751. module.exports = KeyboardProcessor
  23752. },
  23753. /*!****************************************************!*\
  23754. !*** ./artifacts/transpiled/events/contextmenu.js ***!
  23755. \****************************************************/
  23756. /*! dynamic exports provided */
  23757. /*! all exports used */
  23758. function(module, exports, __webpack_require__) {
  23759. var $ = __webpack_require__( /*! ../core/renderer */ 2);
  23760. var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
  23761. var support = __webpack_require__( /*! ../core/utils/support */ 43);
  23762. var devices = __webpack_require__( /*! ../core/devices */ 16);
  23763. var Class = __webpack_require__( /*! ../core/class */ 15);
  23764. var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71);
  23765. var eventUtils = __webpack_require__( /*! ./utils */ 8);
  23766. var holdEvent = __webpack_require__( /*! ./hold */ 88);
  23767. var CONTEXTMENU_NAMESPACE = "dxContexMenu";
  23768. var CONTEXTMENU_NAMESPACED_EVENT_NAME = eventUtils.addNamespace("contextmenu", CONTEXTMENU_NAMESPACE);
  23769. var HOLD_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(holdEvent.name, CONTEXTMENU_NAMESPACE);
  23770. var CONTEXTMENU_EVENT_NAME = "dxcontextmenu";
  23771. var ContextMenu = Class.inherit({
  23772. setup: function(element) {
  23773. var $element = $(element);
  23774. eventsEngine.on($element, CONTEXTMENU_NAMESPACED_EVENT_NAME, this._contextMenuHandler.bind(this));
  23775. if (support.touch || devices.isSimulator()) {
  23776. eventsEngine.on($element, HOLD_NAMESPACED_EVENT_NAME, this._holdHandler.bind(this))
  23777. }
  23778. },
  23779. _holdHandler: function(e) {
  23780. if (eventUtils.isMouseEvent(e) && !devices.isSimulator()) {
  23781. return
  23782. }
  23783. this._fireContextMenu(e)
  23784. },
  23785. _contextMenuHandler: function(e) {
  23786. this._fireContextMenu(e)
  23787. },
  23788. _fireContextMenu: function(e) {
  23789. return eventUtils.fireEvent({
  23790. type: CONTEXTMENU_EVENT_NAME,
  23791. originalEvent: e
  23792. })
  23793. },
  23794. teardown: function(element) {
  23795. eventsEngine.off(element, "." + CONTEXTMENU_NAMESPACE)
  23796. }
  23797. });
  23798. registerEvent(CONTEXTMENU_EVENT_NAME, new ContextMenu);
  23799. exports.name = CONTEXTMENU_EVENT_NAME
  23800. }, ,
  23801. /*!******************************************!*\
  23802. !*** ./artifacts/transpiled/exporter.js ***!
  23803. \******************************************/
  23804. /*! dynamic exports provided */
  23805. /*! all exports used */
  23806. function(module, exports, __webpack_require__) {
  23807. var fileSaver = __webpack_require__( /*! ./exporter/file_saver */ 207).fileSaver;
  23808. var excelCreator = __webpack_require__( /*! ./exporter/excel_creator */ 431);
  23809. var imageCreator = __webpack_require__( /*! ./exporter/image_creator */ 262);
  23810. var svgCreator = __webpack_require__( /*! ./exporter/svg_creator */ 438);
  23811. var _isFunction = __webpack_require__( /*! ./core/utils/type */ 1).isFunction;
  23812. var Deferred = __webpack_require__( /*! ./core/utils/deferred */ 6).Deferred;
  23813. exports.export = function(data, options, getData) {
  23814. if (!data) {
  23815. return (new Deferred).resolve()
  23816. }
  23817. var exportingAction = options.exportingAction;
  23818. var exportedAction = options.exportedAction;
  23819. var fileSavingAction = options.fileSavingAction;
  23820. var eventArgs = {
  23821. fileName: options.fileName,
  23822. format: options.format,
  23823. cancel: false
  23824. };
  23825. _isFunction(exportingAction) && exportingAction(eventArgs);
  23826. if (!eventArgs.cancel) {
  23827. return getData(data, options, function(blob) {
  23828. _isFunction(exportedAction) && exportedAction();
  23829. if (_isFunction(fileSavingAction)) {
  23830. eventArgs.data = blob;
  23831. fileSavingAction(eventArgs)
  23832. }
  23833. if (!eventArgs.cancel) {
  23834. fileSaver.saveAs(eventArgs.fileName, options.format, blob, options.proxyUrl, options.forceProxy)
  23835. }
  23836. })
  23837. }
  23838. return (new Deferred).resolve()
  23839. };
  23840. exports.fileSaver = fileSaver;
  23841. exports.excel = {
  23842. creator: excelCreator.ExcelCreator,
  23843. getData: excelCreator.getData,
  23844. formatConverter: __webpack_require__( /*! ./exporter/excel_format_converter */ 178)
  23845. };
  23846. exports.excel.__internals = excelCreator.__internals;
  23847. exports.image = {
  23848. creator: imageCreator.imageCreator,
  23849. getData: imageCreator.getData,
  23850. testFormats: imageCreator.testFormats
  23851. };
  23852. exports.pdf = {
  23853. getData: __webpack_require__( /*! ./exporter/pdf_creator */ 440).getData
  23854. };
  23855. exports.svg = {
  23856. creator: svgCreator.svgCreator,
  23857. getData: svgCreator.getData
  23858. }
  23859. },
  23860. /*!*************************************************!*\
  23861. !*** ./artifacts/transpiled/core/utils/size.js ***!
  23862. \*************************************************/
  23863. /*! dynamic exports provided */
  23864. /*! all exports used */
  23865. function(module, exports, __webpack_require__) {
  23866. var window = __webpack_require__( /*! ../../core/utils/window */ 7).getWindow();
  23867. var typeUtils = __webpack_require__( /*! ../utils/type */ 1);
  23868. var SPECIAL_HEIGHT_VALUES = ["auto", "none", "inherit", "initial"];
  23869. var getSizeByStyles = function(elementStyles, styles) {
  23870. var result = 0;
  23871. styles.forEach(function(style) {
  23872. result += parseFloat(elementStyles[style]) || 0
  23873. });
  23874. return result
  23875. };
  23876. var getElementBoxParams = function(name, elementStyles) {
  23877. var beforeName = "width" === name ? "Left" : "Top";
  23878. var afterName = "width" === name ? "Right" : "Bottom";
  23879. return {
  23880. padding: getSizeByStyles(elementStyles, ["padding" + beforeName, "padding" + afterName]),
  23881. border: getSizeByStyles(elementStyles, ["border" + beforeName + "Width", "border" + afterName + "Width"]),
  23882. margin: getSizeByStyles(elementStyles, ["margin" + beforeName, "margin" + afterName])
  23883. }
  23884. };
  23885. var getBoxSizingOffset = function(name, elementStyles, boxParams) {
  23886. var size = elementStyles[name];
  23887. if ("border-box" === elementStyles.boxSizing && size.length && "%" !== size[size.length - 1]) {
  23888. return boxParams.border + boxParams.padding
  23889. }
  23890. return 0
  23891. };
  23892. var getSize = function(element, name, include) {
  23893. var elementStyles = window.getComputedStyle(element);
  23894. var boxParams = getElementBoxParams(name, elementStyles);
  23895. var clientRect = element.getClientRects().length;
  23896. var boundingClientRect = element.getBoundingClientRect()[name];
  23897. var result = clientRect ? boundingClientRect : 0;
  23898. if (result <= 0) {
  23899. result = parseFloat(elementStyles[name] || element.style[name]) || 0;
  23900. result -= getBoxSizingOffset(name, elementStyles, boxParams)
  23901. } else {
  23902. result -= boxParams.padding + boxParams.border
  23903. }
  23904. if (include.paddings) {
  23905. result += boxParams.padding
  23906. }
  23907. if (include.borders) {
  23908. result += boxParams.border
  23909. }
  23910. if (include.margins) {
  23911. result += boxParams.margin
  23912. }
  23913. return result
  23914. };
  23915. var getContainerHeight = function(container) {
  23916. return typeUtils.isWindow(container) ? container.innerHeight : container.offsetHeight
  23917. };
  23918. var parseHeight = function(value, container) {
  23919. if (value.indexOf("px") > 0) {
  23920. value = parseInt(value.replace("px", ""))
  23921. } else {
  23922. if (value.indexOf("%") > 0) {
  23923. value = parseInt(value.replace("%", "")) * getContainerHeight(container) / 100
  23924. } else {
  23925. if (!isNaN(value)) {
  23926. value = parseInt(value)
  23927. }
  23928. }
  23929. }
  23930. return value
  23931. };
  23932. var getHeightWithOffset = function(value, offset, container) {
  23933. if (!value) {
  23934. return null
  23935. }
  23936. if (SPECIAL_HEIGHT_VALUES.indexOf(value) > -1) {
  23937. return offset ? null : value
  23938. }
  23939. if (typeUtils.isString(value)) {
  23940. value = parseHeight(value, container)
  23941. }
  23942. if (typeUtils.isNumeric(value)) {
  23943. return Math.max(0, value + offset)
  23944. }
  23945. var operationString = offset < 0 ? " - " : " ";
  23946. return "calc(" + value + operationString + Math.abs(offset) + "px)"
  23947. };
  23948. var addOffsetToMaxHeight = function(value, offset, container) {
  23949. var maxHeight = getHeightWithOffset(value, offset, container);
  23950. return null !== maxHeight ? maxHeight : "none"
  23951. };
  23952. var addOffsetToMinHeight = function(value, offset, container) {
  23953. var minHeight = getHeightWithOffset(value, offset, container);
  23954. return null !== minHeight ? minHeight : 0
  23955. };
  23956. var getVerticalOffsets = function(element, withMargins) {
  23957. if (!element) {
  23958. return 0
  23959. }
  23960. var boxParams = getElementBoxParams("height", window.getComputedStyle(element));
  23961. return boxParams.padding + boxParams.border + (withMargins ? boxParams.margin : 0)
  23962. };
  23963. var getVisibleHeight = function(element) {
  23964. if (element) {
  23965. var boundingClientRect = element.getBoundingClientRect();
  23966. if (boundingClientRect.height) {
  23967. return boundingClientRect.height
  23968. }
  23969. }
  23970. return 0
  23971. };
  23972. exports.getSize = getSize;
  23973. exports.getElementBoxParams = getElementBoxParams;
  23974. exports.addOffsetToMaxHeight = addOffsetToMaxHeight;
  23975. exports.addOffsetToMinHeight = addOffsetToMinHeight;
  23976. exports.getVerticalOffsets = getVerticalOffsets;
  23977. exports.getVisibleHeight = getVisibleHeight;
  23978. exports.parseHeight = parseHeight
  23979. },
  23980. /*!****************************************************************!*\
  23981. !*** ./artifacts/transpiled/ui/validation/validation_mixin.js ***!
  23982. \****************************************************************/
  23983. /*! dynamic exports provided */
  23984. /*! all exports used */
  23985. function(module, exports, __webpack_require__) {
  23986. var ValidationMixin = {
  23987. _findGroup: function() {
  23988. var group = this.option("validationGroup");
  23989. var $dxGroup;
  23990. if (!group) {
  23991. $dxGroup = this.$element().parents(".dx-validationgroup").first();
  23992. if ($dxGroup.length) {
  23993. group = $dxGroup.dxValidationGroup("instance")
  23994. } else {
  23995. group = this._modelByElement(this.$element())
  23996. }
  23997. }
  23998. return group
  23999. }
  24000. };
  24001. module.exports = ValidationMixin
  24002. },
  24003. /*!**********************************************!*\
  24004. !*** ./artifacts/transpiled/ui/resizable.js ***!
  24005. \**********************************************/
  24006. /*! dynamic exports provided */
  24007. /*! all exports used */
  24008. function(module, exports, __webpack_require__) {
  24009. var $ = __webpack_require__( /*! ../core/renderer */ 2);
  24010. var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
  24011. var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
  24012. var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4);
  24013. var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
  24014. var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
  24015. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  24016. var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
  24017. var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
  24018. var translator = __webpack_require__( /*! ../animation/translator */ 27);
  24019. var fitIntoRange = __webpack_require__( /*! ../core/utils/math */ 28).fitIntoRange;
  24020. var DOMComponent = __webpack_require__( /*! ../core/dom_component */ 67);
  24021. var eventUtils = __webpack_require__( /*! ../events/utils */ 8);
  24022. var dragEvents = __webpack_require__( /*! ../events/drag */ 56);
  24023. var isPlainObject = typeUtils.isPlainObject;
  24024. var isFunction = typeUtils.isFunction;
  24025. var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12);
  24026. var RESIZABLE = "dxResizable";
  24027. var RESIZABLE_CLASS = "dx-resizable";
  24028. var RESIZABLE_RESIZING_CLASS = "dx-resizable-resizing";
  24029. var RESIZABLE_HANDLE_CLASS = "dx-resizable-handle";
  24030. var RESIZABLE_HANDLE_TOP_CLASS = "dx-resizable-handle-top";
  24031. var RESIZABLE_HANDLE_BOTTOM_CLASS = "dx-resizable-handle-bottom";
  24032. var RESIZABLE_HANDLE_LEFT_CLASS = "dx-resizable-handle-left";
  24033. var RESIZABLE_HANDLE_RIGHT_CLASS = "dx-resizable-handle-right";
  24034. var RESIZABLE_HANDLE_CORNER_CLASS = "dx-resizable-handle-corner";
  24035. var DRAGSTART_START_EVENT_NAME = eventUtils.addNamespace(dragEvents.start, RESIZABLE);
  24036. var DRAGSTART_EVENT_NAME = eventUtils.addNamespace(dragEvents.move, RESIZABLE);
  24037. var DRAGSTART_END_EVENT_NAME = eventUtils.addNamespace(dragEvents.end, RESIZABLE);
  24038. var SIDE_BORDER_WIDTH_STYLES = {
  24039. left: "borderLeftWidth",
  24040. top: "borderTopWidth",
  24041. right: "borderRightWidth",
  24042. bottom: "borderBottomWidth"
  24043. };
  24044. var Resizable = DOMComponent.inherit({
  24045. _getDefaultOptions: function() {
  24046. return extend(this.callBase(), {
  24047. handles: "all",
  24048. step: "1",
  24049. stepPrecision: "simple",
  24050. area: void 0,
  24051. minWidth: 30,
  24052. maxWidth: 1 / 0,
  24053. minHeight: 30,
  24054. maxHeight: 1 / 0,
  24055. onResizeStart: null,
  24056. onResize: null,
  24057. onResizeEnd: null,
  24058. roundStepValue: true
  24059. })
  24060. },
  24061. _init: function() {
  24062. this.callBase();
  24063. this.$element().addClass(RESIZABLE_CLASS)
  24064. },
  24065. _initMarkup: function() {
  24066. this.callBase();
  24067. this._renderHandles()
  24068. },
  24069. _render: function() {
  24070. this.callBase();
  24071. this._renderActions()
  24072. },
  24073. _renderActions: function() {
  24074. this._resizeStartAction = this._createActionByOption("onResizeStart");
  24075. this._resizeEndAction = this._createActionByOption("onResizeEnd");
  24076. this._resizeAction = this._createActionByOption("onResize")
  24077. },
  24078. _renderHandles: function() {
  24079. var handles = this.option("handles");
  24080. if ("none" === handles) {
  24081. return
  24082. }
  24083. var directions = "all" === handles ? ["top", "bottom", "left", "right"] : handles.split(" ");
  24084. each(directions, function(index, handleName) {
  24085. this._renderHandle(handleName)
  24086. }.bind(this));
  24087. inArray("bottom", directions) + 1 && inArray("right", directions) + 1 && this._renderHandle("corner-bottom-right");
  24088. inArray("bottom", directions) + 1 && inArray("left", directions) + 1 && this._renderHandle("corner-bottom-left");
  24089. inArray("top", directions) + 1 && inArray("right", directions) + 1 && this._renderHandle("corner-top-right");
  24090. inArray("top", directions) + 1 && inArray("left", directions) + 1 && this._renderHandle("corner-top-left")
  24091. },
  24092. _renderHandle: function(handleName) {
  24093. var $element = this.$element();
  24094. var $handle = $("<div>");
  24095. $handle.addClass(RESIZABLE_HANDLE_CLASS).addClass(RESIZABLE_HANDLE_CLASS + "-" + handleName).appendTo($element);
  24096. this._attachEventHandlers($handle)
  24097. },
  24098. _attachEventHandlers: function($handle) {
  24099. if (this.option("disabled")) {
  24100. return
  24101. }
  24102. var handlers = {};
  24103. handlers[DRAGSTART_START_EVENT_NAME] = this._dragStartHandler.bind(this);
  24104. handlers[DRAGSTART_EVENT_NAME] = this._dragHandler.bind(this);
  24105. handlers[DRAGSTART_END_EVENT_NAME] = this._dragEndHandler.bind(this);
  24106. eventsEngine.on($handle, handlers, {
  24107. direction: "both",
  24108. immediate: true
  24109. })
  24110. },
  24111. _dragStartHandler: function(e) {
  24112. var $element = this.$element();
  24113. if ($element.is(".dx-state-disabled, .dx-state-disabled *")) {
  24114. e.cancel = true;
  24115. return
  24116. }
  24117. this._toggleResizingClass(true);
  24118. this._movingSides = this._getMovingSides(e);
  24119. this._elementLocation = translator.locate($element);
  24120. var elementRect = $element.get(0).getBoundingClientRect();
  24121. this._elementSize = {
  24122. width: elementRect.width,
  24123. height: elementRect.height
  24124. };
  24125. this._renderDragOffsets(e);
  24126. this._resizeStartAction({
  24127. event: e,
  24128. width: this._elementSize.width,
  24129. height: this._elementSize.height,
  24130. handles: this._movingSides
  24131. });
  24132. e.targetElements = null
  24133. },
  24134. _toggleResizingClass: function(value) {
  24135. this.$element().toggleClass(RESIZABLE_RESIZING_CLASS, value)
  24136. },
  24137. _renderDragOffsets: function(e) {
  24138. var area = this._getArea();
  24139. if (!area) {
  24140. return
  24141. }
  24142. var $handle = $(e.target).closest("." + RESIZABLE_HANDLE_CLASS);
  24143. var handleWidth = $handle.outerWidth();
  24144. var handleHeight = $handle.outerHeight();
  24145. var handleOffset = $handle.offset();
  24146. var areaOffset = area.offset;
  24147. var scrollOffset = this._getAreaScrollOffset();
  24148. e.maxLeftOffset = handleOffset.left - areaOffset.left - scrollOffset.scrollX;
  24149. e.maxRightOffset = areaOffset.left + area.width - handleOffset.left - handleWidth + scrollOffset.scrollX;
  24150. e.maxTopOffset = handleOffset.top - areaOffset.top - scrollOffset.scrollY;
  24151. e.maxBottomOffset = areaOffset.top + area.height - handleOffset.top - handleHeight + scrollOffset.scrollY
  24152. },
  24153. _getBorderWidth: function($element, direction) {
  24154. if (typeUtils.isWindow($element.get(0))) {
  24155. return 0
  24156. }
  24157. var borderWidth = $element.css(SIDE_BORDER_WIDTH_STYLES[direction]);
  24158. return parseInt(borderWidth) || 0
  24159. },
  24160. _dragHandler: function(e) {
  24161. var $element = this.$element();
  24162. var sides = this._movingSides;
  24163. var location = this._elementLocation;
  24164. var size = this._elementSize;
  24165. var offset = this._getOffset(e);
  24166. var width = size.width + offset.x * (sides.left ? -1 : 1);
  24167. var height = size.height + offset.y * (sides.top ? -1 : 1);
  24168. if (offset.x || "strict" === this.option("stepPrecision")) {
  24169. this._renderWidth(width)
  24170. }
  24171. if (offset.y || "strict" === this.option("stepPrecision")) {
  24172. this._renderHeight(height)
  24173. }
  24174. var elementRect = $element.get(0).getBoundingClientRect();
  24175. var offsetTop = offset.y - ((elementRect.height || height) - height);
  24176. var offsetLeft = offset.x - ((elementRect.width || width) - width);
  24177. translator.move($element, {
  24178. top: location.top + (sides.top ? offsetTop : 0),
  24179. left: location.left + (sides.left ? offsetLeft : 0)
  24180. });
  24181. this._resizeAction({
  24182. event: e,
  24183. width: this.option("width") || width,
  24184. height: this.option("height") || height,
  24185. handles: this._movingSides
  24186. });
  24187. domUtils.triggerResizeEvent($element)
  24188. },
  24189. _getOffset: function(e) {
  24190. var offset = e.offset;
  24191. var steps = commonUtils.pairToObject(this.option("step"), !this.option("roundStepValue"));
  24192. var sides = this._getMovingSides(e);
  24193. var strictPrecision = "strict" === this.option("stepPrecision");
  24194. if (!sides.left && !sides.right) {
  24195. offset.x = 0
  24196. }
  24197. if (!sides.top && !sides.bottom) {
  24198. offset.y = 0
  24199. }
  24200. return strictPrecision ? this._getStrictOffset(offset, steps, sides) : this._getSimpleOffset(offset, steps)
  24201. },
  24202. _getSimpleOffset: function(offset, steps) {
  24203. return {
  24204. x: offset.x - offset.x % steps.h,
  24205. y: offset.y - offset.y % steps.v
  24206. }
  24207. },
  24208. _getStrictOffset: function(offset, steps, sides) {
  24209. var location = this._elementLocation;
  24210. var size = this._elementSize;
  24211. var xPos = sides.left ? location.left : location.left + size.width;
  24212. var yPos = sides.top ? location.top : location.top + size.height;
  24213. var newXShift = (xPos + offset.x) % steps.h;
  24214. var newYShift = (yPos + offset.y) % steps.v;
  24215. var sign = Math.sign || function(x) {
  24216. x = +x;
  24217. if (0 === x || isNaN(x)) {
  24218. return x
  24219. }
  24220. return x > 0 ? 1 : -1
  24221. };
  24222. var separatorOffset = function(steps, offset) {
  24223. return (1 + .2 * sign(offset)) % 1 * steps
  24224. };
  24225. var isSmallOffset = function(offset, steps) {
  24226. return Math.abs(offset) < .2 * steps
  24227. };
  24228. var newOffsetX = offset.x - newXShift;
  24229. var newOffsetY = offset.y - newYShift;
  24230. if (newXShift > separatorOffset(steps.h, offset.x)) {
  24231. newOffsetX += steps.h
  24232. }
  24233. if (newYShift > separatorOffset(steps.v, offset.y)) {
  24234. newOffsetY += steps.v
  24235. }
  24236. return {
  24237. x: (sides.left || sides.right) && !isSmallOffset(offset.x, steps.h) ? newOffsetX : 0,
  24238. y: (sides.top || sides.bottom) && !isSmallOffset(offset.y, steps.v) ? newOffsetY : 0
  24239. }
  24240. },
  24241. _getMovingSides: function(e) {
  24242. var $target = $(e.target);
  24243. var hasCornerTopLeftClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-top-left");
  24244. var hasCornerTopRightClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-top-right");
  24245. var hasCornerBottomLeftClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-bottom-left");
  24246. var hasCornerBottomRightClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-bottom-right");
  24247. return {
  24248. top: $target.hasClass(RESIZABLE_HANDLE_TOP_CLASS) || hasCornerTopLeftClass || hasCornerTopRightClass,
  24249. left: $target.hasClass(RESIZABLE_HANDLE_LEFT_CLASS) || hasCornerTopLeftClass || hasCornerBottomLeftClass,
  24250. bottom: $target.hasClass(RESIZABLE_HANDLE_BOTTOM_CLASS) || hasCornerBottomLeftClass || hasCornerBottomRightClass,
  24251. right: $target.hasClass(RESIZABLE_HANDLE_RIGHT_CLASS) || hasCornerTopRightClass || hasCornerBottomRightClass
  24252. }
  24253. },
  24254. _getArea: function() {
  24255. var area = this.option("area");
  24256. if (isFunction(area)) {
  24257. area = area.call(this)
  24258. }
  24259. if (isPlainObject(area)) {
  24260. return this._getAreaFromObject(area)
  24261. }
  24262. return this._getAreaFromElement(area)
  24263. },
  24264. _getAreaScrollOffset: function() {
  24265. var area = this.option("area");
  24266. var isElement = !isFunction(area) && !isPlainObject(area);
  24267. var scrollOffset = {
  24268. scrollY: 0,
  24269. scrollX: 0
  24270. };
  24271. if (isElement) {
  24272. var areaElement = $(area)[0];
  24273. if (typeUtils.isWindow(areaElement)) {
  24274. scrollOffset.scrollX = areaElement.pageXOffset;
  24275. scrollOffset.scrollY = areaElement.pageYOffset
  24276. }
  24277. }
  24278. return scrollOffset
  24279. },
  24280. _getAreaFromObject: function(area) {
  24281. var result = {
  24282. width: area.right - area.left,
  24283. height: area.bottom - area.top,
  24284. offset: {
  24285. left: area.left,
  24286. top: area.top
  24287. }
  24288. };
  24289. this._correctAreaGeometry(result);
  24290. return result
  24291. },
  24292. _getAreaFromElement: function(area) {
  24293. var $area = $(area);
  24294. var result;
  24295. if ($area.length) {
  24296. result = {
  24297. width: $area.innerWidth(),
  24298. height: $area.innerHeight(),
  24299. offset: extend({
  24300. top: 0,
  24301. left: 0
  24302. }, typeUtils.isWindow($area[0]) ? {} : $area.offset())
  24303. };
  24304. this._correctAreaGeometry(result, $area)
  24305. }
  24306. return result
  24307. },
  24308. _correctAreaGeometry: function(result, $area) {
  24309. var areaBorderLeft = $area ? this._getBorderWidth($area, "left") : 0;
  24310. var areaBorderTop = $area ? this._getBorderWidth($area, "top") : 0;
  24311. result.offset.left += areaBorderLeft + this._getBorderWidth(this.$element(), "left");
  24312. result.offset.top += areaBorderTop + this._getBorderWidth(this.$element(), "top");
  24313. result.width -= this.$element().outerWidth() - this.$element().innerWidth();
  24314. result.height -= this.$element().outerHeight() - this.$element().innerHeight()
  24315. },
  24316. _dragEndHandler: function(e) {
  24317. var $element = this.$element();
  24318. this._resizeEndAction({
  24319. event: e,
  24320. width: $element.outerWidth(),
  24321. height: $element.outerHeight(),
  24322. handles: this._movingSides
  24323. });
  24324. this._toggleResizingClass(false)
  24325. },
  24326. _renderWidth: function(width) {
  24327. this.option("width", fitIntoRange(width, this.option("minWidth"), this.option("maxWidth")))
  24328. },
  24329. _renderHeight: function(height) {
  24330. this.option("height", fitIntoRange(height, this.option("minHeight"), this.option("maxHeight")))
  24331. },
  24332. _optionChanged: function(args) {
  24333. switch (args.name) {
  24334. case "disabled":
  24335. case "handles":
  24336. this._invalidate();
  24337. break;
  24338. case "minWidth":
  24339. case "maxWidth":
  24340. windowUtils.hasWindow() && this._renderWidth(this.$element().outerWidth());
  24341. break;
  24342. case "minHeight":
  24343. case "maxHeight":
  24344. windowUtils.hasWindow() && this._renderHeight(this.$element().outerHeight());
  24345. break;
  24346. case "onResize":
  24347. case "onResizeStart":
  24348. case "onResizeEnd":
  24349. this._renderActions();
  24350. break;
  24351. case "area":
  24352. case "stepPrecision":
  24353. case "step":
  24354. case "roundStepValue":
  24355. break;
  24356. default:
  24357. this.callBase(args)
  24358. }
  24359. },
  24360. _clean: function() {
  24361. this.$element().find("." + RESIZABLE_HANDLE_CLASS).remove()
  24362. }
  24363. });
  24364. registerComponent(RESIZABLE, Resizable);
  24365. module.exports = Resizable
  24366. },
  24367. /*!**********************************************!*\
  24368. !*** ./artifacts/transpiled/events/swipe.js ***!
  24369. \**********************************************/
  24370. /*! dynamic exports provided */
  24371. /*! all exports used */
  24372. function(module, exports, __webpack_require__) {
  24373. var eventUtils = __webpack_require__( /*! ./utils */ 8);
  24374. var GestureEmitter = __webpack_require__( /*! ./gesture/emitter.gesture */ 158);
  24375. var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95);
  24376. var SWIPE_START_EVENT = "dxswipestart";
  24377. var SWIPE_EVENT = "dxswipe";
  24378. var SWIPE_END_EVENT = "dxswipeend";
  24379. var HorizontalStrategy = {
  24380. defaultItemSizeFunc: function() {
  24381. return this.getElement().width()
  24382. },
  24383. getBounds: function() {
  24384. return [this._maxLeftOffset, this._maxRightOffset]
  24385. },
  24386. calcOffsetRatio: function(e) {
  24387. var endEventData = eventUtils.eventData(e);
  24388. return (endEventData.x - (this._savedEventData && this._savedEventData.x || 0)) / this._itemSizeFunc().call(this, e)
  24389. },
  24390. isFastSwipe: function(e) {
  24391. var endEventData = eventUtils.eventData(e);
  24392. return this.FAST_SWIPE_SPEED_LIMIT * Math.abs(endEventData.x - this._tickData.x) >= endEventData.time - this._tickData.time
  24393. }
  24394. };
  24395. var VerticalStrategy = {
  24396. defaultItemSizeFunc: function() {
  24397. return this.getElement().height()
  24398. },
  24399. getBounds: function() {
  24400. return [this._maxTopOffset, this._maxBottomOffset]
  24401. },
  24402. calcOffsetRatio: function(e) {
  24403. var endEventData = eventUtils.eventData(e);
  24404. return (endEventData.y - (this._savedEventData && this._savedEventData.y || 0)) / this._itemSizeFunc().call(this, e)
  24405. },
  24406. isFastSwipe: function(e) {
  24407. var endEventData = eventUtils.eventData(e);
  24408. return this.FAST_SWIPE_SPEED_LIMIT * Math.abs(endEventData.y - this._tickData.y) >= endEventData.time - this._tickData.time
  24409. }
  24410. };
  24411. var STRATEGIES = {
  24412. horizontal: HorizontalStrategy,
  24413. vertical: VerticalStrategy
  24414. };
  24415. var SwipeEmitter = GestureEmitter.inherit({
  24416. TICK_INTERVAL: 300,
  24417. FAST_SWIPE_SPEED_LIMIT: 10,
  24418. ctor: function(element) {
  24419. this.callBase(element);
  24420. this.direction = "horizontal";
  24421. this.elastic = true
  24422. },
  24423. _getStrategy: function() {
  24424. return STRATEGIES[this.direction]
  24425. },
  24426. _defaultItemSizeFunc: function() {
  24427. return this._getStrategy().defaultItemSizeFunc.call(this)
  24428. },
  24429. _itemSizeFunc: function() {
  24430. return this.itemSizeFunc || this._defaultItemSizeFunc
  24431. },
  24432. _init: function(e) {
  24433. this._tickData = eventUtils.eventData(e)
  24434. },
  24435. _start: function(e) {
  24436. this._savedEventData = eventUtils.eventData(e);
  24437. e = this._fireEvent(SWIPE_START_EVENT, e);
  24438. if (!e.cancel) {
  24439. this._maxLeftOffset = e.maxLeftOffset;
  24440. this._maxRightOffset = e.maxRightOffset;
  24441. this._maxTopOffset = e.maxTopOffset;
  24442. this._maxBottomOffset = e.maxBottomOffset
  24443. }
  24444. },
  24445. _move: function(e) {
  24446. var strategy = this._getStrategy();
  24447. var moveEventData = eventUtils.eventData(e);
  24448. var offset = strategy.calcOffsetRatio.call(this, e);
  24449. offset = this._fitOffset(offset, this.elastic);
  24450. if (moveEventData.time - this._tickData.time > this.TICK_INTERVAL) {
  24451. this._tickData = moveEventData
  24452. }
  24453. this._fireEvent(SWIPE_EVENT, e, {
  24454. offset: offset
  24455. });
  24456. e.preventDefault()
  24457. },
  24458. _end: function(e) {
  24459. var strategy = this._getStrategy();
  24460. var offsetRatio = strategy.calcOffsetRatio.call(this, e);
  24461. var isFast = strategy.isFastSwipe.call(this, e);
  24462. var startOffset = offsetRatio;
  24463. var targetOffset = this._calcTargetOffset(offsetRatio, isFast);
  24464. startOffset = this._fitOffset(startOffset, this.elastic);
  24465. targetOffset = this._fitOffset(targetOffset, false);
  24466. this._fireEvent(SWIPE_END_EVENT, e, {
  24467. offset: startOffset,
  24468. targetOffset: targetOffset
  24469. })
  24470. },
  24471. _fitOffset: function(offset, elastic) {
  24472. var strategy = this._getStrategy();
  24473. var bounds = strategy.getBounds.call(this);
  24474. if (offset < -bounds[0]) {
  24475. return elastic ? (-2 * bounds[0] + offset) / 3 : -bounds[0]
  24476. }
  24477. if (offset > bounds[1]) {
  24478. return elastic ? (2 * bounds[1] + offset) / 3 : bounds[1]
  24479. }
  24480. return offset
  24481. },
  24482. _calcTargetOffset: function(offsetRatio, isFast) {
  24483. var result;
  24484. if (isFast) {
  24485. result = Math.ceil(Math.abs(offsetRatio));
  24486. if (offsetRatio < 0) {
  24487. result = -result
  24488. }
  24489. } else {
  24490. result = Math.round(offsetRatio)
  24491. }
  24492. return result
  24493. }
  24494. });
  24495. registerEmitter({
  24496. emitter: SwipeEmitter,
  24497. events: [SWIPE_START_EVENT, SWIPE_EVENT, SWIPE_END_EVENT]
  24498. });
  24499. exports.swipe = SWIPE_EVENT;
  24500. exports.start = SWIPE_START_EVENT;
  24501. exports.end = SWIPE_END_EVENT
  24502. },
  24503. /*!*************************************************************!*\
  24504. !*** ./artifacts/transpiled/viz/core/renderers/renderer.js ***!
  24505. \*************************************************************/
  24506. /*! dynamic exports provided */
  24507. /*! all exports used */
  24508. function(module, exports, __webpack_require__) {
  24509. var _renderer = __webpack_require__( /*! ../../../core/renderer */ 2);
  24510. var _renderer2 = _interopRequireDefault(_renderer);
  24511. var _dom_adapter = __webpack_require__( /*! ../../../core/dom_adapter */ 11);
  24512. var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
  24513. var _window = __webpack_require__( /*! ../../../core/utils/window */ 7);
  24514. var _window2 = _interopRequireDefault(_window);
  24515. var _call_once = __webpack_require__( /*! ../../../core/utils/call_once */ 63);
  24516. var _call_once2 = _interopRequireDefault(_call_once);
  24517. var _events_engine = __webpack_require__( /*! ../../../events/core/events_engine */ 5);
  24518. var _events_engine2 = _interopRequireDefault(_events_engine);
  24519. var _browser = __webpack_require__( /*! ../../../core/utils/browser */ 25);
  24520. var _browser2 = _interopRequireDefault(_browser);
  24521. var _svg = __webpack_require__( /*! ../../../core/utils/svg */ 209);
  24522. var _animation = __webpack_require__( /*! ./animation */ 765);
  24523. var _animation2 = _interopRequireDefault(_animation);
  24524. var _utils = __webpack_require__( /*! ../utils */ 10);
  24525. var _type = __webpack_require__( /*! ../../../core/utils/type */ 1);
  24526. function _interopRequireDefault(obj) {
  24527. return obj && obj.__esModule ? obj : {
  24528. "default": obj
  24529. }
  24530. }
  24531. function _slicedToArray(arr, i) {
  24532. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest()
  24533. }
  24534. function _nonIterableRest() {
  24535. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  24536. }
  24537. function _unsupportedIterableToArray(o, minLen) {
  24538. if (!o) {
  24539. return
  24540. }
  24541. if ("string" === typeof o) {
  24542. return _arrayLikeToArray(o, minLen)
  24543. }
  24544. var n = Object.prototype.toString.call(o).slice(8, -1);
  24545. if ("Object" === n && o.constructor) {
  24546. n = o.constructor.name
  24547. }
  24548. if ("Map" === n || "Set" === n) {
  24549. return Array.from(o)
  24550. }
  24551. if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
  24552. return _arrayLikeToArray(o, minLen)
  24553. }
  24554. }
  24555. function _arrayLikeToArray(arr, len) {
  24556. if (null == len || len > arr.length) {
  24557. len = arr.length
  24558. }
  24559. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  24560. arr2[i] = arr[i]
  24561. }
  24562. return arr2
  24563. }
  24564. function _iterableToArrayLimit(arr, i) {
  24565. var _i = null == arr ? null : "undefined" !== typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  24566. if (null == _i) {
  24567. return
  24568. }
  24569. var _arr = [];
  24570. var _n = true;
  24571. var _d = false;
  24572. var _s, _e;
  24573. try {
  24574. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  24575. _arr.push(_s.value);
  24576. if (i && _arr.length === i) {
  24577. break
  24578. }
  24579. }
  24580. } catch (err) {
  24581. _d = true;
  24582. _e = err
  24583. } finally {
  24584. try {
  24585. if (!_n && null != _i.return) {
  24586. _i.return()
  24587. }
  24588. } finally {
  24589. if (_d) {
  24590. throw _e
  24591. }
  24592. }
  24593. }
  24594. return _arr
  24595. }
  24596. function _arrayWithHoles(arr) {
  24597. if (Array.isArray(arr)) {
  24598. return arr
  24599. }
  24600. }
  24601. var window = _window2.default.getWindow();
  24602. var max = Math.max,
  24603. min = Math.min,
  24604. floor = Math.floor,
  24605. round = Math.round,
  24606. sin = Math.sin,
  24607. cos = Math.cos,
  24608. abs = Math.abs,
  24609. PI = Math.PI;
  24610. var PI_DIV_180 = PI / 180;
  24611. var SHARPING_CORRECTION = .5;
  24612. var ARC_COORD_PREC = 5;
  24613. var pxAddingExceptions = {
  24614. "column-count": true,
  24615. "fill-opacity": true,
  24616. "flex-grow": true,
  24617. "flex-shrink": true,
  24618. "font-weight": true,
  24619. "line-height": true,
  24620. opacity: true,
  24621. order: true,
  24622. orphans: true,
  24623. widows: true,
  24624. "z-index": true,
  24625. zoom: true
  24626. };
  24627. var KEY_TEXT = "text";
  24628. var KEY_STROKE = "stroke";
  24629. var KEY_STROKE_WIDTH = "stroke-width";
  24630. var KEY_STROKE_OPACITY = "stroke-opacity";
  24631. var KEY_FONT_SIZE = "font-size";
  24632. var KEY_FONT_STYLE = "font-style";
  24633. var KEY_FONT_WEIGHT = "font-weight";
  24634. var KEY_TEXT_DECORATION = "text-decoration";
  24635. var NONE = "none";
  24636. var DEFAULT_FONT_SIZE = 12;
  24637. var ELLIPSIS = "...";
  24638. var objectCreate = function() {
  24639. if (!Object.create) {
  24640. return function(proto) {
  24641. var F = function() {};
  24642. F.prototype = proto;
  24643. return new F
  24644. }
  24645. } else {
  24646. return function(proto) {
  24647. return Object.create(proto)
  24648. }
  24649. }
  24650. }();
  24651. var DEFAULTS = {
  24652. scaleX: 1,
  24653. scaleY: 1,
  24654. "pointer-events": null
  24655. };
  24656. var getBackup = (0, _call_once2.default)(function() {
  24657. var backupContainer = _dom_adapter2.default.createElement("div");
  24658. var backupCounter = 0;
  24659. backupContainer.style.left = "-9999px";
  24660. backupContainer.style.position = "absolute";
  24661. return {
  24662. backupContainer: backupContainer,
  24663. backupCounter: backupCounter
  24664. }
  24665. });
  24666. function backupRoot(root) {
  24667. if (0 === getBackup().backupCounter) {
  24668. _dom_adapter2.default.getBody().appendChild(getBackup().backupContainer)
  24669. }++getBackup().backupCounter;
  24670. root.append({
  24671. element: getBackup().backupContainer
  24672. })
  24673. }
  24674. function restoreRoot(root, container) {
  24675. root.append({
  24676. element: container
  24677. });
  24678. --getBackup().backupCounter;
  24679. if (0 === getBackup().backupCounter) {
  24680. _dom_adapter2.default.getBody().removeChild(getBackup().backupContainer)
  24681. }
  24682. }
  24683. var getNextDefsSvgId = function() {
  24684. var numDefsSvgElements = 1;
  24685. return function() {
  24686. return "DevExpress_" + numDefsSvgElements++
  24687. }
  24688. }();
  24689. function isObjectArgument(value) {
  24690. return value && "string" !== typeof value
  24691. }
  24692. function createElement(tagName) {
  24693. return _dom_adapter2.default.createElementNS("http://www.w3.org/2000/svg", tagName)
  24694. }
  24695. function getFuncIri(id, pathModified) {
  24696. return null !== id ? "url(" + (pathModified ? window.location.href.split("#")[0] : "") + "#" + id + ")" : id
  24697. }
  24698. function extend(target, source) {
  24699. var key;
  24700. for (key in source) {
  24701. target[key] = source[key]
  24702. }
  24703. return target
  24704. }
  24705. function roundValue(value, exp) {
  24706. value = value.toString().split("e");
  24707. value = round(+(value[0] + "e" + (value[1] ? +value[1] + exp : exp)));
  24708. value = value.toString().split("e");
  24709. return +(value[0] + "e" + (value[1] ? +value[1] - exp : -exp))
  24710. }
  24711. function getBoundingClientRect(element) {
  24712. var box;
  24713. try {
  24714. box = element.getBoundingClientRect()
  24715. } catch (e) {}
  24716. return box || {
  24717. left: 0,
  24718. top: 0
  24719. }
  24720. }
  24721. var preserveAspectRatioMap = {
  24722. full: NONE,
  24723. lefttop: "xMinYMin",
  24724. leftcenter: "xMinYMid",
  24725. leftbottom: "xMinYMax",
  24726. centertop: "xMidYMin",
  24727. center: "xMidYMid",
  24728. centerbottom: "xMidYMax",
  24729. righttop: "xMaxYMin",
  24730. rightcenter: "xMaxYMid",
  24731. rightbottom: "xMaxYMax"
  24732. };
  24733. function normalizeArcParams(x, y, innerR, outerR, startAngle, endAngle) {
  24734. var isCircle;
  24735. var noArc = true;
  24736. var angleDiff = roundValue(endAngle, 3) - roundValue(startAngle, 3);
  24737. if (angleDiff) {
  24738. if (abs(angleDiff) % 360 === 0) {
  24739. startAngle = 0;
  24740. endAngle = 360;
  24741. isCircle = true;
  24742. endAngle -= .01
  24743. }
  24744. if (startAngle > 360) {
  24745. startAngle %= 360
  24746. }
  24747. if (endAngle > 360) {
  24748. endAngle %= 360
  24749. }
  24750. if (startAngle > endAngle) {
  24751. startAngle -= 360
  24752. }
  24753. noArc = false
  24754. }
  24755. startAngle *= PI_DIV_180;
  24756. endAngle *= PI_DIV_180;
  24757. return [x, y, min(outerR, innerR), max(outerR, innerR), cos(startAngle), sin(startAngle), cos(endAngle), sin(endAngle), isCircle, floor(abs(endAngle - startAngle) / PI) % 2 ? "1" : "0", noArc]
  24758. }
  24759. var buildArcPath = function(x, y, innerR, outerR, startAngleCos, startAngleSin, endAngleCos, endAngleSin, isCircle, longFlag) {
  24760. return ["M", (x + outerR * startAngleCos).toFixed(ARC_COORD_PREC), (y - outerR * startAngleSin).toFixed(ARC_COORD_PREC), "A", outerR.toFixed(ARC_COORD_PREC), outerR.toFixed(ARC_COORD_PREC), 0, longFlag, 0, (x + outerR * endAngleCos).toFixed(ARC_COORD_PREC), (y - outerR * endAngleSin).toFixed(ARC_COORD_PREC), isCircle ? "M" : "L", (x + innerR * endAngleCos).toFixed(5), (y - innerR * endAngleSin).toFixed(ARC_COORD_PREC), "A", innerR.toFixed(ARC_COORD_PREC), innerR.toFixed(ARC_COORD_PREC), 0, longFlag, 1, (x + innerR * startAngleCos).toFixed(ARC_COORD_PREC), (y - innerR * startAngleSin).toFixed(ARC_COORD_PREC), "Z"].join(" ")
  24761. };
  24762. function buildPathSegments(points, type) {
  24763. var list = [
  24764. ["M", 0, 0]
  24765. ];
  24766. switch (type) {
  24767. case "line":
  24768. list = buildLineSegments(points);
  24769. break;
  24770. case "area":
  24771. list = buildLineSegments(points, true);
  24772. break;
  24773. case "bezier":
  24774. list = buildCurveSegments(points);
  24775. break;
  24776. case "bezierarea":
  24777. list = buildCurveSegments(points, true)
  24778. }
  24779. return list
  24780. }
  24781. function buildLineSegments(points, close) {
  24782. return buildSegments(points, buildSimpleLineSegment, close)
  24783. }
  24784. function buildCurveSegments(points, close) {
  24785. return buildSegments(points, buildSimpleCurveSegment, close)
  24786. }
  24787. function buildSegments(points, buildSimpleSegment, close) {
  24788. var i;
  24789. var ii;
  24790. var list = [];
  24791. if (points[0] && points[0].length) {
  24792. for (i = 0, ii = points.length; i < ii; ++i) {
  24793. buildSimpleSegment(points[i], close, list)
  24794. }
  24795. } else {
  24796. buildSimpleSegment(points, close, list)
  24797. }
  24798. return list
  24799. }
  24800. function buildSimpleLineSegment(points, close, list) {
  24801. var i = 0;
  24802. var k0 = list.length;
  24803. var k = k0;
  24804. var ii = (points || []).length;
  24805. if (ii) {
  24806. if (void 0 !== points[0].x) {
  24807. for (; i < ii;) {
  24808. list[k++] = ["L", points[i].x, points[i++].y]
  24809. }
  24810. } else {
  24811. for (; i < ii;) {
  24812. list[k++] = ["L", points[i++], points[i++]]
  24813. }
  24814. }
  24815. list[k0][0] = "M"
  24816. } else {
  24817. list[k] = ["M", 0, 0]
  24818. }
  24819. close && list.push(["Z"]);
  24820. return list
  24821. }
  24822. function buildSimpleCurveSegment(points, close, list) {
  24823. var i;
  24824. var k = list.length;
  24825. var ii = (points || []).length;
  24826. if (ii) {
  24827. if (void 0 !== points[0].x) {
  24828. list[k++] = ["M", points[0].x, points[0].y];
  24829. for (i = 1; i < ii;) {
  24830. list[k++] = ["C", points[i].x, points[i++].y, points[i].x, points[i++].y, points[i].x, points[i++].y]
  24831. }
  24832. } else {
  24833. list[k++] = ["M", points[0], points[1]];
  24834. for (i = 2; i < ii;) {
  24835. list[k++] = ["C", points[i++], points[i++], points[i++], points[i++], points[i++], points[i++]]
  24836. }
  24837. }
  24838. } else {
  24839. list[k] = ["M", 0, 0]
  24840. }
  24841. close && list.push(["Z"]);
  24842. return list
  24843. }
  24844. function combinePathParam(segments) {
  24845. var d = [];
  24846. var k = 0;
  24847. var i;
  24848. var ii = segments.length;
  24849. var segment;
  24850. var j;
  24851. var jj;
  24852. for (i = 0; i < ii; ++i) {
  24853. segment = segments[i];
  24854. for (j = 0, jj = segment.length; j < jj; ++j) {
  24855. d[k++] = segment[j]
  24856. }
  24857. }
  24858. return d.join(" ")
  24859. }
  24860. function compensateSegments(oldSegments, newSegments, type) {
  24861. var oldLength = oldSegments.length;
  24862. var newLength = newSegments.length;
  24863. var i;
  24864. var originalNewSegments;
  24865. var makeEqualSegments = type.indexOf("area") !== -1 ? makeEqualAreaSegments : makeEqualLineSegments;
  24866. if (0 === oldLength) {
  24867. for (i = 0; i < newLength; i++) {
  24868. oldSegments.push(newSegments[i].slice(0))
  24869. }
  24870. } else {
  24871. if (oldLength < newLength) {
  24872. makeEqualSegments(oldSegments, newSegments, type)
  24873. } else {
  24874. if (oldLength > newLength) {
  24875. originalNewSegments = newSegments.slice(0);
  24876. makeEqualSegments(newSegments, oldSegments, type)
  24877. }
  24878. }
  24879. }
  24880. return originalNewSegments
  24881. }
  24882. function prepareConstSegment(constSeg, type) {
  24883. var x = constSeg[constSeg.length - 2];
  24884. var y = constSeg[constSeg.length - 1];
  24885. switch (type) {
  24886. case "line":
  24887. case "area":
  24888. constSeg[0] = "L";
  24889. break;
  24890. case "bezier":
  24891. case "bezierarea":
  24892. constSeg[0] = "C";
  24893. constSeg[1] = constSeg[3] = constSeg[5] = x;
  24894. constSeg[2] = constSeg[4] = constSeg[6] = y
  24895. }
  24896. }
  24897. function makeEqualLineSegments(short, long, type) {
  24898. var constSeg = short[short.length - 1].slice();
  24899. var i = short.length;
  24900. prepareConstSegment(constSeg, type);
  24901. for (; i < long.length; i++) {
  24902. short[i] = constSeg.slice(0)
  24903. }
  24904. }
  24905. function makeEqualAreaSegments(short, long, type) {
  24906. var i;
  24907. var head;
  24908. var shortLength = short.length;
  24909. var longLength = long.length;
  24910. var constsSeg1;
  24911. var constsSeg2;
  24912. if ((shortLength - 1) % 2 === 0 && (longLength - 1) % 2 === 0) {
  24913. i = (shortLength - 1) / 2 - 1;
  24914. head = short.slice(0, i + 1);
  24915. constsSeg1 = head[head.length - 1].slice(0);
  24916. constsSeg2 = short.slice(i + 1)[0].slice(0);
  24917. prepareConstSegment(constsSeg1, type);
  24918. prepareConstSegment(constsSeg2, type);
  24919. for (var j = i; j < (longLength - 1) / 2 - 1; j++) {
  24920. short.splice(j + 1, 0, constsSeg1);
  24921. short.splice(j + 3, 0, constsSeg2)
  24922. }
  24923. }
  24924. }
  24925. function baseCss(that, styles) {
  24926. var elemStyles = that._styles;
  24927. var str = "";
  24928. var key;
  24929. var value;
  24930. styles = styles || {};
  24931. for (key in styles) {
  24932. value = styles[key];
  24933. if ((0, _type.isDefined)(value)) {
  24934. value += "number" === typeof value && !pxAddingExceptions[key] ? "px" : "";
  24935. elemStyles[key] = "" !== value ? value : null
  24936. }
  24937. }
  24938. for (key in elemStyles) {
  24939. value = elemStyles[key];
  24940. if (value) {
  24941. str += key + ":" + value + ";"
  24942. }
  24943. }
  24944. str && that.element.setAttribute("style", str);
  24945. return that
  24946. }
  24947. function fixFuncIri(wrapper, attribute) {
  24948. var element = wrapper.element;
  24949. var id = wrapper.attr(attribute);
  24950. if (id && id.indexOf("DevExpress") !== -1) {
  24951. element.removeAttribute(attribute);
  24952. element.setAttribute(attribute, getFuncIri(id, wrapper.renderer.pathModified))
  24953. }
  24954. }
  24955. function baseAttr(that, attrs) {
  24956. attrs = attrs || {};
  24957. var settings = that._settings;
  24958. var attributes = {};
  24959. var key;
  24960. var value;
  24961. var elem = that.element;
  24962. var renderer = that.renderer;
  24963. var rtl = renderer.rtl;
  24964. var hasTransformations;
  24965. var recalculateDashStyle;
  24966. var sw;
  24967. var i;
  24968. if (!isObjectArgument(attrs)) {
  24969. if (attrs in settings) {
  24970. return settings[attrs]
  24971. }
  24972. if (attrs in DEFAULTS) {
  24973. return DEFAULTS[attrs]
  24974. }
  24975. return 0
  24976. }
  24977. extend(attributes, attrs);
  24978. for (key in attributes) {
  24979. value = attributes[key];
  24980. if (void 0 === value) {
  24981. continue
  24982. }
  24983. settings[key] = value;
  24984. if ("align" === key) {
  24985. key = "text-anchor";
  24986. value = {
  24987. left: rtl ? "end" : "start",
  24988. center: "middle",
  24989. right: rtl ? "start" : "end"
  24990. } [value] || null
  24991. } else {
  24992. if ("dashStyle" === key) {
  24993. recalculateDashStyle = true;
  24994. continue
  24995. } else {
  24996. if (key === KEY_STROKE_WIDTH) {
  24997. recalculateDashStyle = true
  24998. } else {
  24999. if (value && ("fill" === key || "clip-path" === key || "filter" === key) && value.indexOf("DevExpress") !== -1) {
  25000. that._addFixIRICallback();
  25001. value = getFuncIri(value, renderer.pathModified)
  25002. } else {
  25003. if (/^(translate(X|Y)|rotate[XY]?|scale(X|Y)|sharp|sharpDirection)$/i.test(key)) {
  25004. hasTransformations = true;
  25005. continue
  25006. } else {
  25007. if (/^(x|y|d)$/i.test(key)) {
  25008. hasTransformations = true
  25009. }
  25010. }
  25011. }
  25012. }
  25013. }
  25014. }
  25015. if (null === value) {
  25016. elem.removeAttribute(key)
  25017. } else {
  25018. elem.setAttribute(key, value)
  25019. }
  25020. }
  25021. if (recalculateDashStyle && "dashStyle" in settings) {
  25022. value = settings.dashStyle;
  25023. sw = ("_originalSW" in that ? that._originalSW : settings[KEY_STROKE_WIDTH]) || 1;
  25024. key = "stroke-dasharray";
  25025. value = null === value ? "" : (0, _utils.normalizeEnum)(value);
  25026. if ("" === value || "solid" === value || value === NONE) {
  25027. that.element.removeAttribute(key)
  25028. } else {
  25029. value = value.replace(/longdash/g, "8,3,").replace(/dash/g, "4,3,").replace(/dot/g, "1,3,").replace(/,$/, "").split(",");
  25030. i = value.length;
  25031. while (i--) {
  25032. value[i] = parseInt(value[i]) * sw
  25033. }
  25034. that.element.setAttribute(key, value.join(","))
  25035. }
  25036. }
  25037. if (hasTransformations) {
  25038. that._applyTransformation()
  25039. }
  25040. return that
  25041. }
  25042. function pathAttr(attrs) {
  25043. var that = this;
  25044. var segments;
  25045. if (isObjectArgument(attrs)) {
  25046. attrs = extend({}, attrs);
  25047. segments = attrs.segments;
  25048. if ("points" in attrs) {
  25049. segments = buildPathSegments(attrs.points, that.type);
  25050. delete attrs.points
  25051. }
  25052. if (segments) {
  25053. attrs.d = combinePathParam(segments);
  25054. that.segments = segments;
  25055. delete attrs.segments
  25056. }
  25057. }
  25058. return baseAttr(that, attrs)
  25059. }
  25060. function arcAttr(attrs) {
  25061. var settings = this._settings;
  25062. var x;
  25063. var y;
  25064. var innerRadius;
  25065. var outerRadius;
  25066. var startAngle;
  25067. var endAngle;
  25068. if (isObjectArgument(attrs)) {
  25069. attrs = extend({}, attrs);
  25070. if ("x" in attrs || "y" in attrs || "innerRadius" in attrs || "outerRadius" in attrs || "startAngle" in attrs || "endAngle" in attrs) {
  25071. settings.x = x = "x" in attrs ? attrs.x : settings.x;
  25072. delete attrs.x;
  25073. settings.y = y = "y" in attrs ? attrs.y : settings.y;
  25074. delete attrs.y;
  25075. settings.innerRadius = innerRadius = "innerRadius" in attrs ? attrs.innerRadius : settings.innerRadius;
  25076. delete attrs.innerRadius;
  25077. settings.outerRadius = outerRadius = "outerRadius" in attrs ? attrs.outerRadius : settings.outerRadius;
  25078. delete attrs.outerRadius;
  25079. settings.startAngle = startAngle = "startAngle" in attrs ? attrs.startAngle : settings.startAngle;
  25080. delete attrs.startAngle;
  25081. settings.endAngle = endAngle = "endAngle" in attrs ? attrs.endAngle : settings.endAngle;
  25082. delete attrs.endAngle;
  25083. attrs.d = buildArcPath.apply(null, normalizeArcParams(x, y, innerRadius, outerRadius, startAngle, endAngle))
  25084. }
  25085. }
  25086. return baseAttr(this, attrs)
  25087. }
  25088. function rectAttr(attrs) {
  25089. var that = this;
  25090. var x;
  25091. var y;
  25092. var width;
  25093. var height;
  25094. var sw;
  25095. var maxSW;
  25096. var newSW;
  25097. if (isObjectArgument(attrs)) {
  25098. attrs = extend({}, attrs);
  25099. if (void 0 !== attrs.x || void 0 !== attrs.y || void 0 !== attrs.width || void 0 !== attrs.height || void 0 !== attrs[KEY_STROKE_WIDTH]) {
  25100. void 0 !== attrs.x ? x = that._originalX = attrs.x : x = that._originalX || 0;
  25101. void 0 !== attrs.y ? y = that._originalY = attrs.y : y = that._originalY || 0;
  25102. void 0 !== attrs.width ? width = that._originalWidth = attrs.width : width = that._originalWidth || 0;
  25103. void 0 !== attrs.height ? height = that._originalHeight = attrs.height : height = that._originalHeight || 0;
  25104. void 0 !== attrs[KEY_STROKE_WIDTH] ? sw = that._originalSW = attrs[KEY_STROKE_WIDTH] : sw = that._originalSW;
  25105. maxSW = ~~((width < height ? width : height) / 2);
  25106. newSW = (sw || 0) < maxSW ? sw || 0 : maxSW;
  25107. attrs.x = x + newSW / 2;
  25108. attrs.y = y + newSW / 2;
  25109. attrs.width = width - newSW;
  25110. attrs.height = height - newSW;
  25111. ((sw || 0) !== newSW || !(0 === newSW && void 0 === sw)) && (attrs[KEY_STROKE_WIDTH] = newSW)
  25112. }
  25113. if ("sharp" in attrs) {
  25114. delete attrs.sharp
  25115. }
  25116. }
  25117. return baseAttr(that, attrs)
  25118. }
  25119. function textAttr(attrs) {
  25120. var that = this;
  25121. var isResetRequired;
  25122. if (!isObjectArgument(attrs)) {
  25123. return baseAttr(that, attrs)
  25124. }
  25125. attrs = extend({}, attrs);
  25126. var settings = that._settings;
  25127. var wasStroked = (0, _type.isDefined)(settings[KEY_STROKE]) && (0, _type.isDefined)(settings[KEY_STROKE_WIDTH]);
  25128. if (void 0 !== attrs[KEY_TEXT]) {
  25129. settings[KEY_TEXT] = attrs[KEY_TEXT];
  25130. delete attrs[KEY_TEXT];
  25131. isResetRequired = true
  25132. }
  25133. if (void 0 !== attrs[KEY_STROKE]) {
  25134. settings[KEY_STROKE] = attrs[KEY_STROKE];
  25135. delete attrs[KEY_STROKE]
  25136. }
  25137. if (void 0 !== attrs[KEY_STROKE_WIDTH]) {
  25138. settings[KEY_STROKE_WIDTH] = attrs[KEY_STROKE_WIDTH];
  25139. delete attrs[KEY_STROKE_WIDTH]
  25140. }
  25141. if (void 0 !== attrs[KEY_STROKE_OPACITY]) {
  25142. settings[KEY_STROKE_OPACITY] = attrs[KEY_STROKE_OPACITY];
  25143. delete attrs[KEY_STROKE_OPACITY]
  25144. }
  25145. var isStroked = (0, _type.isDefined)(settings[KEY_STROKE]) && (0, _type.isDefined)(settings[KEY_STROKE_WIDTH]);
  25146. baseAttr(that, attrs);
  25147. isResetRequired = isResetRequired || isStroked !== wasStroked && settings[KEY_TEXT];
  25148. if (isResetRequired) {
  25149. createTextNodes(that, settings.text, isStroked);
  25150. that._hasEllipsis = false
  25151. }
  25152. if (isResetRequired || void 0 !== attrs.x || void 0 !== attrs.y) {
  25153. locateTextNodes(that)
  25154. }
  25155. if (isStroked) {
  25156. strokeTextNodes(that)
  25157. }
  25158. return that
  25159. }
  25160. function textCss(styles) {
  25161. styles = styles || {};
  25162. baseCss(this, styles);
  25163. if (KEY_FONT_SIZE in styles) {
  25164. locateTextNodes(this)
  25165. }
  25166. return this
  25167. }
  25168. function orderHtmlTree(list, line, node, parentStyle, parentClassName) {
  25169. var style;
  25170. var realStyle;
  25171. var i;
  25172. var ii;
  25173. var nodes;
  25174. if (void 0 !== node.wholeText) {
  25175. list.push({
  25176. value: node.wholeText,
  25177. style: parentStyle,
  25178. className: parentClassName,
  25179. line: line,
  25180. height: parentStyle[KEY_FONT_SIZE] || 0
  25181. })
  25182. } else {
  25183. if ("BR" === node.tagName) {
  25184. ++line
  25185. } else {
  25186. if (_dom_adapter2.default.isElementNode(node)) {
  25187. extend(style = {}, parentStyle);
  25188. switch (node.tagName) {
  25189. case "B":
  25190. case "STRONG":
  25191. style[KEY_FONT_WEIGHT] = "bold";
  25192. break;
  25193. case "I":
  25194. case "EM":
  25195. style[KEY_FONT_STYLE] = "italic";
  25196. break;
  25197. case "U":
  25198. style[KEY_TEXT_DECORATION] = "underline"
  25199. }
  25200. realStyle = node.style;
  25201. realStyle.color && (style.fill = realStyle.color);
  25202. realStyle.fontSize && (style[KEY_FONT_SIZE] = realStyle.fontSize);
  25203. realStyle.fontStyle && (style[KEY_FONT_STYLE] = realStyle.fontStyle);
  25204. realStyle.fontWeight && (style[KEY_FONT_WEIGHT] = realStyle.fontWeight);
  25205. realStyle.textDecoration && (style[KEY_TEXT_DECORATION] = realStyle.textDecoration);
  25206. for (i = 0, nodes = node.childNodes, ii = nodes.length; i < ii; ++i) {
  25207. line = orderHtmlTree(list, line, nodes[i], style, node.className || parentClassName)
  25208. }
  25209. }
  25210. }
  25211. }
  25212. return line
  25213. }
  25214. function adjustLineHeights(items) {
  25215. var i;
  25216. var ii;
  25217. var currentItem = items[0];
  25218. var item;
  25219. for (i = 1, ii = items.length; i < ii; ++i) {
  25220. item = items[i];
  25221. if (item.line === currentItem.line) {
  25222. currentItem.height = maxLengthFontSize(currentItem.height, item.height);
  25223. currentItem.inherits = currentItem.inherits || 0 === parseFloat(item.height);
  25224. item.height = NaN
  25225. } else {
  25226. currentItem = item
  25227. }
  25228. }
  25229. }
  25230. function removeExtraAttrs(html) {
  25231. var findTagAttrs = /(?:(<[a-z0-9]+\s*))([\s\S]*?)(>|\/>)/gi;
  25232. var findStyleAndClassAttrs = /(style|class)\s*=\s*(["'])(?:(?!\2).)*\2\s?/gi;
  25233. return html.replace(findTagAttrs, function(allTagAttrs, p1, p2, p3) {
  25234. p2 = (p2 && p2.match(findStyleAndClassAttrs) || []).map(function(str) {
  25235. return str
  25236. }).join(" ");
  25237. return p1 + p2 + p3
  25238. })
  25239. }
  25240. function parseHTML(text) {
  25241. var items = [];
  25242. var div = _dom_adapter2.default.createElement("div");
  25243. div.innerHTML = text.replace(/\r/g, "").replace(/\n/g, "<br/>");
  25244. orderHtmlTree(items, 0, div, {}, "");
  25245. adjustLineHeights(items);
  25246. return items
  25247. }
  25248. function parseMultiline(text) {
  25249. var texts = text.replace(/\r/g, "").split(/\n/g);
  25250. var i = 0;
  25251. var items = [];
  25252. for (; i < texts.length; i++) {
  25253. items.push({
  25254. value: texts[i].trim(),
  25255. height: 0,
  25256. line: i
  25257. })
  25258. }
  25259. return items
  25260. }
  25261. function createTspans(items, element, fieldName) {
  25262. var i;
  25263. var ii;
  25264. var item;
  25265. for (i = 0, ii = items.length; i < ii; ++i) {
  25266. item = items[i];
  25267. item[fieldName] = createElement("tspan");
  25268. item[fieldName].appendChild(_dom_adapter2.default.createTextNode(item.value));
  25269. item.style && baseCss({
  25270. element: item[fieldName],
  25271. _styles: {}
  25272. }, item.style);
  25273. item.className && item[fieldName].setAttribute("class", item.className);
  25274. element.appendChild(item[fieldName])
  25275. }
  25276. }
  25277. function restoreText() {
  25278. if (this._hasEllipsis) {
  25279. this.attr({
  25280. text: this._settings.text
  25281. })
  25282. }
  25283. }
  25284. function applyEllipsis(maxWidth) {
  25285. var that = this;
  25286. var lines;
  25287. var hasEllipsis = false;
  25288. var i;
  25289. var ii;
  25290. var lineParts;
  25291. var j;
  25292. var jj;
  25293. var text;
  25294. restoreText.call(that);
  25295. var ellipsis = that.renderer.text(ELLIPSIS).attr(that._styles).append(that.renderer.root);
  25296. var ellipsisWidth = ellipsis.getBBox().width;
  25297. if (that._getElementBBox().width > maxWidth) {
  25298. if (maxWidth - ellipsisWidth < 0) {
  25299. maxWidth = 0
  25300. } else {
  25301. maxWidth -= ellipsisWidth
  25302. }
  25303. lines = prepareLines(that.element, that._texts, maxWidth);
  25304. for (i = 0, ii = lines.length; i < ii; ++i) {
  25305. lineParts = lines[i].parts;
  25306. if (1 === lines[i].commonLength) {
  25307. continue
  25308. }
  25309. for (j = 0, jj = lineParts.length; j < jj; ++j) {
  25310. text = lineParts[j];
  25311. if ((0, _type.isDefined)(text.endIndex)) {
  25312. setNewText(text, text.endIndex);
  25313. hasEllipsis = true
  25314. } else {
  25315. if (text.startBox > maxWidth) {
  25316. removeTextSpan(text)
  25317. }
  25318. }
  25319. }
  25320. }
  25321. }
  25322. ellipsis.remove();
  25323. that._hasEllipsis = hasEllipsis;
  25324. return hasEllipsis
  25325. }
  25326. function cloneAndRemoveAttrs(node) {
  25327. var clone;
  25328. if (node) {
  25329. clone = node.cloneNode();
  25330. clone.removeAttribute("y");
  25331. clone.removeAttribute("x")
  25332. }
  25333. return clone || node
  25334. }
  25335. function detachAndStoreTitleElements(element) {
  25336. var titleElements = _dom_adapter2.default.querySelectorAll(element, "title");
  25337. for (var i = 0; i < titleElements.length; i++) {
  25338. element.removeChild(titleElements[i])
  25339. }
  25340. return function() {
  25341. for (var _i = 0; _i < titleElements.length; _i++) {
  25342. element.appendChild(titleElements[_i])
  25343. }
  25344. }
  25345. }
  25346. function setMaxSize(maxWidth, maxHeight) {
  25347. var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
  25348. var that = this;
  25349. var lines = [];
  25350. var textChanged = false;
  25351. var textIsEmpty = false;
  25352. var ellipsisMaxWidth = maxWidth;
  25353. restoreText.call(that);
  25354. var restoreTitleElement = detachAndStoreTitleElements(this.element);
  25355. var ellipsis = that.renderer.text(ELLIPSIS).attr(that._styles).append(that.renderer.root);
  25356. var ellipsisWidth = ellipsis.getBBox().width;
  25357. var _that$_getElementBBox = that._getElementBBox(),
  25358. width = _that$_getElementBBox.width,
  25359. height = _that$_getElementBBox.height;
  25360. if ((width || height) && (width > maxWidth || maxHeight && height > maxHeight)) {
  25361. if (maxWidth - ellipsisWidth < 0) {
  25362. ellipsisMaxWidth = 0
  25363. } else {
  25364. ellipsisMaxWidth -= ellipsisWidth
  25365. }
  25366. lines = applyOverflowRules(that.element, that._texts, maxWidth, ellipsisMaxWidth, options, maxHeight);
  25367. lines = setMaxHeight(lines, ellipsisMaxWidth, options, maxHeight, parseFloat(this._getLineHeight()));
  25368. this._texts = lines.reduce(function(texts, line) {
  25369. return texts.concat(line.parts)
  25370. }, []).filter(function(t) {
  25371. return "" !== t.value
  25372. }).map(function(t) {
  25373. t.stroke && t.tspan.parentNode.appendChild(t.stroke);
  25374. return t
  25375. }).map(function(t) {
  25376. t.tspan.parentNode.appendChild(t.tspan);
  25377. return t
  25378. });
  25379. !this._texts.length && (this._texts = null);
  25380. textChanged = true;
  25381. if (this._texts) {
  25382. locateTextNodes(this)
  25383. } else {
  25384. this.element.textContent = "";
  25385. textIsEmpty = true
  25386. }
  25387. }
  25388. ellipsis.remove();
  25389. that._hasEllipsis = textChanged;
  25390. restoreTitleElement();
  25391. return {
  25392. rowCount: lines.length,
  25393. textChanged: textChanged,
  25394. textIsEmpty: textIsEmpty
  25395. }
  25396. }
  25397. function getIndexForEllipsis(text, maxWidth, startBox, endBox) {
  25398. var k;
  25399. var kk;
  25400. if (startBox <= maxWidth && endBox > maxWidth) {
  25401. for (k = 1, kk = text.value.length; k <= kk; ++k) {
  25402. if (startBox + text.tspan.getSubStringLength(0, k) > maxWidth) {
  25403. return k - 1
  25404. }
  25405. }
  25406. }
  25407. }
  25408. function getTextWidth(text) {
  25409. return text.value.length ? text.tspan.getSubStringLength(0, text.value.length) : 0
  25410. }
  25411. function prepareLines(element, texts, maxWidth) {
  25412. var lines = [];
  25413. var i;
  25414. var ii;
  25415. var text;
  25416. var startBox;
  25417. var endBox;
  25418. if (texts) {
  25419. for (i = 0, ii = texts.length; i < ii; ++i) {
  25420. text = texts[i];
  25421. if (!lines[text.line]) {
  25422. text.startBox = startBox = 0;
  25423. lines.push({
  25424. commonLength: text.value.length,
  25425. parts: [text]
  25426. })
  25427. } else {
  25428. text.startBox = startBox;
  25429. lines[text.line].parts.push(text);
  25430. lines[text.line].commonLength += text.value.length
  25431. }
  25432. endBox = startBox + text.tspan.getSubStringLength(0, text.value.length);
  25433. text.endIndex = getIndexForEllipsis(text, maxWidth, startBox, endBox);
  25434. startBox = endBox
  25435. }
  25436. } else {
  25437. text = {
  25438. value: element.textContent,
  25439. tspan: element
  25440. };
  25441. text.startBox = startBox = 0;
  25442. endBox = startBox + getTextWidth(text);
  25443. text.endIndex = getIndexForEllipsis(text, maxWidth, startBox, endBox);
  25444. lines = [{
  25445. commonLength: element.textContent.length,
  25446. parts: [text]
  25447. }]
  25448. }
  25449. return lines
  25450. }
  25451. function getSpaceBreakIndex(text, maxWidth) {
  25452. var initialIndices = text.startBox > 0 ? [0] : [];
  25453. var spaceIndices = text.value.split("").reduce(function(indices, char, index) {
  25454. if (" " === char) {
  25455. indices.push(index)
  25456. }
  25457. return indices
  25458. }, initialIndices);
  25459. var spaceIndex = 0;
  25460. while (void 0 !== spaceIndices[spaceIndex + 1] && text.startBox + text.tspan.getSubStringLength(0, spaceIndices[spaceIndex + 1]) < maxWidth) {
  25461. spaceIndex++
  25462. }
  25463. return spaceIndices[spaceIndex]
  25464. }
  25465. function getWordBreakIndex(text, maxWidth) {
  25466. for (var i = 0; i < text.value.length - 1; i++) {
  25467. if (text.startBox + text.tspan.getSubStringLength(0, i + 1) > maxWidth) {
  25468. return i
  25469. }
  25470. }
  25471. }
  25472. function getEllipsisString(ellipsisMaxWidth, _ref) {
  25473. var hideOverflowEllipsis = _ref.hideOverflowEllipsis;
  25474. return hideOverflowEllipsis && 0 === ellipsisMaxWidth ? "" : ELLIPSIS
  25475. }
  25476. function setEllipsis(text, ellipsisMaxWidth, options) {
  25477. var ellipsis = getEllipsisString(ellipsisMaxWidth, options);
  25478. if (text.value.length && text.tspan.parentNode) {
  25479. for (var i = text.value.length - 1; i >= 1; i--) {
  25480. if (text.startBox + text.tspan.getSubStringLength(0, i) < ellipsisMaxWidth) {
  25481. setNewText(text, i, ellipsis);
  25482. break
  25483. } else {
  25484. if (1 === i) {
  25485. setNewText(text, 0, ellipsis)
  25486. }
  25487. }
  25488. }
  25489. }
  25490. }
  25491. function wordWrap(text, maxWidth, ellipsisMaxWidth, options) {
  25492. var wholeText = text.value;
  25493. var breakIndex;
  25494. if ("none" !== options.wordWrap) {
  25495. breakIndex = "normal" === options.wordWrap ? getSpaceBreakIndex(text, maxWidth) : getWordBreakIndex(text, maxWidth)
  25496. }
  25497. var restLines = [];
  25498. var restText;
  25499. if (isFinite(breakIndex)) {
  25500. setNewText(text, breakIndex, "");
  25501. var newTextOffset = " " === wholeText[breakIndex] ? 1 : 0;
  25502. var restString = wholeText.slice(breakIndex + newTextOffset);
  25503. if (restString.length) {
  25504. var restTspan = cloneAndRemoveAttrs(text.tspan);
  25505. restTspan.textContent = restString;
  25506. text.tspan.parentNode.appendChild(restTspan);
  25507. restText = extend(extend({}, text), {
  25508. value: restString,
  25509. startBox: 0,
  25510. height: 0,
  25511. tspan: restTspan,
  25512. stroke: cloneAndRemoveAttrs(text.stroke),
  25513. endBox: restTspan.getSubStringLength(0, restString.length)
  25514. });
  25515. restText.stroke && (restText.stroke.textContent = restString);
  25516. if (restText.endBox > maxWidth) {
  25517. restLines = wordWrap(restText, maxWidth, ellipsisMaxWidth, options);
  25518. if (!restLines.length) {
  25519. return []
  25520. }
  25521. }
  25522. }
  25523. }
  25524. if (text.value.length) {
  25525. if ("ellipsis" === options.textOverflow && text.tspan.getSubStringLength(0, text.value.length) > maxWidth) {
  25526. setEllipsis(text, ellipsisMaxWidth, options)
  25527. }
  25528. if ("hide" === options.textOverflow && text.tspan.getSubStringLength(0, text.value.length) > maxWidth) {
  25529. return []
  25530. }
  25531. } else {
  25532. text.tspan.parentNode.removeChild(text.tspan)
  25533. }
  25534. var parts = [];
  25535. if (restText) {
  25536. parts.push(restText)
  25537. }
  25538. return [{
  25539. commonLength: wholeText.length,
  25540. parts: parts
  25541. }].concat(restLines)
  25542. }
  25543. function calculateLineHeight(line, lineHeight) {
  25544. return line.parts.reduce(function(height, text) {
  25545. return max(height, getItemLineHeight(text, lineHeight))
  25546. }, 0)
  25547. }
  25548. function setMaxHeight(lines, ellipsisMaxWidth, options, maxHeight, lineHeight) {
  25549. var textOverflow = options.textOverflow;
  25550. if (!isFinite(maxHeight) || 0 === Number(maxHeight) || "none" === textOverflow) {
  25551. return lines
  25552. }
  25553. var result = lines.reduce(function(_ref2, l, index, arr) {
  25554. var _ref3 = _slicedToArray(_ref2, 2),
  25555. lines = _ref3[0],
  25556. commonHeight = _ref3[1];
  25557. var height = calculateLineHeight(l, lineHeight);
  25558. commonHeight += height;
  25559. if (commonHeight < maxHeight) {
  25560. lines.push(l)
  25561. } else {
  25562. l.parts.forEach(function(item) {
  25563. removeTextSpan(item)
  25564. });
  25565. if ("ellipsis" === textOverflow) {
  25566. var prevLine = arr[index - 1];
  25567. if (prevLine) {
  25568. var text = prevLine.parts[prevLine.parts.length - 1];
  25569. if (!text.hasEllipsis) {
  25570. if (0 === ellipsisMaxWidth || text.endBox < ellipsisMaxWidth) {
  25571. setNewText(text, text.value.length, getEllipsisString(ellipsisMaxWidth, options))
  25572. } else {
  25573. setEllipsis(text, ellipsisMaxWidth, options)
  25574. }
  25575. }
  25576. }
  25577. }
  25578. }
  25579. return [lines, commonHeight]
  25580. }, [
  25581. [], 0
  25582. ]);
  25583. if ("hide" === textOverflow && result[1] > maxHeight) {
  25584. result[0].forEach(function(l) {
  25585. l.parts.forEach(function(item) {
  25586. removeTextSpan(item)
  25587. })
  25588. });
  25589. return []
  25590. }
  25591. return result[0]
  25592. }
  25593. function applyOverflowRules(element, texts, maxWidth, ellipsisMaxWidth, options) {
  25594. if (!texts) {
  25595. var textValue = element.textContent;
  25596. var text = {
  25597. value: textValue,
  25598. height: 0,
  25599. line: 0
  25600. };
  25601. element.textContent = "";
  25602. createTspans([text], element, "tspan");
  25603. texts = [text]
  25604. }
  25605. return texts.reduce(function(_ref4, text) {
  25606. var _ref5 = _slicedToArray(_ref4, 5),
  25607. lines = _ref5[0],
  25608. startBox = _ref5[1],
  25609. endBox = _ref5[2],
  25610. stop = _ref5[3],
  25611. lineNumber = _ref5[4];
  25612. var line = lines[lines.length - 1];
  25613. if (stop) {
  25614. return [lines, startBox, endBox, stop]
  25615. }
  25616. if (!line || text.line !== lineNumber) {
  25617. text.startBox = startBox = 0;
  25618. lines.push({
  25619. commonLength: text.value.length,
  25620. parts: [text]
  25621. })
  25622. } else {
  25623. text.startBox = startBox;
  25624. if (startBox > ellipsisMaxWidth && "none" === options.wordWrap && "ellipsis" === options.textOverflow) {
  25625. removeTextSpan(text);
  25626. return [lines, startBox, endBox, stop, lineNumber]
  25627. }
  25628. line.parts.push(text);
  25629. line.commonLength += text.value.length
  25630. }
  25631. text.endBox = endBox = startBox + getTextWidth(text);
  25632. startBox = endBox;
  25633. if ((0, _type.isDefined)(maxWidth) && endBox > maxWidth) {
  25634. var wordWrapLines = wordWrap(text, maxWidth, ellipsisMaxWidth, options);
  25635. if (!wordWrapLines.length) {
  25636. lines = [];
  25637. stop = true
  25638. } else {
  25639. lines = lines.concat(wordWrapLines.filter(function(l) {
  25640. return l.parts.length > 0
  25641. }))
  25642. }
  25643. }
  25644. return [lines, startBox, endBox, stop, text.line]
  25645. }, [
  25646. [], 0, 0, false, 0
  25647. ])[0]
  25648. }
  25649. function setNewText(text, index) {
  25650. var insertString = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : ELLIPSIS;
  25651. var newText = text.value.substr(0, index) + insertString;
  25652. text.value = text.tspan.textContent = newText;
  25653. text.stroke && (text.stroke.textContent = newText);
  25654. if (insertString === ELLIPSIS) {
  25655. text.hasEllipsis = true
  25656. }
  25657. }
  25658. function removeTextSpan(text) {
  25659. text.tspan.parentNode && text.tspan.parentNode.removeChild(text.tspan);
  25660. text.stroke && text.stroke.parentNode && text.stroke.parentNode.removeChild(text.stroke)
  25661. }
  25662. function createTextNodes(wrapper, text, isStroked) {
  25663. var items;
  25664. var parsedHtml;
  25665. wrapper._texts = null;
  25666. wrapper.clear();
  25667. if (null === text) {
  25668. return
  25669. }
  25670. text = "" + text;
  25671. if (!wrapper.renderer.encodeHtml && (/<[a-z][\s\S]*>/i.test(text) || text.indexOf("&") !== -1)) {
  25672. parsedHtml = removeExtraAttrs(text);
  25673. items = parseHTML(parsedHtml);
  25674. wrapper.DEBUG_parsedHtml = parsedHtml
  25675. } else {
  25676. if (/\n/g.test(text)) {
  25677. items = parseMultiline(text)
  25678. } else {
  25679. if (isStroked) {
  25680. items = [{
  25681. value: text.trim(),
  25682. height: 0
  25683. }]
  25684. }
  25685. }
  25686. }
  25687. if (items) {
  25688. if (items.length) {
  25689. wrapper._texts = items;
  25690. if (isStroked) {
  25691. createTspans(items, wrapper.element, KEY_STROKE)
  25692. }
  25693. createTspans(items, wrapper.element, "tspan")
  25694. }
  25695. } else {
  25696. wrapper.element.appendChild(_dom_adapter2.default.createTextNode(text))
  25697. }
  25698. }
  25699. function setTextNodeAttribute(item, name, value) {
  25700. item.tspan.setAttribute(name, value);
  25701. item.stroke && item.stroke.setAttribute(name, value)
  25702. }
  25703. function getItemLineHeight(item, defaultValue) {
  25704. return item.inherits ? maxLengthFontSize(item.height, defaultValue) : item.height || defaultValue
  25705. }
  25706. function locateTextNodes(wrapper) {
  25707. if (!wrapper._texts) {
  25708. return
  25709. }
  25710. var items = wrapper._texts;
  25711. var x = wrapper._settings.x;
  25712. var lineHeight = wrapper._getLineHeight();
  25713. var i;
  25714. var ii;
  25715. var item = items[0];
  25716. setTextNodeAttribute(item, "x", x);
  25717. setTextNodeAttribute(item, "y", wrapper._settings.y);
  25718. for (i = 1, ii = items.length; i < ii; ++i) {
  25719. item = items[i];
  25720. if (parseFloat(item.height) >= 0) {
  25721. setTextNodeAttribute(item, "x", x);
  25722. var height = getItemLineHeight(item, lineHeight);
  25723. setTextNodeAttribute(item, "dy", height)
  25724. }
  25725. }
  25726. }
  25727. function maxLengthFontSize(fontSize1, fontSize2) {
  25728. var parsedHeight1 = parseFloat(fontSize1);
  25729. var parsedHeight2 = parseFloat(fontSize2);
  25730. var height1 = parsedHeight1 || DEFAULT_FONT_SIZE;
  25731. var height2 = parsedHeight2 || DEFAULT_FONT_SIZE;
  25732. return height1 > height2 ? !isNaN(parsedHeight1) ? fontSize1 : height1 : !isNaN(parsedHeight2) ? fontSize2 : height2
  25733. }
  25734. function strokeTextNodes(wrapper) {
  25735. if (!wrapper._texts) {
  25736. return
  25737. }
  25738. var items = wrapper._texts;
  25739. var stroke = wrapper._settings[KEY_STROKE];
  25740. var strokeWidth = wrapper._settings[KEY_STROKE_WIDTH];
  25741. var strokeOpacity = wrapper._settings[KEY_STROKE_OPACITY] || 1;
  25742. var tspan;
  25743. var i;
  25744. var ii;
  25745. for (i = 0, ii = items.length; i < ii; ++i) {
  25746. tspan = items[i].stroke;
  25747. tspan.setAttribute(KEY_STROKE, stroke);
  25748. tspan.setAttribute(KEY_STROKE_WIDTH, strokeWidth);
  25749. tspan.setAttribute(KEY_STROKE_OPACITY, strokeOpacity);
  25750. tspan.setAttribute("stroke-linejoin", "round")
  25751. }
  25752. }
  25753. function baseAnimate(that, params, options, complete) {
  25754. options = options || {};
  25755. var key;
  25756. var value;
  25757. var renderer = that.renderer;
  25758. var settings = that._settings;
  25759. var animationParams = {};
  25760. var defaults = {
  25761. translateX: 0,
  25762. translateY: 0,
  25763. scaleX: 1,
  25764. scaleY: 1,
  25765. rotate: 0,
  25766. rotateX: 0,
  25767. rotateY: 0
  25768. };
  25769. if (complete) {
  25770. options.complete = complete
  25771. }
  25772. if (renderer.animationEnabled()) {
  25773. for (key in params) {
  25774. value = params[key];
  25775. if (/^(translate(X|Y)|rotate[XY]?|scale(X|Y))$/i.test(key)) {
  25776. animationParams.transform = animationParams.transform || {
  25777. from: {},
  25778. to: {}
  25779. };
  25780. animationParams.transform.from[key] = key in settings ? Number(settings[key].toFixed(3)) : defaults[key];
  25781. animationParams.transform.to[key] = value
  25782. } else {
  25783. if ("arc" === key || "segments" === key) {
  25784. animationParams[key] = value
  25785. } else {
  25786. animationParams[key] = {
  25787. from: key in settings ? settings[key] : parseFloat(that.element.getAttribute(key) || 0),
  25788. to: value
  25789. }
  25790. }
  25791. }
  25792. }
  25793. renderer.animateElement(that, animationParams, extend(extend({}, renderer._animation), options))
  25794. } else {
  25795. options.step && options.step.call(that, 1, 1);
  25796. options.complete && options.complete.call(that);
  25797. that.attr(params)
  25798. }
  25799. return that
  25800. }
  25801. function pathAnimate(params, options, complete) {
  25802. var that = this;
  25803. var curSegments = that.segments || [];
  25804. var newSegments;
  25805. var endSegments;
  25806. if (that.renderer.animationEnabled() && "points" in params) {
  25807. newSegments = buildPathSegments(params.points, that.type);
  25808. endSegments = compensateSegments(curSegments, newSegments, that.type);
  25809. params.segments = {
  25810. from: curSegments,
  25811. to: newSegments,
  25812. end: endSegments
  25813. };
  25814. delete params.points
  25815. }
  25816. return baseAnimate(that, params, options, complete)
  25817. }
  25818. function arcAnimate(params, options, complete) {
  25819. var that = this;
  25820. var settings = that._settings;
  25821. var arcParams = {
  25822. from: {},
  25823. to: {}
  25824. };
  25825. if (that.renderer.animationEnabled() && ("x" in params || "y" in params || "innerRadius" in params || "outerRadius" in params || "startAngle" in params || "endAngle" in params)) {
  25826. arcParams.from.x = settings.x || 0;
  25827. arcParams.from.y = settings.y || 0;
  25828. arcParams.from.innerRadius = settings.innerRadius || 0;
  25829. arcParams.from.outerRadius = settings.outerRadius || 0;
  25830. arcParams.from.startAngle = settings.startAngle || 0;
  25831. arcParams.from.endAngle = settings.endAngle || 0;
  25832. arcParams.to.x = "x" in params ? params.x : settings.x;
  25833. delete params.x;
  25834. arcParams.to.y = "y" in params ? params.y : settings.y;
  25835. delete params.y;
  25836. arcParams.to.innerRadius = "innerRadius" in params ? params.innerRadius : settings.innerRadius;
  25837. delete params.innerRadius;
  25838. arcParams.to.outerRadius = "outerRadius" in params ? params.outerRadius : settings.outerRadius;
  25839. delete params.outerRadius;
  25840. arcParams.to.startAngle = "startAngle" in params ? params.startAngle : settings.startAngle;
  25841. delete params.startAngle;
  25842. arcParams.to.endAngle = "endAngle" in params ? params.endAngle : settings.endAngle;
  25843. delete params.endAngle;
  25844. params.arc = arcParams
  25845. }
  25846. return baseAnimate(that, params, options, complete)
  25847. }
  25848. exports.DEBUG_set_getNextDefsSvgId = function(newFunction) {
  25849. getNextDefsSvgId = newFunction
  25850. };
  25851. exports.DEBUG_removeBackupContainer = function() {
  25852. if (getBackup().backupCounter) {
  25853. getBackup().backupCounter = 0;
  25854. _dom_adapter2.default.getBody().removeChild(getBackup().backupContainer)
  25855. }
  25856. };
  25857. function buildLink(target, parameters) {
  25858. var obj = {
  25859. is: false,
  25860. name: parameters.name || parameters,
  25861. after: parameters.after
  25862. };
  25863. if (target) {
  25864. obj.to = target
  25865. } else {
  25866. obj.virtual = true
  25867. }
  25868. return obj
  25869. }
  25870. function SvgElement(renderer, tagName, type) {
  25871. var that = this;
  25872. that.renderer = renderer;
  25873. that.element = createElement(tagName);
  25874. that._settings = {};
  25875. that._styles = {};
  25876. if ("path" === tagName) {
  25877. that.type = type || "line"
  25878. }
  25879. }
  25880. function removeFuncIriCallback(callback) {
  25881. fixFuncIriCallbacks.remove(callback)
  25882. }
  25883. exports.SvgElement = SvgElement;
  25884. SvgElement.prototype = {
  25885. constructor: SvgElement,
  25886. _getJQElement: function() {
  25887. return this._$element || (this._$element = (0, _renderer2.default)(this.element))
  25888. },
  25889. _addFixIRICallback: function() {
  25890. var that = this;
  25891. var fn = function() {
  25892. fixFuncIri(that, "fill");
  25893. fixFuncIri(that, "clip-path");
  25894. fixFuncIri(that, "filter")
  25895. };
  25896. that.element._fixFuncIri = fn;
  25897. fn.renderer = that.renderer;
  25898. fixFuncIriCallbacks.add(fn);
  25899. that._addFixIRICallback = function() {}
  25900. },
  25901. _clearChildrenFuncIri: function() {
  25902. var clearChildren = function clearChildren(element) {
  25903. var i;
  25904. for (i = 0; i < element.childNodes.length; i++) {
  25905. removeFuncIriCallback(element.childNodes[i]._fixFuncIri);
  25906. clearChildren(element.childNodes[i])
  25907. }
  25908. };
  25909. clearChildren(this.element)
  25910. },
  25911. dispose: function() {
  25912. removeFuncIriCallback(this.element._fixFuncIri);
  25913. this._clearChildrenFuncIri();
  25914. this._getJQElement().remove();
  25915. return this
  25916. },
  25917. append: function(parent) {
  25918. (parent || this.renderer.root).element.appendChild(this.element);
  25919. return this
  25920. },
  25921. remove: function() {
  25922. var element = this.element;
  25923. element.parentNode && element.parentNode.removeChild(element);
  25924. return this
  25925. },
  25926. enableLinks: function() {
  25927. this._links = [];
  25928. return this
  25929. },
  25930. checkLinks: function() {
  25931. var count = 0;
  25932. var links = this._links;
  25933. var i;
  25934. var ii = links.length;
  25935. for (i = 0; i < ii; ++i) {
  25936. if (!links[i]._link.virtual) {
  25937. ++count
  25938. }
  25939. }
  25940. if (count > 0) {
  25941. throw new Error("There are non disposed links!")
  25942. }
  25943. },
  25944. virtualLink: function(parameters) {
  25945. linkItem({
  25946. _link: buildLink(null, parameters)
  25947. }, this);
  25948. return this
  25949. },
  25950. linkAfter: function(name) {
  25951. this._linkAfter = name;
  25952. return this
  25953. },
  25954. linkOn: function(target, parameters) {
  25955. this._link = buildLink(target, parameters);
  25956. linkItem(this, target);
  25957. return this
  25958. },
  25959. linkOff: function() {
  25960. unlinkItem(this);
  25961. this._link = null;
  25962. return this
  25963. },
  25964. linkAppend: function() {
  25965. var link = this._link;
  25966. var items = link.to._links;
  25967. var i;
  25968. var next;
  25969. for (i = link.i + 1;
  25970. (next = items[i]) && !next._link.is; ++i) {}
  25971. this._insert(link.to, next);
  25972. link.is = true;
  25973. return this
  25974. },
  25975. _insert: function(parent, next) {
  25976. parent.element.insertBefore(this.element, next ? next.element : null)
  25977. },
  25978. linkRemove: function() {
  25979. this.remove();
  25980. this._link.is = false;
  25981. return this
  25982. },
  25983. clear: function() {
  25984. this._clearChildrenFuncIri();
  25985. this._getJQElement().empty();
  25986. return this
  25987. },
  25988. toBackground: function() {
  25989. var elem = this.element;
  25990. var parent = elem.parentNode;
  25991. parent && parent.insertBefore(elem, parent.firstChild);
  25992. return this
  25993. },
  25994. toForeground: function() {
  25995. var elem = this.element;
  25996. var parent = elem.parentNode;
  25997. parent && parent.appendChild(elem);
  25998. return this
  25999. },
  26000. attr: function(attrs) {
  26001. return baseAttr(this, attrs)
  26002. },
  26003. smartAttr: function(attrs) {
  26004. var that = this;
  26005. if (attrs.hatching && "none" !== (0, _utils.normalizeEnum)(attrs.hatching.direction)) {
  26006. attrs = extend({}, attrs);
  26007. attrs.fill = that._hatching = that.renderer.lockHatching(attrs.fill, attrs.hatching, that._hatching);
  26008. delete attrs.hatching
  26009. } else {
  26010. if (that._hatching) {
  26011. that.renderer.releaseHatching(that._hatching);
  26012. that._hatching = null
  26013. }
  26014. }
  26015. return that.attr(attrs)
  26016. },
  26017. css: function(styles) {
  26018. return baseCss(this, styles)
  26019. },
  26020. animate: function(params, options, complete) {
  26021. return baseAnimate(this, params, options, complete)
  26022. },
  26023. sharp: function(pos, sharpDirection) {
  26024. return this.attr({
  26025. sharp: pos || true,
  26026. sharpDirection: sharpDirection
  26027. })
  26028. },
  26029. _applyTransformation: function() {
  26030. var tr = this._settings;
  26031. var rotateX;
  26032. var rotateY;
  26033. var transformations = [];
  26034. var sharpMode = tr.sharp;
  26035. var trDirection = tr.sharpDirection || 1;
  26036. var strokeOdd = tr[KEY_STROKE_WIDTH] % 2;
  26037. var correctionX = strokeOdd && ("h" === sharpMode || true === sharpMode) ? SHARPING_CORRECTION * trDirection : 0;
  26038. var correctionY = strokeOdd && ("v" === sharpMode || true === sharpMode) ? SHARPING_CORRECTION * trDirection : 0;
  26039. transformations.push("translate(" + ((tr.translateX || 0) + correctionX) + "," + ((tr.translateY || 0) + correctionY) + ")");
  26040. if (tr.rotate) {
  26041. if ("rotateX" in tr) {
  26042. rotateX = tr.rotateX
  26043. } else {
  26044. rotateX = tr.x
  26045. }
  26046. if ("rotateY" in tr) {
  26047. rotateY = tr.rotateY
  26048. } else {
  26049. rotateY = tr.y
  26050. }
  26051. transformations.push("rotate(" + tr.rotate + "," + (rotateX || 0) + "," + (rotateY || 0) + ")")
  26052. }
  26053. var scaleXDefined = (0, _type.isDefined)(tr.scaleX);
  26054. var scaleYDefined = (0, _type.isDefined)(tr.scaleY);
  26055. if (scaleXDefined || scaleYDefined) {
  26056. transformations.push("scale(" + (scaleXDefined ? tr.scaleX : 1) + "," + (scaleYDefined ? tr.scaleY : 1) + ")")
  26057. }
  26058. if (transformations.length) {
  26059. this.element.setAttribute("transform", transformations.join(" "))
  26060. }
  26061. },
  26062. move: function(x, y, animate, animOptions) {
  26063. var obj = {};
  26064. (0, _type.isDefined)(x) && (obj.translateX = x);
  26065. (0, _type.isDefined)(y) && (obj.translateY = y);
  26066. if (!animate) {
  26067. this.attr(obj)
  26068. } else {
  26069. this.animate(obj, animOptions)
  26070. }
  26071. return this
  26072. },
  26073. rotate: function(angle, x, y, animate, animOptions) {
  26074. var obj = {
  26075. rotate: angle || 0
  26076. };
  26077. (0, _type.isDefined)(x) && (obj.rotateX = x);
  26078. (0, _type.isDefined)(y) && (obj.rotateY = y);
  26079. if (!animate) {
  26080. this.attr(obj)
  26081. } else {
  26082. this.animate(obj, animOptions)
  26083. }
  26084. return this
  26085. },
  26086. _getElementBBox: function() {
  26087. var elem = this.element;
  26088. var bBox;
  26089. try {
  26090. bBox = elem.getBBox && elem.getBBox()
  26091. } catch (e) {}
  26092. return bBox || {
  26093. x: 0,
  26094. y: 0,
  26095. width: elem.offsetWidth || 0,
  26096. height: elem.offsetHeight || 0
  26097. }
  26098. },
  26099. getBBox: function() {
  26100. var transformation = this._settings;
  26101. var bBox = this._getElementBBox();
  26102. if (transformation.rotate) {
  26103. bBox = (0, _utils.rotateBBox)(bBox, [("rotateX" in transformation ? transformation.rotateX : transformation.x) || 0, ("rotateY" in transformation ? transformation.rotateY : transformation.y) || 0], -transformation.rotate)
  26104. } else {
  26105. bBox = (0, _utils.normalizeBBox)(bBox)
  26106. }
  26107. return bBox
  26108. },
  26109. markup: function() {
  26110. return (0, _svg.getSvgMarkup)(this.element)
  26111. },
  26112. getOffset: function() {
  26113. return this._getJQElement().offset()
  26114. },
  26115. stopAnimation: function(disableComplete) {
  26116. var animation = this.animation;
  26117. animation && animation.stop(disableComplete);
  26118. return this
  26119. },
  26120. setTitle: function(text) {
  26121. var titleElem = createElement("title");
  26122. titleElem.textContent = text || "";
  26123. this.element.appendChild(titleElem)
  26124. },
  26125. data: function(obj, val) {
  26126. var elem = this.element;
  26127. var key;
  26128. if (void 0 !== val) {
  26129. elem[obj] = val
  26130. } else {
  26131. for (key in obj) {
  26132. elem[key] = obj[key]
  26133. }
  26134. }
  26135. return this
  26136. },
  26137. on: function() {
  26138. var args = [this._getJQElement()];
  26139. args.push.apply(args, arguments);
  26140. _events_engine2.default.on.apply(_events_engine2.default, args);
  26141. return this
  26142. },
  26143. off: function() {
  26144. var args = [this._getJQElement()];
  26145. args.push.apply(args, arguments);
  26146. _events_engine2.default.off.apply(_events_engine2.default, args);
  26147. return this
  26148. },
  26149. trigger: function() {
  26150. var args = [this._getJQElement()];
  26151. args.push.apply(args, arguments);
  26152. _events_engine2.default.trigger.apply(_events_engine2.default, args);
  26153. return this
  26154. }
  26155. };
  26156. function PathSvgElement(renderer, type) {
  26157. SvgElement.call(this, renderer, "path", type)
  26158. }
  26159. exports.PathSvgElement = PathSvgElement;
  26160. PathSvgElement.prototype = objectCreate(SvgElement.prototype);
  26161. extend(PathSvgElement.prototype, {
  26162. constructor: PathSvgElement,
  26163. attr: pathAttr,
  26164. animate: pathAnimate
  26165. });
  26166. function ArcSvgElement(renderer) {
  26167. SvgElement.call(this, renderer, "path", "arc")
  26168. }
  26169. exports.ArcSvgElement = ArcSvgElement;
  26170. ArcSvgElement.prototype = objectCreate(SvgElement.prototype);
  26171. extend(ArcSvgElement.prototype, {
  26172. constructor: ArcSvgElement,
  26173. attr: arcAttr,
  26174. animate: arcAnimate
  26175. });
  26176. function RectSvgElement(renderer) {
  26177. SvgElement.call(this, renderer, "rect")
  26178. }
  26179. exports.RectSvgElement = RectSvgElement;
  26180. RectSvgElement.prototype = objectCreate(SvgElement.prototype);
  26181. extend(RectSvgElement.prototype, {
  26182. constructor: RectSvgElement,
  26183. attr: rectAttr
  26184. });
  26185. function TextSvgElement(renderer) {
  26186. SvgElement.call(this, renderer, "text");
  26187. this.css({
  26188. "white-space": "pre"
  26189. })
  26190. }
  26191. exports.TextSvgElement = TextSvgElement;
  26192. TextSvgElement.prototype = objectCreate(SvgElement.prototype);
  26193. extend(TextSvgElement.prototype, {
  26194. constructor: TextSvgElement,
  26195. attr: textAttr,
  26196. css: textCss,
  26197. applyEllipsis: applyEllipsis,
  26198. setMaxSize: setMaxSize,
  26199. restoreText: restoreText,
  26200. _getLineHeight: function() {
  26201. return !isNaN(parseFloat(this._styles[KEY_FONT_SIZE])) ? this._styles[KEY_FONT_SIZE] : DEFAULT_FONT_SIZE
  26202. }
  26203. });
  26204. function updateIndexes(items, k) {
  26205. var i;
  26206. var item;
  26207. for (i = k; item = items[i]; ++i) {
  26208. item._link.i = i
  26209. }
  26210. }
  26211. function linkItem(target, container) {
  26212. var items = container._links;
  26213. var key = target._link.after = target._link.after || container._linkAfter;
  26214. var i;
  26215. var item;
  26216. if (key) {
  26217. for (i = 0;
  26218. (item = items[i]) && item._link.name !== key; ++i) {}
  26219. if (item) {
  26220. for (++i;
  26221. (item = items[i]) && item._link.after === key; ++i) {}
  26222. }
  26223. } else {
  26224. i = items.length
  26225. }
  26226. items.splice(i, 0, target);
  26227. updateIndexes(items, i)
  26228. }
  26229. function unlinkItem(target) {
  26230. var i;
  26231. var items = target._link.to._links;
  26232. for (i = 0; items[i] !== target; ++i) {}
  26233. items.splice(i, 1);
  26234. updateIndexes(items, i)
  26235. }
  26236. function Renderer(options) {
  26237. var that = this;
  26238. that.root = that._createElement("svg", {
  26239. xmlns: "http://www.w3.org/2000/svg",
  26240. version: "1.1",
  26241. fill: NONE,
  26242. stroke: NONE,
  26243. "stroke-width": 0
  26244. }).attr({
  26245. "class": options.cssClass
  26246. }).css({
  26247. "line-height": "normal",
  26248. "-ms-user-select": NONE,
  26249. "-moz-user-select": NONE,
  26250. "-webkit-user-select": NONE,
  26251. "-webkit-tap-highlight-color": "rgba(0, 0, 0, 0)",
  26252. display: "block",
  26253. overflow: "hidden"
  26254. });
  26255. that._init();
  26256. that.pathModified = !!options.pathModified;
  26257. that._$container = (0, _renderer2.default)(options.container);
  26258. that.root.append({
  26259. element: options.container
  26260. });
  26261. that.fixPlacement();
  26262. that._locker = 0;
  26263. that._backed = false
  26264. }
  26265. exports.Renderer = Renderer;
  26266. Renderer.prototype = {
  26267. constructor: Renderer,
  26268. _init: function() {
  26269. var that = this;
  26270. that._defs = that._createElement("defs").append(that.root);
  26271. that._animationController = new _animation2.default.AnimationController(that.root.element);
  26272. that._animation = {
  26273. enabled: true,
  26274. duration: 1e3,
  26275. easing: "easeOutCubic"
  26276. }
  26277. },
  26278. fixPlacement: function() {
  26279. if (!_browser2.default.mozilla && !_browser2.default.msie) {
  26280. return
  26281. }
  26282. var box = getBoundingClientRect(this._$container.get(0));
  26283. var dx = roundValue(box.left % 1, 2);
  26284. var dy = roundValue(box.top % 1, 2);
  26285. if (_browser2.default.msie) {
  26286. this.root.css({
  26287. transform: "translate(" + -dx + "px," + -dy + "px)"
  26288. })
  26289. } else {
  26290. if (_browser2.default.mozilla) {
  26291. this.root.move(-dx, -dy)
  26292. }
  26293. }
  26294. },
  26295. removePlacementFix: function() {
  26296. if (!_browser2.default.mozilla && !_browser2.default.msie) {
  26297. return
  26298. }
  26299. if (_browser2.default.msie) {
  26300. this.root.css({
  26301. transform: ""
  26302. })
  26303. } else {
  26304. if (_browser2.default.mozilla) {
  26305. this.root.attr({
  26306. transform: null
  26307. })
  26308. }
  26309. }
  26310. },
  26311. setOptions: function(options) {
  26312. var that = this;
  26313. that.rtl = !!options.rtl;
  26314. that.encodeHtml = !!options.encodeHtml;
  26315. that.updateAnimationOptions(options.animation || {});
  26316. that.root.attr({
  26317. direction: that.rtl ? "rtl" : "ltr"
  26318. });
  26319. return that
  26320. },
  26321. _createElement: function(tagName, attr, type) {
  26322. var elem = new exports.SvgElement(this, tagName, type);
  26323. attr && elem.attr(attr);
  26324. return elem
  26325. },
  26326. lock: function() {
  26327. var that = this;
  26328. if (0 === that._locker) {
  26329. that._backed = !that._$container.is(":visible");
  26330. if (that._backed) {
  26331. backupRoot(that.root)
  26332. }
  26333. }++that._locker;
  26334. return that
  26335. },
  26336. unlock: function() {
  26337. var that = this;
  26338. --that._locker;
  26339. if (0 === that._locker) {
  26340. if (that._backed) {
  26341. restoreRoot(that.root, that._$container[0]);
  26342. that.fixPlacement()
  26343. }
  26344. that._backed = false
  26345. }
  26346. return that
  26347. },
  26348. resize: function(width, height) {
  26349. if (width >= 0 && height >= 0) {
  26350. this.root.attr({
  26351. width: width,
  26352. height: height
  26353. })
  26354. }
  26355. return this
  26356. },
  26357. dispose: function() {
  26358. var that = this;
  26359. var key;
  26360. that.root.dispose();
  26361. that._defs.dispose();
  26362. that._animationController.dispose();
  26363. fixFuncIriCallbacks.removeByRenderer(that);
  26364. for (key in that) {
  26365. that[key] = null
  26366. }
  26367. return that
  26368. },
  26369. animationEnabled: function() {
  26370. return !!this._animation.enabled
  26371. },
  26372. updateAnimationOptions: function(newOptions) {
  26373. extend(this._animation, newOptions);
  26374. return this
  26375. },
  26376. stopAllAnimations: function(lock) {
  26377. this._animationController[lock ? "lock" : "stop"]();
  26378. return this
  26379. },
  26380. animateElement: function(element, params, options) {
  26381. this._animationController.animateElement(element, params, options);
  26382. return this
  26383. },
  26384. svg: function() {
  26385. this.removePlacementFix();
  26386. var markup = this.root.markup();
  26387. this.fixPlacement();
  26388. return markup
  26389. },
  26390. getRootOffset: function() {
  26391. return this.root.getOffset()
  26392. },
  26393. onEndAnimation: function(endAnimation) {
  26394. this._animationController.onEndAnimation(endAnimation)
  26395. },
  26396. rect: function(x, y, width, height) {
  26397. var elem = new exports.RectSvgElement(this);
  26398. return elem.attr({
  26399. x: x || 0,
  26400. y: y || 0,
  26401. width: width || 0,
  26402. height: height || 0
  26403. })
  26404. },
  26405. simpleRect: function() {
  26406. return this._createElement("rect")
  26407. },
  26408. circle: function(x, y, r) {
  26409. return this._createElement("circle", {
  26410. cx: x || 0,
  26411. cy: y || 0,
  26412. r: r || 0
  26413. })
  26414. },
  26415. g: function() {
  26416. return this._createElement("g")
  26417. },
  26418. image: function image(x, y, w, h, href, location) {
  26419. var image = this._createElement("image", {
  26420. x: x || 0,
  26421. y: y || 0,
  26422. width: w || 0,
  26423. height: h || 0,
  26424. preserveAspectRatio: preserveAspectRatioMap[(0, _utils.normalizeEnum)(location)] || NONE
  26425. });
  26426. image.element.setAttributeNS("http://www.w3.org/1999/xlink", "href", href || "");
  26427. return image
  26428. },
  26429. path: function(points, type) {
  26430. var elem = new exports.PathSvgElement(this, type);
  26431. return elem.attr({
  26432. points: points || []
  26433. })
  26434. },
  26435. arc: function(x, y, innerRadius, outerRadius, startAngle, endAngle) {
  26436. var elem = new exports.ArcSvgElement(this);
  26437. return elem.attr({
  26438. x: x || 0,
  26439. y: y || 0,
  26440. innerRadius: innerRadius || 0,
  26441. outerRadius: outerRadius || 0,
  26442. startAngle: startAngle || 0,
  26443. endAngle: endAngle || 0
  26444. })
  26445. },
  26446. text: function(_text, x, y) {
  26447. var elem = new exports.TextSvgElement(this);
  26448. return elem.attr({
  26449. text: _text,
  26450. x: x || 0,
  26451. y: y || 0
  26452. })
  26453. },
  26454. linearGradient: function(stops) {
  26455. var id = getNextDefsSvgId();
  26456. var that = this;
  26457. var gradient = that._createElement("linearGradient", {
  26458. id: id
  26459. }).append(that._defs);
  26460. gradient.id = id;
  26461. stops.forEach(function(stop) {
  26462. that._createElement("stop", {
  26463. offset: stop.offset,
  26464. "stop-color": stop["stop-color"]
  26465. }).append(gradient)
  26466. });
  26467. return gradient
  26468. },
  26469. pattern: function pattern(color, hatching, _id) {
  26470. hatching = hatching || {};
  26471. var that = this;
  26472. var step = hatching.step || 6;
  26473. var stepTo2 = step / 2;
  26474. var stepBy15 = 1.5 * step;
  26475. var id = _id || getNextDefsSvgId();
  26476. var d = "right" === (0, _utils.normalizeEnum)(hatching.direction) ? "M " + stepTo2 + " " + -stepTo2 + " L " + -stepTo2 + " " + stepTo2 + " M 0 " + step + " L " + step + " 0 M " + stepBy15 + " " + stepTo2 + " L " + stepTo2 + " " + stepBy15 : "M 0 0 L " + step + " " + step + " M " + -stepTo2 + " " + stepTo2 + " L " + stepTo2 + " " + stepBy15 + " M " + stepTo2 + " " + -stepTo2 + " L " + stepBy15 + " " + stepTo2;
  26477. var pattern = that._createElement("pattern", {
  26478. id: id,
  26479. width: step,
  26480. height: step,
  26481. patternUnits: "userSpaceOnUse"
  26482. }).append(that._defs);
  26483. pattern.id = id;
  26484. var rect = that.rect(0, 0, step, step).attr({
  26485. fill: color,
  26486. opacity: hatching.opacity
  26487. }).append(pattern);
  26488. var path = new exports.PathSvgElement(this).attr({
  26489. d: d,
  26490. "stroke-width": hatching.width || 1,
  26491. stroke: color
  26492. }).append(pattern);
  26493. pattern.rect = rect;
  26494. pattern.path = path;
  26495. return pattern
  26496. },
  26497. _getPointsWithYOffset: function(points, offset) {
  26498. return points.map(function(point, index) {
  26499. if (index % 2 !== 0) {
  26500. return point + offset
  26501. }
  26502. return point
  26503. })
  26504. },
  26505. clipRect: function(x, y, width, height) {
  26506. var that = this;
  26507. var id = getNextDefsSvgId();
  26508. var clipPath = that._createElement("clipPath", {
  26509. id: id
  26510. }).append(that._defs);
  26511. var rect = that.rect(x, y, width, height).append(clipPath);
  26512. rect.id = id;
  26513. rect.clipPath = clipPath;
  26514. rect.remove = function() {
  26515. throw "Not implemented"
  26516. };
  26517. rect.dispose = function() {
  26518. clipPath.dispose();
  26519. clipPath = null;
  26520. return this
  26521. };
  26522. return rect
  26523. },
  26524. shadowFilter: function(x, y, width, height, offsetX, offsetY, blur, color, opacity) {
  26525. var that = this;
  26526. var id = getNextDefsSvgId();
  26527. var filter = that._createElement("filter", {
  26528. id: id,
  26529. x: x || 0,
  26530. y: y || 0,
  26531. width: width || 0,
  26532. height: height || 0
  26533. }).append(that._defs);
  26534. var gaussianBlur = that._createElement("feGaussianBlur", {
  26535. "in": "SourceGraphic",
  26536. result: "gaussianBlurResult",
  26537. stdDeviation: blur || 0
  26538. }).append(filter);
  26539. var offset = that._createElement("feOffset", {
  26540. "in": "gaussianBlurResult",
  26541. result: "offsetResult",
  26542. dx: offsetX || 0,
  26543. dy: offsetY || 0
  26544. }).append(filter);
  26545. var flood = that._createElement("feFlood", {
  26546. result: "floodResult",
  26547. "flood-color": color || "",
  26548. "flood-opacity": opacity
  26549. }).append(filter);
  26550. var composite = that._createElement("feComposite", {
  26551. "in": "floodResult",
  26552. in2: "offsetResult",
  26553. operator: "in",
  26554. result: "compositeResult"
  26555. }).append(filter);
  26556. var finalComposite = that._createElement("feComposite", {
  26557. "in": "SourceGraphic",
  26558. in2: "compositeResult",
  26559. operator: "over"
  26560. }).append(filter);
  26561. filter.id = id;
  26562. filter.gaussianBlur = gaussianBlur;
  26563. filter.offset = offset;
  26564. filter.flood = flood;
  26565. filter.composite = composite;
  26566. filter.finalComposite = finalComposite;
  26567. filter.attr = function(attrs) {
  26568. var that = this;
  26569. var filterAttrs = {};
  26570. var offsetAttrs = {};
  26571. var floodAttrs = {};
  26572. "x" in attrs && (filterAttrs.x = attrs.x);
  26573. "y" in attrs && (filterAttrs.y = attrs.y);
  26574. "width" in attrs && (filterAttrs.width = attrs.width);
  26575. "height" in attrs && (filterAttrs.height = attrs.height);
  26576. baseAttr(that, filterAttrs);
  26577. "blur" in attrs && that.gaussianBlur.attr({
  26578. stdDeviation: attrs.blur
  26579. });
  26580. "offsetX" in attrs && (offsetAttrs.dx = attrs.offsetX);
  26581. "offsetY" in attrs && (offsetAttrs.dy = attrs.offsetY);
  26582. that.offset.attr(offsetAttrs);
  26583. "color" in attrs && (floodAttrs["flood-color"] = attrs.color);
  26584. "opacity" in attrs && (floodAttrs["flood-opacity"] = attrs.opacity);
  26585. that.flood.attr(floodAttrs);
  26586. return that
  26587. };
  26588. return filter
  26589. },
  26590. brightFilter: function(type, slope) {
  26591. var that = this;
  26592. var id = getNextDefsSvgId();
  26593. var filter = that._createElement("filter", {
  26594. id: id
  26595. }).append(that._defs);
  26596. var componentTransferElement = that._createElement("feComponentTransfer").append(filter);
  26597. var attrs = {
  26598. type: type,
  26599. slope: slope
  26600. };
  26601. filter.id = id;
  26602. that._createElement("feFuncR", attrs).append(componentTransferElement);
  26603. that._createElement("feFuncG", attrs).append(componentTransferElement);
  26604. that._createElement("feFuncB", attrs).append(componentTransferElement);
  26605. return filter
  26606. },
  26607. getGrayScaleFilter: function() {
  26608. if (this._grayScaleFilter) {
  26609. return this._grayScaleFilter
  26610. }
  26611. var that = this;
  26612. var id = getNextDefsSvgId();
  26613. var filter = that._createElement("filter", {
  26614. id: id
  26615. }).append(that._defs);
  26616. that._createElement("feColorMatrix").attr({
  26617. type: "matrix",
  26618. values: "0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 0.6 0"
  26619. }).append(filter);
  26620. filter.id = id;
  26621. that._grayScaleFilter = filter;
  26622. return filter
  26623. },
  26624. initHatching: function() {
  26625. var storage = this._hatchingStorage = this._hatchingStorage || {
  26626. byHash: {},
  26627. baseId: getNextDefsSvgId()
  26628. };
  26629. var byHash = storage.byHash;
  26630. var name;
  26631. for (name in byHash) {
  26632. byHash[name].pattern.dispose()
  26633. }
  26634. storage.byHash = {};
  26635. storage.refToHash = {};
  26636. storage.nextId = 0
  26637. },
  26638. lockHatching: function(color, hatching, ref) {
  26639. var storage = this._hatchingStorage;
  26640. var hash = getHatchingHash(color, hatching);
  26641. var storageItem;
  26642. var pattern;
  26643. if (storage.refToHash[ref] !== hash) {
  26644. if (ref) {
  26645. this.releaseHatching(ref)
  26646. }
  26647. storageItem = storage.byHash[hash];
  26648. if (!storageItem) {
  26649. pattern = this.pattern(color, hatching, storage.baseId + "-hatching-" + storage.nextId++);
  26650. storageItem = storage.byHash[hash] = {
  26651. pattern: pattern,
  26652. count: 0
  26653. };
  26654. storage.refToHash[pattern.id] = hash
  26655. }++storageItem.count;
  26656. ref = storageItem.pattern.id
  26657. }
  26658. return ref
  26659. },
  26660. releaseHatching: function(ref) {
  26661. var storage = this._hatchingStorage;
  26662. var hash = storage.refToHash[ref];
  26663. var storageItem = storage.byHash[hash];
  26664. if (storageItem && 0 === --storageItem.count) {
  26665. storageItem.pattern.dispose();
  26666. delete storage.byHash[hash];
  26667. delete storage.refToHash[ref]
  26668. }
  26669. }
  26670. };
  26671. function getHatchingHash(color, hatching) {
  26672. return "@" + color + "::" + hatching.step + ":" + hatching.width + ":" + hatching.opacity + ":" + hatching.direction
  26673. }
  26674. var fixFuncIriCallbacks = function() {
  26675. var callbacks = [];
  26676. return {
  26677. add: function(fn) {
  26678. callbacks.push(fn)
  26679. },
  26680. remove: function(fn) {
  26681. callbacks = callbacks.filter(function(el) {
  26682. return el !== fn
  26683. })
  26684. },
  26685. removeByRenderer: function(renderer) {
  26686. callbacks = callbacks.filter(function(el) {
  26687. return el.renderer !== renderer
  26688. })
  26689. },
  26690. fire: function() {
  26691. callbacks.forEach(function(fn) {
  26692. fn()
  26693. })
  26694. }
  26695. }
  26696. }();
  26697. exports.refreshPaths = function() {
  26698. fixFuncIriCallbacks.fire()
  26699. }
  26700. },
  26701. /*!*********************************************************!*\
  26702. !*** ./artifacts/transpiled/core/polyfills/weak_map.js ***!
  26703. \*********************************************************/
  26704. /*! dynamic exports provided */
  26705. /*! all exports used */
  26706. function(module, exports, __webpack_require__) {
  26707. var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  26708. var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
  26709. var weakMap = windowUtils.hasWindow() ? windowUtils.getWindow().WeakMap : WeakMap;
  26710. if (!weakMap) {
  26711. weakMap = function() {
  26712. var keys = [];
  26713. var values = [];
  26714. this.set = function(key, value) {
  26715. var index = inArray(key, keys);
  26716. if (index === -1) {
  26717. keys.push(key);
  26718. values.push(value)
  26719. } else {
  26720. values[index] = value
  26721. }
  26722. };
  26723. this.get = function(key) {
  26724. var index = inArray(key, keys);
  26725. if (index === -1) {
  26726. return
  26727. }
  26728. return values[index]
  26729. };
  26730. this.has = function(key) {
  26731. var index = inArray(key, keys);
  26732. if (index === -1) {
  26733. return false
  26734. }
  26735. return true
  26736. };
  26737. this.delete = function(key) {
  26738. var index = inArray(key, keys);
  26739. if (index === -1) {
  26740. return
  26741. }
  26742. keys.splice(index, 1);
  26743. values.splice(index, 1)
  26744. }
  26745. }
  26746. }
  26747. module.exports = weakMap
  26748. },
  26749. /*!**********************************************************!*\
  26750. !*** ./artifacts/transpiled/core/memorized_callbacks.js ***!
  26751. \**********************************************************/
  26752. /*! dynamic exports provided */
  26753. /*! all exports used */
  26754. function(module, exports, __webpack_require__) {
  26755. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  26756. var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26);
  26757. var MemorizedCallbacks = function() {
  26758. var memory = [];
  26759. var callbacks = Callbacks();
  26760. this.add = function(fn) {
  26761. each(memory, function(_, item) {
  26762. fn.apply(fn, item)
  26763. });
  26764. callbacks.add(fn)
  26765. };
  26766. this.remove = function(fn) {
  26767. callbacks.remove(fn)
  26768. };
  26769. this.fire = function() {
  26770. memory.push(arguments);
  26771. callbacks.fire.apply(callbacks, arguments)
  26772. }
  26773. };
  26774. module.exports = MemorizedCallbacks
  26775. },
  26776. /*!*****************************************************************!*\
  26777. !*** ./artifacts/transpiled/exporter/excel_format_converter.js ***!
  26778. \*****************************************************************/
  26779. /*! dynamic exports provided */
  26780. /*! all exports used */
  26781. function(module, exports, __webpack_require__) {
  26782. var _string = __webpack_require__( /*! ../core/utils/string */ 44);
  26783. var _string2 = _interopRequireDefault(_string);
  26784. var _number = __webpack_require__( /*! ../localization/number */ 51);
  26785. var _number2 = _interopRequireDefault(_number);
  26786. var _date = __webpack_require__( /*! ../localization/date */ 32);
  26787. var _date2 = _interopRequireDefault(_date);
  26788. var _type = __webpack_require__( /*! ../core/utils/type */ 1);
  26789. var _date3 = __webpack_require__( /*! ../localization/ldml/date.format */ 208);
  26790. var _language_codes = __webpack_require__( /*! ../localization/language_codes */ 279);
  26791. __webpack_require__( /*! ../localization/currency */ 152);
  26792. function _interopRequireDefault(obj) {
  26793. return obj && obj.__esModule ? obj : {
  26794. "default": obj
  26795. }
  26796. }
  26797. var ARABIC_ZERO_CODE = 1632;
  26798. var DEFINED_NUMBER_FORMTATS = {
  26799. thousands: "#,##0{0},&quot;K&quot;",
  26800. millions: "#,##0{0},,&quot;M&quot;",
  26801. billions: "#,##0{0},,,&quot;B&quot;",
  26802. trillions: "#,##0{0},,,,&quot;T&quot;",
  26803. percent: "0{0}%",
  26804. decimal: "#{0}",
  26805. fixedpoint: "#,##0{0}",
  26806. exponential: "0{0}E+00",
  26807. currency: " "
  26808. };
  26809. var PERIOD_REGEXP = /a+/g;
  26810. var DAY_REGEXP = /E/g;
  26811. var DO_REGEXP = /dE+/g;
  26812. var STANDALONE_MONTH_REGEXP = /L/g;
  26813. var HOUR_REGEXP = /h/g;
  26814. var SLASH_REGEXP = /\//g;
  26815. var SQUARE_OPEN_BRACKET_REGEXP = /\[/g;
  26816. var SQUARE_CLOSE_BRACKET_REGEXP = /]/g;
  26817. var ANY_REGEXP = /./g;
  26818. var excelFormatConverter = module.exports = {
  26819. _applyPrecision: function(format, precision) {
  26820. var result;
  26821. var i;
  26822. if (precision > 0) {
  26823. result = "decimal" !== format ? "." : "";
  26824. for (i = 0; i < precision; i++) {
  26825. result += "0"
  26826. }
  26827. return result
  26828. }
  26829. return ""
  26830. },
  26831. _hasArabicDigits: function(text) {
  26832. var code;
  26833. for (var i = 0; i < text.length; i++) {
  26834. code = text.charCodeAt(i);
  26835. if (code >= ARABIC_ZERO_CODE && code < ARABIC_ZERO_CODE + 10) {
  26836. return true
  26837. }
  26838. }
  26839. return false
  26840. },
  26841. _convertDateFormatToOpenXml: function(format) {
  26842. return format.replace(SLASH_REGEXP, "\\/").split("'").map(function(datePart, index) {
  26843. if (index % 2 === 0) {
  26844. return datePart.replace(PERIOD_REGEXP, "AM/PM").replace(DO_REGEXP, "d").replace(DAY_REGEXP, "d").replace(STANDALONE_MONTH_REGEXP, "M").replace(HOUR_REGEXP, "H").replace(SQUARE_OPEN_BRACKET_REGEXP, "\\[").replace(SQUARE_CLOSE_BRACKET_REGEXP, "\\]")
  26845. }
  26846. if (datePart) {
  26847. return datePart.replace(ANY_REGEXP, "\\$&")
  26848. }
  26849. return "'"
  26850. }).join("")
  26851. },
  26852. _convertDateFormat: function(format) {
  26853. var formattedValue = (_date2.default.format(new Date(2009, 8, 8, 6, 5, 4), format) || "").toString();
  26854. var result = (0, _date3.getFormat)(function(value) {
  26855. return _date2.default.format(value, format)
  26856. });
  26857. if (result) {
  26858. result = this._convertDateFormatToOpenXml(result);
  26859. result = this._getLanguageInfo(formattedValue) + result
  26860. }
  26861. return result
  26862. },
  26863. _getLanguageInfo: function(defaultPattern) {
  26864. var languageID = (0, _language_codes.getLanguageId)();
  26865. var languageIDStr = languageID ? languageID.toString(16) : "";
  26866. var languageInfo = "";
  26867. if (this._hasArabicDigits(defaultPattern)) {
  26868. while (languageIDStr.length < 3) {
  26869. languageIDStr = "0" + languageIDStr
  26870. }
  26871. languageInfo = "[$-2010" + languageIDStr + "]"
  26872. } else {
  26873. if (languageIDStr) {
  26874. languageInfo = "[$-" + languageIDStr + "]"
  26875. }
  26876. }
  26877. return languageInfo
  26878. },
  26879. _convertNumberFormat: function(format, precision, currency) {
  26880. var result;
  26881. var excelFormat;
  26882. if ("currency" === format) {
  26883. excelFormat = _number2.default.getOpenXmlCurrencyFormat(currency)
  26884. } else {
  26885. excelFormat = DEFINED_NUMBER_FORMTATS[format.toLowerCase()]
  26886. }
  26887. if (excelFormat) {
  26888. result = _string2.default.format(excelFormat, this._applyPrecision(format, precision))
  26889. }
  26890. return result
  26891. },
  26892. convertFormat: function(format, precision, type, currency) {
  26893. if ((0, _type.isDefined)(format)) {
  26894. if ("date" === type) {
  26895. return excelFormatConverter._convertDateFormat(format)
  26896. } else {
  26897. if ((0, _type.isString)(format) && DEFINED_NUMBER_FORMTATS[format.toLowerCase()]) {
  26898. return excelFormatConverter._convertNumberFormat(format, precision, currency)
  26899. }
  26900. }
  26901. }
  26902. }
  26903. }
  26904. },
  26905. /*!***********************************************************!*\
  26906. !*** ./artifacts/transpiled/animation/presets/presets.js ***!
  26907. \***********************************************************/
  26908. /*! dynamic exports provided */
  26909. /*! all exports used */
  26910. function(module, exports, __webpack_require__) {
  26911. var Component = __webpack_require__( /*! ../../core/component */ 133);
  26912. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  26913. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  26914. var devices = __webpack_require__( /*! ../../core/devices */ 16);
  26915. var fx = __webpack_require__( /*! ../fx */ 38);
  26916. var directionPostfixes = {
  26917. forward: " dx-forward",
  26918. backward: " dx-backward",
  26919. none: " dx-no-direction",
  26920. undefined: " dx-no-direction"
  26921. };
  26922. var optionPrefix = "preset_";
  26923. var AnimationPresetCollection = Component.inherit({
  26924. ctor: function() {
  26925. this.callBase.apply(this, arguments);
  26926. this._registeredPresets = [];
  26927. this.resetToDefaults()
  26928. },
  26929. _getDefaultOptions: function() {
  26930. return extend(this.callBase(), {
  26931. defaultAnimationDuration: 400,
  26932. defaultAnimationDelay: 0,
  26933. defaultStaggerAnimationDuration: 300,
  26934. defaultStaggerAnimationDelay: 40,
  26935. defaultStaggerAnimationStartDelay: 500
  26936. })
  26937. },
  26938. _defaultOptionsRules: function() {
  26939. return this.callBase().concat([{
  26940. device: function(_device) {
  26941. return _device.phone
  26942. },
  26943. options: {
  26944. defaultStaggerAnimationDuration: 350,
  26945. defaultStaggerAnimationDelay: 50,
  26946. defaultStaggerAnimationStartDelay: 0
  26947. }
  26948. }, {
  26949. device: function() {
  26950. return devices.current().android || devices.real.android
  26951. },
  26952. options: {
  26953. defaultAnimationDelay: 100
  26954. }
  26955. }])
  26956. },
  26957. _getPresetOptionName: function(animationName) {
  26958. return optionPrefix + animationName
  26959. },
  26960. _createAndroidSlideAnimationConfig: function(throughOpacity, widthMultiplier) {
  26961. var that = this;
  26962. var createBaseConfig = function(configModifier) {
  26963. return {
  26964. type: "slide",
  26965. delay: void 0 === configModifier.delay ? that.option("defaultAnimationDelay") : configModifier.delay,
  26966. duration: void 0 === configModifier.duration ? that.option("defaultAnimationDuration") : configModifier.duration
  26967. }
  26968. };
  26969. return {
  26970. enter: function($element, configModifier) {
  26971. var width = $element.parent().width() * widthMultiplier;
  26972. var direction = configModifier.direction;
  26973. var config = createBaseConfig(configModifier);
  26974. config.to = {
  26975. left: 0,
  26976. opacity: 1
  26977. };
  26978. if ("forward" === direction) {
  26979. config.from = {
  26980. left: width,
  26981. opacity: throughOpacity
  26982. }
  26983. } else {
  26984. if ("backward" === direction) {
  26985. config.from = {
  26986. left: -width,
  26987. opacity: throughOpacity
  26988. }
  26989. } else {
  26990. config.from = {
  26991. left: 0,
  26992. opacity: 0
  26993. }
  26994. }
  26995. }
  26996. return fx.createAnimation($element, config)
  26997. },
  26998. leave: function($element, configModifier) {
  26999. var width = $element.parent().width() * widthMultiplier;
  27000. var direction = configModifier.direction;
  27001. var config = createBaseConfig(configModifier);
  27002. config.from = {
  27003. left: 0,
  27004. opacity: 1
  27005. };
  27006. if ("forward" === direction) {
  27007. config.to = {
  27008. left: -width,
  27009. opacity: throughOpacity
  27010. }
  27011. } else {
  27012. if ("backward" === direction) {
  27013. config.to = {
  27014. left: width,
  27015. opacity: throughOpacity
  27016. }
  27017. } else {
  27018. config.to = {
  27019. left: 0,
  27020. opacity: 0
  27021. }
  27022. }
  27023. }
  27024. return fx.createAnimation($element, config)
  27025. }
  27026. }
  27027. },
  27028. _createOpenDoorConfig: function() {
  27029. var that = this;
  27030. var createBaseConfig = function(configModifier) {
  27031. return {
  27032. type: "css",
  27033. extraCssClasses: "dx-opendoor-animation",
  27034. delay: void 0 === configModifier.delay ? that.option("defaultAnimationDelay") : configModifier.delay,
  27035. duration: void 0 === configModifier.duration ? that.option("defaultAnimationDuration") : configModifier.duration
  27036. }
  27037. };
  27038. return {
  27039. enter: function($element, configModifier) {
  27040. var direction = configModifier.direction;
  27041. var config = createBaseConfig(configModifier);
  27042. config.delay = "none" === direction ? config.delay : config.duration;
  27043. config.from = "dx-enter dx-opendoor-animation" + directionPostfixes[direction];
  27044. config.to = "dx-enter-active";
  27045. return fx.createAnimation($element, config)
  27046. },
  27047. leave: function($element, configModifier) {
  27048. var direction = configModifier.direction;
  27049. var config = createBaseConfig(configModifier);
  27050. config.from = "dx-leave dx-opendoor-animation" + directionPostfixes[direction];
  27051. config.to = "dx-leave-active";
  27052. return fx.createAnimation($element, config)
  27053. }
  27054. }
  27055. },
  27056. _createWinPopConfig: function() {
  27057. var that = this;
  27058. var baseConfig = {
  27059. type: "css",
  27060. extraCssClasses: "dx-win-pop-animation",
  27061. duration: that.option("defaultAnimationDuration")
  27062. };
  27063. return {
  27064. enter: function($element, configModifier) {
  27065. var config = baseConfig;
  27066. var direction = configModifier.direction;
  27067. config.delay = "none" === direction ? that.option("defaultAnimationDelay") : that.option("defaultAnimationDuration") / 2;
  27068. config.from = "dx-enter dx-win-pop-animation" + directionPostfixes[direction];
  27069. config.to = "dx-enter-active";
  27070. return fx.createAnimation($element, config)
  27071. },
  27072. leave: function($element, configModifier) {
  27073. var config = baseConfig;
  27074. var direction = configModifier.direction;
  27075. config.delay = that.option("defaultAnimationDelay");
  27076. config.from = "dx-leave dx-win-pop-animation" + directionPostfixes[direction];
  27077. config.to = "dx-leave-active";
  27078. return fx.createAnimation($element, config)
  27079. }
  27080. }
  27081. },
  27082. resetToDefaults: function() {
  27083. this.clear();
  27084. this.registerDefaultPresets();
  27085. this.applyChanges()
  27086. },
  27087. clear: function(name) {
  27088. var that = this;
  27089. var newRegisteredPresets = [];
  27090. each(this._registeredPresets, function(index, preset) {
  27091. if (!name || name === preset.name) {
  27092. that.option(that._getPresetOptionName(preset.name), void 0)
  27093. } else {
  27094. newRegisteredPresets.push(preset)
  27095. }
  27096. });
  27097. this._registeredPresets = newRegisteredPresets;
  27098. this.applyChanges()
  27099. },
  27100. registerPreset: function(name, config) {
  27101. this._registeredPresets.push({
  27102. name: name,
  27103. config: config
  27104. })
  27105. },
  27106. applyChanges: function() {
  27107. var that = this;
  27108. var customRules = [];
  27109. each(this._registeredPresets, function(index, preset) {
  27110. var rule = {
  27111. device: preset.config.device,
  27112. options: {}
  27113. };
  27114. rule.options[that._getPresetOptionName(preset.name)] = preset.config.animation;
  27115. customRules.push(rule)
  27116. });
  27117. this._setOptionsByDevice(customRules)
  27118. },
  27119. getPreset: function(name) {
  27120. var result = name;
  27121. while ("string" === typeof result) {
  27122. result = this.option(this._getPresetOptionName(result))
  27123. }
  27124. return result
  27125. },
  27126. registerDefaultPresets: function() {
  27127. this.registerPreset("pop", {
  27128. animation: {
  27129. extraCssClasses: "dx-android-pop-animation",
  27130. delay: this.option("defaultAnimationDelay"),
  27131. duration: this.option("defaultAnimationDuration")
  27132. }
  27133. });
  27134. this.registerPreset("openDoor", {
  27135. animation: this._createOpenDoorConfig()
  27136. });
  27137. this.registerPreset("win-pop", {
  27138. animation: this._createWinPopConfig()
  27139. });
  27140. this.registerPreset("fade", {
  27141. animation: {
  27142. extraCssClasses: "dx-fade-animation",
  27143. delay: this.option("defaultAnimationDelay"),
  27144. duration: this.option("defaultAnimationDuration")
  27145. }
  27146. });
  27147. this.registerPreset("slide", {
  27148. device: function() {
  27149. return devices.current().android || devices.real.android
  27150. },
  27151. animation: this._createAndroidSlideAnimationConfig(1, 1)
  27152. });
  27153. this.registerPreset("slide", {
  27154. device: function() {
  27155. return !devices.current().android && !devices.real.android
  27156. },
  27157. animation: {
  27158. extraCssClasses: "dx-slide-animation",
  27159. delay: this.option("defaultAnimationDelay"),
  27160. duration: this.option("defaultAnimationDuration")
  27161. }
  27162. });
  27163. this.registerPreset("ios7-slide", {
  27164. animation: {
  27165. extraCssClasses: "dx-ios7-slide-animation",
  27166. delay: this.option("defaultAnimationDelay"),
  27167. duration: this.option("defaultAnimationDuration")
  27168. }
  27169. });
  27170. this.registerPreset("overflow", {
  27171. animation: {
  27172. extraCssClasses: "dx-overflow-animation",
  27173. delay: this.option("defaultAnimationDelay"),
  27174. duration: this.option("defaultAnimationDuration")
  27175. }
  27176. });
  27177. this.registerPreset("ios7-toolbar", {
  27178. device: function() {
  27179. return !devices.current().android && !devices.real.android
  27180. },
  27181. animation: {
  27182. extraCssClasses: "dx-ios7-toolbar-animation",
  27183. delay: this.option("defaultAnimationDelay"),
  27184. duration: this.option("defaultAnimationDuration")
  27185. }
  27186. });
  27187. this.registerPreset("ios7-toolbar", {
  27188. device: function() {
  27189. return devices.current().android || devices.real.android
  27190. },
  27191. animation: this._createAndroidSlideAnimationConfig(0, .4)
  27192. });
  27193. this.registerPreset("stagger-fade", {
  27194. animation: {
  27195. extraCssClasses: "dx-fade-animation",
  27196. staggerDelay: this.option("defaultStaggerAnimationDelay"),
  27197. duration: this.option("defaultStaggerAnimationDuration"),
  27198. delay: this.option("defaultStaggerAnimationStartDelay")
  27199. }
  27200. });
  27201. this.registerPreset("stagger-slide", {
  27202. animation: {
  27203. extraCssClasses: "dx-slide-animation",
  27204. staggerDelay: this.option("defaultStaggerAnimationDelay"),
  27205. duration: this.option("defaultStaggerAnimationDuration"),
  27206. delay: this.option("defaultStaggerAnimationStartDelay")
  27207. }
  27208. });
  27209. this.registerPreset("stagger-fade-slide", {
  27210. animation: {
  27211. extraCssClasses: "dx-fade-slide-animation",
  27212. staggerDelay: this.option("defaultStaggerAnimationDelay"),
  27213. duration: this.option("defaultStaggerAnimationDuration"),
  27214. delay: this.option("defaultStaggerAnimationStartDelay")
  27215. }
  27216. });
  27217. this.registerPreset("stagger-drop", {
  27218. animation: {
  27219. extraCssClasses: "dx-drop-animation",
  27220. staggerDelay: this.option("defaultStaggerAnimationDelay"),
  27221. duration: this.option("defaultStaggerAnimationDuration"),
  27222. delay: this.option("defaultStaggerAnimationStartDelay")
  27223. }
  27224. });
  27225. this.registerPreset("stagger-fade-drop", {
  27226. animation: {
  27227. extraCssClasses: "dx-fade-drop-animation",
  27228. staggerDelay: this.option("defaultStaggerAnimationDelay"),
  27229. duration: this.option("defaultStaggerAnimationDuration"),
  27230. delay: this.option("defaultStaggerAnimationStartDelay")
  27231. }
  27232. });
  27233. this.registerPreset("stagger-fade-rise", {
  27234. animation: {
  27235. extraCssClasses: "dx-fade-rise-animation",
  27236. staggerDelay: this.option("defaultStaggerAnimationDelay"),
  27237. duration: this.option("defaultStaggerAnimationDuration"),
  27238. delay: this.option("defaultStaggerAnimationStartDelay")
  27239. }
  27240. });
  27241. this.registerPreset("stagger-3d-drop", {
  27242. animation: {
  27243. extraCssClasses: "dx-3d-drop-animation",
  27244. staggerDelay: this.option("defaultStaggerAnimationDelay"),
  27245. duration: this.option("defaultStaggerAnimationDuration"),
  27246. delay: this.option("defaultStaggerAnimationStartDelay")
  27247. }
  27248. });
  27249. this.registerPreset("stagger-fade-zoom", {
  27250. animation: {
  27251. extraCssClasses: "dx-fade-zoom-animation",
  27252. staggerDelay: this.option("defaultStaggerAnimationDelay"),
  27253. duration: this.option("defaultStaggerAnimationDuration"),
  27254. delay: this.option("defaultStaggerAnimationStartDelay")
  27255. }
  27256. })
  27257. }
  27258. });
  27259. exports.PresetCollection = AnimationPresetCollection;
  27260. var animationPresets = new AnimationPresetCollection;
  27261. exports.presets = animationPresets
  27262. },
  27263. /*!************************************************************!*\
  27264. !*** ./artifacts/transpiled/integration/angular/module.js ***!
  27265. \************************************************************/
  27266. /*! dynamic exports provided */
  27267. /*! all exports used */
  27268. function(module, exports, __webpack_require__) {
  27269. var angular = __webpack_require__( /*! angular */ 270);
  27270. module.exports = angular.module("dx", [])
  27271. },
  27272. /*!*****************************************************!*\
  27273. !*** ./artifacts/transpiled/data/query_adapters.js ***!
  27274. \*****************************************************/
  27275. /*! dynamic exports provided */
  27276. /*! all exports used */
  27277. function(module, exports, __webpack_require__) {
  27278. module.exports = {}
  27279. },
  27280. /*!****************************************************************************************!*\
  27281. !*** ./artifacts/transpiled/ui/collection/ui.collection_widget.edit.strategy.plain.js ***!
  27282. \****************************************************************************************/
  27283. /*! dynamic exports provided */
  27284. /*! all exports used */
  27285. function(module, exports, __webpack_require__) {
  27286. function _typeof(obj) {
  27287. "@babel/helpers - typeof";
  27288. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  27289. return typeof obj
  27290. } : function(obj) {
  27291. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  27292. }, _typeof(obj)
  27293. }
  27294. var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  27295. var EditStrategy = __webpack_require__( /*! ./ui.collection_widget.edit.strategy */ 469);
  27296. var PlainEditStrategy = EditStrategy.inherit({
  27297. _getPlainItems: function() {
  27298. return this._collectionWidget.option("items") || []
  27299. },
  27300. getIndexByItemData: function(itemData) {
  27301. var keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget);
  27302. if (keyOf) {
  27303. return this.getIndexByKey(keyOf(itemData))
  27304. } else {
  27305. return inArray(itemData, this._getPlainItems())
  27306. }
  27307. },
  27308. getItemDataByIndex: function(index) {
  27309. return this._getPlainItems()[index]
  27310. },
  27311. deleteItemAtIndex: function(index) {
  27312. this._getPlainItems().splice(index, 1)
  27313. },
  27314. itemsGetter: function() {
  27315. return this._getPlainItems()
  27316. },
  27317. getKeysByItems: function(items) {
  27318. var keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget);
  27319. var result = items;
  27320. if (keyOf) {
  27321. result = [];
  27322. for (var i = 0; i < items.length; i++) {
  27323. result.push(keyOf(items[i]))
  27324. }
  27325. }
  27326. return result
  27327. },
  27328. getIndexByKey: function(key) {
  27329. var cache = this._cache;
  27330. var keys = cache && cache.keys || this.getKeysByItems(this._getPlainItems());
  27331. if (cache && !cache.keys) {
  27332. cache.keys = keys
  27333. }
  27334. if ("object" === _typeof(key)) {
  27335. for (var i = 0, length = keys.length; i < length; i++) {
  27336. if (this._equalKeys(key, keys[i])) {
  27337. return i
  27338. }
  27339. }
  27340. } else {
  27341. return keys.indexOf(key)
  27342. }
  27343. return -1
  27344. },
  27345. getItemsByKeys: function(keys, items) {
  27346. return (items || keys).slice()
  27347. },
  27348. moveItemAtIndexToIndex: function(movingIndex, destinationIndex) {
  27349. var items = this._getPlainItems();
  27350. var movedItemData = items[movingIndex];
  27351. items.splice(movingIndex, 1);
  27352. items.splice(destinationIndex, 0, movedItemData)
  27353. },
  27354. _isItemIndex: function(index) {
  27355. return "number" === typeof index && Math.round(index) === index
  27356. },
  27357. _getNormalizedItemIndex: function(itemElement) {
  27358. return this._collectionWidget._itemElements().index(itemElement)
  27359. },
  27360. _normalizeItemIndex: function(index) {
  27361. return index
  27362. },
  27363. _denormalizeItemIndex: function(index) {
  27364. return index
  27365. },
  27366. _getItemByNormalizedIndex: function(index) {
  27367. return index > -1 ? this._collectionWidget._itemElements().eq(index) : null
  27368. },
  27369. _itemsFromSameParent: function() {
  27370. return true
  27371. }
  27372. });
  27373. module.exports = PlainEditStrategy
  27374. },
  27375. /*!***************************************************************!*\
  27376. !*** ./artifacts/transpiled/localization/globalize/number.js ***!
  27377. \***************************************************************/
  27378. /*! dynamic exports provided */
  27379. /*! all exports used */
  27380. function(module, exports, __webpack_require__) {
  27381. function _typeof(obj) {
  27382. "@babel/helpers - typeof";
  27383. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  27384. return typeof obj
  27385. } : function(obj) {
  27386. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  27387. }, _typeof(obj)
  27388. }
  27389. __webpack_require__( /*! ./core */ 127);
  27390. var Globalize = __webpack_require__( /*! globalize */ 72);
  27391. var numberLocalization = __webpack_require__( /*! ../number */ 51);
  27392. var errors = __webpack_require__( /*! ../../core/errors */ 21);
  27393. __webpack_require__( /*! globalize/number */ 72);
  27394. if (Globalize && Globalize.formatNumber) {
  27395. var enNumbers = {
  27396. main: {
  27397. en: {
  27398. identity: {
  27399. version: {
  27400. _cldrVersion: "28",
  27401. _number: "$Revision: 11972 $"
  27402. },
  27403. language: "en"
  27404. },
  27405. numbers: {
  27406. defaultNumberingSystem: "latn",
  27407. otherNumberingSystems: {
  27408. "native": "latn"
  27409. },
  27410. minimumGroupingDigits: "1",
  27411. "symbols-numberSystem-latn": {
  27412. decimal: ".",
  27413. group: ",",
  27414. list: ";",
  27415. percentSign: "%",
  27416. plusSign: "+",
  27417. minusSign: "-",
  27418. exponential: "E",
  27419. superscriptingExponent: "\xd7",
  27420. perMille: "\u2030",
  27421. infinity: "\u221e",
  27422. nan: "NaN",
  27423. timeSeparator: ":"
  27424. },
  27425. "decimalFormats-numberSystem-latn": {
  27426. standard: "#,##0.###",
  27427. "long": {
  27428. decimalFormat: {
  27429. "1000-count-one": "0 thousand",
  27430. "1000-count-other": "0 thousand",
  27431. "10000-count-one": "00 thousand",
  27432. "10000-count-other": "00 thousand",
  27433. "100000-count-one": "000 thousand",
  27434. "100000-count-other": "000 thousand",
  27435. "1000000-count-one": "0 million",
  27436. "1000000-count-other": "0 million",
  27437. "10000000-count-one": "00 million",
  27438. "10000000-count-other": "00 million",
  27439. "100000000-count-one": "000 million",
  27440. "100000000-count-other": "000 million",
  27441. "1000000000-count-one": "0 billion",
  27442. "1000000000-count-other": "0 billion",
  27443. "10000000000-count-one": "00 billion",
  27444. "10000000000-count-other": "00 billion",
  27445. "100000000000-count-one": "000 billion",
  27446. "100000000000-count-other": "000 billion",
  27447. "1000000000000-count-one": "0 trillion",
  27448. "1000000000000-count-other": "0 trillion",
  27449. "10000000000000-count-one": "00 trillion",
  27450. "10000000000000-count-other": "00 trillion",
  27451. "100000000000000-count-one": "000 trillion",
  27452. "100000000000000-count-other": "000 trillion"
  27453. }
  27454. },
  27455. "short": {
  27456. decimalFormat: {
  27457. "1000-count-one": "0K",
  27458. "1000-count-other": "0K",
  27459. "10000-count-one": "00K",
  27460. "10000-count-other": "00K",
  27461. "100000-count-one": "000K",
  27462. "100000-count-other": "000K",
  27463. "1000000-count-one": "0M",
  27464. "1000000-count-other": "0M",
  27465. "10000000-count-one": "00M",
  27466. "10000000-count-other": "00M",
  27467. "100000000-count-one": "000M",
  27468. "100000000-count-other": "000M",
  27469. "1000000000-count-one": "0B",
  27470. "1000000000-count-other": "0B",
  27471. "10000000000-count-one": "00B",
  27472. "10000000000-count-other": "00B",
  27473. "100000000000-count-one": "000B",
  27474. "100000000000-count-other": "000B",
  27475. "1000000000000-count-one": "0T",
  27476. "1000000000000-count-other": "0T",
  27477. "10000000000000-count-one": "00T",
  27478. "10000000000000-count-other": "00T",
  27479. "100000000000000-count-one": "000T",
  27480. "100000000000000-count-other": "000T"
  27481. }
  27482. }
  27483. },
  27484. "scientificFormats-numberSystem-latn": {
  27485. standard: "#E0"
  27486. },
  27487. "percentFormats-numberSystem-latn": {
  27488. standard: "#,##0%"
  27489. },
  27490. "currencyFormats-numberSystem-latn": {
  27491. currencySpacing: {
  27492. beforeCurrency: {
  27493. currencyMatch: "[:^S:]",
  27494. surroundingMatch: "[:digit:]",
  27495. insertBetween: "\xa0"
  27496. },
  27497. afterCurrency: {
  27498. currencyMatch: "[:^S:]",
  27499. surroundingMatch: "[:digit:]",
  27500. insertBetween: "\xa0"
  27501. }
  27502. },
  27503. standard: "\xa4#,##0.00",
  27504. accounting: "\xa4#,##0.00;(\xa4#,##0.00)",
  27505. "short": {
  27506. standard: {
  27507. "1000-count-one": "\xa40K",
  27508. "1000-count-other": "\xa40K",
  27509. "10000-count-one": "\xa400K",
  27510. "10000-count-other": "\xa400K",
  27511. "100000-count-one": "\xa4000K",
  27512. "100000-count-other": "\xa4000K",
  27513. "1000000-count-one": "\xa40M",
  27514. "1000000-count-other": "\xa40M",
  27515. "10000000-count-one": "\xa400M",
  27516. "10000000-count-other": "\xa400M",
  27517. "100000000-count-one": "\xa4000M",
  27518. "100000000-count-other": "\xa4000M",
  27519. "1000000000-count-one": "\xa40B",
  27520. "1000000000-count-other": "\xa40B",
  27521. "10000000000-count-one": "\xa400B",
  27522. "10000000000-count-other": "\xa400B",
  27523. "100000000000-count-one": "\xa4000B",
  27524. "100000000000-count-other": "\xa4000B",
  27525. "1000000000000-count-one": "\xa40T",
  27526. "1000000000000-count-other": "\xa40T",
  27527. "10000000000000-count-one": "\xa400T",
  27528. "10000000000000-count-other": "\xa400T",
  27529. "100000000000000-count-one": "\xa4000T",
  27530. "100000000000000-count-other": "\xa4000T"
  27531. }
  27532. },
  27533. "unitPattern-count-one": "{0} {1}",
  27534. "unitPattern-count-other": "{0} {1}"
  27535. },
  27536. "miscPatterns-numberSystem-latn": {
  27537. atLeast: "{0}+",
  27538. range: "{0}\u2013{1}"
  27539. }
  27540. }
  27541. }
  27542. }
  27543. };
  27544. if ("en" === Globalize.locale().locale) {
  27545. Globalize.load(enNumbers);
  27546. Globalize.locale("en")
  27547. }
  27548. var formattersCache = {};
  27549. var getFormatter = function(format) {
  27550. var formatter;
  27551. var formatCacheKey;
  27552. if ("object" === _typeof(format)) {
  27553. formatCacheKey = Globalize.locale().locale + ":" + JSON.stringify(format)
  27554. } else {
  27555. formatCacheKey = Globalize.locale().locale + ":" + format
  27556. }
  27557. formatter = formattersCache[formatCacheKey];
  27558. if (!formatter) {
  27559. formatter = formattersCache[formatCacheKey] = Globalize.numberFormatter(format)
  27560. }
  27561. return formatter
  27562. };
  27563. var globalizeNumberLocalization = {
  27564. _formatNumberCore: function(value, format, formatConfig) {
  27565. if ("exponential" === format) {
  27566. return this.callBase.apply(this, arguments)
  27567. }
  27568. return getFormatter(this._normalizeFormatConfig(format, formatConfig, value))(value)
  27569. },
  27570. _normalizeFormatConfig: function(format, formatConfig, value) {
  27571. var config;
  27572. if ("decimal" === format) {
  27573. config = {
  27574. minimumIntegerDigits: formatConfig.precision || 1,
  27575. useGrouping: false,
  27576. minimumFractionDigits: 0,
  27577. maximumFractionDigits: 20,
  27578. round: value < 0 ? "ceil" : "floor"
  27579. }
  27580. } else {
  27581. config = this._getPrecisionConfig(formatConfig.precision)
  27582. }
  27583. if ("percent" === format) {
  27584. config.style = "percent"
  27585. }
  27586. return config
  27587. },
  27588. _getPrecisionConfig: function(precision) {
  27589. var config;
  27590. if (null === precision) {
  27591. config = {
  27592. minimumFractionDigits: 0,
  27593. maximumFractionDigits: 20
  27594. }
  27595. } else {
  27596. config = {
  27597. minimumFractionDigits: precision || 0,
  27598. maximumFractionDigits: precision || 0
  27599. }
  27600. }
  27601. return config
  27602. },
  27603. format: function(value, _format) {
  27604. if ("number" !== typeof value) {
  27605. return value
  27606. }
  27607. _format = this._normalizeFormat(_format);
  27608. if (!_format || "function" !== typeof _format && !_format.type && !_format.formatter) {
  27609. return getFormatter(_format)(value)
  27610. }
  27611. return this.callBase.apply(this, arguments)
  27612. },
  27613. parse: function(text, format) {
  27614. if (!text) {
  27615. return
  27616. }
  27617. if (format && (format.parser || "string" === typeof format)) {
  27618. return this.callBase.apply(this, arguments)
  27619. }
  27620. if (format) {
  27621. errors.log("W0011")
  27622. }
  27623. var result = Globalize.parseNumber(text);
  27624. if (isNaN(result)) {
  27625. result = this.callBase.apply(this, arguments)
  27626. }
  27627. return result
  27628. }
  27629. };
  27630. numberLocalization.inject(globalizeNumberLocalization)
  27631. }
  27632. }, , , , , , , , , , , , , , , , , ,
  27633. /*!*******************************************************!*\
  27634. !*** ./artifacts/transpiled/viz/components/legend.js ***!
  27635. \*******************************************************/
  27636. /*! dynamic exports provided */
  27637. /*! all exports used */
  27638. function(module, exports, __webpack_require__) {
  27639. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  27640. var _extend2 = __webpack_require__( /*! ../../core/utils/extend */ 0);
  27641. var _layout_element = __webpack_require__( /*! ../core/layout_element */ 242);
  27642. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  27643. var _title = __webpack_require__( /*! ../core/title */ 105);
  27644. var _title2 = _interopRequireDefault(_title);
  27645. var _object = __webpack_require__( /*! ../../core/utils/object */ 47);
  27646. var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
  27647. function _interopRequireDefault(obj) {
  27648. return obj && obj.__esModule ? obj : {
  27649. "default": obj
  27650. }
  27651. }
  27652. var _Number = Number;
  27653. var _math = Math;
  27654. var _round = _math.round;
  27655. var _max = _math.max;
  27656. var _min = _math.min;
  27657. var _ceil = _math.ceil;
  27658. var _isDefined = _type.isDefined;
  27659. var _isFunction = _type.isFunction;
  27660. var _enumParser = _utils.enumParser;
  27661. var _normalizeEnum = _utils.normalizeEnum;
  27662. var _extend = _extend2.extend;
  27663. var DEFAULT_MARGIN = 10;
  27664. var DEFAULT_MARKER_HATCHING_WIDTH = 2;
  27665. var DEFAULT_MARKER_HATCHING_STEP = 5;
  27666. var CENTER = "center";
  27667. var RIGHT = "right";
  27668. var LEFT = "left";
  27669. var TOP = "top";
  27670. var BOTTOM = "bottom";
  27671. var HORIZONTAL = "horizontal";
  27672. var VERTICAL = "vertical";
  27673. var INSIDE = "inside";
  27674. var OUTSIDE = "outside";
  27675. var NONE = "none";
  27676. var HEIGHT = "height";
  27677. var WIDTH = "width";
  27678. var parseHorizontalAlignment = _enumParser([LEFT, CENTER, RIGHT]);
  27679. var parseVerticalAlignment = _enumParser([TOP, BOTTOM]);
  27680. var parseOrientation = _enumParser([VERTICAL, HORIZONTAL]);
  27681. var parseItemTextPosition = _enumParser([LEFT, RIGHT, TOP, BOTTOM]);
  27682. var parsePosition = _enumParser([OUTSIDE, INSIDE]);
  27683. var parseItemsAlignment = _enumParser([LEFT, CENTER, RIGHT]);
  27684. function getState(state, color) {
  27685. if (!state) {
  27686. return
  27687. }
  27688. var colorFromAction = state.fill;
  27689. return {
  27690. fill: colorFromAction === NONE ? color : colorFromAction,
  27691. hatching: _extend({}, state.hatching, {
  27692. step: DEFAULT_MARKER_HATCHING_STEP,
  27693. width: DEFAULT_MARKER_HATCHING_WIDTH
  27694. })
  27695. }
  27696. }
  27697. function parseMargins(options) {
  27698. var margin = options.margin;
  27699. if (margin >= 0) {
  27700. margin = _Number(options.margin);
  27701. margin = {
  27702. top: margin,
  27703. bottom: margin,
  27704. left: margin,
  27705. right: margin
  27706. }
  27707. } else {
  27708. margin = {
  27709. top: margin.top >= 0 ? _Number(margin.top) : DEFAULT_MARGIN,
  27710. bottom: margin.bottom >= 0 ? _Number(margin.bottom) : DEFAULT_MARGIN,
  27711. left: margin.left >= 0 ? _Number(margin.left) : DEFAULT_MARGIN,
  27712. right: margin.right >= 0 ? _Number(margin.right) : DEFAULT_MARGIN
  27713. }
  27714. }
  27715. options.margin = margin
  27716. }
  27717. function getSizeItem(options, markerSize, labelBBox) {
  27718. var defaultXMargin = 7;
  27719. var defaultTopMargin = 4;
  27720. var width;
  27721. var height;
  27722. switch (options.itemTextPosition) {
  27723. case LEFT:
  27724. case RIGHT:
  27725. width = markerSize + defaultXMargin + labelBBox.width;
  27726. height = _max(markerSize, labelBBox.height);
  27727. break;
  27728. case TOP:
  27729. case BOTTOM:
  27730. width = _max(markerSize, labelBBox.width);
  27731. height = markerSize + defaultTopMargin + labelBBox.height
  27732. }
  27733. return {
  27734. width: width,
  27735. height: height
  27736. }
  27737. }
  27738. function calculateBBoxLabelAndMarker(markerBBox, labelBBox) {
  27739. var bBox = {};
  27740. bBox.left = _min(markerBBox.x, labelBBox.x);
  27741. bBox.top = _min(markerBBox.y, labelBBox.y);
  27742. bBox.right = _max(markerBBox.x + markerBBox.width, labelBBox.x + labelBBox.width);
  27743. bBox.bottom = _max(markerBBox.y + markerBBox.height, labelBBox.y + labelBBox.height);
  27744. return bBox
  27745. }
  27746. function applyMarkerState(id, idToIndexMap, items, stateName) {
  27747. var item = idToIndexMap && items[idToIndexMap[id]];
  27748. if (item) {
  27749. item.marker.smartAttr(item.states[stateName])
  27750. }
  27751. }
  27752. function parseOptions(options, textField, allowInsidePosition) {
  27753. if (!options) {
  27754. return null
  27755. }
  27756. var debug = __webpack_require__( /*! ../../core/utils/console */ 73).debug;
  27757. debug.assertParam(options.visible, "Visibility was not passed");
  27758. debug.assertParam(options.markerSize, "markerSize was not passed");
  27759. debug.assertParam(options.font.color, "fontColor was not passed");
  27760. debug.assertParam(options.font.family, "fontFamily was not passed");
  27761. debug.assertParam(options.font.size, "fontSize was not passed");
  27762. debug.assertParam(options.paddingLeftRight, "paddingLeftRight was not passed");
  27763. debug.assertParam(options.paddingTopBottom, "paddingTopBottom was not passed");
  27764. debug.assertParam(options.columnItemSpacing, "columnItemSpacing was not passed");
  27765. debug.assertParam(options.rowItemSpacing, "rowItemSpacing was not passed");
  27766. parseMargins(options);
  27767. options.horizontalAlignment = parseHorizontalAlignment(options.horizontalAlignment, RIGHT);
  27768. options.verticalAlignment = parseVerticalAlignment(options.verticalAlignment, options.horizontalAlignment === CENTER ? BOTTOM : TOP);
  27769. options.orientation = parseOrientation(options.orientation, options.horizontalAlignment === CENTER ? HORIZONTAL : VERTICAL);
  27770. options.itemTextPosition = parseItemTextPosition(options.itemTextPosition, options.orientation === HORIZONTAL ? BOTTOM : RIGHT);
  27771. options.position = allowInsidePosition ? parsePosition(options.position, OUTSIDE) : OUTSIDE;
  27772. options.itemsAlignment = parseItemsAlignment(options.itemsAlignment, null);
  27773. options.hoverMode = _normalizeEnum(options.hoverMode);
  27774. options.customizeText = _isFunction(options.customizeText) ? options.customizeText : function() {
  27775. return this[textField]
  27776. };
  27777. options.customizeHint = _isFunction(options.customizeHint) ? options.customizeHint : _common.noop;
  27778. options._incidentOccurred = options._incidentOccurred || _common.noop;
  27779. return options
  27780. }
  27781. function createSquareMarker(renderer, size) {
  27782. return renderer.rect(0, 0, size, size)
  27783. }
  27784. function createCircleMarker(renderer, size) {
  27785. return renderer.circle(size / 2, size / 2, size / 2)
  27786. }
  27787. function isCircle(type) {
  27788. return "circle" === _normalizeEnum(type)
  27789. }
  27790. function inRect(rect, x, y) {
  27791. return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom
  27792. }
  27793. function checkLinesSize(lines, layoutOptions, countItems, margins) {
  27794. var position = {
  27795. x: 0,
  27796. y: 0
  27797. };
  27798. var maxMeasureLength = 0;
  27799. var maxAltMeasureLength = 0;
  27800. var margin = 0;
  27801. if ("y" === layoutOptions.direction) {
  27802. margin = margins.top + margins.bottom
  27803. } else {
  27804. margin = margins.left + margins.right
  27805. }
  27806. lines.forEach(function(line, i) {
  27807. var firstItem = line[0];
  27808. var lineLength = line.length;
  27809. line.forEach(function(item, index) {
  27810. var offset = item.offset || layoutOptions.spacing;
  27811. position[layoutOptions.direction] += item[layoutOptions.measure] + (index !== lineLength - 1 ? offset : 0);
  27812. maxMeasureLength = _max(maxMeasureLength, position[layoutOptions.direction])
  27813. });
  27814. position[layoutOptions.direction] = 0;
  27815. position[layoutOptions.altDirection] += firstItem[layoutOptions.altMeasure] + firstItem.altOffset || layoutOptions.altSpacing;
  27816. maxAltMeasureLength = _max(maxAltMeasureLength, position[layoutOptions.altDirection])
  27817. });
  27818. if (maxMeasureLength + margin > layoutOptions.length) {
  27819. layoutOptions.countItem = decreaseItemCount(layoutOptions, countItems);
  27820. return true
  27821. }
  27822. }
  27823. function decreaseItemCount(layoutOptions, countItems) {
  27824. layoutOptions.altCountItem++;
  27825. return _ceil(countItems / layoutOptions.altCountItem)
  27826. }
  27827. function getLineLength(line, layoutOptions) {
  27828. return line.reduce(function(lineLength, item) {
  27829. var offset = item.offset || layoutOptions.spacing;
  27830. return lineLength + item[layoutOptions.measure] + offset
  27831. }, 0)
  27832. }
  27833. function getMaxLineLength(lines, layoutOptions) {
  27834. return lines.reduce(function(maxLineLength, line) {
  27835. return _max(maxLineLength, getLineLength(line, layoutOptions))
  27836. }, 0)
  27837. }
  27838. function getInitPositionForDirection(line, layoutOptions, maxLineLength) {
  27839. var lineLength = getLineLength(line, layoutOptions);
  27840. var initPosition;
  27841. switch (layoutOptions.itemsAlignment) {
  27842. case RIGHT:
  27843. initPosition = maxLineLength - lineLength;
  27844. break;
  27845. case CENTER:
  27846. initPosition = (maxLineLength - lineLength) / 2;
  27847. break;
  27848. default:
  27849. initPosition = 0
  27850. }
  27851. return initPosition
  27852. }
  27853. function getPos(layoutOptions) {
  27854. switch (layoutOptions.itemTextPosition) {
  27855. case BOTTOM:
  27856. return {
  27857. horizontal: CENTER, vertical: TOP
  27858. };
  27859. case TOP:
  27860. return {
  27861. horizontal: CENTER, vertical: BOTTOM
  27862. };
  27863. case LEFT:
  27864. return {
  27865. horizontal: RIGHT, vertical: CENTER
  27866. };
  27867. case RIGHT:
  27868. return {
  27869. horizontal: LEFT, vertical: CENTER
  27870. }
  27871. }
  27872. }
  27873. function getLines(lines, layoutOptions, itemIndex) {
  27874. var tableLine = {};
  27875. if (itemIndex % layoutOptions.countItem === 0) {
  27876. if (layoutOptions.markerOffset) {
  27877. lines.push([], [])
  27878. } else {
  27879. lines.push([])
  27880. }
  27881. }
  27882. if (layoutOptions.markerOffset) {
  27883. tableLine.firstLine = lines[lines.length - 1];
  27884. tableLine.secondLine = lines[lines.length - 2]
  27885. } else {
  27886. tableLine.firstLine = tableLine.secondLine = lines[lines.length - 1]
  27887. }
  27888. return tableLine
  27889. }
  27890. function setMaxInLine(line, measure) {
  27891. var maxLineSize = line.reduce(function(maxLineSize, item) {
  27892. var itemMeasure = item ? item[measure] : maxLineSize;
  27893. return _max(maxLineSize, itemMeasure)
  27894. }, 0);
  27895. line.forEach(function(item) {
  27896. if (item) {
  27897. item[measure] = maxLineSize
  27898. }
  27899. })
  27900. }
  27901. function transpose(array) {
  27902. var width = array.length;
  27903. var height = array[0].length;
  27904. var i;
  27905. var j;
  27906. var transposeArray = [];
  27907. for (i = 0; i < height; i++) {
  27908. transposeArray[i] = [];
  27909. for (j = 0; j < width; j++) {
  27910. transposeArray[i][j] = array[j][i]
  27911. }
  27912. }
  27913. return transposeArray
  27914. }
  27915. function getAlign(position) {
  27916. switch (position) {
  27917. case TOP:
  27918. case BOTTOM:
  27919. return CENTER;
  27920. case LEFT:
  27921. return RIGHT;
  27922. case RIGHT:
  27923. return LEFT
  27924. }
  27925. }
  27926. var getMarkerCreator = function(type) {
  27927. return isCircle(type) ? createCircleMarker : createSquareMarker
  27928. };
  27929. function getTitleHorizontalAlignment(options) {
  27930. if (options.horizontalAlignment === CENTER) {
  27931. return CENTER
  27932. } else {
  27933. if (options.itemTextPosition === RIGHT) {
  27934. return LEFT
  27935. } else {
  27936. if (options.itemTextPosition === LEFT) {
  27937. return RIGHT
  27938. } else {
  27939. return CENTER
  27940. }
  27941. }
  27942. }
  27943. }
  27944. var _Legend = exports.Legend = function(settings) {
  27945. var that = this;
  27946. that._renderer = settings.renderer;
  27947. that._legendGroup = settings.group;
  27948. that._backgroundClass = settings.backgroundClass;
  27949. that._itemGroupClass = settings.itemGroupClass;
  27950. that._textField = settings.textField;
  27951. that._getCustomizeObject = settings.getFormatObject;
  27952. that._titleGroupClass = settings.titleGroupClass;
  27953. that._allowInsidePosition = settings.allowInsidePosition
  27954. };
  27955. var legendPrototype = _Legend.prototype = (0, _object.clone)(_layout_element.LayoutElement.prototype);
  27956. (0, _extend2.extend)(legendPrototype, {
  27957. constructor: _Legend,
  27958. getOptions: function() {
  27959. return this._options
  27960. },
  27961. update: function(data, options) {
  27962. var themeManagerTitleOptions = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
  27963. var that = this;
  27964. options = that._options = parseOptions(options, that._textField, that._allowInsidePosition) || {};
  27965. that._data = data && options.customizeItems && options.customizeItems(data.slice()) || data;
  27966. that._boundingRect = {
  27967. width: 0,
  27968. height: 0,
  27969. x: 0,
  27970. y: 0
  27971. };
  27972. if (that.isVisible() && !that._title) {
  27973. that._title = new _title2.default.Title({
  27974. renderer: that._renderer,
  27975. cssClass: that._titleGroupClass,
  27976. root: that._legendGroup
  27977. })
  27978. }
  27979. if (that._title) {
  27980. var titleOptions = options.title;
  27981. themeManagerTitleOptions.horizontalAlignment = getTitleHorizontalAlignment(options);
  27982. that._title.update(themeManagerTitleOptions, titleOptions)
  27983. }
  27984. this.erase();
  27985. return that
  27986. },
  27987. isVisible: function() {
  27988. return this._options && this._options.visible
  27989. },
  27990. draw: function(width, height) {
  27991. var that = this;
  27992. var options = that._options;
  27993. var items = that._getItemData();
  27994. that._size = {
  27995. width: width,
  27996. height: height
  27997. };
  27998. that.erase();
  27999. if (!(that.isVisible() && items && items.length)) {
  28000. return that
  28001. }
  28002. that._insideLegendGroup = that._renderer.g().enableLinks().append(that._legendGroup);
  28003. that._title.changeLink(that._insideLegendGroup);
  28004. that._createBackground();
  28005. if (that._title.hasText()) {
  28006. var horizontalPadding = that._background ? 2 * that._options.paddingLeftRight : 0;
  28007. that._title.draw(width - horizontalPadding, height)
  28008. }
  28009. that._markersGroup = that._renderer.g().attr({
  28010. "class": that._itemGroupClass
  28011. }).append(that._insideLegendGroup);
  28012. that._createItems(items);
  28013. that._locateElements(options);
  28014. that._finalUpdate(options);
  28015. var size = that.getLayoutOptions();
  28016. if (size.width > width || size.height > height) {
  28017. that.freeSpace()
  28018. }
  28019. return that
  28020. },
  28021. probeDraw: function(width, height) {
  28022. return this.draw(width, height)
  28023. },
  28024. _createItems: function(items) {
  28025. var that = this;
  28026. var options = that._options;
  28027. var initMarkerSize = options.markerSize;
  28028. var renderer = that._renderer;
  28029. var bBox;
  28030. var maxBBoxHeight = 0;
  28031. var createMarker = getMarkerCreator(options.markerShape);
  28032. that._markersId = {};
  28033. that._items = (items || []).map(function(dataItem, i) {
  28034. var group = that._markersGroup;
  28035. var markerSize = _Number(dataItem.size > 0 ? dataItem.size : initMarkerSize);
  28036. var stateOfDataItem = dataItem.states;
  28037. var normalState = stateOfDataItem.normal;
  28038. var normalStateFill = normalState.fill;
  28039. var marker = createMarker(renderer, markerSize).attr({
  28040. fill: normalStateFill || options.markerColor || options.defaultColor,
  28041. opacity: normalState.opacity
  28042. }).append(group);
  28043. var label = that._createLabel(dataItem, group);
  28044. var states = {
  28045. normal: {
  28046. fill: normalStateFill
  28047. },
  28048. hovered: getState(stateOfDataItem.hover, normalStateFill),
  28049. selected: getState(stateOfDataItem.selection, normalStateFill)
  28050. };
  28051. var labelBBox = label.getBBox();
  28052. if (void 0 !== dataItem.id) {
  28053. that._markersId[dataItem.id] = i
  28054. }
  28055. bBox = getSizeItem(options, markerSize, labelBBox);
  28056. maxBBoxHeight = _max(maxBBoxHeight, bBox.height);
  28057. that._createHint(dataItem, label, marker);
  28058. return {
  28059. label: label,
  28060. labelBBox: labelBBox,
  28061. group: group,
  28062. bBox: bBox,
  28063. marker: marker,
  28064. markerSize: markerSize,
  28065. tracker: {
  28066. id: dataItem.id,
  28067. argument: dataItem.argument,
  28068. argumentIndex: dataItem.argumentIndex
  28069. },
  28070. states: states,
  28071. itemTextPosition: options.itemTextPosition,
  28072. markerOffset: 0,
  28073. bBoxes: []
  28074. }
  28075. });
  28076. if (options.equalRowHeight) {
  28077. that._items.forEach(function(item) {
  28078. return item.bBox.height = maxBBoxHeight
  28079. })
  28080. }
  28081. },
  28082. _getItemData: function() {
  28083. var items = this._data || [];
  28084. var options = this._options || {};
  28085. if (options.inverted) {
  28086. items = items.slice().reverse()
  28087. }
  28088. return items.filter(function(i) {
  28089. return i.visible
  28090. })
  28091. },
  28092. _finalUpdate: function(options) {
  28093. this._adjustBackgroundSettings(options);
  28094. this._setBoundingRect(options.margin)
  28095. },
  28096. erase: function() {
  28097. var that = this;
  28098. var insideLegendGroup = that._insideLegendGroup;
  28099. insideLegendGroup && insideLegendGroup.dispose();
  28100. that._insideLegendGroup = that._markersGroup = that._x1 = that._x2 = that._y2 = that._y2 = null;
  28101. return that
  28102. },
  28103. _locateElements: function(locationOptions) {
  28104. this._moveInInitialValues();
  28105. this._locateRowsColumns(locationOptions)
  28106. },
  28107. _moveInInitialValues: function() {
  28108. var that = this;
  28109. that._title.hasText() && that._title.move([0, 0]);
  28110. that._legendGroup && that._legendGroup.move(0, 0);
  28111. that._background && that._background.attr({
  28112. x: 0,
  28113. y: 0,
  28114. width: 0,
  28115. height: 0
  28116. })
  28117. },
  28118. applySelected: function(id) {
  28119. applyMarkerState(id, this._markersId, this._items, "selected");
  28120. return this
  28121. },
  28122. applyHover: function(id) {
  28123. applyMarkerState(id, this._markersId, this._items, "hovered");
  28124. return this
  28125. },
  28126. resetItem: function(id) {
  28127. applyMarkerState(id, this._markersId, this._items, "normal");
  28128. return this
  28129. },
  28130. _createLabel: function(data, group) {
  28131. var labelFormatObject = this._getCustomizeObject(data);
  28132. var options = this._options;
  28133. var align = getAlign(options.itemTextPosition);
  28134. var text = options.customizeText.call(labelFormatObject, labelFormatObject);
  28135. var fontStyle = _isDefined(data.textOpacity) ? _extend({}, options.font, {
  28136. opacity: data.textOpacity
  28137. }) : options.font;
  28138. return this._renderer.text(text, 0, 0).css((0, _utils.patchFontOptions)(fontStyle)).attr({
  28139. align: align,
  28140. "class": options.cssClass
  28141. }).append(group)
  28142. },
  28143. _createHint: function(data, label, marker) {
  28144. var labelFormatObject = this._getCustomizeObject(data);
  28145. var text = this._options.customizeHint.call(labelFormatObject, labelFormatObject);
  28146. if (_isDefined(text) && "" !== text) {
  28147. label.setTitle(text);
  28148. marker.setTitle(text)
  28149. }
  28150. },
  28151. _createBackground: function() {
  28152. var that = this;
  28153. var isInside = that._options.position === INSIDE;
  28154. var color = that._options.backgroundColor;
  28155. var fill = color || (isInside ? that._options.containerBackgroundColor : NONE);
  28156. if (that._options.border.visible || (isInside || color) && color !== NONE) {
  28157. that._background = that._renderer.rect(0, 0, 0, 0).attr({
  28158. fill: fill,
  28159. "class": that._backgroundClass
  28160. }).append(that._insideLegendGroup)
  28161. }
  28162. },
  28163. _locateRowsColumns: function(options) {
  28164. var that = this;
  28165. var iteration = 0;
  28166. var layoutOptions = that._getItemsLayoutOptions();
  28167. var countItems = that._items.length;
  28168. var lines;
  28169. do {
  28170. lines = [];
  28171. that._createLines(lines, layoutOptions);
  28172. that._alignLines(lines, layoutOptions);
  28173. iteration++
  28174. } while (checkLinesSize(lines, layoutOptions, countItems, options.margin) && iteration < countItems);
  28175. that._applyItemPosition(lines, layoutOptions)
  28176. },
  28177. _createLines: function(lines, layoutOptions) {
  28178. this._items.forEach(function(item, i) {
  28179. var tableLine = getLines(lines, layoutOptions, i);
  28180. var labelBox = {
  28181. width: item.labelBBox.width,
  28182. height: item.labelBBox.height,
  28183. element: item.label,
  28184. bBox: item.labelBBox,
  28185. pos: getPos(layoutOptions),
  28186. itemIndex: i
  28187. };
  28188. var markerBox = {
  28189. width: item.markerSize,
  28190. height: item.markerSize,
  28191. element: item.marker,
  28192. pos: {
  28193. horizontal: CENTER,
  28194. vertical: CENTER
  28195. },
  28196. bBox: {
  28197. width: item.markerSize,
  28198. height: item.markerSize,
  28199. x: 0,
  28200. y: 0
  28201. },
  28202. itemIndex: i
  28203. };
  28204. var firstItem;
  28205. var secondItem;
  28206. var offsetDirection = layoutOptions.markerOffset ? "altOffset" : "offset";
  28207. if (layoutOptions.inverseLabelPosition) {
  28208. firstItem = labelBox;
  28209. secondItem = markerBox
  28210. } else {
  28211. firstItem = markerBox;
  28212. secondItem = labelBox
  28213. }
  28214. firstItem[offsetDirection] = layoutOptions.labelOffset;
  28215. tableLine.secondLine.push(firstItem);
  28216. tableLine.firstLine.push(secondItem)
  28217. })
  28218. },
  28219. _alignLines: function(lines, layoutOptions) {
  28220. var i;
  28221. var measure = layoutOptions.altMeasure;
  28222. lines.forEach(function(line) {
  28223. return setMaxInLine(line, measure)
  28224. });
  28225. measure = layoutOptions.measure;
  28226. if (layoutOptions.itemsAlignment) {
  28227. if (layoutOptions.markerOffset) {
  28228. for (i = 0; i < lines.length;) {
  28229. transpose([lines[i++], lines[i++]]).forEach(processLine)
  28230. }
  28231. }
  28232. } else {
  28233. transpose(lines).forEach(processLine)
  28234. }
  28235. function processLine(line) {
  28236. setMaxInLine(line, measure)
  28237. }
  28238. },
  28239. _applyItemPosition: function(lines, layoutOptions) {
  28240. var that = this;
  28241. var position = {
  28242. x: 0,
  28243. y: 0
  28244. };
  28245. var maxLineLength = getMaxLineLength(lines, layoutOptions);
  28246. lines.forEach(function(line) {
  28247. var firstItem = line[0];
  28248. var altOffset = firstItem.altOffset || layoutOptions.altSpacing;
  28249. position[layoutOptions.direction] = getInitPositionForDirection(line, layoutOptions, maxLineLength);
  28250. line.forEach(function(item) {
  28251. var offset = item.offset || layoutOptions.spacing;
  28252. var wrap = new _layout_element.WrapperLayoutElement(item.element, item.bBox);
  28253. var itemBBoxOptions = {
  28254. x: position.x,
  28255. y: position.y,
  28256. width: item.width,
  28257. height: item.height
  28258. };
  28259. var itemBBox = new _layout_element.WrapperLayoutElement(null, itemBBoxOptions);
  28260. var itemLegend = that._items[item.itemIndex];
  28261. wrap.position({
  28262. of: itemBBox,
  28263. my: item.pos,
  28264. at: item.pos
  28265. });
  28266. itemLegend.bBoxes.push(itemBBox);
  28267. position[layoutOptions.direction] += item[layoutOptions.measure] + offset
  28268. });
  28269. position[layoutOptions.altDirection] += firstItem[layoutOptions.altMeasure] + altOffset
  28270. });
  28271. this._items.forEach(function(item) {
  28272. var itemBBox = calculateBBoxLabelAndMarker(item.bBoxes[0].getLayoutOptions(), item.bBoxes[1].getLayoutOptions());
  28273. var horizontal = that._options.columnItemSpacing / 2;
  28274. var vertical = that._options.rowItemSpacing / 2;
  28275. item.tracker.left = itemBBox.left - horizontal;
  28276. item.tracker.right = itemBBox.right + horizontal;
  28277. item.tracker.top = itemBBox.top - vertical;
  28278. item.tracker.bottom = itemBBox.bottom + vertical
  28279. })
  28280. },
  28281. _getItemsLayoutOptions: function() {
  28282. var that = this;
  28283. var options = that._options;
  28284. var orientation = options.orientation;
  28285. var layoutOptions = {
  28286. itemsAlignment: options.itemsAlignment,
  28287. orientation: options.orientation
  28288. };
  28289. var width = that._size.width - (that._background ? 2 * options.paddingLeftRight : 0);
  28290. var height = that._size.height - (that._background ? 2 * options.paddingTopBottom : 0);
  28291. if (orientation === HORIZONTAL) {
  28292. layoutOptions.length = width;
  28293. layoutOptions.spacing = options.columnItemSpacing;
  28294. layoutOptions.direction = "x";
  28295. layoutOptions.measure = WIDTH;
  28296. layoutOptions.altMeasure = HEIGHT;
  28297. layoutOptions.altDirection = "y";
  28298. layoutOptions.altSpacing = options.rowItemSpacing;
  28299. layoutOptions.countItem = options.columnCount;
  28300. layoutOptions.altCountItem = options.rowCount;
  28301. layoutOptions.marginTextLabel = 4;
  28302. layoutOptions.labelOffset = 7;
  28303. if (options.itemTextPosition === BOTTOM || options.itemTextPosition === TOP) {
  28304. layoutOptions.labelOffset = 4;
  28305. layoutOptions.markerOffset = true
  28306. }
  28307. } else {
  28308. layoutOptions.length = height;
  28309. layoutOptions.spacing = options.rowItemSpacing;
  28310. layoutOptions.direction = "y";
  28311. layoutOptions.measure = HEIGHT;
  28312. layoutOptions.altMeasure = WIDTH;
  28313. layoutOptions.altDirection = "x";
  28314. layoutOptions.altSpacing = options.columnItemSpacing;
  28315. layoutOptions.countItem = options.rowCount;
  28316. layoutOptions.altCountItem = options.columnCount;
  28317. layoutOptions.marginTextLabel = 7;
  28318. layoutOptions.labelOffset = 4;
  28319. if (options.itemTextPosition === RIGHT || options.itemTextPosition === LEFT) {
  28320. layoutOptions.labelOffset = 7;
  28321. layoutOptions.markerOffset = true
  28322. }
  28323. }
  28324. if (!layoutOptions.countItem) {
  28325. if (layoutOptions.altCountItem) {
  28326. layoutOptions.countItem = _ceil(that._items.length / layoutOptions.altCountItem)
  28327. } else {
  28328. layoutOptions.countItem = that._items.length
  28329. }
  28330. }
  28331. if (options.itemTextPosition === TOP || options.itemTextPosition === LEFT) {
  28332. layoutOptions.inverseLabelPosition = true
  28333. }
  28334. layoutOptions.itemTextPosition = options.itemTextPosition;
  28335. layoutOptions.altCountItem = layoutOptions.altCountItem || _ceil(that._items.length / layoutOptions.countItem);
  28336. return layoutOptions
  28337. },
  28338. _adjustBackgroundSettings: function(locationOptions) {
  28339. if (!this._background) {
  28340. return
  28341. }
  28342. var border = locationOptions.border;
  28343. var legendBox = this._calculateTotalBox();
  28344. var backgroundSettings = {
  28345. x: _round(legendBox.x - locationOptions.paddingLeftRight),
  28346. y: _round(legendBox.y - locationOptions.paddingTopBottom),
  28347. width: _round(legendBox.width) + 2 * locationOptions.paddingLeftRight,
  28348. height: _round(legendBox.height),
  28349. opacity: locationOptions.backgroundOpacity
  28350. };
  28351. if (border.visible && border.width && border.color && border.color !== NONE) {
  28352. backgroundSettings["stroke-width"] = border.width;
  28353. backgroundSettings.stroke = border.color;
  28354. backgroundSettings["stroke-opacity"] = border.opacity;
  28355. backgroundSettings.dashStyle = border.dashStyle;
  28356. backgroundSettings.rx = border.cornerRadius || 0;
  28357. backgroundSettings.ry = border.cornerRadius || 0
  28358. }
  28359. this._background.attr(backgroundSettings)
  28360. },
  28361. _setBoundingRect: function(margin) {
  28362. if (!this._insideLegendGroup) {
  28363. return
  28364. }
  28365. var box = this._calculateTotalBox();
  28366. box.height += margin.top + margin.bottom;
  28367. box.widthWithoutMargins = box.width;
  28368. box.width += margin.left + margin.right;
  28369. box.x -= margin.left;
  28370. box.y -= margin.top;
  28371. this._boundingRect = box
  28372. },
  28373. _calculateTotalBox: function() {
  28374. var markerBox = this._markersGroup.getBBox();
  28375. var titleBox = this._title.getCorrectedLayoutOptions();
  28376. var box = this._insideLegendGroup.getBBox();
  28377. var verticalPadding = this._background ? 2 * this._options.paddingTopBottom : 0;
  28378. box.height = markerBox.height + titleBox.height + verticalPadding;
  28379. titleBox.width > box.width && (box.width = titleBox.width);
  28380. return box
  28381. },
  28382. getActionCallback: function(point) {
  28383. var that = this;
  28384. if (that._options.visible) {
  28385. return function(act) {
  28386. that[act](point.index)
  28387. }
  28388. } else {
  28389. return _common.noop
  28390. }
  28391. },
  28392. getLayoutOptions: function() {
  28393. var options = this._options;
  28394. var boundingRect = this._insideLegendGroup ? this._boundingRect : {
  28395. width: 0,
  28396. height: 0,
  28397. x: 0,
  28398. y: 0
  28399. };
  28400. if (options) {
  28401. boundingRect.verticalAlignment = options.verticalAlignment;
  28402. boundingRect.horizontalAlignment = options.horizontalAlignment;
  28403. if (options.orientation === HORIZONTAL) {
  28404. boundingRect.cutLayoutSide = options.verticalAlignment;
  28405. boundingRect.cutSide = "vertical"
  28406. } else {
  28407. if (options.horizontalAlignment === CENTER) {
  28408. boundingRect.cutLayoutSide = options.verticalAlignment;
  28409. boundingRect.cutSide = "vertical"
  28410. } else {
  28411. boundingRect.cutLayoutSide = options.horizontalAlignment;
  28412. boundingRect.cutSide = "horizontal"
  28413. }
  28414. }
  28415. boundingRect.position = {
  28416. horizontal: options.horizontalAlignment,
  28417. vertical: options.verticalAlignment
  28418. };
  28419. return boundingRect
  28420. }
  28421. return null
  28422. },
  28423. shift: function(x, y) {
  28424. var that = this;
  28425. var box = {};
  28426. if (that._insideLegendGroup) {
  28427. that._insideLegendGroup.attr({
  28428. translateX: x - that._boundingRect.x,
  28429. translateY: y - that._boundingRect.y
  28430. })
  28431. }
  28432. that._title && that._shiftTitle(that._boundingRect.widthWithoutMargins);
  28433. that._markersGroup && that._shiftMarkers();
  28434. if (that._insideLegendGroup) {
  28435. box = that._legendGroup.getBBox()
  28436. }
  28437. that._x1 = box.x;
  28438. that._y1 = box.y;
  28439. that._x2 = box.x + box.width;
  28440. that._y2 = box.y + box.height;
  28441. return that
  28442. },
  28443. _shiftTitle: function(boxWidth) {
  28444. var that = this;
  28445. var title = that._title;
  28446. var titleBox = title.getCorrectedLayoutOptions();
  28447. if (!titleBox || !title.hasText()) {
  28448. return
  28449. }
  28450. var width = boxWidth - (that._background ? 2 * that._options.paddingLeftRight : 0);
  28451. var titleOptions = title.getOptions();
  28452. var titleY = titleBox.y + titleOptions.margin.top;
  28453. var titleX = 0;
  28454. if (titleOptions.verticalAlignment === BOTTOM) {
  28455. titleY += that._markersGroup.getBBox().height
  28456. }
  28457. if (titleOptions.horizontalAlignment === RIGHT) {
  28458. titleX = width - titleBox.width
  28459. } else {
  28460. if (titleOptions.horizontalAlignment === CENTER) {
  28461. titleX = (width - titleBox.width) / 2
  28462. }
  28463. }
  28464. title.shift(titleX, titleY)
  28465. },
  28466. _shiftMarkers: function() {
  28467. var titleBox = this._title.getLayoutOptions();
  28468. var markerBox = this._markersGroup.getBBox();
  28469. var titleOptions = this._title.getOptions() || {};
  28470. var center = 0;
  28471. var y = 0;
  28472. if (titleBox.width > markerBox.width && this._options.horizontalAlignment === CENTER) {
  28473. center = titleBox.width / 2 - markerBox.width / 2
  28474. }
  28475. if (titleOptions.verticalAlignment === TOP) {
  28476. y = titleBox.height
  28477. }
  28478. if (0 !== center || 0 !== y) {
  28479. this._markersGroup.attr({
  28480. translateX: center,
  28481. translateY: y
  28482. });
  28483. this._items.forEach(function(item) {
  28484. item.tracker.left += center;
  28485. item.tracker.right += center;
  28486. item.tracker.top += y;
  28487. item.tracker.bottom += y
  28488. })
  28489. }
  28490. },
  28491. getPosition: function() {
  28492. return this._options.position
  28493. },
  28494. coordsIn: function(x, y) {
  28495. return x >= this._x1 && x <= this._x2 && y >= this._y1 && y <= this._y2
  28496. },
  28497. getItemByCoord: function(x, y) {
  28498. var items = this._items;
  28499. var legendGroup = this._insideLegendGroup;
  28500. x -= legendGroup.attr("translateX");
  28501. y -= legendGroup.attr("translateY");
  28502. for (var i = 0; i < items.length; i++) {
  28503. if (inRect(items[i].tracker, x, y)) {
  28504. return items[i].tracker
  28505. }
  28506. }
  28507. return null
  28508. },
  28509. dispose: function() {
  28510. var that = this;
  28511. that._title && that._title.dispose();
  28512. that._legendGroup = that._insideLegendGroup = that._title = that._renderer = that._options = that._data = that._items = null;
  28513. return that
  28514. },
  28515. layoutOptions: function() {
  28516. if (!this.isVisible()) {
  28517. return null
  28518. }
  28519. var pos = this.getLayoutOptions();
  28520. return {
  28521. horizontalAlignment: this._options.horizontalAlignment,
  28522. verticalAlignment: this._options.verticalAlignment,
  28523. side: pos.cutSide,
  28524. priority: 1,
  28525. position: this.getPosition()
  28526. }
  28527. },
  28528. measure: function(size) {
  28529. this.draw(size[0], size[1]);
  28530. var rect = this.getLayoutOptions();
  28531. return [rect.width, rect.height]
  28532. },
  28533. move: function(rect) {
  28534. this.shift(rect[0], rect[1])
  28535. },
  28536. freeSpace: function() {
  28537. this._options._incidentOccurred("W2104");
  28538. this.erase()
  28539. }
  28540. });
  28541. exports.plugin = {
  28542. name: "legend",
  28543. init: function() {
  28544. var that = this;
  28545. var group = this._renderer.g().attr({
  28546. "class": this._rootClassPrefix + "-legend"
  28547. }).enableLinks().append(that._renderer.root);
  28548. that._legend = new exports.Legend({
  28549. renderer: that._renderer,
  28550. group: group,
  28551. itemGroupClass: this._rootClassPrefix + "-item",
  28552. titleGroupClass: this._rootClassPrefix + "-title",
  28553. textField: "text",
  28554. getFormatObject: function(data) {
  28555. return {
  28556. item: data.item,
  28557. text: data.text
  28558. }
  28559. }
  28560. });
  28561. that._layout.add(that._legend)
  28562. },
  28563. extenders: {
  28564. _applyTilesAppearance: function() {
  28565. var that = this;
  28566. this._items.forEach(function(item) {
  28567. that._applyLegendItemStyle(item.id, item.getState())
  28568. })
  28569. },
  28570. _buildNodes: function() {
  28571. this._createLegendItems()
  28572. }
  28573. },
  28574. members: {
  28575. _applyLegendItemStyle: function(id, state) {
  28576. var legend = this._legend;
  28577. switch (state) {
  28578. case "hover":
  28579. legend.applyHover(id);
  28580. break;
  28581. case "selection":
  28582. legend.applySelected(id);
  28583. break;
  28584. default:
  28585. legend.resetItem(id)
  28586. }
  28587. },
  28588. _createLegendItems: function() {
  28589. if (this._legend.update(this._getLegendData(), this._getOption("legend"), this._themeManager.theme("legend").title)) {
  28590. this._requestChange(["LAYOUT"])
  28591. }
  28592. }
  28593. },
  28594. dispose: function() {
  28595. this._legend.dispose()
  28596. },
  28597. customize: function(constructor) {
  28598. constructor.prototype._proxyData.push(function(x, y) {
  28599. if (this._legend.coordsIn(x, y)) {
  28600. var item = this._legend.getItemByCoord(x, y);
  28601. if (item) {
  28602. return {
  28603. id: item.id,
  28604. type: "legend"
  28605. }
  28606. }
  28607. }
  28608. });
  28609. constructor.addChange({
  28610. code: "LEGEND",
  28611. handler: function() {
  28612. this._createLegendItems()
  28613. },
  28614. isThemeDependent: true,
  28615. option: "legend",
  28616. isOptionChange: true
  28617. })
  28618. }
  28619. };
  28620. var __getMarkerCreator = getMarkerCreator;
  28621. exports._DEBUG_stubMarkerCreator = function(callback) {
  28622. getMarkerCreator = function() {
  28623. return callback
  28624. }
  28625. };
  28626. exports._DEBUG_restoreMarkerCreator = function() {
  28627. getMarkerCreator = __getMarkerCreator
  28628. }
  28629. },
  28630. /*!*************************************************************!*\
  28631. !*** ./artifacts/transpiled/viz/series/points/bar_point.js ***!
  28632. \*************************************************************/
  28633. /*! dynamic exports provided */
  28634. /*! all exports used */
  28635. function(module, exports, __webpack_require__) {
  28636. var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
  28637. var _extend = extend;
  28638. var _math = Math;
  28639. var _floor = _math.floor;
  28640. var _abs = _math.abs;
  28641. var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
  28642. var CANVAS_POSITION_DEFAULT = "canvas_position_default";
  28643. var DEFAULT_BAR_TRACKER_SIZE = 9;
  28644. var CORRECTING_BAR_TRACKER_VALUE = 4;
  28645. var RIGHT = "right";
  28646. var LEFT = "left";
  28647. var TOP = "top";
  28648. var BOTTOM = "bottom";
  28649. module.exports = _extend({}, symbolPoint, {
  28650. correctCoordinates: function(correctOptions) {
  28651. var that = this;
  28652. var correction = _floor(correctOptions.offset - correctOptions.width / 2);
  28653. if (that._options.rotated) {
  28654. that.height = correctOptions.width;
  28655. that.yCorrection = correction;
  28656. that.xCorrection = null
  28657. } else {
  28658. that.width = correctOptions.width;
  28659. that.xCorrection = correction;
  28660. that.yCorrection = null
  28661. }
  28662. },
  28663. _getGraphicBBox: function() {
  28664. return {
  28665. x: this.x,
  28666. y: this.y,
  28667. width: this.width,
  28668. height: this.height
  28669. }
  28670. },
  28671. _getLabelConnector: function(location) {
  28672. return this._getGraphicBBox(location)
  28673. },
  28674. _getLabelPosition: function() {
  28675. var that = this;
  28676. var position;
  28677. var initialValue = that.initialValue;
  28678. var invert = that._getValTranslator().getBusinessRange().invert;
  28679. var isDiscreteValue = "discrete" === that.series.valueAxisType;
  28680. var isFullStacked = that.series.isFullStackedSeries();
  28681. var notAxisInverted = !isDiscreteValue && (initialValue >= 0 && !invert || initialValue < 0 && invert) || isDiscreteValue && !invert || isFullStacked;
  28682. if (!that._options.rotated) {
  28683. position = notAxisInverted ? TOP : BOTTOM
  28684. } else {
  28685. position = notAxisInverted ? RIGHT : LEFT
  28686. }
  28687. return position
  28688. },
  28689. _getLabelCoords: function(label) {
  28690. var that = this;
  28691. var coords;
  28692. if (0 === that.initialValue && that.series.isFullStackedSeries()) {
  28693. if (!this._options.rotated) {
  28694. coords = that._getLabelCoordOfPosition(label, TOP)
  28695. } else {
  28696. coords = that._getLabelCoordOfPosition(label, RIGHT)
  28697. }
  28698. } else {
  28699. if ("inside" === label.getLayoutOptions().position) {
  28700. coords = that._getLabelCoordOfPosition(label, "inside")
  28701. } else {
  28702. coords = symbolPoint._getLabelCoords.call(this, label)
  28703. }
  28704. }
  28705. return coords
  28706. },
  28707. _checkLabelPosition: function(label, coord) {
  28708. var that = this;
  28709. var visibleArea = that._getVisibleArea();
  28710. if (that._isPointInVisibleArea(visibleArea, that._getGraphicBBox())) {
  28711. return that._moveLabelOnCanvas(coord, visibleArea, label.getBoundingRect())
  28712. }
  28713. return coord
  28714. },
  28715. hideInsideLabel: function(label, coord) {
  28716. var graphicBBox = this._getGraphicBBox();
  28717. var labelBBox = label.getBoundingRect();
  28718. if (this._options.resolveLabelsOverlapping) {
  28719. if ((coord.y <= graphicBBox.y && coord.y + labelBBox.height >= graphicBBox.y + graphicBBox.height || coord.x <= graphicBBox.x && coord.x + labelBBox.width >= graphicBBox.x + graphicBBox.width) && !(coord.y > graphicBBox.y + graphicBBox.height || coord.y + labelBBox.height < graphicBBox.y || coord.x > graphicBBox.x + graphicBBox.width || coord.x + labelBBox.width < graphicBBox.x)) {
  28720. label.draw(false);
  28721. return true
  28722. }
  28723. }
  28724. return false
  28725. },
  28726. _moveLabelOnCanvas: function(coord, visibleArea, labelBBox) {
  28727. var x = coord.x;
  28728. var y = coord.y;
  28729. if (visibleArea.minX > x) {
  28730. x = visibleArea.minX
  28731. }
  28732. if (visibleArea.maxX < x + labelBBox.width) {
  28733. x = visibleArea.maxX - labelBBox.width
  28734. }
  28735. if (visibleArea.minY > y) {
  28736. y = visibleArea.minY
  28737. }
  28738. if (visibleArea.maxY < y + labelBBox.height) {
  28739. y = visibleArea.maxY - labelBBox.height
  28740. }
  28741. return {
  28742. x: x,
  28743. y: y
  28744. }
  28745. },
  28746. _showForZeroValues: function() {
  28747. return this._options.label.showForZeroValues || this.initialValue
  28748. },
  28749. _drawMarker: function(renderer, group, animationEnabled) {
  28750. var that = this;
  28751. var style = that._getStyle();
  28752. var r = that._options.cornerRadius;
  28753. var rotated = that._options.rotated;
  28754. var _that$getMarkerCoords = that.getMarkerCoords(),
  28755. x = _that$getMarkerCoords.x,
  28756. y = _that$getMarkerCoords.y,
  28757. width = _that$getMarkerCoords.width,
  28758. height = _that$getMarkerCoords.height;
  28759. if (animationEnabled) {
  28760. if (rotated) {
  28761. width = 0;
  28762. x = that.defaultX
  28763. } else {
  28764. height = 0;
  28765. y = that.defaultY
  28766. }
  28767. }
  28768. that.graphic = renderer.rect(x, y, width, height).attr({
  28769. rx: r,
  28770. ry: r
  28771. }).smartAttr(style).data({
  28772. "chart-data-point": that
  28773. }).append(group)
  28774. },
  28775. _getSettingsForTracker: function() {
  28776. var that = this;
  28777. var y = that.y;
  28778. var height = that.height;
  28779. var x = that.x;
  28780. var width = that.width;
  28781. if (that._options.rotated) {
  28782. if (1 === width) {
  28783. width = DEFAULT_BAR_TRACKER_SIZE;
  28784. x -= CORRECTING_BAR_TRACKER_VALUE
  28785. }
  28786. } else {
  28787. if (1 === height) {
  28788. height = DEFAULT_BAR_TRACKER_SIZE;
  28789. y -= CORRECTING_BAR_TRACKER_VALUE
  28790. }
  28791. }
  28792. return {
  28793. x: x,
  28794. y: y,
  28795. width: width,
  28796. height: height
  28797. }
  28798. },
  28799. getGraphicSettings: function() {
  28800. var graphic = this.graphic;
  28801. return {
  28802. x: graphic.attr("x"),
  28803. y: graphic.attr("y"),
  28804. height: graphic.attr("height"),
  28805. width: graphic.attr("width")
  28806. }
  28807. },
  28808. _getEdgeTooltipParams: function() {
  28809. var isPositive = this.value >= 0;
  28810. var xCoord;
  28811. var yCoord;
  28812. var invertedBusinessRange = this._getValTranslator().getBusinessRange().invert;
  28813. var x = this.x,
  28814. y = this.y,
  28815. width = this.width,
  28816. height = this.height;
  28817. if (this._options.rotated) {
  28818. yCoord = y + height / 2;
  28819. if (invertedBusinessRange) {
  28820. xCoord = isPositive ? x : x + width
  28821. } else {
  28822. xCoord = isPositive ? x + width : x
  28823. }
  28824. } else {
  28825. xCoord = x + width / 2;
  28826. if (invertedBusinessRange) {
  28827. yCoord = isPositive ? y + height : y
  28828. } else {
  28829. yCoord = isPositive ? y : y + height
  28830. }
  28831. }
  28832. return {
  28833. x: xCoord,
  28834. y: yCoord,
  28835. offset: 0
  28836. }
  28837. },
  28838. getTooltipParams: function(location) {
  28839. if ("edge" === location) {
  28840. return this._getEdgeTooltipParams()
  28841. }
  28842. var center = this.getCenterCoord();
  28843. center.offset = 0;
  28844. return center
  28845. },
  28846. getCenterCoord: function() {
  28847. var width = this.width,
  28848. height = this.height,
  28849. x = this.x,
  28850. y = this.y;
  28851. return {
  28852. x: x + width / 2,
  28853. y: y + height / 2
  28854. }
  28855. },
  28856. _truncateCoord: function(coord, minBounce, maxBounce) {
  28857. if (null === coord) {
  28858. return coord
  28859. }
  28860. if (coord < minBounce) {
  28861. return minBounce
  28862. }
  28863. if (coord > maxBounce) {
  28864. return maxBounce
  28865. }
  28866. return coord
  28867. },
  28868. _getErrorBarBaseEdgeLength: function() {
  28869. return this._options.rotated ? this.height : this.width
  28870. },
  28871. _translateErrorBars: function(argVisibleArea) {
  28872. symbolPoint._translateErrorBars.call(this);
  28873. if (this._errorBarPos < argVisibleArea[0] || this._errorBarPos > argVisibleArea[1]) {
  28874. this._errorBarPos = void 0
  28875. }
  28876. },
  28877. _translate: function() {
  28878. var that = this;
  28879. var rotated = that._options.rotated;
  28880. var valAxis = rotated ? "x" : "y";
  28881. var argAxis = rotated ? "y" : "x";
  28882. var valIntervalName = rotated ? "width" : "height";
  28883. var argIntervalName = rotated ? "height" : "width";
  28884. var argTranslator = that._getArgTranslator();
  28885. var valTranslator = that._getValTranslator();
  28886. var argVisibleArea = that.series.getArgumentAxis().getVisibleArea();
  28887. var valVisibleArea = that.series.getValueAxis().getVisibleArea();
  28888. var arg;
  28889. var val;
  28890. var minVal;
  28891. arg = argTranslator.translate(that.argument);
  28892. that[argAxis] = arg = null === arg ? arg : arg + (that[argAxis + "Correction"] || 0);
  28893. val = valTranslator.translate(that.value, 1);
  28894. minVal = valTranslator.translate(that.minValue);
  28895. that["v" + valAxis] = val;
  28896. that["v" + argAxis] = arg + that[argIntervalName] / 2;
  28897. val = that._truncateCoord(val, valVisibleArea[0], valVisibleArea[1]);
  28898. minVal = that._truncateCoord(minVal, valVisibleArea[0], valVisibleArea[1]);
  28899. that[valIntervalName] = _abs(val - minVal);
  28900. val = val < minVal ? val : minVal;
  28901. that._calculateVisibility(rotated ? val : arg, rotated ? arg : val, that.width, that.height);
  28902. that[valAxis] = null === val ? val : val + (that[valAxis + "Correction"] || 0);
  28903. that["min" + valAxis.toUpperCase()] = null === minVal ? minVal : minVal + (that[valAxis + "Correction"] || 0);
  28904. that["default" + valAxis.toUpperCase()] = valTranslator.translate(CANVAS_POSITION_DEFAULT);
  28905. that._translateErrorBars(argVisibleArea);
  28906. if (that.inVisibleArea && null !== that[argAxis]) {
  28907. if (that[argAxis] < argVisibleArea[0]) {
  28908. that[argIntervalName] = that[argIntervalName] - (argVisibleArea[0] - that[argAxis]);
  28909. that[argAxis] = argVisibleArea[0]
  28910. }
  28911. if (that[argAxis] + that[argIntervalName] > argVisibleArea[1]) {
  28912. that[argIntervalName] = argVisibleArea[1] - that[argAxis]
  28913. }
  28914. }
  28915. },
  28916. _updateMarker: function(animationEnabled, style) {
  28917. this.graphic.smartAttr(_extend({}, style, !animationEnabled ? this.getMarkerCoords() : {}))
  28918. },
  28919. getMarkerCoords: function() {
  28920. var that = this;
  28921. var x = that.x;
  28922. var y = that.y;
  28923. var width = that.width;
  28924. var height = that.height;
  28925. var argAxis = that.series.getArgumentAxis();
  28926. var rotated = that._options.rotated;
  28927. if (argAxis.getAxisPosition) {
  28928. var axisOptions = argAxis.getOptions();
  28929. var edgeOffset = Math.round(axisOptions.width / 2);
  28930. var argAxisPosition = argAxis.getAxisPosition();
  28931. if (axisOptions.visible) {
  28932. if (!rotated) {
  28933. height -= that.minY === that.defaultY && that.minY === argAxisPosition - argAxis.getAxisShift() ? edgeOffset : 0;
  28934. height < 0 && (height = 0)
  28935. } else {
  28936. var isStartFromAxis = that.minX === that.defaultX && that.minX === argAxisPosition - argAxis.getAxisShift();
  28937. x += isStartFromAxis ? edgeOffset : 0;
  28938. width -= isStartFromAxis ? edgeOffset : 0;
  28939. width < 0 && (width = 0)
  28940. }
  28941. }
  28942. }
  28943. return {
  28944. x: x,
  28945. y: y,
  28946. width: width,
  28947. height: height
  28948. }
  28949. },
  28950. coordsIn: function(x, y) {
  28951. var that = this;
  28952. return x >= that.x && x <= that.x + that.width && y >= that.y && y <= that.y + that.height
  28953. }
  28954. })
  28955. },
  28956. /*!********************************************************!*\
  28957. !*** ./artifacts/transpiled/viz/series/line_series.js ***!
  28958. \********************************************************/
  28959. /*! dynamic exports provided */
  28960. /*! all exports used */
  28961. function(module, exports, __webpack_require__) {
  28962. var series = __webpack_require__( /*! ./scatter_series */ 106);
  28963. var chartScatterSeries = series.chart;
  28964. var polarScatterSeries = series.polar;
  28965. var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
  28966. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  28967. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  28968. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  28969. var mathUtils = __webpack_require__( /*! ../../core/utils/math */ 28);
  28970. var normalizeAngle = vizUtils.normalizeAngle;
  28971. var DISCRETE = "discrete";
  28972. var _map = vizUtils.map;
  28973. var _extend = extend;
  28974. var _each = each;
  28975. exports.chart = {};
  28976. exports.polar = {};
  28977. function clonePoint(point, newX, newY, newAngle) {
  28978. var p = objectUtils.clone(point);
  28979. p.x = newX;
  28980. p.y = newY;
  28981. p.angle = newAngle;
  28982. return p
  28983. }
  28984. function getTangentPoint(point, prevPoint, centerPoint, tan, nextStepAngle) {
  28985. var correctAngle = point.angle + nextStepAngle;
  28986. var cosSin = vizUtils.getCosAndSin(correctAngle);
  28987. var x = centerPoint.x + (point.radius + tan * nextStepAngle) * cosSin.cos;
  28988. var y = centerPoint.y - (point.radius + tan * nextStepAngle) * cosSin.sin;
  28989. return clonePoint(prevPoint, x, y, correctAngle)
  28990. }
  28991. function obtainCubicBezierTCoef(p, p0, p1, p2, p3) {
  28992. var d = p0 - p;
  28993. var c = 3 * p1 - 3 * p0;
  28994. var b = 3 * p2 - 6 * p1 + 3 * p0;
  28995. var a = p3 - 3 * p2 + 3 * p1 - p0;
  28996. return mathUtils.solveCubicEquation(a, b, c, d)
  28997. }
  28998. var lineMethods = {
  28999. autoHidePointMarkersEnabled: function() {
  29000. return true
  29001. },
  29002. _applyGroupSettings: function(style, settings, group) {
  29003. var that = this;
  29004. settings = _extend(settings, style);
  29005. that._applyElementsClipRect(settings);
  29006. group.attr(settings)
  29007. },
  29008. _setGroupsSettings: function(animationEnabled) {
  29009. var that = this;
  29010. var style = that._styles.normal;
  29011. that._applyGroupSettings(style.elements, {
  29012. "class": "dxc-elements"
  29013. }, that._elementsGroup);
  29014. that._bordersGroup && that._applyGroupSettings(style.border, {
  29015. "class": "dxc-borders"
  29016. }, that._bordersGroup);
  29017. chartScatterSeries._setGroupsSettings.call(that, animationEnabled);
  29018. animationEnabled && that._markersGroup && that._markersGroup.attr({
  29019. opacity: .001
  29020. })
  29021. },
  29022. _createGroups: function() {
  29023. var that = this;
  29024. that._createGroup("_elementsGroup", that, that._group);
  29025. that._areBordersVisible() && that._createGroup("_bordersGroup", that, that._group);
  29026. chartScatterSeries._createGroups.call(that)
  29027. },
  29028. _areBordersVisible: function() {
  29029. return false
  29030. },
  29031. _getDefaultSegment: function(segment) {
  29032. return {
  29033. line: _map(segment.line || [], function(pt) {
  29034. return pt.getDefaultCoords()
  29035. })
  29036. }
  29037. },
  29038. _prepareSegment: function(points) {
  29039. return {
  29040. line: points
  29041. }
  29042. },
  29043. _parseLineOptions: function(options, defaultColor) {
  29044. return {
  29045. stroke: options.color || defaultColor,
  29046. "stroke-width": options.width,
  29047. dashStyle: options.dashStyle || "solid"
  29048. }
  29049. },
  29050. _parseStyle: function(options, defaultColor) {
  29051. return {
  29052. elements: this._parseLineOptions(options, defaultColor)
  29053. }
  29054. },
  29055. _applyStyle: function(style) {
  29056. var that = this;
  29057. that._elementsGroup && that._elementsGroup.attr(style.elements);
  29058. _each(that._graphics || [], function(_, graphic) {
  29059. graphic.line && graphic.line.attr({
  29060. "stroke-width": style.elements["stroke-width"]
  29061. }).sharp()
  29062. })
  29063. },
  29064. _drawElement: function(segment, group) {
  29065. return {
  29066. line: this._createMainElement(segment.line, {
  29067. "stroke-width": this._styles.normal.elements["stroke-width"]
  29068. }).append(group)
  29069. }
  29070. },
  29071. _removeElement: function(element) {
  29072. element.line.remove()
  29073. },
  29074. _updateElement: function(element, segment, animate, animationComplete) {
  29075. var params = {
  29076. points: segment.line
  29077. };
  29078. var lineElement = element.line;
  29079. animate ? lineElement.animate(params, {}, animationComplete) : lineElement.attr(params)
  29080. },
  29081. _animateComplete: function() {
  29082. var that = this;
  29083. chartScatterSeries._animateComplete.call(that);
  29084. that._markersGroup && that._markersGroup.animate({
  29085. opacity: 1
  29086. }, {
  29087. duration: that._defaultDuration
  29088. })
  29089. },
  29090. _animate: function() {
  29091. var that = this;
  29092. var lastIndex = that._graphics.length - 1;
  29093. _each(that._graphics || [], function(i, elem) {
  29094. var complete;
  29095. if (i === lastIndex) {
  29096. complete = function() {
  29097. that._animateComplete()
  29098. }
  29099. }
  29100. that._updateElement(elem, that._segments[i], true, complete)
  29101. })
  29102. },
  29103. _drawPoint: function(options) {
  29104. chartScatterSeries._drawPoint.call(this, {
  29105. point: options.point,
  29106. groups: options.groups
  29107. })
  29108. },
  29109. _createMainElement: function(points, settings) {
  29110. return this._renderer.path(points, "line").attr(settings).sharp()
  29111. },
  29112. _sortPoints: function(points, rotated) {
  29113. return rotated ? points.sort(function(p1, p2) {
  29114. return p2.y - p1.y
  29115. }) : points.sort(function(p1, p2) {
  29116. return p1.x - p2.x
  29117. })
  29118. },
  29119. _drawSegment: function(points, animationEnabled, segmentCount, lastSegment) {
  29120. var that = this;
  29121. var rotated = that._options.rotated;
  29122. var forceDefaultSegment = false;
  29123. var segment = that._prepareSegment(points, rotated, lastSegment);
  29124. that._segments.push(segment);
  29125. if (!that._graphics[segmentCount]) {
  29126. that._graphics[segmentCount] = that._drawElement(animationEnabled ? that._getDefaultSegment(segment) : segment, that._elementsGroup)
  29127. } else {
  29128. if (!animationEnabled) {
  29129. that._updateElement(that._graphics[segmentCount], segment)
  29130. } else {
  29131. if (forceDefaultSegment) {
  29132. that._updateElement(that._graphics[segmentCount], that._getDefaultSegment(segment))
  29133. }
  29134. }
  29135. }
  29136. },
  29137. _getTrackerSettings: function() {
  29138. var that = this;
  29139. var defaultTrackerWidth = that._defaultTrackerWidth;
  29140. var strokeWidthFromElements = that._styles.normal.elements["stroke-width"];
  29141. return {
  29142. "stroke-width": strokeWidthFromElements > defaultTrackerWidth ? strokeWidthFromElements : defaultTrackerWidth,
  29143. fill: "none"
  29144. }
  29145. },
  29146. _getMainPointsFromSegment: function(segment) {
  29147. return segment.line
  29148. },
  29149. _drawTrackerElement: function(segment) {
  29150. return this._createMainElement(this._getMainPointsFromSegment(segment), this._getTrackerSettings(segment))
  29151. },
  29152. _updateTrackerElement: function(segment, element) {
  29153. var settings = this._getTrackerSettings(segment);
  29154. settings.points = this._getMainPointsFromSegment(segment);
  29155. element.attr(settings)
  29156. },
  29157. checkSeriesViewportCoord: function(axis, coord) {
  29158. if (0 === this._points.length) {
  29159. return false
  29160. }
  29161. var range = axis.isArgumentAxis ? this.getArgumentRange() : this.getViewport();
  29162. var min = axis.getTranslator().translate(range.categories ? range.categories[0] : range.min);
  29163. var max = axis.getTranslator().translate(range.categories ? range.categories[range.categories.length - 1] : range.max);
  29164. var rotated = this.getOptions().rotated;
  29165. var inverted = axis.getOptions().inverted;
  29166. return axis.isArgumentAxis && (!rotated && !inverted || rotated && inverted) || !axis.isArgumentAxis && (rotated && !inverted || !rotated && inverted) ? coord >= min && coord <= max : coord >= max && coord <= min
  29167. },
  29168. getSeriesPairCoord: function(coord, isArgument) {
  29169. var that = this;
  29170. var oppositeCoord = null;
  29171. var nearestPoints = this.getNearestPointsByCoord(coord, isArgument);
  29172. var needValueCoord = isArgument && !that._options.rotated || !isArgument && that._options.rotated;
  29173. for (var i = 0; i < nearestPoints.length; i++) {
  29174. var p = nearestPoints[i];
  29175. var k = (p[1].vy - p[0].vy) / (p[1].vx - p[0].vx);
  29176. var b = p[0].vy - p[0].vx * k;
  29177. var tmpCoord = void 0;
  29178. if (p[1].vx - p[0].vx === 0) {
  29179. tmpCoord = needValueCoord ? p[0].vy : p[0].vx
  29180. } else {
  29181. tmpCoord = needValueCoord ? k * coord + b : (coord - b) / k
  29182. }
  29183. if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
  29184. oppositeCoord = tmpCoord;
  29185. break
  29186. }
  29187. }
  29188. return oppositeCoord
  29189. }
  29190. };
  29191. var lineSeries = exports.chart.line = _extend({}, chartScatterSeries, lineMethods, {
  29192. getPointCenterByArg: function(arg) {
  29193. var value = this.getArgumentAxis().getTranslator().translate(arg);
  29194. return {
  29195. x: value,
  29196. y: value
  29197. }
  29198. }
  29199. });
  29200. exports.chart.stepline = _extend({}, lineSeries, {
  29201. _calculateStepLinePoints: function(points) {
  29202. var segment = [];
  29203. var coordName = this._options.rotated ? "x" : "y";
  29204. _each(points, function(i, pt) {
  29205. var point;
  29206. if (!i) {
  29207. segment.push(pt);
  29208. return
  29209. }
  29210. var step = segment[segment.length - 1][coordName];
  29211. if (step !== pt[coordName]) {
  29212. point = objectUtils.clone(pt);
  29213. point[coordName] = step;
  29214. segment.push(point)
  29215. }
  29216. segment.push(pt)
  29217. });
  29218. return segment
  29219. },
  29220. _prepareSegment: function(points) {
  29221. return lineSeries._prepareSegment(this._calculateStepLinePoints(points))
  29222. },
  29223. getSeriesPairCoord: function(coord, isArgument) {
  29224. var oppositeCoord;
  29225. var rotated = this._options.rotated;
  29226. var isOpposite = !isArgument && !rotated || isArgument && rotated;
  29227. var coordName = !isOpposite ? "vx" : "vy";
  29228. var oppositeCoordName = !isOpposite ? "vy" : "vx";
  29229. var nearestPoints = this.getNearestPointsByCoord(coord, isArgument);
  29230. for (var i = 0; i < nearestPoints.length; i++) {
  29231. var p = nearestPoints[i];
  29232. var tmpCoord = void 0;
  29233. if (isArgument) {
  29234. tmpCoord = coord !== p[1][coordName] ? p[0][oppositeCoordName] : p[1][oppositeCoordName]
  29235. } else {
  29236. tmpCoord = coord === p[0][coordName] ? p[0][oppositeCoordName] : p[1][oppositeCoordName]
  29237. }
  29238. if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
  29239. oppositeCoord = tmpCoord;
  29240. break
  29241. }
  29242. }
  29243. return oppositeCoord
  29244. }
  29245. });
  29246. exports.chart.spline = _extend({}, lineSeries, {
  29247. _calculateBezierPoints: function(src, rotated) {
  29248. var bezierPoints = [];
  29249. var pointsCopy = src;
  29250. var checkExtremum = function(otherPointCoord, pointCoord, controlCoord) {
  29251. return otherPointCoord > pointCoord && controlCoord > otherPointCoord || otherPointCoord < pointCoord && controlCoord < otherPointCoord ? otherPointCoord : controlCoord
  29252. };
  29253. if (1 !== pointsCopy.length) {
  29254. pointsCopy.forEach(function(curPoint, i) {
  29255. var leftControlX;
  29256. var leftControlY;
  29257. var rightControlX;
  29258. var rightControlY;
  29259. var prevPoint = pointsCopy[i - 1];
  29260. var nextPoint = pointsCopy[i + 1];
  29261. var x1;
  29262. var x2;
  29263. var y1;
  29264. var y2;
  29265. var lambda = .5;
  29266. var a;
  29267. var b;
  29268. var c;
  29269. var xc;
  29270. var yc;
  29271. var shift;
  29272. if (!i || i === pointsCopy.length - 1) {
  29273. bezierPoints.push(curPoint, curPoint);
  29274. return
  29275. }
  29276. var xCur = curPoint.x;
  29277. var yCur = curPoint.y;
  29278. x1 = prevPoint.x;
  29279. x2 = nextPoint.x;
  29280. y1 = prevPoint.y;
  29281. y2 = nextPoint.y;
  29282. var curIsExtremum = !!(!rotated && (yCur <= prevPoint.y && yCur <= nextPoint.y || yCur >= prevPoint.y && yCur >= nextPoint.y) || rotated && (xCur <= prevPoint.x && xCur <= nextPoint.x || xCur >= prevPoint.x && xCur >= nextPoint.x));
  29283. if (curIsExtremum) {
  29284. if (!rotated) {
  29285. rightControlY = leftControlY = yCur;
  29286. rightControlX = (xCur + nextPoint.x) / 2;
  29287. leftControlX = (xCur + prevPoint.x) / 2
  29288. } else {
  29289. rightControlX = leftControlX = xCur;
  29290. rightControlY = (yCur + nextPoint.y) / 2;
  29291. leftControlY = (yCur + prevPoint.y) / 2
  29292. }
  29293. } else {
  29294. a = y2 - y1;
  29295. b = x1 - x2;
  29296. c = y1 * x2 - x1 * y2;
  29297. if (!rotated) {
  29298. if (!b) {
  29299. bezierPoints.push(curPoint, curPoint, curPoint);
  29300. return
  29301. }
  29302. xc = xCur;
  29303. yc = -1 * (a * xc + c) / b;
  29304. shift = yc - yCur;
  29305. y1 -= shift;
  29306. y2 -= shift
  29307. } else {
  29308. if (!a) {
  29309. bezierPoints.push(curPoint, curPoint, curPoint);
  29310. return
  29311. }
  29312. yc = yCur;
  29313. xc = -1 * (b * yc + c) / a;
  29314. shift = xc - xCur;
  29315. x1 -= shift;
  29316. x2 -= shift
  29317. }
  29318. rightControlX = (xCur + lambda * x2) / (1 + lambda);
  29319. rightControlY = (yCur + lambda * y2) / (1 + lambda);
  29320. leftControlX = (xCur + lambda * x1) / (1 + lambda);
  29321. leftControlY = (yCur + lambda * y1) / (1 + lambda)
  29322. }
  29323. if (!rotated) {
  29324. leftControlY = checkExtremum(prevPoint.y, yCur, leftControlY);
  29325. rightControlY = checkExtremum(nextPoint.y, yCur, rightControlY)
  29326. } else {
  29327. leftControlX = checkExtremum(prevPoint.x, xCur, leftControlX);
  29328. rightControlX = checkExtremum(nextPoint.x, xCur, rightControlX)
  29329. }
  29330. var leftPoint = clonePoint(curPoint, leftControlX, leftControlY);
  29331. var rightPoint = clonePoint(curPoint, rightControlX, rightControlY);
  29332. bezierPoints.push(leftPoint, curPoint, rightPoint)
  29333. })
  29334. } else {
  29335. bezierPoints.push(pointsCopy[0])
  29336. }
  29337. return bezierPoints
  29338. },
  29339. _prepareSegment: function(points, rotated) {
  29340. return lineSeries._prepareSegment(this._calculateBezierPoints(points, rotated))
  29341. },
  29342. _createMainElement: function(points, settings) {
  29343. return this._renderer.path(points, "bezier").attr(settings).sharp()
  29344. },
  29345. getSeriesPairCoord: function(coord, isArgument) {
  29346. var that = this;
  29347. var oppositeCoord = null;
  29348. var isOpposite = !isArgument && !this._options.rotated || isArgument && this._options.rotated;
  29349. var coordName = !isOpposite ? "vx" : "vy";
  29350. var bezierCoordName = !isOpposite ? "x" : "y";
  29351. var oppositeCoordName = !isOpposite ? "vy" : "vx";
  29352. var bezierOppositeCoordName = !isOpposite ? "y" : "x";
  29353. var axis = !isArgument ? that.getArgumentAxis() : that.getValueAxis();
  29354. var visibleArea = axis.getVisibleArea();
  29355. var nearestPoints = this.getNearestPointsByCoord(coord, isArgument);
  29356. var _loop = function(i) {
  29357. var p = nearestPoints[i];
  29358. if (1 === p.length) {
  29359. visibleArea[0] <= p[0][oppositeCoordName] && visibleArea[1] >= p[0][oppositeCoordName] && (oppositeCoord = p[0][oppositeCoordName])
  29360. } else {
  29361. var ts = obtainCubicBezierTCoef(coord, p[0][coordName], p[1][bezierCoordName], p[2][bezierCoordName], p[3][coordName]);
  29362. ts.forEach(function(t) {
  29363. if (t >= 0 && t <= 1) {
  29364. var tmpCoord = Math.pow(1 - t, 3) * p[0][oppositeCoordName] + 3 * Math.pow(1 - t, 2) * t * p[1][bezierOppositeCoordName] + 3 * (1 - t) * t * t * p[2][bezierOppositeCoordName] + t * t * t * p[3][oppositeCoordName];
  29365. if (visibleArea[0] <= tmpCoord && visibleArea[1] >= tmpCoord) {
  29366. oppositeCoord = tmpCoord
  29367. }
  29368. }
  29369. })
  29370. }
  29371. if (null !== oppositeCoord) {
  29372. return "break"
  29373. }
  29374. };
  29375. for (var i = 0; i < nearestPoints.length; i++) {
  29376. var _ret = _loop(i);
  29377. if ("break" === _ret) {
  29378. break
  29379. }
  29380. }
  29381. return oppositeCoord
  29382. },
  29383. getNearestPointsByCoord: function(coord, isArgument) {
  29384. var that = this;
  29385. var rotated = that.getOptions().rotated;
  29386. var isOpposite = !isArgument && !rotated || isArgument && rotated;
  29387. var coordName = isOpposite ? "vy" : "vx";
  29388. var points = that.getVisiblePoints();
  29389. var allPoints = that.getPoints();
  29390. var bezierPoints = that._segments.length > 0 ? that._segments.reduce(function(a, seg) {
  29391. return a.concat(seg.line)
  29392. }, []) : [];
  29393. var nearestPoints = [];
  29394. if (that.isVisible() && allPoints.length > 0) {
  29395. if (allPoints.length > 1) {
  29396. that.findNeighborPointsByCoord(coord, coordName, points.slice(0), allPoints, function(point, nextPoint) {
  29397. var index = bezierPoints.indexOf(point);
  29398. nearestPoints.push([point, bezierPoints[index + 1], bezierPoints[index + 2], nextPoint])
  29399. })
  29400. } else {
  29401. if (allPoints[0][coordName] === coord) {
  29402. nearestPoints.push([allPoints[0]])
  29403. }
  29404. }
  29405. }
  29406. return nearestPoints
  29407. }
  29408. });
  29409. exports.polar.line = _extend({}, polarScatterSeries, lineMethods, {
  29410. _sortPoints: function(points) {
  29411. return points
  29412. },
  29413. _prepareSegment: function(points, rotated, lastSegment) {
  29414. var preparedPoints = [];
  29415. var centerPoint = this.getValueAxis().getCenter();
  29416. var i;
  29417. lastSegment && this._closeSegment(points);
  29418. if (this.argumentAxisType !== DISCRETE && this.valueAxisType !== DISCRETE) {
  29419. for (i = 1; i < points.length; i++) {
  29420. preparedPoints = preparedPoints.concat(this._getTangentPoints(points[i], points[i - 1], centerPoint))
  29421. }
  29422. if (!preparedPoints.length) {
  29423. preparedPoints = points
  29424. }
  29425. } else {
  29426. return lineSeries._prepareSegment.call(this, points)
  29427. }
  29428. return {
  29429. line: preparedPoints
  29430. }
  29431. },
  29432. _getRemainingAngle: function(angle) {
  29433. var normAngle = normalizeAngle(angle);
  29434. return angle >= 0 ? 360 - normAngle : -normAngle
  29435. },
  29436. _closeSegment: function(points) {
  29437. var point;
  29438. var differenceAngle;
  29439. if (this._segments.length) {
  29440. point = this._segments[0].line[0]
  29441. } else {
  29442. point = clonePoint(points[0], points[0].x, points[0].y, points[0].angle)
  29443. }
  29444. if (points[points.length - 1].angle !== point.angle) {
  29445. if (normalizeAngle(Math.round(points[points.length - 1].angle)) === normalizeAngle(Math.round(point.angle))) {
  29446. point.angle = points[points.length - 1].angle
  29447. } else {
  29448. differenceAngle = points[points.length - 1].angle - point.angle;
  29449. point.angle = points[points.length - 1].angle + this._getRemainingAngle(differenceAngle)
  29450. }
  29451. points.push(point)
  29452. }
  29453. },
  29454. _getTangentPoints: function(point, prevPoint, centerPoint) {
  29455. var tangentPoints = [];
  29456. var betweenAngle = Math.round(prevPoint.angle - point.angle);
  29457. var tan = (prevPoint.radius - point.radius) / betweenAngle;
  29458. var i;
  29459. if (0 === betweenAngle) {
  29460. tangentPoints = [prevPoint, point]
  29461. } else {
  29462. if (betweenAngle > 0) {
  29463. for (i = betweenAngle; i >= 0; i--) {
  29464. tangentPoints.push(getTangentPoint(point, prevPoint, centerPoint, tan, i))
  29465. }
  29466. } else {
  29467. for (i = 0; i >= betweenAngle; i--) {
  29468. tangentPoints.push(getTangentPoint(point, prevPoint, centerPoint, tan, betweenAngle - i))
  29469. }
  29470. }
  29471. }
  29472. return tangentPoints
  29473. }
  29474. })
  29475. },
  29476. /*!****************************************************!*\
  29477. !*** ./artifacts/transpiled/viz/axes/base_axis.js ***!
  29478. \****************************************************/
  29479. /*! dynamic exports provided */
  29480. /*! all exports used */
  29481. function(module, exports, __webpack_require__) {
  29482. var _smart_formatter = __webpack_require__( /*! ./smart_formatter */ 405);
  29483. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  29484. var _utils2 = _interopRequireDefault(_utils);
  29485. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  29486. var _axes_constants = __webpack_require__( /*! ./axes_constants */ 248);
  29487. var _axes_constants2 = _interopRequireDefault(_axes_constants);
  29488. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  29489. var _array = __webpack_require__( /*! ../../core/utils/array */ 14);
  29490. var _format_helper = __webpack_require__( /*! ../../format_helper */ 64);
  29491. var _format_helper2 = _interopRequireDefault(_format_helper);
  29492. var _parse_utils = __webpack_require__( /*! ../components/parse_utils */ 244);
  29493. var _parse_utils2 = _interopRequireDefault(_parse_utils);
  29494. var _tick_generator = __webpack_require__( /*! ./tick_generator */ 406);
  29495. var _tick_generator2 = _interopRequireDefault(_tick_generator);
  29496. var _translator2d = __webpack_require__( /*! ../translators/translator2d */ 249);
  29497. var _translator2d2 = _interopRequireDefault(_translator2d);
  29498. var _range = __webpack_require__( /*! ../translators/range */ 108);
  29499. var _tick = __webpack_require__( /*! ./tick */ 407);
  29500. var _math2 = __webpack_require__( /*! ../../core/utils/math */ 28);
  29501. var _date = __webpack_require__( /*! ../../core/utils/date */ 22);
  29502. var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
  29503. var _xy_axes = __webpack_require__( /*! ./xy_axes */ 408);
  29504. var _xy_axes2 = _interopRequireDefault(_xy_axes);
  29505. var _polar_axes = __webpack_require__( /*! ./polar_axes */ 784);
  29506. var _polar_axes2 = _interopRequireDefault(_polar_axes);
  29507. var _constant_line = __webpack_require__( /*! ./constant_line */ 785);
  29508. var _constant_line2 = _interopRequireDefault(_constant_line);
  29509. var _strip = __webpack_require__( /*! ./strip */ 786);
  29510. var _strip2 = _interopRequireDefault(_strip);
  29511. function _interopRequireDefault(obj) {
  29512. return obj && obj.__esModule ? obj : {
  29513. "default": obj
  29514. }
  29515. }
  29516. function _defineProperty(obj, key, value) {
  29517. if (key in obj) {
  29518. Object.defineProperty(obj, key, {
  29519. value: value,
  29520. enumerable: true,
  29521. configurable: true,
  29522. writable: true
  29523. })
  29524. } else {
  29525. obj[key] = value
  29526. }
  29527. return obj
  29528. }
  29529. var convertTicksToValues = _axes_constants2.default.convertTicksToValues;
  29530. var patchFontOptions = _utils2.default.patchFontOptions;
  29531. var getVizRangeObject = _utils2.default.getVizRangeObject;
  29532. var _math = Math;
  29533. var _abs = _math.abs;
  29534. var _max = _math.max;
  29535. var _min = _math.min;
  29536. var _isArray = Array.isArray;
  29537. var DEFAULT_AXIS_LABEL_SPACING = 5;
  29538. var MAX_GRID_BORDER_ADHENSION = 4;
  29539. var TOP = _axes_constants2.default.top;
  29540. var BOTTOM = _axes_constants2.default.bottom;
  29541. var LEFT = _axes_constants2.default.left;
  29542. var RIGHT = _axes_constants2.default.right;
  29543. var CENTER = _axes_constants2.default.center;
  29544. var KEEP = "keep";
  29545. var SHIFT = "shift";
  29546. var RESET = "reset";
  29547. var ROTATE = "rotate";
  29548. var DEFAULT_AXIS_DIVISION_FACTOR = 50;
  29549. var DEFAULT_MINOR_AXIS_DIVISION_FACTOR = 15;
  29550. var SCROLL_THRESHOLD = 5;
  29551. var MAX_MARGIN_VALUE = .8;
  29552. var dateIntervals = {
  29553. day: 864e5,
  29554. week: 6048e5
  29555. };
  29556. function getTickGenerator(options, incidentOccurred, skipTickGeneration, rangeIsEmpty, adjustDivisionFactor) {
  29557. return _tick_generator2.default.tickGenerator({
  29558. axisType: options.type,
  29559. dataType: options.dataType,
  29560. logBase: options.logarithmBase,
  29561. axisDivisionFactor: adjustDivisionFactor(options.axisDivisionFactor || DEFAULT_AXIS_DIVISION_FACTOR),
  29562. minorAxisDivisionFactor: adjustDivisionFactor(options.minorAxisDivisionFactor || DEFAULT_MINOR_AXIS_DIVISION_FACTOR),
  29563. numberMultipliers: options.numberMultipliers,
  29564. calculateMinors: options.minorTick.visible || options.minorGrid.visible || options.calculateMinors,
  29565. allowDecimals: options.allowDecimals,
  29566. endOnTick: options.endOnTick,
  29567. incidentOccurred: incidentOccurred,
  29568. firstDayOfWeek: options.workWeek && options.workWeek[0],
  29569. skipTickGeneration: skipTickGeneration,
  29570. skipCalculationLimits: options.skipCalculationLimits,
  29571. generateExtraTick: options.generateExtraTick,
  29572. minTickInterval: options.minTickInterval,
  29573. rangeIsEmpty: rangeIsEmpty
  29574. })
  29575. }
  29576. function createMajorTick(axis, renderer, skippedCategory) {
  29577. var options = axis.getOptions();
  29578. return (0, _tick.tick)(axis, renderer, options.tick, options.grid, skippedCategory, false)
  29579. }
  29580. function createMinorTick(axis, renderer) {
  29581. var options = axis.getOptions();
  29582. return (0, _tick.tick)(axis, renderer, options.minorTick, options.minorGrid)
  29583. }
  29584. function createBoundaryTick(axis, renderer, isFirst) {
  29585. var options = axis.getOptions();
  29586. return (0, _tick.tick)(axis, renderer, (0, _extend.extend)({}, options.tick, {
  29587. visible: options.showCustomBoundaryTicks
  29588. }), options.grid, void 0, false, isFirst ? -1 : 1)
  29589. }
  29590. function callAction(elements, action, actionArgument1, actionArgument2) {
  29591. (elements || []).forEach(function(e) {
  29592. return e[action](actionArgument1, actionArgument2)
  29593. })
  29594. }
  29595. function initTickCoords(ticks) {
  29596. callAction(ticks, "initCoords")
  29597. }
  29598. function drawTickMarks(ticks, options) {
  29599. callAction(ticks, "drawMark", options)
  29600. }
  29601. function drawGrids(ticks, drawLine) {
  29602. callAction(ticks, "drawGrid", drawLine)
  29603. }
  29604. function updateTicksPosition(ticks, options, animate) {
  29605. callAction(ticks, "updateTickPosition", options, animate)
  29606. }
  29607. function updateGridsPosition(ticks, animate) {
  29608. callAction(ticks, "updateGridPosition", animate)
  29609. }
  29610. var measureLabels = exports.measureLabels = function(items) {
  29611. items.forEach(function(item) {
  29612. item.labelBBox = item.label ? item.label.getBBox() : {
  29613. x: 0,
  29614. y: 0,
  29615. width: 0,
  29616. height: 0
  29617. }
  29618. })
  29619. };
  29620. function cleanUpInvalidTicks(ticks) {
  29621. var i = ticks.length - 1;
  29622. for (i; i >= 0; i--) {
  29623. if (!removeInvalidTick(ticks, i)) {
  29624. break
  29625. }
  29626. }
  29627. for (i = 0; i < ticks.length; i++) {
  29628. if (removeInvalidTick(ticks, i)) {
  29629. i--
  29630. } else {
  29631. break
  29632. }
  29633. }
  29634. }
  29635. function removeInvalidTick(ticks, i) {
  29636. if (null === ticks[i].coords.x || null === ticks[i].coords.y) {
  29637. ticks.splice(i, 1);
  29638. return true
  29639. }
  29640. return false
  29641. }
  29642. function validateAxisOptions(options) {
  29643. var labelOptions = options.label;
  29644. var position = options.position;
  29645. var defaultPosition = options.isHorizontal ? BOTTOM : LEFT;
  29646. var secondaryPosition = options.isHorizontal ? TOP : RIGHT;
  29647. if (position !== defaultPosition && position !== secondaryPosition) {
  29648. position = defaultPosition
  29649. }
  29650. if (position === RIGHT && !labelOptions.userAlignment) {
  29651. labelOptions.alignment = LEFT
  29652. }
  29653. options.position = position;
  29654. options.hoverMode = options.hoverMode ? options.hoverMode.toLowerCase() : "none";
  29655. labelOptions.minSpacing = (0, _type.isDefined)(labelOptions.minSpacing) ? labelOptions.minSpacing : DEFAULT_AXIS_LABEL_SPACING;
  29656. options.type && (options.type = options.type.toLowerCase());
  29657. options.argumentType && (options.argumentType = options.argumentType.toLowerCase());
  29658. options.valueType && (options.valueType = options.valueType.toLowerCase())
  29659. }
  29660. function getOptimalAngle(boxes, labelOpt) {
  29661. var angle = 180 * _math.asin((boxes[0].height + labelOpt.minSpacing) / (boxes[1].x - boxes[0].x)) / _math.PI;
  29662. return angle < 45 ? -45 : -90
  29663. }
  29664. function updateLabels(ticks, step, func) {
  29665. ticks.forEach(function(tick, index) {
  29666. if (tick.label) {
  29667. if (index % step !== 0) {
  29668. tick.removeLabel()
  29669. } else {
  29670. if (func) {
  29671. func(tick, index)
  29672. }
  29673. }
  29674. }
  29675. })
  29676. }
  29677. function valueOf(value) {
  29678. return value.valueOf()
  29679. }
  29680. function getZoomBoundValue(optionValue, dataValue) {
  29681. if (void 0 === optionValue) {
  29682. return dataValue
  29683. } else {
  29684. if (null === optionValue) {
  29685. return
  29686. } else {
  29687. return optionValue
  29688. }
  29689. }
  29690. }
  29691. function configureGenerator(options, axisDivisionFactor, viewPort, screenDelta, minTickInterval) {
  29692. var tickGeneratorOptions = (0, _extend.extend)({}, options, {
  29693. endOnTick: true,
  29694. axisDivisionFactor: axisDivisionFactor,
  29695. skipCalculationLimits: true,
  29696. generateExtraTick: true,
  29697. minTickInterval: minTickInterval
  29698. });
  29699. return function(tickInterval, skipTickGeneration, min, max, breaks) {
  29700. return getTickGenerator(tickGeneratorOptions, _common.noop, skipTickGeneration, viewPort.isEmpty(), function(v) {
  29701. return v
  29702. })({
  29703. min: min,
  29704. max: max,
  29705. categories: viewPort.categories,
  29706. isSpacedMargin: viewPort.isSpacedMargin,
  29707. checkMinDataVisibility: viewPort.checkMinDataVisibility,
  29708. checkMaxDataVisibility: viewPort.checkMaxDataVisibility
  29709. }, screenDelta, tickInterval, (0, _type.isDefined)(tickInterval), void 0, void 0, void 0, breaks)
  29710. }
  29711. }
  29712. function convertVisualRangeObject(visualRange, optionValue) {
  29713. return _utils2.default.convertVisualRangeObject(visualRange, !_isArray(optionValue))
  29714. }
  29715. function getConstantLineSharpDirection(coord, axisCanvas) {
  29716. return Math.max(axisCanvas.start, axisCanvas.end) !== coord ? 1 : -1
  29717. }
  29718. var calculateCanvasMargins = exports.calculateCanvasMargins = function(bBoxes, canvas) {
  29719. var cLeft = canvas.left;
  29720. var cTop = canvas.top;
  29721. var cRight = canvas.width - canvas.right;
  29722. var cBottom = canvas.height - canvas.bottom;
  29723. return bBoxes.reduce(function(margins, bBox) {
  29724. if (!bBox || bBox.isEmpty) {
  29725. return margins
  29726. }
  29727. return {
  29728. left: _max(margins.left, cLeft - bBox.x),
  29729. top: _max(margins.top, cTop - bBox.y),
  29730. right: _max(margins.right, bBox.x + bBox.width - cRight),
  29731. bottom: _max(margins.bottom, bBox.y + bBox.height - cBottom)
  29732. }
  29733. }, {
  29734. left: 0,
  29735. right: 0,
  29736. top: 0,
  29737. bottom: 0
  29738. })
  29739. };
  29740. var Axis = exports.Axis = function(renderSettings) {
  29741. var that = this;
  29742. that._renderer = renderSettings.renderer;
  29743. that._incidentOccurred = renderSettings.incidentOccurred;
  29744. that._eventTrigger = renderSettings.eventTrigger;
  29745. that._stripsGroup = renderSettings.stripsGroup;
  29746. that._labelAxesGroup = renderSettings.labelAxesGroup;
  29747. that._constantLinesGroup = renderSettings.constantLinesGroup;
  29748. that._scaleBreaksGroup = renderSettings.scaleBreaksGroup;
  29749. that._axesContainerGroup = renderSettings.axesContainerGroup;
  29750. that._gridContainerGroup = renderSettings.gridGroup;
  29751. that._axisCssPrefix = renderSettings.widgetClass + "-" + (renderSettings.axisClass ? renderSettings.axisClass + "-" : "");
  29752. that._setType(renderSettings.axisType, renderSettings.drawingType);
  29753. that._createAxisGroups();
  29754. that._translator = that._createTranslator();
  29755. that.isArgumentAxis = renderSettings.isArgumentAxis;
  29756. that._viewport = {};
  29757. that._firstDrawing = true;
  29758. that._initRange = {}
  29759. };
  29760. Axis.prototype = {
  29761. constructor: Axis,
  29762. _drawAxis: function() {
  29763. var options = this._options;
  29764. if (!options.visible) {
  29765. return
  29766. }
  29767. this._axisElement = this._createAxisElement();
  29768. this._updateAxisElementPosition();
  29769. this._axisElement.attr({
  29770. "stroke-width": options.width,
  29771. stroke: options.color,
  29772. "stroke-opacity": options.opacity
  29773. }).sharp(this._getSharpParam(true), this.getAxisSharpDirection()).append(this._axisLineGroup)
  29774. },
  29775. _createPathElement: function(points, attr, sharpDirection) {
  29776. return this.sharp(this._renderer.path(points, "line").attr(attr), sharpDirection)
  29777. },
  29778. sharp: function(svgElement) {
  29779. var sharpDirection = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1;
  29780. return svgElement.sharp(this._getSharpParam(), sharpDirection)
  29781. },
  29782. getAxisSharpDirection: function() {
  29783. var position = this._options.position;
  29784. return position === TOP || position === LEFT ? 1 : -1
  29785. },
  29786. getSharpDirectionByCoords: function(coords) {
  29787. var canvas = this._getCanvasStartEnd();
  29788. var maxCoord = Math.max(canvas.start, canvas.end);
  29789. return this.getRadius ? 0 : maxCoord !== coords[this._isHorizontal ? "x" : "y"] ? 1 : -1
  29790. },
  29791. _getGridLineDrawer: function() {
  29792. var that = this;
  29793. return function(tick, gridStyle) {
  29794. var grid = that._getGridPoints(tick.coords);
  29795. if (grid.points) {
  29796. return that._createPathElement(grid.points, gridStyle, that.getSharpDirectionByCoords(tick.coords))
  29797. }
  29798. return null
  29799. }
  29800. },
  29801. _getGridPoints: function(coords) {
  29802. var that = this;
  29803. var isHorizontal = this._isHorizontal;
  29804. var tickPositionField = isHorizontal ? "x" : "y";
  29805. var orthogonalPositions = this._orthogonalPositions;
  29806. var positionFrom = orthogonalPositions.start;
  29807. var positionTo = orthogonalPositions.end;
  29808. var borderOptions = that.borderOptions;
  29809. var canvasStart = isHorizontal ? LEFT : TOP;
  29810. var canvasEnd = isHorizontal ? RIGHT : BOTTOM;
  29811. var axisCanvas = that.getCanvas();
  29812. var canvas = {
  29813. left: axisCanvas.left,
  29814. right: axisCanvas.width - axisCanvas.right,
  29815. top: axisCanvas.top,
  29816. bottom: axisCanvas.height - axisCanvas.bottom
  29817. };
  29818. var firstBorderLinePosition = borderOptions.visible && borderOptions[canvasStart] ? canvas[canvasStart] : void 0;
  29819. var lastBorderLinePosition = borderOptions.visible && borderOptions[canvasEnd] ? canvas[canvasEnd] : void 0;
  29820. var minDelta = MAX_GRID_BORDER_ADHENSION + firstBorderLinePosition;
  29821. var maxDelta = lastBorderLinePosition - MAX_GRID_BORDER_ADHENSION;
  29822. if (that.areCoordsOutsideAxis(coords) || void 0 === coords[tickPositionField] || coords[tickPositionField] < minDelta || coords[tickPositionField] > maxDelta) {
  29823. return {
  29824. points: null
  29825. }
  29826. }
  29827. return {
  29828. points: isHorizontal ? null !== coords[tickPositionField] ? [coords[tickPositionField], positionFrom, coords[tickPositionField], positionTo] : null : null !== coords[tickPositionField] ? [positionFrom, coords[tickPositionField], positionTo, coords[tickPositionField]] : null
  29829. }
  29830. },
  29831. _getConstantLinePos: function(parsedValue, canvasStart, canvasEnd) {
  29832. var value = this._getTranslatedCoord(parsedValue);
  29833. if (!(0, _type.isDefined)(value) || value < _min(canvasStart, canvasEnd) || value > _max(canvasStart, canvasEnd)) {
  29834. return
  29835. }
  29836. return value
  29837. },
  29838. _getConstantLineGraphicAttributes: function(value) {
  29839. var positionFrom = this._orthogonalPositions.start;
  29840. var positionTo = this._orthogonalPositions.end;
  29841. return {
  29842. points: this._isHorizontal ? [value, positionFrom, value, positionTo] : [positionFrom, value, positionTo, value]
  29843. }
  29844. },
  29845. _createConstantLine: function(value, attr) {
  29846. return this._createPathElement(this._getConstantLineGraphicAttributes(value).points, attr, getConstantLineSharpDirection(value, this._getCanvasStartEnd()))
  29847. },
  29848. _drawConstantLineLabelText: function(text, x, y, _ref, group) {
  29849. var font = _ref.font,
  29850. cssClass = _ref.cssClass;
  29851. return this._renderer.text(text, x, y).css(patchFontOptions((0, _extend.extend)({}, this._options.label.font, font))).attr({
  29852. align: "center",
  29853. "class": cssClass
  29854. }).append(group)
  29855. },
  29856. _drawConstantLineLabels: function(parsedValue, lineLabelOptions, value, group) {
  29857. var that = this;
  29858. var text = lineLabelOptions.text;
  29859. var options = that._options;
  29860. var labelOptions = options.label;
  29861. that._checkAlignmentConstantLineLabels(lineLabelOptions);
  29862. text = (0, _type.isDefined)(text) ? text : that.formatLabel(parsedValue, labelOptions);
  29863. var coords = that._getConstantLineLabelsCoords(value, lineLabelOptions);
  29864. return that._drawConstantLineLabelText(text, coords.x, coords.y, lineLabelOptions, group)
  29865. },
  29866. _getStripPos: function(startValue, endValue, canvasStart, canvasEnd, range) {
  29867. var isContinuous = !!(range.minVisible || range.maxVisible);
  29868. var categories = (range.categories || []).reduce(function(result, cat) {
  29869. result.push(cat.valueOf());
  29870. return result
  29871. }, []);
  29872. var start;
  29873. var end;
  29874. if (!isContinuous) {
  29875. if ((0, _type.isDefined)(startValue) && (0, _type.isDefined)(endValue)) {
  29876. var parsedStartValue = this.parser(startValue);
  29877. var parsedEndValue = this.parser(endValue);
  29878. var startCategoryIndex = (0, _array.inArray)((0, _type.isDefined)(parsedStartValue) ? parsedStartValue.valueOf() : void 0, categories);
  29879. var endCategoryIndex = (0, _array.inArray)((0, _type.isDefined)(parsedEndValue) ? parsedEndValue.valueOf() : void 0, categories);
  29880. if (startCategoryIndex === -1 || endCategoryIndex === -1) {
  29881. return {
  29882. from: 0,
  29883. to: 0,
  29884. outOfCanvas: true
  29885. }
  29886. }
  29887. if (startCategoryIndex > endCategoryIndex) {
  29888. var swap = endValue;
  29889. endValue = startValue;
  29890. startValue = swap
  29891. }
  29892. }
  29893. }
  29894. if ((0, _type.isDefined)(startValue)) {
  29895. startValue = this.validateUnit(startValue, "E2105", "strip");
  29896. start = this._getTranslatedCoord(startValue, -1)
  29897. } else {
  29898. start = canvasStart
  29899. }
  29900. if ((0, _type.isDefined)(endValue)) {
  29901. endValue = this.validateUnit(endValue, "E2105", "strip");
  29902. end = this._getTranslatedCoord(endValue, 1)
  29903. } else {
  29904. end = canvasEnd
  29905. }
  29906. var stripPosition = start < end ? {
  29907. from: start,
  29908. to: end
  29909. } : {
  29910. from: end,
  29911. to: start
  29912. };
  29913. var visibleArea = this.getVisibleArea();
  29914. if (stripPosition.from <= visibleArea[0] && stripPosition.to <= visibleArea[0] || stripPosition.from >= visibleArea[1] && stripPosition.to >= visibleArea[1]) {
  29915. stripPosition.outOfCanvas = true
  29916. }
  29917. return stripPosition
  29918. },
  29919. _getStripGraphicAttributes: function(fromPoint, toPoint) {
  29920. var x;
  29921. var y;
  29922. var width;
  29923. var height;
  29924. var orthogonalPositions = this._orthogonalPositions;
  29925. var positionFrom = orthogonalPositions.start;
  29926. var positionTo = orthogonalPositions.end;
  29927. if (this._isHorizontal) {
  29928. x = fromPoint;
  29929. y = _min(positionFrom, positionTo);
  29930. width = toPoint - fromPoint;
  29931. height = _abs(positionFrom - positionTo)
  29932. } else {
  29933. x = _min(positionFrom, positionTo);
  29934. y = fromPoint;
  29935. width = _abs(positionFrom - positionTo);
  29936. height = _abs(fromPoint - toPoint)
  29937. }
  29938. return {
  29939. x: x,
  29940. y: y,
  29941. width: width,
  29942. height: height
  29943. }
  29944. },
  29945. _createStrip: function(attrs) {
  29946. return this._renderer.rect(attrs.x, attrs.y, attrs.width, attrs.height)
  29947. },
  29948. _adjustStripLabels: function() {
  29949. var that = this;
  29950. this._strips.forEach(function(strip) {
  29951. if (strip.label) {
  29952. strip.label.attr(that._getAdjustedStripLabelCoords(strip))
  29953. }
  29954. })
  29955. },
  29956. _adjustLabelsCoord: function(offset, maxWidth, checkCanvas) {
  29957. var that = this;
  29958. that._majorTicks.forEach(function(tick) {
  29959. if (tick.label) {
  29960. tick.label.attr(that._getLabelAdjustedCoord(tick, offset + (tick.labelOffset || 0), maxWidth, checkCanvas))
  29961. }
  29962. })
  29963. },
  29964. _adjustLabels: function(offset) {
  29965. var that = this;
  29966. var maxSize = that._majorTicks.reduce(function(size, tick) {
  29967. if (!tick.label) {
  29968. return size
  29969. }
  29970. var bBox = tick.labelRotationAngle ? _utils2.default.rotateBBox(tick.labelBBox, [tick.labelCoords.x, tick.labelCoords.y], -tick.labelRotationAngle) : tick.labelBBox;
  29971. return {
  29972. width: _max(size.width || 0, bBox.width),
  29973. height: _max(size.height || 0, bBox.height),
  29974. offset: _max(size.offset || 0, tick.labelOffset || 0)
  29975. }
  29976. }, {});
  29977. var additionalOffset = that._isHorizontal ? maxSize.height : maxSize.width;
  29978. that._adjustLabelsCoord(offset, maxSize.width);
  29979. return offset + additionalOffset + (additionalOffset && that._options.label.indentFromAxis) + maxSize.offset
  29980. },
  29981. _getLabelAdjustedCoord: function(tick, offset, maxWidth) {
  29982. offset = offset || 0;
  29983. var that = this;
  29984. var options = that._options;
  29985. var box = _utils2.default.rotateBBox(tick.labelBBox, [tick.labelCoords.x, tick.labelCoords.y], -tick.labelRotationAngle || 0);
  29986. var position = options.position;
  29987. var textAlign = tick.labelAlignment || options.label.alignment;
  29988. var isDiscrete = "discrete" === that._options.type;
  29989. var isFlatLabel = tick.labelRotationAngle % 90 === 0;
  29990. var indentFromAxis = options.label.indentFromAxis;
  29991. var axisPosition = that._axisPosition;
  29992. var labelCoords = tick.labelCoords;
  29993. var labelX = labelCoords.x;
  29994. var translateX;
  29995. var translateY;
  29996. if (that._isHorizontal) {
  29997. if (position === BOTTOM) {
  29998. translateY = axisPosition + indentFromAxis - box.y + offset
  29999. } else {
  30000. translateY = axisPosition - indentFromAxis - (box.y + box.height) - offset
  30001. }
  30002. if (textAlign === RIGHT) {
  30003. translateX = isDiscrete && isFlatLabel ? tick.coords.x - (box.x + box.width) : labelX - box.x - box.width
  30004. } else {
  30005. if (textAlign === LEFT) {
  30006. translateX = isDiscrete && isFlatLabel ? labelX - box.x - (tick.coords.x - labelX) : labelX - box.x
  30007. } else {
  30008. translateX = labelX - box.x - box.width / 2
  30009. }
  30010. }
  30011. } else {
  30012. translateY = labelCoords.y - box.y - box.height / 2;
  30013. if (position === LEFT) {
  30014. if (textAlign === LEFT) {
  30015. translateX = axisPosition - indentFromAxis - maxWidth - box.x
  30016. } else {
  30017. if (textAlign === CENTER) {
  30018. translateX = axisPosition - indentFromAxis - maxWidth / 2 - box.x - box.width / 2
  30019. } else {
  30020. translateX = axisPosition - indentFromAxis - box.x - box.width
  30021. }
  30022. }
  30023. translateX -= offset
  30024. } else {
  30025. if (textAlign === RIGHT) {
  30026. translateX = axisPosition + indentFromAxis + maxWidth - box.x - box.width
  30027. } else {
  30028. if (textAlign === CENTER) {
  30029. translateX = axisPosition + indentFromAxis + maxWidth / 2 - box.x - box.width / 2
  30030. } else {
  30031. translateX = axisPosition + indentFromAxis - box.x
  30032. }
  30033. }
  30034. translateX += offset
  30035. }
  30036. }
  30037. return {
  30038. translateX: translateX,
  30039. translateY: translateY
  30040. }
  30041. },
  30042. _createAxisConstantLineGroups: function() {
  30043. var that = this;
  30044. var renderer = that._renderer;
  30045. var classSelector = that._axisCssPrefix;
  30046. var constantLinesClass = classSelector + "constant-lines";
  30047. var insideGroup = renderer.g().attr({
  30048. "class": constantLinesClass
  30049. });
  30050. var outsideGroup1 = renderer.g().attr({
  30051. "class": constantLinesClass
  30052. });
  30053. var outsideGroup2 = renderer.g().attr({
  30054. "class": constantLinesClass
  30055. });
  30056. return {
  30057. inside: insideGroup,
  30058. outside1: outsideGroup1,
  30059. left: outsideGroup1,
  30060. top: outsideGroup1,
  30061. outside2: outsideGroup2,
  30062. right: outsideGroup2,
  30063. bottom: outsideGroup2,
  30064. remove: function() {
  30065. this.inside.remove();
  30066. this.outside1.remove();
  30067. this.outside2.remove()
  30068. },
  30069. clear: function() {
  30070. this.inside.clear();
  30071. this.outside1.clear();
  30072. this.outside2.clear()
  30073. }
  30074. }
  30075. },
  30076. _createAxisGroups: function() {
  30077. var that = this;
  30078. var renderer = that._renderer;
  30079. var classSelector = that._axisCssPrefix;
  30080. that._axisGroup = renderer.g().attr({
  30081. "class": classSelector + "axis"
  30082. });
  30083. that._axisStripGroup = renderer.g().attr({
  30084. "class": classSelector + "strips"
  30085. });
  30086. that._axisGridGroup = renderer.g().attr({
  30087. "class": classSelector + "grid"
  30088. });
  30089. that._axisElementsGroup = renderer.g().attr({
  30090. "class": classSelector + "elements"
  30091. }).append(that._axisGroup);
  30092. that._axisLineGroup = renderer.g().attr({
  30093. "class": classSelector + "line"
  30094. }).append(that._axisGroup);
  30095. that._axisTitleGroup = renderer.g().attr({
  30096. "class": classSelector + "title"
  30097. }).append(that._axisGroup);
  30098. that._axisConstantLineGroups = {
  30099. above: that._createAxisConstantLineGroups(),
  30100. under: that._createAxisConstantLineGroups()
  30101. };
  30102. that._axisStripLabelGroup = renderer.g().attr({
  30103. "class": classSelector + "axis-labels"
  30104. })
  30105. },
  30106. _clearAxisGroups: function() {
  30107. var that = this;
  30108. that._axisGroup.remove();
  30109. that._axisStripGroup.remove();
  30110. that._axisStripLabelGroup.remove();
  30111. that._axisConstantLineGroups.above.remove();
  30112. that._axisConstantLineGroups.under.remove();
  30113. that._axisGridGroup.remove();
  30114. that._axisTitleGroup.clear();
  30115. that._axisElementsGroup.clear();
  30116. that._axisLineGroup && that._axisLineGroup.clear();
  30117. that._axisStripGroup && that._axisStripGroup.clear();
  30118. that._axisGridGroup && that._axisGridGroup.clear();
  30119. that._axisConstantLineGroups.above.clear();
  30120. that._axisConstantLineGroups.under.clear();
  30121. that._axisStripLabelGroup && that._axisStripLabelGroup.clear()
  30122. },
  30123. _getLabelFormatObject: function(value, labelOptions, range, point, tickInterval, ticks) {
  30124. range = range || this._getViewportRange();
  30125. var formatObject = {
  30126. value: value,
  30127. valueText: (0, _smart_formatter.smartFormatter)(value, {
  30128. labelOptions: labelOptions,
  30129. ticks: ticks || convertTicksToValues(this._majorTicks),
  30130. tickInterval: (0, _type.isDefined)(tickInterval) ? tickInterval : this._tickInterval,
  30131. dataType: this._options.dataType,
  30132. logarithmBase: this._options.logarithmBase,
  30133. type: this._options.type,
  30134. showTransition: !this._options.marker.visible,
  30135. point: point
  30136. }) || "",
  30137. min: range.minVisible,
  30138. max: range.maxVisible
  30139. };
  30140. if (point) {
  30141. formatObject.point = point
  30142. }
  30143. return formatObject
  30144. },
  30145. formatLabel: function(value, labelOptions, range, point, tickInterval, ticks) {
  30146. var formatObject = this._getLabelFormatObject(value, labelOptions, range, point, tickInterval, ticks);
  30147. return (0, _type.isFunction)(labelOptions.customizeText) ? labelOptions.customizeText.call(formatObject, formatObject) : formatObject.valueText
  30148. },
  30149. formatHint: function(value, labelOptions, range) {
  30150. var formatObject = this._getLabelFormatObject(value, labelOptions, range);
  30151. return (0, _type.isFunction)(labelOptions.customizeHint) ? labelOptions.customizeHint.call(formatObject, formatObject) : void 0
  30152. },
  30153. formatRange: function(startValue, endValue, interval) {
  30154. return (0, _smart_formatter.formatRange)(startValue, endValue, interval, this.getOptions())
  30155. },
  30156. _setTickOffset: function() {
  30157. var options = this._options;
  30158. var discreteAxisDivisionMode = options.discreteAxisDivisionMode;
  30159. this._tickOffset = +("crossLabels" !== discreteAxisDivisionMode || !discreteAxisDivisionMode)
  30160. },
  30161. getMargins: function() {
  30162. var that = this;
  30163. var options = that._options;
  30164. var position = options.position;
  30165. var placeholderSize = options.placeholderSize;
  30166. var canvas = that.getCanvas();
  30167. var cLeft = canvas.left;
  30168. var cTop = canvas.top;
  30169. var cRight = canvas.width - canvas.right;
  30170. var cBottom = canvas.height - canvas.bottom;
  30171. var edgeMarginCorrection = _max(options.grid.visible && options.grid.width || 0, options.tick.visible && options.tick.width || 0);
  30172. var constantLineAboveSeries = that._axisConstantLineGroups.above;
  30173. var constantLineUnderSeries = that._axisConstantLineGroups.under;
  30174. var boxes = [that._axisElementsGroup, constantLineAboveSeries.outside1, constantLineAboveSeries.outside2, constantLineUnderSeries.outside1, constantLineUnderSeries.outside2, that._axisLineGroup].map(function(group) {
  30175. return group && group.getBBox()
  30176. }).concat(function(group) {
  30177. var box = group && group.getBBox();
  30178. if (!box || box.isEmpty) {
  30179. return box
  30180. }
  30181. if (that._isHorizontal) {
  30182. box.x = cLeft;
  30183. box.width = cRight - cLeft
  30184. } else {
  30185. box.y = cTop;
  30186. box.height = cBottom - cTop
  30187. }
  30188. return box
  30189. }(that._axisTitleGroup));
  30190. var margins = calculateCanvasMargins(boxes, canvas);
  30191. margins[position] += options.crosshairMargin;
  30192. if (placeholderSize) {
  30193. margins[position] = placeholderSize
  30194. }
  30195. if (edgeMarginCorrection) {
  30196. if (that._isHorizontal && canvas.right < edgeMarginCorrection && margins.right < edgeMarginCorrection) {
  30197. margins.right = edgeMarginCorrection
  30198. }
  30199. if (!that._isHorizontal && canvas.bottom < edgeMarginCorrection && margins.bottom < edgeMarginCorrection) {
  30200. margins.bottom = edgeMarginCorrection
  30201. }
  30202. }
  30203. return margins
  30204. },
  30205. validateUnit: function(unit, idError, parameters) {
  30206. var that = this;
  30207. unit = that.parser(unit);
  30208. if (void 0 === unit && idError) {
  30209. that._incidentOccurred(idError, [parameters])
  30210. }
  30211. return unit
  30212. },
  30213. _setType: function(axisType, drawingType) {
  30214. var that = this;
  30215. var axisTypeMethods;
  30216. switch (axisType) {
  30217. case "xyAxes":
  30218. axisTypeMethods = _xy_axes2.default;
  30219. break;
  30220. case "polarAxes":
  30221. axisTypeMethods = _polar_axes2.default
  30222. }(0, _extend.extend)(that, axisTypeMethods[drawingType])
  30223. },
  30224. _getSharpParam: function() {
  30225. return true
  30226. },
  30227. _disposeBreaksGroup: _common.noop,
  30228. dispose: function() {
  30229. var that = this;
  30230. [that._axisElementsGroup, that._axisStripGroup, that._axisGroup].forEach(function(g) {
  30231. g.dispose()
  30232. });
  30233. that._strips = that._title = null;
  30234. that._axisStripGroup = that._axisConstantLineGroups = that._axisStripLabelGroup = that._axisBreaksGroup = null;
  30235. that._axisLineGroup = that._axisElementsGroup = that._axisGridGroup = null;
  30236. that._axisGroup = that._axisTitleGroup = null;
  30237. that._axesContainerGroup = that._stripsGroup = that._constantLinesGroup = null;
  30238. that._renderer = that._options = that._textOptions = that._textFontStyles = null;
  30239. that._translator = null;
  30240. that._majorTicks = that._minorTicks = null;
  30241. that._disposeBreaksGroup()
  30242. },
  30243. getOptions: function() {
  30244. return this._options
  30245. },
  30246. setPane: function(pane) {
  30247. this.pane = pane;
  30248. this._options.pane = pane
  30249. },
  30250. setTypes: function(type, axisType, typeSelector) {
  30251. this._options.type = type || this._options.type;
  30252. this._options[typeSelector] = axisType || this._options[typeSelector];
  30253. this._updateTranslator()
  30254. },
  30255. resetTypes: function(typeSelector) {
  30256. this._options.type = this._initTypes.type;
  30257. this._options[typeSelector] = this._initTypes[typeSelector]
  30258. },
  30259. getTranslator: function() {
  30260. return this._translator
  30261. },
  30262. updateOptions: function(options) {
  30263. var that = this;
  30264. var labelOpt = options.label;
  30265. validateAxisOptions(options);
  30266. that._options = options;
  30267. options.tick = options.tick || {};
  30268. options.minorTick = options.minorTick || {};
  30269. options.grid = options.grid || {};
  30270. options.minorGrid = options.minorGrid || {};
  30271. options.title = options.title || {};
  30272. options.marker = options.marker || {};
  30273. that._initTypes = {
  30274. type: options.type,
  30275. argumentType: options.argumentType,
  30276. valueType: options.valueType
  30277. };
  30278. that._setTickOffset();
  30279. that._isHorizontal = options.isHorizontal;
  30280. that.pane = options.pane;
  30281. that.name = options.name;
  30282. that.priority = options.priority;
  30283. that._hasLabelFormat = "" !== labelOpt.format && (0, _type.isDefined)(labelOpt.format);
  30284. that._textOptions = {
  30285. opacity: labelOpt.opacity,
  30286. align: "center",
  30287. "class": labelOpt.cssClass
  30288. };
  30289. that._textFontStyles = _utils2.default.patchFontOptions(labelOpt.font);
  30290. if (options.type === _axes_constants2.default.logarithmic) {
  30291. if (options.logarithmBaseError) {
  30292. that._incidentOccurred("E2104");
  30293. delete options.logarithmBaseError
  30294. }
  30295. }
  30296. that._updateTranslator();
  30297. that._createConstantLines();
  30298. that._strips = (options.strips || []).map(function(o) {
  30299. return (0, _strip2.default)(that, o)
  30300. });
  30301. that._majorTicks = that._minorTicks = null;
  30302. that._firstDrawing = true
  30303. },
  30304. calculateInterval: function(value, prevValue) {
  30305. var options = this._options;
  30306. return !options || options.type !== _axes_constants2.default.logarithmic ? _abs(value - prevValue) : _utils2.default.getLog(value / prevValue, options.logarithmBase)
  30307. },
  30308. _processCanvas: function(canvas) {
  30309. return canvas
  30310. },
  30311. updateCanvas: function(canvas) {
  30312. var positions = this._orthogonalPositions = {
  30313. start: !this._isHorizontal ? canvas.left : canvas.top,
  30314. end: !this._isHorizontal ? canvas.width - canvas.right : canvas.height - canvas.bottom
  30315. };
  30316. this._canvas = canvas;
  30317. positions.center = positions.start + (positions.end - positions.start) / 2;
  30318. this._translator.updateCanvas(this._processCanvas(canvas));
  30319. this._initAxisPositions()
  30320. },
  30321. getCanvas: function() {
  30322. return this._canvas
  30323. },
  30324. getAxisShift: function() {
  30325. return this._axisShift || 0
  30326. },
  30327. hideTitle: function() {
  30328. var that = this;
  30329. if (that._options.title.text) {
  30330. that._incidentOccurred("W2105", [that._isHorizontal ? "horizontal" : "vertical"]);
  30331. that._axisTitleGroup.clear()
  30332. }
  30333. },
  30334. getTitle: function() {
  30335. return this._title
  30336. },
  30337. hideOuterElements: function() {
  30338. var that = this;
  30339. var options = that._options;
  30340. if ((options.label.visible || that._outsideConstantLines.length) && !that._translator.getBusinessRange().isEmpty()) {
  30341. that._incidentOccurred("W2106", [that._isHorizontal ? "horizontal" : "vertical"]);
  30342. that._axisElementsGroup.clear();
  30343. callAction(that._outsideConstantLines, "removeLabel")
  30344. }
  30345. },
  30346. adjustViewport: function(businessRange) {
  30347. var that = this;
  30348. var options = that._options;
  30349. var isDiscrete = options.type === _axes_constants2.default.discrete;
  30350. var categories = that._seriesData && that._seriesData.categories || [];
  30351. var wholeRange = that.adjustRange(getVizRangeObject(options.wholeRange));
  30352. var visualRange = that.getViewport() || {};
  30353. var result = new _range.Range(businessRange);
  30354. that._addConstantLinesToRange(result, "minVisible", "maxVisible");
  30355. var minDefined = (0, _type.isDefined)(visualRange.startValue);
  30356. var maxDefined = (0, _type.isDefined)(visualRange.endValue);
  30357. if (!isDiscrete) {
  30358. minDefined = minDefined && (!(0, _type.isDefined)(wholeRange.endValue) || visualRange.startValue < wholeRange.endValue);
  30359. maxDefined = maxDefined && (!(0, _type.isDefined)(wholeRange.startValue) || visualRange.endValue > wholeRange.startValue)
  30360. }
  30361. var minVisible = minDefined ? visualRange.startValue : result.minVisible;
  30362. var maxVisible = maxDefined ? visualRange.endValue : result.maxVisible;
  30363. if (!isDiscrete) {
  30364. result.min = (0, _type.isDefined)(wholeRange.startValue) ? wholeRange.startValue : result.min;
  30365. result.max = (0, _type.isDefined)(wholeRange.endValue) ? wholeRange.endValue : result.max
  30366. } else {
  30367. var categoriesInfo = _utils2.default.getCategoriesInfo(categories, wholeRange.startValue, wholeRange.endValue);
  30368. categories = categoriesInfo.categories;
  30369. result.categories = categories
  30370. }
  30371. var adjustedVisualRange = _utils2.default.adjustVisualRange({
  30372. axisType: options.type,
  30373. dataType: options.dataType,
  30374. base: options.logarithmBase
  30375. }, {
  30376. startValue: minDefined ? visualRange.startValue : void 0,
  30377. endValue: maxDefined ? visualRange.endValue : void 0,
  30378. length: visualRange.length
  30379. }, {
  30380. categories: categories,
  30381. min: wholeRange.startValue,
  30382. max: wholeRange.endValue
  30383. }, {
  30384. categories: categories,
  30385. min: minVisible,
  30386. max: maxVisible
  30387. });
  30388. result.minVisible = adjustedVisualRange.startValue;
  30389. result.maxVisible = adjustedVisualRange.endValue;
  30390. !(0, _type.isDefined)(result.min) && (result.min = result.minVisible);
  30391. !(0, _type.isDefined)(result.max) && (result.max = result.maxVisible);
  30392. result.addRange({});
  30393. return result
  30394. },
  30395. adjustRange: function(range) {
  30396. range = range || {};
  30397. var isDiscrete = this._options.type === _axes_constants2.default.discrete;
  30398. var isLogarithmic = this._options.type === _axes_constants2.default.logarithmic;
  30399. if (isLogarithmic) {
  30400. range.startValue = range.startValue <= 0 ? null : range.startValue;
  30401. range.endValue = range.endValue <= 0 ? null : range.endValue
  30402. }
  30403. if (!isDiscrete && (0, _type.isDefined)(range.startValue) && (0, _type.isDefined)(range.endValue) && range.startValue > range.endValue) {
  30404. var tmp = range.endValue;
  30405. range.endValue = range.startValue;
  30406. range.startValue = tmp
  30407. }
  30408. return range
  30409. },
  30410. _getVisualRangeUpdateMode: function(viewport, newRange, oppositeValue) {
  30411. var value = this._options.visualRangeUpdateMode;
  30412. var translator = this._translator;
  30413. var range = this._seriesData;
  30414. if (this.isArgumentAxis) {
  30415. if ([SHIFT, KEEP, RESET].indexOf(value) === -1) {
  30416. if (range.axisType === _axes_constants2.default.discrete) {
  30417. var categories = range.categories;
  30418. var newCategories = newRange.categories;
  30419. var visualRange = this.visualRange();
  30420. if (categories && newCategories && categories.length && newCategories.map(function(c) {
  30421. return c.valueOf()
  30422. }).join(",").indexOf(categories.map(function(c) {
  30423. return c.valueOf()
  30424. }).join(",")) !== -1 && (visualRange.startValue.valueOf() !== categories[0].valueOf() || visualRange.endValue.valueOf() !== categories[categories.length - 1].valueOf())) {
  30425. value = KEEP
  30426. } else {
  30427. value = RESET
  30428. }
  30429. } else {
  30430. var minPoint = translator.translate(range.min);
  30431. var minVisiblePoint = translator.translate(viewport.startValue);
  30432. var maxPoint = translator.translate(range.max);
  30433. var maxVisiblePoint = translator.translate(viewport.endValue);
  30434. if (minPoint === minVisiblePoint && maxPoint === maxVisiblePoint) {
  30435. value = RESET
  30436. } else {
  30437. if (minPoint !== minVisiblePoint && maxPoint === maxVisiblePoint) {
  30438. value = SHIFT
  30439. } else {
  30440. value = KEEP
  30441. }
  30442. }
  30443. }
  30444. }
  30445. } else {
  30446. if ([KEEP, RESET].indexOf(value) === -1) {
  30447. if (oppositeValue === KEEP) {
  30448. value = KEEP
  30449. } else {
  30450. value = RESET
  30451. }
  30452. }
  30453. }
  30454. return value
  30455. },
  30456. _handleBusinessRangeChanged: function(oppositeVisualRangeUpdateMode, axisReinitialized, newRange) {
  30457. var that = this;
  30458. var visualRange = this.visualRange();
  30459. if (axisReinitialized || that._translator.getBusinessRange().isEmpty()) {
  30460. return
  30461. }
  30462. var visualRangeUpdateMode = that._lastVisualRangeUpdateMode = that._getVisualRangeUpdateMode(visualRange, newRange, oppositeVisualRangeUpdateMode);
  30463. if (!that.isArgumentAxis) {
  30464. var viewport = that.getViewport();
  30465. if (!(0, _type.isDefined)(viewport.startValue) && !(0, _type.isDefined)(viewport.endValue) && !(0, _type.isDefined)(viewport.length)) {
  30466. visualRangeUpdateMode = RESET
  30467. }
  30468. }
  30469. that._prevDataWasEmpty && (visualRangeUpdateMode = KEEP);
  30470. if (visualRangeUpdateMode === KEEP) {
  30471. that._setVisualRange([visualRange.startValue, visualRange.endValue])
  30472. }
  30473. if (visualRangeUpdateMode === RESET) {
  30474. that._setVisualRange([null, null])
  30475. }
  30476. if (visualRangeUpdateMode === SHIFT) {
  30477. that._setVisualRange({
  30478. length: that.getVisualRangeLength()
  30479. })
  30480. }
  30481. },
  30482. getVisualRangeLength: function(range) {
  30483. var currentBusinessRange = range || this._translator.getBusinessRange();
  30484. var _this$_options = this._options,
  30485. type = _this$_options.type,
  30486. logarithmBase = _this$_options.logarithmBase;
  30487. var length;
  30488. if (type === _axes_constants2.default.logarithmic) {
  30489. length = (0, _math2.adjust)(_utils2.default.getLog(currentBusinessRange.maxVisible / currentBusinessRange.minVisible, logarithmBase))
  30490. } else {
  30491. if (type === _axes_constants2.default.discrete) {
  30492. var categoriesInfo = _utils2.default.getCategoriesInfo(currentBusinessRange.categories, currentBusinessRange.minVisible, currentBusinessRange.maxVisible);
  30493. length = categoriesInfo.categories.length
  30494. } else {
  30495. length = currentBusinessRange.maxVisible - currentBusinessRange.minVisible
  30496. }
  30497. }
  30498. return length
  30499. },
  30500. getVisualRangeCenter: function(range) {
  30501. var businessRange = this._translator.getBusinessRange();
  30502. var currentBusinessRange = range || businessRange;
  30503. var _this$_options2 = this._options,
  30504. type = _this$_options2.type,
  30505. logarithmBase = _this$_options2.logarithmBase;
  30506. var center;
  30507. if (!(0, _type.isDefined)(currentBusinessRange.minVisible) || !(0, _type.isDefined)(currentBusinessRange.maxVisible)) {
  30508. return
  30509. }
  30510. if (type === _axes_constants2.default.logarithmic) {
  30511. center = _utils2.default.raiseTo((0, _math2.adjust)(_utils2.default.getLog(currentBusinessRange.maxVisible * currentBusinessRange.minVisible, logarithmBase)) / 2, logarithmBase)
  30512. } else {
  30513. if (type === _axes_constants2.default.discrete) {
  30514. var categoriesInfo = _utils2.default.getCategoriesInfo(currentBusinessRange.categories, currentBusinessRange.minVisible, currentBusinessRange.maxVisible);
  30515. var index = Math.ceil(categoriesInfo.categories.length / 2) - 1;
  30516. center = businessRange.categories.indexOf(categoriesInfo.categories[index])
  30517. } else {
  30518. center = (currentBusinessRange.maxVisible.valueOf() + currentBusinessRange.minVisible.valueOf()) / 2
  30519. }
  30520. }
  30521. return center
  30522. },
  30523. setBusinessRange: function(range, axisReinitialized, oppositeVisualRangeUpdateMode, argCategories) {
  30524. var that = this;
  30525. var options = that._options;
  30526. var isDiscrete = options.type === _axes_constants2.default.discrete;
  30527. that._handleBusinessRangeChanged(oppositeVisualRangeUpdateMode, axisReinitialized, range);
  30528. that._seriesData = new _range.Range(range);
  30529. var dataIsEmpty = that._seriesData.isEmpty();
  30530. that._prevDataWasEmpty = dataIsEmpty;
  30531. that._seriesData.addRange({
  30532. categories: options.categories,
  30533. dataType: options.dataType,
  30534. axisType: options.type,
  30535. base: options.logarithmBase,
  30536. invert: options.inverted
  30537. });
  30538. if (!isDiscrete) {
  30539. if (!(0, _type.isDefined)(that._seriesData.min) && !(0, _type.isDefined)(that._seriesData.max)) {
  30540. var visualRange = that.getViewport();
  30541. visualRange && that._seriesData.addRange({
  30542. min: visualRange.startValue,
  30543. max: visualRange.endValue
  30544. })
  30545. }
  30546. var synchronizedValue = options.synchronizedValue;
  30547. if ((0, _type.isDefined)(synchronizedValue)) {
  30548. that._seriesData.addRange({
  30549. min: synchronizedValue,
  30550. max: synchronizedValue
  30551. })
  30552. }
  30553. }
  30554. that._seriesData.minVisible = void 0 === that._seriesData.minVisible ? that._seriesData.min : that._seriesData.minVisible;
  30555. that._seriesData.maxVisible = void 0 === that._seriesData.maxVisible ? that._seriesData.max : that._seriesData.maxVisible;
  30556. if (!that.isArgumentAxis && options.showZero) {
  30557. that._seriesData.correctValueZeroLevel()
  30558. }
  30559. that._seriesData.sortCategories(that.getCategoriesSorter(argCategories));
  30560. that._seriesData.breaks = that._breaks = that._getScaleBreaks(options, that._seriesData, that._series, that.isArgumentAxis);
  30561. that._translator.updateBusinessRange(that.adjustViewport(that._seriesData))
  30562. },
  30563. _addConstantLinesToRange: function(dataRange, minValueField, maxValueField) {
  30564. this._outsideConstantLines.concat(this._insideConstantLines || []).forEach(function(cl) {
  30565. if (cl.options.extendAxis) {
  30566. var _dataRange$addRange;
  30567. var value = cl.getParsedValue();
  30568. dataRange.addRange((_dataRange$addRange = {}, _defineProperty(_dataRange$addRange, minValueField, value), _defineProperty(_dataRange$addRange, maxValueField, value), _dataRange$addRange))
  30569. }
  30570. })
  30571. },
  30572. setGroupSeries: function(series) {
  30573. this._series = series
  30574. },
  30575. getLabelsPosition: function() {
  30576. var that = this;
  30577. var options = that._options;
  30578. var position = options.position;
  30579. var labelShift = options.label.indentFromAxis + (that._axisShift || 0) + that._constantLabelOffset;
  30580. var axisPosition = that._axisPosition;
  30581. return position === TOP || position === LEFT ? axisPosition - labelShift : axisPosition + labelShift
  30582. },
  30583. getFormattedValue: function(value, options, point) {
  30584. var labelOptions = this._options.label;
  30585. return (0, _type.isDefined)(value) ? this.formatLabel(value, (0, _extend.extend)(true, {}, labelOptions, options), void 0, point) : null
  30586. },
  30587. _getBoundaryTicks: function(majors, viewPort) {
  30588. var that = this;
  30589. var length = majors.length;
  30590. var options = that._options;
  30591. var customBounds = options.customBoundTicks;
  30592. var min = viewPort.minVisible;
  30593. var max = viewPort.maxVisible;
  30594. var addMinMax = options.showCustomBoundaryTicks ? that._boundaryTicksVisibility : {};
  30595. var boundaryTicks = [];
  30596. if (options.type === _axes_constants2.default.discrete) {
  30597. if (that._tickOffset && 0 !== majors.length) {
  30598. boundaryTicks = [majors[0], majors[majors.length - 1]]
  30599. }
  30600. } else {
  30601. if (customBounds) {
  30602. if (addMinMax.min && (0, _type.isDefined)(customBounds[0])) {
  30603. boundaryTicks.push(customBounds[0])
  30604. }
  30605. if (addMinMax.max && (0, _type.isDefined)(customBounds[1])) {
  30606. boundaryTicks.push(customBounds[1])
  30607. }
  30608. } else {
  30609. if (addMinMax.min && (0 === length || majors[0] > min)) {
  30610. boundaryTicks.push(min)
  30611. }
  30612. if (addMinMax.max && (0 === length || majors[length - 1] < max)) {
  30613. boundaryTicks.push(max)
  30614. }
  30615. }
  30616. }
  30617. return boundaryTicks
  30618. },
  30619. setPercentLabelFormat: function() {
  30620. if (!this._hasLabelFormat) {
  30621. this._options.label.format = "percent"
  30622. }
  30623. },
  30624. resetAutoLabelFormat: function() {
  30625. if (!this._hasLabelFormat) {
  30626. delete this._options.label.format
  30627. }
  30628. },
  30629. getMultipleAxesSpacing: function() {
  30630. return this._options.multipleAxesSpacing || 0
  30631. },
  30632. getTicksValues: function() {
  30633. return {
  30634. majorTicksValues: convertTicksToValues(this._majorTicks),
  30635. minorTicksValues: convertTicksToValues(this._minorTicks)
  30636. }
  30637. },
  30638. setTicks: function(ticks) {
  30639. var majors = ticks.majorTicks || [];
  30640. this._majorTicks = majors.map(createMajorTick(this, this._renderer, this._getSkippedCategory(majors)));
  30641. this._minorTicks = (ticks.minorTicks || []).map(createMinorTick(this, this._renderer));
  30642. this._isSynchronized = true
  30643. },
  30644. _adjustDivisionFactor: function(val) {
  30645. return val
  30646. },
  30647. _getTicks: function(viewPort, incidentOccurred, skipTickGeneration) {
  30648. var that = this;
  30649. var options = that._options;
  30650. var customTicks = options.customTicks;
  30651. var customMinorTicks = options.customMinorTicks;
  30652. return getTickGenerator(options, incidentOccurred || that._incidentOccurred, skipTickGeneration, that._translator.getBusinessRange().isEmpty(), that._adjustDivisionFactor.bind(that))({
  30653. min: viewPort.minVisible,
  30654. max: viewPort.maxVisible,
  30655. categories: viewPort.categories,
  30656. isSpacedMargin: viewPort.isSpacedMargin,
  30657. checkMinDataVisibility: viewPort.checkMinDataVisibility,
  30658. checkMaxDataVisibility: viewPort.checkMaxDataVisibility
  30659. }, that._getScreenDelta(), options.tickInterval, "ignore" === options.label.overlappingBehavior || options.forceUserTickInterval, {
  30660. majors: customTicks,
  30661. minors: customMinorTicks
  30662. }, options.minorTickInterval, options.minorTickCount, that._breaks)
  30663. },
  30664. _createTicksAndLabelFormat: function(range, incidentOccurred) {
  30665. var options = this._options;
  30666. var ticks = this._getTicks(range, incidentOccurred, false);
  30667. if (!range.isEmpty() && options.type === _axes_constants2.default.discrete && "datetime" === options.dataType && !this._hasLabelFormat && ticks.ticks.length) {
  30668. options.label.format = _format_helper2.default.getDateFormatByTicks(ticks.ticks)
  30669. }
  30670. return ticks
  30671. },
  30672. getAggregationInfo: function(useAllAggregatedPoints, range) {
  30673. var that = this;
  30674. var options = that._options;
  30675. var marginOptions = that._marginOptions;
  30676. var businessRange = new _range.Range(that.getTranslator().getBusinessRange()).addRange(range);
  30677. var visualRange = that.getViewport();
  30678. var minVisible = visualRange && (0, _type.isDefined)(visualRange.startValue) ? visualRange.startValue : businessRange.minVisible;
  30679. var maxVisible = visualRange && (0, _type.isDefined)(visualRange.endValue) ? visualRange.endValue : businessRange.maxVisible;
  30680. var ticks = [];
  30681. var aggregationInterval = options.aggregationInterval;
  30682. var aggregationGroupWidth = options.aggregationGroupWidth;
  30683. if (!aggregationGroupWidth && marginOptions) {
  30684. if (marginOptions.checkInterval) {
  30685. aggregationGroupWidth = options.axisDivisionFactor
  30686. }
  30687. if (marginOptions.sizePointNormalState) {
  30688. aggregationGroupWidth = Math.min(marginOptions.sizePointNormalState, options.axisDivisionFactor)
  30689. }
  30690. }
  30691. var minInterval = !options.aggregationGroupWidth && !aggregationInterval && range.interval;
  30692. var generateTicks = configureGenerator(options, aggregationGroupWidth, businessRange, that._getScreenDelta(), minInterval);
  30693. var tickInterval = generateTicks(aggregationInterval, true, minVisible, maxVisible, that._breaks).tickInterval;
  30694. if (options.type !== _axes_constants2.default.discrete) {
  30695. var min = useAllAggregatedPoints ? businessRange.min : minVisible;
  30696. var max = useAllAggregatedPoints ? businessRange.max : maxVisible;
  30697. if ((0, _type.isDefined)(min) && (0, _type.isDefined)(max)) {
  30698. var add = _utils2.default.getAddFunction({
  30699. base: options.logarithmBase,
  30700. axisType: options.type,
  30701. dataType: options.dataType
  30702. }, false);
  30703. var start = min;
  30704. var end = max;
  30705. if (!useAllAggregatedPoints) {
  30706. var maxMinDistance = Math.max(that.calculateInterval(max, min), "datetime" === options.dataType ? (0, _date.dateToMilliseconds)(tickInterval) : tickInterval);
  30707. start = add(min, maxMinDistance, -1);
  30708. end = add(max, maxMinDistance)
  30709. }
  30710. start = start < businessRange.min ? businessRange.min : start;
  30711. end = end > businessRange.max ? businessRange.max : end;
  30712. var breaks = that._getScaleBreaks(options, {
  30713. minVisible: start,
  30714. maxVisible: end
  30715. }, that._series, that.isArgumentAxis);
  30716. ticks = generateTicks(tickInterval, false, start, end, breaks).ticks
  30717. }
  30718. }
  30719. that._aggregationInterval = tickInterval;
  30720. return {
  30721. interval: tickInterval,
  30722. ticks: ticks
  30723. }
  30724. },
  30725. createTicks: function(canvas) {
  30726. var that = this;
  30727. var renderer = that._renderer;
  30728. var options = that._options;
  30729. if (!canvas) {
  30730. return
  30731. }
  30732. that._isSynchronized = false;
  30733. that.updateCanvas(canvas);
  30734. that._estimatedTickInterval = that._getTicks(that.adjustViewport(this._seriesData), _common.noop, true).tickInterval;
  30735. var range = that._getViewportRange();
  30736. var margins = this._calculateValueMargins();
  30737. range.addRange({
  30738. minVisible: margins.minValue,
  30739. maxVisible: margins.maxValue,
  30740. isSpacedMargin: margins.isSpacedMargin,
  30741. checkMinDataVisibility: !this.isArgumentAxis && margins.checkInterval && !(0, _type.isDefined)(options.min) && margins.minValue.valueOf() > 0,
  30742. checkMaxDataVisibility: !this.isArgumentAxis && margins.checkInterval && !(0, _type.isDefined)(options.max) && margins.maxValue.valueOf() < 0
  30743. });
  30744. var ticks = that._createTicksAndLabelFormat(range);
  30745. var boundaryTicks = that._getBoundaryTicks(ticks.ticks, that._getViewportRange());
  30746. if (options.showCustomBoundaryTicks && boundaryTicks.length) {
  30747. that._boundaryTicks = [boundaryTicks[0]].map(createBoundaryTick(that, renderer, true));
  30748. if (boundaryTicks.length > 1) {
  30749. that._boundaryTicks = that._boundaryTicks.concat([boundaryTicks[1]].map(createBoundaryTick(that, renderer, false)))
  30750. }
  30751. } else {
  30752. that._boundaryTicks = []
  30753. }
  30754. var minors = (ticks.minorTicks || []).filter(function(minor) {
  30755. return !boundaryTicks.some(function(boundary) {
  30756. return valueOf(boundary) === valueOf(minor)
  30757. })
  30758. });
  30759. that._tickInterval = ticks.tickInterval;
  30760. that._minorTickInterval = ticks.minorTickInterval;
  30761. var oldMajorTicks = that._majorTicks || [];
  30762. var majorTicksByValues = oldMajorTicks.reduce(function(r, t) {
  30763. r[t.value.valueOf()] = t;
  30764. return r
  30765. }, {});
  30766. var sameType = (0, _type.type)(ticks.ticks[0]) === (0, _type.type)(oldMajorTicks[0] && oldMajorTicks[0].value);
  30767. var skippedCategory = that._getSkippedCategory(ticks.ticks);
  30768. var majorTicks = ticks.ticks.map(function(v) {
  30769. var tick = majorTicksByValues[v.valueOf()];
  30770. if (tick && sameType) {
  30771. delete majorTicksByValues[v.valueOf()];
  30772. tick.setSkippedCategory(skippedCategory);
  30773. return tick
  30774. } else {
  30775. return createMajorTick(that, renderer, skippedCategory)(v)
  30776. }
  30777. });
  30778. that._majorTicks = majorTicks;
  30779. var oldMinorTicks = that._minorTicks || [];
  30780. that._minorTicks = minors.map(function(v, i) {
  30781. var minorTick = oldMinorTicks[i];
  30782. if (minorTick) {
  30783. minorTick.updateValue(v);
  30784. return minorTick
  30785. }
  30786. return createMinorTick(that, renderer)(v)
  30787. });
  30788. that._ticksToRemove = Object.keys(majorTicksByValues).map(function(k) {
  30789. return majorTicksByValues[k]
  30790. }).concat(oldMinorTicks.slice(that._minorTicks.length, oldMinorTicks.length));
  30791. that._correctedBreaks = ticks.breaks;
  30792. that._reinitTranslator(that._getViewportRange())
  30793. },
  30794. _reinitTranslator: function(range) {
  30795. var that = this;
  30796. var translator = that._translator;
  30797. if (that._correctedBreaks) {
  30798. range.breaks = that._correctedBreaks
  30799. }
  30800. if (that._isSynchronized) {
  30801. return
  30802. }
  30803. translator.updateBusinessRange(that.adjustViewport(range))
  30804. },
  30805. _getViewportRange: function() {
  30806. return this.adjustViewport(this._seriesData)
  30807. },
  30808. setMarginOptions: function(options) {
  30809. this._marginOptions = options
  30810. },
  30811. getMarginOptions: function() {
  30812. return (0, _type.isDefined)(this._marginOptions) ? this._marginOptions : {}
  30813. },
  30814. allowToExtendVisualRange: function(isEnd) {
  30815. var wholeRange = this.adjustRange(getVizRangeObject(this._options.wholeRange));
  30816. var bound = isEnd ? wholeRange.endValue : wholeRange.startValue;
  30817. return !this.isArgumentAxis || !(0, _type.isDefined)(bound) && this.isExtremePosition(isEnd)
  30818. },
  30819. _calculateRangeInterval: function(interval) {
  30820. var isDateTime = "datetime" === this._options.dataType;
  30821. var minArgs = [];
  30822. var addToArgs = function(value) {
  30823. (0, _type.isDefined)(value) && minArgs.push(isDateTime ? (0, _date.dateToMilliseconds)(value) : value)
  30824. };
  30825. addToArgs(this._tickInterval);
  30826. addToArgs(this._estimatedTickInterval);
  30827. (0, _type.isDefined)(interval) && minArgs.push(interval);
  30828. addToArgs(this._aggregationInterval);
  30829. return this._calculateWorkWeekInterval(_min.apply(this, minArgs))
  30830. },
  30831. _calculateWorkWeekInterval: function(businessInterval) {
  30832. var options = this._options;
  30833. if ("datetime" === options.dataType && options.workdaysOnly && businessInterval) {
  30834. var workWeek = options.workWeek.length * dateIntervals.day;
  30835. var weekend = dateIntervals.week - workWeek;
  30836. if (workWeek !== businessInterval && weekend < businessInterval) {
  30837. var weekendsCount = Math.ceil(businessInterval / dateIntervals.week);
  30838. businessInterval = weekend >= businessInterval ? dateIntervals.day : businessInterval - weekend * weekendsCount
  30839. } else {
  30840. if (weekend >= businessInterval && businessInterval > dateIntervals.day) {
  30841. businessInterval = dateIntervals.day
  30842. }
  30843. }
  30844. }
  30845. return businessInterval
  30846. },
  30847. _calculateValueMargins: function(ticks) {
  30848. this._resetMargins();
  30849. var that = this;
  30850. var margins = that.getMarginOptions();
  30851. var marginSize = (margins.size || 0) / 2;
  30852. var options = that._options;
  30853. var dataRange = this._getViewportRange();
  30854. var viewPort = this.getViewport();
  30855. var screenDelta = that._getScreenDelta();
  30856. var isDiscrete = (options.type || "").indexOf(_axes_constants2.default.discrete) !== -1;
  30857. var valueMarginsEnabled = options.valueMarginsEnabled && !isDiscrete;
  30858. var translator = that._translator;
  30859. var minValueMargin = options.minValueMargin;
  30860. var maxValueMargin = options.maxValueMargin;
  30861. var minPadding = 0;
  30862. var maxPadding = 0;
  30863. var interval = 0;
  30864. var rangeInterval;
  30865. if (dataRange.stubData || !screenDelta) {
  30866. return {
  30867. startPadding: 0,
  30868. endPadding: 0
  30869. }
  30870. }
  30871. function getConvertIntervalCoefficient(intervalInPx) {
  30872. var ratioOfCanvasRange = translator.ratioOfCanvasRange();
  30873. return ratioOfCanvasRange / (ratioOfCanvasRange * screenDelta / (intervalInPx + screenDelta))
  30874. }
  30875. if (that.isArgumentAxis && margins.checkInterval) {
  30876. rangeInterval = that._calculateRangeInterval(dataRange.interval);
  30877. var pxInterval = translator.getInterval(rangeInterval);
  30878. if (isFinite(pxInterval)) {
  30879. interval = Math.ceil(pxInterval / (2 * getConvertIntervalCoefficient(pxInterval)))
  30880. } else {
  30881. rangeInterval = 0
  30882. }
  30883. }
  30884. var minPercentPadding;
  30885. var maxPercentPadding;
  30886. var maxPaddingValue = screenDelta * MAX_MARGIN_VALUE / 2;
  30887. if (valueMarginsEnabled) {
  30888. if ((0, _type.isDefined)(minValueMargin)) {
  30889. minPercentPadding = isFinite(minValueMargin) ? minValueMargin : 0
  30890. } else {
  30891. minPadding = Math.max(marginSize, interval);
  30892. minPadding = Math.min(maxPaddingValue, minPadding)
  30893. }
  30894. if ((0, _type.isDefined)(maxValueMargin)) {
  30895. maxPercentPadding = isFinite(maxValueMargin) ? maxValueMargin : 0
  30896. } else {
  30897. maxPadding = Math.max(marginSize, interval);
  30898. maxPadding = Math.min(maxPaddingValue, maxPadding)
  30899. }
  30900. }
  30901. var percentStick = margins.percentStick && !this.isArgumentAxis;
  30902. if (percentStick) {
  30903. if (1 === _abs(dataRange.max)) {
  30904. maxPadding = 0
  30905. }
  30906. if (1 === _abs(dataRange.min)) {
  30907. minPadding = 0
  30908. }
  30909. }
  30910. var canvasStartEnd = that._getCanvasStartEnd();
  30911. var commonMargin = 1 + (minPercentPadding || 0) + (maxPercentPadding || 0);
  30912. var screenDeltaWithMargins = (screenDelta - minPadding - maxPadding) / commonMargin || screenDelta;
  30913. if (void 0 !== minPercentPadding || void 0 !== maxPercentPadding) {
  30914. if (void 0 !== minPercentPadding) {
  30915. minPadding = screenDeltaWithMargins * minPercentPadding
  30916. }
  30917. if (void 0 !== maxPercentPadding) {
  30918. maxPadding = screenDeltaWithMargins * maxPercentPadding
  30919. }
  30920. }
  30921. var minValue;
  30922. var maxValue;
  30923. if (options.type !== _axes_constants2.default.discrete && ticks && ticks.length > 1 && !options.skipViewportExtending && !viewPort.action && false !== options.endOnTick) {
  30924. var length = ticks.length;
  30925. var firstTickPosition = translator.translate(ticks[0].value);
  30926. var lastTickPosition = translator.translate(ticks[length - 1].value);
  30927. var invertMultiplier = firstTickPosition > lastTickPosition ? -1 : 1;
  30928. var minTickPadding = _max(invertMultiplier * (canvasStartEnd.start - firstTickPosition), 0);
  30929. var maxTickPadding = _max(invertMultiplier * (lastTickPosition - canvasStartEnd.end), 0);
  30930. if (minTickPadding > minPadding || maxTickPadding > maxPadding) {
  30931. var commonPadding = maxTickPadding + minTickPadding;
  30932. var coeff = getConvertIntervalCoefficient(commonPadding);
  30933. if (minTickPadding >= minPadding) {
  30934. minValue = ticks[0].value
  30935. }
  30936. if (maxTickPadding >= maxPadding) {
  30937. maxValue = ticks[length - 1].value
  30938. }
  30939. minPadding = _max(minTickPadding, minPadding) / coeff;
  30940. maxPadding = _max(maxTickPadding, maxPadding) / coeff
  30941. }
  30942. }
  30943. minPercentPadding = void 0 === minPercentPadding ? minPadding / screenDeltaWithMargins : minPercentPadding;
  30944. maxPercentPadding = void 0 === maxPercentPadding ? maxPadding / screenDeltaWithMargins : maxPercentPadding;
  30945. if (!isDiscrete) {
  30946. if (this._translator.isInverted()) {
  30947. minValue = (0, _type.isDefined)(minValue) ? minValue : translator.from(canvasStartEnd.start + screenDelta * minPercentPadding, -1);
  30948. maxValue = (0, _type.isDefined)(maxValue) ? maxValue : translator.from(canvasStartEnd.end - screenDelta * maxPercentPadding, 1)
  30949. } else {
  30950. minValue = (0, _type.isDefined)(minValue) ? minValue : translator.from(canvasStartEnd.start - screenDelta * minPercentPadding, -1);
  30951. maxValue = (0, _type.isDefined)(maxValue) ? maxValue : translator.from(canvasStartEnd.end + screenDelta * maxPercentPadding, 1)
  30952. }
  30953. }
  30954. function correctZeroLevel(minPoint, maxPoint) {
  30955. var minExpectedPadding = _abs(canvasStartEnd.start - minPoint);
  30956. var maxExpectedPadding = _abs(canvasStartEnd.end - maxPoint);
  30957. var coeff = getConvertIntervalCoefficient(minExpectedPadding + maxExpectedPadding);
  30958. minPadding = minExpectedPadding / coeff;
  30959. maxPadding = maxExpectedPadding / coeff
  30960. }
  30961. if (!that.isArgumentAxis) {
  30962. if (minValue * dataRange.min <= 0 && minValue * dataRange.minVisible <= 0) {
  30963. correctZeroLevel(translator.translate(0), translator.translate(maxValue));
  30964. minValue = 0
  30965. }
  30966. if (maxValue * dataRange.max <= 0 && maxValue * dataRange.maxVisible <= 0) {
  30967. correctZeroLevel(translator.translate(minValue), translator.translate(0));
  30968. maxValue = 0
  30969. }
  30970. }
  30971. return {
  30972. startPadding: this._translator.isInverted() ? maxPadding : minPadding,
  30973. endPadding: this._translator.isInverted() ? minPadding : maxPadding,
  30974. minValue: minValue,
  30975. maxValue: maxValue,
  30976. interval: rangeInterval,
  30977. isSpacedMargin: minPadding === maxPadding && 0 !== minPadding
  30978. }
  30979. },
  30980. applyMargins: function() {
  30981. if (this._isSynchronized) {
  30982. return
  30983. }
  30984. var margins = this._calculateValueMargins(this._majorTicks);
  30985. var canvas = (0, _extend.extend)({}, this._canvas, {
  30986. startPadding: margins.startPadding,
  30987. endPadding: margins.endPadding
  30988. });
  30989. this._translator.updateCanvas(this._processCanvas(canvas));
  30990. if (isFinite(margins.interval)) {
  30991. var br = this._translator.getBusinessRange();
  30992. br.addRange({
  30993. interval: margins.interval
  30994. });
  30995. this._translator.updateBusinessRange(br)
  30996. }
  30997. },
  30998. _resetMargins: function() {
  30999. this._reinitTranslator(this._getViewportRange());
  31000. if (this._canvas) {
  31001. this._translator.updateCanvas(this._processCanvas(this._canvas))
  31002. }
  31003. },
  31004. _createConstantLines: function() {
  31005. var _this = this;
  31006. var constantLines = (this._options.constantLines || []).map(function(o) {
  31007. return (0, _constant_line2.default)(_this, o)
  31008. });
  31009. this._outsideConstantLines = constantLines.filter(function(l) {
  31010. return "outside" === l.labelPosition
  31011. });
  31012. this._insideConstantLines = constantLines.filter(function(l) {
  31013. return "inside" === l.labelPosition
  31014. })
  31015. },
  31016. draw: function(canvas, borderOptions) {
  31017. var that = this;
  31018. var options = this._options;
  31019. that.borderOptions = borderOptions || {
  31020. visible: false
  31021. };
  31022. that._resetMargins();
  31023. that.createTicks(canvas);
  31024. that.applyMargins();
  31025. that._clearAxisGroups();
  31026. initTickCoords(that._majorTicks);
  31027. initTickCoords(that._minorTicks);
  31028. initTickCoords(that._boundaryTicks);
  31029. that._axisGroup.append(that._axesContainerGroup);
  31030. that._drawAxis();
  31031. that._drawTitle();
  31032. drawTickMarks(that._majorTicks, options.tick);
  31033. drawTickMarks(that._minorTicks, options.minorTick);
  31034. drawTickMarks(that._boundaryTicks, options.tick);
  31035. var drawGridLine = that._getGridLineDrawer();
  31036. drawGrids(that._majorTicks, drawGridLine);
  31037. drawGrids(that._minorTicks, drawGridLine);
  31038. callAction(that._majorTicks, "drawLabel", that._getViewportRange());
  31039. that._majorTicks.forEach(function(tick) {
  31040. tick.labelRotationAngle = 0;
  31041. tick.labelAlignment = void 0;
  31042. tick.labelOffset = 0
  31043. });
  31044. callAction(that._outsideConstantLines.concat(that._insideConstantLines), "draw");
  31045. callAction(that._strips, "draw");
  31046. that._dateMarkers = that._drawDateMarkers() || [];
  31047. that._labelAxesGroup && that._axisStripLabelGroup.append(that._labelAxesGroup);
  31048. that._gridContainerGroup && that._axisGridGroup.append(that._gridContainerGroup);
  31049. that._stripsGroup && that._axisStripGroup.append(that._stripsGroup);
  31050. if (that._constantLinesGroup) {
  31051. that._axisConstantLineGroups.above.inside.append(that._constantLinesGroup.above);
  31052. that._axisConstantLineGroups.above.outside1.append(that._constantLinesGroup.above);
  31053. that._axisConstantLineGroups.above.outside2.append(that._constantLinesGroup.above);
  31054. that._axisConstantLineGroups.under.inside.append(that._constantLinesGroup.under);
  31055. that._axisConstantLineGroups.under.outside1.append(that._constantLinesGroup.under);
  31056. that._axisConstantLineGroups.under.outside2.append(that._constantLinesGroup.under)
  31057. }
  31058. that._measureTitle();
  31059. measureLabels(that._majorTicks);
  31060. var textWidth;
  31061. var textHeight;
  31062. var convertedTickInterval;
  31063. var tickInterval = that._tickInterval;
  31064. if ((0, _type.isDefined)(tickInterval)) {
  31065. convertedTickInterval = that.getTranslator().getInterval("datetime" === options.dataType ? (0, _date.dateToMilliseconds)(tickInterval) : tickInterval)
  31066. }
  31067. if (that._isHorizontal) {
  31068. textWidth = convertedTickInterval;
  31069. textHeight = options.placeholderSize
  31070. } else {
  31071. textWidth = options.placeholderSize;
  31072. textHeight = convertedTickInterval
  31073. }
  31074. var displayMode = that._validateDisplayMode(options.label.displayMode);
  31075. var overlappingMode = that._validateOverlappingMode(options.label.overlappingBehavior, displayMode);
  31076. var wordWrapMode = options.label.wordWrap || "none";
  31077. var overflowMode = options.label.textOverflow || "none";
  31078. if (("none" !== wordWrapMode || "none" !== overflowMode) && displayMode !== ROTATE && overlappingMode !== ROTATE && "auto" !== overlappingMode) {
  31079. var correctByWidth = false;
  31080. var correctByHeight = false;
  31081. if (textWidth) {
  31082. if (that._majorTicks.some(function(tick) {
  31083. return tick.labelBBox.width > textWidth
  31084. })) {
  31085. correctByWidth = true
  31086. }
  31087. }
  31088. if (textHeight) {
  31089. if (that._majorTicks.some(function(tick) {
  31090. return tick.labelBBox.height > textHeight
  31091. })) {
  31092. correctByHeight = true
  31093. }
  31094. }
  31095. if (correctByWidth || correctByHeight) {
  31096. that._majorTicks.forEach(function(tick) {
  31097. tick.label && tick.label.setMaxSize(textWidth, textHeight, options.label)
  31098. });
  31099. measureLabels(that._majorTicks)
  31100. }
  31101. }
  31102. measureLabels(that._outsideConstantLines);
  31103. measureLabels(that._insideConstantLines);
  31104. measureLabels(that._strips);
  31105. measureLabels(that._dateMarkers);
  31106. that._adjustConstantLineLabels(that._insideConstantLines);
  31107. that._adjustStripLabels();
  31108. var offset = that._constantLabelOffset = that._adjustConstantLineLabels(that._outsideConstantLines);
  31109. if (!that._translator.getBusinessRange().isEmpty()) {
  31110. that._setLabelsPlacement();
  31111. offset = that._adjustLabels(offset)
  31112. }
  31113. offset = that._adjustDateMarkers(offset);
  31114. that._adjustTitle(offset)
  31115. },
  31116. _measureTitle: _common.noop,
  31117. animate: function() {
  31118. callAction(this._majorTicks, "animateLabels")
  31119. },
  31120. updateSize: function(canvas, animate) {
  31121. var updateTitle = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : true;
  31122. var that = this;
  31123. that.updateCanvas(canvas);
  31124. if (updateTitle) {
  31125. that._checkTitleOverflow();
  31126. that._measureTitle();
  31127. that._updateTitleCoords()
  31128. }
  31129. that._reinitTranslator(that._getViewportRange());
  31130. that.applyMargins();
  31131. var animationEnabled = !that._firstDrawing && animate;
  31132. var options = this._options;
  31133. initTickCoords(that._majorTicks);
  31134. initTickCoords(that._minorTicks);
  31135. initTickCoords(that._boundaryTicks);
  31136. cleanUpInvalidTicks(that._majorTicks);
  31137. cleanUpInvalidTicks(that._minorTicks);
  31138. cleanUpInvalidTicks(that._boundaryTicks);
  31139. if (this._axisElement) {
  31140. that._updateAxisElementPosition()
  31141. }
  31142. updateTicksPosition(that._majorTicks, options.tick, animationEnabled);
  31143. updateTicksPosition(that._minorTicks, options.minorTick, animationEnabled);
  31144. updateTicksPosition(that._boundaryTicks, options.tick);
  31145. callAction(that._majorTicks, "updateLabelPosition", animationEnabled);
  31146. that._outsideConstantLines.concat(that._insideConstantLines || []).forEach(function(l) {
  31147. return l.updatePosition(animationEnabled)
  31148. });
  31149. callAction(that._strips, "updatePosition", animationEnabled);
  31150. updateGridsPosition(that._majorTicks, animationEnabled);
  31151. updateGridsPosition(that._minorTicks, animationEnabled);
  31152. if (animationEnabled) {
  31153. callAction(that._ticksToRemove || [], "fadeOutElements")
  31154. }
  31155. that.prepareAnimation();
  31156. that._ticksToRemove = null;
  31157. if (!that._translator.getBusinessRange().isEmpty()) {
  31158. that._firstDrawing = false
  31159. }
  31160. },
  31161. prepareAnimation: function() {
  31162. var that = this;
  31163. var action = "saveCoords";
  31164. callAction(that._majorTicks, action);
  31165. callAction(that._minorTicks, action);
  31166. callAction(that._insideConstantLines, action);
  31167. callAction(that._outsideConstantLines, action);
  31168. callAction(that._strips, action)
  31169. },
  31170. applyClipRects: function(elementsClipID, canvasClipID) {
  31171. this._axisGroup.attr({
  31172. "clip-path": canvasClipID
  31173. });
  31174. this._axisStripGroup.attr({
  31175. "clip-path": elementsClipID
  31176. })
  31177. },
  31178. _mergeViewportOptions: function() {
  31179. var that = this;
  31180. var options = that._options;
  31181. var visualRange = {};
  31182. var visualRangeOptionValue = options._customVisualRange;
  31183. if (((0, _type.isDefined)(options.max) || (0, _type.isDefined)(options.min)) && !(0, _type.isDefined)(visualRangeOptionValue.startValue) && !(0, _type.isDefined)(visualRangeOptionValue.endValue) && !(0, _type.isDefined)(visualRangeOptionValue.length)) {
  31184. visualRange = {
  31185. startValue: options.min,
  31186. endValue: options.max
  31187. }
  31188. } else {
  31189. visualRange = visualRangeOptionValue
  31190. }
  31191. that._setVisualRange(visualRange)
  31192. },
  31193. _validateVisualRange: function(visualRange) {
  31194. var range = getVizRangeObject(visualRange);
  31195. if (void 0 !== range.startValue) {
  31196. range.startValue = this.validateUnit(range.startValue)
  31197. }
  31198. if (void 0 !== range.endValue) {
  31199. range.endValue = this.validateUnit(range.endValue)
  31200. }
  31201. return convertVisualRangeObject(range, visualRange)
  31202. },
  31203. _validateOptions: function(options) {
  31204. var that = this;
  31205. if (void 0 !== options.min) {
  31206. options.min = that.validateUnit(options.min, "E2106")
  31207. }
  31208. if (void 0 !== options.max) {
  31209. options.max = that.validateUnit(options.max, "E2106")
  31210. }
  31211. options.wholeRange = that._validateVisualRange(options.wholeRange);
  31212. options.visualRange = options._customVisualRange = that._validateVisualRange(options._customVisualRange);
  31213. that._mergeViewportOptions()
  31214. },
  31215. validate: function() {
  31216. var that = this;
  31217. var options = that._options;
  31218. var dataType = that.isArgumentAxis ? options.argumentType : options.valueType;
  31219. var parser = dataType ? _parse_utils2.default.getParser(dataType) : function(unit) {
  31220. return unit
  31221. };
  31222. that.parser = parser;
  31223. options.dataType = dataType;
  31224. that._validateOptions(options)
  31225. },
  31226. resetVisualRange: function(isSilent) {
  31227. this._seriesData.minVisible = this._seriesData.min;
  31228. this._seriesData.maxVisible = this._seriesData.max;
  31229. this.handleZooming([null, null], {
  31230. start: !!isSilent,
  31231. end: !!isSilent
  31232. })
  31233. },
  31234. _applyZooming: function(visualRange, allowPartialUpdate) {
  31235. var that = this;
  31236. that._resetVisualRangeOption();
  31237. that._setVisualRange(visualRange, allowPartialUpdate);
  31238. var viewPort = that.getViewport();
  31239. that._breaks = that._getScaleBreaks(that._options, {
  31240. minVisible: viewPort.startValue,
  31241. maxVisible: viewPort.endValue
  31242. }, that._series, that.isArgumentAxis);
  31243. that._translator.updateBusinessRange(that._getViewportRange())
  31244. },
  31245. getZoomStartEventArg: function(event, actionType) {
  31246. return {
  31247. axis: this,
  31248. range: this.visualRange(),
  31249. cancel: false,
  31250. event: event,
  31251. actionType: actionType
  31252. }
  31253. },
  31254. getZoomEndEventArg: function(previousRange, event, actionType, zoomFactor, shift) {
  31255. var newRange = this.visualRange();
  31256. return {
  31257. axis: this,
  31258. previousRange: previousRange,
  31259. range: newRange,
  31260. cancel: false,
  31261. event: event,
  31262. actionType: actionType,
  31263. zoomFactor: zoomFactor,
  31264. shift: shift,
  31265. rangeStart: newRange.startValue,
  31266. rangeEnd: newRange.endValue
  31267. }
  31268. },
  31269. getZoomBounds: function() {
  31270. var wholeRange = _utils2.default.getVizRangeObject(this._options.wholeRange);
  31271. var range = this.getTranslator().getBusinessRange();
  31272. var secondPriorityRange = {
  31273. startValue: getZoomBoundValue(this._initRange.startValue, range.min),
  31274. endValue: getZoomBoundValue(this._initRange.endValue, range.max)
  31275. };
  31276. return {
  31277. startValue: getZoomBoundValue(wholeRange.startValue, secondPriorityRange.startValue),
  31278. endValue: getZoomBoundValue(wholeRange.endValue, secondPriorityRange.endValue)
  31279. }
  31280. },
  31281. setInitRange: function() {
  31282. this._initRange = {};
  31283. if (0 === Object.keys(this._options.wholeRange || {}).length) {
  31284. this._initRange = this.getZoomBounds()
  31285. }
  31286. },
  31287. _resetVisualRangeOption: function() {
  31288. this._options._customVisualRange = {}
  31289. },
  31290. setCustomVisualRange: function(range) {
  31291. this._options._customVisualRange = range
  31292. },
  31293. visualRange: function visualRange() {
  31294. var that = this;
  31295. var args = arguments;
  31296. var visualRange;
  31297. if (0 === args.length) {
  31298. var adjustedRange = that._getAdjustedBusinessRange();
  31299. var startValue = adjustedRange.minVisible;
  31300. var endValue = adjustedRange.maxVisible;
  31301. if (that._options.type === _axes_constants2.default.discrete) {
  31302. startValue = (0, _type.isDefined)(startValue) ? startValue : adjustedRange.categories[0];
  31303. endValue = (0, _type.isDefined)(endValue) ? endValue : adjustedRange.categories[adjustedRange.categories.length - 1];
  31304. return {
  31305. startValue: startValue,
  31306. endValue: endValue,
  31307. categories: _utils2.default.getCategoriesInfo(adjustedRange.categories, startValue, endValue).categories
  31308. }
  31309. }
  31310. return {
  31311. startValue: startValue,
  31312. endValue: endValue
  31313. }
  31314. } else {
  31315. if (_isArray(args[0])) {
  31316. visualRange = args[0]
  31317. } else {
  31318. if ((0, _type.isPlainObject)(args[0])) {
  31319. visualRange = (0, _extend.extend)({}, args[0])
  31320. } else {
  31321. visualRange = [args[0], args[1]]
  31322. }
  31323. }
  31324. }
  31325. var zoomResults = that.handleZooming(visualRange, args[1]);
  31326. if (!zoomResults.isPrevented) {
  31327. that._visualRange(that, zoomResults)
  31328. }
  31329. },
  31330. handleZooming: function(visualRange, preventEvents, domEvent, action) {
  31331. var that = this;
  31332. preventEvents = preventEvents || {};
  31333. if ((0, _type.isDefined)(visualRange)) {
  31334. visualRange = that._validateVisualRange(visualRange);
  31335. visualRange.action = action
  31336. }
  31337. var zoomStartEvent = that.getZoomStartEventArg(domEvent, action);
  31338. var previousRange = zoomStartEvent.range;
  31339. !preventEvents.start && that._eventTrigger("zoomStart", zoomStartEvent);
  31340. var zoomResults = {
  31341. isPrevented: zoomStartEvent.cancel,
  31342. skipEventRising: preventEvents.skipEventRising,
  31343. range: visualRange || zoomStartEvent.range
  31344. };
  31345. if (!zoomStartEvent.cancel) {
  31346. (0, _type.isDefined)(visualRange) && that._applyZooming(visualRange, preventEvents.allowPartialUpdate);
  31347. if (!(0, _type.isDefined)(that._storedZoomEndParams)) {
  31348. that._storedZoomEndParams = {
  31349. startRange: previousRange,
  31350. type: this.getOptions().type
  31351. }
  31352. }
  31353. that._storedZoomEndParams.event = domEvent;
  31354. that._storedZoomEndParams.action = action;
  31355. that._storedZoomEndParams.prevent = !!preventEvents.end
  31356. }
  31357. return zoomResults
  31358. },
  31359. handleZoomEnd: function() {
  31360. var that = this;
  31361. if ((0, _type.isDefined)(that._storedZoomEndParams) && !that._storedZoomEndParams.prevent) {
  31362. var previousRange = that._storedZoomEndParams.startRange;
  31363. var domEvent = that._storedZoomEndParams.event;
  31364. var action = that._storedZoomEndParams.action;
  31365. var previousBusinessRange = {
  31366. minVisible: previousRange.startValue,
  31367. maxVisible: previousRange.endValue,
  31368. categories: previousRange.categories
  31369. };
  31370. var typeIsNotChanged = that.getOptions().type === that._storedZoomEndParams.type;
  31371. var shift = typeIsNotChanged ? (0, _math2.adjust)(that.getVisualRangeCenter() - that.getVisualRangeCenter(previousBusinessRange)) : NaN;
  31372. var zoomFactor = typeIsNotChanged ? +(Math.round(that.getVisualRangeLength(previousBusinessRange) / that.getVisualRangeLength() + "e+2") + "e-2") : NaN;
  31373. var zoomEndEvent = that.getZoomEndEventArg(previousRange, domEvent, action, zoomFactor, shift);
  31374. zoomEndEvent.cancel = that.isZoomingLowerLimitOvercome(1 === zoomFactor ? "pan" : "zoom", zoomFactor);
  31375. that._eventTrigger("zoomEnd", zoomEndEvent);
  31376. if (zoomEndEvent.cancel) {
  31377. that.restorePreviousVisualRange(previousRange)
  31378. }
  31379. that._storedZoomEndParams = null
  31380. }
  31381. },
  31382. restorePreviousVisualRange: function(previousRange) {
  31383. var that = this;
  31384. that._storedZoomEndParams = null;
  31385. that._applyZooming(previousRange);
  31386. that._visualRange(that, previousRange)
  31387. },
  31388. isZoomingLowerLimitOvercome: function(actionType, zoomFactor, range) {
  31389. var that = this;
  31390. var options = that._options;
  31391. var minZoom = options.minVisualRangeLength;
  31392. var isOvercoming = "zoom" === actionType && zoomFactor >= 1;
  31393. var businessRange = that._translator.getBusinessRange();
  31394. var visualRange;
  31395. if ((0, _type.isDefined)(range)) {
  31396. visualRange = that.adjustRange(_utils2.default.getVizRangeObject(range));
  31397. visualRange = {
  31398. minVisible: visualRange.startValue,
  31399. maxVisible: visualRange.endValue,
  31400. categories: businessRange.categories
  31401. }
  31402. }
  31403. var visualRangeLength = that.getVisualRangeLength(visualRange);
  31404. if ("discrete" !== options.type) {
  31405. if ((0, _type.isDefined)(minZoom)) {
  31406. if ("datetime" === options.dataType && !(0, _type.isNumeric)(minZoom)) {
  31407. minZoom = (0, _date.dateToMilliseconds)(minZoom)
  31408. }
  31409. isOvercoming &= minZoom >= visualRangeLength
  31410. } else {
  31411. var canvasLength = that._translator.canvasLength;
  31412. var fullRange = {
  31413. minVisible: businessRange.min,
  31414. maxVisible: businessRange.max,
  31415. categories: businessRange.categories
  31416. };
  31417. isOvercoming &= that.getVisualRangeLength(fullRange) / canvasLength >= visualRangeLength
  31418. }
  31419. } else {
  31420. !(0, _type.isDefined)(minZoom) && (minZoom = 1);
  31421. isOvercoming &= (0, _type.isDefined)(range) && that.getVisualRangeLength() === minZoom && visualRangeLength <= minZoom
  31422. }
  31423. return !!isOvercoming
  31424. },
  31425. dataVisualRangeIsReduced: function() {
  31426. var minDataValue;
  31427. var maxDataValue;
  31428. var translator = this.getTranslator();
  31429. if ("discrete" === this._options.type) {
  31430. var categories = translator.getBusinessRange().categories;
  31431. minDataValue = categories[0];
  31432. maxDataValue = categories[categories.length - 1]
  31433. } else {
  31434. var seriesData = this._seriesData;
  31435. minDataValue = seriesData.min;
  31436. maxDataValue = seriesData.max
  31437. }
  31438. if (!(0, _type.isDefined)(minDataValue) || !(0, _type.isDefined)(maxDataValue)) {
  31439. return false
  31440. }
  31441. var startPoint = translator.translate(minDataValue);
  31442. var endPoint = translator.translate(maxDataValue);
  31443. var edges = [Math.min(startPoint, endPoint), Math.max(startPoint, endPoint)];
  31444. var visualRange = this.visualRange();
  31445. var visualRangeStartPoint = translator.translate(visualRange.startValue);
  31446. var visualRangeEndPoint = translator.translate(visualRange.endValue);
  31447. return visualRangeStartPoint > edges[0] && visualRangeStartPoint < edges[1] || visualRangeEndPoint > edges[0] && visualRangeEndPoint < edges[1] || visualRangeStartPoint === visualRangeEndPoint && edges[0] !== edges[1]
  31448. },
  31449. isExtremePosition: function(isMax) {
  31450. var extremeDataValue;
  31451. var seriesData;
  31452. if ("discrete" === this._options.type) {
  31453. seriesData = this._translator.getBusinessRange();
  31454. extremeDataValue = isMax ? seriesData.categories[seriesData.categories.length - 1] : seriesData.categories[0]
  31455. } else {
  31456. seriesData = this.getZoomBounds();
  31457. extremeDataValue = isMax ? seriesData.endValue : seriesData.startValue
  31458. }
  31459. var translator = this.getTranslator();
  31460. var extremePoint = translator.translate(extremeDataValue);
  31461. var visualRange = this.visualRange();
  31462. var visualRangePoint = isMax ? translator.translate(visualRange.endValue) : translator.translate(visualRange.startValue);
  31463. return _abs(visualRangePoint - extremePoint) < SCROLL_THRESHOLD
  31464. },
  31465. getViewport: function() {
  31466. return this._viewport
  31467. },
  31468. getFullTicks: function() {
  31469. var majors = this._majorTicks || [];
  31470. if (this._options.type === _axes_constants2.default.discrete) {
  31471. return convertTicksToValues(majors)
  31472. } else {
  31473. return convertTicksToValues(majors.concat(this._minorTicks, this._boundaryTicks)).sort(function(a, b) {
  31474. return valueOf(a) - valueOf(b)
  31475. })
  31476. }
  31477. },
  31478. measureLabels: function(canvas, withIndents) {
  31479. var that = this;
  31480. var options = that._options;
  31481. var widthAxis = options.visible ? options.width : 0;
  31482. var ticks;
  31483. var indent = withIndents ? options.label.indentFromAxis + .5 * options.tick.length : 0;
  31484. var tickInterval;
  31485. var viewportRange = that._getViewportRange();
  31486. if (viewportRange.isEmpty() || !options.label.visible || !that._axisElementsGroup) {
  31487. return {
  31488. height: widthAxis,
  31489. width: widthAxis,
  31490. x: 0,
  31491. y: 0
  31492. }
  31493. }
  31494. if (that._majorTicks) {
  31495. ticks = convertTicksToValues(that._majorTicks)
  31496. } else {
  31497. this.updateCanvas(canvas);
  31498. ticks = that._createTicksAndLabelFormat(viewportRange, _common.noop);
  31499. tickInterval = ticks.tickInterval;
  31500. ticks = ticks.ticks
  31501. }
  31502. var maxText = ticks.reduce(function(prevLabel, tick, index) {
  31503. var label = that.formatLabel(tick, options.label, viewportRange, void 0, tickInterval, ticks);
  31504. if (prevLabel.length < label.length) {
  31505. return label
  31506. } else {
  31507. return prevLabel
  31508. }
  31509. }, that.formatLabel(ticks[0], options.label, viewportRange, void 0, tickInterval, ticks));
  31510. var text = that._renderer.text(maxText, 0, 0).css(that._textFontStyles).attr(that._textOptions).append(that._renderer.root);
  31511. var box = text.getBBox();
  31512. text.remove();
  31513. return {
  31514. x: box.x,
  31515. y: box.y,
  31516. width: box.width + indent,
  31517. height: box.height + indent
  31518. }
  31519. },
  31520. _setLabelsPlacement: function() {
  31521. if (!this._options.label.visible) {
  31522. return
  31523. }
  31524. var that = this;
  31525. var labelOpt = that._options.label;
  31526. var displayMode = that._validateDisplayMode(labelOpt.displayMode);
  31527. var overlappingMode = that._validateOverlappingMode(labelOpt.overlappingBehavior, displayMode);
  31528. var ignoreOverlapping = "none" === overlappingMode || "ignore" === overlappingMode;
  31529. var behavior = {
  31530. rotationAngle: labelOpt.rotationAngle,
  31531. staggeringSpacing: labelOpt.staggeringSpacing
  31532. };
  31533. var notRecastStep;
  31534. var boxes = that._majorTicks.map(function(tick) {
  31535. return tick.labelBBox
  31536. });
  31537. var step;
  31538. step = that._getStep(boxes);
  31539. switch (displayMode) {
  31540. case ROTATE:
  31541. if (ignoreOverlapping) {
  31542. notRecastStep = true;
  31543. step = 1
  31544. }
  31545. that._applyLabelMode(displayMode, step, boxes, labelOpt, notRecastStep);
  31546. break;
  31547. case "stagger":
  31548. if (ignoreOverlapping) {
  31549. step = 2
  31550. }
  31551. that._applyLabelMode(displayMode, _max(step, 2), boxes, labelOpt);
  31552. break;
  31553. default:
  31554. that._applyLabelOverlapping(boxes, overlappingMode, step, behavior)
  31555. }
  31556. },
  31557. _applyLabelOverlapping: function(boxes, mode, step, behavior) {
  31558. var that = this;
  31559. var labelOpt = that._options.label;
  31560. var majorTicks = that._majorTicks;
  31561. if ("none" === mode || "ignore" === mode) {
  31562. return
  31563. }
  31564. var checkLabels = function(box, index, array) {
  31565. if (0 === index) {
  31566. return false
  31567. }
  31568. return _axes_constants2.default.areLabelsOverlap(box, array[index - 1], labelOpt.minSpacing, labelOpt.alignment)
  31569. };
  31570. if (step > 1 && boxes.some(checkLabels)) {
  31571. that._applyLabelMode(mode, step, boxes, behavior)
  31572. }
  31573. that._checkBoundedLabelsOverlapping(majorTicks, boxes, mode)
  31574. },
  31575. _applyLabelMode: function(mode, step, boxes, behavior, notRecastStep) {
  31576. var that = this;
  31577. var majorTicks = that._majorTicks;
  31578. var labelOpt = that._options.label;
  31579. var angle = behavior.rotationAngle;
  31580. var alignment;
  31581. var func;
  31582. switch (mode) {
  31583. case ROTATE:
  31584. if (!labelOpt.userAlignment) {
  31585. alignment = angle < 0 ? RIGHT : LEFT;
  31586. if (angle % 90 === 0) {
  31587. alignment = CENTER
  31588. }
  31589. }
  31590. step = notRecastStep ? step : that._getStep(boxes, angle);
  31591. func = function(tick) {
  31592. tick.label.rotate(angle);
  31593. tick.labelRotationAngle = angle;
  31594. alignment && (tick.labelAlignment = alignment)
  31595. };
  31596. updateLabels(majorTicks, step, func);
  31597. break;
  31598. case "stagger":
  31599. var labelHeight = that._getMaxLabelHeight(boxes, behavior.staggeringSpacing);
  31600. func = function(tick, index) {
  31601. if (index / (step - 1) % 2 !== 0) {
  31602. tick.labelOffset = labelHeight
  31603. }
  31604. };
  31605. updateLabels(majorTicks, step - 1, func);
  31606. break;
  31607. case "auto":
  31608. case "_auto":
  31609. if (2 === step) {
  31610. that._applyLabelMode("stagger", step, boxes, behavior)
  31611. } else {
  31612. that._applyLabelMode(ROTATE, step, boxes, {
  31613. rotationAngle: getOptimalAngle(boxes, labelOpt)
  31614. })
  31615. }
  31616. break;
  31617. default:
  31618. updateLabels(majorTicks, step)
  31619. }
  31620. },
  31621. getMarkerTrackers: _common.noop,
  31622. _drawDateMarkers: _common.noop,
  31623. _adjustDateMarkers: _common.noop,
  31624. coordsIn: _common.noop,
  31625. areCoordsOutsideAxis: _common.noop,
  31626. _getSkippedCategory: _common.noop,
  31627. _initAxisPositions: _common.noop,
  31628. _drawTitle: _common.noop,
  31629. _updateTitleCoords: _common.noop,
  31630. _adjustConstantLineLabels: _common.noop,
  31631. _createTranslator: function() {
  31632. return new _translator2d2.default.Translator2D({}, {}, {})
  31633. },
  31634. _updateTranslator: function() {
  31635. var translator = this._translator;
  31636. translator.update(translator.getBusinessRange(), this._canvas || {}, this._getTranslatorOptions())
  31637. },
  31638. _getTranslatorOptions: function() {
  31639. var options = this._options;
  31640. return {
  31641. isHorizontal: this._isHorizontal,
  31642. shiftZeroValue: !this.isArgumentAxis,
  31643. interval: options.semiDiscreteInterval,
  31644. stick: this._getStick(),
  31645. breaksSize: options.breakStyle ? options.breakStyle.width : 0
  31646. }
  31647. },
  31648. getVisibleArea: function() {
  31649. var canvas = this._getCanvasStartEnd();
  31650. return [canvas.start, canvas.end].sort(function(a, b) {
  31651. return a - b
  31652. })
  31653. },
  31654. _getCanvasStartEnd: function() {
  31655. var isHorizontal = this._isHorizontal;
  31656. var canvas = this._canvas || {};
  31657. var invert = this._translator.getBusinessRange().invert;
  31658. var coords = isHorizontal ? [canvas.left, canvas.width - canvas.right] : [canvas.height - canvas.bottom, canvas.top];
  31659. invert && coords.reverse();
  31660. return {
  31661. start: coords[0],
  31662. end: coords[1]
  31663. }
  31664. },
  31665. _getScreenDelta: function() {
  31666. var that = this;
  31667. var canvas = that._getCanvasStartEnd();
  31668. var breaks = that._breaks;
  31669. var breaksLength = breaks ? breaks.length : 0;
  31670. var screenDelta = _abs(canvas.start - canvas.end);
  31671. return screenDelta - (breaksLength ? breaks[breaksLength - 1].cumulativeWidth : 0)
  31672. },
  31673. _getScaleBreaks: function() {
  31674. return []
  31675. },
  31676. _adjustTitle: _common.noop,
  31677. _checkTitleOverflow: _common.noop,
  31678. getSpiderTicks: _common.noop,
  31679. setSpiderTicks: _common.noop,
  31680. _checkBoundedLabelsOverlapping: _common.noop,
  31681. drawScaleBreaks: _common.noop,
  31682. _visualRange: _common.noop,
  31683. _rotateConstantLine: _common.noop,
  31684. applyVisualRangeSetter: _common.noop,
  31685. getCategoriesSorter: function(argCategories) {
  31686. var sort;
  31687. if (this.isArgumentAxis) {
  31688. sort = argCategories
  31689. } else {
  31690. var categoriesSortingMethod = this._options.categoriesSortingMethod;
  31691. sort = (0, _type.isDefined)(categoriesSortingMethod) ? categoriesSortingMethod : this._options.categories
  31692. }
  31693. return sort
  31694. },
  31695. _getAdjustedBusinessRange: function() {
  31696. return this.adjustViewport(this._translator.getBusinessRange())
  31697. },
  31698. _getTickMarkPoints: _common.noop,
  31699. _validateOverlappingMode: _common.noop,
  31700. _getStep: _common.noop,
  31701. _validateDisplayMode: _common.noop,
  31702. shift: _common.noop
  31703. }
  31704. },
  31705. /*!***************************************************!*\
  31706. !*** ./artifacts/transpiled/viz/gauges/common.js ***!
  31707. \***************************************************/
  31708. /*! dynamic exports provided */
  31709. /*! all exports used */
  31710. function(module, exports, __webpack_require__) {
  31711. var dxBaseGauge = __webpack_require__( /*! ./base_gauge */ 145).dxBaseGauge;
  31712. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  31713. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  31714. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  31715. var _isDefined = typeUtils.isDefined;
  31716. var _isArray = Array.isArray;
  31717. var _isNumber = typeUtils.isNumeric;
  31718. var axisModule = __webpack_require__( /*! ../axes/base_axis */ 204);
  31719. var _map = __webpack_require__( /*! ../core/utils */ 10).map;
  31720. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  31721. var _compareArrays = __webpack_require__( /*! ./base_gauge */ 145).compareArrays;
  31722. var _isFinite = isFinite;
  31723. var _Number = Number;
  31724. var _min = Math.min;
  31725. var _max = Math.max;
  31726. var _extend = extend;
  31727. var _each = each;
  31728. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  31729. var SHIFT_ANGLE = 90;
  31730. var OPTION_VALUE = "value";
  31731. var OPTION_SUBVALUES = "subvalues";
  31732. var DEFAULT_MINOR_AXIS_DIVISION_FACTOR = 5;
  31733. var DEFAULT_NUMBER_MULTIPLIERS = [1, 2, 5];
  31734. function processValue(value, fallbackValue) {
  31735. if (null === value) {
  31736. return value
  31737. }
  31738. return _isFinite(value) ? _Number(value) : fallbackValue
  31739. }
  31740. function parseArrayOfNumbers(arg) {
  31741. return _isArray(arg) ? arg : _isNumber(arg) ? [arg] : null
  31742. }
  31743. exports.dxGauge = dxBaseGauge.inherit({
  31744. _initCore: function() {
  31745. var that = this;
  31746. var renderer = that._renderer;
  31747. that._setupValue(that.option(OPTION_VALUE));
  31748. that.__subvalues = parseArrayOfNumbers(that.option(OPTION_SUBVALUES));
  31749. that._setupSubvalues(that.__subvalues);
  31750. selectMode(that);
  31751. that.callBase.apply(that, arguments);
  31752. that._rangeContainer = new that._factory.RangeContainer({
  31753. renderer: renderer,
  31754. container: renderer.root,
  31755. translator: that._translator,
  31756. themeManager: that._themeManager
  31757. });
  31758. that._initScale()
  31759. },
  31760. _fontFields: ["scale.label.font", "valueIndicators.rangebar.text.font", "valueIndicators.textcloud.text.font", "indicator.text.font"],
  31761. _initScale: function() {
  31762. var that = this;
  31763. that._scaleGroup = that._renderer.g().attr({
  31764. "class": "dxg-scale"
  31765. }).linkOn(that._renderer.root, "scale");
  31766. that._scale = new axisModule.Axis({
  31767. incidentOccurred: that._incidentOccurred,
  31768. renderer: that._renderer,
  31769. axesContainerGroup: that._scaleGroup,
  31770. axisType: that._scaleTypes.type,
  31771. drawingType: that._scaleTypes.drawingType,
  31772. widgetClass: "dxg"
  31773. })
  31774. },
  31775. _disposeCore: function() {
  31776. var that = this;
  31777. that.callBase.apply(that, arguments);
  31778. that._scale.dispose();
  31779. that._scaleGroup.linkOff();
  31780. that._rangeContainer.dispose();
  31781. that._disposeValueIndicators();
  31782. that._scale = that._scaleGroup = that._rangeContainer = null
  31783. },
  31784. _disposeValueIndicators: function() {
  31785. var that = this;
  31786. that._valueIndicator && that._valueIndicator.dispose();
  31787. that._subvalueIndicatorsSet && that._subvalueIndicatorsSet.dispose();
  31788. that._valueIndicator = that._subvalueIndicatorsSet = null
  31789. },
  31790. _setupDomainCore: function() {
  31791. var that = this;
  31792. var scaleOption = that.option("scale") || {};
  31793. var startValue = that.option("startValue");
  31794. var endValue = that.option("endValue");
  31795. startValue = _isNumber(startValue) ? _Number(startValue) : _isNumber(scaleOption.startValue) ? _Number(scaleOption.startValue) : 0;
  31796. endValue = _isNumber(endValue) ? _Number(endValue) : _isNumber(scaleOption.endValue) ? _Number(scaleOption.endValue) : 100;
  31797. that._baseValue = startValue < endValue ? startValue : endValue;
  31798. that._translator.setDomain(startValue, endValue)
  31799. },
  31800. _cleanContent: function() {
  31801. var that = this;
  31802. that._rangeContainer.clean();
  31803. that._cleanValueIndicators()
  31804. },
  31805. _measureScale: function(scaleOptions) {
  31806. var that = this;
  31807. var majorTick = scaleOptions.tick;
  31808. var majorTickEnabled = majorTick.visible && majorTick.length > 0 && majorTick.width > 0;
  31809. var minorTick = scaleOptions.minorTick;
  31810. var minorTickEnabled = minorTick.visible && minorTick.length > 0 && minorTick.width > 0;
  31811. var label = scaleOptions.label;
  31812. var indentFromTick = Number(label.indentFromTick);
  31813. if (!majorTickEnabled && !minorTickEnabled && !label.visible) {
  31814. return {}
  31815. }
  31816. var textParams = that._scale.measureLabels(extend({}, that._canvas));
  31817. var layoutValue = that._getScaleLayoutValue();
  31818. var result = {
  31819. min: layoutValue,
  31820. max: layoutValue
  31821. };
  31822. var coefs = that._getTicksCoefficients(scaleOptions);
  31823. var innerCoef = coefs.inner;
  31824. var outerCoef = coefs.outer;
  31825. if (majorTickEnabled) {
  31826. result.min = _min(result.min, layoutValue - innerCoef * majorTick.length);
  31827. result.max = _max(result.max, layoutValue + outerCoef * majorTick.length)
  31828. }
  31829. if (minorTickEnabled) {
  31830. result.min = _min(result.min, layoutValue - innerCoef * minorTick.length);
  31831. result.max = _max(result.max, layoutValue + outerCoef * minorTick.length)
  31832. }
  31833. label.visible && that._correctScaleIndents(result, indentFromTick, textParams);
  31834. return result
  31835. },
  31836. _renderContent: function() {
  31837. var that = this;
  31838. var scaleOptions = that._prepareScaleSettings();
  31839. that._rangeContainer.render(_extend(that._getOption("rangeContainer"), {
  31840. vertical: that._area.vertical
  31841. }));
  31842. that._renderScale(scaleOptions);
  31843. var elements = _map([that._rangeContainer].concat(that._prepareValueIndicators()), function(element) {
  31844. return element && element.enabled ? element : null
  31845. });
  31846. that._applyMainLayout(elements, that._measureScale(scaleOptions));
  31847. _each(elements, function(_, element) {
  31848. element.resize(that._getElementLayout(element.getOffset()))
  31849. });
  31850. that._shiftScale(that._getElementLayout(0), scaleOptions);
  31851. that._beginValueChanging();
  31852. that._updateActiveElements();
  31853. that._endValueChanging()
  31854. },
  31855. _prepareScaleSettings: function() {
  31856. var that = this;
  31857. var userOptions = that.option("scale");
  31858. var scaleOptions = extend(true, {}, that._themeManager.theme("scale"), userOptions);
  31859. scaleOptions.label.indentFromAxis = 0;
  31860. scaleOptions.isHorizontal = !that._area.vertical;
  31861. scaleOptions.forceUserTickInterval |= _isDefined(userOptions) && _isDefined(userOptions.tickInterval) && !_isDefined(userOptions.scaleDivisionFactor);
  31862. scaleOptions.axisDivisionFactor = scaleOptions.scaleDivisionFactor || that._gridSpacingFactor;
  31863. scaleOptions.minorAxisDivisionFactor = scaleOptions.minorScaleDivisionFactor || DEFAULT_MINOR_AXIS_DIVISION_FACTOR;
  31864. scaleOptions.numberMultipliers = DEFAULT_NUMBER_MULTIPLIERS;
  31865. scaleOptions.tickOrientation = that._getTicksOrientation(scaleOptions);
  31866. if (scaleOptions.label.useRangeColors) {
  31867. scaleOptions.label.customizeColor = function() {
  31868. return that._rangeContainer.getColorForValue(this.value)
  31869. }
  31870. }
  31871. return scaleOptions
  31872. },
  31873. _renderScale: function(scaleOptions) {
  31874. var that = this;
  31875. var bounds = that._translator.getDomain();
  31876. var startValue = bounds[0];
  31877. var endValue = bounds[1];
  31878. var angles = that._translator.getCodomain();
  31879. var invert = startValue > endValue;
  31880. var min = _min(startValue, endValue);
  31881. var max = _max(startValue, endValue);
  31882. scaleOptions.min = min;
  31883. scaleOptions.max = max;
  31884. scaleOptions.startAngle = SHIFT_ANGLE - angles[0];
  31885. scaleOptions.endAngle = SHIFT_ANGLE - angles[1];
  31886. scaleOptions.skipViewportExtending = true;
  31887. that._scale.updateOptions(scaleOptions);
  31888. that._scale.setBusinessRange({
  31889. axisType: "continuous",
  31890. dataType: "numeric",
  31891. min: min,
  31892. max: max,
  31893. invert: invert
  31894. });
  31895. that._updateScaleTickIndent(scaleOptions);
  31896. that._scaleGroup.linkAppend();
  31897. that._scale.draw(extend({}, that._canvas))
  31898. },
  31899. _updateIndicatorSettings: function(settings) {
  31900. var that = this;
  31901. settings.currentValue = settings.baseValue = _isFinite(that._translator.translate(settings.baseValue)) ? _Number(settings.baseValue) : that._baseValue;
  31902. settings.vertical = that._area.vertical;
  31903. if (settings.text && !settings.text.format) {
  31904. settings.text.format = that._defaultFormatOptions
  31905. }
  31906. },
  31907. _prepareIndicatorSettings: function(options, defaultTypeField) {
  31908. var that = this;
  31909. var theme = that._themeManager.theme("valueIndicators");
  31910. var type = _normalizeEnum(options.type || that._themeManager.theme(defaultTypeField));
  31911. var settings = _extend(true, {}, theme._default, theme[type], options);
  31912. settings.type = type;
  31913. settings.animation = that._animationSettings;
  31914. settings.containerBackgroundColor = that._containerBackgroundColor;
  31915. that._updateIndicatorSettings(settings);
  31916. return settings
  31917. },
  31918. _cleanValueIndicators: function() {
  31919. this._valueIndicator && this._valueIndicator.clean();
  31920. this._subvalueIndicatorsSet && this._subvalueIndicatorsSet.clean()
  31921. },
  31922. _prepareValueIndicators: function() {
  31923. var that = this;
  31924. that._prepareValueIndicator();
  31925. null !== that.__subvalues && that._prepareSubvalueIndicators();
  31926. return [that._valueIndicator, that._subvalueIndicatorsSet]
  31927. },
  31928. _updateActiveElements: function() {
  31929. this._updateValueIndicator();
  31930. this._updateSubvalueIndicators()
  31931. },
  31932. _prepareValueIndicator: function() {
  31933. var that = this;
  31934. var target = that._valueIndicator;
  31935. var settings = that._prepareIndicatorSettings(that.option("valueIndicator") || {}, "valueIndicatorType");
  31936. if (target && target.type !== settings.type) {
  31937. target.dispose();
  31938. target = null
  31939. }
  31940. if (!target) {
  31941. target = that._valueIndicator = that._createIndicator(settings.type, that._renderer.root, "dxg-value-indicator", "value-indicator")
  31942. }
  31943. target.render(settings)
  31944. },
  31945. _createSubvalueIndicatorsSet: function() {
  31946. var that = this;
  31947. var root = that._renderer.root;
  31948. return new ValueIndicatorsSet({
  31949. createIndicator: function(type, i) {
  31950. return that._createIndicator(type, root, "dxg-subvalue-indicator", "subvalue-indicator", i)
  31951. },
  31952. createPalette: function(palette) {
  31953. return that._themeManager.createPalette(palette)
  31954. }
  31955. })
  31956. },
  31957. _prepareSubvalueIndicators: function() {
  31958. var that = this;
  31959. var target = that._subvalueIndicatorsSet;
  31960. var settings = that._prepareIndicatorSettings(that.option("subvalueIndicator") || {}, "subvalueIndicatorType");
  31961. if (!target) {
  31962. target = that._subvalueIndicatorsSet = that._createSubvalueIndicatorsSet()
  31963. }
  31964. var isRecreate = settings.type !== target.type;
  31965. target.type = settings.type;
  31966. var dummy = that._createIndicator(settings.type, that._renderer.root);
  31967. if (dummy) {
  31968. dummy.dispose();
  31969. target.render(settings, isRecreate)
  31970. }
  31971. },
  31972. _setupValue: function(value) {
  31973. this.__value = processValue(value, this.__value)
  31974. },
  31975. _setupSubvalues: function(subvalues) {
  31976. var vals = void 0 === subvalues ? this.__subvalues : parseArrayOfNumbers(subvalues);
  31977. var i;
  31978. var ii;
  31979. var list;
  31980. if (null === vals) {
  31981. return
  31982. }
  31983. for (i = 0, ii = vals.length, list = []; i < ii; ++i) {
  31984. list.push(processValue(vals[i], this.__subvalues[i]))
  31985. }
  31986. this.__subvalues = list
  31987. },
  31988. _updateValueIndicator: function() {
  31989. var that = this;
  31990. that._valueIndicator && that._valueIndicator.value(that.__value, that._noAnimation)
  31991. },
  31992. _updateSubvalueIndicators: function() {
  31993. var that = this;
  31994. that._subvalueIndicatorsSet && that._subvalueIndicatorsSet.values(that.__subvalues, that._noAnimation)
  31995. },
  31996. value: function(arg) {
  31997. if (void 0 !== arg) {
  31998. this._changeValue(arg);
  31999. return this
  32000. }
  32001. return this.__value
  32002. },
  32003. subvalues: function(arg) {
  32004. if (void 0 !== arg) {
  32005. this._changeSubvalues(arg);
  32006. return this
  32007. }
  32008. return null !== this.__subvalues ? this.__subvalues.slice() : void 0
  32009. },
  32010. _changeValue: function(value) {
  32011. var that = this;
  32012. that._setupValue(value);
  32013. that._beginValueChanging();
  32014. that._updateValueIndicator();
  32015. if (that.__value !== that.option(OPTION_VALUE)) {
  32016. that.option(OPTION_VALUE, that.__value)
  32017. }
  32018. that._endValueChanging()
  32019. },
  32020. _changeSubvalues: function(subvalues) {
  32021. var that = this;
  32022. if (null !== that.__subvalues) {
  32023. that._setupSubvalues(subvalues);
  32024. that._beginValueChanging();
  32025. that._updateSubvalueIndicators();
  32026. that._endValueChanging()
  32027. } else {
  32028. that.__subvalues = parseArrayOfNumbers(subvalues);
  32029. that._setContentSize();
  32030. that._renderContent()
  32031. }
  32032. if (!_compareArrays(that.__subvalues, that.option(OPTION_SUBVALUES))) {
  32033. that.option(OPTION_SUBVALUES, that.__subvalues)
  32034. }
  32035. },
  32036. _optionChangesMap: {
  32037. scale: "DOMAIN",
  32038. rangeContainer: "MOSTLY_TOTAL",
  32039. valueIndicator: "MOSTLY_TOTAL",
  32040. subvalueIndicator: "MOSTLY_TOTAL",
  32041. containerBackgroundColor: "MOSTLY_TOTAL",
  32042. value: "VALUE",
  32043. subvalues: "SUBVALUES",
  32044. valueIndicators: "MOSTLY_TOTAL"
  32045. },
  32046. _customChangesOrder: ["VALUE", "SUBVALUES"],
  32047. _change_VALUE: function() {
  32048. this._changeValue(this.option(OPTION_VALUE))
  32049. },
  32050. _change_SUBVALUES: function() {
  32051. this._changeSubvalues(this.option(OPTION_SUBVALUES))
  32052. },
  32053. _applyMainLayout: null,
  32054. _getElementLayout: null,
  32055. _createIndicator: function(type, owner, className, trackerType, trackerIndex, _strict) {
  32056. var that = this;
  32057. var indicator = that._factory.createIndicator({
  32058. renderer: that._renderer,
  32059. translator: that._translator,
  32060. owner: owner,
  32061. tracker: that._tracker,
  32062. className: className
  32063. }, type, _strict);
  32064. if (indicator) {
  32065. indicator.type = type;
  32066. indicator._trackerInfo = {
  32067. type: trackerType,
  32068. index: trackerIndex
  32069. }
  32070. }
  32071. return indicator
  32072. },
  32073. _getApproximateScreenRange: null
  32074. });
  32075. function valueGetter(arg) {
  32076. return arg ? arg.value : null
  32077. }
  32078. function setupValues(that, fieldName, optionItems) {
  32079. var currentValues = that[fieldName];
  32080. var newValues = _isArray(optionItems) ? _map(optionItems, valueGetter) : [];
  32081. var i = 0;
  32082. var ii = newValues.length;
  32083. var list = [];
  32084. for (; i < ii; ++i) {
  32085. list.push(processValue(newValues[i], currentValues[i]))
  32086. }
  32087. that[fieldName] = list
  32088. }
  32089. function selectMode(gauge) {
  32090. if (void 0 === gauge.option(OPTION_VALUE) && void 0 === gauge.option(OPTION_SUBVALUES)) {
  32091. if (void 0 !== gauge.option("valueIndicators")) {
  32092. disableDefaultMode(gauge);
  32093. selectHardMode(gauge)
  32094. }
  32095. }
  32096. }
  32097. function disableDefaultMode(that) {
  32098. that.value = that.subvalues = _noop;
  32099. that._setupValue = that._setupSubvalues = that._updateValueIndicator = that._updateSubvalueIndicators = null
  32100. }
  32101. function selectHardMode(that) {
  32102. that._indicatorValues = [];
  32103. setupValues(that, "_indicatorValues", that.option("valueIndicators"));
  32104. that._valueIndicators = [];
  32105. var _applyMostlyTotalChange = that._applyMostlyTotalChange;
  32106. that._applyMostlyTotalChange = function() {
  32107. setupValues(this, "_indicatorValues", this.option("valueIndicators"));
  32108. _applyMostlyTotalChange.call(this)
  32109. };
  32110. that._updateActiveElements = updateActiveElements_hardMode;
  32111. that._prepareValueIndicators = prepareValueIndicators_hardMode;
  32112. that._disposeValueIndicators = disposeValueIndicators_hardMode;
  32113. that._cleanValueIndicators = cleanValueIndicators_hardMode;
  32114. that.indicatorValue = indicatorValue_hardMode
  32115. }
  32116. function updateActiveElements_hardMode() {
  32117. var that = this;
  32118. _each(that._valueIndicators, function(_, valueIndicator) {
  32119. valueIndicator.value(that._indicatorValues[valueIndicator.index], that._noAnimation)
  32120. })
  32121. }
  32122. function prepareValueIndicators_hardMode() {
  32123. var that = this;
  32124. var valueIndicators = that._valueIndicators || [];
  32125. var userOptions = that.option("valueIndicators");
  32126. var optionList = [];
  32127. var i = 0;
  32128. var ii;
  32129. for (ii = _isArray(userOptions) ? userOptions.length : 0; i < ii; ++i) {
  32130. optionList.push(userOptions[i])
  32131. }
  32132. for (ii = valueIndicators.length; i < ii; ++i) {
  32133. optionList.push(null)
  32134. }
  32135. var newValueIndicators = [];
  32136. _each(optionList, function(i, userSettings) {
  32137. var valueIndicator = valueIndicators[i];
  32138. if (!userSettings) {
  32139. valueIndicator && valueIndicator.dispose();
  32140. return
  32141. }
  32142. var settings = that._prepareIndicatorSettings(userSettings, "valueIndicatorType");
  32143. if (valueIndicator && valueIndicator.type !== settings.type) {
  32144. valueIndicator.dispose();
  32145. valueIndicator = null
  32146. }
  32147. if (!valueIndicator) {
  32148. valueIndicator = that._createIndicator(settings.type, that._renderer.root, "dxg-value-indicator", "value-indicator", i, true)
  32149. }
  32150. if (valueIndicator) {
  32151. valueIndicator.index = i;
  32152. valueIndicator.render(settings);
  32153. newValueIndicators.push(valueIndicator)
  32154. }
  32155. });
  32156. that._valueIndicators = newValueIndicators;
  32157. return that._valueIndicators
  32158. }
  32159. function disposeValueIndicators_hardMode() {
  32160. _each(this._valueIndicators, function(_, valueIndicator) {
  32161. valueIndicator.dispose()
  32162. });
  32163. this._valueIndicators = null
  32164. }
  32165. function cleanValueIndicators_hardMode() {
  32166. _each(this._valueIndicators, function(_, valueIndicator) {
  32167. valueIndicator.clean()
  32168. })
  32169. }
  32170. function indicatorValue_hardMode(index, value) {
  32171. return accessPointerValue(this, this._valueIndicators, this._indicatorValues, index, value)
  32172. }
  32173. function accessPointerValue(that, pointers, values, index, value) {
  32174. if (void 0 !== value) {
  32175. if (void 0 !== values[index]) {
  32176. values[index] = processValue(value, values[index]);
  32177. pointers[index] && pointers[index].value(values[index])
  32178. }
  32179. return that
  32180. } else {
  32181. return values[index]
  32182. }
  32183. }
  32184. function ValueIndicatorsSet(parameters) {
  32185. this._parameters = parameters;
  32186. this._indicators = []
  32187. }
  32188. ValueIndicatorsSet.prototype = {
  32189. constructor: ValueIndicatorsSet,
  32190. dispose: function() {
  32191. var that = this;
  32192. _each(that._indicators, function(_, indicator) {
  32193. indicator.dispose()
  32194. });
  32195. that._parameters = that._options = that._indicators = that._colorPalette = that._palette = null;
  32196. return that
  32197. },
  32198. clean: function() {
  32199. var that = this;
  32200. that._sample && that._sample.clean().dispose();
  32201. _each(that._indicators, function(_, indicator) {
  32202. indicator.clean()
  32203. });
  32204. that._sample = that._options = that._palette = null;
  32205. return that
  32206. },
  32207. render: function(options, isRecreate) {
  32208. var that = this;
  32209. that._options = options;
  32210. that._sample = that._parameters.createIndicator(that.type);
  32211. that._sample.render(options);
  32212. that.enabled = that._sample.enabled;
  32213. that._palette = _isDefined(options.palette) ? that._parameters.createPalette(options.palette) : null;
  32214. if (that.enabled) {
  32215. that._generatePalette(that._indicators.length);
  32216. that._indicators = _map(that._indicators, function(indicator, i) {
  32217. if (isRecreate) {
  32218. indicator.dispose();
  32219. indicator = that._parameters.createIndicator(that.type, i)
  32220. }
  32221. indicator.render(that._getIndicatorOptions(i));
  32222. return indicator
  32223. })
  32224. }
  32225. return that
  32226. },
  32227. getOffset: function() {
  32228. return this._sample.getOffset()
  32229. },
  32230. resize: function(layout) {
  32231. var that = this;
  32232. that._layout = layout;
  32233. _each(that._indicators, function(_, indicator) {
  32234. indicator.resize(layout)
  32235. });
  32236. return that
  32237. },
  32238. measure: function(layout) {
  32239. return this._sample.measure(layout)
  32240. },
  32241. _getIndicatorOptions: function(index) {
  32242. var result = this._options;
  32243. if (this._colorPalette) {
  32244. result = _extend({}, result, {
  32245. color: this._colorPalette[index]
  32246. })
  32247. }
  32248. return result
  32249. },
  32250. _generatePalette: function(count) {
  32251. var that = this;
  32252. var colors = null;
  32253. if (that._palette) {
  32254. that._palette.reset();
  32255. colors = that._palette.generateColors(count, {
  32256. repeat: true
  32257. })
  32258. }
  32259. that._colorPalette = colors
  32260. },
  32261. _adjustIndicatorsCount: function(count) {
  32262. var that = this;
  32263. var indicators = that._indicators;
  32264. var i;
  32265. var ii;
  32266. var indicator;
  32267. var indicatorsLen = indicators.length;
  32268. if (indicatorsLen > count) {
  32269. for (i = count, ii = indicatorsLen; i < ii; ++i) {
  32270. indicators[i].clean().dispose()
  32271. }
  32272. that._indicators = indicators.slice(0, count);
  32273. that._generatePalette(indicators.length)
  32274. } else {
  32275. if (indicatorsLen < count) {
  32276. that._generatePalette(count);
  32277. for (i = indicatorsLen, ii = count; i < ii; ++i) {
  32278. indicator = that._parameters.createIndicator(that.type, i);
  32279. indicator.render(that._getIndicatorOptions(i)).resize(that._layout);
  32280. indicators.push(indicator)
  32281. }
  32282. }
  32283. }
  32284. },
  32285. values: function(arg, _noAnimation) {
  32286. var that = this;
  32287. if (!that.enabled) {
  32288. return
  32289. }
  32290. if (void 0 !== arg) {
  32291. if (!_isArray(arg)) {
  32292. arg = _isFinite(arg) ? [Number(arg)] : null
  32293. }
  32294. if (arg) {
  32295. that._adjustIndicatorsCount(arg.length);
  32296. _each(that._indicators, function(i, indicator) {
  32297. indicator.value(arg[i], _noAnimation)
  32298. })
  32299. }
  32300. return that
  32301. }
  32302. return _map(that._indicators, function(indicator) {
  32303. return indicator.value()
  32304. })
  32305. }
  32306. };
  32307. exports.createIndicatorCreator = function(indicators) {
  32308. return function(parameters, type, _strict) {
  32309. var indicatorType = indicators[_normalizeEnum(type)] || !_strict && indicators._default;
  32310. return indicatorType ? new indicatorType(parameters) : null
  32311. }
  32312. }
  32313. },
  32314. /*!***********************************************************!*\
  32315. !*** ./artifacts/transpiled/viz/range_selector/common.js ***!
  32316. \***********************************************************/
  32317. /*! dynamic exports provided */
  32318. /*! all exports used */
  32319. function(module, exports, __webpack_require__) {
  32320. var _format = __webpack_require__( /*! ../axes/smart_formatter */ 405).smartFormatter;
  32321. var isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
  32322. var HEIGHT_COMPACT_MODE = 24;
  32323. var POINTER_SIZE = 4;
  32324. var EMPTY_SLIDER_MARKER_TEXT = ". . .";
  32325. var utils = {
  32326. trackerSettings: {
  32327. fill: "grey",
  32328. stroke: "grey",
  32329. opacity: 1e-4
  32330. },
  32331. animationSettings: {
  32332. duration: 250
  32333. }
  32334. };
  32335. var consts = {
  32336. emptySliderMarkerText: EMPTY_SLIDER_MARKER_TEXT,
  32337. pointerSize: POINTER_SIZE
  32338. };
  32339. var formatValue = function(value, formatOptions, tickIntervalsInfo, valueType, type, logarithmBase) {
  32340. var formatObject = {
  32341. value: value,
  32342. valueText: _format(value, {
  32343. labelOptions: formatOptions,
  32344. ticks: tickIntervalsInfo ? tickIntervalsInfo.ticks : [],
  32345. tickInterval: tickIntervalsInfo ? tickIntervalsInfo.tickInterval : void 0,
  32346. dataType: valueType,
  32347. type: type,
  32348. logarithmBase: logarithmBase
  32349. })
  32350. };
  32351. return String(isFunction(formatOptions.customizeText) ? formatOptions.customizeText.call(formatObject, formatObject) : formatObject.valueText)
  32352. };
  32353. exports.utils = utils;
  32354. exports.consts = consts;
  32355. exports.formatValue = formatValue;
  32356. exports.HEIGHT_COMPACT_MODE = HEIGHT_COMPACT_MODE
  32357. },
  32358. /*!*****************************************************!*\
  32359. !*** ./artifacts/transpiled/exporter/file_saver.js ***!
  32360. \*****************************************************/
  32361. /*! dynamic exports provided */
  32362. /*! all exports used */
  32363. function(module, exports, __webpack_require__) {
  32364. var _renderer = __webpack_require__( /*! ../core/renderer */ 2);
  32365. var _renderer2 = _interopRequireDefault(_renderer);
  32366. var _dom_adapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
  32367. var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
  32368. var _window = __webpack_require__( /*! ../core/utils/window */ 7);
  32369. var _window2 = _interopRequireDefault(_window);
  32370. var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5);
  32371. var _events_engine2 = _interopRequireDefault(_events_engine);
  32372. var _ui = __webpack_require__( /*! ../ui/widget/ui.errors */ 17);
  32373. var _ui2 = _interopRequireDefault(_ui);
  32374. var _type = __webpack_require__( /*! ../core/utils/type */ 1);
  32375. var _type2 = _interopRequireDefault(_type);
  32376. var _console = __webpack_require__( /*! ../core/utils/console */ 73);
  32377. function _interopRequireDefault(obj) {
  32378. return obj && obj.__esModule ? obj : {
  32379. "default": obj
  32380. }
  32381. }
  32382. var window = _window2.default.getWindow();
  32383. var navigator = _window2.default.getNavigator();
  32384. var FILE_EXTESIONS = {
  32385. EXCEL: "xlsx",
  32386. CSS: "css",
  32387. PNG: "png",
  32388. JPEG: "jpeg",
  32389. GIF: "gif",
  32390. SVG: "svg",
  32391. PDF: "pdf"
  32392. };
  32393. var MIME_TYPES = exports.MIME_TYPES = {
  32394. CSS: "text/css",
  32395. EXCEL: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  32396. PNG: "image/png",
  32397. JPEG: "image/jpeg",
  32398. GIF: "image/gif",
  32399. SVG: "image/svg+xml",
  32400. PDF: "application/pdf"
  32401. };
  32402. exports.fileSaver = {
  32403. _revokeObjectURLTimeout: 3e4,
  32404. _getDataUri: function(format, data) {
  32405. return "data:" + MIME_TYPES[format] + ";base64," + data
  32406. },
  32407. _linkDownloader: function(fileName, href) {
  32408. var exportLinkElement = _dom_adapter2.default.createElement("a");
  32409. exportLinkElement.download = fileName;
  32410. exportLinkElement.href = href;
  32411. exportLinkElement.target = "_blank";
  32412. return exportLinkElement
  32413. },
  32414. _formDownloader: function(proxyUrl, fileName, contentType, data) {
  32415. var formAttributes = {
  32416. method: "post",
  32417. action: proxyUrl,
  32418. enctype: "multipart/form-data"
  32419. };
  32420. var exportForm = (0, _renderer2.default)("<form>").css({
  32421. display: "none"
  32422. }).attr(formAttributes);
  32423. exportForm.append('<input type="hidden" name="fileName" value="' + fileName + '" />');
  32424. exportForm.append('<input type="hidden" name="contentType" value="' + contentType + '" />');
  32425. exportForm.append('<input type="hidden" name="data" value="' + data + '" />');
  32426. exportForm.appendTo("body");
  32427. _events_engine2.default.trigger(exportForm, "submit");
  32428. if (_events_engine2.default.trigger(exportForm, "submit")) {
  32429. exportForm.remove()
  32430. }
  32431. return exportForm
  32432. },
  32433. _saveByProxy: function(proxyUrl, fileName, format, data) {
  32434. return this._formDownloader(proxyUrl, fileName, MIME_TYPES[format], data)
  32435. },
  32436. _winJSBlobSave: function(blob, fileName, format) {
  32437. var savePicker = new Windows.Storage.Pickers.FileSavePicker;
  32438. savePicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.documentsLibrary;
  32439. savePicker.fileTypeChoices.insert(MIME_TYPES[format], ["." + FILE_EXTESIONS[format]]);
  32440. savePicker.suggestedFileName = fileName;
  32441. savePicker.pickSaveFileAsync().then(function(file) {
  32442. if (file) {
  32443. file.openAsync(Windows.Storage.FileAccessMode.readWrite).then(function(outputStream) {
  32444. var inputStream = blob.msDetachStream();
  32445. Windows.Storage.Streams.RandomAccessStream.copyAsync(inputStream, outputStream).then(function() {
  32446. outputStream.flushAsync().done(function() {
  32447. inputStream.close();
  32448. outputStream.close()
  32449. })
  32450. })
  32451. })
  32452. }
  32453. })
  32454. },
  32455. _click: function(link) {
  32456. try {
  32457. link.dispatchEvent(new MouseEvent("click", {
  32458. cancelable: true
  32459. }))
  32460. } catch (e) {
  32461. var event = _dom_adapter2.default.getDocument().createEvent("MouseEvents");
  32462. event.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);
  32463. link.dispatchEvent(event)
  32464. }
  32465. },
  32466. _saveBlobAs: function(fileName, format, data) {
  32467. var _this = this;
  32468. this._blobSaved = false;
  32469. if (_type2.default.isDefined(navigator.msSaveOrOpenBlob)) {
  32470. navigator.msSaveOrOpenBlob(data, fileName);
  32471. this._blobSaved = true
  32472. } else {
  32473. if (_type2.default.isDefined(window.WinJS)) {
  32474. this._winJSBlobSave(data, fileName, format);
  32475. this._blobSaved = true
  32476. } else {
  32477. var URL = window.URL || window.webkitURL || window.mozURL || window.msURL || window.oURL;
  32478. if (_type2.default.isDefined(URL)) {
  32479. var objectURL = URL.createObjectURL(data);
  32480. var downloadLink = this._linkDownloader(fileName, objectURL);
  32481. setTimeout(function() {
  32482. URL.revokeObjectURL(objectURL);
  32483. _this._objectUrlRevoked = true
  32484. }, this._revokeObjectURLTimeout);
  32485. this._click(downloadLink)
  32486. } else {
  32487. _console.logger.warn("window.URL || window.webkitURL || window.mozURL || window.msURL || window.oURL is not defined")
  32488. }
  32489. }
  32490. }
  32491. },
  32492. saveAs: function(fileName, format, data, proxyURL, forceProxy) {
  32493. fileName += "." + FILE_EXTESIONS[format];
  32494. if (forceProxy) {
  32495. this._saveByProxy(proxyURL, fileName, format, data)
  32496. } else {
  32497. if (_type2.default.isFunction(window.Blob)) {
  32498. this._saveBlobAs(fileName, format, data)
  32499. } else {
  32500. if (_type2.default.isDefined(proxyURL) && !_type2.default.isDefined(navigator.userAgent.match(/iPad/i))) {
  32501. this._saveByProxy(proxyURL, fileName, format, data)
  32502. } else {
  32503. if (!_type2.default.isDefined(navigator.userAgent.match(/iPad/i))) {
  32504. _ui2.default.log("E1034")
  32505. }
  32506. var downloadLink = this._linkDownloader(fileName, this._getDataUri(format, data));
  32507. this._click(downloadLink)
  32508. }
  32509. }
  32510. }
  32511. }
  32512. }
  32513. },
  32514. /*!***************************************************************!*\
  32515. !*** ./artifacts/transpiled/localization/ldml/date.format.js ***!
  32516. \***************************************************************/
  32517. /*! dynamic exports provided */
  32518. /*! all exports used */
  32519. function(module, exports, __webpack_require__) {
  32520. var ARABIC_COMMA = "\u060c";
  32521. var FORMAT_SEPARATORS = " .,:;/\\<>()-[]" + ARABIC_COMMA;
  32522. var ARABIC_ZERO_CODE = 1632;
  32523. var checkDigit = function(char) {
  32524. var code = char && char.charCodeAt(0);
  32525. return char >= "0" && char <= "9" || code >= ARABIC_ZERO_CODE && code < ARABIC_ZERO_CODE + 10
  32526. };
  32527. var checkPatternContinue = function(text, index, isDigit) {
  32528. var char = text[index];
  32529. var prevChar = text[index - 1];
  32530. var nextChar = text[index + 1];
  32531. if (!isDigit) {
  32532. if ("." === char || " " === char && "." === prevChar) {
  32533. return true
  32534. }
  32535. if ("-" === char && !checkDigit(nextChar)) {
  32536. return true
  32537. }
  32538. }
  32539. return FORMAT_SEPARATORS.indexOf(char) < 0 && isDigit === checkDigit(char)
  32540. };
  32541. var getPatternStartIndex = function(defaultPattern, index) {
  32542. if (!checkDigit(defaultPattern[index])) {
  32543. while (index > 0 && !checkDigit(defaultPattern[index - 1]) && ("." === defaultPattern[index - 1] || FORMAT_SEPARATORS.indexOf(defaultPattern[index - 1]) < 0)) {
  32544. index--
  32545. }
  32546. }
  32547. return index
  32548. };
  32549. var getDifference = function(defaultPattern, patterns, processedIndexes, isDigit) {
  32550. var i = 0;
  32551. var result = [];
  32552. var patternsFilter = function(pattern) {
  32553. return defaultPattern[i] !== pattern[i] && (void 0 === isDigit || checkDigit(defaultPattern[i]) === isDigit)
  32554. };
  32555. if (!Array.isArray(patterns)) {
  32556. patterns = [patterns]
  32557. }
  32558. for (i = 0; i < defaultPattern.length; i++) {
  32559. if (processedIndexes.indexOf(i) < 0 && patterns.filter(patternsFilter).length) {
  32560. i = getPatternStartIndex(defaultPattern, i);
  32561. do {
  32562. isDigit = checkDigit(defaultPattern[i]);
  32563. if (!result.length && !isDigit && checkDigit(patterns[0][i])) {
  32564. break
  32565. }
  32566. result.push(i);
  32567. processedIndexes.unshift(i);
  32568. i++
  32569. } while (defaultPattern[i] && checkPatternContinue(defaultPattern, i, isDigit));
  32570. break
  32571. }
  32572. }
  32573. if (1 === result.length && ("0" === defaultPattern[processedIndexes[0] - 1] || "\u0660" === defaultPattern[processedIndexes[0] - 1])) {
  32574. processedIndexes.unshift(processedIndexes[0] - 1)
  32575. }
  32576. return result
  32577. };
  32578. var replaceCharsCore = function(pattern, indexes, char, patternPositions) {
  32579. var baseCharIndex = indexes[0];
  32580. var patternIndex = baseCharIndex < patternPositions.length ? patternPositions[baseCharIndex] : baseCharIndex;
  32581. indexes.forEach(function(_, index) {
  32582. pattern = pattern.substr(0, patternIndex + index) + (char.length > 1 ? char[index] : char) + pattern.substr(patternIndex + index + 1)
  32583. });
  32584. if (1 === indexes.length) {
  32585. pattern = pattern.replace("0" + char, char + char);
  32586. pattern = pattern.replace("\u0660" + char, char + char)
  32587. }
  32588. return pattern
  32589. };
  32590. var replaceChars = function(pattern, indexes, char, patternPositions) {
  32591. var i;
  32592. var index;
  32593. var patternIndex;
  32594. if (!checkDigit(pattern[indexes[0]] || "0")) {
  32595. var letterCount = Math.max(indexes.length <= 3 ? 3 : 4, char.length);
  32596. while (indexes.length > letterCount) {
  32597. index = indexes.pop();
  32598. patternIndex = patternPositions[index];
  32599. patternPositions[index] = -1;
  32600. for (i = index + 1; i < patternPositions.length; i++) {
  32601. patternPositions[i]--
  32602. }
  32603. pattern = pattern.substr(0, patternIndex) + pattern.substr(patternIndex + 1)
  32604. }
  32605. index = indexes[indexes.length - 1] + 1, patternIndex = index < patternPositions.length ? patternPositions[index] : index;
  32606. while (indexes.length < letterCount) {
  32607. indexes.push(indexes[indexes.length - 1] + 1);
  32608. for (i = index; i < patternPositions.length; i++) {
  32609. patternPositions[i]++
  32610. }
  32611. pattern = pattern.substr(0, patternIndex) + " " + pattern.substr(patternIndex)
  32612. }
  32613. }
  32614. pattern = replaceCharsCore(pattern, indexes, char, patternPositions);
  32615. return pattern
  32616. };
  32617. var formatValue = function(value, formatter) {
  32618. if (Array.isArray(value)) {
  32619. return value.map(function(value) {
  32620. return (formatter(value) || "").toString()
  32621. })
  32622. }
  32623. return (formatter(value) || "").toString()
  32624. };
  32625. var ESCAPE_CHARS_REGEXP = /[a-zA-Z]/g;
  32626. var escapeChars = function(pattern, defaultPattern, processedIndexes, patternPositions) {
  32627. var escapeIndexes = defaultPattern.split("").map(function(char, index) {
  32628. if (processedIndexes.indexOf(index) < 0 && (char.match(ESCAPE_CHARS_REGEXP) || "'" === char)) {
  32629. return patternPositions[index]
  32630. }
  32631. return -1
  32632. });
  32633. pattern = pattern.split("").map(function(char, index) {
  32634. var result = char;
  32635. var isCurrentCharEscaped = escapeIndexes.indexOf(index) >= 0;
  32636. var isPrevCharEscaped = index > 0 && escapeIndexes.indexOf(index - 1) >= 0;
  32637. var isNextCharEscaped = escapeIndexes.indexOf(index + 1) >= 0;
  32638. if (isCurrentCharEscaped) {
  32639. if (!isPrevCharEscaped) {
  32640. result = "'" + result
  32641. }
  32642. if (!isNextCharEscaped) {
  32643. result += "'"
  32644. }
  32645. }
  32646. return result
  32647. }).join("");
  32648. return pattern
  32649. };
  32650. var getFormat = function(formatter) {
  32651. var processedIndexes = [];
  32652. var defaultPattern = formatValue(new Date(2009, 8, 8, 6, 5, 4), formatter);
  32653. var patternPositions = defaultPattern.split("").map(function(_, index) {
  32654. return index
  32655. });
  32656. var result = defaultPattern;
  32657. var replacedPatterns = {};
  32658. var datePatterns = [{
  32659. date: new Date(2009, 8, 8, 6, 5, 4, 100),
  32660. pattern: "S"
  32661. }, {
  32662. date: new Date(2009, 8, 8, 6, 5, 2),
  32663. pattern: "s"
  32664. }, {
  32665. date: new Date(2009, 8, 8, 6, 2, 4),
  32666. pattern: "m"
  32667. }, {
  32668. date: new Date(2009, 8, 8, 18, 5, 4),
  32669. pattern: "H",
  32670. isDigit: true
  32671. }, {
  32672. date: new Date(2009, 8, 8, 2, 5, 4),
  32673. pattern: "h",
  32674. isDigit: true
  32675. }, {
  32676. date: new Date(2009, 8, 8, 18, 5, 4),
  32677. pattern: "a",
  32678. isDigit: false
  32679. }, {
  32680. date: new Date(2009, 8, 1, 6, 5, 4),
  32681. pattern: "d"
  32682. }, {
  32683. date: [new Date(2009, 8, 2, 6, 5, 4), new Date(2009, 8, 3, 6, 5, 4), new Date(2009, 8, 4, 6, 5, 4)],
  32684. pattern: "E"
  32685. }, {
  32686. date: new Date(2009, 9, 6, 6, 5, 4),
  32687. pattern: "M"
  32688. }, {
  32689. date: new Date(1998, 8, 8, 6, 5, 4),
  32690. pattern: "y"
  32691. }];
  32692. if (!result) {
  32693. return
  32694. }
  32695. datePatterns.forEach(function(test) {
  32696. var diff = getDifference(defaultPattern, formatValue(test.date, formatter), processedIndexes, test.isDigit);
  32697. var pattern = "M" === test.pattern && !replacedPatterns.d ? "L" : test.pattern;
  32698. result = replaceChars(result, diff, pattern, patternPositions);
  32699. replacedPatterns[pattern] = diff.length
  32700. });
  32701. result = escapeChars(result, defaultPattern, processedIndexes, patternPositions);
  32702. if (processedIndexes.length) {
  32703. return result
  32704. }
  32705. };
  32706. exports.getFormat = getFormat
  32707. },
  32708. /*!************************************************!*\
  32709. !*** ./artifacts/transpiled/core/utils/svg.js ***!
  32710. \************************************************/
  32711. /*! dynamic exports provided */
  32712. /*! all exports used */
  32713. function(module, exports, __webpack_require__) {
  32714. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  32715. var window = __webpack_require__( /*! ./window */ 7).getWindow();
  32716. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  32717. function getMarkup(element, backgroundColor) {
  32718. var temp = domAdapter.createElement("div");
  32719. var clone = element.cloneNode(true);
  32720. if (backgroundColor) {
  32721. $(clone).css("backgroundColor", backgroundColor)
  32722. }
  32723. temp.appendChild(clone);
  32724. return temp.innerHTML
  32725. }
  32726. function fixNamespaces(markup) {
  32727. var first = true;
  32728. if (markup.indexOf("xmlns:xlink") === -1) {
  32729. markup = markup.replace("<svg", '<svg xmlns:xlink="http://www.w3.org/1999/xlink"')
  32730. }
  32731. markup = markup.replace(/xmlns="[\s\S]*?"/gi, function(match) {
  32732. if (!first) {
  32733. return ""
  32734. }
  32735. first = false;
  32736. return match
  32737. });
  32738. return markup.replace(/xmlns:NS1="[\s\S]*?"/gi, "").replace(/NS1:xmlns:xlink="([\s\S]*?)"/gi, 'xmlns:xlink="$1"')
  32739. }
  32740. function decodeHtmlEntities(markup) {
  32741. return markup.replace(/&quot;/gi, "&#34;").replace(/&amp;/gi, "&#38;").replace(/&apos;/gi, "&#39;").replace(/&lt;/gi, "&#60;").replace(/&gt;/gi, "&#62;").replace(/&nbsp;/gi, "&#160;").replace(/&shy;/gi, "&#173;")
  32742. }
  32743. exports.getSvgMarkup = function(element, backgroundColor) {
  32744. return fixNamespaces(decodeHtmlEntities(getMarkup(element, backgroundColor)))
  32745. };
  32746. exports.getSvgElement = function(markup) {
  32747. return domAdapter.isNode(markup) ? markup : (new window.DOMParser).parseFromString(markup, "image/svg+xml").childNodes[0]
  32748. }
  32749. },
  32750. /*!********************************************************************!*\
  32751. !*** ./artifacts/transpiled/ui/widget/template_engine_registry.js ***!
  32752. \********************************************************************/
  32753. /*! dynamic exports provided */
  32754. /*! all exports used */
  32755. function(module, exports, __webpack_require__) {
  32756. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  32757. var _errors = __webpack_require__( /*! ../../core/errors */ 21);
  32758. var _errors2 = _interopRequireDefault(_errors);
  32759. function _interopRequireDefault(obj) {
  32760. return obj && obj.__esModule ? obj : {
  32761. "default": obj
  32762. }
  32763. }
  32764. var templateEngines = {};
  32765. var currentTemplateEngine;
  32766. var registerTemplateEngine = function(name, templateEngine) {
  32767. templateEngines[name] = templateEngine
  32768. };
  32769. var setTemplateEngine = function(templateEngine) {
  32770. if ((0, _type.isString)(templateEngine)) {
  32771. currentTemplateEngine = templateEngines[templateEngine];
  32772. if (!currentTemplateEngine) {
  32773. throw _errors2.default.Error("E0020", templateEngine)
  32774. }
  32775. } else {
  32776. currentTemplateEngine = templateEngine
  32777. }
  32778. };
  32779. var getCurrentTemplateEngine = function() {
  32780. return currentTemplateEngine
  32781. };
  32782. module.exports.setTemplateEngine = setTemplateEngine;
  32783. module.exports.getCurrentTemplateEngine = getCurrentTemplateEngine;
  32784. module.exports.registerTemplateEngine = registerTemplateEngine
  32785. },
  32786. /*!***************************************************************!*\
  32787. !*** ./artifacts/transpiled/localization/ldml/date.parser.js ***!
  32788. \***************************************************************/
  32789. /*! dynamic exports provided */
  32790. /*! all exports used */
  32791. function(module, exports, __webpack_require__) {
  32792. var escapeRegExp = __webpack_require__( /*! ../../core/utils/common */ 4).escapeRegExp;
  32793. var FORMAT_TYPES = {
  32794. 3: "abbreviated",
  32795. 4: "wide",
  32796. 5: "narrow"
  32797. };
  32798. var monthRegExpGenerator = function(count, dateParts) {
  32799. if (count > 2) {
  32800. return Object.keys(FORMAT_TYPES).map(function(count) {
  32801. return ["format", "standalone"].map(function(type) {
  32802. return dateParts.getMonthNames(FORMAT_TYPES[count], type).join("|")
  32803. }).join("|")
  32804. }).join("|")
  32805. }
  32806. return "0?[1-9]|1[012]"
  32807. };
  32808. var PATTERN_REGEXPS = {
  32809. y: function(count) {
  32810. return "[0-9]+"
  32811. },
  32812. M: monthRegExpGenerator,
  32813. L: monthRegExpGenerator,
  32814. Q: function(count, dateParts) {
  32815. if (count > 2) {
  32816. return dateParts.getQuarterNames(FORMAT_TYPES[count], "format").join("|")
  32817. }
  32818. return "0?[1-4]"
  32819. },
  32820. E: function(count, dateParts) {
  32821. return "\\D*"
  32822. },
  32823. a: function(count, dateParts) {
  32824. return dateParts.getPeriodNames(FORMAT_TYPES[count < 3 ? 3 : count], "format").join("|")
  32825. },
  32826. d: function(count) {
  32827. return "0?[1-9]|[12][0-9]|3[01]"
  32828. },
  32829. H: function(count) {
  32830. return "0?[0-9]|1[0-9]|2[0-3]"
  32831. },
  32832. h: function(count) {
  32833. return "0?[1-9]|1[012]"
  32834. },
  32835. m: function(count) {
  32836. return "0?[0-9]|[1-5][0-9]"
  32837. },
  32838. s: function(count) {
  32839. return "0?[0-9]|[1-5][0-9]"
  32840. },
  32841. S: function(count) {
  32842. return "[0-9]{1," + count + "}"
  32843. }
  32844. };
  32845. var parseNumber = Number;
  32846. var caseInsensitiveIndexOf = function(array, value) {
  32847. return array.map(function(item) {
  32848. return item.toLowerCase()
  32849. }).indexOf(value.toLowerCase())
  32850. };
  32851. var monthPatternParser = function(text, count, dateParts) {
  32852. if (count > 2) {
  32853. return ["format", "standalone"].map(function(type) {
  32854. return Object.keys(FORMAT_TYPES).map(function(count) {
  32855. var monthNames = dateParts.getMonthNames(FORMAT_TYPES[count], type);
  32856. return caseInsensitiveIndexOf(monthNames, text)
  32857. })
  32858. }).reduce(function(a, b) {
  32859. return a.concat(b)
  32860. }).filter(function(index) {
  32861. return index >= 0
  32862. })[0]
  32863. }
  32864. return parseNumber(text) - 1
  32865. };
  32866. var PATTERN_PARSERS = {
  32867. y: function(text, count) {
  32868. var year = parseNumber(text);
  32869. if (2 === count) {
  32870. return year < 30 ? 2e3 + year : 1900 + year
  32871. }
  32872. return year
  32873. },
  32874. M: monthPatternParser,
  32875. L: monthPatternParser,
  32876. Q: function(text, count, dateParts) {
  32877. if (count > 2) {
  32878. return dateParts.getQuarterNames(FORMAT_TYPES[count], "format").indexOf(text)
  32879. }
  32880. return parseNumber(text) - 1
  32881. },
  32882. E: function(text, count, dateParts) {
  32883. var dayNames = dateParts.getDayNames(FORMAT_TYPES[count < 3 ? 3 : count], "format");
  32884. return caseInsensitiveIndexOf(dayNames, text)
  32885. },
  32886. a: function(text, count, dateParts) {
  32887. var periodNames = dateParts.getPeriodNames(FORMAT_TYPES[count < 3 ? 3 : count], "format");
  32888. return caseInsensitiveIndexOf(periodNames, text)
  32889. },
  32890. d: parseNumber,
  32891. H: parseNumber,
  32892. h: parseNumber,
  32893. m: parseNumber,
  32894. s: parseNumber,
  32895. S: function(text, count) {
  32896. count = Math.max(count, 3);
  32897. text = text.slice(0, 3);
  32898. while (count < 3) {
  32899. text += "0";
  32900. count++
  32901. }
  32902. return parseNumber(text)
  32903. }
  32904. };
  32905. var ORDERED_PATTERNS = ["y", "M", "d", "h", "m", "s", "S"];
  32906. var PATTERN_SETTERS = {
  32907. y: "setFullYear",
  32908. M: "setMonth",
  32909. L: "setMonth",
  32910. a: function(date, value, datePartValues) {
  32911. var hours = date.getHours();
  32912. var hourPartValue = datePartValues.h;
  32913. if (void 0 !== hourPartValue && hourPartValue !== hours) {
  32914. hours--
  32915. }
  32916. if (!value && 12 === hours) {
  32917. hours = 0
  32918. } else {
  32919. if (value && 12 !== hours) {
  32920. hours += 12
  32921. }
  32922. }
  32923. date.setHours(hours)
  32924. },
  32925. d: "setDate",
  32926. H: "setHours",
  32927. h: "setHours",
  32928. m: "setMinutes",
  32929. s: "setSeconds",
  32930. S: "setMilliseconds"
  32931. };
  32932. var getSameCharCount = function(text, index) {
  32933. var char = text[index];
  32934. var count = 0;
  32935. do {
  32936. index++;
  32937. count++
  32938. } while (text[index] === char);
  32939. return count
  32940. };
  32941. var createPattern = function(char, count) {
  32942. var result = "";
  32943. for (var i = 0; i < count; i++) {
  32944. result += char
  32945. }
  32946. return result
  32947. };
  32948. var getRegExpInfo = function(format, dateParts) {
  32949. var regexpText = "";
  32950. var stubText = "";
  32951. var isEscaping;
  32952. var patterns = [];
  32953. var addPreviousStub = function() {
  32954. if (stubText) {
  32955. patterns.push("'" + stubText + "'");
  32956. regexpText += escapeRegExp(stubText) + ")";
  32957. stubText = ""
  32958. }
  32959. };
  32960. for (var i = 0; i < format.length; i++) {
  32961. var char = format[i];
  32962. var isEscapeChar = "'" === char;
  32963. var regexpPart = PATTERN_REGEXPS[char];
  32964. if (isEscapeChar) {
  32965. isEscaping = !isEscaping;
  32966. if ("'" !== format[i - 1]) {
  32967. continue
  32968. }
  32969. }
  32970. if (regexpPart && !isEscaping) {
  32971. var count = getSameCharCount(format, i);
  32972. var pattern = createPattern(char, count);
  32973. addPreviousStub();
  32974. patterns.push(pattern);
  32975. regexpText += "(" + regexpPart(count, dateParts) + ")";
  32976. i += count - 1
  32977. } else {
  32978. if (!stubText) {
  32979. regexpText += "("
  32980. }
  32981. stubText += char
  32982. }
  32983. }
  32984. addPreviousStub();
  32985. return {
  32986. patterns: patterns,
  32987. regexp: new RegExp("^" + regexpText + "$", "i")
  32988. }
  32989. };
  32990. var getPatternSetters = function() {
  32991. return PATTERN_SETTERS
  32992. };
  32993. var setPatternPart = function(date, pattern, text, dateParts, datePartValues) {
  32994. var patternChar = pattern[0];
  32995. var partSetter = PATTERN_SETTERS[patternChar];
  32996. var partParser = PATTERN_PARSERS[patternChar];
  32997. if (partSetter && partParser) {
  32998. var value = partParser(text, pattern.length, dateParts);
  32999. datePartValues[pattern] = value;
  33000. if (date[partSetter]) {
  33001. date[partSetter](value)
  33002. } else {
  33003. partSetter(date, value, datePartValues)
  33004. }
  33005. }
  33006. };
  33007. var setPatternPartFromNow = function(date, pattern, now) {
  33008. var setterName = PATTERN_SETTERS[pattern];
  33009. var getterName = "g" + setterName.substr(1);
  33010. var value = now[getterName]();
  33011. date[setterName](value)
  33012. };
  33013. var getShortPatterns = function(fullPatterns) {
  33014. return fullPatterns.map(function(pattern) {
  33015. if ("'" === pattern[0]) {
  33016. return ""
  33017. } else {
  33018. return "H" === pattern[0] ? "h" : pattern[0]
  33019. }
  33020. })
  33021. };
  33022. var getMaxOrderedPatternIndex = function(patterns) {
  33023. var indexes = patterns.map(function(pattern) {
  33024. return ORDERED_PATTERNS.indexOf(pattern)
  33025. });
  33026. return Math.max.apply(Math, indexes)
  33027. };
  33028. var getOrderedFormatPatterns = function(formatPatterns) {
  33029. var otherPatterns = formatPatterns.filter(function(pattern) {
  33030. return ORDERED_PATTERNS.indexOf(pattern) < 0
  33031. });
  33032. return ORDERED_PATTERNS.concat(otherPatterns)
  33033. };
  33034. var getParser = function(format, dateParts) {
  33035. var regExpInfo = getRegExpInfo(format, dateParts);
  33036. return function(text) {
  33037. var regExpResult = regExpInfo.regexp.exec(text);
  33038. if (regExpResult) {
  33039. var now = new Date;
  33040. var date = new Date(now.getFullYear(), 0, 1);
  33041. var formatPatterns = getShortPatterns(regExpInfo.patterns);
  33042. var maxPatternIndex = getMaxOrderedPatternIndex(formatPatterns);
  33043. var orderedFormatPatterns = getOrderedFormatPatterns(formatPatterns);
  33044. var datePartValues = {};
  33045. orderedFormatPatterns.forEach(function(pattern, index) {
  33046. if (!pattern || index < ORDERED_PATTERNS.length && index > maxPatternIndex) {
  33047. return
  33048. }
  33049. var patternIndex = formatPatterns.indexOf(pattern);
  33050. if (patternIndex >= 0) {
  33051. var regExpPattern = regExpInfo.patterns[patternIndex];
  33052. var regExpText = regExpResult[patternIndex + 1];
  33053. setPatternPart(date, regExpPattern, regExpText, dateParts, datePartValues)
  33054. } else {
  33055. setPatternPartFromNow(date, pattern, now)
  33056. }
  33057. });
  33058. return date
  33059. }
  33060. return null
  33061. }
  33062. };
  33063. exports.getParser = getParser;
  33064. exports.getRegExpInfo = getRegExpInfo;
  33065. exports.getPatternSetters = getPatternSetters
  33066. },
  33067. /*!************************************************************!*\
  33068. !*** ./artifacts/transpiled/bundles/modules/parts/core.js ***!
  33069. \************************************************************/
  33070. /*! dynamic exports provided */
  33071. /*! all exports used */
  33072. function(module, exports, __webpack_require__) {
  33073. var DevExpress = __webpack_require__( /*! ../../../bundles/modules/core */ 147);
  33074. __webpack_require__( /*! ../../../integration/jquery */ 268);
  33075. __webpack_require__( /*! ../../../integration/angular */ 460);
  33076. __webpack_require__( /*! ../../../integration/knockout */ 475);
  33077. __webpack_require__( /*! ../../../localization/globalize/core */ 127);
  33078. __webpack_require__( /*! ../../../localization/globalize/message */ 484);
  33079. __webpack_require__( /*! ../../../localization/globalize/number */ 183);
  33080. __webpack_require__( /*! ../../../localization/globalize/date */ 485);
  33081. __webpack_require__( /*! ../../../localization/globalize/currency */ 486);
  33082. __webpack_require__( /*! ../../../events/click */ 19);
  33083. __webpack_require__( /*! ../../../events/contextmenu */ 168);
  33084. __webpack_require__( /*! ../../../events/double_click */ 128);
  33085. __webpack_require__( /*! ../../../events/drag */ 56);
  33086. __webpack_require__( /*! ../../../events/hold */ 88);
  33087. __webpack_require__( /*! ../../../events/hover */ 148);
  33088. __webpack_require__( /*! ../../../events/pointer */ 23);
  33089. __webpack_require__( /*! ../../../events/swipe */ 174);
  33090. __webpack_require__( /*! ../../../events/transform */ 285);
  33091. module.exports = DevExpress
  33092. },
  33093. /*!*********************************************************!*\
  33094. !*** ./artifacts/transpiled/mobile/hide_top_overlay.js ***!
  33095. \*********************************************************/
  33096. /*! dynamic exports provided */
  33097. /*! all exports used */
  33098. function(module, exports, __webpack_require__) {
  33099. var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
  33100. var hideCallback = function() {
  33101. var callbacks = [];
  33102. return {
  33103. add: function(callback) {
  33104. var indexOfCallback = inArray(callback, callbacks);
  33105. if (indexOfCallback === -1) {
  33106. callbacks.push(callback)
  33107. }
  33108. },
  33109. remove: function(callback) {
  33110. var indexOfCallback = inArray(callback, callbacks);
  33111. if (indexOfCallback !== -1) {
  33112. callbacks.splice(indexOfCallback, 1)
  33113. }
  33114. },
  33115. fire: function() {
  33116. var callback = callbacks.pop();
  33117. var result = !!callback;
  33118. if (result) {
  33119. callback()
  33120. }
  33121. return result
  33122. },
  33123. hasCallback: function() {
  33124. return callbacks.length > 0
  33125. },
  33126. reset: function() {
  33127. callbacks = []
  33128. }
  33129. }
  33130. }();
  33131. module.exports = function() {
  33132. return hideCallback.fire()
  33133. };
  33134. module.exports.hideCallback = hideCallback
  33135. }, , , , , , , , , , , , , , , , , , , , , , , , , ,
  33136. /*!********************************************!*\
  33137. !*** ./artifacts/transpiled/viz/export.js ***!
  33138. \********************************************/
  33139. /*! dynamic exports provided */
  33140. /*! all exports used */
  33141. function(module, exports, __webpack_require__) {
  33142. module.exports = __webpack_require__( /*! ./core/export */ 93)
  33143. },
  33144. /*!*****************************************************************!*\
  33145. !*** ./artifacts/transpiled/viz/chart_components/base_chart.js ***!
  33146. \*****************************************************************/
  33147. /*! dynamic exports provided */
  33148. /*! all exports used */
  33149. function(module, exports, __webpack_require__) {
  33150. var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
  33151. var noop = commonUtils.noop;
  33152. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  33153. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  33154. var iteratorModule = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  33155. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  33156. var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  33157. var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
  33158. var BaseWidget = __webpack_require__( /*! ../core/base_widget */ 96);
  33159. var coreDataUtils = __webpack_require__( /*! ../../core/utils/data */ 20);
  33160. var legendModule = __webpack_require__( /*! ../components/legend */ 201);
  33161. var dataValidatorModule = __webpack_require__( /*! ../components/data_validator */ 243);
  33162. var seriesModule = __webpack_require__( /*! ../series/base_series */ 245);
  33163. var chartThemeManagerModule = __webpack_require__( /*! ../components/chart_theme_manager */ 401);
  33164. var LayoutManagerModule = __webpack_require__( /*! ./layout_manager */ 402);
  33165. var trackerModule = __webpack_require__( /*! ./tracker */ 777);
  33166. var REINIT_REFRESH_ACTION = "_reinit";
  33167. var REINIT_DATA_SOURCE_REFRESH_ACTION = "_updateDataSource";
  33168. var DATA_INIT_REFRESH_ACTION = "_dataInit";
  33169. var FORCE_RENDER_REFRESH_ACTION = "_forceRender";
  33170. var RESIZE_REFRESH_ACTION = "_resize";
  33171. var ACTIONS_BY_PRIORITY = [REINIT_REFRESH_ACTION, REINIT_DATA_SOURCE_REFRESH_ACTION, DATA_INIT_REFRESH_ACTION, FORCE_RENDER_REFRESH_ACTION, RESIZE_REFRESH_ACTION];
  33172. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  33173. var _map = vizUtils.map;
  33174. var _each = iteratorModule.each;
  33175. var _reverseEach = iteratorModule.reverseEach;
  33176. var _extend = extend;
  33177. var _isArray = Array.isArray;
  33178. var _isDefined = typeUtils.isDefined;
  33179. var _setCanvasValues = vizUtils.setCanvasValues;
  33180. var DEFAULT_OPACITY = .3;
  33181. var REFRESH_SERIES_DATA_INIT_ACTION_OPTIONS = ["series", "commonSeriesSettings", "dataPrepareSettings", "seriesSelectionMode", "pointSelectionMode", "synchronizeMultiAxes", "resolveLabelsOverlapping"];
  33182. var REFRESH_SERIES_FAMILIES_ACTION_OPTIONS = ["equalBarWidth", "minBubbleSize", "maxBubbleSize", "barWidth", "barGroupPadding", "barGroupWidth", "negativesAsZeroes", "negativesAsZeros"];
  33183. var FORCE_RENDER_REFRESH_ACTION_OPTIONS = ["adaptiveLayout", "crosshair", "resolveLabelOverlapping", "adjustOnZoom", "zoomingMode", "scrollingMode", "stickyHovering"];
  33184. var FONT = "font";
  33185. function checkHeightRollingStock(rollingStocks, stubCanvas) {
  33186. var canvasSize = stubCanvas.end - stubCanvas.start;
  33187. var size = 0;
  33188. rollingStocks.forEach(function(rollingStock) {
  33189. size += rollingStock.getBoundingRect().width
  33190. });
  33191. while (canvasSize < size) {
  33192. size -= findAndKillSmallValue(rollingStocks)
  33193. }
  33194. }
  33195. function findAndKillSmallValue(rollingStocks) {
  33196. var smallestObject = rollingStocks.reduce(function(prev, rollingStock, index) {
  33197. if (!rollingStock) {
  33198. return prev
  33199. }
  33200. var value = rollingStock.value();
  33201. return value < prev.value ? {
  33202. value: value,
  33203. rollingStock: rollingStock,
  33204. index: index
  33205. } : prev
  33206. }, {
  33207. rollingStock: void 0,
  33208. value: 1 / 0,
  33209. index: void 0
  33210. });
  33211. smallestObject.rollingStock.getLabels()[0].draw(false);
  33212. var width = smallestObject.rollingStock.getBoundingRect().width;
  33213. rollingStocks[smallestObject.index] = null;
  33214. return width
  33215. }
  33216. function checkStackOverlap(rollingStocks) {
  33217. var i;
  33218. var j;
  33219. var iLength;
  33220. var jLength;
  33221. var overlap = false;
  33222. for (i = 0, iLength = rollingStocks.length - 1; i < iLength; i++) {
  33223. for (j = i + 1, jLength = rollingStocks.length; j < jLength; j++) {
  33224. if (i !== j && checkStacksOverlapping(rollingStocks[i], rollingStocks[j], true)) {
  33225. overlap = true;
  33226. break
  33227. }
  33228. }
  33229. if (overlap) {
  33230. break
  33231. }
  33232. }
  33233. return overlap
  33234. }
  33235. function resolveLabelOverlappingInOneDirection(points, canvas, isRotated, shiftFunction) {
  33236. var customSorting = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : function() {
  33237. return 0
  33238. };
  33239. var rollingStocks = [];
  33240. var stubCanvas = {
  33241. start: isRotated ? canvas.left : canvas.top,
  33242. end: isRotated ? canvas.width - canvas.right : canvas.height - canvas.bottom
  33243. };
  33244. var hasStackedSeries = false;
  33245. points.forEach(function(p) {
  33246. if (!p) {
  33247. return
  33248. }
  33249. hasStackedSeries = hasStackedSeries || p.series.isStackedSeries() || p.series.isFullStackedSeries();
  33250. p.getLabels().forEach(function(l) {
  33251. l.isVisible() && rollingStocks.push(new RollingStock(l, isRotated, shiftFunction))
  33252. })
  33253. });
  33254. if (hasStackedSeries) {
  33255. !isRotated && rollingStocks.reverse()
  33256. } else {
  33257. var rollingStocksTmp = rollingStocks.slice();
  33258. rollingStocks.sort(function(a, b) {
  33259. return customSorting(a, b) || a.getInitialPosition() - b.getInitialPosition() || rollingStocksTmp.indexOf(a) - rollingStocksTmp.indexOf(b)
  33260. })
  33261. }
  33262. if (!checkStackOverlap(rollingStocks)) {
  33263. return false
  33264. }
  33265. checkHeightRollingStock(rollingStocks, stubCanvas);
  33266. prepareOverlapStacks(rollingStocks);
  33267. rollingStocks.reverse();
  33268. moveRollingStock(rollingStocks, stubCanvas);
  33269. return true
  33270. }
  33271. function checkStacksOverlapping(firstRolling, secondRolling, inTwoSides) {
  33272. if (!firstRolling || !secondRolling) {
  33273. return
  33274. }
  33275. var firstRect = firstRolling.getBoundingRect();
  33276. var secondRect = secondRolling.getBoundingRect();
  33277. var oppositeOverlapping = inTwoSides ? firstRect.oppositeStart <= secondRect.oppositeStart && firstRect.oppositeEnd > secondRect.oppositeStart || secondRect.oppositeStart <= firstRect.oppositeStart && secondRect.oppositeEnd > firstRect.oppositeStart : true;
  33278. return firstRect.end > secondRect.start && oppositeOverlapping
  33279. }
  33280. function prepareOverlapStacks(rollingStocks) {
  33281. var i;
  33282. var currentRollingStock;
  33283. var root;
  33284. for (i = 0; i < rollingStocks.length - 1; i++) {
  33285. currentRollingStock = root || rollingStocks[i];
  33286. if (checkStacksOverlapping(currentRollingStock, rollingStocks[i + 1])) {
  33287. currentRollingStock.toChain(rollingStocks[i + 1]);
  33288. rollingStocks[i + 1] = null;
  33289. root = currentRollingStock
  33290. } else {
  33291. root = rollingStocks[i + 1] || currentRollingStock
  33292. }
  33293. }
  33294. }
  33295. function moveRollingStock(rollingStocks, canvas) {
  33296. var i;
  33297. var j;
  33298. var currentRollingStock;
  33299. var nextRollingStock;
  33300. var currentBBox;
  33301. var nextBBox;
  33302. for (i = 0; i < rollingStocks.length; i++) {
  33303. currentRollingStock = rollingStocks[i];
  33304. if (rollingStocksIsOut(currentRollingStock, canvas)) {
  33305. currentBBox = currentRollingStock.getBoundingRect();
  33306. for (j = i + 1; j < rollingStocks.length; j++) {
  33307. nextRollingStock = rollingStocks[j];
  33308. if (!nextRollingStock) {
  33309. continue
  33310. }
  33311. nextBBox = nextRollingStock.getBoundingRect();
  33312. if (nextBBox.end > currentBBox.start - (currentBBox.end - canvas.end)) {
  33313. nextRollingStock.toChain(currentRollingStock);
  33314. rollingStocks[i] = currentRollingStock = null;
  33315. break
  33316. }
  33317. }
  33318. }
  33319. currentRollingStock && currentRollingStock.setRollingStockInCanvas(canvas)
  33320. }
  33321. }
  33322. function rollingStocksIsOut(rollingStock, canvas) {
  33323. return rollingStock && rollingStock.getBoundingRect().end > canvas.end
  33324. }
  33325. function RollingStock(label, isRotated, shiftFunction) {
  33326. var bBox = label.getBoundingRect();
  33327. var x = bBox.x;
  33328. var y = bBox.y;
  33329. var endX = bBox.x + bBox.width;
  33330. var endY = bBox.y + bBox.height;
  33331. this.labels = [label];
  33332. this.shiftFunction = shiftFunction;
  33333. this._bBox = {
  33334. start: isRotated ? x : y,
  33335. width: isRotated ? bBox.width : bBox.height,
  33336. end: isRotated ? endX : endY,
  33337. oppositeStart: isRotated ? y : x,
  33338. oppositeEnd: isRotated ? endY : endX
  33339. };
  33340. this._initialPosition = isRotated ? bBox.x : bBox.y;
  33341. return this
  33342. }
  33343. RollingStock.prototype = {
  33344. toChain: function(nextRollingStock) {
  33345. var nextRollingStockBBox = nextRollingStock.getBoundingRect();
  33346. nextRollingStock.shift(nextRollingStockBBox.start - this._bBox.end);
  33347. this._changeBoxWidth(nextRollingStockBBox.width);
  33348. this.labels = this.labels.concat(nextRollingStock.labels)
  33349. },
  33350. getBoundingRect: function() {
  33351. return this._bBox
  33352. },
  33353. shift: function(shiftLength) {
  33354. var shiftFunction = this.shiftFunction;
  33355. _each(this.labels, function(index, label) {
  33356. var bBox = label.getBoundingRect();
  33357. var coords = shiftFunction(bBox, shiftLength);
  33358. if (!label.hideInsideLabel(coords)) {
  33359. label.shift(coords.x, coords.y)
  33360. }
  33361. });
  33362. this._bBox.end -= shiftLength;
  33363. this._bBox.start -= shiftLength
  33364. },
  33365. setRollingStockInCanvas: function(canvas) {
  33366. if (this._bBox.end > canvas.end) {
  33367. this.shift(this._bBox.end - canvas.end)
  33368. }
  33369. },
  33370. getLabels: function() {
  33371. return this.labels
  33372. },
  33373. value: function() {
  33374. return this.labels[0].getData().value
  33375. },
  33376. getInitialPosition: function() {
  33377. return this._initialPosition
  33378. },
  33379. _changeBoxWidth: function(width) {
  33380. this._bBox.end += width;
  33381. this._bBox.width += width
  33382. }
  33383. };
  33384. function getLegendFields(name) {
  33385. return {
  33386. nameField: name + "Name",
  33387. colorField: name + "Color",
  33388. indexField: name + "Index"
  33389. }
  33390. }
  33391. function getLegendSettings(legendDataField) {
  33392. var formatObjectFields = getLegendFields(legendDataField);
  33393. return {
  33394. getFormatObject: function(data) {
  33395. var res = {};
  33396. res[formatObjectFields.indexField] = data.id;
  33397. res[formatObjectFields.colorField] = data.states.normal.fill;
  33398. res[formatObjectFields.nameField] = data.text;
  33399. return res
  33400. },
  33401. textField: formatObjectFields.nameField
  33402. }
  33403. }
  33404. function checkOverlapping(firstRect, secondRect) {
  33405. return (firstRect.x <= secondRect.x && secondRect.x <= firstRect.x + firstRect.width || firstRect.x >= secondRect.x && firstRect.x <= secondRect.x + secondRect.width) && (firstRect.y <= secondRect.y && secondRect.y <= firstRect.y + firstRect.height || firstRect.y >= secondRect.y && firstRect.y <= secondRect.y + secondRect.height)
  33406. }
  33407. var overlapping = {
  33408. resolveLabelOverlappingInOneDirection: resolveLabelOverlappingInOneDirection
  33409. };
  33410. var BaseChart = BaseWidget.inherit({
  33411. _eventsMap: {
  33412. onSeriesClick: {
  33413. name: "seriesClick"
  33414. },
  33415. onPointClick: {
  33416. name: "pointClick"
  33417. },
  33418. onArgumentAxisClick: {
  33419. name: "argumentAxisClick"
  33420. },
  33421. onLegendClick: {
  33422. name: "legendClick"
  33423. },
  33424. onSeriesSelectionChanged: {
  33425. name: "seriesSelectionChanged"
  33426. },
  33427. onPointSelectionChanged: {
  33428. name: "pointSelectionChanged"
  33429. },
  33430. onSeriesHoverChanged: {
  33431. name: "seriesHoverChanged"
  33432. },
  33433. onPointHoverChanged: {
  33434. name: "pointHoverChanged"
  33435. },
  33436. onDone: {
  33437. name: "done"
  33438. },
  33439. onZoomStart: {
  33440. name: "zoomStart"
  33441. },
  33442. onZoomEnd: {
  33443. name: "zoomEnd"
  33444. }
  33445. },
  33446. _fontFields: ["legend." + FONT, "legend.title." + FONT, "legend.title.subtitle." + FONT, "commonSeriesSettings.label." + FONT],
  33447. _rootClassPrefix: "dxc",
  33448. _rootClass: "dxc-chart",
  33449. _initialChanges: ["INIT"],
  33450. _themeDependentChanges: ["REFRESH_SERIES_REINIT"],
  33451. _getThemeManagerOptions: function() {
  33452. var themeOptions = this.callBase.apply(this, arguments);
  33453. themeOptions.options = this.option();
  33454. return themeOptions
  33455. },
  33456. _createThemeManager: function() {
  33457. var chartOption = this.option();
  33458. var themeManager = new chartThemeManagerModule.ThemeManager(this._getThemeManagerOptions());
  33459. themeManager.setTheme(chartOption.theme, chartOption.rtlEnabled);
  33460. return themeManager
  33461. },
  33462. _initCore: function() {
  33463. var that = this;
  33464. that._canvasClipRect = that._renderer.clipRect();
  33465. that._createHtmlStructure();
  33466. that._createLegend();
  33467. that._createTracker();
  33468. that._needHandleRenderComplete = true;
  33469. that.layoutManager = new LayoutManagerModule.LayoutManager;
  33470. that._createScrollBar();
  33471. eventsEngine.on(that._$element, "contextmenu", function(event) {
  33472. that.eventType = "contextmenu";
  33473. if (eventUtils.isTouchEvent(event) || eventUtils.isPointerEvent(event)) {
  33474. event.preventDefault()
  33475. }
  33476. });
  33477. eventsEngine.on(that._$element, "MSHoldVisual", function(event) {
  33478. that.eventType = "MSHoldVisual";
  33479. event.preventDefault()
  33480. })
  33481. },
  33482. _getLayoutItems: noop,
  33483. _layoutManagerOptions: function() {
  33484. return this._themeManager.getOptions("adaptiveLayout")
  33485. },
  33486. _reinit: function() {
  33487. var that = this;
  33488. _setCanvasValues(that._canvas);
  33489. that._reinitAxes();
  33490. that._requestChange(["DATA_SOURCE", "DATA_INIT", "CORRECT_AXIS", "FULL_RENDER"])
  33491. },
  33492. _correctAxes: noop,
  33493. _createHtmlStructure: function() {
  33494. var that = this;
  33495. var renderer = that._renderer;
  33496. var root = renderer.root;
  33497. var createConstantLinesGroup = function() {
  33498. return renderer.g().attr({
  33499. "class": "dxc-constant-lines-group"
  33500. }).linkOn(root, "constant-lines")
  33501. };
  33502. that._constantLinesGroup = {
  33503. dispose: function() {
  33504. this.under.dispose();
  33505. this.above.dispose()
  33506. },
  33507. linkOff: function() {
  33508. this.under.linkOff();
  33509. this.above.linkOff()
  33510. },
  33511. clear: function() {
  33512. this.under.linkRemove().clear();
  33513. this.above.linkRemove().clear()
  33514. },
  33515. linkAppend: function() {
  33516. this.under.linkAppend();
  33517. this.above.linkAppend()
  33518. }
  33519. };
  33520. that._backgroundRect = renderer.rect().attr({
  33521. fill: "gray",
  33522. opacity: 1e-4
  33523. }).append(root);
  33524. that._panesBackgroundGroup = renderer.g().attr({
  33525. "class": "dxc-background"
  33526. }).append(root);
  33527. that._stripsGroup = renderer.g().attr({
  33528. "class": "dxc-strips-group"
  33529. }).linkOn(root, "strips");
  33530. that._gridGroup = renderer.g().attr({
  33531. "class": "dxc-grids-group"
  33532. }).linkOn(root, "grids");
  33533. that._panesBorderGroup = renderer.g().attr({
  33534. "class": "dxc-border"
  33535. }).linkOn(root, "border");
  33536. that._axesGroup = renderer.g().attr({
  33537. "class": "dxc-axes-group"
  33538. }).linkOn(root, "axes");
  33539. that._labelAxesGroup = renderer.g().attr({
  33540. "class": "dxc-strips-labels-group"
  33541. }).linkOn(root, "strips-labels");
  33542. that._constantLinesGroup.under = createConstantLinesGroup();
  33543. that._seriesGroup = renderer.g().attr({
  33544. "class": "dxc-series-group"
  33545. }).linkOn(root, "series");
  33546. that._constantLinesGroup.above = createConstantLinesGroup();
  33547. that._scaleBreaksGroup = renderer.g().attr({
  33548. "class": "dxc-scale-breaks"
  33549. }).linkOn(root, "scale-breaks");
  33550. that._labelsGroup = renderer.g().attr({
  33551. "class": "dxc-labels-group"
  33552. }).linkOn(root, "labels");
  33553. that._crosshairCursorGroup = renderer.g().attr({
  33554. "class": "dxc-crosshair-cursor"
  33555. }).linkOn(root, "crosshair");
  33556. that._legendGroup = renderer.g().attr({
  33557. "class": "dxc-legend",
  33558. "clip-path": that._getCanvasClipRectID()
  33559. }).linkOn(root, "legend").linkAppend(root).enableLinks();
  33560. that._scrollBarGroup = renderer.g().attr({
  33561. "class": "dxc-scroll-bar"
  33562. }).linkOn(root, "scroll-bar")
  33563. },
  33564. _disposeObjectsInArray: function(propName, fieldNames) {
  33565. _each(this[propName] || [], function(_, item) {
  33566. if (fieldNames && item) {
  33567. _each(fieldNames, function(_, field) {
  33568. item[field] && item[field].dispose()
  33569. })
  33570. } else {
  33571. item && item.dispose()
  33572. }
  33573. });
  33574. this[propName] = null
  33575. },
  33576. _disposeCore: function() {
  33577. var that = this;
  33578. var disposeObject = function(propName) {
  33579. if (that[propName]) {
  33580. that[propName].dispose();
  33581. that[propName] = null
  33582. }
  33583. };
  33584. var unlinkGroup = function(name) {
  33585. that[name].linkOff()
  33586. };
  33587. var disposeObjectsInArray = this._disposeObjectsInArray;
  33588. that._renderer.stopAllAnimations();
  33589. disposeObjectsInArray.call(that, "series");
  33590. disposeObject("_tracker");
  33591. disposeObject("_crosshair");
  33592. that.layoutManager = that._userOptions = that._canvas = that._groupsData = null;
  33593. unlinkGroup("_stripsGroup");
  33594. unlinkGroup("_gridGroup");
  33595. unlinkGroup("_axesGroup");
  33596. unlinkGroup("_constantLinesGroup");
  33597. unlinkGroup("_labelAxesGroup");
  33598. unlinkGroup("_panesBorderGroup");
  33599. unlinkGroup("_seriesGroup");
  33600. unlinkGroup("_labelsGroup");
  33601. unlinkGroup("_crosshairCursorGroup");
  33602. unlinkGroup("_legendGroup");
  33603. unlinkGroup("_scrollBarGroup");
  33604. unlinkGroup("_scaleBreaksGroup");
  33605. disposeObject("_canvasClipRect");
  33606. disposeObject("_panesBackgroundGroup");
  33607. disposeObject("_backgroundRect");
  33608. disposeObject("_stripsGroup");
  33609. disposeObject("_gridGroup");
  33610. disposeObject("_axesGroup");
  33611. disposeObject("_constantLinesGroup");
  33612. disposeObject("_labelAxesGroup");
  33613. disposeObject("_panesBorderGroup");
  33614. disposeObject("_seriesGroup");
  33615. disposeObject("_labelsGroup");
  33616. disposeObject("_crosshairCursorGroup");
  33617. disposeObject("_legendGroup");
  33618. disposeObject("_scrollBarGroup");
  33619. disposeObject("_scaleBreaksGroup")
  33620. },
  33621. _getAnimationOptions: function() {
  33622. return this._themeManager.getOptions("animation")
  33623. },
  33624. _getDefaultSize: function() {
  33625. return {
  33626. width: 400,
  33627. height: 400
  33628. }
  33629. },
  33630. _getOption: function(name) {
  33631. return this._themeManager.getOptions(name)
  33632. },
  33633. _applySize: function(rect) {
  33634. this._rect = rect.slice();
  33635. if (!this._changes.has("FULL_RENDER")) {
  33636. this._processRefreshData(RESIZE_REFRESH_ACTION)
  33637. }
  33638. },
  33639. _resize: function() {
  33640. this._doRender(this.__renderOptions || {
  33641. animate: false,
  33642. isResize: true
  33643. })
  33644. },
  33645. _trackerType: "ChartTracker",
  33646. _createTracker: function() {
  33647. var that = this;
  33648. that._tracker = new trackerModule[that._trackerType]({
  33649. seriesGroup: that._seriesGroup,
  33650. renderer: that._renderer,
  33651. tooltip: that._tooltip,
  33652. legend: that._legend,
  33653. eventTrigger: that._eventTrigger
  33654. })
  33655. },
  33656. _getTrackerSettings: function() {
  33657. return this._getSelectionModes()
  33658. },
  33659. _getSelectionModes: function() {
  33660. var themeManager = this._themeManager;
  33661. return {
  33662. seriesSelectionMode: themeManager.getOptions("seriesSelectionMode"),
  33663. pointSelectionMode: themeManager.getOptions("pointSelectionMode")
  33664. }
  33665. },
  33666. _updateTracker: function(trackerCanvases) {
  33667. var that = this;
  33668. that._tracker.update(that._getTrackerSettings());
  33669. that._tracker.setCanvases({
  33670. left: 0,
  33671. right: that._canvas.width,
  33672. top: 0,
  33673. bottom: that._canvas.height
  33674. }, trackerCanvases)
  33675. },
  33676. _createCanvasFromRect: function(rect) {
  33677. var currentCanvas = this._canvas;
  33678. return _setCanvasValues({
  33679. left: rect[0],
  33680. top: rect[1],
  33681. right: currentCanvas.width - rect[2],
  33682. bottom: currentCanvas.height - rect[3],
  33683. width: currentCanvas.width,
  33684. height: currentCanvas.height
  33685. })
  33686. },
  33687. _doRender: function(_options) {
  33688. var that = this;
  33689. if (0 === that._canvas.width && 0 === that._canvas.height) {
  33690. return
  33691. }
  33692. that._resetIsReady();
  33693. var drawOptions = that._prepareDrawOptions(_options);
  33694. var recreateCanvas = drawOptions.recreateCanvas;
  33695. that.__originalCanvas = that._canvas;
  33696. that._canvas = extend({}, that._canvas);
  33697. if (recreateCanvas) {
  33698. that.__currentCanvas = that._canvas
  33699. } else {
  33700. that._canvas = that.__currentCanvas
  33701. }
  33702. that.DEBUG_canvas = _setCanvasValues(that._canvas);
  33703. recreateCanvas && that._updateCanvasClipRect(that._canvas);
  33704. this._canvas = this._createCanvasFromRect(this._rect);
  33705. that._renderer.stopAllAnimations(true);
  33706. that._cleanGroups();
  33707. var startTime = new Date;
  33708. that._renderElements(drawOptions);
  33709. that._lastRenderingTime = new Date - startTime
  33710. },
  33711. _layoutAxes: noop,
  33712. _renderElements: function(drawOptions) {
  33713. var that = this;
  33714. var preparedOptions = that._prepareToRender(drawOptions);
  33715. var isRotated = that._isRotated();
  33716. var isLegendInside = that._isLegendInside();
  33717. var trackerCanvases = [];
  33718. var dirtyCanvas = extend({}, that._canvas);
  33719. var argBusinessRange;
  33720. var zoomMinArg;
  33721. var zoomMaxArg;
  33722. that.DEBUG_dirtyCanvas = dirtyCanvas;
  33723. that._renderer.lock();
  33724. if (drawOptions.drawLegend && that._legend) {
  33725. that._legendGroup.linkAppend()
  33726. }
  33727. that.layoutManager.setOptions(that._layoutManagerOptions());
  33728. var layoutTargets = that._getLayoutTargets();
  33729. this._layoutAxes(function(needSpace) {
  33730. var axisDrawOptions = needSpace ? extend({}, drawOptions, {
  33731. animate: false
  33732. }) : drawOptions;
  33733. var canvas = that._renderAxes(axisDrawOptions, preparedOptions);
  33734. that._shrinkAxes(needSpace, canvas)
  33735. });
  33736. that._applyClipRects(preparedOptions);
  33737. that._appendSeriesGroups();
  33738. that._createCrosshairCursor();
  33739. layoutTargets.forEach(function(_ref) {
  33740. var canvas = _ref.canvas;
  33741. trackerCanvases.push({
  33742. left: canvas.left,
  33743. right: canvas.width - canvas.right,
  33744. top: canvas.top,
  33745. bottom: canvas.height - canvas.bottom
  33746. })
  33747. });
  33748. if (that._scrollBar) {
  33749. argBusinessRange = that._argumentAxes[0].getTranslator().getBusinessRange();
  33750. if ("discrete" === argBusinessRange.axisType && argBusinessRange.categories && argBusinessRange.categories.length <= 1 || "discrete" !== argBusinessRange.axisType && argBusinessRange.min === argBusinessRange.max) {
  33751. zoomMinArg = zoomMaxArg = void 0
  33752. } else {
  33753. zoomMinArg = argBusinessRange.minVisible;
  33754. zoomMaxArg = argBusinessRange.maxVisible
  33755. }
  33756. that._scrollBar.init(argBusinessRange, !that._argumentAxes[0].getOptions().valueMarginsEnabled).setPosition(zoomMinArg, zoomMaxArg)
  33757. }
  33758. that._updateTracker(trackerCanvases);
  33759. that._updateLegendPosition(drawOptions, isLegendInside);
  33760. that._applyPointMarkersAutoHiding();
  33761. that._renderSeries(drawOptions, isRotated, isLegendInside);
  33762. that._renderer.unlock()
  33763. },
  33764. _createCrosshairCursor: noop,
  33765. _appendSeriesGroups: function() {
  33766. this._seriesGroup.linkAppend();
  33767. this._labelsGroup.linkAppend();
  33768. this._appendAdditionalSeriesGroups()
  33769. },
  33770. _renderSeries: function(drawOptions, isRotated, isLegendInside) {
  33771. this._calculateSeriesLayout(drawOptions, isRotated);
  33772. this._renderSeriesElements(drawOptions, isRotated, isLegendInside)
  33773. },
  33774. _calculateSeriesLayout: function(drawOptions, isRotated) {
  33775. drawOptions.hideLayoutLabels = this.layoutManager.needMoreSpaceForPanesCanvas(this._getLayoutTargets(), isRotated) && !this._themeManager.getOptions("adaptiveLayout").keepLabels;
  33776. this._updateSeriesDimensions(drawOptions)
  33777. },
  33778. _renderSeriesElements: function(drawOptions, isRotated, isLegendInside) {
  33779. var that = this;
  33780. var i;
  33781. var series = that.series;
  33782. var singleSeries;
  33783. var seriesLength = series.length;
  33784. var resolveLabelOverlapping = that._themeManager.getOptions("resolveLabelOverlapping");
  33785. for (i = 0; i < seriesLength; i++) {
  33786. singleSeries = series[i];
  33787. that._applyExtraSettings(singleSeries, drawOptions);
  33788. singleSeries.draw(drawOptions.animate && singleSeries.getPoints().length <= drawOptions.animationPointsLimit && that._renderer.animationEnabled(), drawOptions.hideLayoutLabels, that._getLegendCallBack(singleSeries))
  33789. }
  33790. if ("none" === resolveLabelOverlapping) {
  33791. that._adjustSeriesLabels(false)
  33792. } else {
  33793. that._locateLabels(resolveLabelOverlapping)
  33794. }
  33795. that._renderTrackers(isLegendInside);
  33796. that._tracker.repairTooltip();
  33797. that._clearCanvas();
  33798. that._renderExtraElements();
  33799. that._drawn();
  33800. that._renderCompleteHandler()
  33801. },
  33802. _locateLabels: function(resolveLabelOverlapping) {
  33803. this._resolveLabelOverlapping(resolveLabelOverlapping)
  33804. },
  33805. _renderExtraElements: function() {},
  33806. _clearCanvas: function() {
  33807. this._canvas = this.__originalCanvas
  33808. },
  33809. _resolveLabelOverlapping: function(resolveLabelOverlapping) {
  33810. var func;
  33811. switch (resolveLabelOverlapping) {
  33812. case "stack":
  33813. func = this._resolveLabelOverlappingStack;
  33814. break;
  33815. case "hide":
  33816. func = this._resolveLabelOverlappingHide;
  33817. break;
  33818. case "shift":
  33819. func = this._resolveLabelOverlappingShift
  33820. }
  33821. return typeUtils.isFunction(func) && func.call(this)
  33822. },
  33823. _getVisibleSeries: function() {
  33824. return commonUtils.grep(this.getAllSeries(), function(series) {
  33825. return series.isVisible()
  33826. })
  33827. },
  33828. _resolveLabelOverlappingHide: function() {
  33829. var labels = [];
  33830. var currentLabel;
  33831. var nextLabel;
  33832. var currentLabelRect;
  33833. var nextLabelRect;
  33834. var i;
  33835. var j;
  33836. var points;
  33837. var series = this._getVisibleSeries();
  33838. for (i = 0; i < series.length; i++) {
  33839. points = series[i].getVisiblePoints();
  33840. for (j = 0; j < points.length; j++) {
  33841. labels.push.apply(labels, points[j].getLabels())
  33842. }
  33843. }
  33844. for (i = 0; i < labels.length; i++) {
  33845. currentLabel = labels[i];
  33846. if (!currentLabel.isVisible()) {
  33847. continue
  33848. }
  33849. currentLabelRect = currentLabel.getBoundingRect();
  33850. for (j = i + 1; j < labels.length; j++) {
  33851. nextLabel = labels[j];
  33852. nextLabelRect = nextLabel.getBoundingRect();
  33853. if (checkOverlapping(currentLabelRect, nextLabelRect)) {
  33854. nextLabel.draw(false)
  33855. }
  33856. }
  33857. }
  33858. },
  33859. _cleanGroups: function() {
  33860. var that = this;
  33861. that._stripsGroup.linkRemove().clear();
  33862. that._gridGroup.linkRemove().clear();
  33863. that._axesGroup.linkRemove().clear();
  33864. that._constantLinesGroup.above.clear();
  33865. that._labelAxesGroup.linkRemove().clear();
  33866. that._labelsGroup.linkRemove().clear();
  33867. that._crosshairCursorGroup.linkRemove().clear();
  33868. that._scaleBreaksGroup.linkRemove().clear()
  33869. },
  33870. _allowLegendInsidePosition: function() {
  33871. return false
  33872. },
  33873. _updateLegendPosition: noop,
  33874. _createLegend: function() {
  33875. var that = this;
  33876. var legendSettings = getLegendSettings(that._legendDataField);
  33877. that._legend = new legendModule.Legend({
  33878. renderer: that._renderer,
  33879. group: that._legendGroup,
  33880. backgroundClass: "dxc-border",
  33881. itemGroupClass: "dxc-item",
  33882. titleGroupClass: "dxc-title",
  33883. textField: legendSettings.textField,
  33884. getFormatObject: legendSettings.getFormatObject,
  33885. allowInsidePosition: that._allowLegendInsidePosition()
  33886. });
  33887. that._updateLegend();
  33888. that._layout.add(that._legend)
  33889. },
  33890. _updateLegend: function() {
  33891. var that = this;
  33892. var themeManager = that._themeManager;
  33893. var legendOptions = themeManager.getOptions("legend");
  33894. var legendData = that._getLegendData();
  33895. legendOptions.containerBackgroundColor = themeManager.getOptions("containerBackgroundColor");
  33896. legendOptions._incidentOccurred = that._incidentOccurred;
  33897. that._legend.update(legendData, legendOptions, themeManager.theme("legend").title);
  33898. this._change(["LAYOUT"])
  33899. },
  33900. _prepareDrawOptions: function(drawOptions) {
  33901. var animationOptions = this._getAnimationOptions();
  33902. var options = extend({}, {
  33903. force: false,
  33904. adjustAxes: true,
  33905. drawLegend: true,
  33906. drawTitle: true,
  33907. animate: animationOptions.enabled,
  33908. animationPointsLimit: animationOptions.maxPointCountSupported
  33909. }, drawOptions, this.__renderOptions);
  33910. if (!_isDefined(options.recreateCanvas)) {
  33911. options.recreateCanvas = options.adjustAxes && options.drawLegend && options.drawTitle
  33912. }
  33913. return options
  33914. },
  33915. _processRefreshData: function(newRefreshAction) {
  33916. var currentRefreshActionPosition = inArray(this._currentRefreshData, ACTIONS_BY_PRIORITY);
  33917. var newRefreshActionPosition = inArray(newRefreshAction, ACTIONS_BY_PRIORITY);
  33918. if (!this._currentRefreshData || currentRefreshActionPosition >= 0 && newRefreshActionPosition < currentRefreshActionPosition) {
  33919. this._currentRefreshData = newRefreshAction
  33920. }
  33921. this._requestChange(["REFRESH"])
  33922. },
  33923. _getLegendData: function() {
  33924. return _map(this._getLegendTargets(), function(item) {
  33925. var legendData = item.legendData;
  33926. var style = item.getLegendStyles;
  33927. var opacity = style.normal.opacity;
  33928. if (!item.visible) {
  33929. if (!_isDefined(opacity) || opacity > DEFAULT_OPACITY) {
  33930. opacity = DEFAULT_OPACITY
  33931. }
  33932. legendData.textOpacity = DEFAULT_OPACITY
  33933. }
  33934. legendData.states = {
  33935. hover: style.hover,
  33936. selection: style.selection,
  33937. normal: _extend({}, style.normal, {
  33938. opacity: opacity
  33939. })
  33940. };
  33941. return legendData
  33942. })
  33943. },
  33944. _getLegendOptions: function(item) {
  33945. return {
  33946. legendData: {
  33947. text: item[this._legendItemTextField],
  33948. id: item.index,
  33949. visible: true
  33950. },
  33951. getLegendStyles: item.getLegendStyles(),
  33952. visible: item.isVisible()
  33953. }
  33954. },
  33955. _disposeSeries: function(seriesIndex) {
  33956. var that = this;
  33957. if (that.series) {
  33958. if (_isDefined(seriesIndex)) {
  33959. that.series[seriesIndex].dispose();
  33960. that.series.splice(seriesIndex, 1)
  33961. } else {
  33962. _each(that.series, function(_, s) {
  33963. return s.dispose()
  33964. });
  33965. that.series.length = 0
  33966. }
  33967. }
  33968. if (!that.series || !that.series.length) {
  33969. that.series = []
  33970. }
  33971. },
  33972. _disposeSeriesFamilies: function() {
  33973. var that = this;
  33974. _each(that.seriesFamilies || [], function(_, family) {
  33975. family.dispose()
  33976. });
  33977. that.seriesFamilies = null;
  33978. that._needHandleRenderComplete = true
  33979. },
  33980. _simulateOptionChange: function(fullName, value, previousValue) {
  33981. var that = this;
  33982. var optionSetter = coreDataUtils.compileSetter(fullName);
  33983. optionSetter(that._options, value, {
  33984. functionsAsIs: true,
  33985. merge: !that._getOptionsByReference()[fullName]
  33986. });
  33987. that._notifyOptionChanged(fullName, value, previousValue);
  33988. that._changes.reset()
  33989. },
  33990. _optionChanged: function(arg) {
  33991. this._themeManager.resetOptions(arg.name);
  33992. this.callBase.apply(this, arguments)
  33993. },
  33994. _applyChanges: function() {
  33995. var that = this;
  33996. that._themeManager.update(that._options);
  33997. that.callBase.apply(that, arguments)
  33998. },
  33999. _optionChangesMap: {
  34000. animation: "ANIMATION",
  34001. dataSource: "DATA_SOURCE",
  34002. palette: "PALETTE",
  34003. paletteExtensionMode: "PALETTE",
  34004. legend: "FORCE_DATA_INIT",
  34005. seriesTemplate: "FORCE_DATA_INIT",
  34006. "export": "FORCE_RENDER",
  34007. valueAxis: "AXES_AND_PANES",
  34008. argumentAxis: "AXES_AND_PANES",
  34009. commonAxisSettings: "AXES_AND_PANES",
  34010. panes: "AXES_AND_PANES",
  34011. defaultPane: "AXES_AND_PANES",
  34012. useAggregation: "AXES_AND_PANES",
  34013. containerBackgroundColor: "AXES_AND_PANES",
  34014. rotated: "ROTATED",
  34015. autoHidePointMarkers: "REFRESH_SERIES_REINIT",
  34016. customizePoint: "REFRESH_SERIES_REINIT",
  34017. customizeLabel: "REFRESH_SERIES_REINIT",
  34018. scrollBar: "SCROLL_BAR"
  34019. },
  34020. _optionChangesOrder: ["ROTATED", "PALETTE", "REFRESH_SERIES_REINIT", "AXES_AND_PANES", "INIT", "REINIT", "DATA_SOURCE", "REFRESH_SERIES_DATA_INIT", "DATA_INIT", "FORCE_DATA_INIT", "REFRESH_AXES", "CORRECT_AXIS"],
  34021. _customChangesOrder: ["ANIMATION", "REFRESH_SERIES_FAMILIES", "FORCE_RENDER", "VISUAL_RANGE", "SCROLL_BAR", "CHART_TOOLTIP", "REINIT", "REFRESH", "FULL_RENDER"],
  34022. _change_ANIMATION: function() {
  34023. this._renderer.updateAnimationOptions(this._getAnimationOptions())
  34024. },
  34025. _change_DATA_SOURCE: function() {
  34026. this._needHandleRenderComplete = true;
  34027. this._updateDataSource()
  34028. },
  34029. _change_PALETTE: function() {
  34030. this._themeManager.updatePalette();
  34031. this._refreshSeries("DATA_INIT")
  34032. },
  34033. _change_REFRESH_SERIES_DATA_INIT: function() {
  34034. this._refreshSeries("DATA_INIT")
  34035. },
  34036. _change_DATA_INIT: function() {
  34037. if ((!this.series || this.needToPopulateSeries) && !this._changes.has("FORCE_DATA_INIT")) {
  34038. this._dataInit()
  34039. }
  34040. },
  34041. _change_FORCE_DATA_INIT: function() {
  34042. this._dataInit()
  34043. },
  34044. _change_REFRESH_SERIES_FAMILIES: function() {
  34045. this._processSeriesFamilies();
  34046. this._populateBusinessRange();
  34047. this._processRefreshData(FORCE_RENDER_REFRESH_ACTION)
  34048. },
  34049. _change_FORCE_RENDER: function() {
  34050. this._processRefreshData(FORCE_RENDER_REFRESH_ACTION)
  34051. },
  34052. _change_AXES_AND_PANES: function() {
  34053. this._refreshSeries("INIT")
  34054. },
  34055. _change_ROTATED: function() {
  34056. this._createScrollBar();
  34057. this._refreshSeries("INIT")
  34058. },
  34059. _change_REFRESH_SERIES_REINIT: function() {
  34060. this._refreshSeries("INIT")
  34061. },
  34062. _change_REFRESH_AXES: function() {
  34063. var that = this;
  34064. _setCanvasValues(that._canvas);
  34065. that._reinitAxes();
  34066. that._requestChange(["CORRECT_AXIS", "FULL_RENDER"])
  34067. },
  34068. _change_SCROLL_BAR: function() {
  34069. this._createScrollBar();
  34070. this._processRefreshData(FORCE_RENDER_REFRESH_ACTION)
  34071. },
  34072. _change_CHART_TOOLTIP: function() {
  34073. this._organizeStackPoints()
  34074. },
  34075. _change_REINIT: function() {
  34076. this._processRefreshData(REINIT_REFRESH_ACTION)
  34077. },
  34078. _refreshSeries: function(actionName) {
  34079. this.needToPopulateSeries = true;
  34080. this._requestChange([actionName])
  34081. },
  34082. _change_CORRECT_AXIS: function() {
  34083. this._correctAxes()
  34084. },
  34085. _doRefresh: function() {
  34086. var methodName = this._currentRefreshData;
  34087. if (methodName) {
  34088. this._currentRefreshData = null;
  34089. this._renderer.stopAllAnimations(true);
  34090. this[methodName]()
  34091. }
  34092. },
  34093. _updateCanvasClipRect: function(canvas) {
  34094. var that = this;
  34095. var width = Math.max(canvas.width - canvas.left - canvas.right, 0);
  34096. var height = Math.max(canvas.height - canvas.top - canvas.bottom, 0);
  34097. that._canvasClipRect.attr({
  34098. x: canvas.left,
  34099. y: canvas.top,
  34100. width: width,
  34101. height: height
  34102. });
  34103. that._backgroundRect.attr({
  34104. x: canvas.left,
  34105. y: canvas.top,
  34106. width: width,
  34107. height: height
  34108. })
  34109. },
  34110. _getCanvasClipRectID: function() {
  34111. return this._canvasClipRect.id
  34112. },
  34113. _dataSourceChangedHandler: function() {
  34114. if (this._changes.has("INIT")) {
  34115. this._requestChange(["DATA_INIT"])
  34116. } else {
  34117. this._requestChange(["FORCE_DATA_INIT"])
  34118. }
  34119. },
  34120. _dataInit: function() {
  34121. this._dataSpecificInit(true)
  34122. },
  34123. _processSingleSeries: function(singleSeries) {
  34124. singleSeries.createPoints(false)
  34125. },
  34126. _handleSeriesDataUpdated: function() {
  34127. var _this = this;
  34128. if (this._getVisibleSeries().some(function(s) {
  34129. return s.useAggregation()
  34130. })) {
  34131. this._populateMarginOptions()
  34132. }
  34133. this.series.forEach(function(s) {
  34134. return _this._processSingleSeries(s)
  34135. }, this)
  34136. },
  34137. _dataSpecificInit: function(needRedraw) {
  34138. var that = this;
  34139. if (!that.series || that.needToPopulateSeries) {
  34140. that.series = that._populateSeries()
  34141. }
  34142. that._repopulateSeries();
  34143. that._seriesPopulatedHandlerCore();
  34144. that._populateBusinessRange();
  34145. that._tracker.updateSeries(that.series, this._changes.has("INIT"));
  34146. that._updateLegend();
  34147. if (needRedraw) {
  34148. this._requestChange(["FULL_RENDER"])
  34149. }
  34150. },
  34151. _forceRender: function() {
  34152. this._doRender({
  34153. force: true
  34154. })
  34155. },
  34156. _repopulateSeries: function() {
  34157. var that = this;
  34158. var themeManager = that._themeManager;
  34159. var data = that._dataSourceItems();
  34160. var dataValidatorOptions = themeManager.getOptions("dataPrepareSettings");
  34161. var seriesTemplate = themeManager.getOptions("seriesTemplate");
  34162. if (seriesTemplate) {
  34163. that._populateSeries(data)
  34164. }
  34165. that._groupSeries();
  34166. var parsedData = dataValidatorModule.validateData(data, that._groupsData, that._incidentOccurred, dataValidatorOptions);
  34167. themeManager.resetPalette();
  34168. that.series.forEach(function(singleSeries) {
  34169. singleSeries.updateData(parsedData[singleSeries.getArgumentField()])
  34170. });
  34171. that._handleSeriesDataUpdated();
  34172. that._organizeStackPoints()
  34173. },
  34174. _organizeStackPoints: function() {
  34175. var that = this;
  34176. var themeManager = that._themeManager;
  34177. var sharedTooltip = themeManager.getOptions("tooltip").shared;
  34178. var stackPoints = {};
  34179. _each(that.series || [], function(_, singleSeries) {
  34180. that._resetStackPoints(singleSeries);
  34181. sharedTooltip && that._prepareStackPoints(singleSeries, stackPoints)
  34182. })
  34183. },
  34184. _renderCompleteHandler: function() {
  34185. var that = this;
  34186. var allSeriesInited = true;
  34187. if (that._needHandleRenderComplete) {
  34188. _each(that.series, function(_, s) {
  34189. allSeriesInited = allSeriesInited && s.canRenderCompleteHandle()
  34190. });
  34191. if (allSeriesInited) {
  34192. that._needHandleRenderComplete = false;
  34193. that._eventTrigger("done", {
  34194. target: that
  34195. })
  34196. }
  34197. }
  34198. },
  34199. _dataIsReady: function() {
  34200. return _isDefined(this.option("dataSource")) && this._dataIsLoaded()
  34201. },
  34202. _populateSeriesOptions: function(data) {
  34203. var that = this;
  34204. var themeManager = that._themeManager;
  34205. var seriesTemplate = themeManager.getOptions("seriesTemplate");
  34206. var seriesOptions = seriesTemplate ? vizUtils.processSeriesTemplate(seriesTemplate, data || []) : that.option("series");
  34207. var allSeriesOptions = _isArray(seriesOptions) ? seriesOptions : seriesOptions ? [seriesOptions] : [];
  34208. var extraOptions = that._getExtraOptions();
  34209. var particularSeriesOptions;
  34210. var seriesTheme;
  34211. var seriesThemes = [];
  34212. var seriesVisibilityChanged = function(target) {
  34213. that._specialProcessSeries();
  34214. that._populateBusinessRange(target && target.getValueAxis(), true);
  34215. that._renderer.stopAllAnimations(true);
  34216. that._updateLegend();
  34217. that._requestChange(["FULL_RENDER"])
  34218. };
  34219. for (var i = 0; i < allSeriesOptions.length; i++) {
  34220. particularSeriesOptions = _extend(true, {}, allSeriesOptions[i], extraOptions);
  34221. if (!particularSeriesOptions.name) {
  34222. particularSeriesOptions.name = "Series " + (i + 1).toString()
  34223. }
  34224. particularSeriesOptions.rotated = that._isRotated();
  34225. particularSeriesOptions.customizePoint = themeManager.getOptions("customizePoint");
  34226. particularSeriesOptions.customizeLabel = themeManager.getOptions("customizeLabel");
  34227. particularSeriesOptions.visibilityChanged = seriesVisibilityChanged;
  34228. particularSeriesOptions.incidentOccurred = that._incidentOccurred;
  34229. seriesTheme = themeManager.getOptions("series", particularSeriesOptions, allSeriesOptions.length);
  34230. if (that._checkPaneName(seriesTheme)) {
  34231. seriesThemes.push(seriesTheme)
  34232. }
  34233. }
  34234. return seriesThemes
  34235. },
  34236. _populateSeries: function(data) {
  34237. var that = this;
  34238. var seriesBasis = [];
  34239. var incidentOccurred = that._incidentOccurred;
  34240. var seriesThemes = that._populateSeriesOptions(data);
  34241. var particularSeries;
  34242. var disposeSeriesFamilies = false;
  34243. that.needToPopulateSeries = false;
  34244. _each(seriesThemes, function(_, theme) {
  34245. var curSeries = that.series && that.series.filter(function(s) {
  34246. return s.name === theme.name && seriesBasis.map(function(sb) {
  34247. return sb.series
  34248. }).indexOf(s) === -1
  34249. })[0];
  34250. if (curSeries && curSeries.type === theme.type) {
  34251. seriesBasis.push({
  34252. series: curSeries,
  34253. options: theme
  34254. })
  34255. } else {
  34256. seriesBasis.push({
  34257. options: theme
  34258. });
  34259. disposeSeriesFamilies = true
  34260. }
  34261. });
  34262. that._tracker.clearHover();
  34263. _reverseEach(that.series, function(index, series) {
  34264. if (!seriesBasis.some(function(s) {
  34265. return series === s.series
  34266. })) {
  34267. that._disposeSeries(index);
  34268. disposeSeriesFamilies = true
  34269. }
  34270. });
  34271. !disposeSeriesFamilies && (disposeSeriesFamilies = seriesBasis.some(function(sb) {
  34272. return sb.series.name !== seriesThemes[sb.series.index].name;
  34273. }));
  34274. that.series = [];
  34275. disposeSeriesFamilies && that._disposeSeriesFamilies();
  34276. that._themeManager.resetPalette();
  34277. var eventPipe = function(data) {
  34278. that.series.forEach(function(currentSeries) {
  34279. currentSeries.notify(data)
  34280. })
  34281. };
  34282. _each(seriesBasis, function(_, basis) {
  34283. var seriesTheme = basis.options;
  34284. var renderSettings = {
  34285. commonSeriesModes: that._getSelectionModes(),
  34286. argumentAxis: that.getArgumentAxis(),
  34287. valueAxis: that._getValueAxis(seriesTheme.pane, seriesTheme.axis)
  34288. };
  34289. if (basis.series) {
  34290. particularSeries = basis.series;
  34291. particularSeries.updateOptions(seriesTheme, renderSettings)
  34292. } else {
  34293. particularSeries = new seriesModule.Series(_extend({
  34294. renderer: that._renderer,
  34295. seriesGroup: that._seriesGroup,
  34296. labelsGroup: that._labelsGroup,
  34297. eventTrigger: that._eventTrigger,
  34298. eventPipe: eventPipe,
  34299. incidentOccurred: incidentOccurred
  34300. }, renderSettings), seriesTheme)
  34301. }
  34302. if (!particularSeries.isUpdated) {
  34303. incidentOccurred("E2101", [seriesTheme.type])
  34304. } else {
  34305. particularSeries.index = that.series.length;
  34306. that.series.push(particularSeries)
  34307. }
  34308. });
  34309. return that.series
  34310. },
  34311. getAllSeries: function() {
  34312. return (this.series || []).slice()
  34313. },
  34314. getSeriesByName: function(name) {
  34315. var found = null;
  34316. _each(this.series, function(i, singleSeries) {
  34317. if (singleSeries.name === name) {
  34318. found = singleSeries;
  34319. return false
  34320. }
  34321. });
  34322. return found
  34323. },
  34324. getSeriesByPos: function(pos) {
  34325. return (this.series || [])[pos]
  34326. },
  34327. clearSelection: function() {
  34328. this._tracker.clearSelection()
  34329. },
  34330. hideTooltip: function() {
  34331. this._tracker._hideTooltip()
  34332. },
  34333. clearHover: function() {
  34334. this._tracker.clearHover()
  34335. },
  34336. render: function(renderOptions) {
  34337. var that = this;
  34338. that.__renderOptions = renderOptions;
  34339. that.__forceRender = renderOptions && renderOptions.force;
  34340. that.callBase.apply(that, arguments);
  34341. that.__renderOptions = that.__forceRender = null;
  34342. return that
  34343. },
  34344. refresh: function() {
  34345. this._disposeSeries();
  34346. this._disposeSeriesFamilies();
  34347. this._requestChange(["CONTAINER_SIZE", "REFRESH_SERIES_REINIT"])
  34348. },
  34349. _getMinSize: function() {
  34350. var adaptiveLayout = this._layoutManagerOptions();
  34351. return [adaptiveLayout.width, adaptiveLayout.height]
  34352. },
  34353. _change_REFRESH: function() {
  34354. if (!this._changes.has("INIT")) {
  34355. this._doRefresh()
  34356. } else {
  34357. this._currentRefreshData = null
  34358. }
  34359. },
  34360. _change_FULL_RENDER: function() {
  34361. this._forceRender()
  34362. },
  34363. _change_INIT: function() {
  34364. this._reinit()
  34365. },
  34366. _stopCurrentHandling: function() {
  34367. this._tracker.stopCurrentHandling()
  34368. }
  34369. });
  34370. REFRESH_SERIES_DATA_INIT_ACTION_OPTIONS.forEach(function(name) {
  34371. BaseChart.prototype._optionChangesMap[name] = "REFRESH_SERIES_DATA_INIT"
  34372. });
  34373. FORCE_RENDER_REFRESH_ACTION_OPTIONS.forEach(function(name) {
  34374. BaseChart.prototype._optionChangesMap[name] = "FORCE_RENDER"
  34375. });
  34376. REFRESH_SERIES_FAMILIES_ACTION_OPTIONS.forEach(function(name) {
  34377. BaseChart.prototype._optionChangesMap[name] = "REFRESH_SERIES_FAMILIES"
  34378. });
  34379. exports.overlapping = overlapping;
  34380. exports.BaseChart = BaseChart;
  34381. BaseChart.addPlugin(__webpack_require__( /*! ../core/export */ 93).plugin);
  34382. BaseChart.addPlugin(__webpack_require__( /*! ../core/title */ 105).plugin);
  34383. BaseChart.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin);
  34384. BaseChart.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 119).plugin);
  34385. BaseChart.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin);
  34386. var _change_TITLE = BaseChart.prototype._change_TITLE;
  34387. BaseChart.prototype._change_TITLE = function() {
  34388. _change_TITLE.apply(this, arguments);
  34389. this._change(["FORCE_RENDER"])
  34390. };
  34391. var _change_TOOLTIP = BaseChart.prototype._change_TOOLTIP;
  34392. BaseChart.prototype._change_TOOLTIP = function() {
  34393. _change_TOOLTIP.apply(this, arguments);
  34394. this._change(["CHART_TOOLTIP"])
  34395. }
  34396. },
  34397. /*!*************************************************************!*\
  34398. !*** ./artifacts/transpiled/viz/core/base_theme_manager.js ***!
  34399. \*************************************************************/
  34400. /*! dynamic exports provided */
  34401. /*! all exports used */
  34402. function(module, exports, __webpack_require__) {
  34403. var Class = __webpack_require__( /*! ../../core/class */ 15);
  34404. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  34405. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  34406. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  34407. var paletteModule = __webpack_require__( /*! ../palette */ 164);
  34408. var _isString = typeUtils.isString;
  34409. var _parseScalar = __webpack_require__( /*! ./utils */ 10).parseScalar;
  34410. var themeModule = __webpack_require__( /*! ../themes */ 50);
  34411. var _getTheme = themeModule.getTheme;
  34412. var _addCacheItem = themeModule.addCacheItem;
  34413. var _removeCacheItem = themeModule.removeCacheItem;
  34414. var _extend = extend;
  34415. var _each = each;
  34416. __webpack_require__( /*! ./themes/generic.light */ 754);
  34417. __webpack_require__( /*! ./themes/generic.dark */ 755);
  34418. __webpack_require__( /*! ./themes/generic.contrast */ 756);
  34419. __webpack_require__( /*! ./themes/generic.carmine */ 757);
  34420. __webpack_require__( /*! ./themes/generic.darkmoon */ 758);
  34421. __webpack_require__( /*! ./themes/generic.softblue */ 759);
  34422. __webpack_require__( /*! ./themes/generic.darkviolet */ 760);
  34423. __webpack_require__( /*! ./themes/generic.greenmist */ 761);
  34424. __webpack_require__( /*! ./themes/material */ 762);
  34425. __webpack_require__( /*! ./themes/ios */ 763);
  34426. function getThemePart(theme, path) {
  34427. var _theme = theme;
  34428. path && _each(path.split("."), function(_, pathItem) {
  34429. return _theme = _theme[pathItem]
  34430. });
  34431. return _theme
  34432. }
  34433. exports.BaseThemeManager = Class.inherit({
  34434. ctor: function(options) {
  34435. this._themeSection = options.themeSection;
  34436. this._fontFields = options.fontFields || [];
  34437. _addCacheItem(this)
  34438. },
  34439. dispose: function() {
  34440. var that = this;
  34441. _removeCacheItem(that);
  34442. that._callback = that._theme = that._font = null;
  34443. return that
  34444. },
  34445. setCallback: function(callback) {
  34446. this._callback = callback;
  34447. return this
  34448. },
  34449. setTheme: function(theme, rtl) {
  34450. this._current = theme;
  34451. this._rtl = rtl;
  34452. return this.refresh()
  34453. },
  34454. refresh: function() {
  34455. var that = this;
  34456. var current = that._current || {};
  34457. var theme = _getTheme(current.name || current);
  34458. that._themeName = theme.name;
  34459. that._defaultPalette = theme.defaultPalette;
  34460. that._font = _extend({}, theme.font, current.font);
  34461. that._themeSection && _each(that._themeSection.split("."), function(_, path) {
  34462. theme = _extend(true, {}, theme[path])
  34463. });
  34464. that._theme = _extend(true, {}, theme, _isString(current) ? {} : current);
  34465. that._initializeTheme();
  34466. if (_parseScalar(that._rtl, that._theme.rtlEnabled)) {
  34467. _extend(true, that._theme, that._theme._rtl)
  34468. }
  34469. that._callback();
  34470. return that
  34471. },
  34472. theme: function(path) {
  34473. return getThemePart(this._theme, path)
  34474. },
  34475. themeName: function() {
  34476. return this._themeName
  34477. },
  34478. createPalette: function(palette, options) {
  34479. return paletteModule.createPalette(palette, options, this._defaultPalette)
  34480. },
  34481. createDiscretePalette: function(palette, count) {
  34482. return paletteModule.getDiscretePalette(palette, count, this._defaultPalette)
  34483. },
  34484. createGradientPalette: function(palette) {
  34485. return paletteModule.getGradientPalette(palette, this._defaultPalette)
  34486. },
  34487. getAccentColor: function(palette) {
  34488. return paletteModule.getAccentColor(palette, this._defaultPalette)
  34489. },
  34490. _initializeTheme: function() {
  34491. var that = this;
  34492. _each(that._fontFields || [], function(_, path) {
  34493. that._initializeFont(getThemePart(that._theme, path))
  34494. })
  34495. },
  34496. _initializeFont: function(font) {
  34497. _extend(font, this._font, _extend({}, font))
  34498. }
  34499. })
  34500. },
  34501. /*!*********************************************************!*\
  34502. !*** ./artifacts/transpiled/viz/core/layout_element.js ***!
  34503. \*********************************************************/
  34504. /*! dynamic exports provided */
  34505. /*! all exports used */
  34506. function(module, exports, __webpack_require__) {
  34507. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  34508. var _round = Math.round;
  34509. var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
  34510. var defaultOffset = {
  34511. horizontal: 0,
  34512. vertical: 0
  34513. };
  34514. var alignFactors = {
  34515. center: .5,
  34516. right: 1,
  34517. bottom: 1,
  34518. left: 0,
  34519. top: 0
  34520. };
  34521. function LayoutElement(options) {
  34522. this._options = options
  34523. }
  34524. LayoutElement.prototype = {
  34525. constructor: LayoutElement,
  34526. position: function(options) {
  34527. var that = this;
  34528. var ofBBox = options.of.getLayoutOptions();
  34529. var myBBox = that.getLayoutOptions();
  34530. var at = options.at;
  34531. var my = options.my;
  34532. var offset = options.offset || defaultOffset;
  34533. var shiftX = -alignFactors[my.horizontal] * myBBox.width + ofBBox.x + alignFactors[at.horizontal] * ofBBox.width + parseInt(offset.horizontal);
  34534. var shiftY = -alignFactors[my.vertical] * myBBox.height + ofBBox.y + alignFactors[at.vertical] * ofBBox.height + parseInt(offset.vertical);
  34535. that.shift(_round(shiftX), _round(shiftY))
  34536. },
  34537. getLayoutOptions: noop
  34538. };
  34539. function WrapperLayoutElement(renderElement, bBox) {
  34540. this._renderElement = renderElement;
  34541. this._cacheBBox = bBox
  34542. }
  34543. var wrapperLayoutElementPrototype = WrapperLayoutElement.prototype = objectUtils.clone(LayoutElement.prototype);
  34544. wrapperLayoutElementPrototype.constructor = WrapperLayoutElement;
  34545. wrapperLayoutElementPrototype.getLayoutOptions = function() {
  34546. return this._cacheBBox || this._renderElement.getBBox()
  34547. };
  34548. wrapperLayoutElementPrototype.shift = function(shiftX, shiftY) {
  34549. var bBox = this.getLayoutOptions();
  34550. this._renderElement.move(_round(shiftX - bBox.x), _round(shiftY - bBox.y))
  34551. };
  34552. exports.LayoutElement = LayoutElement;
  34553. exports.WrapperLayoutElement = WrapperLayoutElement
  34554. },
  34555. /*!***************************************************************!*\
  34556. !*** ./artifacts/transpiled/viz/components/data_validator.js ***!
  34557. \***************************************************************/
  34558. /*! dynamic exports provided */
  34559. /*! all exports used */
  34560. function(module, exports, __webpack_require__) {
  34561. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  34562. var STRING = "string";
  34563. var NUMERIC = "numeric";
  34564. var DATETIME = "datetime";
  34565. var DISCRETE = "discrete";
  34566. var SEMIDISCRETE = "semidiscrete";
  34567. var CONTINUOUS = "continuous";
  34568. var LOGARITHMIC = "logarithmic";
  34569. var VALUE_TYPE = "valueType";
  34570. var ARGUMENT_TYPE = "argumentType";
  34571. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  34572. var axisTypeParser = __webpack_require__( /*! ../core/utils */ 10).enumParser([STRING, NUMERIC, DATETIME]);
  34573. var _getParser = __webpack_require__( /*! ./parse_utils */ 244).getParser;
  34574. var _isDefined = typeUtils.isDefined;
  34575. var _isFunction = typeUtils.isFunction;
  34576. var _isArray = Array.isArray;
  34577. var _isString = typeUtils.isString;
  34578. var _isDate = typeUtils.isDate;
  34579. var _isNumber = typeUtils.isNumeric;
  34580. var _isObject = typeUtils.isObject;
  34581. function groupingValues(data, others, valueField, index) {
  34582. if (index >= 0) {
  34583. data.slice(index).forEach(function(cell) {
  34584. if (_isDefined(cell[valueField])) {
  34585. others[valueField] += cell[valueField];
  34586. cell[valueField] = void 0
  34587. }
  34588. })
  34589. }
  34590. }
  34591. function processGroups(groups) {
  34592. groups.forEach(function(group) {
  34593. group.valueType = group.valueAxisType = null;
  34594. group.series.forEach(function(series) {
  34595. series.updateDataType({})
  34596. });
  34597. group.valueAxis && group.valueAxis.resetTypes(VALUE_TYPE)
  34598. })
  34599. }
  34600. function sortValues(data, asc, selector) {
  34601. var func = asc ? function(a, b) {
  34602. return a - b
  34603. } : function(a, b) {
  34604. return b - a
  34605. };
  34606. data.sort(function(a, b) {
  34607. var valA = selector(a);
  34608. var valB = selector(b);
  34609. var aa = _isDefined(valA) ? 1 : 0;
  34610. var bb = _isDefined(valB) ? 1 : 0;
  34611. return aa && bb ? func(valA, valB) : func(aa, bb)
  34612. });
  34613. return data
  34614. }
  34615. function resetArgumentAxes(axes) {
  34616. axes && axes.forEach(function(axis) {
  34617. axis.resetTypes(ARGUMENT_TYPE)
  34618. })
  34619. }
  34620. function parseCategories(categories, parser) {
  34621. var newArray = [];
  34622. categories.forEach(function(category) {
  34623. var parsedCategory = parser(category);
  34624. void 0 !== parsedCategory && newArray.push(parsedCategory)
  34625. });
  34626. return newArray
  34627. }
  34628. function parseAxisCategories(groupsData, parsers) {
  34629. var argumentCategories = groupsData.argumentOptions && groupsData.argumentOptions.categories;
  34630. groupsData.groups.forEach(function(valueGroup, i) {
  34631. var categories = valueGroup.valueOptions && valueGroup.valueOptions.categories;
  34632. if (categories) {
  34633. valueGroup.valueOptions.categories = parseCategories(categories, parsers[i + 1])
  34634. }
  34635. });
  34636. if (argumentCategories) {
  34637. groupsData.argumentOptions.categories = parseCategories(argumentCategories, parsers[0])
  34638. }
  34639. }
  34640. function filterForLogAxis(val, field, incidentOccurred) {
  34641. if (val <= 0 && null !== val) {
  34642. incidentOccurred("E2004", [field]);
  34643. val = null
  34644. }
  34645. return val
  34646. }
  34647. function eigen(x) {
  34648. return x
  34649. }
  34650. function getType(unit, type) {
  34651. var result = type;
  34652. if (type === STRING || _isString(unit)) {
  34653. result = STRING
  34654. } else {
  34655. if (type === DATETIME || _isDate(unit)) {
  34656. result = DATETIME
  34657. } else {
  34658. if (_isNumber(unit)) {
  34659. result = NUMERIC
  34660. }
  34661. }
  34662. }
  34663. return result
  34664. }
  34665. function correctAxisType(type, axisType, hasCategories, incidentOccurred) {
  34666. if (type === STRING && (axisType === CONTINUOUS || axisType === LOGARITHMIC || axisType === SEMIDISCRETE)) {
  34667. incidentOccurred("E2002")
  34668. }
  34669. return axisType === LOGARITHMIC ? LOGARITHMIC : hasCategories || axisType === DISCRETE || type === STRING ? DISCRETE : axisType === SEMIDISCRETE ? SEMIDISCRETE : CONTINUOUS
  34670. }
  34671. function validUnit(unit, field, incidentOccurred) {
  34672. if (unit) {
  34673. incidentOccurred(!_isNumber(unit) && !_isDate(unit) && !_isString(unit) ? "E2003" : "E2004", [field])
  34674. }
  34675. }
  34676. function createParserUnit(type, axisType, incidentOccurred) {
  34677. var parser = type ? _getParser(type) : eigen;
  34678. var filter = axisType === LOGARITHMIC ? filterForLogAxis : eigen;
  34679. var filterInfinity = axisType !== DISCRETE ? function(x) {
  34680. return isFinite(x) || void 0 === x ? x : null
  34681. } : eigen;
  34682. return function(unit, field) {
  34683. var filterLogValues = function(x) {
  34684. return filter(x, field, incidentOccurred)
  34685. };
  34686. var parseUnit = filterLogValues(filterInfinity(parser(unit)));
  34687. if (void 0 === parseUnit) {
  34688. validUnit(unit, field, incidentOccurred)
  34689. }
  34690. return parseUnit
  34691. }
  34692. }
  34693. function prepareParsers(groupsData, incidentOccurred) {
  34694. var argumentParser = createParserUnit(groupsData.argumentType, groupsData.argumentAxisType, incidentOccurred);
  34695. var sizeParser;
  34696. var valueParser;
  34697. var categoryParsers = [argumentParser];
  34698. var cache = {};
  34699. var list = [];
  34700. groupsData.groups.forEach(function(group, groupIndex) {
  34701. group.series.forEach(function(series) {
  34702. valueParser = createParserUnit(group.valueType, group.valueAxisType, incidentOccurred);
  34703. sizeParser = createParserUnit(NUMERIC, CONTINUOUS, incidentOccurred);
  34704. cache[series.getArgumentField()] = argumentParser;
  34705. series.getValueFields().forEach(function(field) {
  34706. categoryParsers[groupIndex + 1] = valueParser;
  34707. cache[field] = valueParser
  34708. });
  34709. if (series.getSizeField()) {
  34710. cache[series.getSizeField()] = sizeParser
  34711. }
  34712. })
  34713. });
  34714. for (var field in cache) {
  34715. list.push([field, cache[field]])
  34716. }
  34717. list.length && parseAxisCategories(groupsData, categoryParsers);
  34718. return list
  34719. }
  34720. function getParsedCell(cell, parsers) {
  34721. var i;
  34722. var ii = parsers.length;
  34723. var obj = extend({}, cell);
  34724. var field;
  34725. var value;
  34726. for (i = 0; i < ii; ++i) {
  34727. field = parsers[i][0];
  34728. value = cell[field];
  34729. obj[field] = parsers[i][1](value, field)
  34730. }
  34731. return obj
  34732. }
  34733. function parse(data, parsers) {
  34734. var parsedData = [];
  34735. var i;
  34736. var ii = data.length;
  34737. parsedData.length = ii;
  34738. for (i = 0; i < ii; ++i) {
  34739. parsedData[i] = getParsedCell(data[i], parsers)
  34740. }
  34741. return parsedData
  34742. }
  34743. function findIndexByThreshold(data, valueField, threshold) {
  34744. var i;
  34745. var ii = data.length;
  34746. var value;
  34747. for (i = 0; i < ii; ++i) {
  34748. value = data[i][valueField];
  34749. if (_isDefined(value) && threshold > value) {
  34750. break
  34751. }
  34752. }
  34753. return i
  34754. }
  34755. function groupMinSlices(originalData, argumentField, valueField, smallValuesGrouping) {
  34756. smallValuesGrouping = smallValuesGrouping || {};
  34757. var mode = smallValuesGrouping.mode;
  34758. var others = {};
  34759. if (!mode || "none" === mode) {
  34760. return
  34761. }
  34762. others[argumentField] = String(smallValuesGrouping.groupName || "others");
  34763. others[valueField] = 0;
  34764. var data = sortValues(originalData.slice(), false, function(a) {
  34765. return a[valueField]
  34766. });
  34767. groupingValues(data, others, valueField, "smallValueThreshold" === mode ? findIndexByThreshold(data, valueField, smallValuesGrouping.threshold) : smallValuesGrouping.topCount);
  34768. others[valueField] && originalData.push(others)
  34769. }
  34770. function groupPieData(data, groupsData) {
  34771. var firstSeries = groupsData.groups[0] && groupsData.groups[0].series[0];
  34772. var isPie = firstSeries && ("pie" === firstSeries.type || "doughnut" === firstSeries.type || "donut" === firstSeries.type);
  34773. if (!isPie) {
  34774. return
  34775. }
  34776. groupsData.groups.forEach(function(group) {
  34777. group.series.forEach(function(series) {
  34778. groupMinSlices(data, series.getArgumentField(), series.getValueFields()[0], series.getOptions().smallValuesGrouping)
  34779. })
  34780. })
  34781. }
  34782. function addUniqueItemToCollection(item, collection, itemsHash) {
  34783. if (!itemsHash[item]) {
  34784. collection.push(item);
  34785. itemsHash[item] = true
  34786. }
  34787. }
  34788. function getUniqueArgumentFields(groupsData) {
  34789. var uniqueArgumentFields = [];
  34790. var hash = {};
  34791. groupsData.groups.forEach(function(group) {
  34792. group.series.forEach(function(series) {
  34793. addUniqueItemToCollection(series.getArgumentField(), uniqueArgumentFields, hash)
  34794. })
  34795. });
  34796. return uniqueArgumentFields
  34797. }
  34798. function sort(a, b) {
  34799. var result = a - b;
  34800. if (isNaN(result)) {
  34801. if (!_isDefined(a)) {
  34802. return 1
  34803. }
  34804. if (!_isDefined(b)) {
  34805. return -1
  34806. }
  34807. return 0
  34808. }
  34809. return result
  34810. }
  34811. function sortByArgument(data, argumentField) {
  34812. return data.slice().sort(function(a, b) {
  34813. return sort(a[argumentField], b[argumentField])
  34814. })
  34815. }
  34816. function sortByCallback(data, callback) {
  34817. return data.slice().sort(callback)
  34818. }
  34819. function checkValueTypeOfGroup(group, cell) {
  34820. group.series.forEach(function(series) {
  34821. series.getValueFields().forEach(function(field) {
  34822. group.valueType = getType(cell[field], group.valueType)
  34823. })
  34824. });
  34825. return group.valueType
  34826. }
  34827. function getSortByCategories(categories) {
  34828. var hash = {};
  34829. categories.forEach(function(value, i) {
  34830. hash[value] = i
  34831. });
  34832. return function(data, argumentField) {
  34833. return sortValues(data.slice(), true, function(a) {
  34834. return hash[a[argumentField]]
  34835. })
  34836. }
  34837. }
  34838. function sortData(data, groupsData, options, uniqueArgumentFields) {
  34839. var dataByArguments = {};
  34840. var isDiscrete = groupsData.argumentAxisType === DISCRETE;
  34841. var userCategories = isDiscrete && groupsData.argumentOptions && groupsData.argumentOptions.categories;
  34842. var sortFunction = function(data) {
  34843. return data
  34844. };
  34845. var sortingMethodOption = options.sortingMethod;
  34846. var reSortCategories;
  34847. if (!userCategories && _isFunction(sortingMethodOption)) {
  34848. data = sortByCallback(data, sortingMethodOption)
  34849. }
  34850. if (isDiscrete) {
  34851. groupsData.categories = getCategories(data, uniqueArgumentFields, userCategories)
  34852. }
  34853. if (userCategories || !_isFunction(sortingMethodOption) && groupsData.argumentType === STRING && !options._skipArgumentSorting) {
  34854. sortFunction = getSortByCategories(groupsData.categories)
  34855. } else {
  34856. if (true === sortingMethodOption && groupsData.argumentType !== STRING) {
  34857. sortFunction = sortByArgument;
  34858. reSortCategories = isDiscrete
  34859. }
  34860. }
  34861. uniqueArgumentFields.forEach(function(field) {
  34862. dataByArguments[field] = sortFunction(data, field)
  34863. });
  34864. if (reSortCategories) {
  34865. groupsData.categories = groupsData.categories.sort(sort)
  34866. }
  34867. return dataByArguments
  34868. }
  34869. function checkItemExistence(collection, item) {
  34870. return collection.map(function(collectionItem) {
  34871. return collectionItem.valueOf()
  34872. }).indexOf(item.valueOf()) === -1
  34873. }
  34874. function getCategories(data, uniqueArgumentFields, userCategories) {
  34875. var categories = userCategories ? userCategories.slice() : [];
  34876. uniqueArgumentFields.forEach(function(field) {
  34877. data.forEach(function(item) {
  34878. var dataItem = item[field];
  34879. _isDefined(dataItem) && checkItemExistence(categories, dataItem) && categories.push(dataItem)
  34880. })
  34881. });
  34882. return categories
  34883. }
  34884. function checkArgumentTypeOfGroup(series, cell, groupsData) {
  34885. series.forEach(function(currentSeries) {
  34886. groupsData.argumentType = getType(cell[currentSeries.getArgumentField()], groupsData.argumentType)
  34887. });
  34888. return groupsData.argumentType
  34889. }
  34890. function checkType(data, groupsData, checkTypeForAllData) {
  34891. var groupsWithUndefinedValueType = [];
  34892. var groupsWithUndefinedArgumentType = [];
  34893. var argumentTypeGroup = groupsData.argumentOptions && axisTypeParser(groupsData.argumentOptions.argumentType);
  34894. var groupsIndexes;
  34895. groupsData.groups.forEach(function(group) {
  34896. if (!group.series.length) {
  34897. return
  34898. }
  34899. var valueTypeGroup = group.valueOptions && axisTypeParser(group.valueOptions.valueType);
  34900. group.valueType = valueTypeGroup;
  34901. groupsData.argumentType = argumentTypeGroup;
  34902. !valueTypeGroup && groupsWithUndefinedValueType.push(group);
  34903. !argumentTypeGroup && groupsWithUndefinedArgumentType.push(group)
  34904. });
  34905. if (groupsWithUndefinedValueType.length || groupsWithUndefinedArgumentType.length) {
  34906. groupsIndexes = groupsWithUndefinedValueType.map(function(_, index) {
  34907. return index
  34908. });
  34909. data.some(function(cell) {
  34910. var defineArg;
  34911. groupsWithUndefinedValueType.forEach(function(group, groupIndex) {
  34912. if (checkValueTypeOfGroup(group, cell) && groupsIndexes.indexOf(groupIndex) >= 0) {
  34913. groupsIndexes.splice(groupIndex, 1)
  34914. }
  34915. });
  34916. if (!defineArg) {
  34917. groupsWithUndefinedArgumentType.forEach(function(group) {
  34918. defineArg = checkArgumentTypeOfGroup(group.series, cell, groupsData)
  34919. })
  34920. }
  34921. if (!checkTypeForAllData && defineArg && 0 === groupsIndexes.length) {
  34922. return true
  34923. }
  34924. })
  34925. }
  34926. }
  34927. function checkAxisType(groupsData, incidentOccurred) {
  34928. var argumentOptions = groupsData.argumentOptions || {};
  34929. var userArgumentCategories = argumentOptions && argumentOptions.categories || [];
  34930. var argumentAxisType = correctAxisType(groupsData.argumentType, argumentOptions.type, !!userArgumentCategories.length, incidentOccurred);
  34931. groupsData.groups.forEach(function(group) {
  34932. var valueOptions = group.valueOptions || {};
  34933. var valueCategories = valueOptions.categories || [];
  34934. var valueAxisType = correctAxisType(group.valueType, valueOptions.type, !!valueCategories.length, incidentOccurred);
  34935. group.series.forEach(function(series) {
  34936. var optionsSeries = {};
  34937. optionsSeries.argumentAxisType = argumentAxisType;
  34938. optionsSeries.valueAxisType = valueAxisType;
  34939. groupsData.argumentAxisType = groupsData.argumentAxisType || optionsSeries.argumentAxisType;
  34940. group.valueAxisType = group.valueAxisType || optionsSeries.valueAxisType;
  34941. optionsSeries.argumentType = groupsData.argumentType;
  34942. optionsSeries.valueType = group.valueType;
  34943. optionsSeries.showZero = valueOptions.showZero;
  34944. series.updateDataType(optionsSeries)
  34945. });
  34946. group.valueAxisType = group.valueAxisType || valueAxisType;
  34947. if (group.valueAxis) {
  34948. group.valueAxis.setTypes(group.valueAxisType, group.valueType, VALUE_TYPE);
  34949. group.valueAxis.validate()
  34950. }
  34951. });
  34952. groupsData.argumentAxisType = groupsData.argumentAxisType || argumentAxisType;
  34953. if (groupsData.argumentAxes) {
  34954. groupsData.argumentAxes.forEach(function(axis) {
  34955. axis.setTypes(groupsData.argumentAxisType, groupsData.argumentType, ARGUMENT_TYPE);
  34956. axis.validate()
  34957. })
  34958. }
  34959. }
  34960. function verifyData(source, incidentOccurred) {
  34961. var data = [];
  34962. var sourceIsDefined = _isDefined(source);
  34963. var hasError = sourceIsDefined && !_isArray(source);
  34964. var i;
  34965. var ii;
  34966. var k;
  34967. var item;
  34968. if (sourceIsDefined && !hasError) {
  34969. for (i = 0, ii = source.length, k = 0; i < ii; ++i) {
  34970. item = source[i];
  34971. if (_isObject(item)) {
  34972. data[k++] = item
  34973. } else {
  34974. if (item) {
  34975. hasError = true
  34976. }
  34977. }
  34978. }
  34979. }
  34980. if (hasError) {
  34981. incidentOccurred("E2001")
  34982. }
  34983. return data
  34984. }
  34985. function validateData(data, groupsData, incidentOccurred, options) {
  34986. data = verifyData(data, incidentOccurred);
  34987. groupsData.argumentType = groupsData.argumentAxisType = null;
  34988. processGroups(groupsData.groups);
  34989. resetArgumentAxes(groupsData.argumentAxes);
  34990. checkType(data, groupsData, options.checkTypeForAllData);
  34991. checkAxisType(groupsData, incidentOccurred);
  34992. if (options.convertToAxisDataType) {
  34993. data = parse(data, prepareParsers(groupsData, incidentOccurred))
  34994. }
  34995. groupPieData(data, groupsData);
  34996. var dataByArgumentFields = sortData(data, groupsData, options, getUniqueArgumentFields(groupsData));
  34997. return dataByArgumentFields
  34998. }
  34999. exports.validateData = validateData
  35000. },
  35001. /*!************************************************************!*\
  35002. !*** ./artifacts/transpiled/viz/components/parse_utils.js ***!
  35003. \************************************************************/
  35004. /*! dynamic exports provided */
  35005. /*! all exports used */
  35006. function(module, exports, __webpack_require__) {
  35007. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  35008. var dateSerialization = __webpack_require__( /*! ../../core/utils/date_serialization */ 52);
  35009. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  35010. var parsers = {
  35011. string: function(val) {
  35012. return isDefined(val) ? "" + val : val
  35013. },
  35014. numeric: function(val) {
  35015. if (!isDefined(val)) {
  35016. return val
  35017. }
  35018. var parsedVal = Number(val);
  35019. if (isNaN(parsedVal)) {
  35020. parsedVal = void 0
  35021. }
  35022. return parsedVal
  35023. },
  35024. datetime: function(val) {
  35025. if (!isDefined(val)) {
  35026. return val
  35027. }
  35028. var parsedVal;
  35029. var numVal = Number(val);
  35030. if (!isNaN(numVal)) {
  35031. parsedVal = new Date(numVal)
  35032. } else {
  35033. parsedVal = dateSerialization.deserializeDate(val)
  35034. }
  35035. if (isNaN(Number(parsedVal))) {
  35036. parsedVal = void 0
  35037. }
  35038. return parsedVal
  35039. }
  35040. };
  35041. function correctValueType(type) {
  35042. return "numeric" === type || "datetime" === type || "string" === type ? type : ""
  35043. }
  35044. module.exports = {
  35045. correctValueType: correctValueType,
  35046. getParser: function(valueType) {
  35047. return parsers[correctValueType(valueType)] || noop
  35048. }
  35049. };
  35050. module.exports.parsers = parsers
  35051. },
  35052. /*!********************************************************!*\
  35053. !*** ./artifacts/transpiled/viz/series/base_series.js ***!
  35054. \********************************************************/
  35055. /*! dynamic exports provided */
  35056. /*! all exports used */
  35057. function(module, exports, __webpack_require__) {
  35058. var seriesNS = {};
  35059. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  35060. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  35061. var _each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  35062. var pointModule = __webpack_require__( /*! ./points/base_point */ 767);
  35063. var _isDefined = typeUtils.isDefined;
  35064. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  35065. var _isEmptyObject = typeUtils.isEmptyObject;
  35066. var _normalizeEnum = vizUtils.normalizeEnum;
  35067. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  35068. var states = __webpack_require__( /*! ../components/consts */ 117).states;
  35069. var rangeCalculator = __webpack_require__( /*! ./helpers/range_data_calculator */ 247);
  35070. var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106);
  35071. var lineSeries = __webpack_require__( /*! ./line_series */ 203);
  35072. var areaSeries = __webpack_require__( /*! ./area_series */ 165);
  35073. var barSeries = __webpack_require__( /*! ./bar_series */ 143);
  35074. var rangeSeries = __webpack_require__( /*! ./range_series */ 772);
  35075. var bubbleSeries = __webpack_require__( /*! ./bubble_series */ 773);
  35076. var pieSeries = __webpack_require__( /*! ./pie_series */ 774);
  35077. var financialSeries = __webpack_require__( /*! ./financial_series */ 775);
  35078. var stackedSeries = __webpack_require__( /*! ./stacked_series */ 776);
  35079. var DISCRETE = "discrete";
  35080. var SELECTED_STATE = states.selectedMark;
  35081. var HOVER_STATE = states.hoverMark;
  35082. var HOVER = states.hover;
  35083. var NORMAL = states.normal;
  35084. var SELECTION = states.selection;
  35085. var APPLY_SELECTED = states.applySelected;
  35086. var APPLY_HOVER = states.applyHover;
  35087. var RESET_ITEM = states.resetItem;
  35088. var NONE_MODE = "none";
  35089. var INCLUDE_POINTS = "includepoints";
  35090. var NEAREST_POINT = "nearestpoint";
  35091. var SERIES_SELECTION_CHANGED = "seriesSelectionChanged";
  35092. var POINT_SELECTION_CHANGED = "pointSelectionChanged";
  35093. var SERIES_HOVER_CHANGED = "seriesHoverChanged";
  35094. var POINT_HOVER_CHANGED = "pointHoverChanged";
  35095. var ALL_SERIES_POINTS = "allseriespoints";
  35096. var ALL_ARGUMENT_POINTS = "allargumentpoints";
  35097. var POINT_HOVER = "pointHover";
  35098. var CLEAR_POINT_HOVER = "clearPointHover";
  35099. var SERIES_SELECT = "seriesSelect";
  35100. var POINT_SELECT = "pointSelect";
  35101. var POINT_DESELECT = "pointDeselect";
  35102. var getEmptyBusinessRange = function() {
  35103. return {
  35104. arg: {},
  35105. val: {}
  35106. }
  35107. };
  35108. function triggerEvent(element, event, point) {
  35109. element && element.trigger(event, point)
  35110. }
  35111. seriesNS.mixins = {
  35112. chart: {},
  35113. pie: {},
  35114. polar: {}
  35115. };
  35116. seriesNS.mixins.chart.scatter = scatterSeries.chart;
  35117. seriesNS.mixins.polar.scatter = scatterSeries.polar;
  35118. _extend(seriesNS.mixins.pie, pieSeries);
  35119. _extend(seriesNS.mixins.chart, lineSeries.chart, areaSeries.chart, barSeries.chart, rangeSeries.chart, bubbleSeries.chart, financialSeries, stackedSeries.chart);
  35120. _extend(seriesNS.mixins.polar, lineSeries.polar, areaSeries.polar, barSeries.polar, rangeSeries.polar, bubbleSeries.polar, stackedSeries.polar);
  35121. function includePointsMode(mode) {
  35122. mode = _normalizeEnum(mode);
  35123. return mode === INCLUDE_POINTS || mode === ALL_SERIES_POINTS
  35124. }
  35125. function getLabelOptions(labelOptions, defaultColor) {
  35126. var opt = labelOptions || {};
  35127. var labelFont = _extend({}, opt.font) || {};
  35128. var labelBorder = opt.border || {};
  35129. var labelConnector = opt.connector || {};
  35130. var backgroundAttr = {
  35131. fill: opt.backgroundColor || defaultColor,
  35132. "stroke-width": labelBorder.visible ? labelBorder.width || 0 : 0,
  35133. stroke: labelBorder.visible && labelBorder.width ? labelBorder.color : "none",
  35134. dashStyle: labelBorder.dashStyle
  35135. };
  35136. var connectorAttr = {
  35137. stroke: labelConnector.visible && labelConnector.width ? labelConnector.color || defaultColor : "none",
  35138. "stroke-width": labelConnector.visible ? labelConnector.width || 0 : 0
  35139. };
  35140. labelFont.color = "none" === opt.backgroundColor && "#ffffff" === _normalizeEnum(labelFont.color) && "inside" !== opt.position ? defaultColor : labelFont.color;
  35141. return {
  35142. alignment: opt.alignment,
  35143. format: opt.format,
  35144. argumentFormat: opt.argumentFormat,
  35145. customizeText: typeUtils.isFunction(opt.customizeText) ? opt.customizeText : void 0,
  35146. attributes: {
  35147. font: labelFont
  35148. },
  35149. visible: 0 !== labelFont.size ? opt.visible : false,
  35150. showForZeroValues: opt.showForZeroValues,
  35151. horizontalOffset: opt.horizontalOffset,
  35152. verticalOffset: opt.verticalOffset,
  35153. radialOffset: opt.radialOffset,
  35154. background: backgroundAttr,
  35155. position: opt.position,
  35156. connector: connectorAttr,
  35157. rotationAngle: opt.rotationAngle,
  35158. wordWrap: opt.wordWrap,
  35159. textOverflow: opt.textOverflow,
  35160. cssClass: opt.cssClass
  35161. }
  35162. }
  35163. function setPointHoverState(point, legendCallback) {
  35164. point.fullState |= HOVER_STATE;
  35165. point.applyView(legendCallback)
  35166. }
  35167. function releasePointHoverState(point, legendCallback) {
  35168. point.fullState &= ~HOVER_STATE;
  35169. point.applyView(legendCallback);
  35170. point.releaseHoverState()
  35171. }
  35172. function setPointSelectedState(point, legendCallback) {
  35173. point.fullState |= SELECTED_STATE;
  35174. point.applyView(legendCallback)
  35175. }
  35176. function releasePointSelectedState(point, legendCallback) {
  35177. point.fullState &= ~SELECTED_STATE;
  35178. point.applyView(legendCallback)
  35179. }
  35180. function mergePointOptionsCore(base, extra) {
  35181. var options = _extend({}, base, extra);
  35182. options.border = _extend({}, base && base.border, extra && extra.border);
  35183. return options
  35184. }
  35185. function mergePointOptions(base, extra) {
  35186. var options = mergePointOptionsCore(base, extra);
  35187. options.image = _extend(true, {}, base.image, extra.image);
  35188. options.selectionStyle = mergePointOptionsCore(base.selectionStyle, extra.selectionStyle);
  35189. options.hoverStyle = mergePointOptionsCore(base.hoverStyle, extra.hoverStyle);
  35190. return options
  35191. }
  35192. function Series(settings, options) {
  35193. var that = this;
  35194. that.fullState = 0;
  35195. that._extGroups = settings;
  35196. that._renderer = settings.renderer;
  35197. that._group = settings.renderer.g().attr({
  35198. "class": "dxc-series"
  35199. });
  35200. that._eventTrigger = settings.eventTrigger;
  35201. that._eventPipe = settings.eventPipe;
  35202. that._incidentOccurred = settings.incidentOccurred;
  35203. that._legendCallback = _noop;
  35204. that.updateOptions(options, settings)
  35205. }
  35206. function getData(pointData) {
  35207. return pointData.data
  35208. }
  35209. exports.Series = Series;
  35210. exports.mixins = seriesNS.mixins;
  35211. Series.prototype = {
  35212. constructor: Series,
  35213. _createLegendState: _noop,
  35214. getLegendStyles: function() {
  35215. return this._styles.legendStyles
  35216. },
  35217. _createStyles: function(options) {
  35218. var that = this;
  35219. var mainSeriesColor = options.mainSeriesColor;
  35220. that._styles = {
  35221. normal: that._parseStyle(options, mainSeriesColor, mainSeriesColor),
  35222. hover: that._parseStyle(options.hoverStyle || {}, mainSeriesColor, mainSeriesColor),
  35223. selection: that._parseStyle(options.selectionStyle || {}, mainSeriesColor, mainSeriesColor),
  35224. legendStyles: {
  35225. normal: that._createLegendState(options, mainSeriesColor),
  35226. hover: that._createLegendState(options.hoverStyle || {}, mainSeriesColor),
  35227. selection: that._createLegendState(options.selectionStyle || {}, mainSeriesColor)
  35228. }
  35229. }
  35230. },
  35231. setClippingParams: function(baseId, wideId, forceClipping) {
  35232. this._paneClipRectID = baseId;
  35233. this._widePaneClipRectID = wideId;
  35234. this._forceClipping = forceClipping
  35235. },
  35236. applyClip: function() {
  35237. this._group.attr({
  35238. "clip-path": this._paneClipRectID
  35239. })
  35240. },
  35241. resetClip: function() {
  35242. this._group.attr({
  35243. "clip-path": null
  35244. })
  35245. },
  35246. getTagField: function() {
  35247. return this._options.tagField || "tag"
  35248. },
  35249. getValueFields: _noop,
  35250. getSizeField: _noop,
  35251. getArgumentField: _noop,
  35252. getPoints: function() {
  35253. return this._points
  35254. },
  35255. getPointsInViewPort: function() {
  35256. return rangeCalculator.getPointsInViewPort(this)
  35257. },
  35258. _createPoint: function(data, index, oldPoint) {
  35259. data.index = index;
  35260. var that = this;
  35261. var pointsByArgument = that.pointsByArgument;
  35262. var options = that._getCreatingPointOptions(data);
  35263. var arg = data.argument.valueOf();
  35264. var point = oldPoint;
  35265. if (point) {
  35266. point.update(data, options)
  35267. } else {
  35268. point = new pointModule.Point(that, data, options);
  35269. if (that.isSelected() && includePointsMode(that.lastSelectionMode)) {
  35270. point.setView(SELECTION)
  35271. }
  35272. }
  35273. var pointByArgument = pointsByArgument[arg];
  35274. if (pointByArgument) {
  35275. pointByArgument.push(point)
  35276. } else {
  35277. pointsByArgument[arg] = [point]
  35278. }
  35279. if (point.hasValue()) {
  35280. that.customizePoint(point, data)
  35281. }
  35282. return point
  35283. },
  35284. getRangeData: function() {
  35285. return this._visible ? this._getRangeData() : getEmptyBusinessRange()
  35286. },
  35287. getArgumentRange: function() {
  35288. return this._visible ? rangeCalculator.getArgumentRange(this) : getEmptyBusinessRange()
  35289. },
  35290. getViewport: function() {
  35291. return rangeCalculator.getViewport(this)
  35292. },
  35293. _deleteGroup: function(groupName) {
  35294. var group = this[groupName];
  35295. if (group) {
  35296. group.dispose();
  35297. this[groupName] = null
  35298. }
  35299. },
  35300. updateOptions: function(newOptions, settings) {
  35301. var that = this;
  35302. var widgetType = newOptions.widgetType;
  35303. var oldType = that.type;
  35304. var newType = newOptions.type;
  35305. that.type = newType && _normalizeEnum(newType.toString());
  35306. if (!that._checkType(widgetType) || that._checkPolarBarType(widgetType, newOptions)) {
  35307. that.dispose();
  35308. that.isUpdated = false;
  35309. return
  35310. }
  35311. if (oldType !== that.type) {
  35312. that._firstDrawing = true;
  35313. that._resetType(oldType, widgetType);
  35314. that._setType(that.type, widgetType)
  35315. } else {
  35316. that._defineDrawingState()
  35317. }
  35318. that._options = newOptions;
  35319. that._pointOptions = null;
  35320. that.name = newOptions.name;
  35321. that.pane = newOptions.pane;
  35322. that.tag = newOptions.tag;
  35323. if (settings) {
  35324. that._seriesModes = settings.commonSeriesModes || that._seriesModes;
  35325. that._valueAxis = settings.valueAxis || that._valueAxis;
  35326. that.axis = that._valueAxis && that._valueAxis.name;
  35327. that._argumentAxis = settings.argumentAxis || that._argumentAxis
  35328. }
  35329. that._createStyles(newOptions);
  35330. that._stackName = null;
  35331. that._updateOptions(newOptions);
  35332. that._visible = newOptions.visible;
  35333. that.isUpdated = true;
  35334. that.stack = newOptions.stack;
  35335. that.barOverlapGroup = newOptions.barOverlapGroup;
  35336. that._createGroups();
  35337. that._processEmptyValue = newOptions.ignoreEmptyPoints ? function(x) {
  35338. return null === x ? void 0 : x
  35339. } : function(x) {
  35340. return x
  35341. }
  35342. },
  35343. _defineDrawingState: function() {
  35344. this._firstDrawing = true
  35345. },
  35346. _disposePoints: function(points) {
  35347. _each(points || [], function(_, p) {
  35348. p.dispose()
  35349. })
  35350. },
  35351. updateDataType: function(settings) {
  35352. var that = this;
  35353. that.argumentType = settings.argumentType;
  35354. that.valueType = settings.valueType;
  35355. that.argumentAxisType = settings.argumentAxisType;
  35356. that.valueAxisType = settings.valueAxisType;
  35357. that.showZero = settings.showZero;
  35358. return that
  35359. },
  35360. getOptions: function() {
  35361. return this._options
  35362. },
  35363. _getOldPoint: function(data, oldPointsByArgument, index) {
  35364. var arg = data.argument && data.argument.valueOf();
  35365. var point = (oldPointsByArgument[arg] || [])[0];
  35366. if (point) {
  35367. oldPointsByArgument[arg].splice(0, 1)
  35368. }
  35369. return point
  35370. },
  35371. updateData: function(data) {
  35372. var that = this;
  35373. var options = that._options;
  35374. var nameField = options.nameField;
  35375. data = data || [];
  35376. if (data.length) {
  35377. that._canRenderCompleteHandle = true
  35378. }
  35379. var dataSelector = this._getPointDataSelector();
  35380. var itemsWithoutArgument = 0;
  35381. that._data = data.reduce(function(data, dataItem, index) {
  35382. var pointDataItem = dataSelector(dataItem);
  35383. if (_isDefined(pointDataItem.argument)) {
  35384. if (!nameField || dataItem[nameField] === options.nameFieldValue) {
  35385. pointDataItem.index = index;
  35386. data.push(pointDataItem)
  35387. }
  35388. } else {
  35389. itemsWithoutArgument++
  35390. }
  35391. return data
  35392. }, []);
  35393. if (itemsWithoutArgument && itemsWithoutArgument === data.length) {
  35394. that._incidentOccurred("W2002", [that.name, that.getArgumentField()])
  35395. }
  35396. that._endUpdateData()
  35397. },
  35398. _getData: function() {
  35399. var data = this._data || [];
  35400. if (this.useAggregation()) {
  35401. data = this._resample(this.getArgumentAxis().getAggregationInfo(this._useAllAggregatedPoints, this.argumentAxisType !== DISCRETE ? this.getArgumentRange() : {}), data)
  35402. }
  35403. return data
  35404. },
  35405. useAggregation: function() {
  35406. var aggregation = this.getOptions().aggregation;
  35407. return aggregation && aggregation.enabled
  35408. },
  35409. autoHidePointMarkersEnabled: _noop,
  35410. usePointsToDefineAutoHiding: _noop,
  35411. createPoints: function(useAllAggregatedPoints) {
  35412. this._normalizeUsingAllAggregatedPoints(useAllAggregatedPoints);
  35413. this._createPoints()
  35414. },
  35415. _normalizeUsingAllAggregatedPoints: function(useAllAggregatedPoints) {
  35416. this._useAllAggregatedPoints = this.useAggregation() && (this.argumentAxisType === DISCRETE || (this._data || []).length > 1 && !!useAllAggregatedPoints)
  35417. },
  35418. _createPoints: function() {
  35419. var that = this;
  35420. var oldPointsByArgument = that.pointsByArgument || {};
  35421. var data = that._getData();
  35422. that.pointsByArgument = {};
  35423. that._calculateErrorBars(data);
  35424. var skippedFields = {};
  35425. var points = data.reduce(function(points, pointDataItem) {
  35426. if (that._checkData(pointDataItem, skippedFields)) {
  35427. var pointIndex = points.length;
  35428. var oldPoint = that._getOldPoint(pointDataItem, oldPointsByArgument, pointIndex);
  35429. var point = that._createPoint(pointDataItem, pointIndex, oldPoint);
  35430. points.push(point)
  35431. }
  35432. return points
  35433. }, []);
  35434. for (var field in skippedFields) {
  35435. if (skippedFields[field] === data.length) {
  35436. that._incidentOccurred("W2002", [that.name, field])
  35437. }
  35438. }
  35439. Object.keys(oldPointsByArgument).forEach(function(key) {
  35440. return that._disposePoints(oldPointsByArgument[key])
  35441. });
  35442. that._points = points
  35443. },
  35444. _removeOldSegments: function() {
  35445. var that = this;
  35446. var startIndex = that._segments.length;
  35447. _each(that._graphics.splice(startIndex, that._graphics.length) || [], function(_, elem) {
  35448. that._removeElement(elem)
  35449. });
  35450. if (that._trackers) {
  35451. _each(that._trackers.splice(startIndex, that._trackers.length) || [], function(_, elem) {
  35452. elem.remove()
  35453. })
  35454. }
  35455. },
  35456. _drawElements: function(animationEnabled, firstDrawing, translateAllPoints) {
  35457. var that = this;
  35458. var points = that._points || [];
  35459. var closeSegment = points[0] && points[0].hasValue() && that._options.closed;
  35460. var groupForPoint = {
  35461. markers: that._markersGroup,
  35462. errorBars: that._errorBarGroup
  35463. };
  35464. that._drawnPoints = [];
  35465. that._graphics = that._graphics || [];
  35466. that._segments = [];
  35467. var segments = points.reduce(function(segments, p) {
  35468. var segment = segments[segments.length - 1];
  35469. if (!p.translated || translateAllPoints) {
  35470. p.translate();
  35471. !translateAllPoints && p.setDefaultCoords()
  35472. }
  35473. if (p.hasValue() && p.hasCoords()) {
  35474. translateAllPoints && that._drawPoint({
  35475. point: p,
  35476. groups: groupForPoint,
  35477. hasAnimation: animationEnabled,
  35478. firstDrawing: firstDrawing
  35479. });
  35480. segment.push(p)
  35481. } else {
  35482. if (!p.hasValue()) {
  35483. segment.length && segments.push([])
  35484. } else {
  35485. p.setInvisibility()
  35486. }
  35487. }
  35488. return segments
  35489. }, [
  35490. []
  35491. ]);
  35492. segments.forEach(function(segment, index) {
  35493. if (segment.length) {
  35494. that._drawSegment(segment, animationEnabled, index, closeSegment && index === this.length - 1)
  35495. }
  35496. }, segments);
  35497. that._firstDrawing = points.length ? false : true;
  35498. that._removeOldSegments();
  35499. animationEnabled && that._animate(firstDrawing)
  35500. },
  35501. draw: function(animationEnabled, hideLayoutLabels, legendCallback) {
  35502. var that = this;
  35503. var firstDrawing = that._firstDrawing;
  35504. that._legendCallback = legendCallback || that._legendCallback;
  35505. if (!that._visible) {
  35506. animationEnabled = false;
  35507. that._group.remove();
  35508. return
  35509. }
  35510. that._appendInGroup();
  35511. that._applyVisibleArea();
  35512. that._setGroupsSettings(animationEnabled, firstDrawing);
  35513. !firstDrawing && that._drawElements(false, firstDrawing, false);
  35514. that._drawElements(animationEnabled, firstDrawing, true);
  35515. hideLayoutLabels && that.hideLabels();
  35516. if (that.isSelected()) {
  35517. that._changeStyle(that.lastSelectionMode, void 0, true)
  35518. } else {
  35519. if (that.isHovered()) {
  35520. that._changeStyle(that.lastHoverMode, void 0, true)
  35521. }
  35522. }
  35523. },
  35524. _setLabelGroupSettings: function(animationEnabled) {
  35525. var settings = {
  35526. "class": "dxc-labels",
  35527. "pointer-events": "none"
  35528. };
  35529. this._applyElementsClipRect(settings);
  35530. this._applyClearingSettings(settings);
  35531. animationEnabled && (settings.opacity = .001);
  35532. this._labelsGroup.attr(settings).append(this._extGroups.labelsGroup)
  35533. },
  35534. _checkType: function(widgetType) {
  35535. return !!seriesNS.mixins[widgetType][this.type]
  35536. },
  35537. _checkPolarBarType: function(widgetType, options) {
  35538. return "polar" === widgetType && options.spiderWidget && this.type.indexOf("bar") !== -1
  35539. },
  35540. _resetType: function(seriesType, widgetType) {
  35541. var methodName;
  35542. var methods;
  35543. if (seriesType) {
  35544. methods = seriesNS.mixins[widgetType][seriesType];
  35545. for (methodName in methods) {
  35546. delete this[methodName]
  35547. }
  35548. }
  35549. },
  35550. _setType: function(seriesType, widgetType) {
  35551. var methodName;
  35552. var methods = seriesNS.mixins[widgetType][seriesType];
  35553. for (methodName in methods) {
  35554. this[methodName] = methods[methodName]
  35555. }
  35556. },
  35557. _setPointsView: function(view, target) {
  35558. this.getPoints().forEach(function(point) {
  35559. if (target !== point) {
  35560. point.setView(view)
  35561. }
  35562. })
  35563. },
  35564. _resetPointsView: function(view, target) {
  35565. this.getPoints().forEach(function(point) {
  35566. if (target !== point) {
  35567. point.resetView(view)
  35568. }
  35569. })
  35570. },
  35571. _resetNearestPoint: function() {
  35572. var that = this;
  35573. that._nearestPoint && null !== that._nearestPoint.series && that._nearestPoint.resetView(HOVER);
  35574. that._nearestPoint = null
  35575. },
  35576. _setSelectedState: function(mode) {
  35577. var that = this;
  35578. that.lastSelectionMode = _normalizeEnum(mode || that._options.selectionMode);
  35579. that.fullState = that.fullState | SELECTED_STATE;
  35580. that._resetNearestPoint();
  35581. that._changeStyle(that.lastSelectionMode);
  35582. if (that.lastSelectionMode !== NONE_MODE && that.isHovered() && includePointsMode(that.lastHoverMode)) {
  35583. that._resetPointsView(HOVER)
  35584. }
  35585. },
  35586. _releaseSelectedState: function() {
  35587. var that = this;
  35588. that.fullState = that.fullState & ~SELECTED_STATE;
  35589. that._changeStyle(that.lastSelectionMode, SELECTION);
  35590. if (that.lastSelectionMode !== NONE_MODE && that.isHovered() && includePointsMode(that.lastHoverMode)) {
  35591. that._setPointsView(HOVER)
  35592. }
  35593. },
  35594. isFullStackedSeries: function() {
  35595. return 0 === this.type.indexOf("fullstacked")
  35596. },
  35597. isStackedSeries: function() {
  35598. return 0 === this.type.indexOf("stacked")
  35599. },
  35600. isFinancialSeries: function() {
  35601. return "stock" === this.type || "candlestick" === this.type
  35602. },
  35603. _canChangeView: function() {
  35604. return !this.isSelected() && _normalizeEnum(this._options.hoverMode) !== NONE_MODE
  35605. },
  35606. _changeStyle: function(mode, resetView, skipPoints) {
  35607. var that = this;
  35608. var state = that.fullState;
  35609. var styles = [NORMAL, HOVER, SELECTION, SELECTION];
  35610. if ("none" === that.lastHoverMode) {
  35611. state &= ~HOVER_STATE
  35612. }
  35613. if ("none" === that.lastSelectionMode) {
  35614. state &= ~SELECTED_STATE
  35615. }
  35616. if (includePointsMode(mode) && !skipPoints) {
  35617. if (!resetView) {
  35618. that._setPointsView(styles[state])
  35619. } else {
  35620. that._resetPointsView(resetView)
  35621. }
  35622. }
  35623. that._legendCallback([RESET_ITEM, APPLY_HOVER, APPLY_SELECTED, APPLY_SELECTED][state]);
  35624. that._applyStyle(that._styles[styles[state]])
  35625. },
  35626. updateHover: function(x, y) {
  35627. var that = this;
  35628. var currentNearestPoint = that._nearestPoint;
  35629. var point = that.isHovered() && that.lastHoverMode === NEAREST_POINT && that.getNeighborPoint(x, y);
  35630. if (point !== currentNearestPoint && !(that.isSelected() && that.lastSelectionMode !== NONE_MODE)) {
  35631. that._resetNearestPoint();
  35632. if (point) {
  35633. point.setView(HOVER);
  35634. that._nearestPoint = point
  35635. }
  35636. }
  35637. },
  35638. _getMainAxisName: function() {
  35639. return this._options.rotated ? "X" : "Y"
  35640. },
  35641. areLabelsVisible: function() {
  35642. return !_isDefined(this._options.maxLabelCount) || this._points.length <= this._options.maxLabelCount
  35643. },
  35644. getLabelVisibility: function() {
  35645. return this.areLabelsVisible() && this._options.label && this._options.label.visible
  35646. },
  35647. customizePoint: function customizePoint(point, pointData) {
  35648. var that = this;
  35649. var options = that._options;
  35650. var customizePoint = options.customizePoint;
  35651. var customizeObject;
  35652. var pointOptions;
  35653. var customLabelOptions;
  35654. var customOptions;
  35655. var customizeLabel = options.customizeLabel;
  35656. var useLabelCustomOptions;
  35657. var usePointCustomOptions;
  35658. if (customizeLabel && customizeLabel.call) {
  35659. customizeObject = _extend({
  35660. seriesName: that.name
  35661. }, pointData);
  35662. customizeObject.series = that;
  35663. customLabelOptions = customizeLabel.call(customizeObject, customizeObject);
  35664. useLabelCustomOptions = customLabelOptions && !_isEmptyObject(customLabelOptions);
  35665. customLabelOptions = useLabelCustomOptions ? _extend(true, {}, options.label, customLabelOptions) : null
  35666. }
  35667. if (customizePoint && customizePoint.call) {
  35668. customizeObject = customizeObject || _extend({
  35669. seriesName: that.name
  35670. }, pointData);
  35671. customizeObject.series = that;
  35672. customOptions = customizePoint.call(customizeObject, customizeObject);
  35673. usePointCustomOptions = customOptions && !_isEmptyObject(customOptions)
  35674. }
  35675. if (useLabelCustomOptions || usePointCustomOptions) {
  35676. pointOptions = that._parsePointOptions(that._preparePointOptions(customOptions), customLabelOptions || options.label, pointData, point);
  35677. pointOptions.styles.useLabelCustomOptions = useLabelCustomOptions;
  35678. pointOptions.styles.usePointCustomOptions = usePointCustomOptions;
  35679. point.updateOptions(pointOptions)
  35680. }
  35681. },
  35682. show: function() {
  35683. if (!this._visible) {
  35684. this._changeVisibility(true)
  35685. }
  35686. },
  35687. hide: function() {
  35688. if (this._visible) {
  35689. this._changeVisibility(false)
  35690. }
  35691. },
  35692. _changeVisibility: function(visibility) {
  35693. var that = this;
  35694. that._visible = that._options.visible = visibility;
  35695. that._updatePointsVisibility();
  35696. that.hidePointTooltip();
  35697. that._options.visibilityChanged(that)
  35698. },
  35699. _updatePointsVisibility: _noop,
  35700. hideLabels: function() {
  35701. _each(this._points, function(_, point) {
  35702. point._label.draw(false)
  35703. })
  35704. },
  35705. _parsePointOptions: function(pointOptions, labelOptions, data, point) {
  35706. var that = this;
  35707. var options = that._options;
  35708. var styles = that._createPointStyles(pointOptions, data, point);
  35709. var parsedOptions = _extend({}, pointOptions, {
  35710. type: options.type,
  35711. rotated: options.rotated,
  35712. styles: styles,
  35713. widgetType: options.widgetType,
  35714. visibilityChanged: options.visibilityChanged
  35715. });
  35716. parsedOptions.label = getLabelOptions(labelOptions, styles.normal.fill);
  35717. if (that.areErrorBarsVisible()) {
  35718. parsedOptions.errorBars = options.valueErrorBar
  35719. }
  35720. return parsedOptions
  35721. },
  35722. _preparePointOptions: function(customOptions) {
  35723. var pointOptions = this._getOptionsForPoint();
  35724. return customOptions ? mergePointOptions(pointOptions, customOptions) : pointOptions
  35725. },
  35726. _getMarkerGroupOptions: function() {
  35727. return _extend(false, {}, this._getOptionsForPoint(), {
  35728. hoverStyle: {},
  35729. selectionStyle: {}
  35730. })
  35731. },
  35732. _getAggregationMethod: function(isDiscrete) {
  35733. var options = this.getOptions().aggregation;
  35734. var method = _normalizeEnum(options.method);
  35735. var customAggregator = "custom" === method && options.calculate;
  35736. var aggregator;
  35737. if (isDiscrete) {
  35738. aggregator = function(_ref) {
  35739. var data = _ref.data;
  35740. return data[0]
  35741. }
  35742. } else {
  35743. aggregator = this._aggregators[method] || this._aggregators[this._defaultAggregator]
  35744. }
  35745. return customAggregator || aggregator
  35746. },
  35747. _resample: function(_ref2, data) {
  35748. var interval = _ref2.interval,
  35749. ticks = _ref2.ticks;
  35750. var that = this;
  35751. var isDiscrete = that.argumentAxisType === DISCRETE || that.valueAxisType === DISCRETE;
  35752. var dataIndex = 0;
  35753. var dataSelector = this._getPointDataSelector();
  35754. var options = that.getOptions();
  35755. var addAggregatedData = function(target, data, aggregationInfo) {
  35756. if (!data) {
  35757. return
  35758. }
  35759. var processData = function(d) {
  35760. var pointData = d && dataSelector(d, options);
  35761. if (pointData && that._checkData(pointData)) {
  35762. pointData.aggregationInfo = aggregationInfo;
  35763. target.push(pointData)
  35764. }
  35765. };
  35766. if (data.length) {
  35767. data.forEach(processData)
  35768. } else {
  35769. processData(data)
  35770. }
  35771. };
  35772. var aggregationMethod = this._getAggregationMethod(isDiscrete);
  35773. if (isDiscrete) {
  35774. return data.reduce(function(result, dataItem, index, data) {
  35775. result[1].push(dataItem);
  35776. if (index === data.length - 1 || (index + 1) % interval === 0) {
  35777. var dataInInterval = result[1];
  35778. var aggregationInfo = {
  35779. aggregationInterval: interval,
  35780. data: dataInInterval.map(getData)
  35781. };
  35782. addAggregatedData(result[0], aggregationMethod(aggregationInfo, that));
  35783. result[1] = []
  35784. }
  35785. return result
  35786. }, [
  35787. [],
  35788. []
  35789. ])[0]
  35790. }
  35791. var aggregatedData = [];
  35792. for (var i = 1; i < ticks.length; i++) {
  35793. var intervalEnd = ticks[i];
  35794. var intervalStart = ticks[i - 1];
  35795. var dataInInterval = [];
  35796. while (data[dataIndex] && data[dataIndex].argument < intervalEnd) {
  35797. if (data[dataIndex].argument >= intervalStart) {
  35798. dataInInterval.push(data[dataIndex])
  35799. }
  35800. dataIndex++
  35801. }
  35802. var aggregationInfo = {
  35803. intervalStart: intervalStart,
  35804. intervalEnd: intervalEnd,
  35805. aggregationInterval: interval,
  35806. data: dataInInterval.map(getData)
  35807. };
  35808. addAggregatedData(aggregatedData, aggregationMethod(aggregationInfo, that), aggregationInfo)
  35809. }
  35810. that._endUpdateData();
  35811. return aggregatedData
  35812. },
  35813. canRenderCompleteHandle: function() {
  35814. var result = this._canRenderCompleteHandle;
  35815. delete this._canRenderCompleteHandle;
  35816. return !!result
  35817. },
  35818. isHovered: function() {
  35819. return !!(1 & this.fullState)
  35820. },
  35821. isSelected: function() {
  35822. return !!(2 & this.fullState)
  35823. },
  35824. isVisible: function() {
  35825. return this._visible
  35826. },
  35827. getAllPoints: function() {
  35828. this._createAllAggregatedPoints();
  35829. return (this._points || []).slice()
  35830. },
  35831. getPointByPos: function(pos) {
  35832. this._createAllAggregatedPoints();
  35833. return (this._points || [])[pos]
  35834. },
  35835. getVisiblePoints: function() {
  35836. return (this._drawnPoints || []).slice()
  35837. },
  35838. selectPoint: function(point) {
  35839. if (!point.isSelected()) {
  35840. setPointSelectedState(point, this._legendCallback);
  35841. this._eventPipe({
  35842. action: POINT_SELECT,
  35843. target: point
  35844. });
  35845. this._eventTrigger(POINT_SELECTION_CHANGED, {
  35846. target: point
  35847. })
  35848. }
  35849. },
  35850. deselectPoint: function(point) {
  35851. if (point.isSelected()) {
  35852. releasePointSelectedState(point, this._legendCallback);
  35853. this._eventPipe({
  35854. action: POINT_DESELECT,
  35855. target: point
  35856. });
  35857. this._eventTrigger(POINT_SELECTION_CHANGED, {
  35858. target: point
  35859. })
  35860. }
  35861. },
  35862. hover: function(mode) {
  35863. var that = this;
  35864. var eventTrigger = that._eventTrigger;
  35865. if (that.isHovered()) {
  35866. return
  35867. }
  35868. that.lastHoverMode = _normalizeEnum(mode || that._options.hoverMode);
  35869. that.fullState = that.fullState | HOVER_STATE;
  35870. that._changeStyle(that.lastHoverMode, void 0, that.isSelected() && that.lastSelectionMode !== NONE_MODE);
  35871. eventTrigger(SERIES_HOVER_CHANGED, {
  35872. target: that
  35873. })
  35874. },
  35875. clearHover: function() {
  35876. var that = this;
  35877. var eventTrigger = that._eventTrigger;
  35878. if (!that.isHovered()) {
  35879. return
  35880. }
  35881. that._resetNearestPoint();
  35882. that.fullState = that.fullState & ~HOVER_STATE;
  35883. that._changeStyle(that.lastHoverMode, HOVER, that.isSelected() && that.lastSelectionMode !== NONE_MODE);
  35884. eventTrigger(SERIES_HOVER_CHANGED, {
  35885. target: that
  35886. })
  35887. },
  35888. hoverPoint: function(point) {
  35889. var that = this;
  35890. if (!point.isHovered()) {
  35891. point.clearHover();
  35892. setPointHoverState(point, that._legendCallback);
  35893. that._canChangeView() && that._applyStyle(that._styles.hover);
  35894. that._eventPipe({
  35895. action: POINT_HOVER,
  35896. target: point
  35897. });
  35898. that._eventTrigger(POINT_HOVER_CHANGED, {
  35899. target: point
  35900. })
  35901. }
  35902. },
  35903. clearPointHover: function() {
  35904. var that = this;
  35905. that.getPoints().some(function(currentPoint) {
  35906. if (currentPoint.isHovered()) {
  35907. releasePointHoverState(currentPoint, that._legendCallback);
  35908. that._canChangeView() && that._applyStyle(that._styles.normal);
  35909. that._eventPipe({
  35910. action: CLEAR_POINT_HOVER,
  35911. target: currentPoint
  35912. });
  35913. that._eventTrigger(POINT_HOVER_CHANGED, {
  35914. target: currentPoint
  35915. });
  35916. return true
  35917. }
  35918. return false
  35919. })
  35920. },
  35921. showPointTooltip: function(point) {
  35922. triggerEvent(this._extGroups.seriesGroup, "showpointtooltip", point)
  35923. },
  35924. hidePointTooltip: function(point) {
  35925. triggerEvent(this._extGroups.seriesGroup, "hidepointtooltip", point)
  35926. },
  35927. select: function() {
  35928. var that = this;
  35929. if (!that.isSelected()) {
  35930. that._setSelectedState(that._options.selectionMode);
  35931. that._eventPipe({
  35932. action: SERIES_SELECT,
  35933. target: that
  35934. });
  35935. that._group.toForeground();
  35936. that._eventTrigger(SERIES_SELECTION_CHANGED, {
  35937. target: that
  35938. })
  35939. }
  35940. },
  35941. clearSelection: function() {
  35942. var that = this;
  35943. if (that.isSelected()) {
  35944. that._releaseSelectedState();
  35945. that._eventTrigger(SERIES_SELECTION_CHANGED, {
  35946. target: that
  35947. })
  35948. }
  35949. },
  35950. getPointsByArg: function(arg, skipPointsCreation) {
  35951. var that = this;
  35952. var argValue = arg.valueOf();
  35953. var points = that.pointsByArgument[argValue];
  35954. if (!points && !skipPointsCreation && that._createAllAggregatedPoints()) {
  35955. points = that.pointsByArgument[argValue]
  35956. }
  35957. return points || []
  35958. },
  35959. _createAllAggregatedPoints: function() {
  35960. if (this.useAggregation() && !this._useAllAggregatedPoints) {
  35961. this.createPoints(true);
  35962. return true
  35963. }
  35964. return false
  35965. },
  35966. getPointsByKeys: function(arg) {
  35967. return this.getPointsByArg(arg)
  35968. },
  35969. notify: function(data) {
  35970. var that = this;
  35971. var action = data.action;
  35972. var seriesModes = that._seriesModes;
  35973. var target = data.target;
  35974. var targetOptions = target.getOptions();
  35975. var pointHoverMode = _normalizeEnum(targetOptions.hoverMode);
  35976. var selectionModeOfPoint = _normalizeEnum(targetOptions.selectionMode);
  35977. if (action === POINT_HOVER) {
  35978. that._hoverPointHandler(target, pointHoverMode, data.notifyLegend)
  35979. } else {
  35980. if (action === CLEAR_POINT_HOVER) {
  35981. that._clearPointHoverHandler(target, pointHoverMode, data.notifyLegend)
  35982. } else {
  35983. if (action === SERIES_SELECT) {
  35984. target !== that && "single" === seriesModes.seriesSelectionMode && that.clearSelection()
  35985. } else {
  35986. if (action === POINT_SELECT) {
  35987. if ("single" === seriesModes.pointSelectionMode) {
  35988. that.getPoints().some(function(currentPoint) {
  35989. if (currentPoint !== target && currentPoint.isSelected()) {
  35990. that.deselectPoint(currentPoint);
  35991. return true
  35992. }
  35993. return false
  35994. })
  35995. }
  35996. that._selectPointHandler(target, selectionModeOfPoint)
  35997. } else {
  35998. if (action === POINT_DESELECT) {
  35999. that._deselectPointHandler(target, selectionModeOfPoint)
  36000. }
  36001. }
  36002. }
  36003. }
  36004. }
  36005. },
  36006. _selectPointHandler: function(target, mode) {
  36007. var that = this;
  36008. if (mode === ALL_SERIES_POINTS) {
  36009. target.series === that && that._setPointsView(SELECTION, target)
  36010. } else {
  36011. if (mode === ALL_ARGUMENT_POINTS) {
  36012. that.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) {
  36013. currentPoint !== target && currentPoint.setView(SELECTION)
  36014. })
  36015. }
  36016. }
  36017. },
  36018. _deselectPointHandler: function(target, mode) {
  36019. if (mode === ALL_SERIES_POINTS) {
  36020. target.series === this && this._resetPointsView(SELECTION, target)
  36021. } else {
  36022. if (mode === ALL_ARGUMENT_POINTS) {
  36023. this.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) {
  36024. currentPoint !== target && currentPoint.resetView(SELECTION)
  36025. })
  36026. }
  36027. }
  36028. },
  36029. _hoverPointHandler: function(target, mode, notifyLegend) {
  36030. var that = this;
  36031. if (target.series !== that && mode === ALL_ARGUMENT_POINTS) {
  36032. that.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) {
  36033. currentPoint.setView(HOVER)
  36034. });
  36035. notifyLegend && that._legendCallback(target)
  36036. } else {
  36037. if (mode === ALL_SERIES_POINTS && target.series === that) {
  36038. that._setPointsView(HOVER, target)
  36039. }
  36040. }
  36041. },
  36042. _clearPointHoverHandler: function(target, mode, notifyLegend) {
  36043. var that = this;
  36044. if (mode === ALL_ARGUMENT_POINTS) {
  36045. target.series !== that && that.getPointsByKeys(target.argument, target.argumentIndex).forEach(function(currentPoint) {
  36046. currentPoint.resetView(HOVER)
  36047. });
  36048. notifyLegend && that._legendCallback(target)
  36049. } else {
  36050. if (mode === ALL_SERIES_POINTS && target.series === that) {
  36051. that._resetPointsView(HOVER, target)
  36052. }
  36053. }
  36054. },
  36055. _deletePoints: function() {
  36056. var that = this;
  36057. that._disposePoints(that._points);
  36058. that._points = that._drawnPoints = null
  36059. },
  36060. _deleteTrackers: function() {
  36061. var that = this;
  36062. _each(that._trackers || [], function(_, tracker) {
  36063. tracker.remove()
  36064. });
  36065. that._trackersGroup && that._trackersGroup.dispose();
  36066. that._trackers = that._trackersGroup = null
  36067. },
  36068. dispose: function() {
  36069. var that = this;
  36070. that._deletePoints();
  36071. that._group.dispose();
  36072. that._labelsGroup && that._labelsGroup.dispose();
  36073. that._errorBarGroup && that._errorBarGroup.dispose();
  36074. that._deleteTrackers();
  36075. that._group = that._extGroups = that._markersGroup = that._elementsGroup = that._bordersGroup = that._labelsGroup = that._errorBarGroup = that._graphics = that._rangeData = that._renderer = that._styles = that._options = that._pointOptions = that._drawnPoints = that.pointsByArgument = that._segments = that._prevSeries = null
  36076. },
  36077. correctPosition: _noop,
  36078. drawTrackers: _noop,
  36079. getNeighborPoint: _noop,
  36080. areErrorBarsVisible: _noop,
  36081. getMarginOptions: function() {
  36082. return this._patchMarginOptions({
  36083. percentStick: this.isFullStackedSeries()
  36084. })
  36085. },
  36086. getColor: function() {
  36087. return this.getLegendStyles().normal.fill
  36088. },
  36089. getOpacity: function() {
  36090. return this._options.opacity
  36091. },
  36092. getStackName: function() {
  36093. return this._stackName
  36094. },
  36095. getBarOverlapGroup: function() {
  36096. return this._options.barOverlapGroup
  36097. },
  36098. getPointByCoord: function(x, y) {
  36099. var point = this.getNeighborPoint(x, y);
  36100. return point && point.coordsIn(x, y) ? point : null
  36101. },
  36102. getValueAxis: function() {
  36103. return this._valueAxis
  36104. },
  36105. getArgumentAxis: function() {
  36106. return this._argumentAxis
  36107. },
  36108. getMarkersGroup: function() {
  36109. return this._markersGroup
  36110. },
  36111. getRenderer: function() {
  36112. return this._renderer
  36113. }
  36114. }
  36115. },
  36116. /*!*********************************************************!*\
  36117. !*** ./artifacts/transpiled/viz/series/points/label.js ***!
  36118. \*********************************************************/
  36119. /*! dynamic exports provided */
  36120. /*! all exports used */
  36121. function(module, exports, __webpack_require__) {
  36122. var _format_helper = __webpack_require__( /*! ../../../format_helper */ 64);
  36123. var _utils = __webpack_require__( /*! ../../core/utils */ 10);
  36124. var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 3);
  36125. var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 0);
  36126. var _math = Math;
  36127. var _round = _math.round;
  36128. var _floor = _math.floor;
  36129. var _abs = _math.abs;
  36130. var CONNECTOR_LENGTH = 12;
  36131. var LABEL_BACKGROUND_PADDING_X = 8;
  36132. var LABEL_BACKGROUND_PADDING_Y = 4;
  36133. function getClosestCoord(point, coords) {
  36134. var closestDistance = 1 / 0;
  36135. var closestCoord;
  36136. (0, _iterator.each)(coords, function(_, coord) {
  36137. var x = point[0] - coord[0];
  36138. var y = point[1] - coord[1];
  36139. var distance = x * x + y * y;
  36140. if (distance < closestDistance) {
  36141. closestDistance = distance;
  36142. closestCoord = coord
  36143. }
  36144. });
  36145. return [_floor(closestCoord[0]), _floor(closestCoord[1])]
  36146. }
  36147. function getCrossCoord(rect, coord, indexOffset) {
  36148. return (coord - rect[0 + indexOffset]) / (rect[2 + indexOffset] - rect[0 + indexOffset]) * (rect[3 - indexOffset] - rect[1 - indexOffset]) + rect[1 - indexOffset]
  36149. }
  36150. var barPointStrategy = {
  36151. isLabelInside: function(labelPoint, figure) {
  36152. var xc = labelPoint.x + labelPoint.width / 2;
  36153. var yc = labelPoint.y + labelPoint.height / 2;
  36154. return figure.x <= xc && xc <= figure.x + figure.width && figure.y <= yc && yc <= figure.y + figure.height
  36155. },
  36156. prepareLabelPoints: function(bBox, rotatedBBox, isHorizontal, angle, figureCenter) {
  36157. var x1 = rotatedBBox.x;
  36158. var xc = x1 + rotatedBBox.width / 2;
  36159. var x2 = x1 + rotatedBBox.width - 1;
  36160. var y1 = rotatedBBox.y;
  36161. var yc = y1 + rotatedBBox.height / 2;
  36162. var y2 = y1 + rotatedBBox.height - 1;
  36163. var labelPoints;
  36164. var isRectangular = _abs(angle) % 90 === 0;
  36165. if (figureCenter[0] > x1 && figureCenter[0] < x2) {
  36166. if (isRectangular) {
  36167. labelPoints = [
  36168. [figureCenter[0], _abs(figureCenter[1] - y1) < _abs(figureCenter[1] - y2) ? y1 : y2]
  36169. ]
  36170. } else {
  36171. labelPoints = [
  36172. [figureCenter[0], getCrossCoord([x1, y1, x2, y2], figureCenter[0], 0)]
  36173. ]
  36174. }
  36175. } else {
  36176. if (figureCenter[1] > y1 && figureCenter[1] < y2) {
  36177. if (isRectangular) {
  36178. labelPoints = [
  36179. [_abs(figureCenter[0] - x1) < _abs(figureCenter[0] - x2) ? x1 : x2, figureCenter[1]]
  36180. ]
  36181. } else {
  36182. labelPoints = [
  36183. [getCrossCoord([x1, y1, x2, y2], figureCenter[1], 1), figureCenter[1]]
  36184. ]
  36185. }
  36186. } else {
  36187. if (isRectangular) {
  36188. labelPoints = [
  36189. [x1, y1],
  36190. [isHorizontal ? x1 : xc, isHorizontal ? yc : y1],
  36191. [x2, y1],
  36192. [x1, y2],
  36193. [isHorizontal ? x2 : xc, isHorizontal ? yc : y2],
  36194. [x2, y2]
  36195. ]
  36196. } else {
  36197. labelPoints = [
  36198. [xc, yc]
  36199. ]
  36200. }
  36201. }
  36202. }
  36203. return labelPoints
  36204. },
  36205. isHorizontal: function(bBox, figure) {
  36206. return bBox.x > figure.x + figure.width || bBox.x + bBox.width < figure.x
  36207. },
  36208. getFigureCenter: function(figure) {
  36209. return [_floor(figure.x + figure.width / 2), _floor(figure.y + figure.height / 2)]
  36210. },
  36211. findFigurePoint: function(figure, labelPoint) {
  36212. var figureCenter = barPointStrategy.getFigureCenter(figure);
  36213. var point = getClosestCoord(labelPoint, [
  36214. [figure.x, figureCenter[1]],
  36215. [figureCenter[0], figure.y + figure.height],
  36216. [figure.x + figure.width, figureCenter[1]],
  36217. [figureCenter[0], figure.y]
  36218. ]);
  36219. return point
  36220. },
  36221. adjustPoints: function(points) {
  36222. var lineIsVertical = _abs(points[1] - points[3]) <= 1;
  36223. var lineIsHorizontal = _abs(points[0] - points[2]) <= 1;
  36224. if (lineIsHorizontal) {
  36225. points[0] = points[2]
  36226. }
  36227. if (lineIsVertical) {
  36228. points[1] = points[3]
  36229. }
  36230. return points
  36231. }
  36232. };
  36233. var symbolPointStrategy = {
  36234. isLabelInside: function() {
  36235. return false
  36236. },
  36237. prepareLabelPoints: barPointStrategy.prepareLabelPoints,
  36238. isHorizontal: function(bBox, figure) {
  36239. return bBox.x > figure.x + figure.r || bBox.x + bBox.width < figure.x - figure.r
  36240. },
  36241. getFigureCenter: function(figure) {
  36242. return [figure.x, figure.y]
  36243. },
  36244. findFigurePoint: function(figure, labelPoint) {
  36245. var angle = Math.atan2(figure.y - labelPoint[1], labelPoint[0] - figure.x);
  36246. return [_round(figure.x + figure.r * Math.cos(angle)), _round(figure.y - figure.r * Math.sin(angle))]
  36247. },
  36248. adjustPoints: barPointStrategy.adjustPoints
  36249. };
  36250. var piePointStrategy = {
  36251. isLabelInside: function(_0, _1, isOutside) {
  36252. return !isOutside
  36253. },
  36254. prepareLabelPoints: function(bBox, rotatedBBox, isHorizontal, angle) {
  36255. var xl = bBox.x;
  36256. var xr = xl + bBox.width;
  36257. var xc = xl + _round(bBox.width / 2);
  36258. var yt = bBox.y;
  36259. var yb = yt + bBox.height;
  36260. var yc = yt + _round(bBox.height / 2);
  36261. var points = [
  36262. [
  36263. [xl, yt],
  36264. [xr, yt]
  36265. ],
  36266. [
  36267. [xr, yt],
  36268. [xr, yb]
  36269. ],
  36270. [
  36271. [xr, yb],
  36272. [xl, yb]
  36273. ],
  36274. [
  36275. [xl, yb],
  36276. [xl, yt]
  36277. ]
  36278. ];
  36279. var cosSin = (0, _utils.getCosAndSin)(angle);
  36280. if (0 === angle) {
  36281. points = isHorizontal ? [
  36282. [xl, yc],
  36283. [xr, yc]
  36284. ] : [
  36285. [xc, yt],
  36286. [xc, yb]
  36287. ]
  36288. } else {
  36289. points = points.map(function(pair) {
  36290. return pair.map(function(point) {
  36291. return [_round((point[0] - xc) * cosSin.cos + (point[1] - yc) * cosSin.sin + xc), _round(-(point[0] - xc) * cosSin.sin + (point[1] - yc) * cosSin.cos + yc)]
  36292. })
  36293. }).reduce(function(r, pair) {
  36294. var point1x = pair[0][0];
  36295. var point1y = pair[0][1];
  36296. var point2x = pair[1][0];
  36297. var point2y = pair[1][1];
  36298. if (isHorizontal) {
  36299. if (point1y >= yc && yc >= point2y || point1y <= yc && yc <= point2y) {
  36300. r.push([(yc - point1y) * (point2x - point1x) / (point2y - point1y) + point1x, yc])
  36301. }
  36302. } else {
  36303. if (point1x >= xc && xc >= point2x || point1x <= xc && xc <= point2x) {
  36304. r.push([xc, (xc - point1x) * (point2y - point1y) / (point2x - point1x) + point1y])
  36305. }
  36306. }
  36307. return r
  36308. }, [])
  36309. }
  36310. return points
  36311. },
  36312. isHorizontal: function(bBox, figure) {
  36313. return bBox.x > figure.x || figure.x > bBox.x + bBox.width
  36314. },
  36315. getFigureCenter: symbolPointStrategy.getFigureCenter,
  36316. findFigurePoint: function(figure, labelPoint, isHorizontal) {
  36317. if (!isHorizontal) {
  36318. return [figure.x, figure.y]
  36319. }
  36320. var labelX = labelPoint[0];
  36321. var x = _round(figure.x + (figure.y - labelPoint[1]) / Math.tan((0, _utils.degreesToRadians)(figure.angle)));
  36322. var points = [figure.x, figure.y, x, labelPoint[1]];
  36323. if (!(figure.x <= x && x <= labelX) && !(labelX <= x && x <= figure.x)) {
  36324. if (_abs(figure.x - labelX) < CONNECTOR_LENGTH) {
  36325. points = [figure.x, figure.y]
  36326. } else {
  36327. if (figure.x <= labelX) {
  36328. points[2] = figure.x + CONNECTOR_LENGTH
  36329. } else {
  36330. points[2] = figure.x - CONNECTOR_LENGTH
  36331. }
  36332. }
  36333. }
  36334. return points
  36335. },
  36336. adjustPoints: function(points) {
  36337. return points
  36338. }
  36339. };
  36340. function selectStrategy(figure) {
  36341. return void 0 !== figure.angle && piePointStrategy || void 0 !== figure.r && symbolPointStrategy || barPointStrategy
  36342. }
  36343. function disposeItem(obj, field) {
  36344. obj[field] && obj[field].dispose();
  36345. obj[field] = null
  36346. }
  36347. function checkBackground(background) {
  36348. return background && (background.fill && "none" !== background.fill || background["stroke-width"] > 0 && background.stroke && "none" !== background.stroke)
  36349. }
  36350. function checkConnector(connector) {
  36351. return connector && connector["stroke-width"] > 0 && connector.stroke && "none" !== connector.stroke
  36352. }
  36353. function formatText(data, options) {
  36354. var format = options.format;
  36355. data.valueText = (0, _format_helper.format)(data.value, format);
  36356. data.argumentText = (0, _format_helper.format)(data.argument, options.argumentFormat);
  36357. if (void 0 !== data.percent) {
  36358. data.percentText = (0, _format_helper.format)(data.percent, {
  36359. type: "percent",
  36360. precision: format && format.percentPrecision
  36361. })
  36362. }
  36363. if (void 0 !== data.total) {
  36364. data.totalText = (0, _format_helper.format)(data.total, format)
  36365. }
  36366. if (void 0 !== data.openValue) {
  36367. data.openValueText = (0, _format_helper.format)(data.openValue, format)
  36368. }
  36369. if (void 0 !== data.closeValue) {
  36370. data.closeValueText = (0, _format_helper.format)(data.closeValue, format)
  36371. }
  36372. if (void 0 !== data.lowValue) {
  36373. data.lowValueText = (0, _format_helper.format)(data.lowValue, format)
  36374. }
  36375. if (void 0 !== data.highValue) {
  36376. data.highValueText = (0, _format_helper.format)(data.highValue, format)
  36377. }
  36378. if (void 0 !== data.reductionValue) {
  36379. data.reductionValueText = (0, _format_helper.format)(data.reductionValue, format)
  36380. }
  36381. return options.customizeText ? options.customizeText.call(data, data) : data.valueText
  36382. }
  36383. function Label(renderSettings) {
  36384. this._renderer = renderSettings.renderer;
  36385. this._container = renderSettings.labelsGroup;
  36386. this._point = renderSettings.point;
  36387. this._strategy = renderSettings.strategy;
  36388. this._rowCount = 1
  36389. }
  36390. Label.prototype = {
  36391. constructor: Label,
  36392. setColor: function(color) {
  36393. this._color = color
  36394. },
  36395. setOptions: function(options) {
  36396. this._options = options
  36397. },
  36398. setData: function(data) {
  36399. this._data = data
  36400. },
  36401. setDataField: function(fieldName, fieldValue) {
  36402. this._data = this._data || {};
  36403. this._data[fieldName] = fieldValue
  36404. },
  36405. getData: function() {
  36406. return this._data
  36407. },
  36408. setFigureToDrawConnector: function(figure) {
  36409. this._figure = figure
  36410. },
  36411. dispose: function() {
  36412. var that = this;
  36413. disposeItem(that, "_group");
  36414. that._data = that._options = that._textContent = that._visible = that._insideGroup = that._text = that._background = that._connector = that._figure = null
  36415. },
  36416. _setVisibility: function(value, state) {
  36417. this._group && this._group.attr({
  36418. visibility: value
  36419. });
  36420. this._visible = state
  36421. },
  36422. isVisible: function() {
  36423. return this._visible
  36424. },
  36425. hide: function(holdInvisible) {
  36426. this._holdVisibility = !!holdInvisible;
  36427. this._hide()
  36428. },
  36429. _hide: function() {
  36430. this._setVisibility("hidden", false)
  36431. },
  36432. show: function(holdVisible) {
  36433. var correctPosition = !this._drawn;
  36434. if (this._point.hasValue()) {
  36435. this._holdVisibility = !!holdVisible;
  36436. this._show();
  36437. correctPosition && this._point.correctLabelPosition(this)
  36438. }
  36439. },
  36440. _show: function() {
  36441. var that = this;
  36442. var renderer = that._renderer;
  36443. var container = that._container;
  36444. var options = that._options || {};
  36445. var text = that._textContent = formatText(that._data, that._options) || null;
  36446. if (text) {
  36447. if (!that._group) {
  36448. that._group = renderer.g().append(container);
  36449. that._insideGroup = renderer.g().append(that._group);
  36450. that._text = renderer.text("", 0, 0).append(that._insideGroup)
  36451. }
  36452. that._text.css(options.attributes ? (0, _utils.patchFontOptions)(options.attributes.font) : {});
  36453. if (checkBackground(options.background)) {
  36454. that._background = that._background || renderer.rect().append(that._insideGroup).toBackground();
  36455. that._background.attr(options.background);
  36456. that._color && that._background.attr({
  36457. fill: that._color
  36458. })
  36459. } else {
  36460. disposeItem(that, "_background")
  36461. }
  36462. if (checkConnector(options.connector)) {
  36463. that._connector = that._connector || renderer.path([], "line").sharp().append(that._group).toBackground();
  36464. that._connector.attr(options.connector);
  36465. that._color && that._connector.attr({
  36466. stroke: that._color
  36467. })
  36468. } else {
  36469. disposeItem(that, "_connector")
  36470. }
  36471. that._text.attr({
  36472. text: text,
  36473. align: options.textAlignment,
  36474. "class": options.cssClass
  36475. });
  36476. that._updateBackground(that._text.getBBox());
  36477. that._setVisibility("visible", true);
  36478. that._drawn = true
  36479. } else {
  36480. that._hide()
  36481. }
  36482. },
  36483. _getLabelVisibility: function(isVisible) {
  36484. return this._holdVisibility ? this.isVisible() : isVisible
  36485. },
  36486. draw: function(isVisible) {
  36487. if (this._getLabelVisibility(isVisible)) {
  36488. this._show();
  36489. this._point && this._point.correctLabelPosition(this)
  36490. } else {
  36491. this._drawn = false;
  36492. this._hide()
  36493. }
  36494. return this
  36495. },
  36496. _updateBackground: function(bBox) {
  36497. var that = this;
  36498. if (that._background) {
  36499. bBox.x -= LABEL_BACKGROUND_PADDING_X;
  36500. bBox.y -= LABEL_BACKGROUND_PADDING_Y;
  36501. bBox.width += 2 * LABEL_BACKGROUND_PADDING_X;
  36502. bBox.height += 2 * LABEL_BACKGROUND_PADDING_Y;
  36503. that._background.attr(bBox)
  36504. }
  36505. that._bBoxWithoutRotation = (0, _extend.extend)({}, bBox);
  36506. var rotationAngle = that._options.rotationAngle || 0;
  36507. that._insideGroup.rotate(rotationAngle, bBox.x + bBox.width / 2, bBox.y + bBox.height / 2);
  36508. bBox = (0, _utils.rotateBBox)(bBox, [bBox.x + bBox.width / 2, bBox.y + bBox.height / 2], -rotationAngle);
  36509. that._bBox = bBox
  36510. },
  36511. getFigureCenter: function() {
  36512. var figure = this._figure;
  36513. var strategy = this._strategy || selectStrategy(figure);
  36514. return strategy.getFigureCenter(figure)
  36515. },
  36516. _getConnectorPoints: function() {
  36517. var that = this;
  36518. var figure = that._figure;
  36519. var options = that._options;
  36520. var strategy = that._strategy || selectStrategy(figure);
  36521. var bBox = that._shiftBBox(that._bBoxWithoutRotation);
  36522. var rotatedBBox = that.getBoundingRect();
  36523. var labelPoint;
  36524. var points = [];
  36525. var isHorizontal;
  36526. if (!strategy.isLabelInside(bBox, figure, "inside" !== options.position)) {
  36527. isHorizontal = strategy.isHorizontal(bBox, figure);
  36528. var figureCenter = that.getFigureCenter();
  36529. points = strategy.prepareLabelPoints(bBox, rotatedBBox, isHorizontal, -options.rotationAngle || 0, figureCenter);
  36530. labelPoint = getClosestCoord(figureCenter, points);
  36531. points = strategy.findFigurePoint(figure, labelPoint, isHorizontal);
  36532. points = points.concat(labelPoint)
  36533. }
  36534. return strategy.adjustPoints(points)
  36535. },
  36536. fit: function(maxWidth) {
  36537. var padding = this._background ? 2 * LABEL_BACKGROUND_PADDING_X : 0;
  36538. var rowCountChanged = false;
  36539. if (this._text) {
  36540. var result = this._text.setMaxSize(maxWidth - padding, void 0, this._options);
  36541. var rowCount = result.rowCount;
  36542. if (0 === rowCount) {
  36543. rowCount = 1
  36544. }
  36545. if (rowCount !== this._rowCount) {
  36546. rowCountChanged = true;
  36547. this._rowCount = rowCount
  36548. }
  36549. result.textIsEmpty && disposeItem(this, "_background")
  36550. }
  36551. this._updateBackground(this._text.getBBox());
  36552. return rowCountChanged
  36553. },
  36554. resetEllipsis: function() {
  36555. this._text && this._text.restoreText();
  36556. this._updateBackground(this._text.getBBox())
  36557. },
  36558. setTrackerData: function(point) {
  36559. this._text.data({
  36560. "chart-data-point": point
  36561. });
  36562. this._background && this._background.data({
  36563. "chart-data-point": point
  36564. })
  36565. },
  36566. hideInsideLabel: function(coords) {
  36567. return this._point.hideInsideLabel(this, coords)
  36568. },
  36569. getPoint: function() {
  36570. return this._point
  36571. },
  36572. shift: function(x, y) {
  36573. var that = this;
  36574. if (that._textContent) {
  36575. that._insideGroup.attr({
  36576. translateX: that._x = _round(x - that._bBox.x),
  36577. translateY: that._y = _round(y - that._bBox.y)
  36578. });
  36579. if (that._connector) {
  36580. that._connector.attr({
  36581. points: that._getConnectorPoints()
  36582. })
  36583. }
  36584. }
  36585. return that
  36586. },
  36587. getBoundingRect: function() {
  36588. return this._shiftBBox(this._bBox)
  36589. },
  36590. _shiftBBox: function(bBox) {
  36591. return this._textContent ? {
  36592. x: bBox.x + this._x,
  36593. y: bBox.y + this._y,
  36594. width: bBox.width,
  36595. height: bBox.height
  36596. } : {}
  36597. },
  36598. getLayoutOptions: function() {
  36599. var options = this._options;
  36600. return {
  36601. alignment: options.alignment,
  36602. background: checkBackground(options.background),
  36603. horizontalOffset: options.horizontalOffset,
  36604. verticalOffset: options.verticalOffset,
  36605. radialOffset: options.radialOffset,
  36606. position: options.position,
  36607. connectorOffset: (checkConnector(options.connector) ? CONNECTOR_LENGTH : 0) + (checkBackground(options.background) ? LABEL_BACKGROUND_PADDING_X : 0)
  36608. }
  36609. }
  36610. };
  36611. exports.Label = Label;
  36612. Label._DEBUG_formatText = formatText
  36613. },
  36614. /*!**************************************************************************!*\
  36615. !*** ./artifacts/transpiled/viz/series/helpers/range_data_calculator.js ***!
  36616. \**************************************************************************/
  36617. /*! dynamic exports provided */
  36618. /*! all exports used */
  36619. function(module, exports, __webpack_require__) {
  36620. var _require = __webpack_require__( /*! ../../core/utils */ 10),
  36621. unique = _require.unique,
  36622. getAddFunction = _require.getAddFunction;
  36623. var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
  36624. var noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop;
  36625. var DISCRETE = "discrete";
  36626. function continuousRangeCalculator(range, minValue, maxValue) {
  36627. range.min = range.min < minValue ? range.min : minValue;
  36628. range.max = range.max > maxValue ? range.max : maxValue
  36629. }
  36630. function getRangeCalculator(axisType, axis) {
  36631. if (axisType === DISCRETE) {
  36632. return function(range, minValue, maxValue) {
  36633. if (minValue !== maxValue) {
  36634. range.categories.push(maxValue)
  36635. }
  36636. range.categories.push(minValue)
  36637. }
  36638. }
  36639. if (axis) {
  36640. return function(range, value) {
  36641. var interval = axis.calculateInterval(value, range.prevValue);
  36642. var minInterval = range.interval;
  36643. range.interval = (minInterval < interval ? minInterval : interval) || minInterval;
  36644. range.prevValue = value;
  36645. continuousRangeCalculator(range, value, value)
  36646. }
  36647. }
  36648. return continuousRangeCalculator
  36649. }
  36650. function getInitialRange(axisType, dataType, firstValue) {
  36651. var range = {
  36652. axisType: axisType,
  36653. dataType: dataType
  36654. };
  36655. if (axisType === DISCRETE) {
  36656. range.categories = []
  36657. } else {
  36658. range.min = firstValue;
  36659. range.max = firstValue
  36660. }
  36661. return range
  36662. }
  36663. function processCategories(range) {
  36664. if (range.categories) {
  36665. range.categories = unique(range.categories)
  36666. }
  36667. }
  36668. function getValueForArgument(point, extraPoint, x, range) {
  36669. if (extraPoint && _isDefined(extraPoint.value)) {
  36670. var y1 = point.value;
  36671. var y2 = extraPoint.value;
  36672. var x1 = point.argument;
  36673. var x2 = extraPoint.argument;
  36674. var r = (x - x1) * (y2 - y1) / (x2 - x1) + y1.valueOf();
  36675. return "datetime" === range.dataType ? new Date(r) : r
  36676. } else {
  36677. return point.value
  36678. }
  36679. }
  36680. function calculateRangeBetweenPoints(rangeCalculator, range, point, prevPoint, bound) {
  36681. var value = getValueForArgument(point, prevPoint, bound, range);
  36682. rangeCalculator(range, value, value)
  36683. }
  36684. function isLineSeries(series) {
  36685. return series.type.toLowerCase().indexOf("line") >= 0 || series.type.toLowerCase().indexOf("area") >= 0
  36686. }
  36687. function getViewportReducer(series) {
  36688. var rangeCalculator = getRangeCalculator(series.valueAxisType);
  36689. var axis = series.getArgumentAxis();
  36690. var viewport = axis && series.getArgumentAxis().visualRange() || {};
  36691. var calculatePointBetweenPoints = isLineSeries(series) ? calculateRangeBetweenPoints : noop;
  36692. if (axis && axis.getMarginOptions().checkInterval) {
  36693. var range = series.getArgumentAxis().getTranslator().getBusinessRange();
  36694. var add = getAddFunction(range, false);
  36695. var interval = range.interval;
  36696. if (isFinite(interval) && _isDefined(viewport.startValue) && _isDefined(viewport.endValue)) {
  36697. viewport.startValue = add(viewport.startValue, interval, -1);
  36698. viewport.endValue = add(viewport.endValue, interval)
  36699. }
  36700. }
  36701. var viewportFilter = getViewPortFilter(viewport);
  36702. return function(range, point, index, points) {
  36703. var argument = point.argument;
  36704. if (!point.hasValue()) {
  36705. return range
  36706. }
  36707. if (viewportFilter(argument)) {
  36708. if (!range.startCalc) {
  36709. range.startCalc = true;
  36710. calculatePointBetweenPoints(rangeCalculator, range, point, points[index - 1], viewport.startValue)
  36711. }
  36712. rangeCalculator(range, point.getMinValue(), point.getMaxValue())
  36713. } else {
  36714. if (!viewport.categories && _isDefined(viewport.startValue) && argument > viewport.startValue) {
  36715. if (!range.startCalc) {
  36716. calculatePointBetweenPoints(rangeCalculator, range, point, points[index - 1], viewport.startValue)
  36717. }
  36718. range.endCalc = true;
  36719. calculatePointBetweenPoints(rangeCalculator, range, point, points[index - 1], viewport.endValue)
  36720. }
  36721. }
  36722. return range
  36723. }
  36724. }
  36725. function getViewPortFilter(viewport) {
  36726. if (viewport.categories) {
  36727. var dictionary = viewport.categories.reduce(function(result, category) {
  36728. result[category.valueOf()] = true;
  36729. return result
  36730. }, {});
  36731. return function(argument) {
  36732. return _isDefined(argument) && dictionary[argument.valueOf()]
  36733. }
  36734. }
  36735. if (!_isDefined(viewport.startValue) && !_isDefined(viewport.endValue)) {
  36736. return function() {
  36737. return true
  36738. }
  36739. }
  36740. if (!_isDefined(viewport.endValue)) {
  36741. return function(argument) {
  36742. return argument >= viewport.startValue
  36743. }
  36744. }
  36745. if (!_isDefined(viewport.startValue)) {
  36746. return function(argument) {
  36747. return argument <= viewport.endValue
  36748. }
  36749. }
  36750. return function(argument) {
  36751. return argument >= viewport.startValue && argument <= viewport.endValue
  36752. }
  36753. }
  36754. module.exports = {
  36755. getViewPortFilter: getViewPortFilter,
  36756. getArgumentRange: function(series) {
  36757. var data = series._data || [];
  36758. var range = {};
  36759. if (data.length) {
  36760. if (series.argumentAxisType === DISCRETE) {
  36761. range = {
  36762. categories: data.map(function(item) {
  36763. return item.argument
  36764. })
  36765. }
  36766. } else {
  36767. var interval;
  36768. if (data.length > 1) {
  36769. var i1 = series.getArgumentAxis().calculateInterval(data[0].argument, data[1].argument);
  36770. var i2 = series.getArgumentAxis().calculateInterval(data[data.length - 1].argument, data[data.length - 2].argument);
  36771. interval = Math.min(i1, i2)
  36772. }
  36773. range = {
  36774. min: data[0].argument,
  36775. max: data[data.length - 1].argument,
  36776. interval: interval
  36777. }
  36778. }
  36779. }
  36780. return range
  36781. },
  36782. getRangeData: function(series) {
  36783. var points = series.getPoints();
  36784. var useAggregation = series.useAggregation();
  36785. var argumentCalculator = getRangeCalculator(series.argumentAxisType, points.length > 1 && series.getArgumentAxis());
  36786. var valueRangeCalculator = getRangeCalculator(series.valueAxisType);
  36787. var viewportReducer = getViewportReducer(series);
  36788. var range = points.reduce(function(range, point, index, points) {
  36789. var argument = point.argument;
  36790. argumentCalculator(range.arg, argument, argument);
  36791. if (point.hasValue()) {
  36792. valueRangeCalculator(range.val, point.getMinValue(), point.getMaxValue());
  36793. viewportReducer(range.viewport, point, index, points)
  36794. }
  36795. return range
  36796. }, {
  36797. arg: getInitialRange(series.argumentAxisType, series.argumentType, points.length ? points[0].argument : void 0),
  36798. val: getInitialRange(series.valueAxisType, series.valueType, points.length ? series.getValueRangeInitialValue() : void 0),
  36799. viewport: getInitialRange(series.valueAxisType, series.valueType, points.length ? series.getValueRangeInitialValue() : void 0)
  36800. });
  36801. if (useAggregation) {
  36802. var argumentRange = this.getArgumentRange(series);
  36803. if (series.argumentAxisType === DISCRETE) {
  36804. range.arg = argumentRange
  36805. } else {
  36806. var viewport = series.getArgumentAxis().getViewport();
  36807. if (_isDefined(viewport.startValue) || _isDefined(viewport.length)) {
  36808. argumentCalculator(range.arg, argumentRange.min, argumentRange.min)
  36809. }
  36810. if (_isDefined(viewport.endValue) || _isDefined(viewport.length) && _isDefined(viewport.startValue)) {
  36811. argumentCalculator(range.arg, argumentRange.max, argumentRange.max)
  36812. }
  36813. }
  36814. }
  36815. processCategories(range.arg);
  36816. processCategories(range.val);
  36817. return range
  36818. },
  36819. getViewport: function(series) {
  36820. var points = series.getPoints();
  36821. var range = {};
  36822. var reducer = getViewportReducer(series);
  36823. range = getInitialRange(series.valueAxisType, series.valueType, points.length ? series.getValueRangeInitialValue() : void 0);
  36824. points.some(function(point, index) {
  36825. reducer(range, point, index, points);
  36826. return range.endCalc
  36827. });
  36828. return range
  36829. },
  36830. getPointsInViewPort: function(series) {
  36831. var argumentViewPortFilter = getViewPortFilter(series.getArgumentAxis().visualRange() || {});
  36832. var valueViewPort = series.getValueAxis().visualRange() || {};
  36833. var valueViewPortFilter = getViewPortFilter(valueViewPort);
  36834. var points = series.getPoints();
  36835. var addValue = function(values, point, isEdge) {
  36836. var minValue = point.getMinValue();
  36837. var maxValue = point.getMaxValue();
  36838. var isMinValueInViewPort = valueViewPortFilter(minValue);
  36839. var isMaxValueInViewPort = valueViewPortFilter(maxValue);
  36840. if (isMinValueInViewPort) {
  36841. values.push(minValue)
  36842. }
  36843. if (maxValue !== minValue && isMaxValueInViewPort) {
  36844. values.push(maxValue)
  36845. }
  36846. if (isEdge && !isMinValueInViewPort && !isMaxValueInViewPort) {
  36847. if (!values.length) {
  36848. values.push(valueViewPort.startValue)
  36849. } else {
  36850. values.push(valueViewPort.endValue)
  36851. }
  36852. }
  36853. };
  36854. var addEdgePoints = isLineSeries(series) ? function(result, points, index) {
  36855. var point = points[index];
  36856. var prevPoint = points[index - 1];
  36857. var nextPoint = points[index + 1];
  36858. if (nextPoint && argumentViewPortFilter(nextPoint.argument)) {
  36859. addValue(result[1], point, true)
  36860. }
  36861. if (prevPoint && argumentViewPortFilter(prevPoint.argument)) {
  36862. addValue(result[1], point, true)
  36863. }
  36864. } : noop;
  36865. var checkPointInViewport = function(result, point, index) {
  36866. if (argumentViewPortFilter(point.argument)) {
  36867. addValue(result[0], point)
  36868. } else {
  36869. addEdgePoints(result, points, index)
  36870. }
  36871. return result
  36872. };
  36873. return points.reduce(checkPointInViewport, [
  36874. [],
  36875. []
  36876. ])
  36877. }
  36878. }
  36879. },
  36880. /*!*********************************************************!*\
  36881. !*** ./artifacts/transpiled/viz/axes/axes_constants.js ***!
  36882. \*********************************************************/
  36883. /*! dynamic exports provided */
  36884. /*! all exports used */
  36885. function(module, exports, __webpack_require__) {
  36886. var _map = __webpack_require__( /*! ../core/utils */ 10).map;
  36887. module.exports = {
  36888. logarithmic: "logarithmic",
  36889. discrete: "discrete",
  36890. numeric: "numeric",
  36891. left: "left",
  36892. right: "right",
  36893. top: "top",
  36894. bottom: "bottom",
  36895. center: "center",
  36896. horizontal: "horizontal",
  36897. vertical: "vertical",
  36898. convertTicksToValues: function(ticks) {
  36899. return _map(ticks || [], function(item) {
  36900. return item.value
  36901. })
  36902. },
  36903. validateOverlappingMode: function(mode) {
  36904. return "ignore" === mode || "none" === mode ? mode : "hide"
  36905. },
  36906. getTicksCountInRange: function(ticks, valueKey, range) {
  36907. var i = 1;
  36908. if (ticks.length > 1) {
  36909. for (; i < ticks.length; i++) {
  36910. if (Math.abs(ticks[i].coords[valueKey] - ticks[0].coords[valueKey]) >= range) {
  36911. break
  36912. }
  36913. }
  36914. }
  36915. return i
  36916. },
  36917. areLabelsOverlap: function(bBox1, bBox2, spacing, alignment) {
  36918. var horizontalInverted = bBox1.x > bBox2.x;
  36919. var verticalInverted = bBox1.y > bBox2.y;
  36920. var x1 = bBox1.x;
  36921. var x2 = bBox2.x;
  36922. var width1 = bBox1.width;
  36923. var width2 = bBox2.width;
  36924. if ("left" === alignment) {
  36925. x1 += width1 / 2;
  36926. x2 += width2 / 2
  36927. } else {
  36928. if ("right" === alignment) {
  36929. x1 -= width1 / 2;
  36930. x2 -= width2 / 2
  36931. }
  36932. }
  36933. var hasHorizontalOverlapping = horizontalInverted ? x2 + width2 + spacing > x1 : x1 + width1 + spacing > x2;
  36934. var hasVerticalOverlapping = verticalInverted ? bBox2.y + bBox2.height > bBox1.y : bBox1.y + bBox1.height > bBox2.y;
  36935. return hasHorizontalOverlapping && hasVerticalOverlapping
  36936. }
  36937. }
  36938. },
  36939. /*!**************************************************************!*\
  36940. !*** ./artifacts/transpiled/viz/translators/translator2d.js ***!
  36941. \**************************************************************/
  36942. /*! dynamic exports provided */
  36943. /*! all exports used */
  36944. function(module, exports, __webpack_require__) {
  36945. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  36946. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  36947. var Range = __webpack_require__( /*! ./range */ 108).Range;
  36948. var categoryTranslator = __webpack_require__( /*! ./category_translator */ 779);
  36949. var intervalTranslator = __webpack_require__( /*! ./interval_translator */ 780);
  36950. var datetimeTranslator = __webpack_require__( /*! ./datetime_translator */ 781);
  36951. var logarithmicTranslator = __webpack_require__( /*! ./logarithmic_translator */ 782);
  36952. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  36953. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  36954. var getLog = vizUtils.getLog;
  36955. var getPower = vizUtils.getPower;
  36956. var isDefined = typeUtils.isDefined;
  36957. var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust;
  36958. var _abs = Math.abs;
  36959. var CANVAS_PROP = ["width", "height", "left", "top", "bottom", "right"];
  36960. var _Translator2d;
  36961. var addInterval = __webpack_require__( /*! ../../core/utils/date */ 22).addInterval;
  36962. var dummyTranslator = {
  36963. to: function(value) {
  36964. var coord = this._canvasOptions.startPoint + (this._options.conversionValue ? value : Math.round(value));
  36965. return coord > this._canvasOptions.endPoint ? this._canvasOptions.endPoint : coord
  36966. },
  36967. from: function(value) {
  36968. return value - this._canvasOptions.startPoint
  36969. }
  36970. };
  36971. var validateCanvas = function(canvas) {
  36972. each(CANVAS_PROP, function(_, prop) {
  36973. canvas[prop] = parseInt(canvas[prop]) || 0
  36974. });
  36975. return canvas
  36976. };
  36977. var makeCategoriesToPoints = function(categories) {
  36978. var categoriesToPoints = {};
  36979. categories.forEach(function(item, i) {
  36980. categoriesToPoints[item.valueOf()] = i
  36981. });
  36982. return categoriesToPoints
  36983. };
  36984. var validateBusinessRange = function(businessRange) {
  36985. if (!(businessRange instanceof Range)) {
  36986. businessRange = new Range(businessRange)
  36987. }
  36988. function validate(valueSelector, baseValueSelector) {
  36989. if (!isDefined(businessRange[valueSelector]) && isDefined(businessRange[baseValueSelector])) {
  36990. businessRange[valueSelector] = businessRange[baseValueSelector]
  36991. }
  36992. }
  36993. validate("minVisible", "min");
  36994. validate("maxVisible", "max");
  36995. return businessRange
  36996. };
  36997. function prepareBreaks(breaks, range) {
  36998. var transform = "logarithmic" === range.axisType ? function(value) {
  36999. return getLog(value, range.base)
  37000. } : function(value) {
  37001. return value
  37002. };
  37003. var array = [];
  37004. var br;
  37005. var transformFrom;
  37006. var transformTo;
  37007. var i;
  37008. var length = breaks.length;
  37009. var sum = 0;
  37010. for (i = 0; i < length; i++) {
  37011. br = breaks[i];
  37012. transformFrom = transform(br.from);
  37013. transformTo = transform(br.to);
  37014. sum += transformTo - transformFrom;
  37015. array.push({
  37016. trFrom: transformFrom,
  37017. trTo: transformTo,
  37018. from: br.from,
  37019. to: br.to,
  37020. length: sum,
  37021. cumulativeWidth: br.cumulativeWidth
  37022. })
  37023. }
  37024. return array
  37025. }
  37026. function getCanvasBounds(range) {
  37027. var min = range.min;
  37028. var max = range.max;
  37029. var minVisible = range.minVisible;
  37030. var maxVisible = range.maxVisible;
  37031. var isLogarithmic = "logarithmic" === range.axisType;
  37032. if (isLogarithmic) {
  37033. maxVisible = getLog(maxVisible, range.base);
  37034. minVisible = getLog(minVisible, range.base);
  37035. min = getLog(min, range.base);
  37036. max = getLog(max, range.base)
  37037. }
  37038. return {
  37039. base: range.base,
  37040. rangeMin: min,
  37041. rangeMax: max,
  37042. rangeMinVisible: minVisible,
  37043. rangeMaxVisible: maxVisible
  37044. }
  37045. }
  37046. function getCheckingMethodsAboutBreaks(inverted) {
  37047. return {
  37048. isStartSide: !inverted ? function(pos, breaks, start, end) {
  37049. return pos < breaks[0][start]
  37050. } : function(pos, breaks, start, end) {
  37051. return pos <= breaks[breaks.length - 1][end]
  37052. },
  37053. isEndSide: !inverted ? function(pos, breaks, start, end) {
  37054. return pos >= breaks[breaks.length - 1][end]
  37055. } : function(pos, breaks, start, end) {
  37056. return pos > breaks[0][start]
  37057. },
  37058. isInBreak: !inverted ? function(pos, br, start, end) {
  37059. return pos >= br[start] && pos < br[end]
  37060. } : function(pos, br, start, end) {
  37061. return pos > br[end] && pos <= br[start]
  37062. },
  37063. isBetweenBreaks: !inverted ? function(pos, br, prevBreak, start, end) {
  37064. return pos < br[start] && pos >= prevBreak[end]
  37065. } : function(pos, br, prevBreak, start, end) {
  37066. return pos >= br[end] && pos < prevBreak[start]
  37067. },
  37068. getLength: !inverted ? function(br) {
  37069. return br.length
  37070. } : function(br, lastBreak) {
  37071. return lastBreak.length - br.length
  37072. },
  37073. getBreaksSize: !inverted ? function(br) {
  37074. return br.cumulativeWidth
  37075. } : function(br, lastBreak) {
  37076. return lastBreak.cumulativeWidth - br.cumulativeWidth
  37077. }
  37078. }
  37079. }
  37080. exports.Translator2D = _Translator2d = function(businessRange, canvas, options) {
  37081. this.update(businessRange, canvas, options)
  37082. };
  37083. _Translator2d.prototype = {
  37084. constructor: _Translator2d,
  37085. reinit: function() {
  37086. var that = this;
  37087. var options = that._options;
  37088. var range = that._businessRange;
  37089. var categories = range.categories || [];
  37090. var script = {};
  37091. var canvasOptions = that._prepareCanvasOptions();
  37092. var visibleCategories = vizUtils.getCategoriesInfo(categories, range.minVisible, range.maxVisible).categories;
  37093. var categoriesLength = visibleCategories.length;
  37094. if (range.isEmpty()) {
  37095. script = dummyTranslator
  37096. } else {
  37097. switch (range.axisType) {
  37098. case "logarithmic":
  37099. script = logarithmicTranslator;
  37100. break;
  37101. case "semidiscrete":
  37102. script = intervalTranslator;
  37103. canvasOptions.ratioOfCanvasRange = canvasOptions.canvasLength / (addInterval(canvasOptions.rangeMaxVisible, options.interval) - canvasOptions.rangeMinVisible);
  37104. break;
  37105. case "discrete":
  37106. script = categoryTranslator;
  37107. that._categories = categories;
  37108. canvasOptions.interval = that._getDiscreteInterval(options.addSpiderCategory ? categoriesLength + 1 : categoriesLength, canvasOptions);
  37109. that._categoriesToPoints = makeCategoriesToPoints(categories, canvasOptions.invert);
  37110. if (categoriesLength) {
  37111. canvasOptions.startPointIndex = that._categoriesToPoints[visibleCategories[0].valueOf()];
  37112. that.visibleCategories = visibleCategories
  37113. }
  37114. break;
  37115. default:
  37116. if ("datetime" === range.dataType) {
  37117. script = datetimeTranslator
  37118. }
  37119. }
  37120. }(that._oldMethods || []).forEach(function(methodName) {
  37121. delete that[methodName]
  37122. });
  37123. that._oldMethods = Object.keys(script);
  37124. extend(that, script);
  37125. that._conversionValue = options.conversionValue ? function(value) {
  37126. return value
  37127. } : function(value) {
  37128. return Math.round(value)
  37129. };
  37130. that.sc = {};
  37131. that._checkingMethodsAboutBreaks = [getCheckingMethodsAboutBreaks(false), getCheckingMethodsAboutBreaks(that.isInverted())];
  37132. that._translateBreaks();
  37133. that._calculateSpecialValues()
  37134. },
  37135. _translateBreaks: function() {
  37136. var breaks = this._breaks;
  37137. var size = this._options.breaksSize;
  37138. var i;
  37139. var b;
  37140. var end;
  37141. var length;
  37142. if (void 0 === breaks) {
  37143. return
  37144. }
  37145. for (i = 0, length = breaks.length; i < length; i++) {
  37146. b = breaks[i];
  37147. end = this.translate(b.to);
  37148. b.end = end;
  37149. b.start = !b.gapSize ? !this.isInverted() ? end - size : end + size : end
  37150. }
  37151. },
  37152. _checkValueAboutBreaks: function(breaks, pos, start, end, methods) {
  37153. var i;
  37154. var length;
  37155. var prop = {
  37156. length: 0,
  37157. breaksSize: void 0,
  37158. inBreak: false
  37159. };
  37160. var br;
  37161. var prevBreak;
  37162. var lastBreak = breaks[breaks.length - 1];
  37163. if (methods.isStartSide(pos, breaks, start, end)) {
  37164. return prop
  37165. } else {
  37166. if (methods.isEndSide(pos, breaks, start, end)) {
  37167. return {
  37168. length: lastBreak.length,
  37169. breaksSize: lastBreak.cumulativeWidth,
  37170. inBreak: false
  37171. }
  37172. }
  37173. }
  37174. for (i = 0, length = breaks.length; i < length; i++) {
  37175. br = breaks[i];
  37176. prevBreak = breaks[i - 1];
  37177. if (methods.isInBreak(pos, br, start, end)) {
  37178. prop.inBreak = true;
  37179. prop.break = br;
  37180. break
  37181. }
  37182. if (prevBreak && methods.isBetweenBreaks(pos, br, prevBreak, start, end)) {
  37183. prop = {
  37184. length: methods.getLength(prevBreak, lastBreak),
  37185. breaksSize: methods.getBreaksSize(prevBreak, lastBreak),
  37186. inBreak: false
  37187. };
  37188. break
  37189. }
  37190. }
  37191. return prop
  37192. },
  37193. isInverted: function() {
  37194. return !(this._options.isHorizontal ^ this._businessRange.invert)
  37195. },
  37196. _getDiscreteInterval: function(categoriesLength, canvasOptions) {
  37197. var correctedCategoriesCount = categoriesLength - (this._options.stick ? 1 : 0);
  37198. return correctedCategoriesCount > 0 ? canvasOptions.canvasLength / correctedCategoriesCount : canvasOptions.canvasLength
  37199. },
  37200. _prepareCanvasOptions: function() {
  37201. var that = this;
  37202. var businessRange = that._businessRange;
  37203. var canvasOptions = that._canvasOptions = getCanvasBounds(businessRange);
  37204. var canvas = that._canvas;
  37205. var breaks = that._breaks;
  37206. var length;
  37207. canvasOptions.startPadding = canvas.startPadding || 0;
  37208. canvasOptions.endPadding = canvas.endPadding || 0;
  37209. if (that._options.isHorizontal) {
  37210. canvasOptions.startPoint = canvas.left + canvasOptions.startPadding;
  37211. length = canvas.width;
  37212. canvasOptions.endPoint = canvas.width - canvas.right - canvasOptions.endPadding;
  37213. canvasOptions.invert = businessRange.invert
  37214. } else {
  37215. canvasOptions.startPoint = canvas.top + canvasOptions.startPadding;
  37216. length = canvas.height;
  37217. canvasOptions.endPoint = canvas.height - canvas.bottom - canvasOptions.endPadding;
  37218. canvasOptions.invert = !businessRange.invert
  37219. }
  37220. that.canvasLength = canvasOptions.canvasLength = canvasOptions.endPoint - canvasOptions.startPoint;
  37221. canvasOptions.rangeDoubleError = Math.pow(10, getPower(canvasOptions.rangeMax - canvasOptions.rangeMin) - getPower(length) - 2);
  37222. canvasOptions.ratioOfCanvasRange = canvasOptions.canvasLength / (canvasOptions.rangeMaxVisible - canvasOptions.rangeMinVisible);
  37223. if (void 0 !== breaks) {
  37224. canvasOptions.ratioOfCanvasRange = (canvasOptions.canvasLength - breaks[breaks.length - 1].cumulativeWidth) / (canvasOptions.rangeMaxVisible - canvasOptions.rangeMinVisible - breaks[breaks.length - 1].length)
  37225. }
  37226. return canvasOptions
  37227. },
  37228. updateCanvas: function(canvas) {
  37229. this._canvas = validateCanvas(canvas);
  37230. this.reinit()
  37231. },
  37232. updateBusinessRange: function(businessRange) {
  37233. var that = this;
  37234. var breaks = businessRange.breaks || [];
  37235. that._businessRange = validateBusinessRange(businessRange);
  37236. that._breaks = breaks.length ? prepareBreaks(breaks, that._businessRange) : void 0;
  37237. that.reinit()
  37238. },
  37239. update: function(businessRange, canvas, options) {
  37240. var that = this;
  37241. that._options = extend(that._options || {}, options);
  37242. that._canvas = validateCanvas(canvas);
  37243. that.updateBusinessRange(businessRange)
  37244. },
  37245. getBusinessRange: function() {
  37246. return this._businessRange
  37247. },
  37248. getEventScale: function(zoomEvent) {
  37249. return zoomEvent.deltaScale || 1
  37250. },
  37251. getCanvasVisibleArea: function() {
  37252. return {
  37253. min: this._canvasOptions.startPoint,
  37254. max: this._canvasOptions.endPoint
  37255. }
  37256. },
  37257. _calculateSpecialValues: function() {
  37258. var that = this;
  37259. var canvasOptions = that._canvasOptions;
  37260. var startPoint = canvasOptions.startPoint - canvasOptions.startPadding;
  37261. var endPoint = canvasOptions.endPoint + canvasOptions.endPadding;
  37262. var range = that._businessRange;
  37263. var minVisible = range.minVisible;
  37264. var maxVisible = range.maxVisible;
  37265. var canvas_position_center_middle = startPoint + canvasOptions.canvasLength / 2;
  37266. var canvas_position_default;
  37267. if (minVisible < 0 && maxVisible > 0 && minVisible !== maxVisible) {
  37268. canvas_position_default = that.translate(0, 1)
  37269. }
  37270. if (!isDefined(canvas_position_default)) {
  37271. var invert = range.invert ^ (minVisible < 0 && maxVisible <= 0);
  37272. if (that._options.isHorizontal) {
  37273. canvas_position_default = invert ? endPoint : startPoint
  37274. } else {
  37275. canvas_position_default = invert ? startPoint : endPoint
  37276. }
  37277. }
  37278. that.sc = {
  37279. canvas_position_default: canvas_position_default,
  37280. canvas_position_left: startPoint,
  37281. canvas_position_top: startPoint,
  37282. canvas_position_center: canvas_position_center_middle,
  37283. canvas_position_middle: canvas_position_center_middle,
  37284. canvas_position_right: endPoint,
  37285. canvas_position_bottom: endPoint,
  37286. canvas_position_start: canvasOptions.invert ? endPoint : startPoint,
  37287. canvas_position_end: canvasOptions.invert ? startPoint : endPoint
  37288. }
  37289. },
  37290. translateSpecialCase: function(value) {
  37291. return this.sc[value]
  37292. },
  37293. _calculateProjection: function(distance) {
  37294. var canvasOptions = this._canvasOptions;
  37295. return canvasOptions.invert ? canvasOptions.endPoint - distance : canvasOptions.startPoint + distance
  37296. },
  37297. _calculateUnProjection: function(distance) {
  37298. var canvasOptions = this._canvasOptions;
  37299. return canvasOptions.invert ? canvasOptions.rangeMaxVisible.valueOf() - distance : canvasOptions.rangeMinVisible.valueOf() + distance
  37300. },
  37301. getMinBarSize: function(minBarSize) {
  37302. var visibleArea = this.getCanvasVisibleArea();
  37303. var minValue = this.from(visibleArea.min + minBarSize);
  37304. return _abs(this.from(visibleArea.min) - (!isDefined(minValue) ? this.from(visibleArea.max) : minValue))
  37305. },
  37306. checkMinBarSize: function(value, minShownValue, stackValue) {
  37307. return _abs(value) < minShownValue ? value >= 0 ? minShownValue : -minShownValue : value
  37308. },
  37309. translate: function(bp, direction) {
  37310. var specialValue = this.translateSpecialCase(bp);
  37311. if (isDefined(specialValue)) {
  37312. return Math.round(specialValue)
  37313. }
  37314. if (isNaN(bp)) {
  37315. return null
  37316. }
  37317. return this.to(bp, direction)
  37318. },
  37319. getInterval: function(interval) {
  37320. var canvasOptions = this._canvasOptions;
  37321. interval = isDefined(interval) ? interval : this._businessRange.interval;
  37322. if (interval) {
  37323. return Math.round(canvasOptions.ratioOfCanvasRange * interval)
  37324. }
  37325. return Math.round(canvasOptions.endPoint - canvasOptions.startPoint)
  37326. },
  37327. zoom: function(translate, scale, wholeRange) {
  37328. var canvasOptions = this._canvasOptions;
  37329. if (canvasOptions.rangeMinVisible.valueOf() === canvasOptions.rangeMaxVisible.valueOf() && 0 !== translate) {
  37330. return this.zoomZeroLengthRange(translate, scale)
  37331. }
  37332. var startPoint = canvasOptions.startPoint;
  37333. var endPoint = canvasOptions.endPoint;
  37334. var isInverted = this.isInverted();
  37335. var newStart = (startPoint + translate) / scale;
  37336. var newEnd = (endPoint + translate) / scale;
  37337. wholeRange = wholeRange || {};
  37338. var minPoint = this.to(isInverted ? wholeRange.endValue : wholeRange.startValue);
  37339. var maxPoint = this.to(isInverted ? wholeRange.startValue : wholeRange.endValue);
  37340. var min;
  37341. var max;
  37342. if (minPoint > newStart) {
  37343. newEnd -= newStart - minPoint;
  37344. newStart = minPoint;
  37345. min = isInverted ? wholeRange.endValue : wholeRange.startValue
  37346. }
  37347. if (maxPoint < newEnd) {
  37348. newStart -= newEnd - maxPoint;
  37349. newEnd = maxPoint;
  37350. max = isInverted ? wholeRange.startValue : wholeRange.endValue
  37351. }
  37352. if (maxPoint - minPoint < newEnd - newStart) {
  37353. newStart = minPoint;
  37354. newEnd = maxPoint
  37355. }
  37356. translate = (endPoint - startPoint) * newStart / (newEnd - newStart) - startPoint;
  37357. scale = (startPoint + translate) / newStart || 1;
  37358. min = isDefined(min) ? min : adjust(this.from(newStart, 1));
  37359. max = isDefined(max) ? max : adjust(this.from(newEnd, -1));
  37360. if (min > max) {
  37361. min = min > wholeRange.endValue ? wholeRange.endValue : min;
  37362. max = max < wholeRange.startValue ? wholeRange.startValue : max
  37363. } else {
  37364. min = min < wholeRange.startValue ? wholeRange.startValue : min;
  37365. max = max > wholeRange.endValue ? wholeRange.endValue : max
  37366. }
  37367. return {
  37368. min: min,
  37369. max: max,
  37370. translate: adjust(translate),
  37371. scale: adjust(scale)
  37372. }
  37373. },
  37374. zoomZeroLengthRange: function(translate, scale) {
  37375. var canvasOptions = this._canvasOptions;
  37376. var min = canvasOptions.rangeMin;
  37377. var max = canvasOptions.rangeMax;
  37378. var correction = (max.valueOf() !== min.valueOf() ? max.valueOf() - min.valueOf() : _abs(canvasOptions.rangeMinVisible.valueOf() - min.valueOf())) / canvasOptions.canvasLength;
  37379. var isDateTime = typeUtils.isDate(max) || typeUtils.isDate(min);
  37380. var isLogarithmic = "logarithmic" === this._businessRange.axisType;
  37381. var newMin = canvasOptions.rangeMinVisible.valueOf() - correction;
  37382. var newMax = canvasOptions.rangeMaxVisible.valueOf() + correction;
  37383. newMin = isLogarithmic ? adjust(Math.pow(canvasOptions.base, newMin)) : isDateTime ? new Date(newMin) : newMin;
  37384. newMax = isLogarithmic ? adjust(Math.pow(canvasOptions.base, newMax)) : isDateTime ? new Date(newMax) : newMax;
  37385. return {
  37386. min: newMin,
  37387. max: newMax,
  37388. translate: translate,
  37389. scale: scale
  37390. }
  37391. },
  37392. getMinScale: function(zoom) {
  37393. return zoom ? 1.1 : .9
  37394. },
  37395. getScale: function(val1, val2) {
  37396. var canvasOptions = this._canvasOptions;
  37397. if (canvasOptions.rangeMax === canvasOptions.rangeMin) {
  37398. return 1
  37399. }
  37400. val1 = isDefined(val1) ? this._fromValue(val1) : canvasOptions.rangeMin;
  37401. val2 = isDefined(val2) ? this._fromValue(val2) : canvasOptions.rangeMax;
  37402. return (canvasOptions.rangeMax - canvasOptions.rangeMin) / Math.abs(val1 - val2)
  37403. },
  37404. isValid: function(value) {
  37405. var co = this._canvasOptions;
  37406. value = this._fromValue(value);
  37407. return null !== value && !isNaN(value) && value.valueOf() + co.rangeDoubleError >= co.rangeMin && value.valueOf() - co.rangeDoubleError <= co.rangeMax
  37408. },
  37409. getCorrectValue: function(value, direction) {
  37410. var that = this;
  37411. var breaks = that._breaks;
  37412. var prop;
  37413. value = that._fromValue(value);
  37414. if (that._breaks) {
  37415. prop = that._checkValueAboutBreaks(breaks, value, "trFrom", "trTo", that._checkingMethodsAboutBreaks[0]);
  37416. if (true === prop.inBreak) {
  37417. return that._toValue(direction > 0 ? prop.break.trTo : prop.break.trFrom)
  37418. }
  37419. }
  37420. return that._toValue(value)
  37421. },
  37422. to: function(bp, direction) {
  37423. var range = this.getBusinessRange();
  37424. if (isDefined(range.maxVisible) && isDefined(range.minVisible) && range.maxVisible.valueOf() === range.minVisible.valueOf()) {
  37425. if (!isDefined(bp) || range.maxVisible.valueOf() !== bp.valueOf()) {
  37426. return null
  37427. }
  37428. return this.translateSpecialCase(0 === bp && this._options.shiftZeroValue ? "canvas_position_default" : "canvas_position_middle")
  37429. }
  37430. bp = this._fromValue(bp);
  37431. var that = this;
  37432. var canvasOptions = that._canvasOptions;
  37433. var breaks = that._breaks;
  37434. var prop = {
  37435. length: 0
  37436. };
  37437. var commonBreakSize = 0;
  37438. if (void 0 !== breaks) {
  37439. prop = that._checkValueAboutBreaks(breaks, bp, "trFrom", "trTo", that._checkingMethodsAboutBreaks[0]);
  37440. commonBreakSize = isDefined(prop.breaksSize) ? prop.breaksSize : 0
  37441. }
  37442. if (true === prop.inBreak) {
  37443. if (direction > 0) {
  37444. return prop.break.start
  37445. } else {
  37446. if (direction < 0) {
  37447. return prop.break.end
  37448. } else {
  37449. return null
  37450. }
  37451. }
  37452. }
  37453. return that._conversionValue(that._calculateProjection((bp - canvasOptions.rangeMinVisible - prop.length) * canvasOptions.ratioOfCanvasRange + commonBreakSize))
  37454. },
  37455. from: function(pos, direction) {
  37456. var that = this;
  37457. var breaks = that._breaks;
  37458. var prop = {
  37459. length: 0
  37460. };
  37461. var canvasOptions = that._canvasOptions;
  37462. var startPoint = canvasOptions.startPoint;
  37463. var commonBreakSize = 0;
  37464. if (void 0 !== breaks) {
  37465. prop = that._checkValueAboutBreaks(breaks, pos, "start", "end", that._checkingMethodsAboutBreaks[1]);
  37466. commonBreakSize = isDefined(prop.breaksSize) ? prop.breaksSize : 0
  37467. }
  37468. if (true === prop.inBreak) {
  37469. if (direction > 0) {
  37470. return that._toValue(prop.break.trTo)
  37471. } else {
  37472. if (direction < 0) {
  37473. return that._toValue(prop.break.trFrom)
  37474. } else {
  37475. return null
  37476. }
  37477. }
  37478. }
  37479. return that._toValue(that._calculateUnProjection((pos - startPoint - commonBreakSize) / canvasOptions.ratioOfCanvasRange + prop.length))
  37480. },
  37481. isValueProlonged: false,
  37482. getRange: function() {
  37483. return [this._toValue(this._canvasOptions.rangeMin), this._toValue(this._canvasOptions.rangeMax)]
  37484. },
  37485. getScreenRange: function() {
  37486. return [this._canvasOptions.startPoint, this._canvasOptions.endPoint]
  37487. },
  37488. add: function(value, diff, dir) {
  37489. return this._add(value, diff, (this._businessRange.invert ? -1 : 1) * dir)
  37490. },
  37491. _add: function(value, diff, coeff) {
  37492. return this._toValue(this._fromValue(value) + diff * coeff)
  37493. },
  37494. _fromValue: function(value) {
  37495. return null !== value ? Number(value) : null
  37496. },
  37497. _toValue: function(value) {
  37498. return null !== value ? Number(value) : null
  37499. },
  37500. ratioOfCanvasRange: function() {
  37501. return this._canvasOptions.ratioOfCanvasRange
  37502. }
  37503. }
  37504. },
  37505. /*!************************************************************!*\
  37506. !*** ./artifacts/transpiled/viz/gauges/base_indicators.js ***!
  37507. \************************************************************/
  37508. /*! dynamic exports provided */
  37509. /*! all exports used */
  37510. function(module, exports, __webpack_require__) {
  37511. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  37512. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  37513. var _isFinite = isFinite;
  37514. var _Number = Number;
  37515. var _round = Math.round;
  37516. var baseGaugeModule = __webpack_require__( /*! ./base_gauge */ 145);
  37517. var _formatValue = baseGaugeModule.formatValue;
  37518. var _getSampleText = baseGaugeModule.getSampleText;
  37519. var _patchFontOptions = __webpack_require__( /*! ../core/utils */ 10).patchFontOptions;
  37520. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  37521. var Class = __webpack_require__( /*! ../../core/class */ 15);
  37522. var BaseElement = Class.inherit({
  37523. ctor: function(parameters) {
  37524. var that = this;
  37525. each(parameters, function(name, value) {
  37526. that["_" + name] = value
  37527. });
  37528. that._init()
  37529. },
  37530. dispose: function() {
  37531. var that = this;
  37532. that._dispose();
  37533. each(that, function(name) {
  37534. that[name] = null
  37535. });
  37536. return that
  37537. },
  37538. getOffset: function() {
  37539. return _Number(this._options.offset) || 0
  37540. }
  37541. });
  37542. var BaseIndicator = BaseElement.inherit({
  37543. _init: function() {
  37544. var that = this;
  37545. that._rootElement = that._createRoot().linkOn(that._owner, {
  37546. name: "value-indicator",
  37547. after: "core"
  37548. });
  37549. that._trackerElement = that._createTracker()
  37550. },
  37551. _dispose: function() {
  37552. this._rootElement.linkOff()
  37553. },
  37554. _setupAnimation: function() {
  37555. var that = this;
  37556. if (that._options.animation) {
  37557. that._animation = {
  37558. step: function(pos) {
  37559. that._actualValue = that._animation.start + that._animation.delta * pos;
  37560. that._actualPosition = that._translator.translate(that._actualValue);
  37561. that._move()
  37562. },
  37563. duration: that._options.animation.duration > 0 ? _Number(that._options.animation.duration) : 0,
  37564. easing: that._options.animation.easing
  37565. }
  37566. }
  37567. },
  37568. _runAnimation: function(value) {
  37569. var that = this;
  37570. var animation = that._animation;
  37571. animation.start = that._actualValue;
  37572. animation.delta = value - that._actualValue;
  37573. that._rootElement.animate({
  37574. _: 0
  37575. }, {
  37576. step: animation.step,
  37577. duration: animation.duration,
  37578. easing: animation.easing
  37579. })
  37580. },
  37581. _createRoot: function() {
  37582. return this._renderer.g().attr({
  37583. "class": this._className
  37584. })
  37585. },
  37586. _createTracker: function() {
  37587. return this._renderer.path([], "area")
  37588. },
  37589. _getTrackerSettings: noop,
  37590. clean: function() {
  37591. var that = this;
  37592. that._animation && that._rootElement.stopAnimation();
  37593. that._rootElement.linkRemove().clear();
  37594. that._clear();
  37595. that._tracker.detach(that._trackerElement);
  37596. that._options = that.enabled = that._animation = null;
  37597. return that
  37598. },
  37599. render: function(options) {
  37600. var that = this;
  37601. that.type = options.type;
  37602. that._options = options;
  37603. that._actualValue = that._currentValue = that._translator.adjust(that._options.currentValue);
  37604. that.enabled = that._isEnabled();
  37605. if (that.enabled) {
  37606. that._setupAnimation();
  37607. that._rootElement.attr({
  37608. fill: that._options.color
  37609. }).linkAppend();
  37610. that._tracker.attach(that._trackerElement, that, that._trackerInfo)
  37611. }
  37612. return that
  37613. },
  37614. resize: function(layout) {
  37615. var that = this;
  37616. that._rootElement.clear();
  37617. that._clear();
  37618. that.visible = that._isVisible(layout);
  37619. if (that.visible) {
  37620. extend(that._options, layout);
  37621. that._actualPosition = that._translator.translate(that._actualValue);
  37622. that._render();
  37623. that._trackerElement.attr(that._getTrackerSettings());
  37624. that._move()
  37625. }
  37626. return that
  37627. },
  37628. value: function(arg, _noAnimation) {
  37629. var that = this;
  37630. var val;
  37631. var rootElement = this._rootElement;
  37632. var visibility = null;
  37633. if (void 0 === arg) {
  37634. return that._currentValue
  37635. }
  37636. if (null === arg) {
  37637. visibility = "hidden";
  37638. that._currentValue = arg
  37639. } else {
  37640. val = that._translator.adjust(arg);
  37641. if (that._currentValue !== val && _isFinite(val)) {
  37642. that._currentValue = val;
  37643. if (that.visible) {
  37644. if (that._animation && !_noAnimation) {
  37645. that._runAnimation(val)
  37646. } else {
  37647. that._actualValue = val;
  37648. that._actualPosition = that._translator.translate(val);
  37649. that._move()
  37650. }
  37651. }
  37652. }
  37653. }
  37654. rootElement.attr({
  37655. visibility: visibility
  37656. });
  37657. return that
  37658. },
  37659. _isEnabled: null,
  37660. _isVisible: null,
  37661. _render: null,
  37662. _clear: null,
  37663. _move: null
  37664. });
  37665. var COEFFICIENTS_MAP = {};
  37666. COEFFICIENTS_MAP["right-bottom"] = COEFFICIENTS_MAP.rb = [0, -1, -1, 0, 0, 1, 1, 0];
  37667. COEFFICIENTS_MAP["bottom-right"] = COEFFICIENTS_MAP.br = [-1, 0, 0, -1, 1, 0, 0, 1];
  37668. COEFFICIENTS_MAP["left-bottom"] = COEFFICIENTS_MAP.lb = [0, -1, 1, 0, 0, 1, -1, 0];
  37669. COEFFICIENTS_MAP["bottom-left"] = COEFFICIENTS_MAP.bl = [1, 0, 0, -1, -1, 0, 0, 1];
  37670. COEFFICIENTS_MAP["left-top"] = COEFFICIENTS_MAP.lt = [0, 1, 1, 0, 0, -1, -1, 0];
  37671. COEFFICIENTS_MAP["top-left"] = COEFFICIENTS_MAP.tl = [1, 0, 0, 1, -1, 0, 0, -1];
  37672. COEFFICIENTS_MAP["right-top"] = COEFFICIENTS_MAP.rt = [0, 1, -1, 0, 0, -1, 1, 0];
  37673. COEFFICIENTS_MAP["top-right"] = COEFFICIENTS_MAP.tr = [-1, 0, 0, 1, 1, 0, 0, -1];
  37674. function getTextCloudInfo(options) {
  37675. var x = options.x;
  37676. var y = options.y;
  37677. var type = COEFFICIENTS_MAP[options.type];
  37678. var cloudWidth = options.textWidth + 2 * options.horMargin;
  37679. var cloudHeight = options.textHeight + 2 * options.verMargin;
  37680. var tailWidth;
  37681. var tailHeight;
  37682. var cx = x;
  37683. var cy = y;
  37684. tailWidth = tailHeight = options.tailLength;
  37685. if (1 & type[0]) {
  37686. tailHeight = Math.min(tailHeight, cloudHeight / 3)
  37687. } else {
  37688. tailWidth = Math.min(tailWidth, cloudWidth / 3)
  37689. }
  37690. return {
  37691. cx: _round(cx + type[0] * tailWidth + (type[0] + type[2]) * cloudWidth / 2),
  37692. cy: _round(cy + type[1] * tailHeight + (type[1] + type[3]) * cloudHeight / 2),
  37693. points: [_round(x), _round(y), _round(x += type[0] * (cloudWidth + tailWidth)), _round(y += type[1] * (cloudHeight + tailHeight)), _round(x += type[2] * cloudWidth), _round(y += type[3] * cloudHeight), _round(x += type[4] * cloudWidth), _round(y += type[5] * cloudHeight), _round(x += type[6] * (cloudWidth - tailWidth)), _round(y += type[7] * (cloudHeight - tailHeight))]
  37694. }
  37695. }
  37696. var BaseTextCloudMarker = BaseIndicator.inherit({
  37697. _move: function() {
  37698. var that = this;
  37699. var textCloudOptions = that._getTextCloudOptions();
  37700. var text = _formatValue(that._actualValue, that._options.text);
  37701. that._text.attr({
  37702. text: text
  37703. });
  37704. var bBox = that._text.getBBox();
  37705. var info = getTextCloudInfo({
  37706. x: textCloudOptions.x,
  37707. y: textCloudOptions.y,
  37708. textWidth: bBox.width || text.length * that._textUnitWidth,
  37709. textHeight: bBox.height || that._textHeight,
  37710. horMargin: that._options.horizontalOffset,
  37711. verMargin: that._options.verticalOffset,
  37712. tailLength: that._options.arrowLength,
  37713. type: textCloudOptions.type
  37714. });
  37715. that._text.attr({
  37716. x: info.cx,
  37717. y: info.cy + that._textVerticalOffset
  37718. });
  37719. that._cloud.attr({
  37720. points: info.points
  37721. });
  37722. that._trackerElement && that._trackerElement.attr({
  37723. points: info.points
  37724. })
  37725. },
  37726. _measureText: function() {
  37727. var that = this;
  37728. var root;
  37729. var text;
  37730. var bBox;
  37731. var sampleText;
  37732. if (!that._textVerticalOffset) {
  37733. root = that._createRoot().append(that._owner);
  37734. sampleText = _getSampleText(that._translator, that._options.text);
  37735. text = that._renderer.text(sampleText, 0, 0).attr({
  37736. align: "center"
  37737. }).css(_patchFontOptions(that._options.text.font)).append(root);
  37738. bBox = text.getBBox();
  37739. root.remove();
  37740. that._textVerticalOffset = -bBox.y - bBox.height / 2;
  37741. that._textWidth = bBox.width;
  37742. that._textHeight = bBox.height;
  37743. that._textUnitWidth = that._textWidth / sampleText.length;
  37744. that._textFullWidth = that._textWidth + 2 * that._options.horizontalOffset;
  37745. that._textFullHeight = that._textHeight + 2 * that._options.verticalOffset
  37746. }
  37747. },
  37748. _render: function() {
  37749. var that = this;
  37750. that._measureText();
  37751. that._cloud = that._cloud || that._renderer.path([], "area").append(that._rootElement);
  37752. that._text = that._text || that._renderer.text().append(that._rootElement);
  37753. that._text.attr({
  37754. align: "center"
  37755. }).css(_patchFontOptions(that._options.text.font))
  37756. },
  37757. _clear: function() {
  37758. delete this._cloud;
  37759. delete this._text
  37760. },
  37761. getTooltipParameters: function() {
  37762. var position = this._getTextCloudOptions();
  37763. return {
  37764. x: position.x,
  37765. y: position.y,
  37766. value: this._currentValue,
  37767. color: this._options.color
  37768. }
  37769. }
  37770. });
  37771. var BaseRangeBar = BaseIndicator.inherit({
  37772. _measureText: function() {
  37773. var that = this;
  37774. var root;
  37775. var text;
  37776. var bBox;
  37777. that._hasText = that._isTextVisible();
  37778. if (that._hasText && !that._textVerticalOffset) {
  37779. root = that._createRoot().append(that._owner);
  37780. text = that._renderer.text(_getSampleText(that._translator, that._options.text), 0, 0).attr({
  37781. "class": "dxg-text",
  37782. align: "center"
  37783. }).css(_patchFontOptions(that._options.text.font)).append(root);
  37784. bBox = text.getBBox();
  37785. root.remove();
  37786. that._textVerticalOffset = -bBox.y - bBox.height / 2;
  37787. that._textWidth = bBox.width;
  37788. that._textHeight = bBox.height
  37789. }
  37790. },
  37791. _move: function() {
  37792. var that = this;
  37793. that._updateBarItemsPositions();
  37794. if (that._hasText) {
  37795. that._text.attr({
  37796. text: _formatValue(that._actualValue, that._options.text)
  37797. });
  37798. that._updateTextPosition();
  37799. that._updateLinePosition()
  37800. }
  37801. },
  37802. _updateBarItems: function() {
  37803. var that = this;
  37804. var options = that._options;
  37805. var spaceColor;
  37806. var translator = that._translator;
  37807. that._setBarSides();
  37808. that._startPosition = translator.translate(translator.getDomainStart());
  37809. that._endPosition = translator.translate(translator.getDomainEnd());
  37810. that._basePosition = translator.translate(options.baseValue);
  37811. that._space = that._getSpace();
  37812. var backgroundColor = options.backgroundColor || "none";
  37813. if ("none" !== backgroundColor && that._space > 0) {
  37814. spaceColor = options.containerBackgroundColor || "none"
  37815. } else {
  37816. that._space = 0;
  37817. spaceColor = "none"
  37818. }
  37819. that._backItem1.attr({
  37820. fill: backgroundColor
  37821. });
  37822. that._backItem2.attr({
  37823. fill: backgroundColor
  37824. });
  37825. that._spaceItem1.attr({
  37826. fill: spaceColor
  37827. });
  37828. that._spaceItem2.attr({
  37829. fill: spaceColor
  37830. })
  37831. },
  37832. _getSpace: function() {
  37833. return 0
  37834. },
  37835. _updateTextItems: function() {
  37836. var that = this;
  37837. if (that._hasText) {
  37838. that._line = that._line || that._renderer.path([], "line").attr({
  37839. "class": "dxg-main-bar",
  37840. "stroke-linecap": "square"
  37841. }).append(that._rootElement);
  37842. that._text = that._text || that._renderer.text("", 0, 0).attr({
  37843. "class": "dxg-text"
  37844. }).append(that._rootElement);
  37845. that._text.attr({
  37846. align: that._getTextAlign()
  37847. }).css(that._getFontOptions());
  37848. that._setTextItemsSides()
  37849. } else {
  37850. if (that._line) {
  37851. that._line.remove();
  37852. delete that._line
  37853. }
  37854. if (that._text) {
  37855. that._text.remove();
  37856. delete that._text
  37857. }
  37858. }
  37859. },
  37860. _isTextVisible: function() {
  37861. return false
  37862. },
  37863. _getTextAlign: function() {
  37864. return "center"
  37865. },
  37866. _getFontOptions: function() {
  37867. var options = this._options;
  37868. var font = options.text.font;
  37869. if (!font || !font.color) {
  37870. font = extend({}, font, {
  37871. color: options.color
  37872. })
  37873. }
  37874. return _patchFontOptions(font)
  37875. },
  37876. _updateBarItemsPositions: function() {
  37877. var that = this;
  37878. var positions = that._getPositions();
  37879. that._backItem1.attr(that._buildItemSettings(positions.start, positions.back1));
  37880. that._backItem2.attr(that._buildItemSettings(positions.back2, positions.end));
  37881. that._spaceItem1.attr(that._buildItemSettings(positions.back1, positions.main1));
  37882. that._spaceItem2.attr(that._buildItemSettings(positions.main2, positions.back2));
  37883. that._mainItem.attr(that._buildItemSettings(positions.main1, positions.main2));
  37884. that._trackerElement && that._trackerElement.attr(that._buildItemSettings(positions.main1, positions.main2))
  37885. },
  37886. _render: function() {
  37887. var that = this;
  37888. that._measureText();
  37889. if (!that._backItem1) {
  37890. that._backItem1 = that._createBarItem();
  37891. that._backItem1.attr({
  37892. "class": "dxg-back-bar"
  37893. })
  37894. }
  37895. if (!that._backItem2) {
  37896. that._backItem2 = that._createBarItem();
  37897. that._backItem2.attr({
  37898. "class": "dxg-back-bar"
  37899. })
  37900. }
  37901. if (!that._spaceItem1) {
  37902. that._spaceItem1 = that._createBarItem();
  37903. that._spaceItem1.attr({
  37904. "class": "dxg-space-bar"
  37905. })
  37906. }
  37907. if (!that._spaceItem2) {
  37908. that._spaceItem2 = that._createBarItem();
  37909. that._spaceItem2.attr({
  37910. "class": "dxg-space-bar"
  37911. })
  37912. }
  37913. if (!that._mainItem) {
  37914. that._mainItem = that._createBarItem();
  37915. that._mainItem.attr({
  37916. "class": "dxg-main-bar"
  37917. })
  37918. }
  37919. that._updateBarItems();
  37920. that._updateTextItems()
  37921. },
  37922. _clear: function() {
  37923. var that = this;
  37924. delete that._backItem1;
  37925. delete that._backItem2;
  37926. delete that._spaceItem1;
  37927. delete that._spaceItem2;
  37928. delete that._mainItem;
  37929. delete that._hasText;
  37930. delete that._line;
  37931. delete that._text
  37932. },
  37933. getTooltipParameters: function() {
  37934. var position = this._getTooltipPosition();
  37935. return {
  37936. x: position.x,
  37937. y: position.y,
  37938. value: this._currentValue,
  37939. color: this._options.color,
  37940. offset: 0
  37941. }
  37942. }
  37943. });
  37944. exports.BaseElement = BaseElement;
  37945. exports.BaseIndicator = BaseIndicator;
  37946. exports.BaseTextCloudMarker = BaseTextCloudMarker;
  37947. exports.BaseRangeBar = BaseRangeBar;
  37948. exports.getTextCloudInfo = getTextCloudInfo
  37949. },
  37950. /*!*****************************************************!*\
  37951. !*** ./artifacts/transpiled/viz/tree_map/common.js ***!
  37952. \*****************************************************/
  37953. /*! dynamic exports provided */
  37954. /*! all exports used */
  37955. function(module, exports, __webpack_require__) {
  37956. var _patchFontOptions = __webpack_require__( /*! ../core/utils */ 10).patchFontOptions;
  37957. exports.buildRectAppearance = function(option) {
  37958. var border = option.border || {};
  37959. return {
  37960. fill: option.color,
  37961. opacity: option.opacity,
  37962. stroke: border.color,
  37963. "stroke-width": border.width,
  37964. "stroke-opacity": border.opacity,
  37965. hatching: option.hatching
  37966. }
  37967. };
  37968. exports.buildTextAppearance = function(options, filter) {
  37969. return {
  37970. attr: options["stroke-width"] ? {
  37971. stroke: options.stroke,
  37972. "stroke-width": options["stroke-width"],
  37973. "stroke-opacity": options["stroke-opacity"],
  37974. filter: filter
  37975. } : {},
  37976. css: _patchFontOptions(options.font)
  37977. }
  37978. }
  37979. },
  37980. /*!********************************************************!*\
  37981. !*** ./artifacts/transpiled/viz/components/tracker.js ***!
  37982. \********************************************************/
  37983. /*! dynamic exports provided */
  37984. /*! all exports used */
  37985. function(module, exports, __webpack_require__) {
  37986. var _eventData = __webpack_require__( /*! ../../events/utils */ 8).eventData;
  37987. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  37988. var clickEventName = __webpack_require__( /*! ../../events/click */ 19).name;
  37989. var downPointerEventName = __webpack_require__( /*! ../../events/pointer */ 23).down;
  37990. var movePointerEventName = __webpack_require__( /*! ../../events/pointer */ 23).move;
  37991. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  37992. function Tracker(parameters) {
  37993. this._initHandlers(parameters)
  37994. }
  37995. Tracker.prototype = {
  37996. constructor: Tracker,
  37997. _initHandlers: function(parameters) {
  37998. var document = domAdapter.getDocument();
  37999. parameters.getCoords = function(e) {
  38000. var data = _eventData(e);
  38001. var offset = parameters.widget._renderer.getRootOffset();
  38002. return [data.x - offset.left, data.y - offset.top]
  38003. };
  38004. parameters.root.on(clickEventName, clickHandler);
  38005. parameters.root.on(downPointerEventName, downHandler);
  38006. eventsEngine.on(document, downPointerEventName, downHandler);
  38007. eventsEngine.on(document, movePointerEventName, moveHandler);
  38008. this._disposeHandlers = function() {
  38009. parameters.root.off(clickEventName, clickHandler);
  38010. parameters.root.off(downPointerEventName, downHandler);
  38011. eventsEngine.off(document, downPointerEventName, downHandler);
  38012. eventsEngine.off(document, movePointerEventName, moveHandler)
  38013. };
  38014. function clickHandler(e) {
  38015. processClick(e, parameters)
  38016. }
  38017. var isRootDown = false;
  38018. function downHandler(e) {
  38019. if (isRootDown) {
  38020. isRootDown = false
  38021. } else {
  38022. if (void 0 !== parameters.getData(e)) {
  38023. isRootDown = true
  38024. }
  38025. moveHandler(e)
  38026. }
  38027. }
  38028. function moveHandler(e) {
  38029. processHover(e, parameters);
  38030. parameters.widget._getOption("tooltip").enabled && processTooltip(e, parameters)
  38031. }
  38032. },
  38033. dispose: function() {
  38034. this._disposeHandlers()
  38035. }
  38036. };
  38037. function processClick(e, params) {
  38038. var id = params.getData(e);
  38039. if (id >= 0) {
  38040. params.click({
  38041. node: params.getNode(id),
  38042. coords: params.getCoords(e),
  38043. event: e
  38044. })
  38045. }
  38046. }
  38047. function processHover(e, params) {
  38048. var id = params.getData(e);
  38049. if (id >= 0) {
  38050. params.getNode(id).setHover()
  38051. } else {
  38052. params.widget.clearHover()
  38053. }
  38054. }
  38055. function processTooltip(e, params) {
  38056. var id = params.getData(e, true);
  38057. var coords;
  38058. if (id >= 0) {
  38059. coords = _eventData(e);
  38060. params.getNode(id).showTooltip([coords.x, coords.y])
  38061. } else {
  38062. params.widget.hideTooltip()
  38063. }
  38064. }
  38065. module.exports.Tracker = Tracker
  38066. },
  38067. /*!****************************************************!*\
  38068. !*** ./artifacts/transpiled/core/renderer_base.js ***!
  38069. \****************************************************/
  38070. /*! dynamic exports provided */
  38071. /*! all exports used */
  38072. function(module, exports, __webpack_require__) {
  38073. var dataUtils = __webpack_require__( /*! ./element_data */ 39);
  38074. var domAdapter = __webpack_require__( /*! ./dom_adapter */ 11);
  38075. var windowUtils = __webpack_require__( /*! ./utils/window */ 7);
  38076. var window = windowUtils.getWindow();
  38077. var typeUtils = __webpack_require__( /*! ./utils/type */ 1);
  38078. var styleUtils = __webpack_require__( /*! ./utils/style */ 85);
  38079. var sizeUtils = __webpack_require__( /*! ./utils/size */ 171);
  38080. var htmlParser = __webpack_require__( /*! ./utils/html_parser */ 255);
  38081. var renderer = function(selector, context) {
  38082. return new initRender(selector, context)
  38083. };
  38084. var initRender = function(selector, context) {
  38085. if (!selector) {
  38086. this.length = 0;
  38087. return this
  38088. }
  38089. if ("string" === typeof selector) {
  38090. if ("body" === selector) {
  38091. this[0] = context ? context.body : domAdapter.getBody();
  38092. this.length = 1;
  38093. return this
  38094. }
  38095. context = context || domAdapter.getDocument();
  38096. if ("<" === selector[0]) {
  38097. this[0] = domAdapter.createElement(selector.slice(1, -1), context);
  38098. this.length = 1;
  38099. return this
  38100. } [].push.apply(this, domAdapter.querySelectorAll(context, selector));
  38101. return this
  38102. } else {
  38103. if (domAdapter.isNode(selector) || typeUtils.isWindow(selector)) {
  38104. this[0] = selector;
  38105. this.length = 1;
  38106. return this
  38107. } else {
  38108. if (Array.isArray(selector)) {
  38109. [].push.apply(this, selector);
  38110. return this
  38111. }
  38112. }
  38113. }
  38114. return renderer(selector.toArray ? selector.toArray() : [selector])
  38115. };
  38116. renderer.fn = {
  38117. dxRenderer: true
  38118. };
  38119. initRender.prototype = renderer.fn;
  38120. var repeatMethod = function(methodName, args) {
  38121. for (var i = 0; i < this.length; i++) {
  38122. var item = renderer(this[i]);
  38123. item[methodName].apply(item, args)
  38124. }
  38125. return this
  38126. };
  38127. var setAttributeValue = function(element, attrName, value) {
  38128. if (void 0 !== value && null !== value) {
  38129. domAdapter.setAttribute(element, attrName, value)
  38130. } else {
  38131. domAdapter.removeAttribute(element, attrName)
  38132. }
  38133. };
  38134. initRender.prototype.show = function() {
  38135. return this.toggle(true)
  38136. };
  38137. initRender.prototype.hide = function() {
  38138. return this.toggle(false)
  38139. };
  38140. initRender.prototype.toggle = function(value) {
  38141. if (this[0]) {
  38142. this.toggleClass("dx-state-invisible", !value)
  38143. }
  38144. return this
  38145. };
  38146. initRender.prototype.attr = function(attrName, value) {
  38147. if (this.length > 1 && arguments.length > 1) {
  38148. return repeatMethod.call(this, "attr", arguments)
  38149. }
  38150. if (!this[0]) {
  38151. if (typeUtils.isObject(attrName) || void 0 !== value) {
  38152. return this
  38153. } else {
  38154. return
  38155. }
  38156. }
  38157. if (!this[0].getAttribute) {
  38158. return this.prop(attrName, value)
  38159. }
  38160. if ("string" === typeof attrName && 1 === arguments.length) {
  38161. var result = this[0].getAttribute(attrName);
  38162. return null == result ? void 0 : result
  38163. } else {
  38164. if (typeUtils.isPlainObject(attrName)) {
  38165. for (var key in attrName) {
  38166. this.attr(key, attrName[key])
  38167. }
  38168. } else {
  38169. setAttributeValue(this[0], attrName, value)
  38170. }
  38171. }
  38172. return this
  38173. };
  38174. initRender.prototype.removeAttr = function(attrName) {
  38175. this[0] && domAdapter.removeAttribute(this[0], attrName);
  38176. return this
  38177. };
  38178. initRender.prototype.prop = function(propName, value) {
  38179. if (!this[0]) {
  38180. return this
  38181. }
  38182. if ("string" === typeof propName && 1 === arguments.length) {
  38183. return this[0][propName]
  38184. } else {
  38185. if (typeUtils.isPlainObject(propName)) {
  38186. for (var key in propName) {
  38187. this.prop(key, propName[key])
  38188. }
  38189. } else {
  38190. domAdapter.setProperty(this[0], propName, value)
  38191. }
  38192. }
  38193. return this
  38194. };
  38195. initRender.prototype.addClass = function(className) {
  38196. return this.toggleClass(className, true)
  38197. };
  38198. initRender.prototype.removeClass = function(className) {
  38199. return this.toggleClass(className, false)
  38200. };
  38201. initRender.prototype.hasClass = function(className) {
  38202. if (!this[0] || void 0 === this[0].className) {
  38203. return false
  38204. }
  38205. var classNames = className.split(" ");
  38206. for (var i = 0; i < classNames.length; i++) {
  38207. if (this[0].classList) {
  38208. if (this[0].classList.contains(classNames[i])) {
  38209. return true
  38210. }
  38211. } else {
  38212. var _className = typeUtils.isString(this[0].className) ? this[0].className : domAdapter.getAttribute(this[0], "class");
  38213. if ((_className || "").split(" ").indexOf(classNames[i]) >= 0) {
  38214. return true
  38215. }
  38216. }
  38217. }
  38218. return false
  38219. };
  38220. initRender.prototype.toggleClass = function(className, value) {
  38221. if (this.length > 1) {
  38222. return repeatMethod.call(this, "toggleClass", arguments)
  38223. }
  38224. if (!this[0] || !className) {
  38225. return this
  38226. }
  38227. value = void 0 === value ? !this.hasClass(className) : value;
  38228. var classNames = className.split(" ");
  38229. for (var i = 0; i < classNames.length; i++) {
  38230. domAdapter.setClass(this[0], classNames[i], value)
  38231. }
  38232. return this
  38233. };
  38234. ["width", "height", "outerWidth", "outerHeight", "innerWidth", "innerHeight"].forEach(function(methodName) {
  38235. var partialName = methodName.toLowerCase().indexOf("width") >= 0 ? "Width" : "Height";
  38236. var propName = partialName.toLowerCase();
  38237. var isOuter = 0 === methodName.indexOf("outer");
  38238. var isInner = 0 === methodName.indexOf("inner");
  38239. initRender.prototype[methodName] = function(value) {
  38240. if (this.length > 1 && arguments.length > 0) {
  38241. return repeatMethod.call(this, methodName, arguments)
  38242. }
  38243. var element = this[0];
  38244. if (!element) {
  38245. return
  38246. }
  38247. if (typeUtils.isWindow(element)) {
  38248. return isOuter ? element["inner" + partialName] : domAdapter.getDocumentElement()["client" + partialName]
  38249. }
  38250. if (domAdapter.isDocument(element)) {
  38251. var documentElement = domAdapter.getDocumentElement();
  38252. var body = domAdapter.getBody();
  38253. return Math.max(body["scroll" + partialName], body["offset" + partialName], documentElement["scroll" + partialName], documentElement["offset" + partialName], documentElement["client" + partialName])
  38254. }
  38255. if (0 === arguments.length || "boolean" === typeof value) {
  38256. var include = {
  38257. paddings: isInner || isOuter,
  38258. borders: isOuter,
  38259. margins: value
  38260. };
  38261. return sizeUtils.getSize(element, propName, include)
  38262. }
  38263. if (void 0 === value || null === value) {
  38264. return this
  38265. }
  38266. if (typeUtils.isNumeric(value)) {
  38267. var elementStyles = window.getComputedStyle(element);
  38268. var sizeAdjustment = sizeUtils.getElementBoxParams(propName, elementStyles);
  38269. var isBorderBox = "border-box" === elementStyles.boxSizing;
  38270. value = Number(value);
  38271. if (isOuter) {
  38272. value -= isBorderBox ? 0 : sizeAdjustment.border + sizeAdjustment.padding
  38273. } else {
  38274. if (isInner) {
  38275. value += isBorderBox ? sizeAdjustment.border : -sizeAdjustment.padding
  38276. } else {
  38277. if (isBorderBox) {
  38278. value += sizeAdjustment.border + sizeAdjustment.padding
  38279. }
  38280. }
  38281. }
  38282. }
  38283. value += typeUtils.isNumeric(value) ? "px" : "";
  38284. domAdapter.setStyle(element, propName, value);
  38285. return this
  38286. }
  38287. });
  38288. initRender.prototype.html = function(value) {
  38289. if (!arguments.length) {
  38290. return this[0].innerHTML
  38291. }
  38292. this.empty();
  38293. if ("string" === typeof value && !htmlParser.isTablePart(value) || "number" === typeof value) {
  38294. this[0].innerHTML = value;
  38295. return this
  38296. }
  38297. return this.append(htmlParser.parseHTML(value))
  38298. };
  38299. var appendElements = function(element, nextSibling) {
  38300. if (!this[0] || !element) {
  38301. return
  38302. }
  38303. if ("string" === typeof element) {
  38304. element = htmlParser.parseHTML(element)
  38305. } else {
  38306. if (element.nodeType) {
  38307. element = [element]
  38308. } else {
  38309. if (typeUtils.isNumeric(element)) {
  38310. element = [domAdapter.createTextNode(element)]
  38311. }
  38312. }
  38313. }
  38314. for (var i = 0; i < element.length; i++) {
  38315. var item = element[i];
  38316. var container = this[0];
  38317. var wrapTR = "TABLE" === container.tagName && "TR" === item.tagName;
  38318. if (wrapTR && container.tBodies && container.tBodies.length) {
  38319. container = container.tBodies[0]
  38320. }
  38321. domAdapter.insertElement(container, item.nodeType ? item : item[0], nextSibling)
  38322. }
  38323. };
  38324. var setCss = function(name, value) {
  38325. if (!this[0] || !this[0].style) {
  38326. return
  38327. }
  38328. if (null === value || "number" === typeof value && isNaN(value)) {
  38329. return
  38330. }
  38331. name = styleUtils.styleProp(name);
  38332. for (var i = 0; i < this.length; i++) {
  38333. this[i].style[name] = styleUtils.normalizeStyleProp(name, value)
  38334. }
  38335. };
  38336. initRender.prototype.css = function(name, value) {
  38337. if (typeUtils.isString(name)) {
  38338. if (2 === arguments.length) {
  38339. setCss.call(this, name, value)
  38340. } else {
  38341. if (!this[0]) {
  38342. return
  38343. }
  38344. name = styleUtils.styleProp(name);
  38345. var result = window.getComputedStyle(this[0])[name] || this[0].style[name];
  38346. return typeUtils.isNumeric(result) ? result.toString() : result
  38347. }
  38348. } else {
  38349. if (typeUtils.isPlainObject(name)) {
  38350. for (var key in name) {
  38351. setCss.call(this, key, name[key])
  38352. }
  38353. }
  38354. }
  38355. return this
  38356. };
  38357. initRender.prototype.prepend = function(element) {
  38358. if (arguments.length > 1) {
  38359. for (var i = 0; i < arguments.length; i++) {
  38360. this.prepend(arguments[i])
  38361. }
  38362. return this
  38363. }
  38364. appendElements.apply(this, [element, this[0].firstChild]);
  38365. return this
  38366. };
  38367. initRender.prototype.append = function(element) {
  38368. if (arguments.length > 1) {
  38369. for (var i = 0; i < arguments.length; i++) {
  38370. this.append(arguments[i])
  38371. }
  38372. return this
  38373. }
  38374. appendElements.apply(this, [element]);
  38375. return this
  38376. };
  38377. initRender.prototype.prependTo = function(element) {
  38378. if (this.length > 1) {
  38379. for (var i = this.length - 1; i >= 0; i--) {
  38380. renderer(this[i]).prependTo(element)
  38381. }
  38382. return this
  38383. }
  38384. element = renderer(element);
  38385. if (element[0]) {
  38386. domAdapter.insertElement(element[0], this[0], element[0].firstChild)
  38387. }
  38388. return this
  38389. };
  38390. initRender.prototype.appendTo = function(element) {
  38391. if (this.length > 1) {
  38392. return repeatMethod.call(this, "appendTo", arguments)
  38393. }
  38394. domAdapter.insertElement(renderer(element)[0], this[0]);
  38395. return this
  38396. };
  38397. initRender.prototype.insertBefore = function(element) {
  38398. if (element && element[0]) {
  38399. domAdapter.insertElement(element[0].parentNode, this[0], element[0])
  38400. }
  38401. return this
  38402. };
  38403. initRender.prototype.insertAfter = function(element) {
  38404. if (element && element[0]) {
  38405. domAdapter.insertElement(element[0].parentNode, this[0], element[0].nextSibling)
  38406. }
  38407. return this
  38408. };
  38409. initRender.prototype.before = function(element) {
  38410. if (this[0]) {
  38411. domAdapter.insertElement(this[0].parentNode, element[0], this[0])
  38412. }
  38413. return this
  38414. };
  38415. initRender.prototype.after = function(element) {
  38416. if (this[0]) {
  38417. domAdapter.insertElement(this[0].parentNode, element[0], this[0].nextSibling)
  38418. }
  38419. return this
  38420. };
  38421. initRender.prototype.wrap = function(wrapper) {
  38422. if (this[0]) {
  38423. var wrap = renderer(wrapper);
  38424. wrap.insertBefore(this);
  38425. wrap.append(this)
  38426. }
  38427. return this
  38428. };
  38429. initRender.prototype.wrapInner = function(wrapper) {
  38430. var contents = this.contents();
  38431. if (contents.length) {
  38432. contents.wrap(wrapper)
  38433. } else {
  38434. this.append(wrapper)
  38435. }
  38436. return this
  38437. };
  38438. initRender.prototype.replaceWith = function(element) {
  38439. if (!(element && element[0])) {
  38440. return
  38441. }
  38442. if (element.is(this)) {
  38443. return this
  38444. }
  38445. element.insertBefore(this);
  38446. this.remove();
  38447. return element
  38448. };
  38449. initRender.prototype.remove = function() {
  38450. if (this.length > 1) {
  38451. return repeatMethod.call(this, "remove", arguments)
  38452. }
  38453. dataUtils.cleanDataRecursive(this[0], true);
  38454. domAdapter.removeElement(this[0]);
  38455. return this
  38456. };
  38457. initRender.prototype.detach = function() {
  38458. if (this.length > 1) {
  38459. return repeatMethod.call(this, "detach", arguments)
  38460. }
  38461. domAdapter.removeElement(this[0]);
  38462. return this
  38463. };
  38464. initRender.prototype.empty = function() {
  38465. if (this.length > 1) {
  38466. return repeatMethod.call(this, "empty", arguments)
  38467. }
  38468. dataUtils.cleanDataRecursive(this[0]);
  38469. domAdapter.setText(this[0], "");
  38470. return this
  38471. };
  38472. initRender.prototype.clone = function() {
  38473. var result = [];
  38474. for (var i = 0; i < this.length; i++) {
  38475. result.push(this[i].cloneNode(true))
  38476. }
  38477. return renderer(result)
  38478. };
  38479. initRender.prototype.text = function(value) {
  38480. if (!arguments.length) {
  38481. var result = "";
  38482. for (var i = 0; i < this.length; i++) {
  38483. result += this[i] && this[i].textContent || ""
  38484. }
  38485. return result
  38486. }
  38487. var text = typeUtils.isFunction(value) ? value() : value;
  38488. dataUtils.cleanDataRecursive(this[0], false);
  38489. domAdapter.setText(this[0], typeUtils.isDefined(text) ? text : "");
  38490. return this
  38491. };
  38492. initRender.prototype.val = function(value) {
  38493. if (1 === arguments.length) {
  38494. return this.prop("value", typeUtils.isDefined(value) ? value : "")
  38495. }
  38496. return this.prop("value")
  38497. };
  38498. initRender.prototype.contents = function() {
  38499. if (!this[0]) {
  38500. return renderer()
  38501. }
  38502. var result = [];
  38503. result.push.apply(result, this[0].childNodes);
  38504. return renderer(result)
  38505. };
  38506. initRender.prototype.find = function(selector) {
  38507. var result = renderer();
  38508. if (!selector) {
  38509. return result
  38510. }
  38511. var nodes = [];
  38512. var i;
  38513. if ("string" === typeof selector) {
  38514. selector = selector.trim();
  38515. for (i = 0; i < this.length; i++) {
  38516. var element = this[i];
  38517. if (domAdapter.isElementNode(element)) {
  38518. var elementId = element.getAttribute("id");
  38519. var queryId = elementId || "dx-query-children";
  38520. if (!elementId) {
  38521. setAttributeValue(element, "id", queryId)
  38522. }
  38523. queryId = "[id='" + queryId + "'] ";
  38524. var querySelector = queryId + selector.replace(/([^\\])(,)/g, "$1, " + queryId);
  38525. nodes.push.apply(nodes, domAdapter.querySelectorAll(element, querySelector));
  38526. setAttributeValue(element, "id", elementId)
  38527. } else {
  38528. if (domAdapter.isDocument(element)) {
  38529. nodes.push.apply(nodes, domAdapter.querySelectorAll(element, selector))
  38530. }
  38531. }
  38532. }
  38533. } else {
  38534. for (i = 0; i < this.length; i++) {
  38535. selector = domAdapter.isNode(selector) ? selector : selector[0];
  38536. if (this[i] !== selector && this[i].contains(selector)) {
  38537. nodes.push(selector)
  38538. }
  38539. }
  38540. }
  38541. return result.add(nodes)
  38542. };
  38543. var isVisible = function(_, element) {
  38544. if (!element.nodeType) {
  38545. return true
  38546. }
  38547. return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length)
  38548. };
  38549. initRender.prototype.filter = function(selector) {
  38550. if (!selector) {
  38551. return renderer()
  38552. }
  38553. if (":visible" === selector) {
  38554. return this.filter(isVisible)
  38555. } else {
  38556. if (":hidden" === selector) {
  38557. return this.filter(function(_, element) {
  38558. return !isVisible(_, element)
  38559. })
  38560. }
  38561. }
  38562. var result = [];
  38563. for (var i = 0; i < this.length; i++) {
  38564. var item = this[i];
  38565. if (domAdapter.isElementNode(item) && "string" === typeUtils.type(selector)) {
  38566. domAdapter.elementMatches(item, selector) && result.push(item)
  38567. } else {
  38568. if (domAdapter.isNode(selector) || typeUtils.isWindow(selector)) {
  38569. selector === item && result.push(item)
  38570. } else {
  38571. if (typeUtils.isFunction(selector)) {
  38572. selector.call(item, i, item) && result.push(item)
  38573. } else {
  38574. for (var j = 0; j < selector.length; j++) {
  38575. selector[j] === item && result.push(item)
  38576. }
  38577. }
  38578. }
  38579. }
  38580. }
  38581. return renderer(result)
  38582. };
  38583. initRender.prototype.not = function(selector) {
  38584. var result = [];
  38585. var nodes = this.filter(selector).toArray();
  38586. for (var i = 0; i < this.length; i++) {
  38587. if (nodes.indexOf(this[i]) === -1) {
  38588. result.push(this[i])
  38589. }
  38590. }
  38591. return renderer(result)
  38592. };
  38593. initRender.prototype.is = function(selector) {
  38594. return !!this.filter(selector).length
  38595. };
  38596. initRender.prototype.children = function(selector) {
  38597. var result = [];
  38598. for (var i = 0; i < this.length; i++) {
  38599. var nodes = this[i] ? this[i].childNodes : [];
  38600. for (var j = 0; j < nodes.length; j++) {
  38601. if (domAdapter.isElementNode(nodes[j])) {
  38602. result.push(nodes[j])
  38603. }
  38604. }
  38605. }
  38606. result = renderer(result);
  38607. return selector ? result.filter(selector) : result
  38608. };
  38609. initRender.prototype.siblings = function() {
  38610. var element = this[0];
  38611. if (!element || !element.parentNode) {
  38612. return renderer()
  38613. }
  38614. var result = [];
  38615. var parentChildNodes = element.parentNode.childNodes || [];
  38616. for (var i = 0; i < parentChildNodes.length; i++) {
  38617. var node = parentChildNodes[i];
  38618. if (domAdapter.isElementNode(node) && node !== element) {
  38619. result.push(node)
  38620. }
  38621. }
  38622. return renderer(result)
  38623. };
  38624. initRender.prototype.each = function(callback) {
  38625. for (var i = 0; i < this.length; i++) {
  38626. if (false === callback.call(this[i], i, this[i])) {
  38627. break
  38628. }
  38629. }
  38630. };
  38631. initRender.prototype.index = function(element) {
  38632. if (!element) {
  38633. return this.parent().children().index(this)
  38634. }
  38635. element = renderer(element);
  38636. return this.toArray().indexOf(element[0])
  38637. };
  38638. initRender.prototype.get = function(index) {
  38639. return this[index < 0 ? this.length + index : index]
  38640. };
  38641. initRender.prototype.eq = function(index) {
  38642. index = index < 0 ? this.length + index : index;
  38643. return renderer(this[index])
  38644. };
  38645. initRender.prototype.first = function() {
  38646. return this.eq(0)
  38647. };
  38648. initRender.prototype.last = function() {
  38649. return this.eq(-1)
  38650. };
  38651. initRender.prototype.parent = function(selector) {
  38652. if (!this[0]) {
  38653. return renderer()
  38654. }
  38655. var result = renderer(this[0].parentNode);
  38656. return !selector || result.is(selector) ? result : renderer()
  38657. };
  38658. initRender.prototype.parents = function(selector) {
  38659. var result = [];
  38660. var parent = this.parent();
  38661. while (parent && parent[0] && !domAdapter.isDocument(parent[0])) {
  38662. if (domAdapter.isElementNode(parent[0])) {
  38663. if (!selector || selector && parent.is(selector)) {
  38664. result.push(parent.get(0))
  38665. }
  38666. }
  38667. parent = parent.parent()
  38668. }
  38669. return renderer(result)
  38670. };
  38671. initRender.prototype.closest = function(selector) {
  38672. if (this.is(selector)) {
  38673. return this
  38674. }
  38675. var parent = this.parent();
  38676. while (parent && parent.length) {
  38677. if (parent.is(selector)) {
  38678. return parent
  38679. }
  38680. parent = parent.parent()
  38681. }
  38682. return renderer()
  38683. };
  38684. initRender.prototype.next = function(selector) {
  38685. if (!this[0]) {
  38686. return renderer()
  38687. }
  38688. var next = renderer(this[0].nextSibling);
  38689. if (!arguments.length) {
  38690. return next
  38691. }
  38692. while (next && next.length) {
  38693. if (next.is(selector)) {
  38694. return next
  38695. }
  38696. next = next.next()
  38697. }
  38698. return renderer()
  38699. };
  38700. initRender.prototype.prev = function() {
  38701. if (!this[0]) {
  38702. return renderer()
  38703. }
  38704. return renderer(this[0].previousSibling)
  38705. };
  38706. initRender.prototype.add = function(selector) {
  38707. var targets = renderer(selector);
  38708. var result = this.toArray();
  38709. for (var i = 0; i < targets.length; i++) {
  38710. var target = targets[i];
  38711. if (result.indexOf(target) === -1) {
  38712. result.push(target)
  38713. }
  38714. }
  38715. return renderer(result)
  38716. };
  38717. var emptyArray = [];
  38718. initRender.prototype.splice = function() {
  38719. return renderer(emptyArray.splice.apply(this, arguments))
  38720. };
  38721. initRender.prototype.slice = function() {
  38722. return renderer(emptyArray.slice.apply(this, arguments))
  38723. };
  38724. initRender.prototype.toArray = function() {
  38725. return emptyArray.slice.call(this)
  38726. };
  38727. var getWindowByElement = function(element) {
  38728. return typeUtils.isWindow(element) ? element : element.defaultView
  38729. };
  38730. initRender.prototype.offset = function() {
  38731. if (!this[0]) {
  38732. return
  38733. }
  38734. if (!this[0].getClientRects().length) {
  38735. return {
  38736. top: 0,
  38737. left: 0
  38738. }
  38739. }
  38740. var rect = this[0].getBoundingClientRect();
  38741. var win = getWindowByElement(this[0].ownerDocument);
  38742. var docElem = this[0].ownerDocument.documentElement;
  38743. return {
  38744. top: rect.top + win.pageYOffset - docElem.clientTop,
  38745. left: rect.left + win.pageXOffset - docElem.clientLeft
  38746. }
  38747. };
  38748. initRender.prototype.offsetParent = function() {
  38749. if (!this[0]) {
  38750. return renderer()
  38751. }
  38752. var offsetParent = renderer(this[0].offsetParent);
  38753. while (offsetParent[0] && "static" === offsetParent.css("position")) {
  38754. offsetParent = renderer(offsetParent[0].offsetParent)
  38755. }
  38756. offsetParent = offsetParent[0] ? offsetParent : renderer(domAdapter.getDocumentElement());
  38757. return offsetParent
  38758. };
  38759. initRender.prototype.position = function() {
  38760. if (!this[0]) {
  38761. return
  38762. }
  38763. var offset;
  38764. var marginTop = parseFloat(this.css("marginTop"));
  38765. var marginLeft = parseFloat(this.css("marginLeft"));
  38766. if ("fixed" === this.css("position")) {
  38767. offset = this[0].getBoundingClientRect();
  38768. return {
  38769. top: offset.top - marginTop,
  38770. left: offset.left - marginLeft
  38771. }
  38772. }
  38773. offset = this.offset();
  38774. var offsetParent = this.offsetParent();
  38775. var parentOffset = {
  38776. top: 0,
  38777. left: 0
  38778. };
  38779. if ("HTML" !== offsetParent[0].nodeName) {
  38780. parentOffset = offsetParent.offset()
  38781. }
  38782. parentOffset = {
  38783. top: parentOffset.top + parseFloat(offsetParent.css("borderTopWidth")),
  38784. left: parentOffset.left + parseFloat(offsetParent.css("borderLeftWidth"))
  38785. };
  38786. return {
  38787. top: offset.top - parentOffset.top - marginTop,
  38788. left: offset.left - parentOffset.left - marginLeft
  38789. }
  38790. };
  38791. [{
  38792. name: "scrollLeft",
  38793. offsetProp: "pageXOffset",
  38794. scrollWindow: function(win, value) {
  38795. win.scrollTo(value, win.pageYOffset)
  38796. }
  38797. }, {
  38798. name: "scrollTop",
  38799. offsetProp: "pageYOffset",
  38800. scrollWindow: function(win, value) {
  38801. win.scrollTo(win.pageXOffset, value)
  38802. }
  38803. }].forEach(function(directionStrategy) {
  38804. var propName = directionStrategy.name;
  38805. initRender.prototype[propName] = function(value) {
  38806. if (!this[0]) {
  38807. return
  38808. }
  38809. var window = getWindowByElement(this[0]);
  38810. if (void 0 === value) {
  38811. return window ? window[directionStrategy.offsetProp] : this[0][propName]
  38812. }
  38813. if (window) {
  38814. directionStrategy.scrollWindow(window, value)
  38815. } else {
  38816. this[0][propName] = value
  38817. }
  38818. return this
  38819. }
  38820. });
  38821. initRender.prototype.data = function(key, value) {
  38822. if (!this[0]) {
  38823. return
  38824. }
  38825. if (arguments.length < 2) {
  38826. return dataUtils.data.call(renderer, this[0], key)
  38827. }
  38828. dataUtils.data.call(renderer, this[0], key, value);
  38829. return this
  38830. };
  38831. initRender.prototype.removeData = function(key) {
  38832. this[0] && dataUtils.removeData(this[0], key);
  38833. return this
  38834. };
  38835. var rendererWrapper = function() {
  38836. return renderer.apply(this, arguments)
  38837. };
  38838. Object.defineProperty(rendererWrapper, "fn", {
  38839. enumerable: true,
  38840. configurable: true,
  38841. get: function() {
  38842. return renderer.fn
  38843. },
  38844. set: function(value) {
  38845. renderer.fn = value
  38846. }
  38847. });
  38848. module.exports = {
  38849. set: function(strategy) {
  38850. renderer = strategy
  38851. },
  38852. get: function() {
  38853. return rendererWrapper
  38854. }
  38855. }
  38856. },
  38857. /*!**************************************************************!*\
  38858. !*** ./artifacts/transpiled/events/core/hook_touch_props.js ***!
  38859. \**************************************************************/
  38860. /*! dynamic exports provided */
  38861. /*! all exports used */
  38862. function(module, exports, __webpack_require__) {
  38863. var touchPropsToHook = ["pageX", "pageY", "screenX", "screenY", "clientX", "clientY"];
  38864. var touchPropHook = function(name, event) {
  38865. if (event[name] && !event.touches || !event.touches) {
  38866. return event[name]
  38867. }
  38868. var touches = event.touches.length ? event.touches : event.changedTouches;
  38869. if (!touches.length) {
  38870. return
  38871. }
  38872. return touches[0][name]
  38873. };
  38874. module.exports = function(callback) {
  38875. touchPropsToHook.forEach(function(name) {
  38876. callback(name, function(event) {
  38877. return touchPropHook(name, event)
  38878. })
  38879. }, this)
  38880. }
  38881. },
  38882. /*!********************************************************!*\
  38883. !*** ./artifacts/transpiled/core/utils/html_parser.js ***!
  38884. \********************************************************/
  38885. /*! dynamic exports provided */
  38886. /*! all exports used */
  38887. function(module, exports, __webpack_require__) {
  38888. var merge = __webpack_require__( /*! ./array */ 14).merge;
  38889. var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11);
  38890. var isTagName = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i;
  38891. var tagWrappers = {
  38892. "default": {
  38893. tagsCount: 0,
  38894. startTags: "",
  38895. endTags: ""
  38896. },
  38897. thead: {
  38898. tagsCount: 1,
  38899. startTags: "<table>",
  38900. endTags: "</table>"
  38901. },
  38902. td: {
  38903. tagsCount: 3,
  38904. startTags: "<table><tbody><tr>",
  38905. endTags: "</tr></tbody></table>"
  38906. },
  38907. col: {
  38908. tagsCount: 2,
  38909. startTags: "<table><colgroup>",
  38910. endTags: "</colgroup></table>"
  38911. },
  38912. tr: {
  38913. tagsCount: 2,
  38914. startTags: "<table><tbody>",
  38915. endTags: "</tbody></table>"
  38916. }
  38917. };
  38918. tagWrappers.tbody = tagWrappers.colgroup = tagWrappers.caption = tagWrappers.tfoot = tagWrappers.thead;
  38919. tagWrappers.th = tagWrappers.td;
  38920. var parseHTML = function(html) {
  38921. if ("string" !== typeof html) {
  38922. return null
  38923. }
  38924. var fragment = domAdapter.createDocumentFragment();
  38925. var container = fragment.appendChild(domAdapter.createElement("div"));
  38926. var tags = isTagName.exec(html);
  38927. var firstRootTag = tags && tags[1].toLowerCase();
  38928. var tagWrapper = tagWrappers[firstRootTag] || tagWrappers.default;
  38929. container.innerHTML = tagWrapper.startTags + html + tagWrapper.endTags;
  38930. for (var i = 0; i < tagWrapper.tagsCount; i++) {
  38931. container = container.lastChild
  38932. }
  38933. return merge([], container.childNodes)
  38934. };
  38935. var isTablePart = function(html) {
  38936. var tags = isTagName.exec(html);
  38937. return tags && tags[1] in tagWrappers
  38938. };
  38939. exports.parseHTML = parseHTML;
  38940. exports.isTablePart = isTablePart
  38941. },
  38942. /*!****************************************************!*\
  38943. !*** ./artifacts/transpiled/localization/utils.js ***!
  38944. \****************************************************/
  38945. /*! dynamic exports provided */
  38946. /*! all exports used */
  38947. function(module, exports, __webpack_require__) {
  38948. Object.defineProperty(exports, "__esModule", {
  38949. value: true
  38950. });
  38951. exports.toFixed = void 0;
  38952. var _math = __webpack_require__( /*! ../core/utils/math */ 28);
  38953. var DECIMAL_BASE = 10;
  38954. function roundByAbs(value) {
  38955. var valueSign = (0, _math.sign)(value);
  38956. return valueSign * Math.round(Math.abs(value))
  38957. }
  38958. function adjustValue(value, precision) {
  38959. var precisionMultiplier = Math.pow(DECIMAL_BASE, precision);
  38960. var roundMultiplier = precisionMultiplier * DECIMAL_BASE;
  38961. var intermediateValue = value * roundMultiplier / DECIMAL_BASE;
  38962. return roundByAbs(intermediateValue) / precisionMultiplier
  38963. }
  38964. function toFixed(value, precision) {
  38965. var valuePrecision = precision || 0;
  38966. var adjustedValue = valuePrecision > 0 ? adjustValue.apply(void 0, arguments) : value;
  38967. return adjustedValue.toFixed(valuePrecision)
  38968. }
  38969. exports.toFixed = toFixed
  38970. },
  38971. /*!******************************************************************!*\
  38972. !*** ./artifacts/transpiled/localization/ldml/date.formatter.js ***!
  38973. \******************************************************************/
  38974. /*! dynamic exports provided */
  38975. /*! all exports used */
  38976. function(module, exports, __webpack_require__) {
  38977. function leftPad(text, length) {
  38978. while (text.length < length) {
  38979. text = "0" + text
  38980. }
  38981. return text
  38982. }
  38983. var FORMAT_TYPES = {
  38984. 3: "abbreviated",
  38985. 4: "wide",
  38986. 5: "narrow"
  38987. };
  38988. var LDML_FORMATTERS = {
  38989. y: function(date, count, useUtc) {
  38990. var year = date[useUtc ? "getUTCFullYear" : "getFullYear"]();
  38991. if (2 === count) {
  38992. year %= 100
  38993. }
  38994. return leftPad(year.toString(), count)
  38995. },
  38996. M: function(date, count, useUtc, dateParts) {
  38997. var month = date[useUtc ? "getUTCMonth" : "getMonth"]();
  38998. var formatType = FORMAT_TYPES[count];
  38999. if (formatType) {
  39000. return dateParts.getMonthNames(formatType, "format")[month]
  39001. }
  39002. return leftPad((month + 1).toString(), Math.min(count, 2))
  39003. },
  39004. L: function(date, count, useUtc, dateParts) {
  39005. var month = date[useUtc ? "getUTCMonth" : "getMonth"]();
  39006. var formatType = FORMAT_TYPES[count];
  39007. if (formatType) {
  39008. return dateParts.getMonthNames(formatType, "standalone")[month]
  39009. }
  39010. return leftPad((month + 1).toString(), Math.min(count, 2))
  39011. },
  39012. Q: function(date, count, useUtc, dateParts) {
  39013. var month = date[useUtc ? "getUTCMonth" : "getMonth"]();
  39014. var quarter = Math.floor(month / 3);
  39015. var formatType = FORMAT_TYPES[count];
  39016. if (formatType) {
  39017. return dateParts.getQuarterNames(formatType)[quarter]
  39018. }
  39019. return leftPad((quarter + 1).toString(), Math.min(count, 2))
  39020. },
  39021. E: function(date, count, useUtc, dateParts) {
  39022. var day = date[useUtc ? "getUTCDay" : "getDay"]();
  39023. var formatType = FORMAT_TYPES[count < 3 ? 3 : count];
  39024. return dateParts.getDayNames(formatType)[day]
  39025. },
  39026. a: function(date, count, useUtc, dateParts) {
  39027. var hours = date[useUtc ? "getUTCHours" : "getHours"]();
  39028. var period = hours < 12 ? 0 : 1;
  39029. var formatType = FORMAT_TYPES[count];
  39030. return dateParts.getPeriodNames(formatType)[period]
  39031. },
  39032. d: function(date, count, useUtc) {
  39033. return leftPad(date[useUtc ? "getUTCDate" : "getDate"]().toString(), Math.min(count, 2))
  39034. },
  39035. H: function(date, count, useUtc) {
  39036. return leftPad(date[useUtc ? "getUTCHours" : "getHours"]().toString(), Math.min(count, 2))
  39037. },
  39038. h: function(date, count, useUtc) {
  39039. var hours = date[useUtc ? "getUTCHours" : "getHours"]();
  39040. return leftPad((hours % 12 || 12).toString(), Math.min(count, 2))
  39041. },
  39042. m: function(date, count, useUtc) {
  39043. return leftPad(date[useUtc ? "getUTCMinutes" : "getMinutes"]().toString(), Math.min(count, 2))
  39044. },
  39045. s: function(date, count, useUtc) {
  39046. return leftPad(date[useUtc ? "getUTCSeconds" : "getSeconds"]().toString(), Math.min(count, 2))
  39047. },
  39048. S: function(date, count, useUtc) {
  39049. return leftPad(date[useUtc ? "getUTCMilliseconds" : "getMilliseconds"]().toString(), 3).substr(0, count)
  39050. },
  39051. x: function(date, count, useUtc) {
  39052. var timezoneOffset = useUtc ? 0 : date.getTimezoneOffset();
  39053. var signPart = timezoneOffset > 0 ? "-" : "+";
  39054. var timezoneOffsetAbs = Math.abs(timezoneOffset);
  39055. var hours = Math.floor(timezoneOffsetAbs / 60);
  39056. var minutes = timezoneOffsetAbs % 60;
  39057. var hoursPart = leftPad(hours.toString(), 2);
  39058. var minutesPart = leftPad(minutes.toString(), 2);
  39059. return signPart + hoursPart + (count >= 3 ? ":" : "") + (count > 1 || minutes ? minutesPart : "")
  39060. },
  39061. X: function(date, count, useUtc) {
  39062. if (useUtc || !date.getTimezoneOffset()) {
  39063. return "Z"
  39064. }
  39065. return LDML_FORMATTERS.x(date, count, useUtc)
  39066. },
  39067. Z: function(date, count, useUtc) {
  39068. return LDML_FORMATTERS.X(date, count >= 5 ? 3 : 2, useUtc)
  39069. }
  39070. };
  39071. var getFormatter = function(format, dateParts) {
  39072. return function(date) {
  39073. var charIndex;
  39074. var formatter;
  39075. var char;
  39076. var charCount = 0;
  39077. var separator = "'";
  39078. var isEscaping = false;
  39079. var isCurrentCharEqualsNext;
  39080. var result = "";
  39081. if (!date) {
  39082. return null
  39083. }
  39084. if (!format) {
  39085. return date
  39086. }
  39087. var useUtc = "Z" === format[format.length - 1] || "'Z'" === format.slice(-3);
  39088. for (charIndex = 0; charIndex < format.length; charIndex++) {
  39089. char = format[charIndex];
  39090. formatter = LDML_FORMATTERS[char];
  39091. isCurrentCharEqualsNext = char === format[charIndex + 1];
  39092. charCount++;
  39093. if (!isCurrentCharEqualsNext) {
  39094. if (formatter && !isEscaping) {
  39095. result += formatter(date, charCount, useUtc, dateParts)
  39096. }
  39097. charCount = 0
  39098. }
  39099. if (char === separator && !isCurrentCharEqualsNext) {
  39100. isEscaping = !isEscaping
  39101. } else {
  39102. if (isEscaping || !formatter) {
  39103. result += char
  39104. }
  39105. }
  39106. if (char === separator && isCurrentCharEqualsNext) {
  39107. charIndex++
  39108. }
  39109. }
  39110. return result
  39111. }
  39112. };
  39113. module.exports.getFormatter = getFormatter
  39114. },
  39115. /*!*****************************************************************!*\
  39116. !*** ./artifacts/transpiled/localization/default_date_names.js ***!
  39117. \*****************************************************************/
  39118. /*! dynamic exports provided */
  39119. /*! all exports used */
  39120. function(module, exports, __webpack_require__) {
  39121. var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
  39122. var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
  39123. var DAYS = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
  39124. var PERIODS = ["AM", "PM"];
  39125. var QUARTERS = ["Q1", "Q2", "Q3", "Q4"];
  39126. var cutCaptions = function(captions, format) {
  39127. var lengthByFormat = {
  39128. abbreviated: 3,
  39129. "short": 2,
  39130. narrow: 1
  39131. };
  39132. return iteratorUtils.map(captions, function(caption) {
  39133. return caption.substr(0, lengthByFormat[format])
  39134. })
  39135. };
  39136. module.exports = {
  39137. getMonthNames: function(format) {
  39138. return cutCaptions(MONTHS, format)
  39139. },
  39140. getDayNames: function(format) {
  39141. return cutCaptions(DAYS, format)
  39142. },
  39143. getQuarterNames: function(format) {
  39144. return QUARTERS
  39145. },
  39146. getPeriodNames: function(format) {
  39147. return PERIODS
  39148. }
  39149. }
  39150. },
  39151. /*!******************************************************************!*\
  39152. !*** ./artifacts/transpiled/exporter/excel/excel.fill_helper.js ***!
  39153. \******************************************************************/
  39154. /*! dynamic exports provided */
  39155. /*! all exports used */
  39156. function(module, exports, __webpack_require__) {
  39157. Object.defineProperty(exports, "__esModule", {
  39158. value: true
  39159. });
  39160. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  39161. var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
  39162. var _excel2 = _interopRequireDefault(_excel);
  39163. var _excel3 = __webpack_require__( /*! ./excel.pattern_fill_helper */ 436);
  39164. var _excel4 = _interopRequireDefault(_excel3);
  39165. function _interopRequireDefault(obj) {
  39166. return obj && obj.__esModule ? obj : {
  39167. "default": obj
  39168. }
  39169. }
  39170. var fillHelper = {
  39171. tryCreateTag: function(sourceObj) {
  39172. var result = null;
  39173. if ((0, _type.isDefined)(sourceObj)) {
  39174. result = {
  39175. patternFill: _excel4.default.tryCreateTag(sourceObj.patternFill)
  39176. };
  39177. if (fillHelper.isEmpty(result)) {
  39178. result = null
  39179. }
  39180. }
  39181. return result
  39182. },
  39183. tryCreateFillFromSimpleFormat: function() {
  39184. var _ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
  39185. backgroundColor = _ref.backgroundColor,
  39186. fillPatternType = _ref.fillPatternType,
  39187. fillPatternColor = _ref.fillPatternColor;
  39188. if ((0, _type.isDefined)(backgroundColor) && !((0, _type.isDefined)(fillPatternType) && (0, _type.isDefined)(fillPatternColor))) {
  39189. return {
  39190. patternFill: {
  39191. patternType: "solid",
  39192. foregroundColor: {
  39193. rgb: backgroundColor
  39194. }
  39195. }
  39196. }
  39197. } else {
  39198. if ((0, _type.isDefined)(fillPatternType) && (0, _type.isDefined)(fillPatternColor)) {
  39199. return {
  39200. patternFill: {
  39201. patternType: fillPatternType,
  39202. foregroundColor: {
  39203. rgb: fillPatternColor
  39204. },
  39205. backgroundColor: {
  39206. rgb: backgroundColor
  39207. }
  39208. }
  39209. }
  39210. }
  39211. }
  39212. },
  39213. copySimpleFormat: function(source, target) {
  39214. if (void 0 !== source.backgroundColor) {
  39215. target.backgroundColor = source.backgroundColor
  39216. }
  39217. if (void 0 !== source.fillPatternType) {
  39218. target.fillPatternType = source.fillPatternType
  39219. }
  39220. if (void 0 !== source.fillPatternColor) {
  39221. target.fillPatternColor = source.fillPatternColor
  39222. }
  39223. },
  39224. copy: function(source) {
  39225. var result = null;
  39226. if ((0, _type.isDefined)(source)) {
  39227. result = {};
  39228. if (void 0 !== source.patternFill) {
  39229. result.patternFill = _excel4.default.copy(source.patternFill)
  39230. }
  39231. }
  39232. return result
  39233. },
  39234. areEqual: function(leftTag, rightTag) {
  39235. return fillHelper.isEmpty(leftTag) && fillHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && _excel4.default.areEqual(leftTag.patternFill, rightTag.patternFill)
  39236. },
  39237. isEmpty: function(tag) {
  39238. return !(0, _type.isDefined)(tag) || _excel4.default.isEmpty(tag.patternFill)
  39239. },
  39240. toXml: function(tag) {
  39241. return _excel2.default.toXml("fill", {}, _excel4.default.toXml(tag.patternFill))
  39242. }
  39243. };
  39244. exports.default = fillHelper
  39245. },
  39246. /*!*******************************************************************!*\
  39247. !*** ./artifacts/transpiled/exporter/excel/excel.color_helper.js ***!
  39248. \*******************************************************************/
  39249. /*! dynamic exports provided */
  39250. /*! all exports used */
  39251. function(module, exports, __webpack_require__) {
  39252. Object.defineProperty(exports, "__esModule", {
  39253. value: true
  39254. });
  39255. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  39256. var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
  39257. var _excel2 = _interopRequireDefault(_excel);
  39258. function _interopRequireDefault(obj) {
  39259. return obj && obj.__esModule ? obj : {
  39260. "default": obj
  39261. }
  39262. }
  39263. var colorHelper = {
  39264. _tryConvertColor: function(source) {
  39265. if ("string" !== typeof source) {
  39266. return source
  39267. }
  39268. var result;
  39269. if (source.length > 0 && "#" === source[0]) {
  39270. var colorCode = source.substr(1, source.length);
  39271. if (6 === colorCode.length) {
  39272. result = "FF" + colorCode
  39273. } else {
  39274. if (8 === colorCode.length) {
  39275. result = colorCode[6] + colorCode[7] + colorCode.substr(0, 6)
  39276. } else {
  39277. result = colorCode
  39278. }
  39279. }
  39280. } else {
  39281. result = source
  39282. }
  39283. return result
  39284. },
  39285. tryCreateTag: function(sourceObj) {
  39286. var result = null;
  39287. if ((0, _type.isDefined)(sourceObj)) {
  39288. if ("string" === typeof sourceObj) {
  39289. result = {
  39290. rgb: this._tryConvertColor(sourceObj)
  39291. }
  39292. } else {
  39293. result = {
  39294. rgb: this._tryConvertColor(sourceObj.rgb),
  39295. theme: sourceObj.theme
  39296. }
  39297. }
  39298. if (colorHelper.isEmpty(result)) {
  39299. result = null
  39300. }
  39301. }
  39302. return result
  39303. },
  39304. copy: function(source) {
  39305. var result = null;
  39306. if ((0, _type.isDefined)(source)) {
  39307. if ("string" === typeof source) {
  39308. result = source
  39309. } else {
  39310. result = {};
  39311. if (void 0 !== source.rgb) {
  39312. result.rgb = source.rgb
  39313. }
  39314. if (void 0 !== source.theme) {
  39315. result.theme = source.theme
  39316. }
  39317. }
  39318. }
  39319. return result
  39320. },
  39321. isEmpty: function(tag) {
  39322. return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.rgb) && !(0, _type.isDefined)(tag.theme)
  39323. },
  39324. areEqual: function(leftTag, rightTag) {
  39325. return colorHelper.isEmpty(leftTag) && colorHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.rgb === rightTag.rgb && leftTag.theme === rightTag.theme
  39326. },
  39327. toXml: function(tagName, tag) {
  39328. return _excel2.default.toXml(tagName, {
  39329. rgb: tag.rgb,
  39330. theme: tag.theme
  39331. })
  39332. }
  39333. };
  39334. exports.default = colorHelper
  39335. },
  39336. /*!******************************************************************!*\
  39337. !*** ./artifacts/transpiled/exporter/excel/excel.font_helper.js ***!
  39338. \******************************************************************/
  39339. /*! dynamic exports provided */
  39340. /*! all exports used */
  39341. function(module, exports, __webpack_require__) {
  39342. Object.defineProperty(exports, "__esModule", {
  39343. value: true
  39344. });
  39345. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  39346. var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
  39347. var _excel2 = _interopRequireDefault(_excel);
  39348. var _excel3 = __webpack_require__( /*! ./excel.color_helper */ 260);
  39349. var _excel4 = _interopRequireDefault(_excel3);
  39350. function _interopRequireDefault(obj) {
  39351. return obj && obj.__esModule ? obj : {
  39352. "default": obj
  39353. }
  39354. }
  39355. var fontHelper = {
  39356. tryCreateTag: function(sourceObj) {
  39357. var result = null;
  39358. if ((0, _type.isDefined)(sourceObj)) {
  39359. result = {
  39360. size: sourceObj.size,
  39361. name: sourceObj.name,
  39362. family: sourceObj.family,
  39363. scheme: sourceObj.scheme,
  39364. bold: sourceObj.bold,
  39365. italic: sourceObj.italic,
  39366. underline: sourceObj.underline,
  39367. color: _excel4.default.tryCreateTag(sourceObj.color)
  39368. };
  39369. if (fontHelper.isEmpty(result)) {
  39370. result = null
  39371. }
  39372. }
  39373. return result
  39374. },
  39375. copy: function(source) {
  39376. var result = null;
  39377. if ((0, _type.isDefined)(source)) {
  39378. result = {};
  39379. if (void 0 !== source.size) {
  39380. result.size = source.size
  39381. }
  39382. if (void 0 !== source.name) {
  39383. result.name = source.name
  39384. }
  39385. if (void 0 !== source.family) {
  39386. result.family = source.family
  39387. }
  39388. if (void 0 !== source.scheme) {
  39389. result.scheme = source.scheme
  39390. }
  39391. if (void 0 !== source.bold) {
  39392. result.bold = source.bold
  39393. }
  39394. if (void 0 !== source.italic) {
  39395. result.italic = source.italic
  39396. }
  39397. if (void 0 !== source.underline) {
  39398. result.underline = source.underline
  39399. }
  39400. if (void 0 !== source.color) {
  39401. result.color = _excel4.default.copy(source.color)
  39402. }
  39403. }
  39404. return result
  39405. },
  39406. areEqual: function(leftTag, rightTag) {
  39407. return fontHelper.isEmpty(leftTag) && fontHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.size === rightTag.size && leftTag.name === rightTag.name && leftTag.family === rightTag.family && leftTag.scheme === rightTag.scheme && (leftTag.bold === rightTag.bold || !leftTag.bold === !rightTag.bold) && (leftTag.italic === rightTag.italic || !leftTag.italic === !rightTag.italic) && leftTag.underline === rightTag.underline && _excel4.default.areEqual(leftTag.color, rightTag.color)
  39408. },
  39409. isEmpty: function(tag) {
  39410. return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.size) && !(0, _type.isDefined)(tag.name) && !(0, _type.isDefined)(tag.family) && !(0, _type.isDefined)(tag.scheme) && (!(0, _type.isDefined)(tag.bold) || !tag.bold) && (!(0, _type.isDefined)(tag.italic) || !tag.italic) && !(0, _type.isDefined)(tag.underline) && _excel4.default.isEmpty(tag.color)
  39411. },
  39412. toXml: function(tag) {
  39413. var content = [(0, _type.isDefined)(tag.bold) && tag.bold ? _excel2.default.toXml("b", {}) : "", (0, _type.isDefined)(tag.size) ? _excel2.default.toXml("sz", {
  39414. val: tag.size
  39415. }) : "", (0, _type.isDefined)(tag.color) ? _excel4.default.toXml("color", tag.color) : "", (0, _type.isDefined)(tag.name) ? _excel2.default.toXml("name", {
  39416. val: tag.name
  39417. }) : "", (0, _type.isDefined)(tag.family) ? _excel2.default.toXml("family", {
  39418. val: tag.family
  39419. }) : "", (0, _type.isDefined)(tag.scheme) ? _excel2.default.toXml("scheme", {
  39420. val: tag.scheme
  39421. }) : "", (0, _type.isDefined)(tag.italic) && tag.italic ? _excel2.default.toXml("i", {}) : "", (0, _type.isDefined)(tag.underline) ? _excel2.default.toXml("u", {
  39422. val: tag.underline
  39423. }) : ""].join("");
  39424. return _excel2.default.toXml("font", {}, content)
  39425. }
  39426. };
  39427. exports.default = fontHelper
  39428. },
  39429. /*!********************************************************!*\
  39430. !*** ./artifacts/transpiled/exporter/image_creator.js ***!
  39431. \********************************************************/
  39432. /*! dynamic exports provided */
  39433. /*! all exports used */
  39434. function(module, exports, __webpack_require__) {
  39435. var _renderer = __webpack_require__( /*! ../core/renderer */ 2);
  39436. var _renderer2 = _interopRequireDefault(_renderer);
  39437. var _color = __webpack_require__( /*! ../color */ 94);
  39438. var _color2 = _interopRequireDefault(_color);
  39439. var _type = __webpack_require__( /*! ../core/utils/type */ 1);
  39440. var _svg = __webpack_require__( /*! ../core/utils/svg */ 209);
  39441. var _svg2 = _interopRequireDefault(_svg);
  39442. var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
  39443. var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
  39444. var _dom_adapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
  39445. var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
  39446. var _dom = __webpack_require__( /*! ../core/utils/dom */ 12);
  39447. var _dom2 = _interopRequireDefault(_dom);
  39448. var _window = __webpack_require__( /*! ../core/utils/window */ 7);
  39449. var _window2 = _interopRequireDefault(_window);
  39450. var _inflector = __webpack_require__( /*! ../core/utils/inflector */ 33);
  39451. var _deferred = __webpack_require__( /*! ../core/utils/deferred */ 6);
  39452. function _interopRequireDefault(obj) {
  39453. return obj && obj.__esModule ? obj : {
  39454. "default": obj
  39455. }
  39456. }
  39457. var window = _window2.default.getWindow();
  39458. var _math = Math;
  39459. var PI = _math.PI;
  39460. var _min = _math.min;
  39461. var _abs = _math.abs;
  39462. var _sqrt = _math.sqrt;
  39463. var _pow = _math.pow;
  39464. var _atan2 = _math.atan2;
  39465. var _cos = _math.cos;
  39466. var _sin = _math.sin;
  39467. var _number = Number;
  39468. var IMAGE_QUALITY = 1;
  39469. var TEXT_DECORATION_LINE_WIDTH_COEFF = .05;
  39470. var DEFAULT_FONT_SIZE = "10px";
  39471. var DEFAULT_FONT_FAMILY = "sans-serif";
  39472. var DEFAULT_TEXT_COLOR = "#000";
  39473. function createCanvas(width, height, margin) {
  39474. var canvas = (0, _renderer2.default)("<canvas>")[0];
  39475. canvas.width = width + 2 * margin;
  39476. canvas.height = height + 2 * margin;
  39477. canvas.hidden = true;
  39478. return canvas
  39479. }
  39480. function getStringFromCanvas(canvas, mimeType) {
  39481. var dataURL = canvas.toDataURL(mimeType, IMAGE_QUALITY);
  39482. var imageData = window.atob(dataURL.substring(("data:" + mimeType + ";base64,").length));
  39483. return imageData
  39484. }
  39485. function arcTo(x1, y1, x2, y2, radius, largeArcFlag, clockwise, context) {
  39486. var cBx = (x1 + x2) / 2;
  39487. var cBy = (y1 + y2) / 2;
  39488. var aB = _atan2(y1 - y2, x1 - x2);
  39489. var k = largeArcFlag ? 1 : -1;
  39490. aB += 90 * (PI / 180) * (clockwise ? 1 : -1);
  39491. var opSide = _sqrt(_pow(x2 - x1, 2) + _pow(y2 - y1, 2)) / 2;
  39492. var adjSide = _sqrt(_abs(_pow(radius, 2) - _pow(opSide, 2)));
  39493. var centerX = cBx + k * (adjSide * _cos(aB));
  39494. var centerY = cBy + k * (adjSide * _sin(aB));
  39495. var startAngle = _atan2(y1 - centerY, x1 - centerX);
  39496. var endAngle = _atan2(y2 - centerY, x2 - centerX);
  39497. context.arc(centerX, centerY, radius, startAngle, endAngle, !clockwise)
  39498. }
  39499. function getElementOptions(element, rootAppended) {
  39500. var attr = parseAttributes(element.attributes || {});
  39501. var options = (0, _extend.extend)({}, attr, {
  39502. text: element.textContent.replace(/\s+/g, " "),
  39503. textAlign: "middle" === attr["text-anchor"] ? "center" : attr["text-anchor"]
  39504. });
  39505. var transform = attr.transform;
  39506. var coords;
  39507. if (transform) {
  39508. coords = transform.match(/translate\(-*\d+([.]\d+)*(,*\s*-*\d+([.]\d+)*)*/);
  39509. if (coords) {
  39510. coords = coords[0].match(/-*\d+([.]\d+)*/g);
  39511. options.translateX = _number(coords[0]);
  39512. options.translateY = coords[1] ? _number(coords[1]) : 0
  39513. }
  39514. coords = transform.match(/rotate\(-*\d+([.]\d+)*(,*\s*-*\d+([.]\d+)*,*\s*-*\d+([.]\d+)*)*/);
  39515. if (coords) {
  39516. coords = coords[0].match(/-*\d+([.]\d+)*/g);
  39517. options.rotationAngle = _number(coords[0]);
  39518. options.rotationX = coords[1] && _number(coords[1]);
  39519. options.rotationY = coords[2] && _number(coords[2])
  39520. }
  39521. coords = transform.match(/scale\(-*\d+([.]\d+)*(,*\s*-*\d+([.]\d+)*)*/);
  39522. if (coords) {
  39523. coords = coords[0].match(/-*\d+([.]\d+)*/g);
  39524. options.scaleX = _number(coords[0]);
  39525. if (coords.length > 1) {
  39526. options.scaleY = _number(coords[1])
  39527. } else {
  39528. options.scaleY = options.scaleX
  39529. }
  39530. }
  39531. }
  39532. parseStyles(element, options, rootAppended);
  39533. return options
  39534. }
  39535. function drawRect(context, options) {
  39536. var x = options.x;
  39537. var y = options.y;
  39538. var width = options.width;
  39539. var height = options.height;
  39540. var cornerRadius = options.rx;
  39541. if (!cornerRadius) {
  39542. context.rect(x, y, width, height)
  39543. } else {
  39544. cornerRadius = _min(cornerRadius, width / 2, height / 2);
  39545. context.save();
  39546. context.translate(x, y);
  39547. context.moveTo(width / 2, 0);
  39548. context.arcTo(width, 0, width, height, cornerRadius);
  39549. context.arcTo(width, height, 0, height, cornerRadius);
  39550. context.arcTo(0, height, 0, 0, cornerRadius);
  39551. context.arcTo(0, 0, cornerRadius, 0, cornerRadius);
  39552. context.lineTo(width / 2, 0);
  39553. context.restore()
  39554. }
  39555. }
  39556. function drawImage(context, options, shared) {
  39557. var d = new _deferred.Deferred;
  39558. var image = new window.Image;
  39559. image.onload = function() {
  39560. context.save();
  39561. context.globalAlpha = options.globalAlpha;
  39562. transformElement(context, options);
  39563. clipElement(context, options, shared);
  39564. context.drawImage(image, options.x, options.y, options.width, options.height);
  39565. context.restore();
  39566. d.resolve()
  39567. };
  39568. image.onerror = function() {
  39569. d.resolve()
  39570. };
  39571. image.setAttribute("crossOrigin", "anonymous");
  39572. image.src = options.href || options["xlink:href"];
  39573. return d
  39574. }
  39575. function drawPath(context, dAttr) {
  39576. var dArray = dAttr.replace(/,/g, " ").split(/([A-Z])/i).filter(function(item) {
  39577. return "" !== item.trim()
  39578. });
  39579. var i = 0;
  39580. var prevParams;
  39581. var prevParamsLen;
  39582. do {
  39583. var params = (dArray[i + 1] || "").trim().split(" ");
  39584. switch (dArray[i]) {
  39585. case "M":
  39586. context.moveTo(_number(params[0]), _number(params[1]));
  39587. i += 2;
  39588. break;
  39589. case "L":
  39590. for (var j = 0; j < params.length / 2; j++) {
  39591. context.lineTo(_number(params[2 * j]), _number(params[2 * j + 1]))
  39592. }
  39593. i += 2;
  39594. break;
  39595. case "C":
  39596. context.bezierCurveTo(_number(params[0]), _number(params[1]), _number(params[2]), _number(params[3]), _number(params[4]), _number(params[5]));
  39597. i += 2;
  39598. break;
  39599. case "a":
  39600. prevParams = dArray[i - 1].trim().split(" ");
  39601. prevParamsLen = prevParams.length - 1;
  39602. arcTo(_number(prevParams[prevParamsLen - 1]), _number(prevParams[prevParamsLen]), _number(prevParams[prevParamsLen - 1]) + _number(params[5]), _number(prevParams[prevParamsLen]) + _number(params[6]), _number(params[0]), _number(params[3]), _number(params[4]), context);
  39603. i += 2;
  39604. break;
  39605. case "A":
  39606. prevParams = dArray[i - 1].trim().split(" ");
  39607. prevParamsLen = prevParams.length - 1;
  39608. arcTo(_number(prevParams[prevParamsLen - 1]), _number(prevParams[prevParamsLen]), _number(params[5]), _number(params[6]), _number(params[0]), _number(params[3]), _number(params[4]), context);
  39609. i += 2;
  39610. break;
  39611. case "Z":
  39612. context.closePath();
  39613. i += 1
  39614. }
  39615. } while (i < dArray.length)
  39616. }
  39617. function parseStyles(element, options, rootAppended) {
  39618. var style = element.style || {};
  39619. var field;
  39620. for (field in style) {
  39621. if ("" !== style[field]) {
  39622. options[(0, _inflector.camelize)(field)] = style[field]
  39623. }
  39624. }
  39625. if (rootAppended && _dom_adapter2.default.isElementNode(element)) {
  39626. style = window.getComputedStyle(element);
  39627. ["fill", "stroke", "stroke-width", "font-family", "font-size", "font-style", "font-weight"].forEach(function(prop) {
  39628. if (prop in style && "" !== style[prop]) {
  39629. options[(0, _inflector.camelize)(prop)] = style[prop]
  39630. }
  39631. });
  39632. ["opacity", "fill-opacity", "stroke-opacity"].forEach(function(prop) {
  39633. if (prop in style && "" !== style[prop] && "1" !== style[prop]) {
  39634. options[prop] = _number(style[prop])
  39635. }
  39636. })
  39637. }
  39638. options.textDecoration = options.textDecoration || options.textDecorationLine;
  39639. options.globalAlpha = (0, _type.isDefined)(options.opacity) ? options.opacity : options.globalAlpha
  39640. }
  39641. function parseUrl(urlString) {
  39642. var matches = urlString && urlString.match(/url\(.*#(.*?)["']?\)/i);
  39643. return matches && matches[1]
  39644. }
  39645. function setFontStyle(context, options) {
  39646. var fontParams = [];
  39647. options.fontSize = options.fontSize || DEFAULT_FONT_SIZE;
  39648. options.fontFamily || DEFAULT_FONT_FAMILY;
  39649. options.fill = options.fill || DEFAULT_TEXT_COLOR;
  39650. options.fontStyle && fontParams.push(options.fontStyle);
  39651. options.fontWeight && fontParams.push(options.fontWeight);
  39652. fontParams.push(options.fontSize);
  39653. fontParams.push(options.fontFamily);
  39654. context.font = fontParams.join(" ");
  39655. context.textAlign = options.textAlign;
  39656. context.fillStyle = options.fill;
  39657. context.globalAlpha = options.globalAlpha
  39658. }
  39659. function drawText(context, options, shared) {
  39660. setFontStyle(context, options);
  39661. applyFilter(context, options, shared);
  39662. options.text && context.fillText(options.text, options.x || 0, options.y || 0);
  39663. strokeElement(context, options, true);
  39664. drawTextDecoration(context, options, shared)
  39665. }
  39666. function drawTextDecoration(context, options, shared) {
  39667. if (!options.textDecoration || "none" === options.textDecoration) {
  39668. return
  39669. }
  39670. var x = options.x;
  39671. var textWidth = context.measureText(options.text).width;
  39672. var textHeight = parseInt(options.fontSize, 10);
  39673. var lineHeight = textHeight * TEXT_DECORATION_LINE_WIDTH_COEFF < 1 ? 1 : textHeight * TEXT_DECORATION_LINE_WIDTH_COEFF;
  39674. var y = options.y;
  39675. switch (options.textDecoration) {
  39676. case "line-through":
  39677. y -= textHeight / 3 + lineHeight / 2;
  39678. break;
  39679. case "overline":
  39680. y -= textHeight - lineHeight;
  39681. break;
  39682. case "underline":
  39683. y += lineHeight
  39684. }
  39685. context.rect(x, y, textWidth, lineHeight);
  39686. fillElement(context, options, shared);
  39687. strokeElement(context, options)
  39688. }
  39689. function aggregateOpacity(options) {
  39690. options.strokeOpacity = void 0 !== options["stroke-opacity"] ? options["stroke-opacity"] : 1;
  39691. options.fillOpacity = void 0 !== options["fill-opacity"] ? options["fill-opacity"] : 1;
  39692. if (void 0 !== options.opacity) {
  39693. options.strokeOpacity *= options.opacity;
  39694. options.fillOpacity *= options.opacity
  39695. }
  39696. }
  39697. function hasTspan(element) {
  39698. var nodes = element.childNodes;
  39699. for (var i = 0; i < nodes.length; i++) {
  39700. if ("tspan" === nodes[i].tagName) {
  39701. return true
  39702. }
  39703. }
  39704. return false
  39705. }
  39706. function drawTextElement(childNodes, context, options, shared) {
  39707. var lines = [];
  39708. var line;
  39709. var offset = 0;
  39710. for (var i = 0; i < childNodes.length; i++) {
  39711. var element = childNodes[i];
  39712. if (void 0 === element.tagName) {
  39713. drawElement(element, context, options, shared)
  39714. } else {
  39715. if ("tspan" === element.tagName || "text" === element.tagName) {
  39716. var elementOptions = getElementOptions(element, shared.rootAppended);
  39717. var mergedOptions = (0, _extend.extend)({}, options, elementOptions);
  39718. if ("tspan" === element.tagName && hasTspan(element)) {
  39719. drawTextElement(element.childNodes, context, mergedOptions, shared);
  39720. continue
  39721. }
  39722. mergedOptions.textAlign = "start";
  39723. if (!line || void 0 !== elementOptions.x) {
  39724. line = {
  39725. elements: [],
  39726. options: [],
  39727. widths: [],
  39728. offsets: []
  39729. };
  39730. lines.push(line)
  39731. }
  39732. if (void 0 !== elementOptions.y) {
  39733. offset = 0
  39734. }
  39735. if (void 0 !== elementOptions.dy) {
  39736. offset += parseFloat(elementOptions.dy)
  39737. }
  39738. line.elements.push(element);
  39739. line.options.push(mergedOptions);
  39740. line.offsets.push(offset);
  39741. setFontStyle(context, mergedOptions);
  39742. line.widths.push(context.measureText(mergedOptions.text).width)
  39743. }
  39744. }
  39745. }
  39746. lines.forEach(function(line) {
  39747. var commonWidth = line.widths.reduce(function(commonWidth, width) {
  39748. return commonWidth + width
  39749. }, 0);
  39750. var xDiff = 0;
  39751. var currentOffset = 0;
  39752. if ("center" === options.textAlign) {
  39753. xDiff = commonWidth / 2
  39754. }
  39755. if ("end" === options.textAlign) {
  39756. xDiff = commonWidth
  39757. }
  39758. line.options.forEach(function(o, index) {
  39759. var width = line.widths[index];
  39760. o.x = o.x - xDiff + currentOffset;
  39761. o.y += line.offsets[index];
  39762. currentOffset += width
  39763. });
  39764. line.elements.forEach(function(element, index) {
  39765. drawTextElement(element.childNodes, context, line.options[index], shared)
  39766. })
  39767. })
  39768. }
  39769. function drawElement(element, context, parentOptions, shared) {
  39770. var tagName = element.tagName;
  39771. var isText = "text" === tagName || "tspan" === tagName || void 0 === tagName;
  39772. var isImage = "image" === tagName;
  39773. var options = (0, _extend.extend)({}, parentOptions, getElementOptions(element, shared.rootAppended));
  39774. if ("hidden" === options.visibility || options["hidden-for-export"]) {
  39775. return
  39776. }
  39777. context.save();
  39778. !isImage && transformElement(context, options);
  39779. clipElement(context, options, shared);
  39780. aggregateOpacity(options);
  39781. var promise;
  39782. context.beginPath();
  39783. switch (element.tagName) {
  39784. case void 0:
  39785. drawText(context, options, shared);
  39786. break;
  39787. case "text":
  39788. case "tspan":
  39789. drawTextElement(element.childNodes, context, options, shared);
  39790. break;
  39791. case "image":
  39792. promise = drawImage(context, options, shared);
  39793. break;
  39794. case "path":
  39795. drawPath(context, options.d);
  39796. break;
  39797. case "rect":
  39798. drawRect(context, options);
  39799. context.closePath();
  39800. break;
  39801. case "circle":
  39802. context.arc(options.cx, options.cy, options.r, 0, 2 * PI, 1)
  39803. }
  39804. if (!isText) {
  39805. applyFilter(context, options, shared);
  39806. fillElement(context, options, shared);
  39807. strokeElement(context, options)
  39808. }
  39809. applyGradient(context, options, shared, element);
  39810. context.restore();
  39811. return promise
  39812. }
  39813. function applyGradient(context, options, _ref, element) {
  39814. var gradients = _ref.gradients;
  39815. if (0 === gradients.length) {
  39816. return
  39817. }
  39818. var id = parseUrl(options.fill);
  39819. if (id && gradients[id]) {
  39820. var box = element.getBBox();
  39821. var gradient = context.createLinearGradient(box.x, 0, box.x + box.width, 0);
  39822. gradients[id].forEach(function(opt) {
  39823. var offset = parseInt(opt.offset.replace(/%/, ""));
  39824. gradient.addColorStop(offset / 100, opt.stopColor)
  39825. });
  39826. context.globalAlpha = options.opacity;
  39827. context.fillStyle = gradient;
  39828. context.fill()
  39829. }
  39830. }
  39831. function applyFilter(context, options, shared) {
  39832. var filterOptions;
  39833. var id = parseUrl(options.filter);
  39834. if (id) {
  39835. filterOptions = shared.filters[id];
  39836. if (!filterOptions) {
  39837. filterOptions = {
  39838. offsetX: 0,
  39839. offsetY: 0,
  39840. blur: 0,
  39841. color: "#000"
  39842. }
  39843. }
  39844. context.shadowOffsetX = filterOptions.offsetX;
  39845. context.shadowOffsetY = filterOptions.offsetY;
  39846. context.shadowColor = filterOptions.color;
  39847. context.shadowBlur = filterOptions.blur
  39848. }
  39849. }
  39850. function transformElement(context, options) {
  39851. context.translate(options.translateX || 0, options.translateY || 0);
  39852. options.translateX = void 0;
  39853. options.translateY = void 0;
  39854. if (options.rotationAngle) {
  39855. context.translate(options.rotationX || 0, options.rotationY || 0);
  39856. context.rotate(options.rotationAngle * PI / 180);
  39857. context.translate(-(options.rotationX || 0), -(options.rotationY || 0));
  39858. options.rotationAngle = void 0;
  39859. options.rotationX = void 0;
  39860. options.rotationY = void 0
  39861. }
  39862. if (isFinite(options.scaleX)) {
  39863. context.scale(options.scaleX, options.scaleY);
  39864. options.scaleX = void 0;
  39865. options.scaleY = void 0
  39866. }
  39867. }
  39868. function clipElement(context, options, shared) {
  39869. if (options["clip-path"]) {
  39870. drawElement(shared.clipPaths[parseUrl(options["clip-path"])], context, {}, shared);
  39871. context.clip();
  39872. options["clip-path"] = void 0
  39873. }
  39874. }
  39875. function hex2rgba(hexColor, alpha) {
  39876. var color = new _color2.default(hexColor);
  39877. return "rgba(" + color.r + "," + color.g + "," + color.b + "," + alpha + ")"
  39878. }
  39879. function createGradient(element) {
  39880. var options = [];
  39881. (0, _iterator.each)(element.childNodes, function(_, _ref2) {
  39882. var attributes = _ref2.attributes;
  39883. options.push({
  39884. offset: attributes.offset.value,
  39885. stopColor: attributes["stop-color"].value
  39886. })
  39887. });
  39888. return options
  39889. }
  39890. function createFilter(element) {
  39891. var color;
  39892. var filterOptions = {};
  39893. (0, _iterator.each)(element.childNodes, function(_, node) {
  39894. var attr = node.attributes;
  39895. if (!attr.result) {
  39896. return
  39897. }
  39898. switch (attr.result.value) {
  39899. case "gaussianBlurResult":
  39900. filterOptions.blur = _number(attr.stdDeviation.value);
  39901. break;
  39902. case "offsetResult":
  39903. filterOptions.offsetX = _number(attr.dx.value);
  39904. filterOptions.offsetY = _number(attr.dy.value);
  39905. break;
  39906. case "floodResult":
  39907. color = attr["flood-color"] ? attr["flood-color"].value : "#000";
  39908. var opacity = attr["flood-opacity"] ? attr["flood-opacity"].value : 1;
  39909. filterOptions.color = hex2rgba(color, opacity)
  39910. }
  39911. });
  39912. return filterOptions
  39913. }
  39914. function asyncEach(array, callback) {
  39915. var d = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : new _deferred.Deferred;
  39916. if (0 === array.length) {
  39917. return d.resolve()
  39918. }
  39919. var result = callback(array[0]);
  39920. function next() {
  39921. asyncEach(Array.prototype.slice.call(array, 1), callback, d)
  39922. }
  39923. if ((0, _type.isPromise)(result)) {
  39924. result.then(next)
  39925. } else {
  39926. next()
  39927. }
  39928. return d
  39929. }
  39930. function drawCanvasElements(elements, context, parentOptions, shared) {
  39931. return asyncEach(elements, function(element) {
  39932. switch (element.tagName && element.tagName.toLowerCase()) {
  39933. case "g":
  39934. case "svg":
  39935. var options = (0, _extend.extend)({}, parentOptions, getElementOptions(element, shared.rootAppended));
  39936. context.save();
  39937. transformElement(context, options);
  39938. clipElement(context, options, shared);
  39939. var onDone = function() {
  39940. context.restore()
  39941. };
  39942. var d = drawCanvasElements(element.childNodes, context, options, shared);
  39943. if ((0, _type.isPromise)(d)) {
  39944. d.then(onDone)
  39945. } else {
  39946. onDone()
  39947. }
  39948. return d;
  39949. case "defs":
  39950. return drawCanvasElements(element.childNodes, context, {}, shared);
  39951. case "clippath":
  39952. shared.clipPaths[element.attributes.id.textContent] = element.childNodes[0];
  39953. break;
  39954. case "pattern":
  39955. shared.patterns[element.attributes.id.textContent] = element;
  39956. break;
  39957. case "filter":
  39958. shared.filters[element.id] = createFilter(element);
  39959. break;
  39960. case "lineargradient":
  39961. shared.gradients[element.attributes.id.textContent] = createGradient(element);
  39962. break;
  39963. default:
  39964. return drawElement(element, context, parentOptions, shared)
  39965. }
  39966. })
  39967. }
  39968. function setLineDash(context, options) {
  39969. var matches = options["stroke-dasharray"] && options["stroke-dasharray"].match(/(\d+)/g);
  39970. if (matches && matches.length) {
  39971. matches = (0, _iterator.map)(matches, function(item) {
  39972. return _number(item)
  39973. });
  39974. context.setLineDash(matches)
  39975. }
  39976. }
  39977. function strokeElement(context, options, isText) {
  39978. var stroke = options.stroke;
  39979. if (stroke && "none" !== stroke && 0 !== options["stroke-width"]) {
  39980. setLineDash(context, options);
  39981. context.lineJoin = options["stroke-linejoin"];
  39982. context.lineWidth = options["stroke-width"];
  39983. context.globalAlpha = options.strokeOpacity;
  39984. context.strokeStyle = stroke;
  39985. isText ? context.strokeText(options.text, options.x, options.y) : context.stroke();
  39986. context.globalAlpha = 1
  39987. }
  39988. }
  39989. function getPattern(context, pattern, shared) {
  39990. var options = getElementOptions(pattern, shared.rootAppended);
  39991. var patternCanvas = createCanvas(options.width, options.height, 0);
  39992. var patternContext = patternCanvas.getContext("2d");
  39993. drawCanvasElements(pattern.childNodes, patternContext, options, shared);
  39994. return context.createPattern(patternCanvas, "repeat")
  39995. }
  39996. function fillElement(context, options, shared) {
  39997. var fill = options.fill;
  39998. if (fill && "none" !== fill) {
  39999. if (fill.search(/url/) === -1) {
  40000. context.fillStyle = fill
  40001. } else {
  40002. var pattern = shared.patterns[parseUrl(fill)];
  40003. if (!pattern) {
  40004. return
  40005. }
  40006. context.fillStyle = getPattern(context, pattern, shared)
  40007. }
  40008. context.globalAlpha = options.fillOpacity;
  40009. context.fill();
  40010. context.globalAlpha = 1
  40011. }
  40012. }
  40013. var parseAttributes = function(attributes) {
  40014. var newAttributes = {};
  40015. var attr;
  40016. (0, _iterator.each)(attributes, function(index, item) {
  40017. attr = item.textContent;
  40018. if (isFinite(attr)) {
  40019. attr = _number(attr)
  40020. }
  40021. newAttributes[item.name.toLowerCase()] = attr
  40022. });
  40023. return newAttributes
  40024. };
  40025. function drawBackground(context, width, height, backgroundColor, margin) {
  40026. context.fillStyle = backgroundColor || "#ffffff";
  40027. context.fillRect(-margin, -margin, width + 2 * margin, height + 2 * margin)
  40028. }
  40029. function createInvisibleDiv() {
  40030. var invisibleDiv = _dom_adapter2.default.createElement("div");
  40031. invisibleDiv.style.left = "-9999px";
  40032. invisibleDiv.style.position = "absolute";
  40033. return invisibleDiv
  40034. }
  40035. function getCanvasFromSvg(markup, width, height, backgroundColor, margin) {
  40036. var canvas = createCanvas(width, height, margin);
  40037. var context = canvas.getContext("2d");
  40038. var svgElem = _svg2.default.getSvgElement(markup);
  40039. var invisibleDiv;
  40040. var markupIsDomElement = _dom_adapter2.default.isElementNode(markup);
  40041. context.translate(margin, margin);
  40042. _dom_adapter2.default.getBody().appendChild(canvas);
  40043. if (!markupIsDomElement) {
  40044. invisibleDiv = createInvisibleDiv();
  40045. invisibleDiv.appendChild(svgElem);
  40046. _dom_adapter2.default.getBody().appendChild(invisibleDiv)
  40047. }
  40048. if (svgElem.attributes.direction) {
  40049. canvas.dir = svgElem.attributes.direction.textContent
  40050. }
  40051. drawBackground(context, width, height, backgroundColor, margin);
  40052. return drawCanvasElements(svgElem.childNodes, context, {}, {
  40053. clipPaths: {},
  40054. patterns: {},
  40055. filters: {},
  40056. gradients: {},
  40057. rootAppended: markupIsDomElement && _dom2.default.contains(_dom_adapter2.default.getBody(), markup)
  40058. }).then(function() {
  40059. invisibleDiv && _dom_adapter2.default.getBody().removeChild(invisibleDiv);
  40060. _dom_adapter2.default.getBody().removeChild(canvas);
  40061. return canvas
  40062. })
  40063. }
  40064. exports.imageCreator = {
  40065. getImageData: function(markup, options) {
  40066. var mimeType = "image/" + options.format;
  40067. var width = options.width;
  40068. var height = options.height;
  40069. var backgroundColor = options.backgroundColor;
  40070. if ((0, _type.isFunction)(options.__parseAttributesFn)) {
  40071. parseAttributes = options.__parseAttributesFn
  40072. }
  40073. var deferred = new _deferred.Deferred;
  40074. getCanvasFromSvg(markup, width, height, backgroundColor, options.margin).then(function(canvas) {
  40075. deferred.resolve(getStringFromCanvas(canvas, mimeType))
  40076. });
  40077. return deferred
  40078. },
  40079. getData: function(markup, options) {
  40080. var that = this;
  40081. var deferred = new _deferred.Deferred;
  40082. exports.imageCreator.getImageData(markup, options).then(function(binaryData) {
  40083. var mimeType = "image/" + options.format;
  40084. var data = (0, _type.isFunction)(window.Blob) && !options.forceProxy ? that._getBlob(binaryData, mimeType) : that._getBase64(binaryData);
  40085. deferred.resolve(data)
  40086. });
  40087. return deferred
  40088. },
  40089. _getBlob: function(binaryData, mimeType) {
  40090. var dataArray = new Uint8Array(binaryData.length);
  40091. for (var i = 0; i < binaryData.length; i++) {
  40092. dataArray[i] = binaryData.charCodeAt(i)
  40093. }
  40094. return new window.Blob([dataArray.buffer], {
  40095. type: mimeType
  40096. })
  40097. },
  40098. _getBase64: function(binaryData) {
  40099. return window.btoa(binaryData)
  40100. }
  40101. };
  40102. exports.getData = function(data, options, callback) {
  40103. return exports.imageCreator.getData(data, options).then(callback)
  40104. };
  40105. exports.testFormats = function(formats) {
  40106. var canvas = createCanvas(100, 100, 0);
  40107. return formats.reduce(function(r, f) {
  40108. var mimeType = ("image/" + f).toLowerCase();
  40109. if (canvas.toDataURL(mimeType).indexOf(mimeType) !== -1) {
  40110. r.supported.push(f)
  40111. } else {
  40112. r.unsupported.push(f)
  40113. }
  40114. return r
  40115. }, {
  40116. supported: [],
  40117. unsupported: []
  40118. })
  40119. }
  40120. },
  40121. /*!**************************************************!*\
  40122. !*** ./artifacts/transpiled/core/utils/queue.js ***!
  40123. \**************************************************/
  40124. /*! dynamic exports provided */
  40125. /*! all exports used */
  40126. function(module, exports, __webpack_require__) {
  40127. var errors = __webpack_require__( /*! ../errors */ 21);
  40128. var when = __webpack_require__( /*! ../../core/utils/deferred */ 6).when;
  40129. function createQueue(discardPendingTasks) {
  40130. var _tasks = [];
  40131. var _busy = false;
  40132. function exec() {
  40133. while (_tasks.length) {
  40134. _busy = true;
  40135. var task = _tasks.shift();
  40136. var result = task();
  40137. if (void 0 === result) {
  40138. continue
  40139. }
  40140. if (result.then) {
  40141. when(result).always(exec);
  40142. return
  40143. }
  40144. throw errors.Error("E0015")
  40145. }
  40146. _busy = false
  40147. }
  40148. function add(task, removeTaskCallback) {
  40149. if (!discardPendingTasks) {
  40150. _tasks.push(task)
  40151. } else {
  40152. if (_tasks[0] && removeTaskCallback) {
  40153. removeTaskCallback(_tasks[0])
  40154. }
  40155. _tasks = [task]
  40156. }
  40157. if (!_busy) {
  40158. exec()
  40159. }
  40160. }
  40161. function busy() {
  40162. return _busy
  40163. }
  40164. return {
  40165. add: add,
  40166. busy: busy
  40167. }
  40168. }
  40169. exports.create = createQueue;
  40170. exports.enqueue = createQueue().add
  40171. },
  40172. /*!**************************************************!*\
  40173. !*** ./artifacts/transpiled/animation/easing.js ***!
  40174. \**************************************************/
  40175. /*! dynamic exports provided */
  40176. /*! all exports used */
  40177. function(module, exports, __webpack_require__) {
  40178. var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction;
  40179. var CSS_TRANSITION_EASING_REGEX = /cubic-bezier\((\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\)/;
  40180. var TransitionTimingFuncMap = {
  40181. linear: "cubic-bezier(0, 0, 1, 1)",
  40182. swing: "cubic-bezier(0.445, 0.05, 0.55, 0.95)",
  40183. ease: "cubic-bezier(0.25, 0.1, 0.25, 1)",
  40184. "ease-in": "cubic-bezier(0.42, 0, 1, 1)",
  40185. "ease-out": "cubic-bezier(0, 0, 0.58, 1)",
  40186. "ease-in-out": "cubic-bezier(0.42, 0, 0.58, 1)"
  40187. };
  40188. var polynomBezier = function(x1, y1, x2, y2) {
  40189. var Cx = 3 * x1;
  40190. var Bx = 3 * (x2 - x1) - Cx;
  40191. var Ax = 1 - Cx - Bx;
  40192. var Cy = 3 * y1;
  40193. var By = 3 * (y2 - y1) - Cy;
  40194. var Ay = 1 - Cy - By;
  40195. var bezierX = function(t) {
  40196. return t * (Cx + t * (Bx + t * Ax))
  40197. };
  40198. var bezierY = function(t) {
  40199. return t * (Cy + t * (By + t * Ay))
  40200. };
  40201. var findXFor = function(t) {
  40202. var x = t;
  40203. var i = 0;
  40204. var z;
  40205. while (i < 14) {
  40206. z = bezierX(x) - t;
  40207. if (Math.abs(z) < .001) {
  40208. break
  40209. }
  40210. x -= z / derivativeX(x);
  40211. i++
  40212. }
  40213. return x
  40214. };
  40215. var derivativeX = function(t) {
  40216. return Cx + t * (2 * Bx + 3 * t * Ax)
  40217. };
  40218. return function(t) {
  40219. return bezierY(findXFor(t))
  40220. }
  40221. };
  40222. var easing = {};
  40223. var convertTransitionTimingFuncToEasing = function(cssTransitionEasing) {
  40224. cssTransitionEasing = TransitionTimingFuncMap[cssTransitionEasing] || cssTransitionEasing;
  40225. var coeffs = cssTransitionEasing.match(CSS_TRANSITION_EASING_REGEX);
  40226. var forceName;
  40227. if (!coeffs) {
  40228. forceName = "linear";
  40229. coeffs = TransitionTimingFuncMap[forceName].match(CSS_TRANSITION_EASING_REGEX)
  40230. }
  40231. coeffs = coeffs.slice(1, 5);
  40232. for (var i = 0; i < coeffs.length; i++) {
  40233. coeffs[i] = parseFloat(coeffs[i])
  40234. }
  40235. var easingName = forceName || "cubicbezier_" + coeffs.join("_").replace(/\./g, "p");
  40236. if (!isFunction(easing[easingName])) {
  40237. easing[easingName] = function(x, t, b, c, d) {
  40238. return c * polynomBezier(coeffs[0], coeffs[1], coeffs[2], coeffs[3])(t / d) + b
  40239. }
  40240. }
  40241. return easingName
  40242. };
  40243. exports.setEasing = function(value) {
  40244. easing = value
  40245. };
  40246. exports.getEasing = function(name) {
  40247. return easing[name]
  40248. };
  40249. exports.convertTransitionTimingFuncToEasing = convertTransitionTimingFuncToEasing
  40250. },
  40251. /*!******************************************************!*\
  40252. !*** ./artifacts/transpiled/events/pointer/touch.js ***!
  40253. \******************************************************/
  40254. /*! dynamic exports provided */
  40255. /*! all exports used */
  40256. function(module, exports, __webpack_require__) {
  40257. var devices = __webpack_require__( /*! ../../core/devices */ 16);
  40258. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  40259. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  40260. var BaseStrategy = __webpack_require__( /*! ./base */ 154);
  40261. var eventMap = {
  40262. dxpointerdown: "touchstart",
  40263. dxpointermove: "touchmove",
  40264. dxpointerup: "touchend",
  40265. dxpointercancel: "touchcancel",
  40266. dxpointerover: "",
  40267. dxpointerout: "",
  40268. dxpointerenter: "",
  40269. dxpointerleave: ""
  40270. };
  40271. var normalizeTouchEvent = function(e) {
  40272. var pointers = [];
  40273. each(e.touches, function(_, touch) {
  40274. pointers.push(extend({
  40275. pointerId: touch.identifier
  40276. }, touch))
  40277. });
  40278. return {
  40279. pointers: pointers,
  40280. pointerId: e.changedTouches[0].identifier
  40281. }
  40282. };
  40283. var skipTouchWithSameIdentifier = function(pointerEvent) {
  40284. return "ios" === devices.real().platform && ("dxpointerdown" === pointerEvent || "dxpointerup" === pointerEvent)
  40285. };
  40286. var TouchStrategy = BaseStrategy.inherit({
  40287. ctor: function() {
  40288. this.callBase.apply(this, arguments);
  40289. this._pointerId = 0
  40290. },
  40291. _handler: function(e) {
  40292. if (skipTouchWithSameIdentifier(this._eventName)) {
  40293. var touch = e.changedTouches[0];
  40294. if (this._pointerId === touch.identifier && 0 !== this._pointerId) {
  40295. return
  40296. }
  40297. this._pointerId = touch.identifier
  40298. }
  40299. return this.callBase.apply(this, arguments)
  40300. },
  40301. _fireEvent: function(args) {
  40302. return this.callBase(extend(normalizeTouchEvent(args.originalEvent), args))
  40303. }
  40304. });
  40305. TouchStrategy.map = eventMap;
  40306. TouchStrategy.normalize = normalizeTouchEvent;
  40307. module.exports = TouchStrategy
  40308. },
  40309. /*!*********************************************************!*\
  40310. !*** ./artifacts/transpiled/events/pointer/observer.js ***!
  40311. \*********************************************************/
  40312. /*! dynamic exports provided */
  40313. /*! all exports used */
  40314. function(module, exports, __webpack_require__) {
  40315. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  40316. var readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48);
  40317. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  40318. var addEventsListener = function(events, handler) {
  40319. readyCallbacks.add(function() {
  40320. events.split(" ").forEach(function(event) {
  40321. domAdapter.listen(domAdapter.getDocument(), event, handler, true)
  40322. })
  40323. })
  40324. };
  40325. var Observer = function(eventMap, pointerEquals, onPointerAdding) {
  40326. onPointerAdding = onPointerAdding || function() {};
  40327. var pointers = [];
  40328. var getPointerIndex = function(e) {
  40329. var index = -1;
  40330. each(pointers, function(i, pointer) {
  40331. if (!pointerEquals(e, pointer)) {
  40332. return true
  40333. }
  40334. index = i;
  40335. return false
  40336. });
  40337. return index
  40338. };
  40339. var addPointer = function(e) {
  40340. if (getPointerIndex(e) === -1) {
  40341. onPointerAdding(e);
  40342. pointers.push(e)
  40343. }
  40344. };
  40345. var removePointer = function(e) {
  40346. var index = getPointerIndex(e);
  40347. if (index > -1) {
  40348. pointers.splice(index, 1)
  40349. }
  40350. };
  40351. var updatePointer = function(e) {
  40352. pointers[getPointerIndex(e)] = e
  40353. };
  40354. addEventsListener(eventMap.dxpointerdown, addPointer);
  40355. addEventsListener(eventMap.dxpointermove, updatePointer);
  40356. addEventsListener(eventMap.dxpointerup, removePointer);
  40357. addEventsListener(eventMap.dxpointercancel, removePointer);
  40358. this.pointers = function() {
  40359. return pointers
  40360. };
  40361. this.reset = function() {
  40362. pointers = []
  40363. }
  40364. };
  40365. module.exports = Observer
  40366. },
  40367. /*!******************************************************!*\
  40368. !*** ./artifacts/transpiled/events/pointer/mouse.js ***!
  40369. \******************************************************/
  40370. /*! dynamic exports provided */
  40371. /*! all exports used */
  40372. function(module, exports, __webpack_require__) {
  40373. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  40374. var BaseStrategy = __webpack_require__( /*! ./base */ 154);
  40375. var Observer = __webpack_require__( /*! ./observer */ 266);
  40376. var eventMap = {
  40377. dxpointerdown: "mousedown",
  40378. dxpointermove: "mousemove",
  40379. dxpointerup: "mouseup",
  40380. dxpointercancel: "",
  40381. dxpointerover: "mouseover",
  40382. dxpointerout: "mouseout",
  40383. dxpointerenter: "mouseenter",
  40384. dxpointerleave: "mouseleave"
  40385. };
  40386. var normalizeMouseEvent = function(e) {
  40387. e.pointerId = 1;
  40388. return {
  40389. pointers: observer.pointers(),
  40390. pointerId: 1
  40391. }
  40392. };
  40393. var observer;
  40394. var activated = false;
  40395. var activateStrategy = function() {
  40396. if (activated) {
  40397. return
  40398. }
  40399. observer = new Observer(eventMap, function() {
  40400. return true
  40401. });
  40402. activated = true
  40403. };
  40404. var MouseStrategy = BaseStrategy.inherit({
  40405. ctor: function() {
  40406. this.callBase.apply(this, arguments);
  40407. activateStrategy()
  40408. },
  40409. _fireEvent: function(args) {
  40410. return this.callBase(extend(normalizeMouseEvent(args.originalEvent), args))
  40411. }
  40412. });
  40413. MouseStrategy.map = eventMap;
  40414. MouseStrategy.normalize = normalizeMouseEvent;
  40415. MouseStrategy.activate = activateStrategy;
  40416. MouseStrategy.resetObserver = function() {
  40417. observer.reset()
  40418. };
  40419. module.exports = MouseStrategy
  40420. },
  40421. /*!****************************************************!*\
  40422. !*** ./artifacts/transpiled/integration/jquery.js ***!
  40423. \****************************************************/
  40424. /*! dynamic exports provided */
  40425. /*! all exports used */
  40426. function(module, exports, __webpack_require__) {
  40427. var jQuery = __webpack_require__( /*! jquery */ 55);
  40428. var compareVersions = __webpack_require__( /*! ../core/utils/version */ 61).compare;
  40429. var errors = __webpack_require__( /*! ../core/utils/error */ 129);
  40430. var useJQuery = __webpack_require__( /*! ./jquery/use_jquery */ 80)();
  40431. if (useJQuery && compareVersions(jQuery.fn.jquery, [1, 10]) < 0) {
  40432. throw errors.Error("E0012")
  40433. }
  40434. __webpack_require__( /*! ./jquery/renderer */ 450);
  40435. __webpack_require__( /*! ./jquery/hooks */ 451);
  40436. __webpack_require__( /*! ./jquery/deferred */ 452);
  40437. __webpack_require__( /*! ./jquery/hold_ready */ 453);
  40438. __webpack_require__( /*! ./jquery/events */ 454);
  40439. __webpack_require__( /*! ./jquery/easing */ 455);
  40440. __webpack_require__( /*! ./jquery/element_data */ 456);
  40441. __webpack_require__( /*! ./jquery/element */ 457);
  40442. __webpack_require__( /*! ./jquery/component_registrator */ 458);
  40443. __webpack_require__( /*! ./jquery/ajax */ 459)
  40444. },
  40445. /*!****************************************************!*\
  40446. !*** ./artifacts/transpiled/ui/themes_callback.js ***!
  40447. \****************************************************/
  40448. /*! dynamic exports provided */
  40449. /*! all exports used */
  40450. function(module, exports, __webpack_require__) {
  40451. var Callbacks = __webpack_require__( /*! ../core/utils/callbacks */ 26);
  40452. module.exports = new Callbacks
  40453. },
  40454. /*!*********************************!*\
  40455. !*** external "window.angular" ***!
  40456. \*********************************/
  40457. /*! dynamic exports provided */
  40458. /*! all exports used */
  40459. function(module, exports) {
  40460. module.exports = window.angular
  40461. },
  40462. /*!***************************************************!*\
  40463. !*** ./artifacts/transpiled/core/utils/locker.js ***!
  40464. \***************************************************/
  40465. /*! dynamic exports provided */
  40466. /*! all exports used */
  40467. function(module, exports, __webpack_require__) {
  40468. var errors = __webpack_require__( /*! ../errors */ 21);
  40469. var Locker = function() {
  40470. var info = {};
  40471. var currentCount = function(lockName) {
  40472. return info[lockName] || 0
  40473. };
  40474. return {
  40475. obtain: function(lockName) {
  40476. info[lockName] = currentCount(lockName) + 1
  40477. },
  40478. release: function(lockName) {
  40479. var count = currentCount(lockName);
  40480. if (count < 1) {
  40481. throw errors.Error("E0014")
  40482. }
  40483. if (1 === count) {
  40484. delete info[lockName]
  40485. } else {
  40486. info[lockName] = count - 1
  40487. }
  40488. },
  40489. locked: function(lockName) {
  40490. return currentCount(lockName) > 0
  40491. }
  40492. }
  40493. };
  40494. module.exports = Locker
  40495. },
  40496. /*!*****************************************************************!*\
  40497. !*** ./artifacts/transpiled/ui/selection/selection.strategy.js ***!
  40498. \*****************************************************************/
  40499. /*! dynamic exports provided */
  40500. /*! all exports used */
  40501. function(module, exports, __webpack_require__) {
  40502. var dataQuery = __webpack_require__( /*! ../../data/query */ 42);
  40503. var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
  40504. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  40505. var getKeyHash = commonUtils.getKeyHash;
  40506. var Class = __webpack_require__( /*! ../../core/class */ 15);
  40507. var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred;
  40508. module.exports = Class.inherit({
  40509. ctor: function(options) {
  40510. this.options = options;
  40511. this._clearItemKeys()
  40512. },
  40513. _clearItemKeys: function() {
  40514. this._setOption("addedItemKeys", []);
  40515. this._setOption("removedItemKeys", []);
  40516. this._setOption("removedItems", []);
  40517. this._setOption("addedItems", [])
  40518. },
  40519. validate: commonUtils.noop,
  40520. _setOption: function(name, value) {
  40521. this.options[name] = value
  40522. },
  40523. onSelectionChanged: function onSelectionChanged() {
  40524. var addedItemKeys = this.options.addedItemKeys;
  40525. var removedItemKeys = this.options.removedItemKeys;
  40526. var addedItems = this.options.addedItems;
  40527. var removedItems = this.options.removedItems;
  40528. var selectedItems = this.options.selectedItems;
  40529. var selectedItemKeys = this.options.selectedItemKeys;
  40530. var onSelectionChanged = this.options.onSelectionChanged || commonUtils.noop;
  40531. this._clearItemKeys();
  40532. onSelectionChanged({
  40533. selectedItems: selectedItems,
  40534. selectedItemKeys: selectedItemKeys,
  40535. addedItemKeys: addedItemKeys,
  40536. removedItemKeys: removedItemKeys,
  40537. addedItems: addedItems,
  40538. removedItems: removedItems
  40539. })
  40540. },
  40541. equalKeys: function(key1, key2) {
  40542. if (this.options.equalByReference) {
  40543. if (typeUtils.isObject(key1) && typeUtils.isObject(key2)) {
  40544. return key1 === key2
  40545. }
  40546. }
  40547. return commonUtils.equalByValue(key1, key2)
  40548. },
  40549. _clearSelection: function(keys, preserve, isDeselect, isSelectAll) {
  40550. keys = keys || [];
  40551. keys = Array.isArray(keys) ? keys : [keys];
  40552. this.validate();
  40553. return this.selectedItemKeys(keys, preserve, isDeselect, isSelectAll)
  40554. },
  40555. _loadFilteredData: function(remoteFilter, localFilter, select, isSelectAll) {
  40556. var filterLength = encodeURI(JSON.stringify(remoteFilter)).length;
  40557. var needLoadAllData = this.options.maxFilterLengthInRequest && filterLength > this.options.maxFilterLengthInRequest;
  40558. var deferred = new Deferred;
  40559. var loadOptions = {
  40560. filter: needLoadAllData ? void 0 : remoteFilter,
  40561. select: needLoadAllData ? this.options.dataFields() : select || this.options.dataFields()
  40562. };
  40563. if (remoteFilter && 0 === remoteFilter.length) {
  40564. deferred.resolve([])
  40565. } else {
  40566. this.options.load(loadOptions).done(function(items) {
  40567. var filteredItems = typeUtils.isPlainObject(items) ? items.data : items;
  40568. if (localFilter && !isSelectAll) {
  40569. filteredItems = filteredItems.filter(localFilter)
  40570. } else {
  40571. if (needLoadAllData) {
  40572. filteredItems = dataQuery(filteredItems).filter(remoteFilter).toArray()
  40573. }
  40574. }
  40575. deferred.resolve(filteredItems)
  40576. }).fail(deferred.reject.bind(deferred))
  40577. }
  40578. return deferred
  40579. },
  40580. updateSelectedItemKeyHash: function(keys) {
  40581. for (var i = 0; i < keys.length; i++) {
  40582. var keyHash = getKeyHash(keys[i]);
  40583. if (!typeUtils.isObject(keyHash)) {
  40584. this.options.keyHashIndices[keyHash] = this.options.keyHashIndices[keyHash] || [];
  40585. var keyIndices = this.options.keyHashIndices[keyHash];
  40586. keyIndices.push(i)
  40587. }
  40588. }
  40589. },
  40590. _isAnyItemSelected: function(items) {
  40591. for (var i = 0; i < items.length; i++) {
  40592. if (this.options.isItemSelected(items[i])) {
  40593. return
  40594. }
  40595. }
  40596. return false
  40597. },
  40598. _getFullSelectAllState: function() {
  40599. var items = this.options.plainItems();
  40600. var dataFilter = this.options.filter();
  40601. var selectedItems = this.options.selectedItems;
  40602. if (dataFilter) {
  40603. selectedItems = dataQuery(selectedItems).filter(dataFilter).toArray()
  40604. }
  40605. var selectedItemsLength = selectedItems.length;
  40606. if (!selectedItemsLength) {
  40607. return this._isAnyItemSelected(items)
  40608. }
  40609. if (selectedItemsLength >= this.options.totalCount()) {
  40610. return true
  40611. }
  40612. return
  40613. },
  40614. _getVisibleSelectAllState: function() {
  40615. var items = this.options.plainItems();
  40616. var hasSelectedItems = false;
  40617. var hasUnselectedItems = false;
  40618. for (var i = 0; i < items.length; i++) {
  40619. var item = items[i];
  40620. var itemData = this.options.getItemData(item);
  40621. var key = this.options.keyOf(itemData);
  40622. if (this.options.isSelectableItem(item)) {
  40623. if (this.isItemKeySelected(key)) {
  40624. hasSelectedItems = true
  40625. } else {
  40626. hasUnselectedItems = true
  40627. }
  40628. }
  40629. }
  40630. if (hasSelectedItems) {
  40631. return !hasUnselectedItems ? true : void 0
  40632. } else {
  40633. return false
  40634. }
  40635. }
  40636. })
  40637. },
  40638. /*!************************************************************!*\
  40639. !*** ./artifacts/transpiled/integration/knockout/utils.js ***!
  40640. \************************************************************/
  40641. /*! dynamic exports provided */
  40642. /*! all exports used */
  40643. function(module, exports, __webpack_require__) {
  40644. var ko = __webpack_require__( /*! knockout */ 62);
  40645. var getClosestNodeWithContext = function getClosestNodeWithContext(node) {
  40646. var context = ko.contextFor(node);
  40647. if (!context && node.parentNode) {
  40648. return getClosestNodeWithContext(node.parentNode)
  40649. }
  40650. return node
  40651. };
  40652. module.exports.getClosestNodeWithContext = getClosestNodeWithContext
  40653. },
  40654. /*!******************************************************!*\
  40655. !*** ./artifacts/transpiled/bundles/modules/data.js ***!
  40656. \******************************************************/
  40657. /*! dynamic exports provided */
  40658. /*! all exports used */
  40659. function(module, exports, __webpack_require__) {
  40660. var DevExpress = __webpack_require__( /*! ./core */ 147);
  40661. module.exports = DevExpress.data = DevExpress.data || {};
  40662. Object.defineProperty(DevExpress.data, "errorHandler", {
  40663. get: function() {
  40664. /*! ../../data/errors */
  40665. return __webpack_require__(36).errorHandler
  40666. },
  40667. set: function(value) {
  40668. __webpack_require__( /*! ../../data/errors */ 36).errorHandler = value
  40669. }
  40670. });
  40671. Object.defineProperty(DevExpress.data, "_errorHandler", {
  40672. get: function() {
  40673. /*! ../../data/errors */
  40674. return __webpack_require__(36)._errorHandler
  40675. },
  40676. set: function(value) {
  40677. __webpack_require__( /*! ../../data/errors */ 36)._errorHandler = value
  40678. }
  40679. });
  40680. DevExpress.data.DataSource = __webpack_require__( /*! ../../data/data_source */ 487);
  40681. DevExpress.data.query = __webpack_require__( /*! ../../data/query */ 42);
  40682. DevExpress.data.Store = __webpack_require__( /*! ../../data/abstract_store */ 98);
  40683. DevExpress.data.ArrayStore = __webpack_require__( /*! ../../data/array_store */ 68);
  40684. DevExpress.data.CustomStore = __webpack_require__( /*! ../../data/custom_store */ 149);
  40685. DevExpress.data.LocalStore = __webpack_require__( /*! ../../data/local_store */ 488);
  40686. DevExpress.data.base64_encode = __webpack_require__( /*! ../../data/utils */ 41).base64_encode;
  40687. DevExpress.data.Guid = __webpack_require__( /*! ../../core/guid */ 40);
  40688. DevExpress.data.utils = {};
  40689. DevExpress.data.utils.compileGetter = __webpack_require__( /*! ../../core/utils/data */ 20).compileGetter;
  40690. DevExpress.data.utils.compileSetter = __webpack_require__( /*! ../../core/utils/data */ 20).compileSetter;
  40691. DevExpress.EndpointSelector = __webpack_require__( /*! ../../data/endpoint_selector */ 489);
  40692. DevExpress.data.queryImpl = __webpack_require__( /*! ../../data/query */ 42).queryImpl;
  40693. DevExpress.data.queryAdapters = __webpack_require__( /*! ../../data/query_adapters */ 181);
  40694. var dataUtils = __webpack_require__( /*! ../../data/utils */ 41);
  40695. DevExpress.data.utils.normalizeBinaryCriterion = dataUtils.normalizeBinaryCriterion;
  40696. DevExpress.data.utils.normalizeSortingInfo = dataUtils.normalizeSortingInfo;
  40697. DevExpress.data.utils.errorMessageFromXhr = dataUtils.errorMessageFromXhr;
  40698. DevExpress.data.utils.aggregators = dataUtils.aggregators;
  40699. DevExpress.data.utils.keysEqual = dataUtils.keysEqual;
  40700. DevExpress.data.utils.isDisjunctiveOperator = dataUtils.isDisjunctiveOperator;
  40701. DevExpress.data.utils.isConjunctiveOperator = dataUtils.isConjunctiveOperator;
  40702. DevExpress.data.utils.processRequestResultLock = dataUtils.processRequestResultLock;
  40703. DevExpress.data.utils.toComparable = __webpack_require__( /*! ../../core/utils/data */ 20).toComparable;
  40704. DevExpress.data.utils.multiLevelGroup = __webpack_require__( /*! ../../data/store_helper */ 81).multiLevelGroup;
  40705. DevExpress.data.utils.arrangeSortingInfo = __webpack_require__( /*! ../../data/store_helper */ 81).arrangeSortingInfo;
  40706. DevExpress.data.utils.normalizeDataSourceOptions = __webpack_require__( /*! ../../data/data_source/data_source */ 45).normalizeDataSourceOptions
  40707. },
  40708. /*!**********************************************************!*\
  40709. !*** ./artifacts/transpiled/data/proxy_url_formatter.js ***!
  40710. \**********************************************************/
  40711. /*! dynamic exports provided */
  40712. /*! all exports used */
  40713. function(module, exports, __webpack_require__) {
  40714. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  40715. var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
  40716. var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow();
  40717. var callOnce = __webpack_require__( /*! ../core/utils/call_once */ 63);
  40718. var DXPROXY_HOST = "dxproxy.devexpress.com:8000";
  40719. var urlMapping = {};
  40720. var getUrlParser = callOnce(function() {
  40721. var a = domAdapter.createElement("a");
  40722. var props = ["protocol", "hostname", "port", "pathname", "search", "hash"];
  40723. var normalizePath = function(value) {
  40724. if ("/" !== value.charAt(0)) {
  40725. value = "/" + value
  40726. }
  40727. return value
  40728. };
  40729. return function(url) {
  40730. a.href = url;
  40731. var result = {};
  40732. each(props, function() {
  40733. result[this] = a[this]
  40734. });
  40735. result.pathname = normalizePath(result.pathname);
  40736. return result
  40737. }
  40738. });
  40739. var parseUrl = function(url) {
  40740. var urlParser = getUrlParser();
  40741. return urlParser(url)
  40742. };
  40743. var extractProxyAppId = function() {
  40744. return window.location.pathname.split("/")[1]
  40745. };
  40746. module.exports = {
  40747. parseUrl: parseUrl,
  40748. isProxyUsed: function() {
  40749. return window.location.host === DXPROXY_HOST
  40750. },
  40751. formatProxyUrl: function(localUrl) {
  40752. var urlData = parseUrl(localUrl);
  40753. if (!/^(localhost$|127\.)/i.test(urlData.hostname)) {
  40754. return localUrl
  40755. }
  40756. var proxyUrlPart = DXPROXY_HOST + "/" + extractProxyAppId() + "_" + urlData.port;
  40757. urlMapping[proxyUrlPart] = urlData.hostname + ":" + urlData.port;
  40758. var resultUrl = "http://" + proxyUrlPart + urlData.pathname + urlData.search;
  40759. return resultUrl
  40760. },
  40761. formatLocalUrl: function(proxyUrl) {
  40762. if (proxyUrl.indexOf(DXPROXY_HOST) < 0) {
  40763. return proxyUrl
  40764. }
  40765. var resultUrl = proxyUrl;
  40766. for (var proxyUrlPart in urlMapping) {
  40767. if (Object.prototype.hasOwnProperty.call(urlMapping, proxyUrlPart)) {
  40768. if (proxyUrl.indexOf(proxyUrlPart) >= 0) {
  40769. resultUrl = proxyUrl.replace(proxyUrlPart, urlMapping[proxyUrlPart]);
  40770. break
  40771. }
  40772. }
  40773. }
  40774. return resultUrl
  40775. }
  40776. }
  40777. },
  40778. /*!**************************************************!*\
  40779. !*** ./artifacts/transpiled/data/odata/store.js ***!
  40780. \**************************************************/
  40781. /*! dynamic exports provided */
  40782. /*! all exports used */
  40783. function(module, exports, __webpack_require__) {
  40784. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  40785. var config = __webpack_require__( /*! ../../core/config */ 31);
  40786. var odataUtils = __webpack_require__( /*! ./utils */ 110);
  40787. var proxyUrlFormatter = __webpack_require__( /*! ../proxy_url_formatter */ 275);
  40788. var errors = __webpack_require__( /*! ../errors */ 36).errors;
  40789. var query = __webpack_require__( /*! ../query */ 42);
  40790. var Store = __webpack_require__( /*! ../abstract_store */ 98);
  40791. var mixins = __webpack_require__( /*! ./mixins */ 277);
  40792. var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
  40793. var when = deferredUtils.when;
  40794. var Deferred = deferredUtils.Deferred;
  40795. __webpack_require__( /*! ./query_adapter */ 156);
  40796. var ANONYMOUS_KEY_NAME = "5d46402c-7899-4ea9-bd81-8b73c47c7683";
  40797. function expandKeyType(key, keyType) {
  40798. var result = {};
  40799. result[key] = keyType;
  40800. return result
  40801. }
  40802. function mergeFieldTypesWithKeyType(fieldTypes, keyType) {
  40803. var result = {};
  40804. for (var field in fieldTypes) {
  40805. result[field] = fieldTypes[field]
  40806. }
  40807. for (var keyName in keyType) {
  40808. if (keyName in result) {
  40809. if (result[keyName] !== keyType[keyName]) {
  40810. errors.log("W4001", keyName)
  40811. }
  40812. } else {
  40813. result[keyName] = keyType[keyName]
  40814. }
  40815. }
  40816. return result
  40817. }
  40818. var ODataStore = Store.inherit({
  40819. ctor: function(options) {
  40820. this.callBase(options);
  40821. this._extractServiceOptions(options);
  40822. var key = this.key();
  40823. var fieldTypes = options.fieldTypes;
  40824. var keyType = options.keyType;
  40825. if (keyType) {
  40826. var keyTypeIsString = "string" === typeof keyType;
  40827. if (!key) {
  40828. key = keyTypeIsString ? ANONYMOUS_KEY_NAME : Object.keys(keyType);
  40829. this._legacyAnonymousKey = key
  40830. }
  40831. if (keyTypeIsString) {
  40832. keyType = expandKeyType(key, keyType)
  40833. }
  40834. fieldTypes = mergeFieldTypesWithKeyType(fieldTypes, keyType)
  40835. }
  40836. this._fieldTypes = fieldTypes || {};
  40837. if (2 === this.version()) {
  40838. this._updateMethod = "MERGE"
  40839. } else {
  40840. this._updateMethod = "PATCH"
  40841. }
  40842. },
  40843. _customLoadOptions: function() {
  40844. return ["expand", "customQueryParams"]
  40845. },
  40846. _byKeyImpl: function(key, extraOptions) {
  40847. var params = {};
  40848. if (extraOptions) {
  40849. params.$expand = odataUtils.generateExpand(this._version, extraOptions.expand, extraOptions.select) || void 0;
  40850. params.$select = odataUtils.generateSelect(this._version, extraOptions.select) || void 0
  40851. }
  40852. return this._sendRequest(this._byKeyUrl(key), "GET", params)
  40853. },
  40854. createQuery: function(loadOptions) {
  40855. var url;
  40856. loadOptions = loadOptions || {};
  40857. var queryOptions = {
  40858. adapter: "odata",
  40859. beforeSend: this._beforeSend,
  40860. errorHandler: this._errorHandler,
  40861. jsonp: this._jsonp,
  40862. version: this._version,
  40863. withCredentials: this._withCredentials,
  40864. expand: loadOptions.expand,
  40865. requireTotalCount: loadOptions.requireTotalCount,
  40866. deserializeDates: this._deserializeDates,
  40867. fieldTypes: this._fieldTypes
  40868. };
  40869. if (isDefined(loadOptions.urlOverride)) {
  40870. url = loadOptions.urlOverride
  40871. } else {
  40872. url = this._url
  40873. }
  40874. if (isDefined(this._filterToLower)) {
  40875. queryOptions.filterToLower = this._filterToLower
  40876. }
  40877. if (loadOptions.customQueryParams) {
  40878. var params = mixins.escapeServiceOperationParams(loadOptions.customQueryParams, this.version());
  40879. if (4 === this.version()) {
  40880. url = mixins.formatFunctionInvocationUrl(url, params)
  40881. } else {
  40882. queryOptions.params = params
  40883. }
  40884. }
  40885. return query(url, queryOptions)
  40886. },
  40887. _insertImpl: function(values) {
  40888. this._requireKey();
  40889. var that = this;
  40890. var d = new Deferred;
  40891. when(this._sendRequest(this._url, "POST", null, values)).done(function(serverResponse) {
  40892. d.resolve(config().useLegacyStoreResult ? values : serverResponse || values, that.keyOf(serverResponse))
  40893. }).fail(d.reject);
  40894. return d.promise()
  40895. },
  40896. _updateImpl: function(key, values) {
  40897. var d = new Deferred;
  40898. when(this._sendRequest(this._byKeyUrl(key), this._updateMethod, null, values)).done(function(serverResponse) {
  40899. if (config().useLegacyStoreResult) {
  40900. d.resolve(key, values)
  40901. } else {
  40902. d.resolve(serverResponse || values, key)
  40903. }
  40904. }).fail(d.reject);
  40905. return d.promise()
  40906. },
  40907. _removeImpl: function(key) {
  40908. var d = new Deferred;
  40909. when(this._sendRequest(this._byKeyUrl(key), "DELETE")).done(function() {
  40910. d.resolve(key)
  40911. }).fail(d.reject);
  40912. return d.promise()
  40913. },
  40914. _convertKey: function(value) {
  40915. var result = value;
  40916. var fieldTypes = this._fieldTypes;
  40917. var key = this.key() || this._legacyAnonymousKey;
  40918. if (Array.isArray(key)) {
  40919. result = {};
  40920. for (var i = 0; i < key.length; i++) {
  40921. var keyName = key[i];
  40922. result[keyName] = odataUtils.convertPrimitiveValue(fieldTypes[keyName], value[keyName])
  40923. }
  40924. } else {
  40925. if (fieldTypes[key]) {
  40926. result = odataUtils.convertPrimitiveValue(fieldTypes[key], value)
  40927. }
  40928. }
  40929. return result
  40930. },
  40931. _byKeyUrl: function(value, useOriginalHost) {
  40932. var baseUrl = useOriginalHost ? proxyUrlFormatter.formatLocalUrl(this._url) : this._url;
  40933. var convertedKey = this._convertKey(value);
  40934. return baseUrl + "(" + encodeURIComponent(odataUtils.serializeKey(convertedKey, this._version)) + ")"
  40935. }
  40936. }, "odata").include(mixins.SharedMethods);
  40937. module.exports = ODataStore
  40938. },
  40939. /*!***************************************************!*\
  40940. !*** ./artifacts/transpiled/data/odata/mixins.js ***!
  40941. \***************************************************/
  40942. /*! dynamic exports provided */
  40943. /*! all exports used */
  40944. function(module, exports, __webpack_require__) {
  40945. var stringUtils = __webpack_require__( /*! ../../core/utils/string */ 44);
  40946. var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  40947. var odataUtils = __webpack_require__( /*! ./utils */ 110);
  40948. __webpack_require__( /*! ./query_adapter */ 156);
  40949. var DEFAULT_PROTOCOL_VERSION = 2;
  40950. var formatFunctionInvocationUrl = function(baseUrl, args) {
  40951. return stringUtils.format("{0}({1})", baseUrl, iteratorUtils.map(args || {}, function(value, key) {
  40952. return stringUtils.format("{0}={1}", key, value)
  40953. }).join(","))
  40954. };
  40955. var escapeServiceOperationParams = function(params, version) {
  40956. if (!params) {
  40957. return params
  40958. }
  40959. var result = {};
  40960. iteratorUtils.each(params, function(k, v) {
  40961. result[k] = odataUtils.serializeValue(v, version)
  40962. });
  40963. return result
  40964. };
  40965. var SharedMethods = {
  40966. _extractServiceOptions: function(options) {
  40967. options = options || {};
  40968. this._url = String(options.url).replace(/\/+$/, "");
  40969. this._beforeSend = options.beforeSend;
  40970. this._jsonp = options.jsonp;
  40971. this._version = options.version || DEFAULT_PROTOCOL_VERSION;
  40972. this._withCredentials = options.withCredentials;
  40973. this._deserializeDates = options.deserializeDates;
  40974. this._filterToLower = options.filterToLower
  40975. },
  40976. _sendRequest: function(url, method, params, payload) {
  40977. return odataUtils.sendRequest(this.version(), {
  40978. url: url,
  40979. method: method,
  40980. params: params || {},
  40981. payload: payload
  40982. }, {
  40983. beforeSend: this._beforeSend,
  40984. jsonp: this._jsonp,
  40985. withCredentials: this._withCredentials,
  40986. deserializeDates: this._deserializeDates
  40987. })
  40988. },
  40989. version: function() {
  40990. return this._version
  40991. }
  40992. };
  40993. exports.SharedMethods = SharedMethods;
  40994. exports.escapeServiceOperationParams = escapeServiceOperationParams;
  40995. exports.formatFunctionInvocationUrl = formatFunctionInvocationUrl
  40996. },
  40997. /*!**********************************************************!*\
  40998. !*** ./artifacts/transpiled/localization/ldml/number.js ***!
  40999. \**********************************************************/
  41000. /*! dynamic exports provided */
  41001. /*! all exports used */
  41002. function(module, exports, __webpack_require__) {
  41003. var fitIntoRange = __webpack_require__( /*! ../../core/utils/math */ 28).fitIntoRange;
  41004. var toFixed = __webpack_require__( /*! ../utils */ 256).toFixed;
  41005. var DEFAULT_CONFIG = {
  41006. thousandsSeparator: ",",
  41007. decimalSeparator: "."
  41008. };
  41009. var ESCAPING_CHAR = "'";
  41010. var MAXIMUM_NUMBER_LENGTH = 15;
  41011. function getGroupSizes(formatString) {
  41012. return formatString.split(",").slice(1).map(function(str) {
  41013. return str.split("").filter(function(char) {
  41014. return "#" === char || "0" === char
  41015. }).length
  41016. })
  41017. }
  41018. function getSignParts(format) {
  41019. var signParts = format.split(";");
  41020. if (1 === signParts.length) {
  41021. signParts.push("-" + signParts[0])
  41022. }
  41023. return signParts
  41024. }
  41025. function reverseString(str) {
  41026. return str.toString().split("").reverse().join("")
  41027. }
  41028. function isPercentFormat(format) {
  41029. return format.indexOf("%") !== -1 && !format.match(/'[^']*%[^']*'/g)
  41030. }
  41031. function getNonRequiredDigitCount(floatFormat) {
  41032. if (!floatFormat) {
  41033. return 0
  41034. }
  41035. return floatFormat.length - floatFormat.replace(/[#]/g, "").length
  41036. }
  41037. function getRequiredDigitCount(floatFormat) {
  41038. if (!floatFormat) {
  41039. return 0
  41040. }
  41041. return floatFormat.length - floatFormat.replace(/[0]/g, "").length
  41042. }
  41043. function normalizeValueString(valuePart, minDigitCount, maxDigitCount) {
  41044. if (!valuePart) {
  41045. return ""
  41046. }
  41047. if (valuePart.length > maxDigitCount) {
  41048. valuePart = valuePart.substr(0, maxDigitCount)
  41049. }
  41050. while (valuePart.length > minDigitCount && "0" === valuePart.slice(-1)) {
  41051. valuePart = valuePart.substr(0, valuePart.length - 1)
  41052. }
  41053. while (valuePart.length < minDigitCount) {
  41054. valuePart += "0"
  41055. }
  41056. return valuePart
  41057. }
  41058. function applyGroups(valueString, groupSizes, thousandsSeparator) {
  41059. if (!groupSizes.length) {
  41060. return valueString
  41061. }
  41062. var groups = [];
  41063. var index = 0;
  41064. while (valueString) {
  41065. var groupSize = groupSizes[index];
  41066. groups.push(valueString.slice(0, groupSize));
  41067. valueString = valueString.slice(groupSize);
  41068. if (index < groupSizes.length - 1) {
  41069. index++
  41070. }
  41071. }
  41072. return groups.join(thousandsSeparator)
  41073. }
  41074. function formatNumberPart(format, valueString) {
  41075. return format.split(ESCAPING_CHAR).map(function(formatPart, escapeIndex) {
  41076. var isEscape = escapeIndex % 2;
  41077. if (!formatPart && isEscape) {
  41078. return ESCAPING_CHAR
  41079. }
  41080. return isEscape ? formatPart : formatPart.replace(/[,#0]+/, valueString)
  41081. }).join("")
  41082. }
  41083. function getFloatPointIndex(format) {
  41084. var isEscape = false;
  41085. for (var index = 0; index < format.length; index++) {
  41086. if ("'" === format[index]) {
  41087. isEscape = !isEscape
  41088. }
  41089. if ("." === format[index] && !isEscape) {
  41090. return index
  41091. }
  41092. }
  41093. return format.length
  41094. }
  41095. function getFormatter(format, config) {
  41096. config = config || DEFAULT_CONFIG;
  41097. return function(value) {
  41098. if ("number" !== typeof value || isNaN(value)) {
  41099. return ""
  41100. }
  41101. var signFormatParts = getSignParts(format);
  41102. var isPositiveZero = 1 / value === 1 / 0;
  41103. var isPositive = value > 0 || isPositiveZero;
  41104. var numberFormat = signFormatParts[isPositive ? 0 : 1];
  41105. if (isPercentFormat(numberFormat)) {
  41106. value = 100 * value
  41107. }
  41108. if (!isPositive) {
  41109. value = -value
  41110. }
  41111. var floatPointIndex = getFloatPointIndex(numberFormat);
  41112. var floatFormatParts = [numberFormat.substr(0, floatPointIndex), numberFormat.substr(floatPointIndex + 1)];
  41113. var minFloatPrecision = getRequiredDigitCount(floatFormatParts[1]);
  41114. var maxFloatPrecision = minFloatPrecision + getNonRequiredDigitCount(floatFormatParts[1]);
  41115. var minIntegerPrecision = getRequiredDigitCount(floatFormatParts[0]);
  41116. var maxIntegerPrecision = getNonRequiredDigitCount(floatFormatParts[0]) ? void 0 : minIntegerPrecision;
  41117. var integerLength = Math.floor(value).toString().length;
  41118. var floatPrecision = fitIntoRange(maxFloatPrecision, 0, MAXIMUM_NUMBER_LENGTH - integerLength);
  41119. var groupSizes = getGroupSizes(floatFormatParts[0]).reverse();
  41120. var valueParts = toFixed(value, floatPrecision < 0 ? 0 : floatPrecision).split(".");
  41121. var valueIntegerPart = normalizeValueString(reverseString(valueParts[0]), minIntegerPrecision, maxIntegerPrecision);
  41122. var valueFloatPart = normalizeValueString(valueParts[1], minFloatPrecision, maxFloatPrecision);
  41123. valueIntegerPart = applyGroups(valueIntegerPart, groupSizes, config.thousandsSeparator);
  41124. var integerString = reverseString(formatNumberPart(reverseString(floatFormatParts[0]), valueIntegerPart));
  41125. var floatString = maxFloatPrecision ? formatNumberPart(floatFormatParts[1], valueFloatPart) : "";
  41126. var result = integerString + (floatString.match(/\d/) ? config.decimalSeparator : "") + floatString;
  41127. return result
  41128. }
  41129. }
  41130. function parseValue(text, isPercent, isNegative) {
  41131. var value = (isPercent ? .01 : 1) * parseFloat(text) || 0;
  41132. return isNegative ? -value : value
  41133. }
  41134. function prepareValueText(valueText, formatter, isPercent, isIntegerPart) {
  41135. var nextValueText = valueText;
  41136. var char;
  41137. var text;
  41138. var nextText;
  41139. do {
  41140. if (nextText) {
  41141. char = text.length === nextText.length ? "0" : "1";
  41142. valueText = isIntegerPart ? char + valueText : valueText + char
  41143. }
  41144. text = nextText || formatter(parseValue(nextValueText, isPercent));
  41145. nextValueText = isIntegerPart ? "1" + nextValueText : nextValueText + "1";
  41146. nextText = formatter(parseValue(nextValueText, isPercent))
  41147. } while (text !== nextText && (isIntegerPart ? text.length === nextText.length : text.length <= nextText.length));
  41148. if (isIntegerPart && nextText.length > text.length) {
  41149. var hasGroups = formatter(12345).indexOf("12345") === -1;
  41150. do {
  41151. valueText = "1" + valueText
  41152. } while (hasGroups && parseValue(valueText, isPercent) < 1e5)
  41153. }
  41154. return valueText
  41155. }
  41156. function getFormatByValueText(valueText, formatter, isPercent, isNegative) {
  41157. var format = formatter(parseValue(valueText, isPercent, isNegative));
  41158. var valueTextParts = valueText.split(".");
  41159. var valueTextWithModifiedFloat = valueTextParts[0] + ".3" + valueTextParts[1].slice(1);
  41160. var valueWithModifiedFloat = parseValue(valueTextWithModifiedFloat, isPercent, isNegative);
  41161. var decimalSeparatorIndex = formatter(valueWithModifiedFloat).indexOf("3") - 1;
  41162. format = format.replace(/(\d)\D(\d)/g, "$1,$2");
  41163. if (decimalSeparatorIndex >= 0) {
  41164. format = format.slice(0, decimalSeparatorIndex) + "." + format.slice(decimalSeparatorIndex + 1)
  41165. }
  41166. format = format.replace(/1+/, "1").replace(/1/g, "#");
  41167. if (!isPercent) {
  41168. format = format.replace("%", "'%'")
  41169. }
  41170. return format
  41171. }
  41172. function getFormat(formatter) {
  41173. var valueText = ".";
  41174. var isPercent = formatter(1).indexOf("100") >= 0;
  41175. valueText = prepareValueText(valueText, formatter, isPercent, true);
  41176. valueText = prepareValueText(valueText, formatter, isPercent, false);
  41177. var positiveFormat = getFormatByValueText(valueText, formatter, isPercent, false);
  41178. var negativeFormat = getFormatByValueText(valueText, formatter, isPercent, true);
  41179. return negativeFormat === "-" + positiveFormat ? positiveFormat : positiveFormat + ";" + negativeFormat
  41180. }
  41181. exports.getFormatter = getFormatter;
  41182. exports.getFormat = getFormat
  41183. },
  41184. /*!*************************************************************!*\
  41185. !*** ./artifacts/transpiled/localization/language_codes.js ***!
  41186. \*************************************************************/
  41187. /*! dynamic exports provided */
  41188. /*! all exports used */
  41189. function(module, exports, __webpack_require__) {
  41190. var locale = __webpack_require__( /*! ./core */ 87).locale;
  41191. var LANGUAGE_CODES = {
  41192. ar: 1,
  41193. bg: 2,
  41194. ca: 3,
  41195. "zh-Hans": 4,
  41196. cs: 5,
  41197. da: 6,
  41198. de: 7,
  41199. el: 8,
  41200. en: 9,
  41201. es: 10,
  41202. fi: 11,
  41203. fr: 12,
  41204. he: 13,
  41205. hu: 14,
  41206. is: 15,
  41207. it: 16,
  41208. ja: 17,
  41209. ko: 18,
  41210. nl: 19,
  41211. no: 20,
  41212. pl: 21,
  41213. pt: 22,
  41214. rm: 23,
  41215. ro: 24,
  41216. ru: 25,
  41217. hr: 26,
  41218. sk: 27,
  41219. sq: 28,
  41220. sv: 29,
  41221. th: 30,
  41222. tr: 31,
  41223. ur: 32,
  41224. id: 33,
  41225. uk: 34,
  41226. be: 35,
  41227. sl: 36,
  41228. et: 37,
  41229. lv: 38,
  41230. lt: 39,
  41231. tg: 40,
  41232. fa: 41,
  41233. vi: 42,
  41234. hy: 43,
  41235. az: 44,
  41236. eu: 45,
  41237. hsb: 46,
  41238. mk: 47,
  41239. tn: 50,
  41240. xh: 52,
  41241. zu: 53,
  41242. af: 54,
  41243. ka: 55,
  41244. fo: 56,
  41245. hi: 57,
  41246. mt: 58,
  41247. se: 59,
  41248. ga: 60,
  41249. ms: 62,
  41250. kk: 63,
  41251. ky: 64,
  41252. sw: 65,
  41253. tk: 66,
  41254. uz: 67,
  41255. tt: 68,
  41256. bn: 69,
  41257. pa: 70,
  41258. gu: 71,
  41259. or: 72,
  41260. ta: 73,
  41261. te: 74,
  41262. kn: 75,
  41263. ml: 76,
  41264. as: 77,
  41265. mr: 78,
  41266. sa: 79,
  41267. mn: 80,
  41268. bo: 81,
  41269. cy: 82,
  41270. km: 83,
  41271. lo: 84,
  41272. gl: 86,
  41273. kok: 87,
  41274. syr: 90,
  41275. si: 91,
  41276. iu: 93,
  41277. am: 94,
  41278. tzm: 95,
  41279. ne: 97,
  41280. fy: 98,
  41281. ps: 99,
  41282. fil: 100,
  41283. dv: 101,
  41284. ha: 104,
  41285. yo: 106,
  41286. quz: 107,
  41287. nso: 108,
  41288. ba: 109,
  41289. lb: 110,
  41290. kl: 111,
  41291. ig: 112,
  41292. ii: 120,
  41293. arn: 122,
  41294. moh: 124,
  41295. br: 126,
  41296. ug: 128,
  41297. mi: 129,
  41298. oc: 130,
  41299. co: 131,
  41300. gsw: 132,
  41301. sah: 133,
  41302. qut: 134,
  41303. rw: 135,
  41304. wo: 136,
  41305. prs: 140,
  41306. gd: 145,
  41307. "ar-SA": 1025,
  41308. "bg-BG": 1026,
  41309. "ca-ES": 1027,
  41310. "zh-TW": 1028,
  41311. "cs-CZ": 1029,
  41312. "da-DK": 1030,
  41313. "de-DE": 1031,
  41314. "el-GR": 1032,
  41315. "en-US": 1033,
  41316. "fi-FI": 1035,
  41317. "fr-FR": 1036,
  41318. "he-IL": 1037,
  41319. "hu-HU": 1038,
  41320. "is-IS": 1039,
  41321. "it-IT": 1040,
  41322. "ja-JP": 1041,
  41323. "ko-KR": 1042,
  41324. "nl-NL": 1043,
  41325. "nb-NO": 1044,
  41326. "pl-PL": 1045,
  41327. "pt-BR": 1046,
  41328. "rm-CH": 1047,
  41329. "ro-RO": 1048,
  41330. "ru-RU": 1049,
  41331. "hr-HR": 1050,
  41332. "sk-SK": 1051,
  41333. "sq-AL": 1052,
  41334. "sv-SE": 1053,
  41335. "th-TH": 1054,
  41336. "tr-TR": 1055,
  41337. "ur-PK": 1056,
  41338. "id-ID": 1057,
  41339. "uk-UA": 1058,
  41340. "be-BY": 1059,
  41341. "sl-SI": 1060,
  41342. "et-EE": 1061,
  41343. "lv-LV": 1062,
  41344. "lt-LT": 1063,
  41345. "tg-Cyrl-TJ": 1064,
  41346. "fa-IR": 1065,
  41347. "vi-VN": 1066,
  41348. "hy-AM": 1067,
  41349. "az-Latn-AZ": 1068,
  41350. "eu-ES": 1069,
  41351. "hsb-DE": 1070,
  41352. "mk-MK": 1071,
  41353. "tn-ZA": 1074,
  41354. "xh-ZA": 1076,
  41355. "zu-ZA": 1077,
  41356. "af-ZA": 1078,
  41357. "ka-GE": 1079,
  41358. "fo-FO": 1080,
  41359. "hi-IN": 1081,
  41360. "mt-MT": 1082,
  41361. "se-NO": 1083,
  41362. "ms-MY": 1086,
  41363. "kk-KZ": 1087,
  41364. "ky-KG": 1088,
  41365. "sw-KE": 1089,
  41366. "tk-TM": 1090,
  41367. "uz-Latn-UZ": 1091,
  41368. "tt-RU": 1092,
  41369. "bn-IN": 1093,
  41370. "pa-IN": 1094,
  41371. "gu-IN": 1095,
  41372. "or-IN": 1096,
  41373. "ta-IN": 1097,
  41374. "te-IN": 1098,
  41375. "kn-IN": 1099,
  41376. "ml-IN": 1100,
  41377. "as-IN": 1101,
  41378. "mr-IN": 1102,
  41379. "sa-IN": 1103,
  41380. "mn-MN": 1104,
  41381. "bo-CN": 1105,
  41382. "cy-GB": 1106,
  41383. "km-KH": 1107,
  41384. "lo-LA": 1108,
  41385. "gl-ES": 1110,
  41386. "kok-IN": 1111,
  41387. "syr-SY": 1114,
  41388. "si-LK": 1115,
  41389. "iu-Cans-CA": 1117,
  41390. "am-ET": 1118,
  41391. "ne-NP": 1121,
  41392. "fy-NL": 1122,
  41393. "ps-AF": 1123,
  41394. "fil-PH": 1124,
  41395. "dv-MV": 1125,
  41396. "ha-Latn-NG": 1128,
  41397. "yo-NG": 1130,
  41398. "quz-BO": 1131,
  41399. "nso-ZA": 1132,
  41400. "ba-RU": 1133,
  41401. "lb-LU": 1134,
  41402. "kl-GL": 1135,
  41403. "ig-NG": 1136,
  41404. "ii-CN": 1144,
  41405. "arn-CL": 1146,
  41406. "moh-CA": 1148,
  41407. "br-FR": 1150,
  41408. "ug-CN": 1152,
  41409. "mi-NZ": 1153,
  41410. "oc-FR": 1154,
  41411. "co-FR": 1155,
  41412. "gsw-FR": 1156,
  41413. "sah-RU": 1157,
  41414. "qut-GT": 1158,
  41415. "rw-RW": 1159,
  41416. "wo-SN": 1160,
  41417. "prs-AF": 1164,
  41418. "gd-GB": 1169,
  41419. "ar-IQ": 2049,
  41420. "zh-CN": 2052,
  41421. "de-CH": 2055,
  41422. "en-GB": 2057,
  41423. "es-MX": 2058,
  41424. "fr-BE": 2060,
  41425. "it-CH": 2064,
  41426. "nl-BE": 2067,
  41427. "nn-NO": 2068,
  41428. "pt-PT": 2070,
  41429. "sr-Latn-CS": 2074,
  41430. "sv-FI": 2077,
  41431. "az-Cyrl-AZ": 2092,
  41432. "dsb-DE": 2094,
  41433. "se-SE": 2107,
  41434. "ga-IE": 2108,
  41435. "ms-BN": 2110,
  41436. "uz-Cyrl-UZ": 2115,
  41437. "bn-BD": 2117,
  41438. "mn-Mong-CN": 2128,
  41439. "iu-Latn-CA": 2141,
  41440. "tzm-Latn-DZ": 2143,
  41441. "quz-EC": 2155,
  41442. "ar-EG": 3073,
  41443. "zh-HK": 3076,
  41444. "de-AT": 3079,
  41445. "en-AU": 3081,
  41446. "es-ES": 3082,
  41447. "fr-CA": 3084,
  41448. "sr-Cyrl-CS": 3098,
  41449. "se-FI": 3131,
  41450. "quz-PE": 3179,
  41451. "ar-LY": 4097,
  41452. "zh-SG": 4100,
  41453. "de-LU": 4103,
  41454. "en-CA": 4105,
  41455. "es-GT": 4106,
  41456. "fr-CH": 4108,
  41457. "hr-BA": 4122,
  41458. "smj-NO": 4155,
  41459. "ar-DZ": 5121,
  41460. "zh-MO": 5124,
  41461. "de-LI": 5127,
  41462. "en-NZ": 5129,
  41463. "es-CR": 5130,
  41464. "fr-LU": 5132,
  41465. "bs-Latn-BA": 5146,
  41466. "smj-SE": 5179,
  41467. "ar-MA": 6145,
  41468. "en-IE": 6153,
  41469. "es-PA": 6154,
  41470. "fr-MC": 6156,
  41471. "sr-Latn-BA": 6170,
  41472. "sma-NO": 6203,
  41473. "ar-TN": 7169,
  41474. "en-ZA": 7177,
  41475. "es-DO": 7178,
  41476. "sr-Cyrl-BA": 7194,
  41477. "sma-SE": 7227,
  41478. "ar-OM": 8193,
  41479. "en-JM": 8201,
  41480. "es-VE": 8202,
  41481. "bs-Cyrl-BA": 8218,
  41482. "sms-FI": 8251,
  41483. "ar-YE": 9217,
  41484. "en-029": 9225,
  41485. "es-CO": 9226,
  41486. "sr-Latn-RS": 9242,
  41487. "smn-FI": 9275,
  41488. "ar-SY": 10241,
  41489. "en-BZ": 10249,
  41490. "es-PE": 10250,
  41491. "sr-Cyrl-RS": 10266,
  41492. "ar-JO": 11265,
  41493. "en-TT": 11273,
  41494. "es-AR": 11274,
  41495. "sr-Latn-ME": 11290,
  41496. "ar-LB": 12289,
  41497. "en-ZW": 12297,
  41498. "es-EC": 12298,
  41499. "sr-Cyrl-ME": 12314,
  41500. "ar-KW": 13313,
  41501. "en-PH": 13321,
  41502. "es-CL": 13322,
  41503. "ar-AE": 14337,
  41504. "es-UY": 14346,
  41505. "ar-BH": 15361,
  41506. "es-PY": 15370,
  41507. "ar-QA": 16385,
  41508. "en-IN": 16393,
  41509. "es-BO": 16394,
  41510. "en-MY": 17417,
  41511. "es-SV": 17418,
  41512. "en-SG": 18441,
  41513. "es-HN": 18442,
  41514. "es-NI": 19466,
  41515. "es-PR": 20490,
  41516. "es-US": 21514,
  41517. "bs-Cyrl": 25626,
  41518. "bs-Latn": 26650,
  41519. "sr-Cyrl": 27674,
  41520. "sr-Latn": 28698,
  41521. smn: 28731,
  41522. "az-Cyrl": 29740,
  41523. sms: 29755,
  41524. zh: 30724,
  41525. nn: 30740,
  41526. bs: 30746,
  41527. "az-Latn": 30764,
  41528. sma: 30779,
  41529. "uz-Cyrl": 30787,
  41530. "mn-Cyrl": 30800,
  41531. "iu-Cans": 30813,
  41532. "zh-Hant": 31748,
  41533. nb: 31764,
  41534. sr: 31770,
  41535. "tg-Cyrl": 31784,
  41536. dsb: 31790,
  41537. smj: 31803,
  41538. "uz-Latn": 31811,
  41539. "mn-Mong": 31824,
  41540. "iu-Latn": 31837,
  41541. "tzm-Latn": 31839,
  41542. "ha-Latn": 31848
  41543. };
  41544. exports.getLanguageId = function() {
  41545. return LANGUAGE_CODES[locale()]
  41546. }
  41547. },
  41548. /*!****************************************************!*\
  41549. !*** ./artifacts/transpiled/core/utils/storage.js ***!
  41550. \****************************************************/
  41551. /*! dynamic exports provided */
  41552. /*! all exports used */
  41553. function(module, exports, __webpack_require__) {
  41554. var window = __webpack_require__( /*! ../../core/utils/window */ 7).getWindow();
  41555. var getSessionStorage = function() {
  41556. var sessionStorage;
  41557. try {
  41558. sessionStorage = window.sessionStorage
  41559. } catch (e) {}
  41560. return sessionStorage
  41561. };
  41562. exports.sessionStorage = getSessionStorage
  41563. },
  41564. /*!***********************************************************************************!*\
  41565. !*** ./artifacts/transpiled/animation/transition_executor/transition_executor.js ***!
  41566. \***********************************************************************************/
  41567. /*! dynamic exports provided */
  41568. /*! all exports used */
  41569. function(module, exports, __webpack_require__) {
  41570. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  41571. var Class = __webpack_require__( /*! ../../core/class */ 15);
  41572. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  41573. var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
  41574. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  41575. var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  41576. var fx = __webpack_require__( /*! ../fx */ 38);
  41577. var animationPresetsModule = __webpack_require__( /*! ../presets/presets */ 179);
  41578. var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
  41579. var when = deferredUtils.when;
  41580. var Deferred = deferredUtils.Deferred;
  41581. var directionPostfixes = {
  41582. forward: " dx-forward",
  41583. backward: " dx-backward",
  41584. none: " dx-no-direction",
  41585. undefined: " dx-no-direction"
  41586. };
  41587. var DX_ANIMATING_CLASS = "dx-animating";
  41588. var TransitionExecutor = Class.inherit({
  41589. ctor: function() {
  41590. this._accumulatedDelays = {
  41591. enter: 0,
  41592. leave: 0
  41593. };
  41594. this._animations = [];
  41595. this.reset()
  41596. },
  41597. _createAnimations: function($elements, initialConfig, configModifier, type) {
  41598. var that = this;
  41599. var result = [];
  41600. configModifier = configModifier || {};
  41601. var animationConfig = this._prepareElementAnimationConfig(initialConfig, configModifier, type);
  41602. if (animationConfig) {
  41603. $elements.each(function() {
  41604. var animation = that._createAnimation($(this), animationConfig, configModifier);
  41605. if (animation) {
  41606. animation.element.addClass(DX_ANIMATING_CLASS);
  41607. animation.setup();
  41608. result.push(animation)
  41609. }
  41610. })
  41611. }
  41612. return result
  41613. },
  41614. _prepareElementAnimationConfig: function(config, configModifier, type) {
  41615. var result;
  41616. if ("string" === typeof config) {
  41617. var presetName = config;
  41618. config = animationPresetsModule.presets.getPreset(presetName)
  41619. }
  41620. if (!config) {
  41621. result = void 0
  41622. } else {
  41623. if (typeUtils.isFunction(config[type])) {
  41624. result = config[type]
  41625. } else {
  41626. result = extend({
  41627. skipElementInitialStyles: true,
  41628. cleanupWhen: this._completePromise
  41629. }, config, configModifier);
  41630. if (!result.type || "css" === result.type) {
  41631. var cssClass = "dx-" + type;
  41632. var extraCssClasses = (result.extraCssClasses ? " " + result.extraCssClasses : "") + directionPostfixes[result.direction];
  41633. result.type = "css";
  41634. result.from = (result.from || cssClass) + extraCssClasses;
  41635. result.to = result.to || cssClass + "-active"
  41636. }
  41637. result.staggerDelay = result.staggerDelay || 0;
  41638. result.delay = result.delay || 0;
  41639. if (result.staggerDelay) {
  41640. result.delay += this._accumulatedDelays[type];
  41641. this._accumulatedDelays[type] += result.staggerDelay
  41642. }
  41643. }
  41644. }
  41645. return result
  41646. },
  41647. _createAnimation: function($element, animationConfig, configModifier) {
  41648. var result;
  41649. if (typeUtils.isPlainObject(animationConfig)) {
  41650. result = fx.createAnimation($element, animationConfig)
  41651. } else {
  41652. if (typeUtils.isFunction(animationConfig)) {
  41653. result = animationConfig($element, configModifier)
  41654. }
  41655. }
  41656. return result
  41657. },
  41658. _startAnimations: function() {
  41659. var animations = this._animations;
  41660. for (var i = 0; i < animations.length; i++) {
  41661. animations[i].start()
  41662. }
  41663. },
  41664. _stopAnimations: function(jumpToEnd) {
  41665. var animations = this._animations;
  41666. for (var i = 0; i < animations.length; i++) {
  41667. animations[i].stop(jumpToEnd)
  41668. }
  41669. },
  41670. _clearAnimations: function() {
  41671. var animations = this._animations;
  41672. for (var i = 0; i < animations.length; i++) {
  41673. animations[i].element.removeClass(DX_ANIMATING_CLASS)
  41674. }
  41675. this._animations.length = 0
  41676. },
  41677. reset: function() {
  41678. this._accumulatedDelays.enter = 0;
  41679. this._accumulatedDelays.leave = 0;
  41680. this._clearAnimations();
  41681. this._completeDeferred = new Deferred;
  41682. this._completePromise = this._completeDeferred.promise()
  41683. },
  41684. enter: function($elements, animationConfig, configModifier) {
  41685. var animations = this._createAnimations($elements, animationConfig, configModifier, "enter");
  41686. this._animations.push.apply(this._animations, animations)
  41687. },
  41688. leave: function($elements, animationConfig, configModifier) {
  41689. var animations = this._createAnimations($elements, animationConfig, configModifier, "leave");
  41690. this._animations.push.apply(this._animations, animations)
  41691. },
  41692. start: function() {
  41693. var that = this;
  41694. var result;
  41695. if (!this._animations.length) {
  41696. that.reset();
  41697. result = (new Deferred).resolve().promise()
  41698. } else {
  41699. var animationDeferreds = iteratorUtils.map(this._animations, function(animation) {
  41700. var result = new Deferred;
  41701. animation.deferred.always(function() {
  41702. result.resolve()
  41703. });
  41704. return result.promise()
  41705. });
  41706. result = when.apply($, animationDeferreds).always(function() {
  41707. that._completeDeferred.resolve();
  41708. that.reset()
  41709. });
  41710. commonUtils.executeAsync(function() {
  41711. that._startAnimations()
  41712. })
  41713. }
  41714. return result
  41715. },
  41716. stop: function(jumpToEnd) {
  41717. this._stopAnimations(jumpToEnd)
  41718. }
  41719. });
  41720. exports.TransitionExecutor = TransitionExecutor
  41721. },
  41722. /*!****************************************!*\
  41723. !*** ./artifacts/transpiled/events.js ***!
  41724. \****************************************/
  41725. /*! dynamic exports provided */
  41726. /*! all exports used */
  41727. function(module, exports, __webpack_require__) {
  41728. var eventsEngine = __webpack_require__( /*! ./events/core/events_engine */ 5);
  41729. exports.on = eventsEngine.on;
  41730. exports.one = eventsEngine.one;
  41731. exports.off = eventsEngine.off;
  41732. exports.trigger = eventsEngine.trigger;
  41733. exports.triggerHandler = eventsEngine.triggerHandler;
  41734. exports.Event = eventsEngine.Event
  41735. },
  41736. /*!********************************************************!*\
  41737. !*** ./artifacts/transpiled/ui/selection/selection.js ***!
  41738. \********************************************************/
  41739. /*! dynamic exports provided */
  41740. /*! all exports used */
  41741. function(module, exports, __webpack_require__) {
  41742. var Class = __webpack_require__( /*! ../../core/class */ 15);
  41743. var deferredStrategy = __webpack_require__( /*! ./selection.strategy.deferred */ 470);
  41744. var standardStrategy = __webpack_require__( /*! ./selection.strategy.standard */ 471);
  41745. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  41746. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  41747. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  41748. var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred;
  41749. module.exports = Class.inherit({
  41750. ctor: function(options) {
  41751. this.options = extend(this._getDefaultOptions(), options, {
  41752. selectedItemKeys: options.selectedKeys || []
  41753. });
  41754. this._selectionStrategy = this.options.deferred ? new deferredStrategy(this.options) : new standardStrategy(this.options);
  41755. this._focusedItemIndex = -1;
  41756. if (!this.options.equalByReference) {
  41757. this._selectionStrategy.updateSelectedItemKeyHash(this.options.selectedItemKeys)
  41758. }
  41759. },
  41760. _getDefaultOptions: function() {
  41761. return {
  41762. allowNullValue: false,
  41763. deferred: false,
  41764. equalByReference: false,
  41765. mode: "multiple",
  41766. selectedItems: [],
  41767. selectionFilter: [],
  41768. maxFilterLengthInRequest: 0,
  41769. onSelectionChanged: noop,
  41770. key: noop,
  41771. keyOf: function(item) {
  41772. return item
  41773. },
  41774. load: function() {
  41775. return (new Deferred).resolve([])
  41776. },
  41777. totalCount: function() {
  41778. return -1
  41779. },
  41780. isSelectableItem: function() {
  41781. return true
  41782. },
  41783. isItemSelected: function() {
  41784. return false
  41785. },
  41786. getItemData: function(item) {
  41787. return item
  41788. },
  41789. dataFields: noop,
  41790. filter: noop
  41791. }
  41792. },
  41793. validate: function() {
  41794. this._selectionStrategy.validate()
  41795. },
  41796. getSelectedItemKeys: function() {
  41797. return this._selectionStrategy.getSelectedItemKeys()
  41798. },
  41799. getSelectedItems: function() {
  41800. return this._selectionStrategy.getSelectedItems()
  41801. },
  41802. selectionFilter: function(value) {
  41803. if (void 0 === value) {
  41804. return this.options.selectionFilter
  41805. }
  41806. var filterIsChanged = this.options.selectionFilter !== value && JSON.stringify(this.options.selectionFilter) !== JSON.stringify(value);
  41807. this.options.selectionFilter = value;
  41808. filterIsChanged && this.onSelectionChanged()
  41809. },
  41810. setSelection: function(keys) {
  41811. return this.selectedItemKeys(keys)
  41812. },
  41813. select: function(keys) {
  41814. return this.selectedItemKeys(keys, true)
  41815. },
  41816. deselect: function(keys) {
  41817. return this.selectedItemKeys(keys, true, true)
  41818. },
  41819. selectedItemKeys: function(keys, preserve, isDeselect, isSelectAll) {
  41820. var that = this;
  41821. keys = keys || [];
  41822. keys = Array.isArray(keys) ? keys : [keys];
  41823. that.validate();
  41824. return this._selectionStrategy.selectedItemKeys(keys, preserve, isDeselect, isSelectAll)
  41825. },
  41826. clearSelection: function() {
  41827. return this.selectedItemKeys([])
  41828. },
  41829. _addSelectedItem: function(itemData, key) {
  41830. this._selectionStrategy.addSelectedItem(key, itemData)
  41831. },
  41832. _removeSelectedItem: function(key) {
  41833. this._selectionStrategy.removeSelectedItem(key)
  41834. },
  41835. _setSelectedItems: function(keys, items) {
  41836. this._selectionStrategy.setSelectedItems(keys, items)
  41837. },
  41838. onSelectionChanged: function() {
  41839. this._selectionStrategy.onSelectionChanged()
  41840. },
  41841. changeItemSelection: function(itemIndex, keys) {
  41842. var isSelectedItemsChanged;
  41843. var items = this.options.plainItems();
  41844. var item = items[itemIndex];
  41845. if (!this.isSelectable() || !this.isDataItem(item)) {
  41846. return false
  41847. }
  41848. var itemData = this.options.getItemData(item);
  41849. var itemKey = this.options.keyOf(itemData);
  41850. keys = keys || {};
  41851. if (keys.shift && "multiple" === this.options.mode && this._focusedItemIndex >= 0) {
  41852. isSelectedItemsChanged = this.changeItemSelectionWhenShiftKeyPressed(itemIndex, items)
  41853. } else {
  41854. if (keys.control) {
  41855. this._resetItemSelectionWhenShiftKeyPressed();
  41856. var isSelected = this._selectionStrategy.isItemDataSelected(itemData);
  41857. if ("single" === this.options.mode) {
  41858. this.clearSelectedItems()
  41859. }
  41860. if (isSelected) {
  41861. this._removeSelectedItem(itemKey)
  41862. } else {
  41863. this._addSelectedItem(itemData, itemKey)
  41864. }
  41865. isSelectedItemsChanged = true
  41866. } else {
  41867. this._resetItemSelectionWhenShiftKeyPressed();
  41868. var isKeysEqual = this._selectionStrategy.equalKeys(this.options.selectedItemKeys[0], itemKey);
  41869. if (1 !== this.options.selectedItemKeys.length || !isKeysEqual) {
  41870. this._setSelectedItems([itemKey], [itemData]);
  41871. isSelectedItemsChanged = true
  41872. }
  41873. }
  41874. }
  41875. if (isSelectedItemsChanged) {
  41876. this._focusedItemIndex = itemIndex;
  41877. this.onSelectionChanged();
  41878. return true
  41879. }
  41880. },
  41881. isDataItem: function(item) {
  41882. return this.options.isSelectableItem(item)
  41883. },
  41884. isSelectable: function() {
  41885. return "single" === this.options.mode || "multiple" === this.options.mode
  41886. },
  41887. isItemDataSelected: function(data) {
  41888. return this._selectionStrategy.isItemDataSelected(data)
  41889. },
  41890. isItemSelected: function(arg) {
  41891. return this._selectionStrategy.isItemKeySelected(arg)
  41892. },
  41893. _resetItemSelectionWhenShiftKeyPressed: function() {
  41894. delete this._shiftFocusedItemIndex
  41895. },
  41896. _resetFocusedItemIndex: function() {
  41897. this._focusedItemIndex = -1
  41898. },
  41899. changeItemSelectionWhenShiftKeyPressed: function(itemIndex, items) {
  41900. var isSelectedItemsChanged = false;
  41901. var itemIndexStep;
  41902. var index;
  41903. var keyOf = this.options.keyOf;
  41904. var focusedItem = items[this._focusedItemIndex];
  41905. var focusedData = this.options.getItemData(focusedItem);
  41906. var focusedKey = keyOf(focusedData);
  41907. var isFocusedItemSelected = focusedItem && this.isItemDataSelected(focusedData);
  41908. if (!isDefined(this._shiftFocusedItemIndex)) {
  41909. this._shiftFocusedItemIndex = this._focusedItemIndex
  41910. }
  41911. var data;
  41912. var itemKey;
  41913. if (this._shiftFocusedItemIndex !== this._focusedItemIndex) {
  41914. itemIndexStep = this._focusedItemIndex < this._shiftFocusedItemIndex ? 1 : -1;
  41915. for (index = this._focusedItemIndex; index !== this._shiftFocusedItemIndex; index += itemIndexStep) {
  41916. if (this.isDataItem(items[index])) {
  41917. itemKey = keyOf(this.options.getItemData(items[index]));
  41918. this._removeSelectedItem(itemKey);
  41919. isSelectedItemsChanged = true
  41920. }
  41921. }
  41922. }
  41923. if (itemIndex !== this._shiftFocusedItemIndex) {
  41924. itemIndexStep = itemIndex < this._shiftFocusedItemIndex ? 1 : -1;
  41925. for (index = itemIndex; index !== this._shiftFocusedItemIndex; index += itemIndexStep) {
  41926. if (this.isDataItem(items[index])) {
  41927. data = this.options.getItemData(items[index]);
  41928. itemKey = keyOf(data);
  41929. this._addSelectedItem(data, itemKey);
  41930. isSelectedItemsChanged = true
  41931. }
  41932. }
  41933. }
  41934. if (this.isDataItem(focusedItem) && !isFocusedItemSelected) {
  41935. this._addSelectedItem(focusedData, focusedKey);
  41936. isSelectedItemsChanged = true
  41937. }
  41938. return isSelectedItemsChanged
  41939. },
  41940. clearSelectedItems: function() {
  41941. this._setSelectedItems([], [])
  41942. },
  41943. selectAll: function(isOnePage) {
  41944. this._resetFocusedItemIndex();
  41945. if (isOnePage) {
  41946. return this._onePageSelectAll(false)
  41947. } else {
  41948. return this.selectedItemKeys([], true, false, true)
  41949. }
  41950. },
  41951. deselectAll: function(isOnePage) {
  41952. this._resetFocusedItemIndex();
  41953. if (isOnePage) {
  41954. return this._onePageSelectAll(true)
  41955. } else {
  41956. return this.selectedItemKeys([], true, true, true)
  41957. }
  41958. },
  41959. _onePageSelectAll: function(isDeselect) {
  41960. var items = this.options.plainItems();
  41961. for (var i = 0; i < items.length; i++) {
  41962. var item = items[i];
  41963. if (this.isDataItem(item)) {
  41964. var itemData = this.options.getItemData(item);
  41965. var itemKey = this.options.keyOf(itemData);
  41966. var isSelected = this.isItemSelected(itemKey);
  41967. if (!isSelected && !isDeselect) {
  41968. this._addSelectedItem(itemData, itemKey)
  41969. }
  41970. if (isSelected && isDeselect) {
  41971. this._removeSelectedItem(itemKey)
  41972. }
  41973. }
  41974. }
  41975. this.onSelectionChanged();
  41976. return (new Deferred).resolve()
  41977. },
  41978. getSelectAllState: function(visibleOnly) {
  41979. return this._selectionStrategy.getSelectAllState(visibleOnly)
  41980. }
  41981. })
  41982. },
  41983. /*!*************************************************************!*\
  41984. !*** ./artifacts/transpiled/core/utils/selection_filter.js ***!
  41985. \*************************************************************/
  41986. /*! dynamic exports provided */
  41987. /*! all exports used */
  41988. function(module, exports, __webpack_require__) {
  41989. var getKeyHash = __webpack_require__( /*! ./common */ 4).getKeyHash;
  41990. var equalByValue = __webpack_require__( /*! ./common */ 4).equalByValue;
  41991. var typeUtils = __webpack_require__( /*! ./type */ 1);
  41992. var SelectionFilterCreator = function(selectedItemKeys, isSelectAll) {
  41993. this.getLocalFilter = function(keyGetter, equalKeys, equalByReference, keyExpr) {
  41994. equalKeys = void 0 === equalKeys ? equalByValue : equalKeys;
  41995. return functionFilter.bind(this, equalKeys, keyGetter, equalByReference, keyExpr)
  41996. };
  41997. this.getExpr = function(keyExpr) {
  41998. if (!keyExpr) {
  41999. return
  42000. }
  42001. var filterExpr;
  42002. selectedItemKeys.forEach(function(key, index) {
  42003. filterExpr = filterExpr || [];
  42004. var filterExprPart;
  42005. if (index > 0) {
  42006. filterExpr.push(isSelectAll ? "and" : "or")
  42007. }
  42008. if (typeUtils.isString(keyExpr)) {
  42009. filterExprPart = getFilterForPlainKey(keyExpr, key)
  42010. } else {
  42011. filterExprPart = getFilterForCompositeKey(keyExpr, key)
  42012. }
  42013. filterExpr.push(filterExprPart)
  42014. });
  42015. if (filterExpr && 1 === filterExpr.length) {
  42016. filterExpr = filterExpr[0]
  42017. }
  42018. return filterExpr
  42019. };
  42020. this.getCombinedFilter = function(keyExpr, dataSourceFilter) {
  42021. var filterExpr = this.getExpr(keyExpr);
  42022. var combinedFilter = filterExpr;
  42023. if (isSelectAll && dataSourceFilter) {
  42024. if (filterExpr) {
  42025. combinedFilter = [];
  42026. combinedFilter.push(filterExpr);
  42027. combinedFilter.push(dataSourceFilter)
  42028. } else {
  42029. combinedFilter = dataSourceFilter
  42030. }
  42031. }
  42032. return combinedFilter
  42033. };
  42034. var selectedItemKeyHashesMap;
  42035. var getSelectedItemKeyHashesMap = function(selectedItemKeys) {
  42036. if (!selectedItemKeyHashesMap) {
  42037. selectedItemKeyHashesMap = {};
  42038. for (var i = 0; i < selectedItemKeys.length; i++) {
  42039. selectedItemKeyHashesMap[getKeyHash(selectedItemKeys[i])] = true
  42040. }
  42041. }
  42042. return selectedItemKeyHashesMap
  42043. };
  42044. var normalizeKeys = function(keys, keyOf, keyExpr) {
  42045. return Array.isArray(keyExpr) ? keys.map(function(key) {
  42046. return keyOf(key)
  42047. }) : keys
  42048. };
  42049. var functionFilter = function(equalKeys, keyOf, equalByReference, keyExpr, item) {
  42050. var key = keyOf(item);
  42051. var keyHash;
  42052. var i;
  42053. if (!equalByReference) {
  42054. keyHash = getKeyHash(key);
  42055. if (!typeUtils.isObject(keyHash)) {
  42056. var selectedKeyHashesMap = getSelectedItemKeyHashesMap(normalizeKeys(selectedItemKeys, keyOf, keyExpr));
  42057. if (selectedKeyHashesMap[keyHash]) {
  42058. return !isSelectAll
  42059. }
  42060. return !!isSelectAll
  42061. }
  42062. }
  42063. for (i = 0; i < selectedItemKeys.length; i++) {
  42064. if (equalKeys(selectedItemKeys[i], key)) {
  42065. return !isSelectAll
  42066. }
  42067. }
  42068. return !!isSelectAll
  42069. };
  42070. var getFilterForPlainKey = function(keyExpr, keyValue) {
  42071. if (void 0 === keyValue) {
  42072. return
  42073. }
  42074. return [keyExpr, isSelectAll ? "<>" : "=", keyValue]
  42075. };
  42076. var getFilterForCompositeKey = function(keyExpr, itemKeyValue) {
  42077. var filterExpr = [];
  42078. for (var i = 0, length = keyExpr.length; i < length; i++) {
  42079. var currentKeyExpr = keyExpr[i];
  42080. var currentKeyValue = itemKeyValue && itemKeyValue[currentKeyExpr];
  42081. var filterExprPart = getFilterForPlainKey(currentKeyExpr, currentKeyValue);
  42082. if (!filterExprPart) {
  42083. break
  42084. }
  42085. if (i > 0) {
  42086. filterExpr.push(isSelectAll ? "or" : "and")
  42087. }
  42088. filterExpr.push(filterExprPart)
  42089. }
  42090. return filterExpr
  42091. }
  42092. };
  42093. exports.SelectionFilterCreator = SelectionFilterCreator
  42094. },
  42095. /*!**************************************************!*\
  42096. !*** ./artifacts/transpiled/events/transform.js ***!
  42097. \**************************************************/
  42098. /*! dynamic exports provided */
  42099. /*! all exports used */
  42100. function(module, exports, __webpack_require__) {
  42101. var mathUtils = __webpack_require__( /*! ../core/utils/math */ 28);
  42102. var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
  42103. var errors = __webpack_require__( /*! ../core/errors */ 21);
  42104. var eventUtils = __webpack_require__( /*! ./utils */ 8);
  42105. var Emitter = __webpack_require__( /*! ./core/emitter */ 123);
  42106. var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95);
  42107. var DX_PREFIX = "dx";
  42108. var TRANSFORM = "transform";
  42109. var TRANSLATE = "translate";
  42110. var ZOOM = "zoom";
  42111. var PINCH = "pinch";
  42112. var ROTATE = "rotate";
  42113. var START_POSTFIX = "start";
  42114. var UPDATE_POSTFIX = "";
  42115. var END_POSTFIX = "end";
  42116. var eventAliases = [];
  42117. var addAlias = function(eventName, eventArgs) {
  42118. eventAliases.push({
  42119. name: eventName,
  42120. args: eventArgs
  42121. })
  42122. };
  42123. addAlias(TRANSFORM, {
  42124. scale: true,
  42125. deltaScale: true,
  42126. rotation: true,
  42127. deltaRotation: true,
  42128. translation: true,
  42129. deltaTranslation: true
  42130. });
  42131. addAlias(TRANSLATE, {
  42132. translation: true,
  42133. deltaTranslation: true
  42134. });
  42135. addAlias(ZOOM, {
  42136. scale: true,
  42137. deltaScale: true
  42138. });
  42139. addAlias(PINCH, {
  42140. scale: true,
  42141. deltaScale: true
  42142. });
  42143. addAlias(ROTATE, {
  42144. rotation: true,
  42145. deltaRotation: true
  42146. });
  42147. var getVector = function(first, second) {
  42148. return {
  42149. x: second.pageX - first.pageX,
  42150. y: -second.pageY + first.pageY,
  42151. centerX: .5 * (second.pageX + first.pageX),
  42152. centerY: .5 * (second.pageY + first.pageY)
  42153. }
  42154. };
  42155. var getEventVector = function(e) {
  42156. var pointers = e.pointers;
  42157. return getVector(pointers[0], pointers[1])
  42158. };
  42159. var getDistance = function(vector) {
  42160. return Math.sqrt(vector.x * vector.x + vector.y * vector.y)
  42161. };
  42162. var getScale = function(firstVector, secondVector) {
  42163. return getDistance(firstVector) / getDistance(secondVector)
  42164. };
  42165. var getRotation = function(firstVector, secondVector) {
  42166. var scalarProduct = firstVector.x * secondVector.x + firstVector.y * secondVector.y;
  42167. var distanceProduct = getDistance(firstVector) * getDistance(secondVector);
  42168. if (0 === distanceProduct) {
  42169. return 0
  42170. }
  42171. var sign = mathUtils.sign(firstVector.x * secondVector.y - secondVector.x * firstVector.y);
  42172. var angle = Math.acos(mathUtils.fitIntoRange(scalarProduct / distanceProduct, -1, 1));
  42173. return sign * angle
  42174. };
  42175. var getTranslation = function(firstVector, secondVector) {
  42176. return {
  42177. x: firstVector.centerX - secondVector.centerX,
  42178. y: firstVector.centerY - secondVector.centerY
  42179. }
  42180. };
  42181. var TransformEmitter = Emitter.inherit({
  42182. configure: function(data, eventName) {
  42183. if (eventName.indexOf(ZOOM) > -1) {
  42184. errors.log("W0005", eventName, "15.1", "Use '" + eventName.replace(ZOOM, PINCH) + "' event instead")
  42185. }
  42186. this.callBase(data)
  42187. },
  42188. validatePointers: function(e) {
  42189. return eventUtils.hasTouches(e) > 1
  42190. },
  42191. start: function(e) {
  42192. this._accept(e);
  42193. var startVector = getEventVector(e);
  42194. this._startVector = startVector;
  42195. this._prevVector = startVector;
  42196. this._fireEventAliases(START_POSTFIX, e)
  42197. },
  42198. move: function(e) {
  42199. var currentVector = getEventVector(e);
  42200. var eventArgs = this._getEventArgs(currentVector);
  42201. this._fireEventAliases(UPDATE_POSTFIX, e, eventArgs);
  42202. this._prevVector = currentVector
  42203. },
  42204. end: function(e) {
  42205. var eventArgs = this._getEventArgs(this._prevVector);
  42206. this._fireEventAliases(END_POSTFIX, e, eventArgs)
  42207. },
  42208. _getEventArgs: function(vector) {
  42209. return {
  42210. scale: getScale(vector, this._startVector),
  42211. deltaScale: getScale(vector, this._prevVector),
  42212. rotation: getRotation(vector, this._startVector),
  42213. deltaRotation: getRotation(vector, this._prevVector),
  42214. translation: getTranslation(vector, this._startVector),
  42215. deltaTranslation: getTranslation(vector, this._prevVector)
  42216. }
  42217. },
  42218. _fireEventAliases: function(eventPostfix, originalEvent, eventArgs) {
  42219. eventArgs = eventArgs || {};
  42220. iteratorUtils.each(eventAliases, function(_, eventAlias) {
  42221. var args = {};
  42222. iteratorUtils.each(eventAlias.args, function(name) {
  42223. if (name in eventArgs) {
  42224. args[name] = eventArgs[name]
  42225. }
  42226. });
  42227. this._fireEvent(DX_PREFIX + eventAlias.name + eventPostfix, originalEvent, args)
  42228. }.bind(this))
  42229. }
  42230. });
  42231. var eventNames = eventAliases.reduce(function(result, eventAlias) {
  42232. [START_POSTFIX, UPDATE_POSTFIX, END_POSTFIX].forEach(function(eventPostfix) {
  42233. result.push(DX_PREFIX + eventAlias.name + eventPostfix)
  42234. });
  42235. return result
  42236. }, []);
  42237. registerEmitter({
  42238. emitter: TransformEmitter,
  42239. events: eventNames
  42240. });
  42241. iteratorUtils.each(eventNames, function(_, eventName) {
  42242. exports[eventName.substring(DX_PREFIX.length)] = eventName
  42243. })
  42244. }, , ,
  42245. /*!************************************************************!*\
  42246. !*** ./artifacts/transpiled/bundles/modules/parts/data.js ***!
  42247. \************************************************************/
  42248. /*! dynamic exports provided */
  42249. /*! all exports used */
  42250. function(module, exports, __webpack_require__) {
  42251. var DevExpress = __webpack_require__( /*! ./core */ 212);
  42252. var data = DevExpress.data = __webpack_require__( /*! ../../../bundles/modules/data */ 274);
  42253. data.odata = __webpack_require__( /*! ../../../bundles/modules/data.odata */ 490);
  42254. module.exports = data
  42255. }, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
  42256. /*!*************************************************************!*\
  42257. !*** ./artifacts/transpiled/viz/series/points/pie_point.js ***!
  42258. \*************************************************************/
  42259. /*! dynamic exports provided */
  42260. /*! all exports used */
  42261. function(module, exports, __webpack_require__) {
  42262. var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
  42263. var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
  42264. var _extend = extend;
  42265. var _round = Math.round;
  42266. var _sqrt = Math.sqrt;
  42267. var _acos = Math.acos;
  42268. var DEG = 180 / Math.PI;
  42269. var _abs = Math.abs;
  42270. var vizUtils = __webpack_require__( /*! ../../core/utils */ 10);
  42271. var _normalizeAngle = vizUtils.normalizeAngle;
  42272. var _getCosAndSin = vizUtils.getCosAndSin;
  42273. var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
  42274. var getVerticallyShiftedAngularCoords = vizUtils.getVerticallyShiftedAngularCoords;
  42275. var RADIAL_LABEL_INDENT = __webpack_require__( /*! ../../components/consts */ 117).radialLabelIndent;
  42276. module.exports = _extend({}, symbolPoint, {
  42277. _updateData: function(data, argumentChanged) {
  42278. var that = this;
  42279. symbolPoint._updateData.call(this, data);
  42280. if (argumentChanged || !_isDefined(that._visible)) {
  42281. that._visible = true
  42282. }
  42283. that.minValue = that.initialMinValue = that.originalMinValue = _isDefined(data.minValue) ? data.minValue : 0
  42284. },
  42285. animate: function(complete, duration, delay) {
  42286. var that = this;
  42287. that.graphic.animate({
  42288. x: that.centerX,
  42289. y: that.centerY,
  42290. outerRadius: that.radiusOuter,
  42291. innerRadius: that.radiusInner,
  42292. startAngle: that.toAngle,
  42293. endAngle: that.fromAngle
  42294. }, {
  42295. delay: delay,
  42296. partitionDuration: duration
  42297. }, complete)
  42298. },
  42299. correctPosition: function(correction) {
  42300. var that = this;
  42301. that.correctRadius(correction);
  42302. that.correctLabelRadius(correction.radiusOuter + RADIAL_LABEL_INDENT);
  42303. that.centerX = correction.centerX;
  42304. that.centerY = correction.centerY
  42305. },
  42306. correctRadius: function(correction) {
  42307. this.radiusInner = correction.radiusInner;
  42308. this.radiusOuter = correction.radiusOuter
  42309. },
  42310. correctLabelRadius: function(radiusLabels) {
  42311. this.radiusLabels = radiusLabels
  42312. },
  42313. correctValue: function(correction, percent, base) {
  42314. var that = this;
  42315. that.value = (base || that.normalInitialValue) + correction;
  42316. that.minValue = correction;
  42317. that.percent = percent;
  42318. that._label.setDataField("percent", percent)
  42319. },
  42320. _updateLabelData: function() {
  42321. this._label.setData(this._getLabelFormatObject())
  42322. },
  42323. _getShiftLabelCoords: function() {
  42324. var that = this;
  42325. var bBox = that._label.getBoundingRect();
  42326. var coord = that._getLabelCoords(that._label);
  42327. var visibleArea = that._getVisibleArea();
  42328. if (that._isLabelDrawingWithoutPoints) {
  42329. return that._checkLabelPosition(coord, bBox, visibleArea)
  42330. } else {
  42331. return that._getLabelExtraCoord(coord, that._checkVerticalLabelPosition(coord, bBox, visibleArea), bBox)
  42332. }
  42333. },
  42334. _getLabelPosition: function(options) {
  42335. return options.position
  42336. },
  42337. _getLabelCoords: function(label) {
  42338. var that = this;
  42339. var bBox = label.getBoundingRect();
  42340. var options = label.getLayoutOptions();
  42341. var angleFunctions = _getCosAndSin(that.middleAngle);
  42342. var position = that._getLabelPosition(options);
  42343. var radiusInner = that.radiusInner;
  42344. var radiusOuter = that.radiusOuter;
  42345. var radiusLabels = that.radiusLabels;
  42346. var columnsPosition = "columns" === position;
  42347. var rad;
  42348. var x;
  42349. if ("inside" === position) {
  42350. rad = radiusInner + (radiusOuter - radiusInner) / 2 + options.radialOffset;
  42351. x = that.centerX + rad * angleFunctions.cos - bBox.width / 2
  42352. } else {
  42353. rad = radiusLabels + options.radialOffset;
  42354. if (angleFunctions.cos > .1 || columnsPosition && angleFunctions.cos >= 0) {
  42355. x = that.centerX + rad * angleFunctions.cos
  42356. } else {
  42357. if (angleFunctions.cos < -.1 || columnsPosition && angleFunctions.cos < 0) {
  42358. x = that.centerX + rad * angleFunctions.cos - bBox.width
  42359. } else {
  42360. x = that.centerX + rad * angleFunctions.cos - bBox.width / 2
  42361. }
  42362. }
  42363. }
  42364. return {
  42365. x: x,
  42366. y: _round(that.centerY - rad * angleFunctions.sin - bBox.height / 2)
  42367. }
  42368. },
  42369. _correctLabelCoord: function(coord, moveLabelsFromCenter) {
  42370. var that = this;
  42371. var label = that._label;
  42372. var bBox = label.getBoundingRect();
  42373. var labelWidth = bBox.width;
  42374. var options = label.getLayoutOptions();
  42375. var visibleArea = that._getVisibleArea();
  42376. var rightBorderX = visibleArea.maxX - labelWidth;
  42377. var leftBorderX = visibleArea.minX;
  42378. var angleOfPoint = _normalizeAngle(that.middleAngle);
  42379. var centerX = that.centerX;
  42380. var connectorOffset = options.connectorOffset;
  42381. var x = coord.x;
  42382. if ("columns" === options.position) {
  42383. if (angleOfPoint <= 90 || angleOfPoint >= 270) {
  42384. x = rightBorderX
  42385. } else {
  42386. x = leftBorderX
  42387. }
  42388. coord.x = x
  42389. } else {
  42390. if ("inside" !== options.position && moveLabelsFromCenter) {
  42391. if (angleOfPoint <= 90 || angleOfPoint >= 270) {
  42392. if (x - connectorOffset < centerX) {
  42393. x = centerX + connectorOffset
  42394. }
  42395. } else {
  42396. if (x + labelWidth + connectorOffset > centerX) {
  42397. x = centerX - labelWidth - connectorOffset
  42398. }
  42399. }
  42400. coord.x = x
  42401. }
  42402. }
  42403. return coord
  42404. },
  42405. drawLabel: function() {
  42406. this.translate();
  42407. this._isLabelDrawingWithoutPoints = true;
  42408. this._drawLabel();
  42409. this._isLabelDrawingWithoutPoints = false
  42410. },
  42411. updateLabelCoord: function(moveLabelsFromCenter) {
  42412. var that = this;
  42413. var bBox = that._label.getBoundingRect();
  42414. var coord = that._correctLabelCoord(bBox, moveLabelsFromCenter);
  42415. coord = that._checkHorizontalLabelPosition(coord, bBox, that._getVisibleArea());
  42416. that._label.shift(_round(coord.x), _round(bBox.y))
  42417. },
  42418. _checkVerticalLabelPosition: function(coord, box, visibleArea) {
  42419. var x = coord.x;
  42420. var y = coord.y;
  42421. if (coord.y + box.height > visibleArea.maxY) {
  42422. y = visibleArea.maxY - box.height
  42423. } else {
  42424. if (coord.y < visibleArea.minY) {
  42425. y = visibleArea.minY
  42426. }
  42427. }
  42428. return {
  42429. x: x,
  42430. y: y
  42431. }
  42432. },
  42433. _getLabelExtraCoord: function(coord, shiftCoord, box) {
  42434. return coord.y !== shiftCoord.y ? getVerticallyShiftedAngularCoords({
  42435. x: coord.x,
  42436. y: coord.y,
  42437. width: box.width,
  42438. height: box.height
  42439. }, shiftCoord.y - coord.y, {
  42440. x: this.centerX,
  42441. y: this.centerY
  42442. }) : coord
  42443. },
  42444. _checkHorizontalLabelPosition: function(coord, box, visibleArea) {
  42445. var x = coord.x;
  42446. var y = coord.y;
  42447. if (coord.x + box.width > visibleArea.maxX) {
  42448. x = visibleArea.maxX - box.width
  42449. } else {
  42450. if (coord.x < visibleArea.minX) {
  42451. x = visibleArea.minX
  42452. }
  42453. }
  42454. return {
  42455. x: x,
  42456. y: y
  42457. }
  42458. },
  42459. applyWordWrap: function(moveLabelsFromCenter) {
  42460. var that = this;
  42461. var label = that._label;
  42462. var box = label.getBoundingRect();
  42463. var visibleArea = that._getVisibleArea();
  42464. var position = label.getLayoutOptions().position;
  42465. var width = box.width;
  42466. var rowCountChanged = false;
  42467. if ("columns" === position && that.series.index > 0) {
  42468. width = visibleArea.maxX - that.centerX - that.radiusLabels
  42469. } else {
  42470. if ("inside" === position) {
  42471. if (width > visibleArea.maxX - visibleArea.minX) {
  42472. width = visibleArea.maxX - visibleArea.minX
  42473. }
  42474. } else {
  42475. if (moveLabelsFromCenter && box.x < that.centerX && box.width + box.x > that.centerX) {
  42476. width = Math.floor((visibleArea.maxX - visibleArea.minX) / 2)
  42477. } else {
  42478. if (box.x + width > visibleArea.maxX) {
  42479. width = visibleArea.maxX - box.x
  42480. } else {
  42481. if (box.x < visibleArea.minX) {
  42482. width = box.x + width - visibleArea.minX
  42483. }
  42484. }
  42485. }
  42486. }
  42487. }
  42488. if (width < box.width) {
  42489. rowCountChanged = label.fit(width)
  42490. }
  42491. return rowCountChanged
  42492. },
  42493. setLabelTrackerData: function() {
  42494. this._label.setTrackerData(this)
  42495. },
  42496. _checkLabelPosition: function(coord, bBox, visibleArea) {
  42497. coord = this._checkHorizontalLabelPosition(coord, bBox, visibleArea);
  42498. return this._checkVerticalLabelPosition(coord, bBox, visibleArea)
  42499. },
  42500. _getLabelConnector: function() {
  42501. var that = this;
  42502. var rad = that.radiusOuter;
  42503. var seriesStyle = that._options.styles.normal;
  42504. var strokeWidthBy2 = seriesStyle["stroke-width"] / 2;
  42505. var borderWidth = that.series.getOptions().containerBackgroundColor === seriesStyle.stroke ? _round(strokeWidthBy2) : _round(-strokeWidthBy2);
  42506. var angleFunctions = _getCosAndSin(_round(that.middleAngle));
  42507. return {
  42508. x: _round(that.centerX + (rad - borderWidth) * angleFunctions.cos),
  42509. y: _round(that.centerY - (rad - borderWidth) * angleFunctions.sin),
  42510. angle: that.middleAngle
  42511. }
  42512. },
  42513. _drawMarker: function(renderer, group, animationEnabled, firstDrawing) {
  42514. var that = this;
  42515. var radiusOuter = that.radiusOuter;
  42516. var radiusInner = that.radiusInner;
  42517. var fromAngle = that.fromAngle;
  42518. var toAngle = that.toAngle;
  42519. if (animationEnabled) {
  42520. radiusInner = radiusOuter = 0;
  42521. if (!firstDrawing) {
  42522. fromAngle = toAngle = that.shiftedAngle
  42523. }
  42524. }
  42525. that.graphic = renderer.arc(that.centerX, that.centerY, radiusInner, radiusOuter, toAngle, fromAngle).attr({
  42526. "stroke-linejoin": "round"
  42527. }).smartAttr(that._getStyle()).data({
  42528. "chart-data-point": that
  42529. }).sharp().append(group)
  42530. },
  42531. getTooltipParams: function() {
  42532. var that = this;
  42533. var angleFunctions = _getCosAndSin(that.middleAngle);
  42534. var radiusInner = that.radiusInner;
  42535. var radiusOuter = that.radiusOuter;
  42536. return {
  42537. x: that.centerX + (radiusInner + (radiusOuter - radiusInner) / 2) * angleFunctions.cos,
  42538. y: that.centerY - (radiusInner + (radiusOuter - radiusInner) / 2) * angleFunctions.sin,
  42539. offset: 0
  42540. }
  42541. },
  42542. _translate: function() {
  42543. var that = this;
  42544. var angle = that.shiftedAngle || 0;
  42545. var value = that.value;
  42546. var minValue = that.minValue;
  42547. var translator = that._getValTranslator();
  42548. that.fromAngle = translator.translate(minValue) + angle;
  42549. that.toAngle = translator.translate(value) + angle;
  42550. that.middleAngle = translator.translate((value - minValue) / 2 + minValue) + angle;
  42551. if (!that.isVisible()) {
  42552. that.middleAngle = that.toAngle = that.fromAngle = that.fromAngle || angle
  42553. }
  42554. },
  42555. getMarkerVisibility: function() {
  42556. return true
  42557. },
  42558. _updateMarker: function(animationEnabled, style, _, callback) {
  42559. var that = this;
  42560. if (!animationEnabled) {
  42561. style = _extend({
  42562. x: that.centerX,
  42563. y: that.centerY,
  42564. outerRadius: that.radiusOuter,
  42565. innerRadius: that.radiusInner,
  42566. startAngle: that.toAngle,
  42567. endAngle: that.fromAngle
  42568. }, style)
  42569. }
  42570. that.graphic.smartAttr(style).sharp();
  42571. callback && callback()
  42572. },
  42573. getLegendStyles: function() {
  42574. return this._styles.legendStyles
  42575. },
  42576. isInVisibleArea: function() {
  42577. return true
  42578. },
  42579. hide: function() {
  42580. var that = this;
  42581. if (that._visible) {
  42582. that._visible = false;
  42583. that.hideTooltip();
  42584. that._options.visibilityChanged()
  42585. }
  42586. },
  42587. show: function() {
  42588. var that = this;
  42589. if (!that._visible) {
  42590. that._visible = true;
  42591. that._options.visibilityChanged()
  42592. }
  42593. },
  42594. setInvisibility: function() {
  42595. this._label.draw(false)
  42596. },
  42597. isVisible: function() {
  42598. return this._visible
  42599. },
  42600. _getFormatObject: function(tooltip) {
  42601. var formatObject = symbolPoint._getFormatObject.call(this, tooltip);
  42602. var percent = this.percent;
  42603. formatObject.percent = percent;
  42604. formatObject.percentText = tooltip.formatValue(percent, "percent");
  42605. return formatObject
  42606. },
  42607. getColor: function() {
  42608. return this._styles.normal.fill
  42609. },
  42610. coordsIn: function(x, y) {
  42611. var that = this;
  42612. var lx = x - that.centerX;
  42613. var ly = y - that.centerY;
  42614. var r = _sqrt(lx * lx + ly * ly);
  42615. var fromAngle = that.fromAngle % 360;
  42616. var toAngle = that.toAngle % 360;
  42617. var angle;
  42618. if (r < that.radiusInner || r > that.radiusOuter || 0 === r) {
  42619. return false
  42620. }
  42621. angle = _acos(lx / r) * DEG * (ly > 0 ? -1 : 1);
  42622. if (angle < 0) {
  42623. angle += 360
  42624. }
  42625. if (fromAngle === toAngle && _abs(that.toAngle - that.fromAngle) > 1e-4) {
  42626. return true
  42627. } else {
  42628. return fromAngle >= toAngle ? angle <= fromAngle && angle >= toAngle : !(angle >= fromAngle && angle <= toAngle)
  42629. }
  42630. }
  42631. })
  42632. },
  42633. /*!**********************************************************************!*\
  42634. !*** ./artifacts/transpiled/viz/series/points/range_symbol_point.js ***!
  42635. \**********************************************************************/
  42636. /*! dynamic exports provided */
  42637. /*! all exports used */
  42638. function(module, exports, __webpack_require__) {
  42639. var each = __webpack_require__( /*! ../../../core/utils/iterator */ 3).each;
  42640. var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
  42641. var noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop;
  42642. var labelModule = __webpack_require__( /*! ./label */ 246);
  42643. var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
  42644. var _extend = extend;
  42645. var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
  42646. var _math = Math;
  42647. var _abs = _math.abs;
  42648. var _min = _math.min;
  42649. var _max = _math.max;
  42650. var _round = _math.round;
  42651. var DEFAULT_IMAGE_WIDTH = 20;
  42652. var DEFAULT_IMAGE_HEIGHT = 20;
  42653. module.exports = _extend({}, symbolPoint, {
  42654. deleteLabel: function() {
  42655. var that = this;
  42656. that._topLabel.dispose();
  42657. that._topLabel = null;
  42658. that._bottomLabel.dispose();
  42659. that._bottomLabel = null
  42660. },
  42661. hideMarker: function(type) {
  42662. var graphic = this.graphic;
  42663. var marker = graphic && graphic[type + "Marker"];
  42664. var label = this["_" + type + "Label"];
  42665. if (marker && "hidden" !== marker.attr("visibility")) {
  42666. marker.attr({
  42667. visibility: "hidden"
  42668. })
  42669. }
  42670. label.draw(false)
  42671. },
  42672. setInvisibility: function() {
  42673. this.hideMarker("top");
  42674. this.hideMarker("bottom")
  42675. },
  42676. clearVisibility: function() {
  42677. var that = this;
  42678. var graphic = that.graphic;
  42679. var topMarker = graphic && graphic.topMarker;
  42680. var bottomMarker = graphic && graphic.bottomMarker;
  42681. if (topMarker && topMarker.attr("visibility")) {
  42682. topMarker.attr({
  42683. visibility: null
  42684. })
  42685. }
  42686. if (bottomMarker && bottomMarker.attr("visibility")) {
  42687. bottomMarker.attr({
  42688. visibility: null
  42689. })
  42690. }
  42691. },
  42692. clearMarker: function() {
  42693. var that = this;
  42694. var graphic = that.graphic;
  42695. var topMarker = graphic && graphic.topMarker;
  42696. var bottomMarker = graphic && graphic.bottomMarker;
  42697. var emptySettings = that._emptySettings;
  42698. topMarker && topMarker.attr(emptySettings);
  42699. bottomMarker && bottomMarker.attr(emptySettings)
  42700. },
  42701. _getLabelPosition: function(markerType) {
  42702. var position;
  42703. var labelsInside = "inside" === this._options.label.position;
  42704. if (!this._options.rotated) {
  42705. position = "top" === markerType ^ labelsInside ? "top" : "bottom"
  42706. } else {
  42707. position = "top" === markerType ^ labelsInside ? "right" : "left"
  42708. }
  42709. return position
  42710. },
  42711. _getLabelMinFormatObject: function() {
  42712. var that = this;
  42713. return {
  42714. index: 0,
  42715. argument: that.initialArgument,
  42716. value: that.initialMinValue,
  42717. seriesName: that.series.name,
  42718. originalValue: that.originalMinValue,
  42719. originalArgument: that.originalArgument,
  42720. point: that
  42721. }
  42722. },
  42723. _updateLabelData: function() {
  42724. var maxFormatObject = this._getLabelFormatObject();
  42725. maxFormatObject.index = 1;
  42726. this._topLabel.setData(maxFormatObject);
  42727. this._bottomLabel.setData(this._getLabelMinFormatObject())
  42728. },
  42729. _updateLabelOptions: function() {
  42730. var that = this;
  42731. var options = this._options.label;
  42732. (!that._topLabel || !that._bottomLabel) && that._createLabel();
  42733. that._topLabel.setOptions(options);
  42734. that._bottomLabel.setOptions(options)
  42735. },
  42736. _createLabel: function() {
  42737. var options = {
  42738. renderer: this.series._renderer,
  42739. labelsGroup: this.series._labelsGroup,
  42740. point: this
  42741. };
  42742. this._topLabel = new labelModule.Label(options);
  42743. this._bottomLabel = new labelModule.Label(options)
  42744. },
  42745. _getGraphicBBox: function(location) {
  42746. var options = this._options;
  42747. var images = this._getImage(options.image);
  42748. var image = "top" === location ? this._checkImage(images.top) : this._checkImage(images.bottom);
  42749. var bBox;
  42750. var coord = this._getPositionFromLocation(location);
  42751. if (options.visible) {
  42752. bBox = image ? this._getImageBBox(coord.x, coord.y) : this._getSymbolBBox(coord.x, coord.y, options.styles.normal.r)
  42753. } else {
  42754. bBox = {
  42755. x: coord.x,
  42756. y: coord.y,
  42757. width: 0,
  42758. height: 0
  42759. }
  42760. }
  42761. return bBox
  42762. },
  42763. _getPositionFromLocation: function(location) {
  42764. var x;
  42765. var y;
  42766. var isTop = "top" === location;
  42767. if (!this._options.rotated) {
  42768. x = this.x;
  42769. y = isTop ? _min(this.y, this.minY) : _max(this.y, this.minY)
  42770. } else {
  42771. x = isTop ? _max(this.x, this.minX) : _min(this.x, this.minX);
  42772. y = this.y
  42773. }
  42774. return {
  42775. x: x,
  42776. y: y
  42777. }
  42778. },
  42779. _checkOverlay: function(bottomCoord, topCoord, topValue) {
  42780. return bottomCoord < topCoord + topValue
  42781. },
  42782. _getOverlayCorrections: function(topCoords, bottomCoords) {
  42783. var rotated = this._options.rotated;
  42784. var coordSelector = !rotated ? "y" : "x";
  42785. var valueSelector = !rotated ? "height" : "width";
  42786. var visibleArea = this.series.getValueAxis().getVisibleArea();
  42787. var minBound = visibleArea[0];
  42788. var maxBound = visibleArea[1];
  42789. var delta = _round((topCoords[coordSelector] + topCoords[valueSelector] - bottomCoords[coordSelector]) / 2);
  42790. var coord1 = topCoords[coordSelector] - delta;
  42791. var coord2 = bottomCoords[coordSelector] + delta;
  42792. if (coord1 < minBound) {
  42793. delta = minBound - topCoords[coordSelector];
  42794. coord1 += delta;
  42795. coord2 += delta
  42796. } else {
  42797. if (coord2 + bottomCoords[valueSelector] > maxBound) {
  42798. delta = -(bottomCoords[coordSelector] + bottomCoords[valueSelector] - maxBound);
  42799. coord1 += delta;
  42800. coord2 += delta
  42801. }
  42802. }
  42803. return {
  42804. coord1: coord1,
  42805. coord2: coord2
  42806. }
  42807. },
  42808. _checkLabelsOverlay: function(topLocation) {
  42809. var that = this;
  42810. var topCoords = that._topLabel.getBoundingRect();
  42811. var bottomCoords = that._bottomLabel.getBoundingRect();
  42812. var corrections = {};
  42813. if (!that._options.rotated) {
  42814. if ("top" === topLocation) {
  42815. if (this._checkOverlay(bottomCoords.y, topCoords.y, topCoords.height)) {
  42816. corrections = this._getOverlayCorrections(topCoords, bottomCoords);
  42817. that._topLabel.shift(topCoords.x, corrections.coord1);
  42818. that._bottomLabel.shift(bottomCoords.x, corrections.coord2)
  42819. }
  42820. } else {
  42821. if (this._checkOverlay(topCoords.y, bottomCoords.y, bottomCoords.height)) {
  42822. corrections = this._getOverlayCorrections(bottomCoords, topCoords);
  42823. that._topLabel.shift(topCoords.x, corrections.coord2);
  42824. that._bottomLabel.shift(bottomCoords.x, corrections.coord1)
  42825. }
  42826. }
  42827. } else {
  42828. if ("top" === topLocation) {
  42829. if (this._checkOverlay(topCoords.x, bottomCoords.x, bottomCoords.width)) {
  42830. corrections = this._getOverlayCorrections(bottomCoords, topCoords);
  42831. that._topLabel.shift(corrections.coord2, topCoords.y);
  42832. that._bottomLabel.shift(corrections.coord1, bottomCoords.y)
  42833. }
  42834. } else {
  42835. if (this._checkOverlay(bottomCoords.x, topCoords.x, topCoords.width)) {
  42836. corrections = this._getOverlayCorrections(topCoords, bottomCoords);
  42837. that._topLabel.shift(corrections.coord1, topCoords.y);
  42838. that._bottomLabel.shift(corrections.coord2, bottomCoords.y)
  42839. }
  42840. }
  42841. }
  42842. },
  42843. _drawLabel: function() {
  42844. var that = this;
  42845. var labels = [];
  42846. var notInverted = that._options.rotated ? that.x >= that.minX : that.y < that.minY;
  42847. var customVisibility = that._getCustomLabelVisibility();
  42848. var topLabel = that._topLabel;
  42849. var bottomLabel = that._bottomLabel;
  42850. topLabel.pointPosition = notInverted ? "top" : "bottom";
  42851. bottomLabel.pointPosition = notInverted ? "bottom" : "top";
  42852. if ((that.series.getLabelVisibility() || customVisibility) && that.hasValue() && false !== customVisibility) {
  42853. false !== that.visibleTopMarker && labels.push(topLabel);
  42854. false !== that.visibleBottomMarker && labels.push(bottomLabel);
  42855. each(labels, function(_, label) {
  42856. label.draw(true)
  42857. });
  42858. that._checkLabelsOverlay(that._topLabel.pointPosition)
  42859. } else {
  42860. topLabel.draw(false);
  42861. bottomLabel.draw(false)
  42862. }
  42863. },
  42864. _getImage: function(imageOption) {
  42865. var image = {};
  42866. if (_isDefined(imageOption)) {
  42867. if ("string" === typeof imageOption) {
  42868. image.top = image.bottom = imageOption
  42869. } else {
  42870. image.top = {
  42871. url: "string" === typeof imageOption.url ? imageOption.url : imageOption.url && imageOption.url.rangeMaxPoint,
  42872. width: "number" === typeof imageOption.width ? imageOption.width : imageOption.width && imageOption.width.rangeMaxPoint,
  42873. height: "number" === typeof imageOption.height ? imageOption.height : imageOption.height && imageOption.height.rangeMaxPoint
  42874. };
  42875. image.bottom = {
  42876. url: "string" === typeof imageOption.url ? imageOption.url : imageOption.url && imageOption.url.rangeMinPoint,
  42877. width: "number" === typeof imageOption.width ? imageOption.width : imageOption.width && imageOption.width.rangeMinPoint,
  42878. height: "number" === typeof imageOption.height ? imageOption.height : imageOption.height && imageOption.height.rangeMinPoint
  42879. }
  42880. }
  42881. }
  42882. return image
  42883. },
  42884. _checkSymbol: function(oldOptions, newOptions) {
  42885. var that = this;
  42886. var oldSymbol = oldOptions.symbol;
  42887. var newSymbol = newOptions.symbol;
  42888. var symbolChanged = "circle" === oldSymbol && "circle" !== newSymbol || "circle" !== oldSymbol && "circle" === newSymbol;
  42889. var oldImages = that._getImage(oldOptions.image);
  42890. var newImages = that._getImage(newOptions.image);
  42891. var topImageChanged = that._checkImage(oldImages.top) !== that._checkImage(newImages.top);
  42892. var bottomImageChanged = that._checkImage(oldImages.bottom) !== that._checkImage(newImages.bottom);
  42893. return symbolChanged || topImageChanged || bottomImageChanged
  42894. },
  42895. _getSettingsForTwoMarkers: function(style) {
  42896. var that = this;
  42897. var options = that._options;
  42898. var settings = {};
  42899. var x = options.rotated ? _min(that.x, that.minX) : that.x;
  42900. var y = options.rotated ? that.y : _min(that.y, that.minY);
  42901. var radius = style.r;
  42902. var points = that._populatePointShape(options.symbol, radius);
  42903. settings.top = _extend({
  42904. translateX: x + that.width,
  42905. translateY: y,
  42906. r: radius
  42907. }, style);
  42908. settings.bottom = _extend({
  42909. translateX: x,
  42910. translateY: y + that.height,
  42911. r: radius
  42912. }, style);
  42913. if (points) {
  42914. settings.top.points = settings.bottom.points = points
  42915. }
  42916. return settings
  42917. },
  42918. _hasGraphic: function() {
  42919. return this.graphic && this.graphic.topMarker && this.graphic.bottomMarker
  42920. },
  42921. _drawOneMarker: function(renderer, markerType, imageSettings, settings) {
  42922. var that = this;
  42923. var graphic = that.graphic;
  42924. if (graphic[markerType]) {
  42925. that._updateOneMarker(markerType, settings)
  42926. } else {
  42927. graphic[markerType] = that._createMarker(renderer, graphic, imageSettings, settings)
  42928. }
  42929. },
  42930. _drawMarker: function(renderer, group, animationEnabled, firstDrawing, style) {
  42931. var that = this;
  42932. var settings = that._getSettingsForTwoMarkers(style || that._getStyle());
  42933. var image = that._getImage(that._options.image);
  42934. if (that._checkImage(image.top)) {
  42935. settings.top = that._getImageSettings(settings.top, image.top)
  42936. }
  42937. if (that._checkImage(image.bottom)) {
  42938. settings.bottom = that._getImageSettings(settings.bottom, image.bottom)
  42939. }
  42940. that.graphic = that.graphic || renderer.g().append(group);
  42941. that.visibleTopMarker && that._drawOneMarker(renderer, "topMarker", image.top, settings.top);
  42942. that.visibleBottomMarker && that._drawOneMarker(renderer, "bottomMarker", image.bottom, settings.bottom)
  42943. },
  42944. _getSettingsForTracker: function(radius) {
  42945. var that = this;
  42946. var rotated = that._options.rotated;
  42947. return {
  42948. translateX: rotated ? _min(that.x, that.minX) - radius : that.x - radius,
  42949. translateY: rotated ? that.y - radius : _min(that.y, that.minY) - radius,
  42950. width: that.width + 2 * radius,
  42951. height: that.height + 2 * radius
  42952. }
  42953. },
  42954. isInVisibleArea: function() {
  42955. var that = this;
  42956. var rotated = that._options.rotated;
  42957. var argument = !rotated ? that.x : that.y;
  42958. var maxValue = !rotated ? _max(that.minY, that.y) : _max(that.minX, that.x);
  42959. var minValue = !rotated ? _min(that.minY, that.y) : _min(that.minX, that.x);
  42960. var tmp;
  42961. var visibleTopMarker = true;
  42962. var visibleBottomMarker = true;
  42963. var visibleRangeArea = true;
  42964. var visibleArgArea = that.series.getArgumentAxis().getVisibleArea();
  42965. var visibleValArea = that.series.getValueAxis().getVisibleArea();
  42966. var notVisibleByArg = visibleArgArea[1] < argument || visibleArgArea[0] > argument;
  42967. var notVisibleByVal = visibleValArea[0] > minValue && visibleValArea[0] > maxValue || visibleValArea[1] < minValue && visibleValArea[1] < maxValue;
  42968. if (notVisibleByArg || notVisibleByVal) {
  42969. visibleTopMarker = visibleBottomMarker = visibleRangeArea = false
  42970. } else {
  42971. visibleTopMarker = visibleValArea[0] <= minValue && visibleValArea[1] > minValue;
  42972. visibleBottomMarker = visibleValArea[0] < maxValue && visibleValArea[1] >= maxValue;
  42973. if (rotated) {
  42974. tmp = visibleTopMarker;
  42975. visibleTopMarker = visibleBottomMarker;
  42976. visibleBottomMarker = tmp
  42977. }
  42978. }
  42979. that.visibleTopMarker = visibleTopMarker;
  42980. that.visibleBottomMarker = visibleBottomMarker;
  42981. return visibleRangeArea
  42982. },
  42983. getTooltipParams: function() {
  42984. var that = this;
  42985. var x;
  42986. var y;
  42987. var rotated = that._options.rotated;
  42988. var minValue = !rotated ? _min(that.y, that.minY) : _min(that.x, that.minX);
  42989. var side = !rotated ? "height" : "width";
  42990. var visibleArea = that._getVisibleArea();
  42991. var minVisible = rotated ? visibleArea.minX : visibleArea.minY;
  42992. var maxVisible = rotated ? visibleArea.maxX : visibleArea.maxY;
  42993. var min = _max(minVisible, minValue);
  42994. var max = _min(maxVisible, minValue + that[side]);
  42995. if (!rotated) {
  42996. x = that.x;
  42997. y = min + (max - min) / 2
  42998. } else {
  42999. y = that.y;
  43000. x = min + (max - min) / 2
  43001. }
  43002. return {
  43003. x: x,
  43004. y: y,
  43005. offset: 0
  43006. }
  43007. },
  43008. _translate: function() {
  43009. var that = this;
  43010. var rotated = that._options.rotated;
  43011. symbolPoint._translate.call(that);
  43012. that.height = rotated ? 0 : _abs(that.minY - that.y);
  43013. that.width = rotated ? _abs(that.x - that.minX) : 0
  43014. },
  43015. hasCoords: function() {
  43016. return symbolPoint.hasCoords.call(this) && !(null === this.minX || null === this.minY)
  43017. },
  43018. _updateData: function(data) {
  43019. var that = this;
  43020. symbolPoint._updateData.call(that, data);
  43021. that.minValue = that.initialMinValue = that.originalMinValue = data.minValue
  43022. },
  43023. _getImageSettings: function(settings, image) {
  43024. return {
  43025. href: image.url || image.toString(),
  43026. width: image.width || DEFAULT_IMAGE_WIDTH,
  43027. height: image.height || DEFAULT_IMAGE_HEIGHT,
  43028. translateX: settings.translateX,
  43029. translateY: settings.translateY
  43030. }
  43031. },
  43032. getCrosshairData: function(x, y) {
  43033. var that = this;
  43034. var rotated = that._options.rotated;
  43035. var minX = that.minX;
  43036. var minY = that.minY;
  43037. var vx = that.vx;
  43038. var vy = that.vy;
  43039. var value = that.value;
  43040. var minValue = that.minValue;
  43041. var argument = that.argument;
  43042. var coords = {
  43043. axis: that.series.axis,
  43044. x: vx,
  43045. y: vy,
  43046. yValue: value,
  43047. xValue: argument
  43048. };
  43049. if (rotated) {
  43050. coords.yValue = argument;
  43051. if (_abs(vx - x) < _abs(minX - x)) {
  43052. coords.xValue = value
  43053. } else {
  43054. coords.x = minX;
  43055. coords.xValue = minValue
  43056. }
  43057. } else {
  43058. if (_abs(vy - y) >= _abs(minY - y)) {
  43059. coords.y = minY;
  43060. coords.yValue = minValue
  43061. }
  43062. }
  43063. return coords
  43064. },
  43065. _updateOneMarker: function(markerType, settings) {
  43066. this.graphic && this.graphic[markerType] && this.graphic[markerType].attr(settings)
  43067. },
  43068. _updateMarker: function(animationEnabled, style) {
  43069. this._drawMarker(void 0, void 0, false, false, style)
  43070. },
  43071. _getFormatObject: function(tooltip) {
  43072. var that = this;
  43073. var initialMinValue = that.initialMinValue;
  43074. var initialValue = that.initialValue;
  43075. var initialArgument = that.initialArgument;
  43076. var minValue = tooltip.formatValue(initialMinValue);
  43077. var value = tooltip.formatValue(initialValue);
  43078. return {
  43079. argument: initialArgument,
  43080. argumentText: tooltip.formatValue(initialArgument, "argument"),
  43081. valueText: minValue + " - " + value,
  43082. rangeValue1Text: minValue,
  43083. rangeValue2Text: value,
  43084. rangeValue1: initialMinValue,
  43085. rangeValue2: initialValue,
  43086. seriesName: that.series.name,
  43087. point: that,
  43088. originalMinValue: that.originalMinValue,
  43089. originalValue: that.originalValue,
  43090. originalArgument: that.originalArgument
  43091. }
  43092. },
  43093. getLabel: function() {
  43094. return [this._topLabel, this._bottomLabel]
  43095. },
  43096. getLabels: function() {
  43097. return [this._topLabel, this._bottomLabel]
  43098. },
  43099. getBoundingRect: noop,
  43100. coordsIn: function(x, y) {
  43101. var trackerRadius = this._storeTrackerR();
  43102. var xCond = x >= this.x - trackerRadius && x <= this.x + trackerRadius;
  43103. var yCond = y >= this.y - trackerRadius && y <= this.y + trackerRadius;
  43104. if (this._options.rotated) {
  43105. return yCond && (xCond || x >= this.minX - trackerRadius && x <= this.minX + trackerRadius)
  43106. } else {
  43107. return xCond && (yCond || y >= this.minY - trackerRadius && y <= this.minY + trackerRadius)
  43108. }
  43109. },
  43110. getMaxValue: function() {
  43111. if ("discrete" !== this.series.valueAxisType) {
  43112. return this.minValue > this.value ? this.minValue : this.value
  43113. }
  43114. return this.value
  43115. },
  43116. getMinValue: function() {
  43117. if ("discrete" !== this.series.valueAxisType) {
  43118. return this.minValue < this.value ? this.minValue : this.value
  43119. }
  43120. return this.minValue
  43121. }
  43122. })
  43123. },
  43124. /*!*********************************************************************!*\
  43125. !*** ./artifacts/transpiled/viz/series/points/candlestick_point.js ***!
  43126. \*********************************************************************/
  43127. /*! dynamic exports provided */
  43128. /*! all exports used */
  43129. function(module, exports, __webpack_require__) {
  43130. var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
  43131. var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
  43132. var barPoint = __webpack_require__( /*! ./bar_point */ 202);
  43133. var _math = Math;
  43134. var _abs = _math.abs;
  43135. var _min = _math.min;
  43136. var _max = _math.max;
  43137. var _round = _math.round;
  43138. var DEFAULT_FINANCIAL_TRACKER_MARGIN = 2;
  43139. module.exports = _extend({}, barPoint, {
  43140. _getContinuousPoints: function(openCoord, closeCoord) {
  43141. var that = this;
  43142. var x = that.x;
  43143. var createPoint = that._options.rotated ? function(x, y) {
  43144. return [y, x]
  43145. } : function(x, y) {
  43146. return [x, y]
  43147. };
  43148. var width = that.width;
  43149. var highCoord = that.highY;
  43150. var max = _abs(highCoord - openCoord) < _abs(highCoord - closeCoord) ? openCoord : closeCoord;
  43151. var min = max === closeCoord ? openCoord : closeCoord;
  43152. var points;
  43153. if (min === max) {
  43154. points = [].concat(createPoint(x, that.highY)).concat(createPoint(x, that.lowY)).concat(createPoint(x, that.closeY)).concat(createPoint(x - width / 2, that.closeY)).concat(createPoint(x + width / 2, that.closeY)).concat(createPoint(x, that.closeY))
  43155. } else {
  43156. points = [].concat(createPoint(x, that.highY)).concat(createPoint(x, max)).concat(createPoint(x + width / 2, max)).concat(createPoint(x + width / 2, min)).concat(createPoint(x, min)).concat(createPoint(x, that.lowY)).concat(createPoint(x, min)).concat(createPoint(x - width / 2, min)).concat(createPoint(x - width / 2, max)).concat(createPoint(x, max))
  43157. }
  43158. return points
  43159. },
  43160. _getCrockPoints: function(y) {
  43161. var that = this;
  43162. var x = that.x;
  43163. var createPoint = that._options.rotated ? function(x, y) {
  43164. return [y, x]
  43165. } : function(x, y) {
  43166. return [x, y]
  43167. };
  43168. return [].concat(createPoint(x, that.highY)).concat(createPoint(x, that.lowY)).concat(createPoint(x, y)).concat(createPoint(x - that.width / 2, y)).concat(createPoint(x + that.width / 2, y)).concat(createPoint(x, y))
  43169. },
  43170. _getPoints: function() {
  43171. var that = this;
  43172. var points;
  43173. var closeCoord = that.closeY;
  43174. var openCoord = that.openY;
  43175. if (null !== closeCoord && null !== openCoord) {
  43176. points = that._getContinuousPoints(openCoord, closeCoord)
  43177. } else {
  43178. if (openCoord === closeCoord) {
  43179. points = [that.x, that.highY, that.x, that.lowY]
  43180. } else {
  43181. points = that._getCrockPoints(null !== openCoord ? openCoord : closeCoord)
  43182. }
  43183. }
  43184. return points
  43185. },
  43186. getColor: function() {
  43187. var that = this;
  43188. return that._isReduction ? that._options.reduction.color : that._styles.normal.stroke || that.series.getColor()
  43189. },
  43190. _drawMarkerInGroup: function(group, attributes, renderer) {
  43191. var that = this;
  43192. that.graphic = renderer.path(that._getPoints(), "area").attr({
  43193. "stroke-linecap": "square"
  43194. }).attr(attributes).data({
  43195. "chart-data-point": that
  43196. }).sharp().append(group)
  43197. },
  43198. _fillStyle: function() {
  43199. var that = this;
  43200. var styles = that._options.styles;
  43201. if (that._isReduction && that._isPositive) {
  43202. that._styles = styles.reductionPositive
  43203. } else {
  43204. if (that._isReduction) {
  43205. that._styles = styles.reduction
  43206. } else {
  43207. if (that._isPositive) {
  43208. that._styles = styles.positive
  43209. } else {
  43210. that._styles = styles
  43211. }
  43212. }
  43213. }
  43214. },
  43215. _getMinTrackerWidth: function() {
  43216. return 2 + 2 * this._styles.normal["stroke-width"]
  43217. },
  43218. correctCoordinates: function(correctOptions) {
  43219. var minWidth = this._getMinTrackerWidth();
  43220. var maxWidth = 10;
  43221. var width = correctOptions.width;
  43222. width = width < minWidth ? minWidth : width > maxWidth ? maxWidth : width;
  43223. this.width = width + width % 2;
  43224. this.xCorrection = correctOptions.offset
  43225. },
  43226. _getMarkerGroup: function(group) {
  43227. var that = this;
  43228. var markerGroup;
  43229. if (that._isReduction && that._isPositive) {
  43230. markerGroup = group.reductionPositiveMarkersGroup
  43231. } else {
  43232. if (that._isReduction) {
  43233. markerGroup = group.reductionMarkersGroup
  43234. } else {
  43235. if (that._isPositive) {
  43236. markerGroup = group.defaultPositiveMarkersGroup
  43237. } else {
  43238. markerGroup = group.defaultMarkersGroup
  43239. }
  43240. }
  43241. }
  43242. return markerGroup
  43243. },
  43244. _drawMarker: function(renderer, group) {
  43245. this._drawMarkerInGroup(this._getMarkerGroup(group), this._getStyle(), renderer)
  43246. },
  43247. _getSettingsForTracker: function() {
  43248. var that = this;
  43249. var highY = that.highY;
  43250. var lowY = that.lowY;
  43251. var rotated = that._options.rotated;
  43252. var x;
  43253. var y;
  43254. var width;
  43255. var height;
  43256. if (highY === lowY) {
  43257. highY = rotated ? highY + DEFAULT_FINANCIAL_TRACKER_MARGIN : highY - DEFAULT_FINANCIAL_TRACKER_MARGIN;
  43258. lowY = rotated ? lowY - DEFAULT_FINANCIAL_TRACKER_MARGIN : lowY + DEFAULT_FINANCIAL_TRACKER_MARGIN
  43259. }
  43260. if (rotated) {
  43261. x = _min(lowY, highY);
  43262. y = that.x - that.width / 2;
  43263. width = _abs(lowY - highY);
  43264. height = that.width
  43265. } else {
  43266. x = that.x - that.width / 2;
  43267. y = _min(lowY, highY);
  43268. width = that.width;
  43269. height = _abs(lowY - highY)
  43270. }
  43271. return {
  43272. x: x,
  43273. y: y,
  43274. width: width,
  43275. height: height
  43276. }
  43277. },
  43278. _getGraphicBBox: function() {
  43279. var that = this;
  43280. var rotated = that._options.rotated;
  43281. var x = that.x;
  43282. var width = that.width;
  43283. var lowY = that.lowY;
  43284. var highY = that.highY;
  43285. return {
  43286. x: !rotated ? x - _round(width / 2) : lowY,
  43287. y: !rotated ? highY : x - _round(width / 2),
  43288. width: !rotated ? width : highY - lowY,
  43289. height: !rotated ? lowY - highY : width
  43290. }
  43291. },
  43292. getTooltipParams: function(location) {
  43293. var that = this;
  43294. if (that.graphic) {
  43295. var minValue = _min(that.lowY, that.highY);
  43296. var maxValue = _max(that.lowY, that.highY);
  43297. var visibleArea = that._getVisibleArea();
  43298. var rotated = that._options.rotated;
  43299. var minVisible = rotated ? visibleArea.minX : visibleArea.minY;
  43300. var maxVisible = rotated ? visibleArea.maxX : visibleArea.maxY;
  43301. var min = _max(minVisible, minValue);
  43302. var max = _min(maxVisible, maxValue);
  43303. var centerCoord = that.getCenterCoord();
  43304. if ("edge" === location) {
  43305. centerCoord[rotated ? "x" : "y"] = rotated ? max : min
  43306. }
  43307. centerCoord.offset = 0;
  43308. return centerCoord
  43309. }
  43310. },
  43311. getCenterCoord: function() {
  43312. if (this.graphic) {
  43313. var that = this;
  43314. var x;
  43315. var y;
  43316. var minValue = _min(that.lowY, that.highY);
  43317. var maxValue = _max(that.lowY, that.highY);
  43318. var visibleArea = that._getVisibleArea();
  43319. var rotated = that._options.rotated;
  43320. var minVisible = rotated ? visibleArea.minX : visibleArea.minY;
  43321. var maxVisible = rotated ? visibleArea.maxX : visibleArea.maxY;
  43322. var min = _max(minVisible, minValue);
  43323. var max = _min(maxVisible, maxValue);
  43324. var center = min + (max - min) / 2;
  43325. if (rotated) {
  43326. y = that.x;
  43327. x = center
  43328. } else {
  43329. x = that.x;
  43330. y = center
  43331. }
  43332. return {
  43333. x: x,
  43334. y: y
  43335. }
  43336. }
  43337. },
  43338. hasValue: function() {
  43339. return null !== this.highValue && null !== this.lowValue
  43340. },
  43341. hasCoords: function() {
  43342. return null !== this.x && null !== this.lowY && null !== this.highY
  43343. },
  43344. _translate: function() {
  43345. var that = this;
  43346. var rotated = that._options.rotated;
  43347. var valTranslator = that._getValTranslator();
  43348. var x = that._getArgTranslator().translate(that.argument);
  43349. that.vx = that.vy = that.x = null === x ? x : x + (that.xCorrection || 0);
  43350. that.openY = null !== that.openValue ? valTranslator.translate(that.openValue) : null;
  43351. that.highY = valTranslator.translate(that.highValue);
  43352. that.lowY = valTranslator.translate(that.lowValue);
  43353. that.closeY = null !== that.closeValue ? valTranslator.translate(that.closeValue) : null;
  43354. var centerValue = _min(that.lowY, that.highY) + _abs(that.lowY - that.highY) / 2;
  43355. that._calculateVisibility(!rotated ? that.x : centerValue, !rotated ? centerValue : that.x)
  43356. },
  43357. getCrosshairData: function(x, y) {
  43358. var that = this;
  43359. var rotated = that._options.rotated;
  43360. var origY = rotated ? x : y;
  43361. var yValue;
  43362. var argument = that.argument;
  43363. var coords;
  43364. var coord = "low";
  43365. if (_abs(that.lowY - origY) < _abs(that.closeY - origY)) {
  43366. yValue = that.lowY
  43367. } else {
  43368. yValue = that.closeY;
  43369. coord = "close"
  43370. }
  43371. if (_abs(yValue - origY) >= _abs(that.openY - origY)) {
  43372. yValue = that.openY;
  43373. coord = "open"
  43374. }
  43375. if (_abs(yValue - origY) >= _abs(that.highY - origY)) {
  43376. yValue = that.highY;
  43377. coord = "high"
  43378. }
  43379. if (rotated) {
  43380. coords = {
  43381. y: that.vy,
  43382. x: yValue,
  43383. xValue: that[coord + "Value"],
  43384. yValue: argument
  43385. }
  43386. } else {
  43387. coords = {
  43388. x: that.vx,
  43389. y: yValue,
  43390. xValue: argument,
  43391. yValue: that[coord + "Value"]
  43392. }
  43393. }
  43394. coords.axis = that.series.axis;
  43395. return coords
  43396. },
  43397. _updateData: function(data) {
  43398. var that = this;
  43399. var label = that._label;
  43400. var reductionColor = this._options.reduction.color;
  43401. that.value = that.initialValue = data.reductionValue;
  43402. that.originalValue = data.value;
  43403. that.lowValue = that.originalLowValue = data.lowValue;
  43404. that.highValue = that.originalHighValue = data.highValue;
  43405. that.openValue = that.originalOpenValue = data.openValue;
  43406. that.closeValue = that.originalCloseValue = data.closeValue;
  43407. that._isPositive = data.openValue < data.closeValue;
  43408. that._isReduction = data.isReduction;
  43409. if (that._isReduction) {
  43410. label.setColor(reductionColor)
  43411. }
  43412. },
  43413. _updateMarker: function(animationEnabled, style, group) {
  43414. var that = this;
  43415. var graphic = that.graphic;
  43416. graphic.attr({
  43417. points: that._getPoints()
  43418. }).smartAttr(style).sharp();
  43419. group && graphic.append(that._getMarkerGroup(group))
  43420. },
  43421. _getLabelFormatObject: function() {
  43422. var that = this;
  43423. return {
  43424. openValue: that.openValue,
  43425. highValue: that.highValue,
  43426. lowValue: that.lowValue,
  43427. closeValue: that.closeValue,
  43428. reductionValue: that.initialValue,
  43429. argument: that.initialArgument,
  43430. value: that.initialValue,
  43431. seriesName: that.series.name,
  43432. originalOpenValue: that.originalOpenValue,
  43433. originalCloseValue: that.originalCloseValue,
  43434. originalLowValue: that.originalLowValue,
  43435. originalHighValue: that.originalHighValue,
  43436. originalArgument: that.originalArgument,
  43437. point: that
  43438. }
  43439. },
  43440. _getFormatObject: function(tooltip) {
  43441. var that = this;
  43442. var highValue = tooltip.formatValue(that.highValue);
  43443. var openValue = tooltip.formatValue(that.openValue);
  43444. var closeValue = tooltip.formatValue(that.closeValue);
  43445. var lowValue = tooltip.formatValue(that.lowValue);
  43446. var symbolMethods = symbolPoint;
  43447. var formatObject = symbolMethods._getFormatObject.call(that, tooltip);
  43448. return _extend({}, formatObject, {
  43449. valueText: "h: " + highValue + ("" !== openValue ? " o: " + openValue : "") + ("" !== closeValue ? " c: " + closeValue : "") + " l: " + lowValue,
  43450. highValueText: highValue,
  43451. openValueText: openValue,
  43452. closeValueText: closeValue,
  43453. lowValueText: lowValue
  43454. })
  43455. },
  43456. getMaxValue: function() {
  43457. return this.highValue
  43458. },
  43459. getMinValue: function() {
  43460. return this.lowValue
  43461. }
  43462. })
  43463. },
  43464. /*!********************************************************************!*\
  43465. !*** ./artifacts/transpiled/viz/components/chart_theme_manager.js ***!
  43466. \********************************************************************/
  43467. /*! dynamic exports provided */
  43468. /*! all exports used */
  43469. function(module, exports, __webpack_require__) {
  43470. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  43471. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  43472. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  43473. var BaseThemeManager = __webpack_require__( /*! ../core/base_theme_manager */ 241).BaseThemeManager;
  43474. var _isString = typeUtils.isString;
  43475. var _isDefined = typeUtils.isDefined;
  43476. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  43477. var ThemeManager = BaseThemeManager.inherit(function() {
  43478. var ctor = function(params) {
  43479. var that = this;
  43480. that.callBase.apply(that, arguments);
  43481. var options = params.options || {};
  43482. that._userOptions = options;
  43483. that._mergeAxisTitleOptions = [];
  43484. that._multiPieColors = {};
  43485. that._callback = noop
  43486. };
  43487. var dispose = function() {
  43488. var that = this;
  43489. that.palette && that.palette.dispose();
  43490. that.palette = that._userOptions = that._mergedSettings = that._multiPieColors = null;
  43491. return that.callBase.apply(that, arguments)
  43492. };
  43493. var resetPalette = function() {
  43494. this.palette.reset();
  43495. this._multiPieColors = {}
  43496. };
  43497. var processTitleOptions = function(options) {
  43498. return _isString(options) ? {
  43499. text: options
  43500. } : options
  43501. };
  43502. var processAxisOptions = function(axisOptions) {
  43503. if (!axisOptions) {
  43504. return {}
  43505. }
  43506. axisOptions = extend(true, {}, axisOptions);
  43507. axisOptions.title = processTitleOptions(axisOptions.title);
  43508. if ("logarithmic" === axisOptions.type && axisOptions.logarithmBase <= 0 || axisOptions.logarithmBase && !typeUtils.isNumeric(axisOptions.logarithmBase)) {
  43509. axisOptions.logarithmBase = void 0;
  43510. axisOptions.logarithmBaseError = true
  43511. }
  43512. if (axisOptions.label) {
  43513. if (axisOptions.label.alignment) {
  43514. axisOptions.label.userAlignment = true
  43515. }
  43516. }
  43517. return axisOptions
  43518. };
  43519. var applyParticularAxisOptions = function(name, userOptions, rotated) {
  43520. var theme = this._theme;
  43521. var position = !(rotated ^ "valueAxis" === name) ? "horizontalAxis" : "verticalAxis";
  43522. var processedUserOptions = processAxisOptions(userOptions, name);
  43523. var commonAxisSettings = processAxisOptions(this._userOptions.commonAxisSettings, name);
  43524. var mergeOptions = extend(true, {}, theme.commonAxisSettings, theme[position], theme[name], commonAxisSettings, processedUserOptions);
  43525. mergeOptions.workWeek = processedUserOptions.workWeek || theme[name].workWeek;
  43526. mergeOptions.forceUserTickInterval |= _isDefined(processedUserOptions.tickInterval) && !_isDefined(processedUserOptions.axisDivisionFactor);
  43527. return mergeOptions
  43528. };
  43529. var mergeOptions = function(name, userOptions) {
  43530. userOptions = userOptions || this._userOptions[name];
  43531. var theme = this._theme[name];
  43532. var result = this._mergedSettings[name];
  43533. if (result) {
  43534. return result
  43535. }
  43536. if (typeUtils.isPlainObject(theme) && typeUtils.isPlainObject(userOptions)) {
  43537. result = extend(true, {}, theme, userOptions)
  43538. } else {
  43539. result = _isDefined(userOptions) ? userOptions : theme
  43540. }
  43541. this._mergedSettings[name] = result;
  43542. return result
  43543. };
  43544. var applyParticularTheme = {
  43545. base: mergeOptions,
  43546. argumentAxis: applyParticularAxisOptions,
  43547. valueAxisRangeSelector: function() {
  43548. return mergeOptions.call(this, "valueAxis")
  43549. },
  43550. valueAxis: applyParticularAxisOptions,
  43551. series: function(name, userOptions, seriesCount) {
  43552. var that = this;
  43553. var theme = that._theme;
  43554. var userCommonSettings = that._userOptions.commonSeriesSettings || {};
  43555. var themeCommonSettings = theme.commonSeriesSettings;
  43556. var widgetType = that._themeSection.split(".").slice(-1)[0];
  43557. var type = _normalizeEnum(userOptions.type || userCommonSettings.type || themeCommonSettings.type || "pie" === widgetType && theme.type);
  43558. var palette = that.palette;
  43559. var isBar = ~type.indexOf("bar");
  43560. var isLine = ~type.indexOf("line");
  43561. var isArea = ~type.indexOf("area");
  43562. var isBubble = "bubble" === type;
  43563. var mainSeriesColor;
  43564. var resolveLabelsOverlapping = that.getOptions("resolveLabelsOverlapping");
  43565. var containerBackgroundColor = that.getOptions("containerBackgroundColor");
  43566. var seriesTemplate = applyParticularTheme.seriesTemplate.call(this);
  43567. if (isBar || isBubble) {
  43568. userOptions = extend(true, {}, userCommonSettings, userCommonSettings[type], userOptions);
  43569. var seriesVisibility = userOptions.visible;
  43570. userCommonSettings = {
  43571. type: {}
  43572. };
  43573. extend(true, userOptions, userOptions.point);
  43574. userOptions.visible = seriesVisibility
  43575. }
  43576. var settings = extend(true, {
  43577. aggregation: {}
  43578. }, themeCommonSettings, themeCommonSettings[type], userCommonSettings, userCommonSettings[type], userOptions);
  43579. settings.aggregation.enabled = "chart" === widgetType && normalizeAggregationEnabled(settings.aggregation, that.getOptions("useAggregation"));
  43580. settings.type = type;
  43581. settings.widgetType = widgetType;
  43582. settings.containerBackgroundColor = containerBackgroundColor;
  43583. if ("pie" !== widgetType) {
  43584. mainSeriesColor = settings.color || palette.getNextColor(seriesCount)
  43585. } else {
  43586. mainSeriesColor = function(argument, index, count) {
  43587. var cat = "".concat(argument, "-").concat(index);
  43588. if (!that._multiPieColors[cat]) {
  43589. that._multiPieColors[cat] = palette.getNextColor(count)
  43590. }
  43591. return that._multiPieColors[cat]
  43592. }
  43593. }
  43594. settings.mainSeriesColor = mainSeriesColor;
  43595. settings.resolveLabelsOverlapping = resolveLabelsOverlapping;
  43596. if (settings.label && (isLine || isArea && "rangearea" !== type || "scatter" === type)) {
  43597. settings.label.position = "outside"
  43598. }
  43599. if (seriesTemplate) {
  43600. settings.nameField = seriesTemplate.nameField
  43601. }
  43602. return settings
  43603. },
  43604. animation: function(name) {
  43605. var userOptions = this._userOptions[name];
  43606. userOptions = typeUtils.isPlainObject(userOptions) ? userOptions : _isDefined(userOptions) ? {
  43607. enabled: !!userOptions
  43608. } : {};
  43609. return mergeOptions.call(this, name, userOptions)
  43610. },
  43611. seriesTemplate: function() {
  43612. var value = mergeOptions.call(this, "seriesTemplate");
  43613. if (value) {
  43614. value.nameField = value.nameField || "series"
  43615. }
  43616. return value
  43617. },
  43618. zoomAndPan: function() {
  43619. function parseOption(option) {
  43620. option = _normalizeEnum(option);
  43621. var pan = "pan" === option || "both" === option;
  43622. var zoom = "zoom" === option || "both" === option;
  43623. return {
  43624. pan: pan,
  43625. zoom: zoom,
  43626. none: !pan && !zoom
  43627. }
  43628. }
  43629. var userOptions = this._userOptions.zoomAndPan;
  43630. if (!_isDefined(userOptions)) {
  43631. var zoomingMode = _normalizeEnum(this.getOptions("zoomingMode"));
  43632. var scrollingMode = _normalizeEnum(this.getOptions("scrollingMode"));
  43633. var allowZoom = ["all", "mouse", "touch"].indexOf(zoomingMode) !== -1;
  43634. var allowScroll = ["all", "mouse", "touch"].indexOf(scrollingMode) !== -1;
  43635. userOptions = {
  43636. argumentAxis: allowZoom && allowScroll ? "both" : allowZoom ? "zoom" : allowScroll ? "pan" : "none",
  43637. allowMouseWheel: "all" === zoomingMode || "mouse" === zoomingMode,
  43638. allowTouchGestures: "all" === zoomingMode || "touch" === zoomingMode || "all" === scrollingMode || "touch" === scrollingMode
  43639. }
  43640. }
  43641. var options = mergeOptions.call(this, "zoomAndPan", userOptions);
  43642. return {
  43643. valueAxis: parseOption(options.valueAxis),
  43644. argumentAxis: parseOption(options.argumentAxis),
  43645. dragToZoom: !!options.dragToZoom,
  43646. dragBoxStyle: {
  43647. "class": "dxc-shutter",
  43648. fill: options.dragBoxStyle.color,
  43649. opacity: options.dragBoxStyle.opacity
  43650. },
  43651. panKey: options.panKey,
  43652. allowMouseWheel: !!options.allowMouseWheel,
  43653. allowTouchGestures: !!options.allowTouchGestures
  43654. }
  43655. }
  43656. };
  43657. var normalizeAggregationEnabled = function(aggregation, useAggregation) {
  43658. return !!(!_isDefined(aggregation.enabled) ? useAggregation : aggregation.enabled)
  43659. };
  43660. return {
  43661. _themeSection: "chart",
  43662. ctor: ctor,
  43663. dispose: dispose,
  43664. resetPalette: resetPalette,
  43665. getOptions: function(name) {
  43666. return (applyParticularTheme[name] || applyParticularTheme.base).apply(this, arguments)
  43667. },
  43668. refresh: function() {
  43669. this._mergedSettings = {};
  43670. return this.callBase.apply(this, arguments)
  43671. },
  43672. _initializeTheme: function() {
  43673. var that = this;
  43674. that.callBase.apply(that, arguments);
  43675. that.updatePalette()
  43676. },
  43677. resetOptions: function(name) {
  43678. this._mergedSettings[name] = null
  43679. },
  43680. update: function(options) {
  43681. this._userOptions = options
  43682. },
  43683. updatePalette: function() {
  43684. var that = this;
  43685. that.palette = that.createPalette(that.getOptions("palette"), {
  43686. useHighlight: true,
  43687. extensionMode: that.getOptions("paletteExtensionMode")
  43688. })
  43689. }
  43690. }
  43691. }());
  43692. exports.ThemeManager = ThemeManager
  43693. },
  43694. /*!*********************************************************************!*\
  43695. !*** ./artifacts/transpiled/viz/chart_components/layout_manager.js ***!
  43696. \*********************************************************************/
  43697. /*! dynamic exports provided */
  43698. /*! all exports used */
  43699. function(module, exports, __webpack_require__) {
  43700. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  43701. var layoutElementModule = __webpack_require__( /*! ../core/layout_element */ 242);
  43702. var _isNumber = __webpack_require__( /*! ../../core/utils/type */ 1).isNumeric;
  43703. var _min = Math.min;
  43704. var _max = Math.max;
  43705. var _floor = Math.floor;
  43706. var _sqrt = Math.sqrt;
  43707. var consts = __webpack_require__( /*! ../components/consts */ 117);
  43708. var RADIAL_LABEL_INDENT = consts.radialLabelIndent;
  43709. function getNearestCoord(firstCoord, secondCoord, pointCenterCoord) {
  43710. var nearestCoord;
  43711. if (pointCenterCoord < firstCoord) {
  43712. nearestCoord = firstCoord
  43713. } else {
  43714. if (secondCoord < pointCenterCoord) {
  43715. nearestCoord = secondCoord
  43716. } else {
  43717. nearestCoord = pointCenterCoord
  43718. }
  43719. }
  43720. return nearestCoord
  43721. }
  43722. function getLabelLayout(point) {
  43723. if (point._label.isVisible() && "inside" !== point._label.getLayoutOptions().position) {
  43724. return point._label.getBoundingRect()
  43725. }
  43726. }
  43727. function getPieRadius(series, paneCenterX, paneCenterY, accessibleRadius, minR) {
  43728. series.some(function(singleSeries) {
  43729. return singleSeries.getVisiblePoints().reduce(function(radiusIsFound, point) {
  43730. var labelBBox = getLabelLayout(point);
  43731. if (labelBBox) {
  43732. var xCoords = getNearestCoord(labelBBox.x, labelBBox.x + labelBBox.width, paneCenterX);
  43733. var yCoords = getNearestCoord(labelBBox.y, labelBBox.y + labelBBox.height, paneCenterY);
  43734. accessibleRadius = _min(_max(getLengthFromCenter(xCoords, yCoords, paneCenterX, paneCenterY) - RADIAL_LABEL_INDENT, minR), accessibleRadius);
  43735. radiusIsFound = true
  43736. }
  43737. return radiusIsFound
  43738. }, false)
  43739. });
  43740. return accessibleRadius
  43741. }
  43742. function getSizeLabels(series) {
  43743. return series.reduce(function(res, singleSeries) {
  43744. var maxWidth = singleSeries.getVisiblePoints().reduce(function(width, point) {
  43745. var labelBBox = getLabelLayout(point);
  43746. if (labelBBox && labelBBox.width > width) {
  43747. width = labelBBox.width
  43748. }
  43749. return width
  43750. }, 0);
  43751. var rWidth = maxWidth;
  43752. if (maxWidth) {
  43753. res.outerLabelsCount++;
  43754. if (res.outerLabelsCount > 1) {
  43755. maxWidth += consts.pieLabelSpacing
  43756. }
  43757. rWidth += consts.pieLabelSpacing
  43758. }
  43759. res.sizes.push(maxWidth);
  43760. res.rSizes.push(rWidth);
  43761. res.common += maxWidth;
  43762. return res
  43763. }, {
  43764. sizes: [],
  43765. rSizes: [],
  43766. common: 0,
  43767. outerLabelsCount: 0
  43768. })
  43769. }
  43770. function correctLabelRadius(labelSizes, radius, series, canvas, averageWidthLabels, centerX) {
  43771. var curRadius;
  43772. var i;
  43773. var runningWidth = 0;
  43774. var sizes = labelSizes.sizes;
  43775. var rSizes = labelSizes.rSizes;
  43776. for (i = 0; i < series.length; i++) {
  43777. if (0 === sizes[i]) {
  43778. curRadius && (curRadius += rSizes[i - 1]);
  43779. continue
  43780. }
  43781. curRadius = _floor(curRadius ? curRadius + rSizes[i - 1] : radius);
  43782. series[i].correctLabelRadius(curRadius);
  43783. runningWidth += averageWidthLabels || sizes[i];
  43784. rSizes[i] = averageWidthLabels || rSizes[i];
  43785. series[i].setVisibleArea({
  43786. left: _floor(centerX - radius - runningWidth),
  43787. right: _floor(canvas.width - (centerX + radius + runningWidth)),
  43788. top: canvas.top,
  43789. bottom: canvas.bottom,
  43790. width: canvas.width,
  43791. height: canvas.height
  43792. })
  43793. }
  43794. }
  43795. function getLengthFromCenter(x, y, paneCenterX, paneCenterY) {
  43796. return _sqrt((x - paneCenterX) * (x - paneCenterX) + (y - paneCenterY) * (y - paneCenterY))
  43797. }
  43798. function getInnerRadius(series) {
  43799. var innerRadius;
  43800. if ("pie" === series.type) {
  43801. innerRadius = 0
  43802. } else {
  43803. innerRadius = _isNumber(series.innerRadius) ? Number(series.innerRadius) : .5;
  43804. innerRadius = innerRadius < .2 ? .2 : innerRadius;
  43805. innerRadius = innerRadius > .8 ? .8 : innerRadius
  43806. }
  43807. return innerRadius
  43808. }
  43809. var inverseAlign = {
  43810. left: "right",
  43811. right: "left",
  43812. top: "bottom",
  43813. bottom: "top",
  43814. center: "center"
  43815. };
  43816. function downSize(canvas, layoutOptions) {
  43817. canvas[layoutOptions.cutLayoutSide] += "horizontal" === layoutOptions.cutSide ? layoutOptions.width : layoutOptions.height
  43818. }
  43819. function getOffset(layoutOptions, offsets) {
  43820. var side = layoutOptions.cutLayoutSide;
  43821. var offset = {
  43822. horizontal: 0,
  43823. vertical: 0
  43824. };
  43825. switch (side) {
  43826. case "top":
  43827. case "left":
  43828. offset[layoutOptions.cutSide] = -offsets[side];
  43829. break;
  43830. case "bottom":
  43831. case "right":
  43832. offset[layoutOptions.cutSide] = offsets[side]
  43833. }
  43834. return offset
  43835. }
  43836. function LayoutManager() {}
  43837. function toLayoutElementCoords(canvas) {
  43838. return new layoutElementModule.WrapperLayoutElement(null, {
  43839. x: canvas.left,
  43840. y: canvas.top,
  43841. width: canvas.width - canvas.left - canvas.right,
  43842. height: canvas.height - canvas.top - canvas.bottom
  43843. })
  43844. }
  43845. function getAverageLabelWidth(centerX, radius, canvas, sizeLabels) {
  43846. return (centerX - radius - RADIAL_LABEL_INDENT - canvas.left) / sizeLabels.outerLabelsCount
  43847. }
  43848. function getFullRadiusWithLabels(centerX, canvas, sizeLabels) {
  43849. return centerX - canvas.left - (sizeLabels.outerLabelsCount > 0 ? sizeLabels.common + RADIAL_LABEL_INDENT : 0)
  43850. }
  43851. function correctAvailableRadius(availableRadius, canvas, series, minR, paneCenterX, paneCenterY) {
  43852. var sizeLabels = getSizeLabels(series);
  43853. var averageWidthLabels;
  43854. var fullRadiusWithLabels = getFullRadiusWithLabels(paneCenterX, canvas, sizeLabels);
  43855. if (fullRadiusWithLabels < minR) {
  43856. availableRadius = minR;
  43857. averageWidthLabels = getAverageLabelWidth(paneCenterX, availableRadius, canvas, sizeLabels)
  43858. } else {
  43859. availableRadius = _min(getPieRadius(series, paneCenterX, paneCenterY, availableRadius, minR), fullRadiusWithLabels)
  43860. }
  43861. correctLabelRadius(sizeLabels, availableRadius + RADIAL_LABEL_INDENT, series, canvas, averageWidthLabels, paneCenterX);
  43862. return availableRadius
  43863. }
  43864. LayoutManager.prototype = {
  43865. constructor: LayoutManager,
  43866. setOptions: function(options) {
  43867. this._options = options
  43868. },
  43869. applyPieChartSeriesLayout: function(canvas, series, hideLayoutLabels) {
  43870. var paneSpaceHeight = canvas.height - canvas.top - canvas.bottom;
  43871. var paneSpaceWidth = canvas.width - canvas.left - canvas.right;
  43872. var paneCenterX = paneSpaceWidth / 2 + canvas.left;
  43873. var paneCenterY = paneSpaceHeight / 2 + canvas.top;
  43874. var piePercentage = this._options.piePercentage;
  43875. var availableRadius;
  43876. var minR;
  43877. if (_isNumber(piePercentage)) {
  43878. availableRadius = minR = piePercentage * _min(canvas.height, canvas.width) / 2
  43879. } else {
  43880. availableRadius = _min(paneSpaceWidth, paneSpaceHeight) / 2;
  43881. minR = this._options.minPiePercentage * availableRadius
  43882. }
  43883. if (!hideLayoutLabels) {
  43884. availableRadius = correctAvailableRadius(availableRadius, canvas, series, minR, paneCenterX, paneCenterY)
  43885. }
  43886. return {
  43887. centerX: _floor(paneCenterX),
  43888. centerY: _floor(paneCenterY),
  43889. radiusInner: _floor(availableRadius * getInnerRadius(series[0])),
  43890. radiusOuter: _floor(availableRadius)
  43891. }
  43892. },
  43893. applyEqualPieChartLayout: function(series, layout) {
  43894. var radius = layout.radius;
  43895. return {
  43896. centerX: _floor(layout.x),
  43897. centerY: _floor(layout.y),
  43898. radiusInner: _floor(radius * getInnerRadius(series[0])),
  43899. radiusOuter: _floor(radius)
  43900. }
  43901. },
  43902. correctPieLabelRadius: function(series, layout, canvas) {
  43903. var sizeLabels = getSizeLabels(series);
  43904. var averageWidthLabels;
  43905. var radius = layout.radiusOuter + RADIAL_LABEL_INDENT;
  43906. var availableLabelWidth = layout.centerX - canvas.left - radius;
  43907. if (sizeLabels.common + RADIAL_LABEL_INDENT > availableLabelWidth) {
  43908. averageWidthLabels = getAverageLabelWidth(layout.centerX, layout.radiusOuter, canvas, sizeLabels)
  43909. }
  43910. correctLabelRadius(sizeLabels, radius, series, canvas, averageWidthLabels, layout.centerX)
  43911. },
  43912. needMoreSpaceForPanesCanvas: function(panes, rotated) {
  43913. var options = this._options;
  43914. var width = options.width;
  43915. var height = options.height;
  43916. var piePercentage = options.piePercentage;
  43917. var percentageIsValid = _isNumber(piePercentage);
  43918. var needHorizontalSpace = 0;
  43919. var needVerticalSpace = 0;
  43920. panes.forEach(function(pane) {
  43921. var paneCanvas = pane.canvas;
  43922. var minSize = percentageIsValid ? _min(paneCanvas.width, paneCanvas.height) * piePercentage : void 0;
  43923. var needPaneHorizontalSpace = (percentageIsValid ? minSize : width) - (paneCanvas.width - paneCanvas.left - paneCanvas.right);
  43924. var needPaneVerticalSpace = (percentageIsValid ? minSize : height) - (paneCanvas.height - paneCanvas.top - paneCanvas.bottom);
  43925. if (rotated) {
  43926. needHorizontalSpace += needPaneHorizontalSpace > 0 ? needPaneHorizontalSpace : 0;
  43927. needVerticalSpace = _max(needPaneVerticalSpace > 0 ? needPaneVerticalSpace : 0, needVerticalSpace)
  43928. } else {
  43929. needHorizontalSpace = _max(needPaneHorizontalSpace > 0 ? needPaneHorizontalSpace : 0, needHorizontalSpace);
  43930. needVerticalSpace += needPaneVerticalSpace > 0 ? needPaneVerticalSpace : 0
  43931. }
  43932. });
  43933. return needHorizontalSpace > 0 || needVerticalSpace > 0 ? {
  43934. width: needHorizontalSpace,
  43935. height: needVerticalSpace
  43936. } : false
  43937. },
  43938. layoutElements: function(elements, canvas, funcAxisDrawer, panes, rotated) {
  43939. this._elements = elements;
  43940. this._probeDrawing(canvas);
  43941. this._drawElements(canvas);
  43942. funcAxisDrawer();
  43943. this._processAdaptiveLayout(panes, rotated, canvas, funcAxisDrawer);
  43944. this._positionElements(canvas)
  43945. },
  43946. _processAdaptiveLayout: function(panes, rotated, canvas, funcAxisDrawer) {
  43947. var that = this;
  43948. var size = that.needMoreSpaceForPanesCanvas(panes, rotated);
  43949. var items = this._elements;
  43950. if (!size) {
  43951. return
  43952. }
  43953. function processCanvases(item, layoutOptions, side) {
  43954. if (!item.getLayoutOptions()[side]) {
  43955. canvas[layoutOptions.cutLayoutSide] -= layoutOptions[side];
  43956. size[side] = size[side] - layoutOptions[side]
  43957. }
  43958. }
  43959. items.slice().reverse().forEach(function(item) {
  43960. var layoutOptions = item.getLayoutOptions();
  43961. var needRedraw = false;
  43962. if (!layoutOptions) {
  43963. return
  43964. }
  43965. var sizeObject = extend({}, layoutOptions);
  43966. needRedraw = "vertical" === layoutOptions.cutSide && size.width < 0 || "horizontal" === layoutOptions.cutSide && size.height < 0 || "vertical" === layoutOptions.cutSide && size.height > 0 || "horizontal" === layoutOptions.cutSide && size.width > 0;
  43967. var cutSide = "horizontal" === layoutOptions.cutSide ? "width" : "height";
  43968. if (needRedraw) {
  43969. var width = sizeObject.width - size.width;
  43970. var height = sizeObject.height - size.height;
  43971. if ("height" === cutSide && size.width < 0) {
  43972. width = canvas.width - canvas.left - canvas.right
  43973. }
  43974. if ("width" === cutSide && size.height < 0) {
  43975. height = canvas.height - canvas.top - canvas.bottom
  43976. }
  43977. item.draw(width, height)
  43978. }
  43979. processCanvases(item, layoutOptions, cutSide)
  43980. });
  43981. funcAxisDrawer(size)
  43982. },
  43983. _probeDrawing: function(canvas) {
  43984. var that = this;
  43985. this._elements.forEach(function(item) {
  43986. var layoutOptions = item.getLayoutOptions();
  43987. if (!layoutOptions) {
  43988. return
  43989. }
  43990. var sizeObject = {
  43991. width: canvas.width - canvas.left - canvas.right,
  43992. height: canvas.height - canvas.top - canvas.bottom
  43993. };
  43994. if ("vertical" === layoutOptions.cutSide) {
  43995. sizeObject.height -= that._options.height
  43996. } else {
  43997. sizeObject.width -= that._options.width
  43998. }
  43999. item.probeDraw(sizeObject.width, sizeObject.height);
  44000. downSize(canvas, item.getLayoutOptions())
  44001. })
  44002. },
  44003. _drawElements: function(canvas) {
  44004. this._elements.slice().reverse().forEach(function(item) {
  44005. var layoutOptions = item.getLayoutOptions();
  44006. if (!layoutOptions) {
  44007. return
  44008. }
  44009. var sizeObject = {
  44010. width: canvas.width - canvas.left - canvas.right,
  44011. height: canvas.height - canvas.top - canvas.bottom
  44012. };
  44013. var cutSide = layoutOptions.cutSide;
  44014. var length = "horizontal" === cutSide ? "width" : "height";
  44015. sizeObject[length] = layoutOptions[length];
  44016. item.draw(sizeObject.width, sizeObject.height)
  44017. })
  44018. },
  44019. _positionElements: function(canvas) {
  44020. var offsets = {
  44021. left: 0,
  44022. right: 0,
  44023. top: 0,
  44024. bottom: 0
  44025. };
  44026. this._elements.slice().reverse().forEach(function(item) {
  44027. var layoutOptions = item.getLayoutOptions();
  44028. if (!layoutOptions) {
  44029. return
  44030. }
  44031. var position = layoutOptions.position;
  44032. var cutSide = layoutOptions.cutSide;
  44033. var my = {
  44034. horizontal: position.horizontal,
  44035. vertical: position.vertical
  44036. };
  44037. my[cutSide] = inverseAlign[my[cutSide]];
  44038. item.position({
  44039. of: toLayoutElementCoords(canvas),
  44040. my: my,
  44041. at: position,
  44042. offset: getOffset(layoutOptions, offsets)
  44043. });
  44044. offsets[layoutOptions.cutLayoutSide] += layoutOptions["horizontal" === layoutOptions.cutSide ? "width" : "height"]
  44045. })
  44046. }
  44047. };
  44048. exports.LayoutManager = LayoutManager
  44049. },
  44050. /*!*************************************************!*\
  44051. !*** ./artifacts/transpiled/viz/core/plaque.js ***!
  44052. \*************************************************/
  44053. /*! dynamic exports provided */
  44054. /*! all exports used */
  44055. function(module, exports, __webpack_require__) {
  44056. Object.defineProperty(exports, "__esModule", {
  44057. value: true
  44058. });
  44059. exports.Plaque = void 0;
  44060. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  44061. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  44062. function _classCallCheck(instance, Constructor) {
  44063. if (!(instance instanceof Constructor)) {
  44064. throw new TypeError("Cannot call a class as a function")
  44065. }
  44066. }
  44067. function _defineProperties(target, props) {
  44068. for (var i = 0; i < props.length; i++) {
  44069. var descriptor = props[i];
  44070. descriptor.enumerable = descriptor.enumerable || false;
  44071. descriptor.configurable = true;
  44072. if ("value" in descriptor) {
  44073. descriptor.writable = true
  44074. }
  44075. Object.defineProperty(target, descriptor.key, descriptor)
  44076. }
  44077. }
  44078. function _createClass(Constructor, protoProps, staticProps) {
  44079. if (protoProps) {
  44080. _defineProperties(Constructor.prototype, protoProps)
  44081. }
  44082. if (staticProps) {
  44083. _defineProperties(Constructor, staticProps)
  44084. }
  44085. Object.defineProperty(Constructor, "prototype", {
  44086. writable: false
  44087. });
  44088. return Constructor
  44089. }
  44090. var math = Math;
  44091. var round = math.round;
  44092. var max = math.max;
  44093. var min = math.min;
  44094. var sin = math.sin;
  44095. var cos = math.cos;
  44096. var asin = math.asin;
  44097. var PI = math.PI;
  44098. var buildPath = function() {
  44099. for (var _len = arguments.length, points = new Array(_len), _key = 0; _key < _len; _key++) {
  44100. points[_key] = arguments[_key]
  44101. }
  44102. return points.join("")
  44103. };
  44104. function getArc(cornerRadius, xDirection, yDirection) {
  44105. return "a ".concat(cornerRadius, " ").concat(cornerRadius, " 0 0 1 ").concat(xDirection * cornerRadius, " ").concat(yDirection * cornerRadius)
  44106. }
  44107. function getAbsoluteArc(cornerRadius, x, y) {
  44108. return "A ".concat(cornerRadius, " ").concat(cornerRadius, " 0 0 1 ").concat(x, " ").concat(y)
  44109. }
  44110. function rotateX(x, y, angle, x0, y0) {
  44111. return (x - x0) * round(cos(angle)) + (y - y0) * round(sin(angle)) + x0
  44112. }
  44113. function rotateY(x, y, angle, x0, y0) {
  44114. return -(x - x0) * round(sin(angle)) + (y - y0) * round(cos(angle)) + y0
  44115. }
  44116. function rotateSize(options, angle) {
  44117. if (angle % 90 === 0 && angle % 180 !== 0) {
  44118. return {
  44119. width: options.height,
  44120. height: options.width
  44121. }
  44122. }
  44123. return options
  44124. }
  44125. function getCloudAngle(_ref, x, y, anchorX, anchorY) {
  44126. var width = _ref.width,
  44127. height = _ref.height;
  44128. var halfWidth = width / 2;
  44129. var halfHeight = height / 2;
  44130. var xr = Math.ceil(x + halfWidth);
  44131. var xl = Math.floor(x - halfWidth);
  44132. var yt = Math.floor(y - halfHeight);
  44133. var yb = Math.ceil(y + halfHeight);
  44134. if (anchorX < xl && anchorY < yt || anchorX >= xl && anchorX <= xr && anchorY < yt) {
  44135. return 270
  44136. }
  44137. if (anchorX > xr && anchorY > yb || anchorX >= xl && anchorX <= xr && anchorY > yb) {
  44138. return 90
  44139. } else {
  44140. if (anchorX < xl && anchorY > yb || anchorX < xl && anchorY >= yt && anchorY <= yb) {
  44141. return 180
  44142. }
  44143. }
  44144. return 0
  44145. }
  44146. function getCloudPoints(_ref2, x, y, anchorX, anchorY, _ref3, bounded) {
  44147. var width = _ref2.width,
  44148. height = _ref2.height;
  44149. var arrowWidth = _ref3.arrowWidth,
  44150. _ref3$cornerRadius = _ref3.cornerRadius,
  44151. cornerRadius = void 0 === _ref3$cornerRadius ? 0 : _ref3$cornerRadius;
  44152. var halfArrowWidth = arrowWidth / 2;
  44153. var halfWidth = width / 2;
  44154. var halfHeight = height / 2;
  44155. var xr = Math.ceil(x + halfWidth);
  44156. var xl = Math.floor(x - halfWidth);
  44157. var yt = Math.floor(y - halfHeight);
  44158. var yb = Math.ceil(y + halfHeight);
  44159. var leftTopCorner = [xl, yt];
  44160. var rightTopCorner = [xr, yt];
  44161. var rightBottomCorner = [xr, yb];
  44162. var leftBottomCorner = [xl, yb];
  44163. var arrowX = anchorX <= xl ? xl : xr <= anchorX ? xr : anchorX;
  44164. var arrowY = anchorY <= yt ? yt : yb <= anchorY ? yb : anchorY;
  44165. var arrowBaseBottom = min(arrowY + halfArrowWidth, yb);
  44166. var arrowBaseTop = max(arrowY - halfArrowWidth, yt);
  44167. var arrowBaseLeft = max(arrowX - halfArrowWidth, xl);
  44168. cornerRadius = Math.min(width / 2, height / 2, cornerRadius);
  44169. var points;
  44170. leftTopCorner[1] += cornerRadius;
  44171. rightTopCorner[0] -= cornerRadius;
  44172. rightBottomCorner[1] -= cornerRadius;
  44173. leftBottomCorner[0] += cornerRadius;
  44174. if (!bounded || xl <= anchorX && anchorX <= xr && yt <= anchorY && anchorY <= yb) {
  44175. points = buildPath(leftTopCorner, getArc(cornerRadius, 1, -1), "L", rightTopCorner, getArc(cornerRadius, 1, 1), "L", rightBottomCorner, getArc(cornerRadius, -1, 1), "L", leftBottomCorner, getArc(cornerRadius, -1, -1))
  44176. } else {
  44177. if (anchorX > xr && anchorY < yt) {
  44178. var arrowAngle = arrowWidth / cornerRadius || 0;
  44179. var angle = PI / 4 + arrowAngle / 2;
  44180. var endAngle = PI / 4 - arrowAngle / 2;
  44181. var arrowEndPointX = rightTopCorner[0] + cos(endAngle) * cornerRadius;
  44182. var arrowEndPointY = rightTopCorner[1] + (1 - sin(endAngle)) * cornerRadius;
  44183. var arrowArc = buildPath("L", rightTopCorner, getArc(cornerRadius, cos(angle), 1 - sin(angle)), "L", [anchorX, anchorY, arrowEndPointX, arrowEndPointY], getAbsoluteArc(cornerRadius, rightTopCorner[0] + cornerRadius, rightTopCorner[1] + cornerRadius));
  44184. if (Math.abs(angle) > PI / 2) {
  44185. arrowArc = buildPath("L", [arrowBaseLeft, yt, anchorX, anchorY, xr, arrowBaseBottom])
  44186. }
  44187. points = buildPath(leftTopCorner, getArc(cornerRadius, 1, -1), arrowArc, "L", rightBottomCorner, getArc(cornerRadius, -1, 1), "L", leftBottomCorner, getArc(cornerRadius, -1, -1))
  44188. } else {
  44189. if (anchorX > xr && anchorY >= yt && anchorY <= yb) {
  44190. var _arrowArc;
  44191. if (arrowBaseTop >= rightTopCorner[1] + cornerRadius && arrowBaseBottom <= rightBottomCorner[1]) {
  44192. _arrowArc = buildPath(getArc(cornerRadius, 1, 1), "L", [xr, arrowBaseTop, anchorX, anchorY, xr, arrowBaseBottom], "L", rightBottomCorner, getArc(cornerRadius, -1, 1))
  44193. } else {
  44194. if (arrowBaseTop < rightTopCorner[1] + cornerRadius && arrowBaseBottom >= rightTopCorner[1] + cornerRadius && arrowBaseBottom <= rightBottomCorner[1]) {
  44195. var arrowWidthRest = rightTopCorner[1] + cornerRadius - arrowBaseTop;
  44196. var _angle = arrowWidthRest / cornerRadius;
  44197. var arrowBaseTopX = rightTopCorner[0] + cos(_angle) * cornerRadius;
  44198. var arrowBaseTopY = rightTopCorner[1] + (1 - sin(_angle)) * cornerRadius;
  44199. _arrowArc = buildPath(getArc(cornerRadius, cos(_angle), 1 - sin(_angle)), "L", [arrowBaseTopX, arrowBaseTopY, anchorX, anchorY, xr, arrowBaseBottom], "L", rightBottomCorner, getArc(cornerRadius, -1, 1))
  44200. } else {
  44201. if (arrowBaseTop < rightTopCorner[1] + cornerRadius && arrowBaseBottom < rightTopCorner[1] + cornerRadius) {
  44202. var _arrowWidthRest = rightTopCorner[1] + cornerRadius - arrowBaseTop;
  44203. var _arrowAngle = _arrowWidthRest / cornerRadius;
  44204. var _angle2 = _arrowAngle;
  44205. var _arrowBaseTopX = rightTopCorner[0] + cos(_angle2) * cornerRadius;
  44206. var _arrowBaseTopY = rightTopCorner[1] + (1 - sin(_angle2)) * cornerRadius;
  44207. var bottomAngle = Math.sin((rightTopCorner[1] + cornerRadius - arrowBaseBottom) / cornerRadius);
  44208. var arrowBaseBottomX = rightTopCorner[0] + cornerRadius * cos(bottomAngle);
  44209. var arrowBaseBottomY = rightTopCorner[1] + cornerRadius * (1 - sin(bottomAngle));
  44210. _arrowArc = buildPath(getArc(cornerRadius, cos(_angle2), 1 - sin(_angle2)), "L", [_arrowBaseTopX, _arrowBaseTopY, anchorX, anchorY, arrowBaseBottomX, arrowBaseBottomY], getAbsoluteArc(cornerRadius, rightTopCorner[0] + cornerRadius, rightTopCorner[1] + cornerRadius), "L", rightBottomCorner, getArc(cornerRadius, -1, 1))
  44211. } else {
  44212. if (arrowBaseTop <= rightTopCorner[1] + cornerRadius && arrowBaseBottom >= rightBottomCorner[1]) {
  44213. var topAngle = asin((rightTopCorner[1] + cornerRadius - arrowBaseTop) / cornerRadius);
  44214. var _arrowBaseTopX2 = rightTopCorner[0] + cornerRadius * cos(topAngle);
  44215. var _arrowBaseTopY2 = rightTopCorner[1] + cornerRadius * (1 - sin(topAngle));
  44216. var _bottomAngle = asin((arrowBaseBottom - rightBottomCorner[1]) / cornerRadius);
  44217. var _arrowBaseBottomX = rightBottomCorner[0] + cornerRadius * (cos(_bottomAngle) - 1);
  44218. var _arrowBaseBottomY = rightBottomCorner[1] + cornerRadius * sin(_bottomAngle);
  44219. _arrowArc = buildPath(getArc(cornerRadius, cos(topAngle), 1 - sin(topAngle)), "L", [_arrowBaseTopX2, _arrowBaseTopY2, anchorX, anchorY, _arrowBaseBottomX, _arrowBaseBottomY], getAbsoluteArc(cornerRadius, rightBottomCorner[0] - cornerRadius, rightBottomCorner[1] + cornerRadius))
  44220. } else {
  44221. if (arrowBaseTop > rightTopCorner[1] + cornerRadius && arrowBaseTop <= rightBottomCorner[1] && arrowBaseBottom > rightBottomCorner[1]) {
  44222. var _bottomAngle2 = asin((arrowBaseBottom - rightBottomCorner[1]) / cornerRadius);
  44223. var _arrowBaseBottomX2 = rightBottomCorner[0] + cornerRadius * (cos(_bottomAngle2) - 1);
  44224. var _arrowBaseBottomY2 = rightBottomCorner[1] + cornerRadius * sin(_bottomAngle2);
  44225. _arrowArc = buildPath(getArc(cornerRadius, 1, 1), "L", [xr, arrowBaseTop, anchorX, anchorY, _arrowBaseBottomX2, _arrowBaseBottomY2], getAbsoluteArc(cornerRadius, rightBottomCorner[0] - cornerRadius, rightBottomCorner[1] + cornerRadius))
  44226. } else {
  44227. if (arrowBaseTop > rightTopCorner[1] + cornerRadius && arrowBaseBottom > rightBottomCorner[1]) {
  44228. var _bottomAngle3 = asin((arrowBaseBottom - rightBottomCorner[1]) / cornerRadius);
  44229. var _arrowBaseBottomX3 = rightBottomCorner[0] + cornerRadius * (cos(_bottomAngle3) - 1);
  44230. var _arrowBaseBottomY3 = rightBottomCorner[1] + cornerRadius * sin(_bottomAngle3);
  44231. var _topAngle = asin((arrowBaseTop - rightBottomCorner[1]) / cornerRadius);
  44232. var _arrowBaseTopX3 = rightBottomCorner[0] + cornerRadius * (cos(_topAngle) - 1);
  44233. var _arrowBaseTopY3 = rightBottomCorner[1] + cornerRadius * sin(_topAngle);
  44234. _arrowArc = buildPath(getArc(cornerRadius, 1, 1), "L", rightBottomCorner, getArc(cornerRadius, cos(_topAngle) - 1, sin(_topAngle)), "L", [_arrowBaseTopX3, _arrowBaseTopY3, anchorX, anchorY, _arrowBaseBottomX3, _arrowBaseBottomY3], getAbsoluteArc(cornerRadius, rightBottomCorner[0] - cornerRadius, rightBottomCorner[1] + cornerRadius))
  44235. }
  44236. }
  44237. }
  44238. }
  44239. }
  44240. }
  44241. points = buildPath(leftTopCorner, getArc(cornerRadius, 1, -1), "L", rightTopCorner, _arrowArc, "L", leftBottomCorner, getArc(cornerRadius, -1, -1))
  44242. }
  44243. }
  44244. }
  44245. return buildPath("M", points, "Z")
  44246. }
  44247. exports.Plaque = function() {
  44248. function Plaque(options, widget, root, renderContent) {
  44249. var bounded = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : true;
  44250. var measureContent = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : function(_, g) {
  44251. return g.getBBox()
  44252. };
  44253. var moveContentGroup = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : function(_, g, x, y) {
  44254. return g.move(x, y)
  44255. };
  44256. _classCallCheck(this, Plaque);
  44257. this.widget = widget;
  44258. this.options = options;
  44259. this.root = root;
  44260. this.renderContent = renderContent;
  44261. this.bonded = bounded;
  44262. this.measureContent = measureContent;
  44263. this.moveContentGroup = moveContentGroup
  44264. }
  44265. _createClass(Plaque, [{
  44266. key: "draw",
  44267. value: function(_ref4) {
  44268. var anchorX = _ref4.x,
  44269. anchorY = _ref4.y,
  44270. _ref4$canvas = _ref4.canvas,
  44271. canvas = void 0 === _ref4$canvas ? {} : _ref4$canvas,
  44272. offsetX = _ref4.offsetX,
  44273. offsetY = _ref4.offsetY,
  44274. _ref4$offset = _ref4.offset,
  44275. offset = void 0 === _ref4$offset ? 0 : _ref4$offset;
  44276. var options = this.options;
  44277. var x = options.x,
  44278. y = options.y;
  44279. var bounds = {
  44280. xl: canvas.left,
  44281. xr: canvas.width - canvas.right,
  44282. width: canvas.width - canvas.right - canvas.left,
  44283. yt: canvas.top,
  44284. yb: canvas.height - canvas.bottom,
  44285. height: canvas.height - canvas.bottom - canvas.top
  44286. };
  44287. if (!((0, _type.isDefined)(anchorX) && (0, _type.isDefined)(anchorY)) && !((0, _type.isDefined)(x) && (0, _type.isDefined)(y))) {
  44288. return
  44289. }
  44290. if ((0, _type.isDefined)(anchorX) && (anchorX < bounds.xl || bounds.xr < anchorX || anchorY < bounds.yt || bounds.yb < anchorY)) {
  44291. return
  44292. }
  44293. if (!this._root) {
  44294. this._draw()
  44295. }
  44296. var shadowSettings = (0, _extend.extend)({
  44297. x: "-50%",
  44298. y: "-50%",
  44299. width: "200%",
  44300. height: "200%"
  44301. }, options.shadow);
  44302. var contentWidth = options.width > 0 ? options.width : null;
  44303. var contentHeight = options.height > 0 ? options.height : null;
  44304. this.renderContent(this.widget, this._contentGroup, {
  44305. width: contentWidth,
  44306. height: contentHeight
  44307. });
  44308. var bBox = this._contentBBox = this.measureContent(this.widget, this._contentGroup);
  44309. var size = this._size = {
  44310. width: max(contentWidth, bBox.width) + 2 * options.paddingLeftRight,
  44311. height: max(contentHeight, bBox.height) + 2 * options.paddingTopBottom,
  44312. offset: offset
  44313. };
  44314. var xOff = shadowSettings.offsetX;
  44315. var yOff = shadowSettings.offsetY;
  44316. var blur = 2 * shadowSettings.blur + 1;
  44317. var lm = max(blur - xOff, 0);
  44318. var rm = max(blur + xOff, 0);
  44319. var tm = max(blur - yOff, 0);
  44320. var bm = max(blur + yOff, 0);
  44321. this.margins = {
  44322. lm: lm,
  44323. rm: rm,
  44324. tm: tm,
  44325. bm: bm
  44326. };
  44327. if (!(0, _type.isDefined)(x)) {
  44328. if ((0, _type.isDefined)(offsetX)) {
  44329. x = anchorX + offsetX
  44330. } else {
  44331. if (bounds.width < size.width) {
  44332. x = round(bounds.xl + bounds.width / 2)
  44333. } else {
  44334. x = min(max(anchorX, Math.ceil(bounds.xl + size.width / 2 + lm)), Math.floor(bounds.xr - size.width / 2 - rm))
  44335. }
  44336. }
  44337. } else {
  44338. x += offsetX || 0;
  44339. if (!(0, _type.isDefined)(anchorX)) {
  44340. anchorX = x
  44341. }
  44342. }
  44343. if (!(0, _type.isDefined)(y)) {
  44344. if ((0, _type.isDefined)(offsetY)) {
  44345. y = anchorY + offsetY
  44346. } else {
  44347. var y_top = anchorY - options.arrowLength - size.height / 2 - offset;
  44348. var y_bottom = anchorY + options.arrowLength + size.height / 2 + offset;
  44349. if (bounds.height < size.height + options.arrowLength) {
  44350. y = round(bounds.yt + size.height / 2)
  44351. } else {
  44352. if (y_top - size.height / 2 - tm < bounds.yt) {
  44353. if (y_bottom + size.height / 2 + bm < bounds.yb) {
  44354. y = y_bottom;
  44355. anchorY += offset
  44356. } else {
  44357. y = round(bounds.yt + size.height / 2)
  44358. }
  44359. } else {
  44360. y = y_top;
  44361. anchorY -= offset
  44362. }
  44363. }
  44364. }
  44365. } else {
  44366. y += offsetY || 0;
  44367. if (!(0, _type.isDefined)(anchorY)) {
  44368. anchorY = y + size.height / 2
  44369. }
  44370. }
  44371. this.anchorX = anchorX;
  44372. this.anchorY = anchorY;
  44373. this.move(x, y)
  44374. }
  44375. }, {
  44376. key: "_draw",
  44377. value: function() {
  44378. var renderer = this.widget._renderer;
  44379. var options = this.options;
  44380. var cloudSettings = {
  44381. opacity: options.opacity,
  44382. "stroke-width": 0,
  44383. fill: options.color
  44384. };
  44385. var borderOptions = options.border || {};
  44386. if (borderOptions.visible) {
  44387. (0, _extend.extend)(cloudSettings, {
  44388. "stroke-width": borderOptions.width,
  44389. stroke: borderOptions.color,
  44390. "stroke-opacity": borderOptions.opacity,
  44391. dashStyle: borderOptions.dashStyle
  44392. })
  44393. }
  44394. var shadowSettings = (0, _extend.extend)({
  44395. x: "-50%",
  44396. y: "-50%",
  44397. width: "200%",
  44398. height: "200%"
  44399. }, options.shadow);
  44400. var shadow = this._shadow = renderer.shadowFilter().attr(shadowSettings);
  44401. var group = this._root = renderer.g().append(this.root);
  44402. if (options.type) {
  44403. group.attr({
  44404. "class": "dxc-".concat(options.type, "-annotation")
  44405. })
  44406. }
  44407. var cloudGroup = renderer.g().attr({
  44408. filter: shadow.id
  44409. }).append(group);
  44410. this._cloud = renderer.path([], "area").attr(cloudSettings).sharp().append(cloudGroup);
  44411. this._contentGroup = renderer.g().append(group)
  44412. }
  44413. }, {
  44414. key: "getBBox",
  44415. value: function() {
  44416. var size = this._size || {};
  44417. var margins = this.margins || {};
  44418. var rotationAngle = getCloudAngle(size, this.x, this.y, this.anchorX, this.anchorY);
  44419. return {
  44420. x: Math.floor(this.x - size.width / 2 - margins.lm),
  44421. y: Math.floor(this.y - size.height / 2 - margins.tm - (270 === rotationAngle ? this.options.arrowLength : 0)),
  44422. width: size.width + margins.lm + margins.rm,
  44423. height: size.height + margins.tm + margins.bm + (90 === rotationAngle || 270 === rotationAngle ? this.options.arrowLength : 0)
  44424. }
  44425. }
  44426. }, {
  44427. key: "clear",
  44428. value: function() {
  44429. if (this._root) {
  44430. this._root.remove();
  44431. this._shadow.remove();
  44432. this._root = null
  44433. }
  44434. return this
  44435. }
  44436. }, {
  44437. key: "customizeCloud",
  44438. value: function(attr) {
  44439. if (this._cloud) {
  44440. this._cloud.attr(attr)
  44441. }
  44442. }
  44443. }, {
  44444. key: "moveRoot",
  44445. value: function(x, y) {
  44446. if (this._root) {
  44447. this._root.move(x, y)
  44448. }
  44449. }
  44450. }, {
  44451. key: "move",
  44452. value: function(x, y) {
  44453. x = round(x);
  44454. y = round(y);
  44455. this.x = x;
  44456. this.y = y;
  44457. var rotationAngle = getCloudAngle(this._size, x, y, this.anchorX, this.anchorY);
  44458. var radRotationAngle = rotationAngle * PI / 180;
  44459. this._cloud.attr({
  44460. d: getCloudPoints(rotateSize(this._size, rotationAngle), x, y, rotateX(this.anchorX, this.anchorY, radRotationAngle, x, y), rotateY(this.anchorX, this.anchorY, radRotationAngle, x, y), this.options, this.bonded)
  44461. }).rotate(rotationAngle, x, y);
  44462. this.moveContentGroup(this.widget, this._contentGroup, x - this._contentBBox.x - this._contentBBox.width / 2, y - this._contentBBox.y - this._contentBBox.height / 2)
  44463. }
  44464. }, {
  44465. key: "hitTest",
  44466. value: function(x, y) {
  44467. var _ref5 = this._size || {},
  44468. width = _ref5.width,
  44469. height = _ref5.height;
  44470. return Math.abs(x - this.x) <= width / 2 && Math.abs(y - this.y) <= height / 2
  44471. }
  44472. }]);
  44473. return Plaque
  44474. }()
  44475. },
  44476. /*!*********************************************************************!*\
  44477. !*** ./artifacts/transpiled/viz/chart_components/advanced_chart.js ***!
  44478. \*********************************************************************/
  44479. /*! dynamic exports provided */
  44480. /*! all exports used */
  44481. function(module, exports, __webpack_require__) {
  44482. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  44483. var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  44484. var iteratorModule = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  44485. var rangeModule = __webpack_require__( /*! ../translators/range */ 108);
  44486. var DEFAULT_AXIS_NAME = "defaultAxisName";
  44487. var axisModule = __webpack_require__( /*! ../axes/base_axis */ 204);
  44488. var seriesFamilyModule = __webpack_require__( /*! ../core/series_family */ 409);
  44489. var BaseChart = __webpack_require__( /*! ./base_chart */ 240).BaseChart;
  44490. var crosshairModule = __webpack_require__( /*! ./crosshair */ 410);
  44491. var _isArray = Array.isArray;
  44492. var _isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  44493. var _each = iteratorModule.each;
  44494. var _reverseEach = iteratorModule.reverseEach;
  44495. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  44496. var _extend = extend;
  44497. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  44498. var _map = vizUtils.map;
  44499. var mergeMarginOptions = vizUtils.mergeMarginOptions;
  44500. var FONT = "font";
  44501. var COMMON_AXIS_SETTINGS = "commonAxisSettings";
  44502. function prepareAxis(axisOptions) {
  44503. return _isArray(axisOptions) ? 0 === axisOptions.length ? [{}] : axisOptions : [axisOptions]
  44504. }
  44505. function processBubbleMargin(opt, bubbleSize) {
  44506. if (opt.processBubbleSize) {
  44507. opt.size = bubbleSize
  44508. }
  44509. return opt
  44510. }
  44511. function estimateBubbleSize(size, panesCount, maxSize, rotated) {
  44512. var width = rotated ? size.width / panesCount : size.width;
  44513. var height = rotated ? size.height : size.height / panesCount;
  44514. return Math.min(width, height) * maxSize
  44515. }
  44516. var AdvancedChart = BaseChart.inherit({
  44517. _setDeprecatedOptions: function() {
  44518. this.callBase.apply(this, arguments);
  44519. _extend(this._deprecatedOptions, {
  44520. barWidth: {
  44521. since: "18.1",
  44522. message: "Use the 'commonSeriesSettings.barPadding' or 'series.barPadding' option instead"
  44523. },
  44524. equalBarWidth: {
  44525. since: "18.1",
  44526. message: "Use the 'commonSeriesSettings.ignoreEmptyPoints' or 'series.ignoreEmptyPoints' option instead"
  44527. }
  44528. })
  44529. },
  44530. _fontFields: [COMMON_AXIS_SETTINGS + ".label." + FONT, COMMON_AXIS_SETTINGS + ".title." + FONT],
  44531. _dispose: function() {
  44532. var that = this;
  44533. var disposeObjectsInArray = this._disposeObjectsInArray;
  44534. that.callBase();
  44535. that.panes = null;
  44536. if (that._legend) {
  44537. that._legend.dispose();
  44538. that._legend = null
  44539. }
  44540. disposeObjectsInArray.call(that, "panesBackground");
  44541. disposeObjectsInArray.call(that, "seriesFamilies");
  44542. that._disposeAxes()
  44543. },
  44544. _reinitAxes: function() {
  44545. this.panes = this._createPanes();
  44546. this._populateAxes();
  44547. this._axesReinitialized = true
  44548. },
  44549. _getCrosshairMargins: function() {
  44550. var crosshairOptions = this._getCrosshairOptions() || {};
  44551. var crosshairEnabled = crosshairOptions.enabled;
  44552. var margins = crosshairModule.getMargins();
  44553. return {
  44554. x: crosshairEnabled && crosshairOptions.horizontalLine.visible ? margins.x : 0,
  44555. y: crosshairEnabled && crosshairOptions.verticalLine.visible ? margins.y : 0
  44556. }
  44557. },
  44558. _populateAxes: function() {
  44559. var that = this;
  44560. var panes = that.panes;
  44561. var rotated = that._isRotated();
  44562. var argumentAxesOptions = prepareAxis(that.option("argumentAxis") || {})[0];
  44563. var valueAxisOption = that.option("valueAxis");
  44564. var valueAxesOptions = prepareAxis(valueAxisOption || {});
  44565. var argumentAxesPopulatedOptions = [];
  44566. var valueAxesPopulatedOptions = [];
  44567. var axisNames = [];
  44568. var valueAxesCounter = 0;
  44569. var paneWithNonVirtualAxis;
  44570. var crosshairMargins = that._getCrosshairMargins();
  44571. function getNextAxisName() {
  44572. return DEFAULT_AXIS_NAME + valueAxesCounter++
  44573. }
  44574. if (rotated) {
  44575. paneWithNonVirtualAxis = "right" === argumentAxesOptions.position ? panes[panes.length - 1].name : panes[0].name
  44576. } else {
  44577. paneWithNonVirtualAxis = "top" === argumentAxesOptions.position ? panes[0].name : panes[panes.length - 1].name
  44578. }
  44579. argumentAxesPopulatedOptions = _map(panes, function(pane) {
  44580. var virtual = pane.name !== paneWithNonVirtualAxis;
  44581. return that._populateAxesOptions("argumentAxis", argumentAxesOptions, {
  44582. pane: pane.name,
  44583. name: null,
  44584. optionPath: "argumentAxis",
  44585. crosshairMargin: rotated ? crosshairMargins.x : crosshairMargins.y
  44586. }, rotated, virtual)
  44587. });
  44588. _each(valueAxesOptions, function(priority, axisOptions) {
  44589. var axisPanes = [];
  44590. var name = axisOptions.name;
  44591. if (name && inArray(name, axisNames) !== -1) {
  44592. that._incidentOccurred("E2102");
  44593. return
  44594. }
  44595. name && axisNames.push(name);
  44596. if (axisOptions.pane) {
  44597. axisPanes.push(axisOptions.pane)
  44598. }
  44599. if (axisOptions.panes && axisOptions.panes.length) {
  44600. axisPanes = axisPanes.concat(axisOptions.panes.slice(0))
  44601. }
  44602. axisPanes = vizUtils.unique(axisPanes);
  44603. if (!axisPanes.length) {
  44604. axisPanes.push(void 0)
  44605. }
  44606. _each(axisPanes, function(_, pane) {
  44607. var optionPath = _isArray(valueAxisOption) ? "valueAxis[".concat(priority, "]") : "valueAxis";
  44608. valueAxesPopulatedOptions.push(that._populateAxesOptions("valueAxis", axisOptions, {
  44609. name: name || getNextAxisName(),
  44610. pane: pane,
  44611. priority: priority,
  44612. optionPath: optionPath,
  44613. crosshairMargin: rotated ? crosshairMargins.y : crosshairMargins.x
  44614. }, rotated))
  44615. })
  44616. });
  44617. that._redesignAxes(argumentAxesPopulatedOptions, true, paneWithNonVirtualAxis);
  44618. that._redesignAxes(valueAxesPopulatedOptions, false)
  44619. },
  44620. _redesignAxes: function(options, isArgumentAxes, paneWithNonVirtualAxis) {
  44621. var that = this;
  44622. var axesBasis = [];
  44623. var axes = isArgumentAxes ? that._argumentAxes : that._valueAxes;
  44624. _each(options, function(_, opt) {
  44625. var curAxes = axes && axes.filter(function(a) {
  44626. return a.name === opt.name && (!_isDefined(opt.pane) && that.panes.some(function(p) {
  44627. return p.name === a.pane
  44628. }) || a.pane === opt.pane)
  44629. });
  44630. if (curAxes && curAxes.length > 0) {
  44631. _each(curAxes, function(_, axis) {
  44632. axis.updateOptions(opt);
  44633. axis.validate();
  44634. axesBasis.push({
  44635. axis: axis
  44636. })
  44637. })
  44638. } else {
  44639. axesBasis.push({
  44640. options: opt
  44641. })
  44642. }
  44643. });
  44644. if (axes) {
  44645. _reverseEach(axes, function(index, axis) {
  44646. if (!axesBasis.some(function(basis) {
  44647. return basis.axis && basis.axis === axis
  44648. })) {
  44649. that._disposeAxis(index, isArgumentAxes)
  44650. }
  44651. })
  44652. } else {
  44653. if (isArgumentAxes) {
  44654. axes = that._argumentAxes = []
  44655. } else {
  44656. axes = that._valueAxes = []
  44657. }
  44658. }
  44659. _each(axesBasis, function(index, basis) {
  44660. var axis = basis.axis;
  44661. if (basis.axis && isArgumentAxes) {
  44662. basis.axis.isVirtual = basis.axis.pane !== paneWithNonVirtualAxis
  44663. } else {
  44664. if (basis.options) {
  44665. axis = that._createAxis(isArgumentAxes, basis.options, isArgumentAxes ? basis.options.pane !== paneWithNonVirtualAxis : void 0, isArgumentAxes ? index : void 0);
  44666. axes.push(axis)
  44667. }
  44668. }
  44669. axis.applyVisualRangeSetter(that._getVisualRangeSetter())
  44670. })
  44671. },
  44672. _disposeAxis: function(index, isArgumentAxis) {
  44673. var axes = isArgumentAxis ? this._argumentAxes : this._valueAxes;
  44674. var axis = axes[index];
  44675. if (!axis) {
  44676. return
  44677. }
  44678. axis.dispose();
  44679. axes.splice(index, 1)
  44680. },
  44681. _prepareStackPoints: function(singleSeries, stackPoints) {
  44682. var points = singleSeries.getPoints();
  44683. var stackName = singleSeries.getStackName();
  44684. _each(points, function(_, point) {
  44685. var argument = point.argument;
  44686. if (!stackPoints[argument]) {
  44687. stackPoints[argument] = {};
  44688. stackPoints[argument][null] = []
  44689. }
  44690. if (stackName && !_isArray(stackPoints[argument][stackName])) {
  44691. stackPoints[argument][stackName] = [];
  44692. _each(stackPoints[argument][null], function(_, point) {
  44693. if (!point.stackName) {
  44694. stackPoints[argument][stackName].push(point)
  44695. }
  44696. })
  44697. }
  44698. if (stackName) {
  44699. stackPoints[argument][stackName].push(point);
  44700. stackPoints[argument][null].push(point)
  44701. } else {
  44702. _each(stackPoints[argument], function(_, stack) {
  44703. stack.push(point)
  44704. })
  44705. }
  44706. point.stackPoints = stackPoints[argument][stackName];
  44707. point.stackName = stackName
  44708. })
  44709. },
  44710. _resetStackPoints: function(singleSeries) {
  44711. _each(singleSeries.getPoints(), function(_, point) {
  44712. point.stackPoints = null;
  44713. point.stackName = null
  44714. })
  44715. },
  44716. _disposeAxes: function() {
  44717. var that = this;
  44718. var disposeObjectsInArray = that._disposeObjectsInArray;
  44719. disposeObjectsInArray.call(that, "_argumentAxes");
  44720. disposeObjectsInArray.call(that, "_valueAxes")
  44721. },
  44722. _appendAdditionalSeriesGroups: function() {
  44723. this._crosshairCursorGroup.linkAppend();
  44724. this._scrollBar && this._scrollBarGroup.linkAppend()
  44725. },
  44726. _getLegendTargets: function() {
  44727. var _this = this;
  44728. return (this.series || []).map(function(s) {
  44729. var item = _this._getLegendOptions(s);
  44730. item.legendData.series = s;
  44731. if (!s.getOptions().showInLegend) {
  44732. item.legendData.visible = false
  44733. }
  44734. return item
  44735. })
  44736. },
  44737. _legendItemTextField: "name",
  44738. _seriesPopulatedHandlerCore: function() {
  44739. this._processSeriesFamilies();
  44740. this._processValueAxisFormat()
  44741. },
  44742. _renderTrackers: function() {
  44743. var that = this;
  44744. var i;
  44745. for (i = 0; i < that.series.length; ++i) {
  44746. that.series[i].drawTrackers()
  44747. }
  44748. },
  44749. _specialProcessSeries: function() {
  44750. this._processSeriesFamilies()
  44751. },
  44752. _processSeriesFamilies: function() {
  44753. var that = this;
  44754. var types = [];
  44755. var families = [];
  44756. var paneSeries;
  44757. var themeManager = that._themeManager;
  44758. var negativesAsZeroes = themeManager.getOptions("negativesAsZeroes");
  44759. var negativesAsZeros = themeManager.getOptions("negativesAsZeros");
  44760. var familyOptions = {
  44761. equalBarWidth: themeManager.getOptions("equalBarWidth"),
  44762. minBubbleSize: themeManager.getOptions("minBubbleSize"),
  44763. maxBubbleSize: themeManager.getOptions("maxBubbleSize"),
  44764. barWidth: themeManager.getOptions("barWidth"),
  44765. barGroupPadding: themeManager.getOptions("barGroupPadding"),
  44766. barGroupWidth: themeManager.getOptions("barGroupWidth"),
  44767. negativesAsZeroes: _isDefined(negativesAsZeroes) ? negativesAsZeroes : negativesAsZeros
  44768. };
  44769. if (that.seriesFamilies && that.seriesFamilies.length) {
  44770. _each(that.seriesFamilies, function(_, family) {
  44771. family.updateOptions(familyOptions);
  44772. family.adjustSeriesValues()
  44773. });
  44774. return
  44775. }
  44776. _each(that.series, function(_, item) {
  44777. if (inArray(item.type, types) === -1) {
  44778. types.push(item.type)
  44779. }
  44780. });
  44781. _each(that._getLayoutTargets(), function(_, pane) {
  44782. paneSeries = that._getSeriesForPane(pane.name);
  44783. _each(types, function(_, type) {
  44784. var family = new seriesFamilyModule.SeriesFamily({
  44785. type: type,
  44786. pane: pane.name,
  44787. equalBarWidth: familyOptions.equalBarWidth,
  44788. minBubbleSize: familyOptions.minBubbleSize,
  44789. maxBubbleSize: familyOptions.maxBubbleSize,
  44790. barWidth: familyOptions.barWidth,
  44791. barGroupPadding: familyOptions.barGroupPadding,
  44792. barGroupWidth: familyOptions.barGroupWidth,
  44793. negativesAsZeroes: familyOptions.negativesAsZeroes,
  44794. rotated: that._isRotated()
  44795. });
  44796. family.add(paneSeries);
  44797. family.adjustSeriesValues();
  44798. families.push(family)
  44799. })
  44800. });
  44801. that.seriesFamilies = families
  44802. },
  44803. _updateSeriesDimensions: function() {
  44804. var that = this;
  44805. var i;
  44806. var seriesFamilies = that.seriesFamilies || [];
  44807. for (i = 0; i < seriesFamilies.length; i++) {
  44808. var family = seriesFamilies[i];
  44809. family.updateSeriesValues();
  44810. family.adjustSeriesDimensions()
  44811. }
  44812. },
  44813. _getLegendCallBack: function(series) {
  44814. return this._legend && this._legend.getActionCallback(series)
  44815. },
  44816. _appendAxesGroups: function() {
  44817. var that = this;
  44818. that._stripsGroup.linkAppend();
  44819. that._gridGroup.linkAppend();
  44820. that._axesGroup.linkAppend();
  44821. that._constantLinesGroup.linkAppend();
  44822. that._labelAxesGroup.linkAppend();
  44823. that._scaleBreaksGroup.linkAppend()
  44824. },
  44825. _populateMarginOptions: function() {
  44826. var that = this;
  44827. var bubbleSize = estimateBubbleSize(that.getSize(), that.panes.length, that._themeManager.getOptions("maxBubbleSize"), that._isRotated());
  44828. var argumentMarginOptions = {};
  44829. that._valueAxes.forEach(function(valueAxis) {
  44830. var groupSeries = that.series.filter(function(series) {
  44831. return series.getValueAxis() === valueAxis
  44832. });
  44833. var marginOptions = {};
  44834. groupSeries.forEach(function(series) {
  44835. if (series.isVisible()) {
  44836. var seriesMarginOptions = processBubbleMargin(series.getMarginOptions(), bubbleSize);
  44837. marginOptions = mergeMarginOptions(marginOptions, seriesMarginOptions);
  44838. argumentMarginOptions = mergeMarginOptions(argumentMarginOptions, seriesMarginOptions)
  44839. }
  44840. });
  44841. valueAxis.setMarginOptions(marginOptions)
  44842. });
  44843. that._argumentAxes.forEach(function(a) {
  44844. return a.setMarginOptions(argumentMarginOptions)
  44845. })
  44846. },
  44847. _populateBusinessRange: function(updatedAxis, keepRange) {
  44848. var that = this;
  44849. var rotated = that._isRotated();
  44850. var argRange = new rangeModule.Range({
  44851. rotated: !!rotated
  44852. });
  44853. var series = that._getVisibleSeries();
  44854. that._valueAxes.forEach(function(valueAxis) {
  44855. var groupRange = new rangeModule.Range({
  44856. rotated: !!rotated,
  44857. pane: valueAxis.pane,
  44858. axis: valueAxis.name
  44859. });
  44860. var groupSeries = series.filter(function(series) {
  44861. return series.getValueAxis() === valueAxis
  44862. });
  44863. groupSeries.forEach(function(series) {
  44864. var seriesRange = series.getRangeData();
  44865. groupRange.addRange(seriesRange.val);
  44866. argRange.addRange(seriesRange.arg)
  44867. });
  44868. if (!updatedAxis || updatedAxis && groupSeries.length && valueAxis === updatedAxis) {
  44869. valueAxis.setGroupSeries(groupSeries);
  44870. valueAxis.setBusinessRange(groupRange, that._axesReinitialized || keepRange, that._argumentAxes[0]._lastVisualRangeUpdateMode)
  44871. }
  44872. });
  44873. if (!updatedAxis || updatedAxis && series.length) {
  44874. that._argumentAxes.forEach(function(a) {
  44875. return a.setBusinessRange(argRange, that._axesReinitialized, void 0, that._groupsData.categories)
  44876. })
  44877. }
  44878. that._populateMarginOptions()
  44879. },
  44880. getArgumentAxis: function() {
  44881. return (this._argumentAxes || []).filter(function(a) {
  44882. return !a.isVirtual
  44883. })[0]
  44884. },
  44885. getValueAxis: function(name) {
  44886. var _this2 = this;
  44887. return (this._valueAxes || []).filter(_isDefined(name) ? function(a) {
  44888. return a.name === name
  44889. } : function(a) {
  44890. return a.pane === _this2.defaultPane
  44891. })[0]
  44892. },
  44893. _getGroupsData: function() {
  44894. var that = this;
  44895. var groups = [];
  44896. that._valueAxes.forEach(function(axis) {
  44897. groups.push({
  44898. series: that.series.filter(function(series) {
  44899. return series.getValueAxis() === axis
  44900. }),
  44901. valueAxis: axis,
  44902. valueOptions: axis.getOptions()
  44903. })
  44904. });
  44905. return {
  44906. groups: groups,
  44907. argumentAxes: that._argumentAxes,
  44908. argumentOptions: that._argumentAxes[0].getOptions()
  44909. }
  44910. },
  44911. _groupSeries: function() {
  44912. var that = this;
  44913. that._correctValueAxes(false);
  44914. that._groupsData = that._getGroupsData()
  44915. },
  44916. _processValueAxisFormat: function() {
  44917. var axesWithFullStackedFormat = [];
  44918. this.series.forEach(function(series) {
  44919. var axis = series.getValueAxis();
  44920. if (series.isFullStackedSeries()) {
  44921. axis.setPercentLabelFormat();
  44922. axesWithFullStackedFormat.push(axis)
  44923. }
  44924. });
  44925. this._valueAxes.forEach(function(axis) {
  44926. if (axesWithFullStackedFormat.indexOf(axis) === -1) {
  44927. axis.resetAutoLabelFormat()
  44928. }
  44929. })
  44930. },
  44931. _populateAxesOptions: function(typeSelector, userOptions, axisOptions, rotated, virtual) {
  44932. var that = this;
  44933. var preparedUserOptions = that._prepareStripsAndConstantLines(typeSelector, userOptions, rotated);
  44934. var options = _extend(true, {}, preparedUserOptions, axisOptions, that._prepareAxisOptions(typeSelector, preparedUserOptions, rotated));
  44935. if (virtual) {
  44936. options.visible = options.tick.visible = options.minorTick.visible = options.label.visible = false;
  44937. options.title = {}
  44938. }
  44939. return options
  44940. },
  44941. _createAxis: function(isArgumentAxes, options, virtual, index) {
  44942. var that = this;
  44943. var typeSelector = isArgumentAxes ? "argumentAxis" : "valueAxis";
  44944. var renderingSettings = _extend({
  44945. renderer: that._renderer,
  44946. incidentOccurred: that._incidentOccurred,
  44947. eventTrigger: that._eventTrigger,
  44948. axisClass: isArgumentAxes ? "arg" : "val",
  44949. widgetClass: "dxc",
  44950. stripsGroup: that._stripsGroup,
  44951. labelAxesGroup: that._labelAxesGroup,
  44952. constantLinesGroup: that._constantLinesGroup,
  44953. scaleBreaksGroup: that._scaleBreaksGroup,
  44954. axesContainerGroup: that._axesGroup,
  44955. gridGroup: that._gridGroup,
  44956. isArgumentAxis: isArgumentAxes
  44957. }, that._getAxisRenderingOptions(typeSelector));
  44958. var axis = new axisModule.Axis(renderingSettings);
  44959. axis.updateOptions(options);
  44960. axis.isVirtual = virtual;
  44961. return axis
  44962. },
  44963. _getVisualRangeSetter: _noop,
  44964. _getTrackerSettings: function() {
  44965. return _extend(this.callBase(), {
  44966. argumentAxis: this.getArgumentAxis()
  44967. })
  44968. },
  44969. _prepareStripsAndConstantLines: function(typeSelector, userOptions, rotated) {
  44970. userOptions = this._themeManager.getOptions(typeSelector, userOptions, rotated);
  44971. if (userOptions.strips) {
  44972. _each(userOptions.strips, function(i) {
  44973. userOptions.strips[i] = _extend(true, {}, userOptions.stripStyle, userOptions.strips[i])
  44974. })
  44975. }
  44976. if (userOptions.constantLines) {
  44977. _each(userOptions.constantLines, function(i, line) {
  44978. userOptions.constantLines[i] = _extend(true, {}, userOptions.constantLineStyle, line)
  44979. })
  44980. }
  44981. return userOptions
  44982. },
  44983. _legendDataField: "series",
  44984. _adjustSeriesLabels: _noop,
  44985. _correctValueAxes: _noop,
  44986. refresh: function() {
  44987. this._disposeAxes();
  44988. this.callBase()
  44989. },
  44990. _layoutAxes: function(drawAxes) {
  44991. var that = this;
  44992. var cleanPanesCanvases = drawAxes();
  44993. var needSpace = that.checkForMoreSpaceForPanesCanvas();
  44994. if (needSpace) {
  44995. var size = this._layout.backward(this._rect, this._rect, [needSpace.width, needSpace.height]);
  44996. needSpace.width = Math.max(0, size[0]);
  44997. needSpace.height = Math.max(0, size[1]);
  44998. this._canvas = this._createCanvasFromRect(this._rect);
  44999. drawAxes(needSpace, cleanPanesCanvases)
  45000. }
  45001. },
  45002. checkForMoreSpaceForPanesCanvas: function() {
  45003. return this.layoutManager.needMoreSpaceForPanesCanvas(this._getLayoutTargets(), this._isRotated())
  45004. },
  45005. _notify: function() {
  45006. this._axesReinitialized = false
  45007. }
  45008. });
  45009. exports.AdvancedChart = AdvancedChart
  45010. },
  45011. /*!**********************************************************!*\
  45012. !*** ./artifacts/transpiled/viz/axes/smart_formatter.js ***!
  45013. \**********************************************************/
  45014. /*! dynamic exports provided */
  45015. /*! all exports used */
  45016. function(module, exports, __webpack_require__) {
  45017. Object.defineProperty(exports, "__esModule", {
  45018. value: true
  45019. });
  45020. exports.smartFormatter = smartFormatter;
  45021. exports.formatRange = formatRange;
  45022. var _format_helper = __webpack_require__( /*! ../../format_helper */ 64);
  45023. var _format_helper2 = _interopRequireDefault(_format_helper);
  45024. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  45025. var _date = __webpack_require__( /*! ../../core/utils/date */ 22);
  45026. var _date2 = _interopRequireDefault(_date);
  45027. var _math = __webpack_require__( /*! ../../core/utils/math */ 28);
  45028. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  45029. function _interopRequireDefault(obj) {
  45030. return obj && obj.__esModule ? obj : {
  45031. "default": obj
  45032. }
  45033. }
  45034. var _format = _format_helper2.default.format;
  45035. var floor = Math.floor;
  45036. var abs = Math.abs;
  45037. var EXPONENTIAL = "exponential";
  45038. var formats = ["fixedPoint", "thousands", "millions", "billions", "trillions", EXPONENTIAL];
  45039. var dateUnitIntervals = ["millisecond", "second", "minute", "hour", "day", "month", "year"];
  45040. function getDatesDifferences(prevDate, curDate, nextDate, tickFormat) {
  45041. var prevDifferences;
  45042. var nextDifferences;
  45043. var dateUnitInterval;
  45044. var dateUnitsLength = dateUnitIntervals.length;
  45045. var i;
  45046. var j;
  45047. if ("week" === tickFormat) {
  45048. tickFormat = "day"
  45049. } else {
  45050. if ("quarter" === tickFormat) {
  45051. tickFormat = "month"
  45052. } else {
  45053. if ("shorttime" === tickFormat) {
  45054. tickFormat = "hour"
  45055. } else {
  45056. if ("longtime" === tickFormat) {
  45057. tickFormat = "second"
  45058. }
  45059. }
  45060. }
  45061. }
  45062. var tickFormatIndex = dateUnitIntervals.indexOf(tickFormat);
  45063. if (nextDate) {
  45064. nextDifferences = _date2.default.getDatesDifferences(curDate, nextDate);
  45065. prevDifferences = _date2.default.getDatesDifferences(curDate, prevDate);
  45066. if (nextDifferences[tickFormat]) {
  45067. for (i = dateUnitsLength - 1; i >= tickFormatIndex; i--) {
  45068. dateUnitInterval = dateUnitIntervals[i];
  45069. if (i === tickFormatIndex) {
  45070. setDateUnitInterval(nextDifferences, tickFormatIndex + (nextDifferences.millisecond ? 2 : 1))
  45071. } else {
  45072. if (nextDifferences[dateUnitInterval]) {
  45073. resetDateUnitInterval(nextDifferences, i);
  45074. break
  45075. }
  45076. }
  45077. }
  45078. }
  45079. } else {
  45080. prevDifferences = _date2.default.getDatesDifferences(prevDate, curDate);
  45081. for (i = dateUnitsLength - 1; i >= tickFormatIndex; i--) {
  45082. dateUnitInterval = dateUnitIntervals[i];
  45083. if (prevDifferences[dateUnitInterval]) {
  45084. if (i - tickFormatIndex > 1) {
  45085. for (j = tickFormatIndex + 1; j >= 0; j--) {
  45086. resetDateUnitInterval(prevDifferences, j)
  45087. }
  45088. break
  45089. } else {
  45090. if (isDateTimeStart(curDate, dateUnitInterval)) {
  45091. for (j = i - 1; j > 0; j--) {
  45092. resetDateUnitInterval(prevDifferences, j)
  45093. }
  45094. break
  45095. }
  45096. }
  45097. }
  45098. }
  45099. }
  45100. return nextDate ? nextDifferences : prevDifferences
  45101. }
  45102. function isDateTimeStart(date, dateUnitInterval) {
  45103. var unitNumbers = [date.getMilliseconds(), date.getSeconds(), date.getMinutes(), date.getHours(), date.getDate(), date.getMonth()];
  45104. var unitIndex = dateUnitIntervals.indexOf(dateUnitInterval);
  45105. var i;
  45106. for (i = 0; i < unitIndex; i++) {
  45107. if (4 === i && 1 !== unitNumbers[i] || 4 !== i && 0 !== unitNumbers[i]) {
  45108. return false
  45109. }
  45110. }
  45111. return true
  45112. }
  45113. function resetDateUnitInterval(differences, intervalIndex) {
  45114. var dateUnitInterval = dateUnitIntervals[intervalIndex];
  45115. if (differences[dateUnitInterval]) {
  45116. differences[dateUnitInterval] = false;
  45117. differences.count--
  45118. }
  45119. }
  45120. function setDateUnitInterval(differences, intervalIndex) {
  45121. var dateUnitInterval = dateUnitIntervals[intervalIndex];
  45122. if (false === differences[dateUnitInterval]) {
  45123. differences[dateUnitInterval] = true;
  45124. differences.count++
  45125. }
  45126. }
  45127. function getNoZeroIndex(str) {
  45128. return str.length - parseInt(str).toString().length
  45129. }
  45130. function getTransitionTickIndex(ticks, value) {
  45131. var i;
  45132. var curDiff;
  45133. var minDiff;
  45134. var nearestTickIndex = 0;
  45135. minDiff = abs(value - ticks[0]);
  45136. for (i = 1; i < ticks.length; i++) {
  45137. curDiff = abs(value - ticks[i]);
  45138. if (curDiff < minDiff) {
  45139. minDiff = curDiff;
  45140. nearestTickIndex = i
  45141. }
  45142. }
  45143. return nearestTickIndex
  45144. }
  45145. function splitDecimalNumber(value) {
  45146. return value.toString().split(".")
  45147. }
  45148. function createFormat(type) {
  45149. var formatter;
  45150. if ((0, _type.isFunction)(type)) {
  45151. formatter = type;
  45152. type = null
  45153. }
  45154. return {
  45155. type: type,
  45156. formatter: formatter
  45157. }
  45158. }
  45159. function smartFormatter(tick, options) {
  45160. var tickInterval = options.tickInterval;
  45161. var tickIntervalIndex;
  45162. var tickIndex;
  45163. var actualIndex;
  45164. var stringTick = abs(tick).toString();
  45165. var precision = 0;
  45166. var typeFormat;
  45167. var offset = 0;
  45168. var separatedTickInterval;
  45169. var indexOfFormat = 0;
  45170. var indexOfTick = -1;
  45171. var datesDifferences;
  45172. var format = options.labelOptions.format;
  45173. var ticks = options.ticks;
  45174. var log10Tick;
  45175. var prevDateIndex;
  45176. var nextDateIndex;
  45177. var isLogarithmic = "logarithmic" === options.type;
  45178. if (1 === ticks.length && 0 === ticks.indexOf(tick) && !(0, _type.isDefined)(tickInterval)) {
  45179. tickInterval = abs(tick) >= 1 ? 1 : (0, _math.adjust)(1 - abs(tick), tick)
  45180. }
  45181. if (!(0, _type.isDefined)(format) && "discrete" !== options.type && tick && (10 === options.logarithmBase || !isLogarithmic)) {
  45182. if ("datetime" !== options.dataType && (0, _type.isDefined)(tickInterval)) {
  45183. if (ticks.length && ticks.indexOf(tick) === -1) {
  45184. indexOfTick = getTransitionTickIndex(ticks, tick);
  45185. tickInterval = (0, _math.adjust)(abs(tick - ticks[indexOfTick]), tick)
  45186. }
  45187. separatedTickInterval = splitDecimalNumber(tickInterval);
  45188. if (separatedTickInterval < 2) {
  45189. separatedTickInterval = splitDecimalNumber(tick)
  45190. }
  45191. if (isLogarithmic) {
  45192. log10Tick = (0, _utils.getAdjustedLog10)(abs(tick));
  45193. if (log10Tick > 0) {
  45194. typeFormat = formats[floor(log10Tick / 3)] || EXPONENTIAL
  45195. } else {
  45196. if (log10Tick < -4) {
  45197. typeFormat = EXPONENTIAL
  45198. } else {
  45199. precision = void 0
  45200. }
  45201. }
  45202. } else {
  45203. if (separatedTickInterval.length > 1 && !(0, _type.isExponential)(tickInterval)) {
  45204. precision = separatedTickInterval[1].length;
  45205. typeFormat = formats[indexOfFormat]
  45206. } else {
  45207. if ((0, _type.isExponential)(tickInterval) && (stringTick.indexOf(".") !== -1 || (0, _type.isExponential)(tick))) {
  45208. typeFormat = EXPONENTIAL;
  45209. if (!(0, _type.isExponential)(tick)) {
  45210. precision = abs(getNoZeroIndex(stringTick.split(".")[1]) - (0, _math.getExponent)(tickInterval) + 1)
  45211. } else {
  45212. precision = Math.max(abs((0, _math.getExponent)(tick) - (0, _math.getExponent)(tickInterval)), abs((0, _math.getPrecision)(tick) - (0, _math.getPrecision)(tickInterval)))
  45213. }
  45214. } else {
  45215. tickIntervalIndex = floor((0, _utils.getAdjustedLog10)(tickInterval));
  45216. actualIndex = tickIndex = floor((0, _utils.getAdjustedLog10)(abs(tick)));
  45217. if (tickIndex - tickIntervalIndex >= 2) {
  45218. actualIndex = tickIntervalIndex
  45219. }
  45220. indexOfFormat = floor(actualIndex / 3);
  45221. offset = 3 * indexOfFormat;
  45222. if (indexOfFormat < 5) {
  45223. if (tickIntervalIndex - offset === 2 && tickIndex >= 3) {
  45224. indexOfFormat++;
  45225. offset = 3 * indexOfFormat
  45226. }
  45227. typeFormat = formats[indexOfFormat]
  45228. } else {
  45229. typeFormat = formats[formats.length - 1]
  45230. }
  45231. if (offset > 0) {
  45232. separatedTickInterval = splitDecimalNumber(tickInterval / Math.pow(10, offset));
  45233. if (separatedTickInterval[1]) {
  45234. precision = separatedTickInterval[1].length
  45235. }
  45236. }
  45237. }
  45238. }
  45239. }
  45240. if (void 0 !== typeFormat || void 0 !== precision) {
  45241. format = {
  45242. type: typeFormat,
  45243. precision: precision
  45244. }
  45245. }
  45246. } else {
  45247. if ("datetime" === options.dataType) {
  45248. typeFormat = _date2.default.getDateFormatByTickInterval(tickInterval);
  45249. if (options.showTransition && ticks.length) {
  45250. indexOfTick = ticks.map(Number).indexOf(+tick);
  45251. if (1 === ticks.length && 0 === indexOfTick) {
  45252. typeFormat = _format_helper2.default.getDateFormatByTicks(ticks)
  45253. } else {
  45254. if (indexOfTick === -1) {
  45255. prevDateIndex = getTransitionTickIndex(ticks, tick)
  45256. } else {
  45257. prevDateIndex = 0 === indexOfTick ? ticks.length - 1 : indexOfTick - 1;
  45258. nextDateIndex = 0 === indexOfTick ? 1 : -1
  45259. }
  45260. datesDifferences = getDatesDifferences(ticks[prevDateIndex], tick, ticks[nextDateIndex], typeFormat);
  45261. typeFormat = _format_helper2.default.getDateFormatByDifferences(datesDifferences, typeFormat)
  45262. }
  45263. }
  45264. format = createFormat(typeFormat)
  45265. }
  45266. }
  45267. }
  45268. return _format(tick, format)
  45269. }
  45270. function getHighDiffFormat(diff) {
  45271. var stop = false;
  45272. for (var i in diff) {
  45273. if (true === diff[i] || "hour" === i || stop) {
  45274. diff[i] = false;
  45275. stop = true
  45276. } else {
  45277. if (false === diff[i]) {
  45278. diff[i] = true
  45279. }
  45280. }
  45281. }
  45282. return createFormat(_format_helper2.default.getDateFormatByDifferences(diff))
  45283. }
  45284. function getHighAndSelfDiffFormat(diff, interval) {
  45285. var stop = false;
  45286. for (var i in diff) {
  45287. if (stop) {
  45288. diff[i] = false
  45289. } else {
  45290. if (i === interval) {
  45291. stop = true
  45292. } else {
  45293. diff[i] = true
  45294. }
  45295. }
  45296. }
  45297. return createFormat(_format_helper2.default.getDateFormatByDifferences(diff))
  45298. }
  45299. function formatDateRange(startValue, endValue, tickInterval) {
  45300. var diff = getDatesDifferences(startValue, endValue);
  45301. var typeFormat = _date2.default.getDateFormatByTickInterval(tickInterval);
  45302. var diffFormatType = _format_helper2.default.getDateFormatByDifferences(diff, typeFormat);
  45303. var diffFormat = createFormat(diffFormatType);
  45304. var values = [];
  45305. if (tickInterval in diff) {
  45306. var rangeFormat = getHighAndSelfDiffFormat(getDatesDifferences(startValue, endValue), tickInterval);
  45307. var value = _format(startValue, rangeFormat);
  45308. if (value) {
  45309. values.push(value)
  45310. }
  45311. } else {
  45312. var _rangeFormat = getHighDiffFormat(getDatesDifferences(startValue, endValue));
  45313. var highValue = _format(startValue, _rangeFormat);
  45314. if (highValue) {
  45315. values.push(highValue)
  45316. }
  45317. values.push("".concat(_format(startValue, diffFormat), " - ").concat(_format(endValue, diffFormat)))
  45318. }
  45319. return values.join(", ")
  45320. }
  45321. function processDateInterval(interval) {
  45322. if ((0, _type.isObject)(interval)) {
  45323. var dateUnits = Object.keys(interval);
  45324. var sum = dateUnits.reduce(function(sum, k) {
  45325. return interval[k] + sum
  45326. }, 0);
  45327. if (1 === sum) {
  45328. var dateUnit = dateUnits.filter(function(k) {
  45329. return 1 === interval[k]
  45330. })[0];
  45331. return dateUnit.slice(0, dateUnit.length - 1)
  45332. }
  45333. }
  45334. return interval
  45335. }
  45336. function formatRange(startValue, endValue, tickInterval, _ref) {
  45337. var dataType = _ref.dataType,
  45338. type = _ref.type,
  45339. logarithmBase = _ref.logarithmBase;
  45340. if ("discrete" === type) {
  45341. return ""
  45342. }
  45343. if ("datetime" === dataType) {
  45344. return formatDateRange(startValue, endValue, processDateInterval(tickInterval))
  45345. }
  45346. var formatOptions = {
  45347. ticks: [],
  45348. type: type,
  45349. dataType: dataType,
  45350. tickInterval: tickInterval,
  45351. logarithmBase: logarithmBase,
  45352. labelOptions: {}
  45353. };
  45354. return "".concat(smartFormatter(startValue, formatOptions), " - ").concat(smartFormatter(endValue, formatOptions))
  45355. }
  45356. },
  45357. /*!*********************************************************!*\
  45358. !*** ./artifacts/transpiled/viz/axes/tick_generator.js ***!
  45359. \*********************************************************/
  45360. /*! dynamic exports provided */
  45361. /*! all exports used */
  45362. function(module, exports, __webpack_require__) {
  45363. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  45364. var _date = __webpack_require__( /*! ../../core/utils/date */ 22);
  45365. var _date2 = _interopRequireDefault(_date);
  45366. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  45367. var _math = __webpack_require__( /*! ../../core/utils/math */ 28);
  45368. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  45369. function _interopRequireDefault(obj) {
  45370. return obj && obj.__esModule ? obj : {
  45371. "default": obj
  45372. }
  45373. }
  45374. function _slicedToArray(arr, i) {
  45375. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest()
  45376. }
  45377. function _nonIterableRest() {
  45378. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  45379. }
  45380. function _unsupportedIterableToArray(o, minLen) {
  45381. if (!o) {
  45382. return
  45383. }
  45384. if ("string" === typeof o) {
  45385. return _arrayLikeToArray(o, minLen)
  45386. }
  45387. var n = Object.prototype.toString.call(o).slice(8, -1);
  45388. if ("Object" === n && o.constructor) {
  45389. n = o.constructor.name
  45390. }
  45391. if ("Map" === n || "Set" === n) {
  45392. return Array.from(o)
  45393. }
  45394. if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
  45395. return _arrayLikeToArray(o, minLen)
  45396. }
  45397. }
  45398. function _arrayLikeToArray(arr, len) {
  45399. if (null == len || len > arr.length) {
  45400. len = arr.length
  45401. }
  45402. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  45403. arr2[i] = arr[i]
  45404. }
  45405. return arr2
  45406. }
  45407. function _iterableToArrayLimit(arr, i) {
  45408. var _i = null == arr ? null : "undefined" !== typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  45409. if (null == _i) {
  45410. return
  45411. }
  45412. var _arr = [];
  45413. var _n = true;
  45414. var _d = false;
  45415. var _s, _e;
  45416. try {
  45417. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  45418. _arr.push(_s.value);
  45419. if (i && _arr.length === i) {
  45420. break
  45421. }
  45422. }
  45423. } catch (err) {
  45424. _d = true;
  45425. _e = err
  45426. } finally {
  45427. try {
  45428. if (!_n && null != _i.return) {
  45429. _i.return()
  45430. }
  45431. } finally {
  45432. if (_d) {
  45433. throw _e
  45434. }
  45435. }
  45436. }
  45437. return _arr
  45438. }
  45439. function _arrayWithHoles(arr) {
  45440. if (Array.isArray(arr)) {
  45441. return arr
  45442. }
  45443. }
  45444. var convertDateUnitToMilliseconds = _date2.default.convertDateUnitToMilliseconds;
  45445. var dateToMilliseconds = _date2.default.dateToMilliseconds;
  45446. var math = Math;
  45447. var mathAbs = math.abs;
  45448. var mathFloor = math.floor;
  45449. var mathCeil = math.ceil;
  45450. var mathPow = math.pow;
  45451. var NUMBER_MULTIPLIERS = [1, 2, 2.5, 5];
  45452. var LOGARITHMIC_MULTIPLIERS = [1, 2, 3, 5];
  45453. var DATETIME_MULTIPLIERS = {
  45454. millisecond: [1, 2, 5, 10, 25, 50, 100, 250, 500],
  45455. second: [1, 2, 3, 5, 10, 15, 20, 30],
  45456. minute: [1, 2, 3, 5, 10, 15, 20, 30],
  45457. hour: [1, 2, 3, 4, 6, 8, 12],
  45458. day: [1, 2],
  45459. week: [1, 2],
  45460. month: [1, 2, 3, 6]
  45461. };
  45462. var DATETIME_MULTIPLIERS_WITH_BIG_WEEKEND = (0, _extend.extend)({}, DATETIME_MULTIPLIERS, {
  45463. day: [1]
  45464. });
  45465. var DATETIME_MINOR_MULTIPLIERS = {
  45466. millisecond: [1, 2, 5, 10, 25, 50, 100, 250, 500],
  45467. second: [1, 2, 3, 5, 10, 15, 20, 30],
  45468. minute: [1, 2, 3, 5, 10, 15, 20, 30],
  45469. hour: [1, 2, 3, 4, 6, 8, 12],
  45470. day: [1, 2, 3, 7, 14],
  45471. month: [1, 2, 3, 6]
  45472. };
  45473. var MINOR_DELIMITERS = [2, 4, 5, 8, 10];
  45474. var VISIBILITY_DELIMITER = 3;
  45475. var MINUTE = 6e4;
  45476. function dummyGenerator(options) {
  45477. return function(data, screenDelta, tickInterval, forceTickInterval) {
  45478. var count = mathFloor(screenDelta / options.axisDivisionFactor);
  45479. count = count < 1 ? 1 : count;
  45480. var interval = screenDelta / count;
  45481. return {
  45482. ticks: interval > 0 ? Array.apply(null, new Array(count + 1)).map(function(_, i) {
  45483. return interval * i
  45484. }) : [],
  45485. tickInterval: interval
  45486. }
  45487. }
  45488. }
  45489. function discreteGenerator(options) {
  45490. return function(data, screenDelta, tickInterval, forceTickInterval) {
  45491. var categories = (0, _utils.getCategoriesInfo)(data.categories, data.min, data.max).categories;
  45492. return {
  45493. ticks: categories,
  45494. tickInterval: mathCeil(categories.length * options.axisDivisionFactor / screenDelta)
  45495. }
  45496. }
  45497. }
  45498. var getValue = function(value) {
  45499. return value
  45500. };
  45501. var getLogValue = function(base) {
  45502. return function(value) {
  45503. return (0, _utils.getLog)(value, base)
  45504. }
  45505. };
  45506. var raiseTo = function(base) {
  45507. return function(value) {
  45508. return mathPow(base, value)
  45509. }
  45510. };
  45511. var correctValueByInterval = function(post, round, getValue) {
  45512. return function(value, interval) {
  45513. return (0, _math.adjust)(post(round((0, _math.adjust)(getValue(value) / interval)) * interval))
  45514. }
  45515. };
  45516. function correctMinValueByEndOnTick(floorFunc, ceilFunc, resolveEndOnTick, endOnTick) {
  45517. if ((0, _type.isDefined)(endOnTick)) {
  45518. return endOnTick ? floorFunc : ceilFunc
  45519. }
  45520. return function(value, interval, businessViewInfo, forceEndOnTick) {
  45521. var floorTickValue = floorFunc(value, interval);
  45522. if (value - floorTickValue === 0 || !(0, _type.isDefined)(businessViewInfo) || resolveEndOnTick(value, floorTickValue, interval, businessViewInfo) || forceEndOnTick) {
  45523. return floorTickValue
  45524. }
  45525. return ceilFunc(value, interval)
  45526. }
  45527. }
  45528. function resolveEndOnTick(curValue, tickValue, interval, businessViewInfo) {
  45529. var prevTickDataDiff = interval - mathAbs(tickValue - curValue);
  45530. var intervalCount = math.max(mathCeil(businessViewInfo.businessDelta / interval), 2);
  45531. var businessRatio = businessViewInfo.screenDelta / (intervalCount * interval);
  45532. var potentialTickScreenDiff = math.round(businessRatio * prevTickDataDiff);
  45533. var delimiterFactor = (0, _utils.getLog)(businessRatio * interval / businessViewInfo.axisDivisionFactor, 2) + 1;
  45534. var delimiterMultiplier = (businessViewInfo.isSpacedMargin ? 2 : 1) * delimiterFactor;
  45535. var screenDelimiter = math.round(VISIBILITY_DELIMITER * delimiterMultiplier);
  45536. return businessViewInfo.businessDelta > businessViewInfo.interval && potentialTickScreenDiff >= screenDelimiter
  45537. }
  45538. function resolveEndOnTickLog(base) {
  45539. return function(curValue, tickValue, interval, businessViewInfo) {
  45540. return resolveEndOnTick((0, _utils.getLog)(curValue, base), (0, _utils.getLog)(tickValue, base), interval, businessViewInfo)
  45541. }
  45542. }
  45543. function resolveEndOnTickDate(curValue, tickValue, interval, businessViewInfo) {
  45544. return resolveEndOnTick(curValue.valueOf(), tickValue.valueOf(), dateToMilliseconds(interval), businessViewInfo)
  45545. }
  45546. function resolveExtraTickForHiddenDataPoint(checkDataVisibility, extremum, tick, businessViewInfo, isMin) {
  45547. var screenRatio = businessViewInfo.screenDelta / businessViewInfo.businessDelta;
  45548. var extDir = isMin ? 1 : -1;
  45549. var tickDir = isMin ? -1 : 1;
  45550. return checkDataVisibility && screenRatio * (extremum * extDir + tick * tickDir) < VISIBILITY_DELIMITER
  45551. }
  45552. function resolveExtraTickForHiddenDataPointLog(base) {
  45553. return function(checkDataVisibility, extremum, tick, businessViewInfo, isMin) {
  45554. return resolveExtraTickForHiddenDataPoint(checkDataVisibility, (0, _utils.getLog)(extremum, base), (0, _utils.getLog)(tick, base), businessViewInfo, isMin)
  45555. }
  45556. }
  45557. function resolveExtraTickForHiddenDataPointDate(checkDataVisibility, extremum, tick, businessViewInfo, isMin) {
  45558. return resolveExtraTickForHiddenDataPoint(checkDataVisibility, extremum.valueOf(), tick.valueOf(), businessViewInfo, isMin)
  45559. }
  45560. function getBusinessDelta(data, breaks) {
  45561. var spacing = 0;
  45562. if (breaks) {
  45563. spacing = breaks.reduce(function(prev, item) {
  45564. return prev + (item.to - item.from)
  45565. }, 0)
  45566. }
  45567. return mathAbs(data.max - data.min - spacing)
  45568. }
  45569. function getBusinessDeltaLog(base) {
  45570. var getLog = getLogValue(base);
  45571. return function(data, breaks) {
  45572. var spacing = 0;
  45573. if (breaks) {
  45574. spacing = breaks.reduce(function(prev, item) {
  45575. return prev + mathAbs(getLog(item.to / item.from))
  45576. }, 0)
  45577. }
  45578. return mathCeil(mathAbs(getLog(data.max / data.min)) - spacing)
  45579. }
  45580. }
  45581. function getIntervalByFactor(businessDelta, screenDelta, axisDivisionFactor, addTickCount) {
  45582. var count = screenDelta / axisDivisionFactor - (addTickCount || 0);
  45583. count = count < 1 ? 1 : count;
  45584. return businessDelta / count
  45585. }
  45586. function getMultiplierFactor(interval, factorDelta) {
  45587. return mathPow(10, mathFloor((0, _utils.getLog)(interval, 10)) + (factorDelta || 0))
  45588. }
  45589. function calculateTickInterval(businessDelta, screenDelta, tickInterval, forceTickInterval, axisDivisionFactor, multipliers, allowDecimals, addTickCount, _, minTickInterval) {
  45590. var interval = getIntervalByFactor(businessDelta, screenDelta, axisDivisionFactor, addTickCount);
  45591. var result = 1;
  45592. var onlyIntegers = false === allowDecimals;
  45593. if (!forceTickInterval || !tickInterval) {
  45594. if (interval >= 1 || !onlyIntegers && interval > 0) {
  45595. result = adjustInterval(interval, multipliers, onlyIntegers)
  45596. }
  45597. if (!tickInterval || !forceTickInterval && tickInterval < result) {
  45598. tickInterval = result
  45599. }
  45600. }
  45601. if (!forceTickInterval && minTickInterval) {
  45602. minTickInterval = adjustInterval(minTickInterval, multipliers, onlyIntegers);
  45603. if (minTickInterval > tickInterval) {
  45604. tickInterval = minTickInterval
  45605. }
  45606. }
  45607. return tickInterval
  45608. }
  45609. function adjustInterval(interval, multipliers, onlyIntegers) {
  45610. var factor = getMultiplierFactor(interval, -1);
  45611. var result = 1;
  45612. multipliers = multipliers || NUMBER_MULTIPLIERS;
  45613. if (interval > 0) {
  45614. interval /= factor;
  45615. result = multipliers.concat(10 * multipliers[0]).map(function(m) {
  45616. return 10 * m
  45617. }).reduce(function(r, m) {
  45618. if (.1 === factor && onlyIntegers && 25 === m) {
  45619. return r
  45620. }
  45621. return r < interval ? m : r
  45622. }, 0);
  45623. result = (0, _math.adjust)(result * factor, factor)
  45624. }
  45625. return result
  45626. }
  45627. function calculateMinorTickInterval(businessDelta, screenDelta, tickInterval, axisDivisionFactor) {
  45628. var interval = getIntervalByFactor(businessDelta, screenDelta, axisDivisionFactor);
  45629. return tickInterval || MINOR_DELIMITERS.reduce(function(r, d) {
  45630. var cur = businessDelta / d;
  45631. return cur >= interval ? cur : r
  45632. }, 0)
  45633. }
  45634. function getCalculateTickIntervalLog(skipCalculationLimits) {
  45635. return function(businessDelta, screenDelta, tickInterval, forceTickInterval, axisDivisionFactor, multipliers, allowDecimals, _, __, minTickInterval) {
  45636. var interval = getIntervalByFactor(businessDelta, screenDelta, axisDivisionFactor);
  45637. var result = 0;
  45638. var adjustInterval = getAdjustIntervalLog(skipCalculationLimits);
  45639. if (!forceTickInterval || !tickInterval) {
  45640. if (interval > 0) {
  45641. result = adjustInterval(interval, multipliers)
  45642. }
  45643. if (!tickInterval || !forceTickInterval && tickInterval < result) {
  45644. tickInterval = result
  45645. }
  45646. }
  45647. if (!forceTickInterval && minTickInterval) {
  45648. minTickInterval = adjustInterval(minTickInterval, multipliers);
  45649. if (minTickInterval > tickInterval) {
  45650. tickInterval = minTickInterval
  45651. }
  45652. }
  45653. return tickInterval
  45654. }
  45655. }
  45656. function getAdjustIntervalLog(skipCalculationLimits) {
  45657. return function(interval, multipliers) {
  45658. var factor = getMultiplierFactor(interval);
  45659. multipliers = multipliers || LOGARITHMIC_MULTIPLIERS;
  45660. if (!skipCalculationLimits && factor < 1) {
  45661. factor = 1
  45662. }
  45663. return multipliers.concat(10 * multipliers[0]).reduce(function(r, m) {
  45664. return r < interval ? m * factor : r
  45665. }, 0)
  45666. }
  45667. }
  45668. function getDataTimeMultipliers(gapSize) {
  45669. if (gapSize && gapSize > 2) {
  45670. return DATETIME_MULTIPLIERS_WITH_BIG_WEEKEND
  45671. } else {
  45672. return DATETIME_MULTIPLIERS
  45673. }
  45674. }
  45675. function numbersReducer(interval, key) {
  45676. return function(r, m) {
  45677. if (!r && interval <= convertDateUnitToMilliseconds(key, m)) {
  45678. r = {};
  45679. r[key + "s"] = m
  45680. }
  45681. return r
  45682. }
  45683. }
  45684. function yearsReducer(interval, factor) {
  45685. return function(r, m) {
  45686. var years = factor * m;
  45687. if (!r && interval <= convertDateUnitToMilliseconds("year", years) && 2.5 !== years) {
  45688. r = {
  45689. years: years
  45690. }
  45691. }
  45692. return r
  45693. }
  45694. }
  45695. function calculateTickIntervalDateTime(businessDelta, screenDelta, tickInterval, forceTickInterval, axisDivisionFactor, multipliers, allowDecimals, addTickCount, gapSize, minTickInterval) {
  45696. if (!forceTickInterval || !tickInterval) {
  45697. var result = adjustIntervalDateTime(getIntervalByFactor(businessDelta, screenDelta, axisDivisionFactor), multipliers, null, gapSize);
  45698. if (!tickInterval || !forceTickInterval && dateToMilliseconds(tickInterval) <= dateToMilliseconds(result)) {
  45699. tickInterval = result
  45700. }
  45701. }
  45702. if (!forceTickInterval && minTickInterval) {
  45703. minTickInterval = adjustIntervalDateTime(minTickInterval, multipliers, null, gapSize);
  45704. if (dateToMilliseconds(minTickInterval) > dateToMilliseconds(tickInterval)) {
  45705. tickInterval = minTickInterval
  45706. }
  45707. }
  45708. return tickInterval
  45709. }
  45710. function adjustIntervalDateTime(interval, multipliers, _, gapSize) {
  45711. var result;
  45712. multipliers = multipliers || getDataTimeMultipliers(gapSize);
  45713. for (var key in multipliers) {
  45714. result = multipliers[key].reduce(numbersReducer(interval, key), result);
  45715. if (result) {
  45716. break
  45717. }
  45718. }
  45719. if (!result) {
  45720. for (var factor = 1;; factor *= 10) {
  45721. result = NUMBER_MULTIPLIERS.reduce(yearsReducer(interval, factor), result);
  45722. if (result) {
  45723. break
  45724. }
  45725. }
  45726. }
  45727. return result
  45728. }
  45729. function calculateMinorTickIntervalDateTime(businessDelta, screenDelta, tickInterval, axisDivisionFactor) {
  45730. return calculateTickIntervalDateTime(businessDelta, screenDelta, tickInterval, true, axisDivisionFactor, DATETIME_MINOR_MULTIPLIERS)
  45731. }
  45732. function getTickIntervalByCustomTicks(getValue, postProcess) {
  45733. return function(ticks) {
  45734. return ticks ? postProcess(mathAbs((0, _math.adjust)(getValue(ticks[1]) - getValue(ticks[0])))) || void 0 : void 0
  45735. }
  45736. }
  45737. function addInterval(value, interval, isNegative) {
  45738. return _date2.default.addInterval(value, interval, isNegative)
  45739. }
  45740. function addIntervalLog(base) {
  45741. return function(value, interval, isNegative) {
  45742. return raiseTo(base)(addInterval((0, _utils.getLog)(value, base), interval, isNegative))
  45743. }
  45744. }
  45745. function addIntervalDate(value, interval, isNegative) {
  45746. return addInterval(value, interval, isNegative)
  45747. }
  45748. function addIntervalWithBreaks(addInterval, breaks, correctValue) {
  45749. breaks = breaks.filter(function(b) {
  45750. return !b.gapSize
  45751. });
  45752. return function(value, interval, isNegative) {
  45753. var breakSize;
  45754. value = addInterval(value, interval, isNegative);
  45755. if (!breaks.every(function(item) {
  45756. if (value >= addInterval(item.from, interval) && addInterval(value, interval) < item.to) {
  45757. breakSize = item.to - item.from - 2 * (addInterval(item.from, interval) - item.from)
  45758. }
  45759. return !breakSize
  45760. })) {
  45761. value = correctValue(addInterval(value, breakSize), interval)
  45762. }
  45763. return value
  45764. }
  45765. }
  45766. function calculateTicks(addInterval, correctMinValue, adjustInterval, resolveEndOnTick, resolveExtraTickForHiddenDataPoint) {
  45767. return function(data, tickInterval, endOnTick, gaps, breaks, businessDelta, screenDelta, axisDivisionFactor, generateExtraTick) {
  45768. var correctTickValue = correctTickValueOnGapSize(addInterval, gaps);
  45769. var min = data.min;
  45770. var max = data.max;
  45771. var businessViewInfo = {
  45772. screenDelta: screenDelta,
  45773. businessDelta: businessDelta,
  45774. axisDivisionFactor: axisDivisionFactor,
  45775. isSpacedMargin: data.isSpacedMargin,
  45776. interval: tickInterval
  45777. };
  45778. var cur = correctMinValue(min, tickInterval, businessViewInfo);
  45779. var ticks = [];
  45780. if (breaks && breaks.length) {
  45781. addInterval = addIntervalWithBreaks(addInterval, breaks, correctMinValue)
  45782. }
  45783. if (cur > max) {
  45784. cur = correctMinValue(min, adjustInterval(businessDelta / 2), businessViewInfo);
  45785. if (cur > max) {
  45786. endOnTick = true;
  45787. cur = correctMinValue(min, tickInterval, businessViewInfo, endOnTick)
  45788. }
  45789. }
  45790. cur = correctTickValue(cur);
  45791. var prev;
  45792. while (cur < max && cur !== prev || generateExtraTick && cur <= max) {
  45793. ticks.push(cur);
  45794. prev = cur;
  45795. cur = correctTickValue(addInterval(cur, tickInterval))
  45796. }
  45797. if (endOnTick || cur - max === 0 || !(0, _type.isDefined)(endOnTick) && resolveEndOnTick(max, cur, tickInterval, businessViewInfo)) {
  45798. ticks.push(cur)
  45799. }
  45800. if (ticks.length > 0) {
  45801. if (ticks[0].valueOf() > 0 && resolveExtraTickForHiddenDataPoint(data.checkMinDataVisibility, min, ticks[0], businessViewInfo, true)) {
  45802. cur = addInterval(ticks[0], tickInterval, true);
  45803. ticks.unshift(cur)
  45804. } else {
  45805. if (ticks[ticks.length - 1].valueOf() < 0 && resolveExtraTickForHiddenDataPoint(data.checkMaxDataVisibility, max, ticks[ticks.length - 1], businessViewInfo, false)) {
  45806. cur = addInterval(ticks[ticks.length - 1], tickInterval);
  45807. ticks.push(cur)
  45808. }
  45809. }
  45810. }
  45811. return ticks
  45812. }
  45813. }
  45814. function calculateMinorTicks(updateTickInterval, addInterval, correctMinValue, correctTickValue, ceil) {
  45815. return function(min, max, majorTicks, minorTickInterval, tickInterval, breaks, maxCount) {
  45816. var factor = tickInterval / minorTickInterval;
  45817. var lastMajor = majorTicks[majorTicks.length - 1];
  45818. var firstMajor = majorTicks[0];
  45819. var tickBalance = maxCount - 1;
  45820. if (breaks && breaks.length) {
  45821. addInterval = addIntervalWithBreaks(addInterval, breaks, correctMinValue)
  45822. }
  45823. minorTickInterval = updateTickInterval(minorTickInterval, firstMajor, factor);
  45824. if (0 === minorTickInterval) {
  45825. return []
  45826. }
  45827. var cur = correctTickValue(correctMinValue(min, tickInterval, min), minorTickInterval);
  45828. var ticks = [];
  45829. while (cur < firstMajor && (!tickBalance || tickBalance > 0)) {
  45830. cur >= min && ticks.push(cur);
  45831. tickBalance--;
  45832. cur = addInterval(cur, minorTickInterval)
  45833. }
  45834. var middleTicks = majorTicks.reduce(function(r, tick) {
  45835. tickBalance = maxCount - 1;
  45836. if (null === r.prevTick) {
  45837. r.prevTick = tick;
  45838. return r
  45839. }
  45840. minorTickInterval = updateTickInterval(minorTickInterval, tick, factor);
  45841. var cur = correctTickValue(r.prevTick, minorTickInterval);
  45842. while (cur < tick && (!tickBalance || tickBalance > 0)) {
  45843. cur !== r.prevTick && r.minors.push(cur);
  45844. tickBalance--;
  45845. cur = addInterval(cur, minorTickInterval)
  45846. }
  45847. r.prevTick = tick;
  45848. return r
  45849. }, {
  45850. prevTick: null,
  45851. minors: []
  45852. });
  45853. ticks = ticks.concat(middleTicks.minors);
  45854. minorTickInterval = updateTickInterval(minorTickInterval, ceil(max, tickInterval, min), factor);
  45855. cur = correctTickValue(lastMajor, minorTickInterval);
  45856. var prev;
  45857. while (cur < max && cur !== prev) {
  45858. ticks.push(cur);
  45859. prev = cur;
  45860. cur = addInterval(cur, minorTickInterval)
  45861. }
  45862. if (lastMajor - max !== 0 && cur - max === 0) {
  45863. ticks.push(cur)
  45864. }
  45865. return ticks
  45866. }
  45867. }
  45868. function filterTicks(ticks, breaks) {
  45869. if (breaks.length) {
  45870. var result = breaks.reduce(function(result, b) {
  45871. var tmpTicks = [];
  45872. var i;
  45873. for (i = result[1]; i < ticks.length; i++) {
  45874. var tickValue = ticks[i];
  45875. if (tickValue < b.from) {
  45876. tmpTicks.push(tickValue)
  45877. }
  45878. if (tickValue >= b.to) {
  45879. break
  45880. }
  45881. }
  45882. return [result[0].concat(tmpTicks), i]
  45883. }, [
  45884. [], 0
  45885. ]);
  45886. return result[0].concat(ticks.slice(result[1]))
  45887. }
  45888. return ticks
  45889. }
  45890. function correctTickValueOnGapSize(addInterval, breaks) {
  45891. return function(value) {
  45892. var gapSize;
  45893. if (!breaks.every(function(item) {
  45894. if (value >= item.from && value < item.to) {
  45895. gapSize = item.gapSize
  45896. }
  45897. return !gapSize
  45898. })) {
  45899. value = addInterval(value, gapSize)
  45900. }
  45901. return value
  45902. }
  45903. }
  45904. function generator(options, getBusinessDelta, calculateTickInterval, calculateMinorTickInterval, getMajorTickIntervalByCustomTicks, getMinorTickIntervalByCustomTicks, convertTickInterval, calculateTicks, calculateMinorTicks, processScaleBreaks) {
  45905. function processCustomTicks(customTicks) {
  45906. return {
  45907. tickInterval: getMajorTickIntervalByCustomTicks(customTicks.majors),
  45908. ticks: customTicks.majors || [],
  45909. minorTickInterval: getMinorTickIntervalByCustomTicks(customTicks.minors),
  45910. minorTicks: customTicks.minors || []
  45911. }
  45912. }
  45913. function correctUserTickInterval(tickInterval, businessDelta, limit) {
  45914. if (tickInterval && businessDelta / convertTickInterval(tickInterval) >= limit + 1) {
  45915. options.incidentOccurred("W2003");
  45916. tickInterval = void 0
  45917. }
  45918. return tickInterval
  45919. }
  45920. function generateMajorTicks(ticks, data, businessDelta, screenDelta, tickInterval, forceTickInterval, customTicks, breaks) {
  45921. if (customTicks.majors) {
  45922. ticks.breaks = breaks;
  45923. return ticks
  45924. }
  45925. var gaps = breaks.filter(function(b) {
  45926. return b.gapSize
  45927. });
  45928. var majorTicks;
  45929. tickInterval = options.skipCalculationLimits ? tickInterval : correctUserTickInterval(tickInterval, businessDelta, screenDelta);
  45930. tickInterval = calculateTickInterval(businessDelta, screenDelta, tickInterval, forceTickInterval, options.axisDivisionFactor, options.numberMultipliers, options.allowDecimals, breaks.length, gaps[0] && gaps[0].gapSize.days, options.minTickInterval);
  45931. if (!options.skipTickGeneration) {
  45932. majorTicks = calculateTicks(data, tickInterval, options.endOnTick, gaps, breaks, businessDelta, screenDelta, options.axisDivisionFactor, options.generateExtraTick);
  45933. breaks = processScaleBreaks(breaks, majorTicks, tickInterval);
  45934. majorTicks = filterTicks(majorTicks, breaks);
  45935. ticks.breaks = breaks;
  45936. ticks.ticks = ticks.ticks.concat(majorTicks)
  45937. }
  45938. ticks.tickInterval = tickInterval;
  45939. return ticks
  45940. }
  45941. function generateMinorTicks(ticks, data, businessDelta, screenDelta, minorTickInterval, minorTickCount, customTicks) {
  45942. if (!options.calculateMinors) {
  45943. return ticks
  45944. }
  45945. if (customTicks.minors) {
  45946. return ticks
  45947. }
  45948. var minorBusinessDelta = convertTickInterval(ticks.tickInterval);
  45949. var minorScreenDelta = screenDelta * minorBusinessDelta / businessDelta;
  45950. var breaks = ticks.breaks;
  45951. if (!minorTickInterval && minorTickCount) {
  45952. minorTickInterval = getMinorTickIntervalByCustomTicks([minorBusinessDelta / (minorTickCount + 1), minorBusinessDelta / (minorTickCount + 1) * 2])
  45953. } else {
  45954. minorTickCount = void 0
  45955. }
  45956. minorTickInterval = correctUserTickInterval(minorTickInterval, minorBusinessDelta, minorScreenDelta);
  45957. minorTickInterval = calculateMinorTickInterval(minorBusinessDelta, minorScreenDelta, minorTickInterval, options.minorAxisDivisionFactor);
  45958. ticks.minorTicks = filterTicks(ticks.minorTicks.concat(calculateMinorTicks(data.min, data.max, ticks.ticks, minorTickInterval, ticks.tickInterval, breaks, minorTickCount)), breaks);
  45959. ticks.minorTickInterval = minorTickInterval;
  45960. return ticks
  45961. }
  45962. return function(data, screenDelta, tickInterval, forceTickInterval, customTicks, minorTickInterval, minorTickCount, breaks) {
  45963. customTicks = customTicks || {};
  45964. var businessDelta = getBusinessDelta(data, breaks);
  45965. var result = processCustomTicks(customTicks);
  45966. if (!isNaN(businessDelta)) {
  45967. if (0 === businessDelta && !customTicks.majors) {
  45968. result.ticks = [data.min]
  45969. } else {
  45970. result = generateMajorTicks(result, data, businessDelta, screenDelta, tickInterval, forceTickInterval, customTicks, breaks || []);
  45971. if (!options.skipTickGeneration && businessDelta > 0) {
  45972. result = generateMinorTicks(result, data, businessDelta, screenDelta, minorTickInterval, minorTickCount, customTicks)
  45973. }
  45974. }
  45975. }
  45976. return result
  45977. }
  45978. }
  45979. function getBaseTick(breakValue, _ref, interval, getValue) {
  45980. var _ref2 = _slicedToArray(_ref, 2),
  45981. tick = _ref2[0],
  45982. insideTick = _ref2[1];
  45983. if (!(0, _type.isDefined)(tick) || mathAbs(getValue(breakValue) - getValue(tick)) / interval > .25) {
  45984. if ((0, _type.isDefined)(insideTick)) {
  45985. tick = insideTick
  45986. } else {
  45987. if (!(0, _type.isDefined)(tick)) {
  45988. tick = breakValue
  45989. }
  45990. }
  45991. }
  45992. return tick
  45993. }
  45994. function getScaleBreaksProcessor(convertTickInterval, getValue, addCorrection) {
  45995. return function(breaks, ticks, tickInterval) {
  45996. var interval = convertTickInterval(tickInterval);
  45997. var correction = .5 * interval;
  45998. return breaks.reduce(function(result, b) {
  45999. var breakTicks = ticks.filter(function(tick) {
  46000. return tick <= b.from
  46001. });
  46002. var from = addCorrection(getBaseTick(b.from, [].concat(breakTicks[breakTicks.length - 1], ticks[breakTicks.length]), interval, getValue), correction);
  46003. breakTicks = ticks.filter(function(tick) {
  46004. return tick >= b.to
  46005. });
  46006. var to = addCorrection(getBaseTick(b.to, [].concat(breakTicks[0], ticks[ticks.length - breakTicks.length - 1]), interval, getValue), -correction);
  46007. if (getValue(to) - getValue(from) < interval && !b.gapSize) {
  46008. return result
  46009. }
  46010. if (b.gapSize) {
  46011. return result.concat([b])
  46012. }
  46013. return result.concat([{
  46014. from: from,
  46015. to: to,
  46016. cumulativeWidth: b.cumulativeWidth
  46017. }])
  46018. }, [])
  46019. }
  46020. }
  46021. function numericGenerator(options) {
  46022. var floor = correctValueByInterval(getValue, mathFloor, getValue);
  46023. var ceil = correctValueByInterval(getValue, mathCeil, getValue);
  46024. var calculateTickIntervalByCustomTicks = getTickIntervalByCustomTicks(getValue, getValue);
  46025. return generator(options, getBusinessDelta, calculateTickInterval, calculateMinorTickInterval, calculateTickIntervalByCustomTicks, calculateTickIntervalByCustomTicks, getValue, calculateTicks(addInterval, correctMinValueByEndOnTick(floor, ceil, resolveEndOnTick, options.endOnTick), adjustInterval, resolveEndOnTick, resolveExtraTickForHiddenDataPoint), calculateMinorTicks(getValue, addInterval, floor, addInterval, getValue), getScaleBreaksProcessor(getValue, getValue, function(value, correction) {
  46026. return value + correction
  46027. }))
  46028. }
  46029. function logarithmicGenerator(options) {
  46030. var base = options.logBase;
  46031. var raise = raiseTo(base);
  46032. var log = getLogValue(base);
  46033. var floor = correctValueByInterval(raise, mathFloor, log);
  46034. var ceil = correctValueByInterval(raise, mathCeil, log);
  46035. var ceilNumber = correctValueByInterval(getValue, mathCeil, getValue);
  46036. return generator(options, getBusinessDeltaLog(base), getCalculateTickIntervalLog(options.skipCalculationLimits), calculateMinorTickInterval, getTickIntervalByCustomTicks(log, getValue), getTickIntervalByCustomTicks(getValue, getValue), getValue, calculateTicks(addIntervalLog(base), correctMinValueByEndOnTick(floor, ceil, resolveEndOnTickLog(base), options.endOnTick), getAdjustIntervalLog(options.skipCalculationLimits), resolveEndOnTickLog(base), resolveExtraTickForHiddenDataPointLog(base)), calculateMinorTicks(function(_, tick, factor) {
  46037. return tick / factor
  46038. }, addInterval, floor, ceilNumber, ceil), getScaleBreaksProcessor(getValue, log, function(value, correction) {
  46039. return raise(log(value) + correction)
  46040. }))
  46041. }
  46042. function dateGenerator(options) {
  46043. function floor(value, interval) {
  46044. var floorNumber = correctValueByInterval(getValue, mathFloor, getValue);
  46045. var intervalObject = (0, _type.isString)(interval) ? _date2.default.getDateIntervalByString(interval.toLowerCase()) : interval;
  46046. var divider = dateToMilliseconds(interval);
  46047. if (intervalObject.days % 7 === 0 || interval.quarters) {
  46048. intervalObject = adjustIntervalDateTime(divider)
  46049. }
  46050. var correctDateWithUnitBeginning = function(v) {
  46051. return _date2.default.correctDateWithUnitBeginning(v, intervalObject, null, options.firstDayOfWeek)
  46052. };
  46053. var floorAtStartDate = function(v) {
  46054. return new Date(mathFloor((v.getTime() - v.getTimezoneOffset() * MINUTE) / divider) * divider + v.getTimezoneOffset() * MINUTE)
  46055. };
  46056. value = correctDateWithUnitBeginning(value);
  46057. if ("years" in intervalObject) {
  46058. value.setFullYear(floorNumber(value.getFullYear(), intervalObject.years, 0))
  46059. } else {
  46060. if ("quarters" in intervalObject) {
  46061. value = correctDateWithUnitBeginning(floorAtStartDate(value))
  46062. } else {
  46063. if ("months" in intervalObject) {
  46064. value.setMonth(floorNumber(value.getMonth(), intervalObject.months, 0))
  46065. } else {
  46066. if ("weeks" in intervalObject || "days" in intervalObject) {
  46067. value = correctDateWithUnitBeginning(floorAtStartDate(value))
  46068. } else {
  46069. if ("hours" in intervalObject) {
  46070. value.setHours(floorNumber(value.getHours(), intervalObject.hours, 0))
  46071. } else {
  46072. if ("minutes" in intervalObject) {
  46073. value.setMinutes(floorNumber(value.getMinutes(), intervalObject.minutes, 0))
  46074. } else {
  46075. if ("seconds" in intervalObject) {
  46076. value.setSeconds(floorNumber(value.getSeconds(), intervalObject.seconds, 0))
  46077. } else {
  46078. if ("milliseconds" in intervalObject) {
  46079. value = floorAtStartDate(value)
  46080. }
  46081. }
  46082. }
  46083. }
  46084. }
  46085. }
  46086. }
  46087. }
  46088. return value
  46089. }
  46090. function ceil(value, interval) {
  46091. var newValue = floor(value, interval);
  46092. while (value - newValue > 0) {
  46093. newValue = addIntervalDate(newValue, interval)
  46094. }
  46095. return newValue
  46096. }
  46097. var calculateTickIntervalByCustomTicks = getTickIntervalByCustomTicks(getValue, _date2.default.convertMillisecondsToDateUnits);
  46098. return generator(options, getBusinessDelta, calculateTickIntervalDateTime, calculateMinorTickIntervalDateTime, calculateTickIntervalByCustomTicks, calculateTickIntervalByCustomTicks, dateToMilliseconds, calculateTicks(addIntervalDate, correctMinValueByEndOnTick(floor, ceil, resolveEndOnTickDate, options.endOnTick), adjustIntervalDateTime, resolveEndOnTickDate, resolveExtraTickForHiddenDataPointDate), calculateMinorTicks(getValue, addIntervalDate, floor, addIntervalDate, getValue), getScaleBreaksProcessor(dateToMilliseconds, getValue, function(value, correction) {
  46099. return new Date(value.getTime() + correction)
  46100. }))
  46101. }
  46102. exports.tickGenerator = function(options) {
  46103. var result;
  46104. if (options.rangeIsEmpty) {
  46105. result = dummyGenerator(options)
  46106. } else {
  46107. if ("discrete" === options.axisType) {
  46108. result = discreteGenerator(options)
  46109. } else {
  46110. if ("logarithmic" === options.axisType) {
  46111. result = logarithmicGenerator(options)
  46112. } else {
  46113. if ("datetime" === options.dataType) {
  46114. result = dateGenerator(options)
  46115. } else {
  46116. result = numericGenerator(options)
  46117. }
  46118. }
  46119. }
  46120. }
  46121. return result
  46122. }
  46123. },
  46124. /*!***********************************************!*\
  46125. !*** ./artifacts/transpiled/viz/axes/tick.js ***!
  46126. \***********************************************/
  46127. /*! dynamic exports provided */
  46128. /*! all exports used */
  46129. function(module, exports, __webpack_require__) {
  46130. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  46131. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  46132. function getPathStyle(options) {
  46133. return {
  46134. stroke: options.color,
  46135. "stroke-width": options.width,
  46136. "stroke-opacity": options.opacity,
  46137. opacity: 1
  46138. }
  46139. }
  46140. function createTick(axis, renderer, tickOptions, gridOptions, skippedCategory, skipLabels, offset) {
  46141. var tickOffset = offset || axis._tickOffset;
  46142. var lineGroup = axis._axisLineGroup;
  46143. var elementsGroup = axis._axisElementsGroup;
  46144. var tickStyle = getPathStyle(tickOptions);
  46145. var gridStyle = getPathStyle(gridOptions);
  46146. var emptyStrRegExp = /^\s+$/;
  46147. var axisOptions = axis.getOptions();
  46148. var labelOptions = axisOptions.label;
  46149. var labelStyle = axis._textOptions;
  46150. function getLabelFontStyle(tick) {
  46151. var fontStyle = axis._textFontStyles;
  46152. var customizeColor = labelOptions.customizeColor;
  46153. if (customizeColor && customizeColor.call) {
  46154. fontStyle = extend({}, axis._textFontStyles, {
  46155. fill: customizeColor.call(tick, tick)
  46156. })
  46157. }
  46158. return fontStyle
  46159. }
  46160. function createLabelHint(tick, range) {
  46161. var labelHint = axis.formatHint(tick.value, labelOptions, range);
  46162. if (isDefined(labelHint) && "" !== labelHint) {
  46163. tick.label.setTitle(labelHint)
  46164. }
  46165. }
  46166. return function(value) {
  46167. var tick = {
  46168. value: value,
  46169. updateValue: function(newValue) {
  46170. this.value = value = newValue
  46171. },
  46172. initCoords: function() {
  46173. this.coords = axis._getTranslatedValue(value, tickOffset);
  46174. this.labelCoords = axis._getTranslatedValue(value)
  46175. },
  46176. saveCoords: function() {
  46177. this._storedCoords = this.coords;
  46178. this._storedLabelsCoords = this.labelCoords
  46179. },
  46180. drawMark: function(options) {
  46181. if (!tickOptions.visible || skippedCategory === value) {
  46182. return
  46183. }
  46184. if (axis.areCoordsOutsideAxis(this.coords)) {
  46185. return
  46186. }
  46187. if (this.mark) {
  46188. this.mark.append(lineGroup);
  46189. axis.sharp(this.mark, axis.getSharpDirectionByCoords(this.coords));
  46190. this.updateTickPosition(options)
  46191. } else {
  46192. this.mark = axis._createPathElement([], tickStyle, axis.getSharpDirectionByCoords(this.coords)).append(lineGroup);
  46193. this.updateTickPosition(options)
  46194. }
  46195. },
  46196. setSkippedCategory: function(category) {
  46197. skippedCategory = category
  46198. },
  46199. _updateLine: function(lineElement, settings, storedSettings, animate, isGridLine) {
  46200. if (!lineElement) {
  46201. return
  46202. }
  46203. if (null === settings.points || null === settings.r) {
  46204. lineElement.remove();
  46205. return
  46206. }
  46207. if (animate && storedSettings && null !== storedSettings.points) {
  46208. settings.opacity = 1;
  46209. lineElement.attr(storedSettings);
  46210. lineElement.animate(settings)
  46211. } else {
  46212. settings.opacity = animate ? 0 : 1;
  46213. lineElement.attr(settings);
  46214. animate && lineElement.animate({
  46215. opacity: 1
  46216. }, {
  46217. delay: .5,
  46218. partitionDuration: .5
  46219. })
  46220. }
  46221. this.coords.angle && axis._rotateTick(lineElement, this.coords, isGridLine)
  46222. },
  46223. updateTickPosition: function(options, animate) {
  46224. this._updateLine(this.mark, {
  46225. points: axis._getTickMarkPoints(tick.coords, tickOptions.length, options)
  46226. }, this._storedCoords && {
  46227. points: axis._getTickMarkPoints(tick._storedCoords, tickOptions.length, options)
  46228. }, animate, false)
  46229. },
  46230. drawLabel: function(range) {
  46231. var labelIsVisible = labelOptions.visible && !skipLabels && !axis.getTranslator().getBusinessRange().isEmpty() && !axis.areCoordsOutsideAxis(this.labelCoords);
  46232. if (!labelIsVisible) {
  46233. if (this.label) {
  46234. this.label.remove()
  46235. }
  46236. return
  46237. }
  46238. var text = axis.formatLabel(value, labelOptions, range);
  46239. if (this.label) {
  46240. this.label.attr({
  46241. text: text,
  46242. rotate: 0
  46243. }).append(elementsGroup);
  46244. createLabelHint(this, range);
  46245. this.updateLabelPosition();
  46246. return
  46247. }
  46248. if (isDefined(text) && "" !== text && !emptyStrRegExp.test(text)) {
  46249. this.label = renderer.text(text).css(getLabelFontStyle(this)).attr(labelStyle).data("chart-data-argument", this.value).append(elementsGroup);
  46250. this.updateLabelPosition();
  46251. createLabelHint(this, range)
  46252. }
  46253. },
  46254. fadeOutElements: function() {
  46255. var startSettings = {
  46256. opacity: 1
  46257. };
  46258. var endSettings = {
  46259. opacity: 0
  46260. };
  46261. var animationSettings = {
  46262. partitionDuration: .5
  46263. };
  46264. if (this.label) {
  46265. this._fadeOutLabel()
  46266. }
  46267. if (this.grid) {
  46268. this.grid.append(axis._axisGridGroup).attr(startSettings).animate(endSettings, animationSettings)
  46269. }
  46270. if (this.mark) {
  46271. this.mark.append(axis._axisLineGroup).attr(startSettings).animate(endSettings, animationSettings)
  46272. }
  46273. },
  46274. _fadeInLabel: function() {
  46275. var group = axis._renderer.g().attr({
  46276. opacity: 0
  46277. }).append(axis._axisElementsGroup).animate({
  46278. opacity: 1
  46279. }, {
  46280. delay: .5,
  46281. partitionDuration: .5
  46282. });
  46283. this.label.append(group)
  46284. },
  46285. _fadeOutLabel: function() {
  46286. var group = axis._renderer.g().attr({
  46287. opacity: 1
  46288. }).animate({
  46289. opacity: 0
  46290. }, {
  46291. partitionDuration: .5
  46292. }).append(axis._axisElementsGroup);
  46293. this.label.append(group)
  46294. },
  46295. updateLabelPosition: function(animate) {
  46296. if (!this.label) {
  46297. return
  46298. }
  46299. if (animate && this._storedLabelsCoords) {
  46300. this.label.attr({
  46301. x: this._storedLabelsCoords.x,
  46302. y: this._storedLabelsCoords.y
  46303. });
  46304. this.label.animate({
  46305. x: this.labelCoords.x,
  46306. y: this.labelCoords.y
  46307. })
  46308. } else {
  46309. this.label.attr({
  46310. x: this.labelCoords.x,
  46311. y: this.labelCoords.y
  46312. });
  46313. if (animate) {
  46314. this._fadeInLabel()
  46315. }
  46316. }
  46317. },
  46318. drawGrid: function(drawLine) {
  46319. if (gridOptions.visible && skippedCategory !== this.value) {
  46320. if (this.grid) {
  46321. this.grid.append(axis._axisGridGroup);
  46322. axis.sharp(this.grid, axis.getSharpDirectionByCoords(this.coords));
  46323. this.updateGridPosition()
  46324. } else {
  46325. this.grid = drawLine(this, gridStyle);
  46326. this.grid && this.grid.append(axis._axisGridGroup)
  46327. }
  46328. }
  46329. },
  46330. updateGridPosition: function(animate) {
  46331. this._updateLine(this.grid, axis._getGridPoints(tick.coords), this._storedCoords && axis._getGridPoints(this._storedCoords), animate, true)
  46332. },
  46333. removeLabel: function() {
  46334. this.label.remove();
  46335. this.label = null
  46336. }
  46337. };
  46338. return tick
  46339. }
  46340. }
  46341. exports.tick = createTick
  46342. },
  46343. /*!**************************************************!*\
  46344. !*** ./artifacts/transpiled/viz/axes/xy_axes.js ***!
  46345. \**************************************************/
  46346. /*! dynamic exports provided */
  46347. /*! all exports used */
  46348. function(module, exports, __webpack_require__) {
  46349. var _range = __webpack_require__( /*! ../translators/range */ 108);
  46350. var _range2 = _interopRequireDefault(_range);
  46351. var _format_helper = __webpack_require__( /*! ../../format_helper */ 64);
  46352. var _date = __webpack_require__( /*! ../../core/utils/date */ 22);
  46353. var _date2 = _interopRequireDefault(_date);
  46354. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  46355. var _datetime_breaks = __webpack_require__( /*! ./datetime_breaks */ 783);
  46356. var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
  46357. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  46358. var _utils2 = _interopRequireDefault(_utils);
  46359. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  46360. var _axes_constants = __webpack_require__( /*! ./axes_constants */ 248);
  46361. var _axes_constants2 = _interopRequireDefault(_axes_constants);
  46362. function _interopRequireDefault(obj) {
  46363. return obj && obj.__esModule ? obj : {
  46364. "default": obj
  46365. }
  46366. }
  46367. var getNextDateUnit = _date2.default.getNextDateUnit;
  46368. var correctDateWithUnitBeginning = _date2.default.correctDateWithUnitBeginning;
  46369. var _math = Math;
  46370. var _max = _math.max;
  46371. var TOP = _axes_constants2.default.top;
  46372. var BOTTOM = _axes_constants2.default.bottom;
  46373. var LEFT = _axes_constants2.default.left;
  46374. var RIGHT = _axes_constants2.default.right;
  46375. var CENTER = _axes_constants2.default.center;
  46376. var SCALE_BREAK_OFFSET = 3;
  46377. var RANGE_RATIO = .3;
  46378. var WAVED_LINE_CENTER = 2;
  46379. var WAVED_LINE_TOP = 0;
  46380. var WAVED_LINE_BOTTOM = 4;
  46381. var WAVED_LINE_LENGTH = 24;
  46382. var TICKS_CORRECTIONS = {
  46383. left: -1,
  46384. top: -1,
  46385. right: 0,
  46386. bottom: 0,
  46387. center: -.5
  46388. };
  46389. function prepareDatesDifferences(datesDifferences, tickInterval) {
  46390. var dateUnitInterval;
  46391. var i;
  46392. if ("week" === tickInterval) {
  46393. tickInterval = "day"
  46394. }
  46395. if ("quarter" === tickInterval) {
  46396. tickInterval = "month"
  46397. }
  46398. if (datesDifferences[tickInterval]) {
  46399. for (i = 0; i < _date2.default.dateUnitIntervals.length; i++) {
  46400. dateUnitInterval = _date2.default.dateUnitIntervals[i];
  46401. if (datesDifferences[dateUnitInterval]) {
  46402. datesDifferences[dateUnitInterval] = false;
  46403. datesDifferences.count--
  46404. }
  46405. if (dateUnitInterval === tickInterval) {
  46406. break
  46407. }
  46408. }
  46409. }
  46410. }
  46411. function sortingBreaks(breaks) {
  46412. return breaks.sort(function(a, b) {
  46413. return a.from - b.from
  46414. })
  46415. }
  46416. function filterBreaks(breaks, viewport, breakStyle) {
  46417. var minVisible = viewport.minVisible;
  46418. var maxVisible = viewport.maxVisible;
  46419. var breakSize = breakStyle ? breakStyle.width : 0;
  46420. return breaks.reduce(function(result, currentBreak) {
  46421. var from = currentBreak.from;
  46422. var to = currentBreak.to;
  46423. var lastResult = result[result.length - 1];
  46424. var newBreak;
  46425. if (!(0, _type.isDefined)(from) || !(0, _type.isDefined)(to)) {
  46426. return result
  46427. }
  46428. if (from > to) {
  46429. to = [from, from = to][0]
  46430. }
  46431. if (result.length && from < lastResult.to) {
  46432. if (to > lastResult.to) {
  46433. lastResult.to = to > maxVisible ? maxVisible : to;
  46434. if (lastResult.gapSize) {
  46435. lastResult.gapSize = void 0;
  46436. lastResult.cumulativeWidth += breakSize
  46437. }
  46438. }
  46439. } else {
  46440. if ((from >= minVisible && from < maxVisible || to <= maxVisible && to > minVisible) && to - from < maxVisible - minVisible) {
  46441. from = from >= minVisible ? from : minVisible;
  46442. to = to <= maxVisible ? to : maxVisible;
  46443. newBreak = {
  46444. from: from,
  46445. to: to,
  46446. cumulativeWidth: (lastResult ? lastResult.cumulativeWidth : 0) + breakSize
  46447. };
  46448. if (currentBreak.gapSize) {
  46449. newBreak.gapSize = _date2.default.convertMillisecondsToDateUnits(to - from);
  46450. newBreak.cumulativeWidth = lastResult ? lastResult.cumulativeWidth : 0
  46451. }
  46452. result.push(newBreak)
  46453. }
  46454. }
  46455. return result
  46456. }, [])
  46457. }
  46458. function getMarkerDates(min, max, markerInterval) {
  46459. var origMin = min;
  46460. var dates;
  46461. min = correctDateWithUnitBeginning(min, markerInterval);
  46462. max = correctDateWithUnitBeginning(max, markerInterval);
  46463. dates = _date2.default.getSequenceByInterval(min, max, markerInterval);
  46464. if (dates.length && origMin > dates[0]) {
  46465. dates = dates.slice(1)
  46466. }
  46467. return dates
  46468. }
  46469. function getStripHorizontalAlignmentPosition(alignment) {
  46470. var position = "start";
  46471. if ("center" === alignment) {
  46472. position = "center"
  46473. }
  46474. if ("right" === alignment) {
  46475. position = "end"
  46476. }
  46477. return position
  46478. }
  46479. function getStripVerticalAlignmentPosition(alignment) {
  46480. var position = "start";
  46481. if ("center" === alignment) {
  46482. position = "center"
  46483. }
  46484. if ("bottom" === alignment) {
  46485. position = "end"
  46486. }
  46487. return position
  46488. }
  46489. function getMarkerInterval(tickInterval) {
  46490. var markerInterval = getNextDateUnit(tickInterval);
  46491. if ("quarter" === markerInterval) {
  46492. markerInterval = getNextDateUnit(markerInterval)
  46493. }
  46494. return markerInterval
  46495. }
  46496. function getMarkerFormat(curDate, prevDate, tickInterval, markerInterval) {
  46497. var format = markerInterval;
  46498. var datesDifferences = prevDate && _date2.default.getDatesDifferences(prevDate, curDate);
  46499. if (prevDate && "year" !== tickInterval) {
  46500. prepareDatesDifferences(datesDifferences, tickInterval);
  46501. format = (0, _format_helper.getDateFormatByDifferences)(datesDifferences)
  46502. }
  46503. return format
  46504. }
  46505. function getMaxSide(act, boxes) {
  46506. return boxes.reduce(function(prevValue, box) {
  46507. return _max(prevValue, act(box))
  46508. }, 0)
  46509. }
  46510. function getDistanceByAngle(bBox, rotationAngle) {
  46511. rotationAngle = _math.abs(rotationAngle);
  46512. rotationAngle = rotationAngle % 180 >= 90 ? 90 - rotationAngle % 90 : rotationAngle % 90;
  46513. var a = rotationAngle * (_math.PI / 180);
  46514. if (a >= _math.atan(bBox.height / bBox.width)) {
  46515. return bBox.height / _math.abs(_math.sin(a))
  46516. } else {
  46517. return bBox.width
  46518. }
  46519. }
  46520. function getMaxConstantLinePadding(constantLines) {
  46521. return constantLines.reduce(function(padding, options) {
  46522. return _max(padding, options.paddingTopBottom)
  46523. }, 0)
  46524. }
  46525. function getConstantLineLabelMarginForVerticalAlignment(constantLines, alignment, labelHeight) {
  46526. return constantLines.some(function(options) {
  46527. return options.label.verticalAlignment === alignment
  46528. }) && labelHeight || 0
  46529. }
  46530. function getLeftMargin(bBox) {
  46531. return _math.abs(bBox.x) || 0
  46532. }
  46533. function getRightMargin(bBox) {
  46534. return _math.abs(bBox.width - _math.abs(bBox.x)) || 0
  46535. }
  46536. function generateRangesOnPoints(points, edgePoints, getRange) {
  46537. var i;
  46538. var length;
  46539. var maxRange = null;
  46540. var ranges = [];
  46541. var curValue;
  46542. var prevValue;
  46543. var curRange;
  46544. for (i = 1, length = points.length; i < length; i++) {
  46545. curValue = points[i];
  46546. prevValue = points[i - 1];
  46547. curRange = getRange(curValue, prevValue);
  46548. if (edgePoints.indexOf(curValue) >= 0) {
  46549. if (!maxRange || curRange > maxRange.length) {
  46550. maxRange = {
  46551. start: curValue,
  46552. end: prevValue,
  46553. length: curRange
  46554. }
  46555. }
  46556. } else {
  46557. if (maxRange && curRange < maxRange.length) {
  46558. ranges.push(maxRange)
  46559. } else {
  46560. ranges.push({
  46561. start: curValue,
  46562. end: prevValue,
  46563. length: curRange
  46564. })
  46565. }
  46566. maxRange = null
  46567. }
  46568. }
  46569. if (maxRange) {
  46570. ranges.push(maxRange)
  46571. }
  46572. return ranges
  46573. }
  46574. function generateAutoBreaks(_ref, series, _ref2) {
  46575. var logarithmBase = _ref.logarithmBase,
  46576. type = _ref.type,
  46577. maxAutoBreakCount = _ref.maxAutoBreakCount;
  46578. var minVisible = _ref2.minVisible,
  46579. maxVisible = _ref2.maxVisible;
  46580. var breaks = [];
  46581. var getRange = "logarithmic" === type ? function(min, max) {
  46582. return _utils2.default.getLog(max / min, logarithmBase)
  46583. } : function(min, max) {
  46584. return max - min
  46585. };
  46586. var visibleRange = getRange(minVisible, maxVisible);
  46587. var points = series.reduce(function(result, s) {
  46588. var points = s.getPointsInViewPort();
  46589. result[0] = result[0].concat(points[0]);
  46590. result[1] = result[1].concat(points[1]);
  46591. return result
  46592. }, [
  46593. [],
  46594. []
  46595. ]);
  46596. var sortedAllPoints = points[0].concat(points[1]).sort(function(a, b) {
  46597. return b - a
  46598. });
  46599. var edgePoints = points[1].filter(function(p) {
  46600. return points[0].indexOf(p) < 0
  46601. });
  46602. var minDiff = RANGE_RATIO * visibleRange;
  46603. var ranges = generateRangesOnPoints(sortedAllPoints, edgePoints, getRange).sort(function(a, b) {
  46604. return b.length - a.length
  46605. });
  46606. var epsilon = _math.min.apply(null, ranges.map(function(r) {
  46607. return r.length
  46608. })) / 1e3;
  46609. var _maxAutoBreakCount = (0, _type.isDefined)(maxAutoBreakCount) ? _math.min(maxAutoBreakCount, ranges.length) : ranges.length;
  46610. for (var i = 0; i < _maxAutoBreakCount; i++) {
  46611. if (ranges[i].length >= minDiff) {
  46612. if (visibleRange <= ranges[i].length) {
  46613. break
  46614. }
  46615. visibleRange -= ranges[i].length;
  46616. if (visibleRange > epsilon || visibleRange < -epsilon) {
  46617. breaks.push({
  46618. from: ranges[i].start,
  46619. to: ranges[i].end
  46620. });
  46621. minDiff = RANGE_RATIO * visibleRange
  46622. }
  46623. } else {
  46624. break
  46625. }
  46626. }
  46627. sortingBreaks(breaks);
  46628. return breaks
  46629. }
  46630. module.exports = {
  46631. linear: {
  46632. _getStep: function(boxes, rotationAngle) {
  46633. var spacing = this._options.label.minSpacing;
  46634. var func = this._isHorizontal ? function(box) {
  46635. return box.width + spacing
  46636. } : function(box) {
  46637. return box.height
  46638. };
  46639. var maxLabelLength = getMaxSide(func, boxes);
  46640. if (rotationAngle) {
  46641. maxLabelLength = getDistanceByAngle({
  46642. width: maxLabelLength,
  46643. height: this._getMaxLabelHeight(boxes, 0)
  46644. }, rotationAngle)
  46645. }
  46646. return _axes_constants2.default.getTicksCountInRange(this._majorTicks, this._isHorizontal ? "x" : "y", maxLabelLength)
  46647. },
  46648. _getMaxLabelHeight: function(boxes, spacing) {
  46649. return getMaxSide(function(box) {
  46650. return box.height
  46651. }, boxes) + spacing
  46652. },
  46653. _validateOverlappingMode: function(mode, displayMode) {
  46654. if (this._isHorizontal && ("rotate" === displayMode || "stagger" === displayMode) || !this._isHorizontal) {
  46655. return _axes_constants2.default.validateOverlappingMode(mode)
  46656. }
  46657. return mode
  46658. },
  46659. _validateDisplayMode: function(mode) {
  46660. return this._isHorizontal ? mode : "standard"
  46661. },
  46662. getMarkerTrackers: function() {
  46663. return this._markerTrackers
  46664. },
  46665. _getSharpParam: function(opposite) {
  46666. return this._isHorizontal ^ opposite ? "h" : "v"
  46667. },
  46668. _createAxisElement: function() {
  46669. return this._renderer.path([], "line")
  46670. },
  46671. _updateAxisElementPosition: function() {
  46672. var axisCoord = this._axisPosition;
  46673. var canvas = this._getCanvasStartEnd();
  46674. this._axisElement.attr({
  46675. points: this._isHorizontal ? [canvas.start, axisCoord, canvas.end, axisCoord] : [axisCoord, canvas.start, axisCoord, canvas.end]
  46676. })
  46677. },
  46678. _getTranslatedCoord: function(value, offset) {
  46679. return this._translator.translate(value, offset)
  46680. },
  46681. _initAxisPositions: function() {
  46682. var that = this;
  46683. var position = that._options.position;
  46684. that._axisPosition = that._orthogonalPositions["top" === position || "left" === position ? "start" : "end"]
  46685. },
  46686. _getTickMarkPoints: function(coords, length, tickOptions) {
  46687. var isHorizontal = this._isHorizontal;
  46688. var options = this._options;
  46689. var tickStartCoord;
  46690. if ((0, _type.isDefined)(options.tickOrientation)) {
  46691. tickStartCoord = TICKS_CORRECTIONS[options.tickOrientation] * length
  46692. } else {
  46693. var shift = tickOptions.shift || 0;
  46694. if ("left" === options.position || "top" === options.position) {
  46695. shift = -shift
  46696. }
  46697. tickStartCoord = shift + this.getTickStartPositionShift(length)
  46698. }
  46699. return [coords.x + (isHorizontal ? 0 : tickStartCoord), coords.y + (isHorizontal ? tickStartCoord : 0), coords.x + (isHorizontal ? 0 : tickStartCoord + length), coords.y + (isHorizontal ? tickStartCoord + length : 0)]
  46700. },
  46701. getTickStartPositionShift: function(length) {
  46702. var options = this._options;
  46703. return length % 2 === 1 ? options.width % 2 === 0 && ("left" === options.position || "top" === options.position) || options.width % 2 === 1 && ("right" === options.position || "bottom" === options.position) ? Math.floor(-length / 2) : -Math.floor(length / 2) : -length / 2 + (options.width % 2 === 0 ? 0 : "bottom" === options.position || "right" === options.position ? -1 : 1)
  46704. },
  46705. _getTitleCoords: function() {
  46706. var that = this;
  46707. var horizontal = that._isHorizontal;
  46708. var x = that._axisPosition;
  46709. var y = that._axisPosition;
  46710. var align = that._options.title.alignment;
  46711. var canvas = that._getCanvasStartEnd();
  46712. var fromStartToEnd = horizontal || that._options.position === LEFT;
  46713. var canvasStart = fromStartToEnd ? canvas.start : canvas.end;
  46714. var canvasEnd = fromStartToEnd ? canvas.end : canvas.start;
  46715. var coord = align === LEFT ? canvasStart : align === RIGHT ? canvasEnd : canvas.start + (canvas.end - canvas.start) / 2;
  46716. if (horizontal) {
  46717. x = coord
  46718. } else {
  46719. y = coord
  46720. }
  46721. return {
  46722. x: x,
  46723. y: y
  46724. }
  46725. },
  46726. _drawTitleText: function(group, coords) {
  46727. var options = this._options;
  46728. var titleOptions = options.title;
  46729. var attrs = {
  46730. opacity: titleOptions.opacity,
  46731. align: titleOptions.alignment,
  46732. "class": titleOptions.cssClass
  46733. };
  46734. if (!titleOptions.text || !group) {
  46735. return
  46736. }
  46737. coords = coords || this._getTitleCoords();
  46738. if (!this._isHorizontal) {
  46739. attrs.rotate = options.position === LEFT ? 270 : 90
  46740. }
  46741. var text = this._renderer.text(titleOptions.text, coords.x, coords.y).css(_utils2.default.patchFontOptions(titleOptions.font)).attr(attrs).append(group);
  46742. this._checkTitleOverflow(text);
  46743. return text
  46744. },
  46745. _updateTitleCoords: function() {
  46746. this._title && this._title.element.attr(this._getTitleCoords())
  46747. },
  46748. _drawTitle: function() {
  46749. var title = this._drawTitleText(this._axisTitleGroup);
  46750. if (title) {
  46751. this._title = {
  46752. element: title
  46753. }
  46754. }
  46755. },
  46756. _measureTitle: function() {
  46757. if (this._title) {
  46758. if (this._title.bBox && !this._title.originalSize) {
  46759. this._title.originalSize = this._title.bBox
  46760. }
  46761. this._title.bBox = this._title.element.getBBox()
  46762. }
  46763. },
  46764. _drawDateMarker: function(date, options, range) {
  46765. var that = this;
  46766. var markerOptions = that._options.marker;
  46767. var invert = that._translator.getBusinessRange().invert;
  46768. var textIndent = markerOptions.width + markerOptions.textLeftIndent;
  46769. var pathElement;
  46770. if (null === options.x) {
  46771. return
  46772. }
  46773. if (!options.withoutStick) {
  46774. pathElement = that._renderer.path([options.x, options.y, options.x, options.y + markerOptions.separatorHeight], "line").attr({
  46775. "stroke-width": markerOptions.width,
  46776. stroke: markerOptions.color,
  46777. "stroke-opacity": markerOptions.opacity,
  46778. sharp: "h"
  46779. }).append(that._axisElementsGroup)
  46780. }
  46781. var text = String(that.formatLabel(date, options.labelOptions, range));
  46782. return {
  46783. date: date,
  46784. x: options.x,
  46785. y: options.y,
  46786. cropped: options.withoutStick,
  46787. label: that._renderer.text(text, options.x, options.y).css(_utils2.default.patchFontOptions(markerOptions.label.font)).append(that._axisElementsGroup),
  46788. line: pathElement,
  46789. getEnd: function() {
  46790. return this.x + (invert ? -1 : 1) * (textIndent + this.labelBBox.width)
  46791. },
  46792. setTitle: function() {
  46793. this.title = text
  46794. },
  46795. hideLabel: function() {
  46796. this.label.dispose();
  46797. this.label = null;
  46798. this.title = text
  46799. },
  46800. hide: function() {
  46801. if (pathElement) {
  46802. pathElement.dispose();
  46803. pathElement = null
  46804. }
  46805. this.label.dispose();
  46806. this.label = null;
  46807. this.hidden = true
  46808. }
  46809. }
  46810. },
  46811. _drawDateMarkers: function() {
  46812. var that = this;
  46813. var options = that._options;
  46814. var translator = that._translator;
  46815. var viewport = that._getViewportRange();
  46816. var minBound = viewport.minVisible;
  46817. var dateMarkers = [];
  46818. var dateMarker;
  46819. function draw(markerDate, format, withoutStick) {
  46820. return that._drawDateMarker(markerDate, {
  46821. x: translator.translate(markerDate),
  46822. y: markersAreaTop,
  46823. labelOptions: that._getLabelFormatOptions(format),
  46824. withoutStick: withoutStick
  46825. }, viewport)
  46826. }
  46827. if (viewport.isEmpty() || !options.marker.visible || "datetime" !== options.argumentType || "discrete" === options.type || that._majorTicks.length <= 1) {
  46828. return []
  46829. }
  46830. var markersAreaTop = that._axisPosition + options.marker.topIndent;
  46831. var tickInterval = _date2.default.getDateUnitInterval(this._tickInterval);
  46832. var markerInterval = getMarkerInterval(tickInterval);
  46833. var markerDates = getMarkerDates(minBound, viewport.maxVisible, markerInterval);
  46834. if (markerDates.length > 1 || 1 === markerDates.length && minBound < markerDates[0]) {
  46835. dateMarkers = markerDates.reduce(function(markers, curDate, i, dates) {
  46836. var marker = draw(curDate, getMarkerFormat(curDate, dates[i - 1] || minBound < curDate && minBound, tickInterval, markerInterval));
  46837. marker && markers.push(marker);
  46838. return markers
  46839. }, []);
  46840. if (minBound < markerDates[0]) {
  46841. dateMarker = draw(minBound, getMarkerFormat(minBound, markerDates[0], tickInterval, markerInterval), true);
  46842. dateMarker && dateMarkers.unshift(dateMarker)
  46843. }
  46844. }
  46845. return dateMarkers
  46846. },
  46847. _adjustDateMarkers: function(offset) {
  46848. offset = offset || 0;
  46849. var that = this;
  46850. var markerOptions = this._options.marker;
  46851. var textIndent = markerOptions.width + markerOptions.textLeftIndent;
  46852. var invert = this._translator.getBusinessRange().invert;
  46853. var canvas = that._getCanvasStartEnd();
  46854. var dateMarkers = this._dateMarkers;
  46855. if (!dateMarkers.length) {
  46856. return offset
  46857. }
  46858. if (dateMarkers[0].cropped) {
  46859. if (!this._checkMarkersPosition(invert, dateMarkers[1], dateMarkers[0])) {
  46860. dateMarkers[0].hideLabel()
  46861. }
  46862. }
  46863. var prevDateMarker;
  46864. dateMarkers.forEach(function(marker, i, markers) {
  46865. if (marker.cropped) {
  46866. return
  46867. }
  46868. if (invert ? marker.getEnd() < canvas.end : marker.getEnd() > canvas.end) {
  46869. marker.hideLabel()
  46870. } else {
  46871. if (that._checkMarkersPosition(invert, marker, prevDateMarker)) {
  46872. prevDateMarker = marker
  46873. } else {
  46874. marker.hide()
  46875. }
  46876. }
  46877. });
  46878. this._dateMarkers.forEach(function(marker) {
  46879. if (marker.label) {
  46880. var labelBBox = marker.labelBBox;
  46881. var dy = marker.y + markerOptions.textTopIndent - labelBBox.y;
  46882. marker.label.attr({
  46883. translateX: invert ? marker.x - textIndent - labelBBox.x - labelBBox.width : marker.x + textIndent - labelBBox.x,
  46884. translateY: dy + offset
  46885. })
  46886. }
  46887. if (marker.line) {
  46888. marker.line.attr({
  46889. translateY: offset
  46890. })
  46891. }
  46892. });
  46893. that._initializeMarkersTrackers(offset);
  46894. return offset + markerOptions.topIndent + markerOptions.separatorHeight
  46895. },
  46896. _checkMarkersPosition: function(invert, dateMarker, prevDateMarker) {
  46897. if (void 0 === prevDateMarker) {
  46898. return true
  46899. }
  46900. return invert ? dateMarker.x < prevDateMarker.getEnd() : dateMarker.x > prevDateMarker.getEnd()
  46901. },
  46902. _initializeMarkersTrackers: function(offset) {
  46903. var that = this;
  46904. var separatorHeight = that._options.marker.separatorHeight;
  46905. var renderer = that._renderer;
  46906. var businessRange = this._translator.getBusinessRange();
  46907. var canvas = that._getCanvasStartEnd();
  46908. var group = that._axisElementsGroup;
  46909. that._markerTrackers = this._dateMarkers.filter(function(marker) {
  46910. return !marker.hidden
  46911. }).map(function(marker, i, markers) {
  46912. var nextMarker = markers[i + 1] || {
  46913. x: canvas.end,
  46914. date: businessRange.max
  46915. };
  46916. var x = marker.x;
  46917. var y = marker.y + offset;
  46918. var markerTracker = renderer.path([x, y, x, y + separatorHeight, nextMarker.x, y + separatorHeight, nextMarker.x, y, x, y], "area").attr({
  46919. "stroke-width": 1,
  46920. stroke: "grey",
  46921. fill: "grey",
  46922. opacity: 1e-4
  46923. }).append(group);
  46924. markerTracker.data("range", {
  46925. startValue: marker.date,
  46926. endValue: nextMarker.date
  46927. });
  46928. if (marker.title) {
  46929. markerTracker.setTitle(marker.title)
  46930. }
  46931. return markerTracker
  46932. })
  46933. },
  46934. _getLabelFormatOptions: function(formatString) {
  46935. var that = this;
  46936. var markerLabelOptions = that._markerLabelOptions;
  46937. if (!markerLabelOptions) {
  46938. that._markerLabelOptions = markerLabelOptions = (0, _extend.extend)(true, {}, that._options.marker.label)
  46939. }
  46940. if (!(0, _type.isDefined)(that._options.marker.label.format)) {
  46941. markerLabelOptions.format = formatString
  46942. }
  46943. return markerLabelOptions
  46944. },
  46945. _adjustConstantLineLabels: function(constantLines) {
  46946. var that = this;
  46947. var axisPosition = that._options.position;
  46948. var canvas = that.getCanvas();
  46949. var canvasLeft = canvas.left;
  46950. var canvasRight = canvas.width - canvas.right;
  46951. var canvasTop = canvas.top;
  46952. var canvasBottom = canvas.height - canvas.bottom;
  46953. var verticalCenter = canvasTop + (canvasBottom - canvasTop) / 2;
  46954. var horizontalCenter = canvasLeft + (canvasRight - canvasLeft) / 2;
  46955. var maxLabel = 0;
  46956. constantLines.forEach(function(item) {
  46957. var isHorizontal = that._isHorizontal;
  46958. var linesOptions = item.options;
  46959. var paddingTopBottom = linesOptions.paddingTopBottom;
  46960. var paddingLeftRight = linesOptions.paddingLeftRight;
  46961. var labelOptions = linesOptions.label;
  46962. var labelVerticalAlignment = labelOptions.verticalAlignment;
  46963. var labelHorizontalAlignment = labelOptions.horizontalAlignment;
  46964. var labelIsInside = "inside" === labelOptions.position;
  46965. var label = item.label;
  46966. var box = item.labelBBox;
  46967. var translateX;
  46968. var translateY;
  46969. if (null === label || box.isEmpty) {
  46970. return
  46971. }
  46972. if (isHorizontal) {
  46973. if (labelIsInside) {
  46974. if (labelHorizontalAlignment === LEFT) {
  46975. translateX = item.coord - paddingLeftRight - box.x - box.width
  46976. } else {
  46977. translateX = item.coord + paddingLeftRight - box.x
  46978. }
  46979. switch (labelVerticalAlignment) {
  46980. case CENTER:
  46981. translateY = verticalCenter - box.y - box.height / 2;
  46982. break;
  46983. case BOTTOM:
  46984. translateY = canvasBottom - paddingTopBottom - box.y - box.height;
  46985. break;
  46986. default:
  46987. translateY = canvasTop + paddingTopBottom - box.y
  46988. }
  46989. } else {
  46990. if (axisPosition === labelVerticalAlignment) {
  46991. maxLabel = _max(maxLabel, box.height + paddingTopBottom)
  46992. }
  46993. translateX = item.coord - box.x - box.width / 2;
  46994. if (labelVerticalAlignment === BOTTOM) {
  46995. translateY = canvasBottom + paddingTopBottom - box.y
  46996. } else {
  46997. translateY = canvasTop - paddingTopBottom - box.y - box.height
  46998. }
  46999. }
  47000. } else {
  47001. if (labelIsInside) {
  47002. if (labelVerticalAlignment === BOTTOM) {
  47003. translateY = item.coord + paddingTopBottom - box.y
  47004. } else {
  47005. translateY = item.coord - paddingTopBottom - box.y - box.height
  47006. }
  47007. switch (labelHorizontalAlignment) {
  47008. case CENTER:
  47009. translateX = horizontalCenter - box.x - box.width / 2;
  47010. break;
  47011. case RIGHT:
  47012. translateX = canvasRight - paddingLeftRight - box.x - box.width;
  47013. break;
  47014. default:
  47015. translateX = canvasLeft + paddingLeftRight - box.x
  47016. }
  47017. } else {
  47018. if (axisPosition === labelHorizontalAlignment) {
  47019. maxLabel = _max(maxLabel, box.width + paddingLeftRight)
  47020. }
  47021. translateY = item.coord - box.y - box.height / 2;
  47022. if (labelHorizontalAlignment === RIGHT) {
  47023. translateX = canvasRight + paddingLeftRight - box.x
  47024. } else {
  47025. translateX = canvasLeft - paddingLeftRight - box.x - box.width
  47026. }
  47027. }
  47028. }
  47029. label.attr({
  47030. translateX: translateX,
  47031. translateY: translateY
  47032. })
  47033. });
  47034. return maxLabel
  47035. },
  47036. _drawConstantLinesForEstimating: function(constantLines) {
  47037. var that = this;
  47038. var renderer = this._renderer;
  47039. var group = renderer.g();
  47040. constantLines.forEach(function(options) {
  47041. that._drawConstantLineLabelText(options.label.text, 0, 0, options.label, group).attr({
  47042. align: "center"
  47043. })
  47044. });
  47045. return group.append(renderer.root)
  47046. },
  47047. _estimateLabelHeight: function(bBox, labelOptions) {
  47048. var height = bBox.height;
  47049. var drawingType = labelOptions.drawingType;
  47050. if ("stagger" === this._validateDisplayMode(drawingType) || "stagger" === this._validateOverlappingMode(labelOptions.overlappingBehavior, drawingType)) {
  47051. height = 2 * height + labelOptions.staggeringSpacing
  47052. }
  47053. if ("rotate" === this._validateDisplayMode(drawingType) || "rotate" === this._validateOverlappingMode(labelOptions.overlappingBehavior, drawingType)) {
  47054. var sinCos = _utils2.default.getCosAndSin(labelOptions.rotationAngle);
  47055. height = height * sinCos.cos + bBox.width * sinCos.sin
  47056. }
  47057. return height && (height + labelOptions.indentFromAxis || 0) || 0
  47058. },
  47059. estimateMargins: function(canvas) {
  47060. this.updateCanvas(canvas);
  47061. var that = this;
  47062. var range = that._getViewportRange();
  47063. var ticksData = this._createTicksAndLabelFormat(range);
  47064. var ticks = ticksData.ticks;
  47065. var tickInterval = ticksData.tickInterval;
  47066. var options = this._options;
  47067. var constantLineOptions = that._outsideConstantLines.filter(function(l) {
  47068. return l.labelOptions.visible
  47069. }).map(function(l) {
  47070. return l.options
  47071. });
  47072. var rootElement = that._renderer.root;
  47073. var labelIsVisible = options.label.visible && !range.isEmpty() && ticks.length;
  47074. var labelValue = labelIsVisible && that.formatLabel(ticks[ticks.length - 1], options.label, void 0, void 0, tickInterval, ticks);
  47075. var labelElement = labelIsVisible && that._renderer.text(labelValue, 0, 0).css(that._textFontStyles).attr(that._textOptions).append(rootElement);
  47076. var titleElement = that._drawTitleText(rootElement, {
  47077. x: 0,
  47078. y: 0
  47079. });
  47080. var constantLinesLabelsElement = that._drawConstantLinesForEstimating(constantLineOptions);
  47081. var labelBox = labelElement && labelElement.getBBox() || {
  47082. x: 0,
  47083. y: 0,
  47084. width: 0,
  47085. height: 0
  47086. };
  47087. var titleBox = titleElement && titleElement.getBBox() || {
  47088. x: 0,
  47089. y: 0,
  47090. width: 0,
  47091. height: 0
  47092. };
  47093. var constantLinesBox = constantLinesLabelsElement.getBBox();
  47094. var titleHeight = titleBox.height ? titleBox.height + options.title.margin : 0;
  47095. var labelHeight = that._estimateLabelHeight(labelBox, options.label);
  47096. var constantLinesHeight = constantLinesBox.height ? constantLinesBox.height + getMaxConstantLinePadding(constantLineOptions) : 0;
  47097. var height = labelHeight + titleHeight;
  47098. var margins = {
  47099. left: _max(getLeftMargin(labelBox), getLeftMargin(constantLinesBox)),
  47100. right: _max(getRightMargin(labelBox), getRightMargin(constantLinesBox)),
  47101. top: ("top" === options.position ? height : 0) + getConstantLineLabelMarginForVerticalAlignment(constantLineOptions, "top", constantLinesHeight),
  47102. bottom: ("top" !== options.position ? height : 0) + getConstantLineLabelMarginForVerticalAlignment(constantLineOptions, "bottom", constantLinesHeight)
  47103. };
  47104. labelElement && labelElement.remove();
  47105. titleElement && titleElement.remove();
  47106. constantLinesLabelsElement && constantLinesLabelsElement.remove();
  47107. return margins
  47108. },
  47109. _checkAlignmentConstantLineLabels: function(labelOptions) {
  47110. var position = labelOptions.position;
  47111. var verticalAlignment = (labelOptions.verticalAlignment || "").toLowerCase();
  47112. var horizontalAlignment = (labelOptions.horizontalAlignment || "").toLowerCase();
  47113. if (this._isHorizontal) {
  47114. if ("outside" === position) {
  47115. verticalAlignment = verticalAlignment === BOTTOM ? BOTTOM : TOP;
  47116. horizontalAlignment = CENTER
  47117. } else {
  47118. verticalAlignment = verticalAlignment === CENTER ? CENTER : verticalAlignment === BOTTOM ? BOTTOM : TOP;
  47119. horizontalAlignment = horizontalAlignment === LEFT ? LEFT : RIGHT
  47120. }
  47121. } else {
  47122. if ("outside" === position) {
  47123. verticalAlignment = CENTER;
  47124. horizontalAlignment = horizontalAlignment === LEFT ? LEFT : RIGHT
  47125. } else {
  47126. verticalAlignment = verticalAlignment === BOTTOM ? BOTTOM : TOP;
  47127. horizontalAlignment = horizontalAlignment === RIGHT ? RIGHT : horizontalAlignment === CENTER ? CENTER : LEFT
  47128. }
  47129. }
  47130. labelOptions.verticalAlignment = verticalAlignment;
  47131. labelOptions.horizontalAlignment = horizontalAlignment
  47132. },
  47133. _getConstantLineLabelsCoords: function(value, lineLabelOptions) {
  47134. var that = this;
  47135. var x = value;
  47136. var y = value;
  47137. if (that._isHorizontal) {
  47138. y = that._orthogonalPositions["top" === lineLabelOptions.verticalAlignment ? "start" : "end"]
  47139. } else {
  47140. x = that._orthogonalPositions["right" === lineLabelOptions.horizontalAlignment ? "end" : "start"]
  47141. }
  47142. return {
  47143. x: x,
  47144. y: y
  47145. }
  47146. },
  47147. _getAdjustedStripLabelCoords: function(strip) {
  47148. var stripOptions = strip.options;
  47149. var paddingTopBottom = stripOptions.paddingTopBottom;
  47150. var paddingLeftRight = stripOptions.paddingLeftRight;
  47151. var horizontalAlignment = stripOptions.label.horizontalAlignment;
  47152. var verticalAlignment = stripOptions.label.verticalAlignment;
  47153. var box = strip.labelBBox;
  47154. var labelHeight = box.height;
  47155. var labelWidth = box.width;
  47156. var labelCoords = strip.labelCoords;
  47157. var y = labelCoords.y - box.y;
  47158. var x = labelCoords.x - box.x;
  47159. if (verticalAlignment === TOP) {
  47160. y += paddingTopBottom
  47161. } else {
  47162. if (verticalAlignment === CENTER) {
  47163. y -= labelHeight / 2
  47164. } else {
  47165. if (verticalAlignment === BOTTOM) {
  47166. y -= paddingTopBottom + labelHeight
  47167. }
  47168. }
  47169. }
  47170. if (horizontalAlignment === LEFT) {
  47171. x += paddingLeftRight
  47172. } else {
  47173. if (horizontalAlignment === CENTER) {
  47174. x -= labelWidth / 2
  47175. } else {
  47176. if (horizontalAlignment === RIGHT) {
  47177. x -= paddingLeftRight + labelWidth
  47178. }
  47179. }
  47180. }
  47181. return {
  47182. translateX: x,
  47183. translateY: y
  47184. }
  47185. },
  47186. _adjustTitle: function(offset) {
  47187. offset = offset || 0;
  47188. if (!this._title) {
  47189. return
  47190. }
  47191. var that = this;
  47192. var options = that._options;
  47193. var position = options.position;
  47194. var margin = options.title.margin;
  47195. var title = that._title;
  47196. var boxTitle = title.bBox;
  47197. var x = boxTitle.x;
  47198. var y = boxTitle.y;
  47199. var width = boxTitle.width;
  47200. var height = boxTitle.height;
  47201. var axisPosition = that._axisPosition;
  47202. var loCoord = axisPosition - margin - offset;
  47203. var hiCoord = axisPosition + margin + offset;
  47204. var params = {};
  47205. if (that._isHorizontal) {
  47206. if (position === TOP) {
  47207. params.translateY = loCoord - (y + height)
  47208. } else {
  47209. params.translateY = hiCoord - y
  47210. }
  47211. } else {
  47212. if (position === LEFT) {
  47213. params.translateX = loCoord - (x + width)
  47214. } else {
  47215. params.translateX = hiCoord - x
  47216. }
  47217. }
  47218. title.element.attr(params)
  47219. },
  47220. _checkTitleOverflow: function(titleElement) {
  47221. if (!this._title && !titleElement) {
  47222. return
  47223. }
  47224. var canvasLength = this._getScreenDelta();
  47225. var title = titleElement ? {
  47226. bBox: titleElement.getBBox(),
  47227. element: titleElement
  47228. } : this._title;
  47229. var titleOptions = this._options.title;
  47230. var boxTitle = title.bBox;
  47231. if ((this._isHorizontal ? boxTitle.width : boxTitle.height) > canvasLength) {
  47232. title.element.setMaxSize(canvasLength, void 0, {
  47233. wordWrap: titleOptions.wordWrap || "none",
  47234. textOverflow: titleOptions.textOverflow || "ellipsis"
  47235. });
  47236. this._wrapped = titleOptions.wordWrap && "none" !== titleOptions.wordWrap
  47237. } else {
  47238. var moreThanOriginalSize = title.originalSize && canvasLength > (this._isHorizontal ? title.originalSize.width : title.originalSize.height);
  47239. !this._wrapped && moreThanOriginalSize && title.element.restoreText()
  47240. }
  47241. },
  47242. coordsIn: function(x, y) {
  47243. var canvas = this.getCanvas();
  47244. var isHorizontal = this._options.isHorizontal;
  47245. var position = this._options.position;
  47246. var coord = isHorizontal ? y : x;
  47247. if (isHorizontal && (x < canvas.left || x > canvas.width - canvas.right) || !isHorizontal && (y < canvas.top || y > canvas.height - canvas.bottom)) {
  47248. return false
  47249. }
  47250. if (isHorizontal && position === _axes_constants2.default.top || !isHorizontal && position === _axes_constants2.default.left) {
  47251. return coord < canvas[position]
  47252. }
  47253. return coord > canvas[isHorizontal ? "height" : "width"] - canvas[position]
  47254. },
  47255. _boundaryTicksVisibility: {
  47256. min: true,
  47257. max: true
  47258. },
  47259. _setVisualRange: function(visualRange, allowPartialUpdate) {
  47260. var range = this.adjustRange(_utils2.default.getVizRangeObject(visualRange));
  47261. if (allowPartialUpdate) {
  47262. (0, _type.isDefined)(range.startValue) && (this._viewport.startValue = range.startValue);
  47263. (0, _type.isDefined)(range.endValue) && (this._viewport.endValue = range.endValue)
  47264. } else {
  47265. this._viewport = range
  47266. }
  47267. },
  47268. applyVisualRangeSetter: function(visualRangeSetter) {
  47269. this._visualRange = visualRangeSetter
  47270. },
  47271. adjust: function(alignToBounds) {
  47272. var that = this;
  47273. var seriesData = that._seriesData;
  47274. var viewport = {
  47275. min: seriesData.min,
  47276. max: seriesData.max
  47277. };
  47278. if (!alignToBounds) {
  47279. viewport = that._series.filter(function(s) {
  47280. return s.isVisible()
  47281. }).reduce(function(range, s) {
  47282. var seriesRange = s.getViewport();
  47283. range.min = (0, _type.isDefined)(seriesRange.min) ? range.min < seriesRange.min ? range.min : seriesRange.min : range.min;
  47284. range.max = (0, _type.isDefined)(seriesRange.max) ? range.max > seriesRange.max ? range.max : seriesRange.max : range.max;
  47285. if (s.showZero) {
  47286. range = new _range2.default.Range(range);
  47287. range.correctValueZeroLevel()
  47288. }
  47289. return range
  47290. }, {})
  47291. }
  47292. if ((0, _type.isDefined)(viewport.min) && (0, _type.isDefined)(viewport.max)) {
  47293. seriesData.minVisible = viewport.min;
  47294. seriesData.maxVisible = viewport.max
  47295. }
  47296. that._translator.updateBusinessRange(that.adjustViewport(seriesData));
  47297. that._breaks = that._getScaleBreaks(that._options, {
  47298. minVisible: seriesData.minVisible,
  47299. maxVisible: seriesData.maxVisible
  47300. }, that._series, that.isArgumentAxis)
  47301. },
  47302. hasWrap: function() {
  47303. return this._wrapped
  47304. },
  47305. getAxisPosition: function() {
  47306. return this._axisPosition
  47307. },
  47308. _getStick: function() {
  47309. return !this._options.valueMarginsEnabled
  47310. },
  47311. _getStripLabelCoords: function(from, to, stripLabelOptions) {
  47312. var that = this;
  47313. var orthogonalPositions = that._orthogonalPositions;
  47314. var isHorizontal = that._isHorizontal;
  47315. var horizontalAlignment = stripLabelOptions.horizontalAlignment;
  47316. var verticalAlignment = stripLabelOptions.verticalAlignment;
  47317. var x;
  47318. var y;
  47319. if (isHorizontal) {
  47320. if (horizontalAlignment === CENTER) {
  47321. x = from + (to - from) / 2
  47322. } else {
  47323. if (horizontalAlignment === LEFT) {
  47324. x = from
  47325. } else {
  47326. if (horizontalAlignment === RIGHT) {
  47327. x = to
  47328. }
  47329. }
  47330. }
  47331. y = orthogonalPositions[getStripVerticalAlignmentPosition(verticalAlignment)]
  47332. } else {
  47333. x = orthogonalPositions[getStripHorizontalAlignmentPosition(horizontalAlignment)];
  47334. if (verticalAlignment === TOP) {
  47335. y = from
  47336. } else {
  47337. if (verticalAlignment === CENTER) {
  47338. y = to + (from - to) / 2
  47339. } else {
  47340. if (verticalAlignment === BOTTOM) {
  47341. y = to
  47342. }
  47343. }
  47344. }
  47345. }
  47346. return {
  47347. x: x,
  47348. y: y
  47349. }
  47350. },
  47351. _getTranslatedValue: function(value, offset) {
  47352. var pos1 = this._translator.translate(value, offset, "semidiscrete" === this._options.type && this._options.tickInterval);
  47353. var pos2 = this._axisPosition;
  47354. var isHorizontal = this._isHorizontal;
  47355. return {
  47356. x: isHorizontal ? pos1 : pos2,
  47357. y: isHorizontal ? pos2 : pos1
  47358. }
  47359. },
  47360. areCoordsOutsideAxis: function(coords) {
  47361. var coord = this._isHorizontal ? coords.x : coords.y;
  47362. var visibleArea = this.getVisibleArea();
  47363. if (coord < visibleArea[0] || coord > visibleArea[1]) {
  47364. return true
  47365. }
  47366. return false
  47367. },
  47368. _getSkippedCategory: function(ticks) {
  47369. var skippedCategory;
  47370. if (this._options.type === _axes_constants2.default.discrete && this._tickOffset && 0 !== ticks.length) {
  47371. skippedCategory = ticks[ticks.length - 1]
  47372. }
  47373. return skippedCategory
  47374. },
  47375. _getScaleBreaks: function(axisOptions, viewport, series, isArgumentAxis) {
  47376. var that = this;
  47377. var breaks = (axisOptions.breaks || []).map(function(b) {
  47378. return {
  47379. from: that.parser(b.startValue),
  47380. to: that.parser(b.endValue)
  47381. }
  47382. });
  47383. if ("discrete" !== axisOptions.type && "datetime" === axisOptions.dataType && axisOptions.workdaysOnly) {
  47384. breaks = breaks.concat((0, _datetime_breaks.generateDateBreaks)(viewport.minVisible, viewport.maxVisible, axisOptions.workWeek, axisOptions.singleWorkdays, axisOptions.holidays))
  47385. }
  47386. if (!isArgumentAxis && "discrete" !== axisOptions.type && "datetime" !== axisOptions.dataType && axisOptions.autoBreaksEnabled && 0 !== axisOptions.maxAutoBreakCount) {
  47387. breaks = breaks.concat(generateAutoBreaks(axisOptions, series, viewport))
  47388. }
  47389. return filterBreaks(sortingBreaks(breaks), viewport, axisOptions.breakStyle)
  47390. },
  47391. _drawBreak: function(translatedEnd, positionFrom, positionTo, width, options, group) {
  47392. var that = this;
  47393. var breakStart = translatedEnd - (!that._translator.isInverted() ? width + 1 : 0);
  47394. var attr = {
  47395. "stroke-width": 1,
  47396. stroke: options.borderColor,
  47397. sharp: !options.isWaved ? options.isHorizontal ? "h" : "v" : void 0
  47398. };
  47399. var spaceAttr = {
  47400. stroke: options.color,
  47401. "stroke-width": width
  47402. };
  47403. var getPoints = that._isHorizontal ? rotateLine : function(p) {
  47404. return p
  47405. };
  47406. var drawer = getLineDrawer(that._renderer, group, getPoints, positionFrom, breakStart, positionTo, options.isWaved);
  47407. drawer(width / 2, spaceAttr);
  47408. drawer(0, attr);
  47409. drawer(width, attr)
  47410. },
  47411. _createBreakClipRect: function(from, to) {
  47412. var that = this;
  47413. var canvas = that._canvas;
  47414. var clipWidth = to - from;
  47415. var clipRect;
  47416. if (that._isHorizontal) {
  47417. clipRect = that._renderer.clipRect(canvas.left, from, canvas.width, clipWidth)
  47418. } else {
  47419. clipRect = that._renderer.clipRect(from, canvas.top, clipWidth, canvas.height)
  47420. }
  47421. that._breaksElements = that._breaksElements || [];
  47422. that._breaksElements.push(clipRect);
  47423. return clipRect.id
  47424. },
  47425. _createBreaksGroup: function(clipFrom, clipTo) {
  47426. var that = this;
  47427. var group = that._renderer.g().attr({
  47428. "class": that._axisCssPrefix + "breaks",
  47429. "clip-path": that._createBreakClipRect(clipFrom, clipTo)
  47430. }).append(that._scaleBreaksGroup);
  47431. that._breaksElements = that._breaksElements || [];
  47432. that._breaksElements.push(group);
  47433. return group
  47434. },
  47435. _disposeBreaksGroup: function() {
  47436. (this._breaksElements || []).forEach(function(clipRect) {
  47437. clipRect.dispose()
  47438. });
  47439. this._breaksElements = null
  47440. },
  47441. drawScaleBreaks: function(customCanvas) {
  47442. var that = this;
  47443. var options = that._options;
  47444. var breakStyle = options.breakStyle;
  47445. var position = options.position;
  47446. var positionFrom;
  47447. var positionTo;
  47448. var breaks = that._translator.getBusinessRange().breaks || [];
  47449. var additionGroup;
  47450. var additionBreakFrom;
  47451. var additionBreakTo;
  47452. that._disposeBreaksGroup();
  47453. if (!(breaks && breaks.length)) {
  47454. return
  47455. }
  47456. var breakOptions = {
  47457. color: that._options.containerColor,
  47458. borderColor: breakStyle.color,
  47459. isHorizontal: that._isHorizontal,
  47460. isWaved: "straight" !== breakStyle.line.toLowerCase()
  47461. };
  47462. if (customCanvas) {
  47463. positionFrom = customCanvas.start;
  47464. positionTo = customCanvas.end
  47465. } else {
  47466. positionFrom = that._orthogonalPositions.start - (options.visible && !that._axisShift && ("left" === position || "top" === position) ? SCALE_BREAK_OFFSET : 0);
  47467. positionTo = that._orthogonalPositions.end + (options.visible && ("right" === position || "bottom" === position) ? SCALE_BREAK_OFFSET : 0)
  47468. }
  47469. var mainGroup = that._createBreaksGroup(positionFrom, positionTo);
  47470. if (that._axisShift && options.visible) {
  47471. additionBreakFrom = that._axisPosition - that._axisShift - SCALE_BREAK_OFFSET;
  47472. additionBreakTo = additionBreakFrom + 2 * SCALE_BREAK_OFFSET;
  47473. additionGroup = that._createBreaksGroup(additionBreakFrom, additionBreakTo);
  47474. }
  47475. breaks.forEach(function(br) {
  47476. if (!br.gapSize) {
  47477. var breakCoord = that._getTranslatedCoord(br.to);
  47478. that._drawBreak(breakCoord, positionFrom, positionTo, breakStyle.width, breakOptions, mainGroup);
  47479. if (that._axisShift && options.visible) {
  47480. that._drawBreak(breakCoord, additionBreakFrom, additionBreakTo, breakStyle.width, breakOptions, additionGroup)
  47481. }
  47482. }
  47483. })
  47484. },
  47485. _getSpiderCategoryOption: _common.noop,
  47486. shift: function(margins) {
  47487. var that = this;
  47488. var options = that._options;
  47489. var isHorizontal = options.isHorizontal;
  47490. var axesSpacing = that.getMultipleAxesSpacing();
  47491. var constantLinesGroups = that._axisConstantLineGroups;
  47492. function shiftGroup(side, group) {
  47493. var attr = {
  47494. translateX: 0,
  47495. translateY: 0
  47496. };
  47497. var shift = margins[side] ? margins[side] + axesSpacing : 0;
  47498. attr[isHorizontal ? "translateY" : "translateX"] = ("left" === side || "top" === side ? -1 : 1) * shift;
  47499. (group[side] || group).attr(attr);
  47500. return shift
  47501. }
  47502. that._axisShift = shiftGroup(options.position, that._axisGroup);
  47503. (isHorizontal ? ["top", "bottom"] : ["left", "right"]).forEach(function(side) {
  47504. shiftGroup(side, constantLinesGroups.above);
  47505. shiftGroup(side, constantLinesGroups.under)
  47506. })
  47507. }
  47508. }
  47509. };
  47510. function getLineDrawer(renderer, root, rotatePoints, positionFrom, breakStart, positionTo, isWaved) {
  47511. var elementType = isWaved ? "bezier" : "line";
  47512. var group = renderer.g().append(root);
  47513. return function(offset, attr) {
  47514. renderer.path(rotatePoints(getPoints(positionFrom, breakStart, positionTo, offset, isWaved)), elementType).attr(attr).append(group)
  47515. }
  47516. }
  47517. function getPoints(positionFrom, breakStart, positionTo, offset, isWaved) {
  47518. if (!isWaved) {
  47519. return [positionFrom, breakStart + offset, positionTo, breakStart + offset]
  47520. }
  47521. breakStart += offset;
  47522. var currentPosition;
  47523. var topPoint = breakStart + WAVED_LINE_TOP;
  47524. var centerPoint = breakStart + WAVED_LINE_CENTER;
  47525. var bottomPoint = breakStart + WAVED_LINE_BOTTOM;
  47526. var points = [
  47527. [positionFrom, centerPoint]
  47528. ];
  47529. for (currentPosition = positionFrom; currentPosition < positionTo + WAVED_LINE_LENGTH; currentPosition += WAVED_LINE_LENGTH) {
  47530. points.push([currentPosition + 6, topPoint, currentPosition + 6, topPoint, currentPosition + 12, centerPoint, currentPosition + 18, bottomPoint, currentPosition + 18, bottomPoint, currentPosition + 24, centerPoint])
  47531. }
  47532. return [].concat.apply([], points)
  47533. }
  47534. function rotateLine(lineCoords) {
  47535. var points = [];
  47536. var i;
  47537. for (i = 0; i < lineCoords.length; i += 2) {
  47538. points.push(lineCoords[i + 1]);
  47539. points.push(lineCoords[i])
  47540. }
  47541. return points
  47542. }
  47543. },
  47544. /*!********************************************************!*\
  47545. !*** ./artifacts/transpiled/viz/core/series_family.js ***!
  47546. \********************************************************/
  47547. /*! dynamic exports provided */
  47548. /*! all exports used */
  47549. function(module, exports, __webpack_require__) {
  47550. var isNumeric = __webpack_require__( /*! ../../core/utils/type */ 1).isNumeric;
  47551. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  47552. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  47553. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  47554. var sign = __webpack_require__( /*! ../../core/utils/math */ 28).sign;
  47555. var _math = Math;
  47556. var _round = _math.round;
  47557. var _abs = _math.abs;
  47558. var _pow = _math.pow;
  47559. var _each = each;
  47560. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  47561. var vizUtils = __webpack_require__( /*! ./utils */ 10);
  47562. var DEFAULT_BAR_GROUP_PADDING = .3;
  47563. var _normalizeEnum = vizUtils.normalizeEnum;
  47564. function validateBarPadding(barPadding) {
  47565. return barPadding < 0 || barPadding > 1 ? void 0 : barPadding
  47566. }
  47567. function validateBarGroupPadding(barGroupPadding) {
  47568. return barGroupPadding < 0 || barGroupPadding > 1 ? DEFAULT_BAR_GROUP_PADDING : barGroupPadding
  47569. }
  47570. function isStackExist(series, arg, equalBarWidth) {
  47571. return series.some(function(s) {
  47572. return equalBarWidth && !s.getOptions().ignoreEmptyPoints || s.getPointsByArg(arg, true).some(function(point) {
  47573. return point.hasValue()
  47574. })
  47575. })
  47576. }
  47577. function correctStackCoordinates(series, currentStacks, arg, stack, parameters, barsArea, seriesStackIndexCallback) {
  47578. series.forEach(function(series) {
  47579. var stackIndex = seriesStackIndexCallback(currentStacks.indexOf(stack), currentStacks.length);
  47580. var points = series.getPointsByArg(arg, true);
  47581. var barPadding = validateBarPadding(series.getOptions().barPadding);
  47582. var barWidth = series.getOptions().barWidth;
  47583. var offset = getOffset(stackIndex, parameters);
  47584. var width = parameters.width;
  47585. if (stackIndex === -1) {
  47586. return
  47587. }
  47588. if (isDefined(barPadding) || isDefined(barWidth)) {
  47589. var extraParameters = calculateParams(barsArea, currentStacks.length, 1 - barPadding, barWidth);
  47590. width = extraParameters.width;
  47591. offset = getOffset(stackIndex, extraParameters)
  47592. }
  47593. correctPointCoordinates(points, width, offset)
  47594. })
  47595. }
  47596. function adjustBarSeriesDimensionsCore(series, options, seriesStackIndexCallback) {
  47597. var commonStacks = [];
  47598. var allArguments = [];
  47599. var seriesInStacks = {};
  47600. var barWidth = options.barWidth;
  47601. var barGroupWidth = options.barGroupWidth;
  47602. var interval = series[0] && series[0].getArgumentAxis().getTranslator().getInterval();
  47603. var barsArea = barGroupWidth ? interval > barGroupWidth ? barGroupWidth : interval : interval * (1 - validateBarGroupPadding(options.barGroupPadding));
  47604. series.forEach(function(s, i) {
  47605. var stackName = s.getStackName() || s.getBarOverlapGroup() || i.toString();
  47606. var argument;
  47607. for (argument in s.pointsByArgument) {
  47608. if (allArguments.indexOf(argument.valueOf()) === -1) {
  47609. allArguments.push(argument.valueOf())
  47610. }
  47611. }
  47612. if (commonStacks.indexOf(stackName) === -1) {
  47613. commonStacks.push(stackName);
  47614. seriesInStacks[stackName] = []
  47615. }
  47616. seriesInStacks[stackName].push(s)
  47617. });
  47618. allArguments.forEach(function(arg) {
  47619. var currentStacks = commonStacks.reduce(function(stacks, stack) {
  47620. if (isStackExist(seriesInStacks[stack], arg, options.equalBarWidth)) {
  47621. stacks.push(stack)
  47622. }
  47623. return stacks
  47624. }, []);
  47625. var parameters = calculateParams(barsArea, currentStacks.length, barWidth);
  47626. commonStacks.forEach(function(stack) {
  47627. correctStackCoordinates(seriesInStacks[stack], currentStacks, arg, stack, parameters, barsArea, seriesStackIndexCallback)
  47628. })
  47629. })
  47630. }
  47631. function calculateParams(barsArea, count, percentWidth, fixedBarWidth) {
  47632. var spacing;
  47633. var width;
  47634. if (fixedBarWidth) {
  47635. width = Math.min(fixedBarWidth, _round(barsArea / count));
  47636. spacing = count > 1 ? _round((barsArea - width * count) / (count - 1)) : 0
  47637. } else {
  47638. if (isDefined(percentWidth)) {
  47639. width = _round(barsArea * percentWidth / count);
  47640. spacing = _round(count > 1 ? (barsArea - barsArea * percentWidth) / (count - 1) : 0)
  47641. } else {
  47642. spacing = _round(barsArea / count * .2);
  47643. width = _round((barsArea - spacing * (count - 1)) / count)
  47644. }
  47645. }
  47646. return {
  47647. width: width > 1 ? width : 1,
  47648. spacing: spacing,
  47649. middleIndex: count / 2
  47650. }
  47651. }
  47652. function getOffset(stackIndex, parameters) {
  47653. return (stackIndex - parameters.middleIndex + .5) * parameters.width - (parameters.middleIndex - stackIndex - .5) * parameters.spacing
  47654. }
  47655. function correctPointCoordinates(points, width, offset) {
  47656. _each(points, function(_, point) {
  47657. point.correctCoordinates({
  47658. width: width,
  47659. offset: offset
  47660. })
  47661. })
  47662. }
  47663. function getValueType(value) {
  47664. return value >= 0 ? "positive" : "negative"
  47665. }
  47666. function getVisibleSeries(that) {
  47667. return that.series.filter(function(s) {
  47668. return s.isVisible()
  47669. })
  47670. }
  47671. function getAbsStackSumByArg(stackKeepers, stackName, argument) {
  47672. var positiveStackValue = (stackKeepers.positive[stackName] || {})[argument] || 0;
  47673. var negativeStackValue = -(stackKeepers.negative[stackName] || {})[argument] || 0;
  47674. return positiveStackValue + negativeStackValue
  47675. }
  47676. function getStackSumByArg(stackKeepers, stackName, argument) {
  47677. var positiveStackValue = (stackKeepers.positive[stackName] || {})[argument] || 0;
  47678. var negativeStackValue = (stackKeepers.negative[stackName] || {})[argument] || 0;
  47679. return positiveStackValue + negativeStackValue
  47680. }
  47681. function getSeriesStackIndexCallback(inverted) {
  47682. if (!inverted) {
  47683. return function(index) {
  47684. return index
  47685. }
  47686. } else {
  47687. return function(index, stackCount) {
  47688. return stackCount - index - 1
  47689. }
  47690. }
  47691. }
  47692. function isInverted(series) {
  47693. return series[0] && series[0].getArgumentAxis().getTranslator().isInverted()
  47694. }
  47695. function adjustBarSeriesDimensions() {
  47696. var series = getVisibleSeries(this);
  47697. adjustBarSeriesDimensionsCore(series, this._options, getSeriesStackIndexCallback(isInverted(series)))
  47698. }
  47699. function getFirstValueSign(series) {
  47700. var points = series.getPoints();
  47701. var value;
  47702. for (var i = 0; i < points.length; i++) {
  47703. var point = points[i];
  47704. value = point.initialValue && point.initialValue.valueOf();
  47705. if (Math.abs(value) > 0) {
  47706. break
  47707. }
  47708. }
  47709. return sign(value)
  47710. }
  47711. function adjustStackedSeriesValues() {
  47712. var that = this;
  47713. var negativesAsZeroes = that._options.negativesAsZeroes;
  47714. var series = getVisibleSeries(that);
  47715. var stackKeepers = {
  47716. positive: {},
  47717. negative: {}
  47718. };
  47719. var holesStack = {
  47720. left: {},
  47721. right: {}
  47722. };
  47723. var lastSeriesInPositiveStack = {};
  47724. var lastSeriesInNegativeStack = {};
  47725. series.forEach(function(singleSeries) {
  47726. var stackName = singleSeries.getStackName() || singleSeries.getBarOverlapGroup();
  47727. var hole = false;
  47728. var stack = getFirstValueSign(singleSeries) < 0 ? lastSeriesInNegativeStack : lastSeriesInPositiveStack;
  47729. singleSeries._prevSeries = stack[stackName];
  47730. stack[stackName] = singleSeries;
  47731. singleSeries.holes = extend(true, {}, holesStack);
  47732. singleSeries.getPoints().forEach(function(point, index, points) {
  47733. var value = point.initialValue && point.initialValue.valueOf();
  47734. var argument = point.argument.valueOf();
  47735. var stacks = value >= 0 ? stackKeepers.positive : stackKeepers.negative;
  47736. var isNotBarSeries = "bar" !== singleSeries.type;
  47737. if (negativesAsZeroes && value < 0) {
  47738. stacks = stackKeepers.positive;
  47739. value = 0;
  47740. point.resetValue()
  47741. }
  47742. stacks[stackName] = stacks[stackName] || {};
  47743. var currentStack = stacks[stackName];
  47744. if (currentStack[argument]) {
  47745. if (isNotBarSeries) {
  47746. point.correctValue(currentStack[argument])
  47747. }
  47748. currentStack[argument] += value
  47749. } else {
  47750. currentStack[argument] = value;
  47751. if (isNotBarSeries) {
  47752. point.resetCorrection()
  47753. }
  47754. }
  47755. if (!point.hasValue()) {
  47756. var prevPoint = points[index - 1];
  47757. if (!hole && prevPoint && prevPoint.hasValue()) {
  47758. argument = prevPoint.argument.valueOf();
  47759. prevPoint._skipSetRightHole = true;
  47760. holesStack.right[argument] = (holesStack.right[argument] || 0) + (prevPoint.value.valueOf() - (isFinite(prevPoint.minValue) ? prevPoint.minValue.valueOf() : 0))
  47761. }
  47762. hole = true
  47763. } else {
  47764. if (hole) {
  47765. hole = false;
  47766. holesStack.left[argument] = (holesStack.left[argument] || 0) + (point.value.valueOf() - (isFinite(point.minValue) ? point.minValue.valueOf() : 0));
  47767. point._skipSetLeftHole = true
  47768. }
  47769. }
  47770. })
  47771. });
  47772. series.forEach(function(singleSeries) {
  47773. var holes = singleSeries.holes;
  47774. singleSeries.getPoints().forEach(function(point) {
  47775. var argument = point.argument.valueOf();
  47776. point.resetHoles();
  47777. !point._skipSetLeftHole && point.setHole(holes.left[argument] || holesStack.left[argument] && 0, "left");
  47778. !point._skipSetRightHole && point.setHole(holes.right[argument] || holesStack.right[argument] && 0, "right");
  47779. point._skipSetLeftHole = null;
  47780. point._skipSetRightHole = null
  47781. })
  47782. });
  47783. that._stackKeepers = stackKeepers;
  47784. series.forEach(function(singleSeries) {
  47785. singleSeries.getPoints().forEach(function(point) {
  47786. var argument = point.argument.valueOf();
  47787. var stackName = singleSeries.getStackName() || singleSeries.getBarOverlapGroup();
  47788. var absTotal = getAbsStackSumByArg(stackKeepers, stackName, argument);
  47789. var total = getStackSumByArg(stackKeepers, stackName, argument);
  47790. point.setPercentValue(absTotal, total, holesStack.left[argument], holesStack.right[argument])
  47791. })
  47792. })
  47793. }
  47794. function updateStackedSeriesValues() {
  47795. var that = this;
  47796. var series = getVisibleSeries(that);
  47797. var stack = that._stackKeepers;
  47798. var stackKeepers = {
  47799. positive: {},
  47800. negative: {}
  47801. };
  47802. _each(series, function(_, singleSeries) {
  47803. var minBarSize = singleSeries.getOptions().minBarSize;
  47804. var valueAxisTranslator = singleSeries.getValueAxis().getTranslator();
  47805. var minShownBusinessValue = minBarSize && valueAxisTranslator.getMinBarSize(minBarSize);
  47806. var stackName = singleSeries.getStackName();
  47807. _each(singleSeries.getPoints(), function(index, point) {
  47808. if (!point.hasValue()) {
  47809. return
  47810. }
  47811. var value = point.initialValue && point.initialValue.valueOf();
  47812. var argument = point.argument.valueOf();
  47813. if (that.fullStacked) {
  47814. value = value / getAbsStackSumByArg(stack, stackName, argument) || 0
  47815. }
  47816. var updateValue = valueAxisTranslator.checkMinBarSize(value, minShownBusinessValue, point.value);
  47817. var valueType = getValueType(updateValue);
  47818. var currentStack = stackKeepers[valueType][stackName] = stackKeepers[valueType][stackName] || {};
  47819. if (currentStack[argument]) {
  47820. point.minValue = currentStack[argument];
  47821. currentStack[argument] += updateValue
  47822. } else {
  47823. currentStack[argument] = updateValue
  47824. }
  47825. point.value = currentStack[argument]
  47826. })
  47827. });
  47828. if (that.fullStacked) {
  47829. updateFullStackedSeriesValues(series, stackKeepers)
  47830. }
  47831. }
  47832. function updateFullStackedSeriesValues(series, stackKeepers) {
  47833. _each(series, function(_, singleSeries) {
  47834. var stackName = singleSeries.getStackName ? singleSeries.getStackName() : "default";
  47835. _each(singleSeries.getPoints(), function(index, point) {
  47836. var stackSum = getAbsStackSumByArg(stackKeepers, stackName, point.argument.valueOf());
  47837. point.value = point.value / stackSum;
  47838. if (isNumeric(point.minValue)) {
  47839. point.minValue = point.minValue / stackSum
  47840. }
  47841. })
  47842. })
  47843. }
  47844. function updateBarSeriesValues() {
  47845. _each(this.series, function(_, singleSeries) {
  47846. var minBarSize = singleSeries.getOptions().minBarSize;
  47847. var valueAxisTranslator = singleSeries.getValueAxis().getTranslator();
  47848. var minShownBusinessValue = minBarSize && valueAxisTranslator.getMinBarSize(minBarSize);
  47849. if (minShownBusinessValue) {
  47850. _each(singleSeries.getPoints(), function(index, point) {
  47851. if (point.hasValue()) {
  47852. point.value = valueAxisTranslator.checkMinBarSize(point.initialValue, minShownBusinessValue)
  47853. }
  47854. })
  47855. }
  47856. })
  47857. }
  47858. function adjustCandlestickSeriesDimensions() {
  47859. var series = getVisibleSeries(this);
  47860. adjustBarSeriesDimensionsCore(series, {
  47861. barWidth: null,
  47862. equalBarWidth: true,
  47863. barGroupPadding: .3
  47864. }, getSeriesStackIndexCallback(isInverted(series)))
  47865. }
  47866. function adjustBubbleSeriesDimensions() {
  47867. var series = getVisibleSeries(this);
  47868. if (!series.length) {
  47869. return
  47870. }
  47871. var options = this._options;
  47872. var visibleAreaX = series[0].getArgumentAxis().getVisibleArea();
  47873. var visibleAreaY = series[0].getValueAxis().getVisibleArea();
  47874. var min = _math.min(visibleAreaX[1] - visibleAreaX[0], visibleAreaY[1] - visibleAreaY[0]);
  47875. var minBubbleArea = _pow(options.minBubbleSize, 2);
  47876. var maxBubbleArea = _pow(min * options.maxBubbleSize, 2);
  47877. var equalBubbleSize = (min * options.maxBubbleSize + options.minBubbleSize) / 2;
  47878. var minPointSize = 1 / 0;
  47879. var maxPointSize = -(1 / 0);
  47880. var pointSize;
  47881. _each(series, function(_, seriesItem) {
  47882. _each(seriesItem.getPoints(), function(_, point) {
  47883. maxPointSize = maxPointSize > point.size ? maxPointSize : point.size;
  47884. minPointSize = minPointSize < point.size ? minPointSize : point.size
  47885. })
  47886. });
  47887. var sizeDispersion = maxPointSize - minPointSize;
  47888. var areaDispersion = _abs(maxBubbleArea - minBubbleArea);
  47889. _each(series, function(_, seriesItem) {
  47890. _each(seriesItem.getPoints(), function(_, point) {
  47891. if (maxPointSize === minPointSize) {
  47892. pointSize = _round(equalBubbleSize)
  47893. } else {
  47894. var sizeProportion = _abs(point.size - minPointSize) / sizeDispersion;
  47895. var bubbleArea = areaDispersion * sizeProportion + minBubbleArea;
  47896. pointSize = _round(_math.sqrt(bubbleArea))
  47897. }
  47898. point.correctCoordinates(pointSize)
  47899. })
  47900. })
  47901. }
  47902. function SeriesFamily(options) {
  47903. var debug = __webpack_require__( /*! ../../core/utils/console */ 73).debug;
  47904. debug.assert(options.type, "type was not passed or empty");
  47905. var that = this;
  47906. that.type = _normalizeEnum(options.type);
  47907. that.pane = options.pane;
  47908. that.series = [];
  47909. that.updateOptions(options);
  47910. switch (that.type) {
  47911. case "bar":
  47912. that.adjustSeriesDimensions = adjustBarSeriesDimensions;
  47913. that.updateSeriesValues = updateBarSeriesValues;
  47914. that.adjustSeriesValues = adjustStackedSeriesValues;
  47915. break;
  47916. case "rangebar":
  47917. that.adjustSeriesDimensions = adjustBarSeriesDimensions;
  47918. break;
  47919. case "fullstackedbar":
  47920. that.fullStacked = true;
  47921. that.adjustSeriesDimensions = adjustBarSeriesDimensions;
  47922. that.adjustSeriesValues = adjustStackedSeriesValues;
  47923. that.updateSeriesValues = updateStackedSeriesValues;
  47924. break;
  47925. case "stackedbar":
  47926. that.adjustSeriesDimensions = adjustBarSeriesDimensions;
  47927. that.adjustSeriesValues = adjustStackedSeriesValues;
  47928. that.updateSeriesValues = updateStackedSeriesValues;
  47929. break;
  47930. case "fullstackedarea":
  47931. case "fullstackedline":
  47932. case "fullstackedspline":
  47933. case "fullstackedsplinearea":
  47934. that.fullStacked = true;
  47935. that.adjustSeriesValues = adjustStackedSeriesValues;
  47936. break;
  47937. case "stackedarea":
  47938. case "stackedsplinearea":
  47939. case "stackedline":
  47940. case "stackedspline":
  47941. that.adjustSeriesValues = adjustStackedSeriesValues;
  47942. break;
  47943. case "candlestick":
  47944. case "stock":
  47945. that.adjustSeriesDimensions = adjustCandlestickSeriesDimensions;
  47946. break;
  47947. case "bubble":
  47948. that.adjustSeriesDimensions = adjustBubbleSeriesDimensions
  47949. }
  47950. }
  47951. exports.SeriesFamily = SeriesFamily;
  47952. SeriesFamily.prototype = {
  47953. constructor: SeriesFamily,
  47954. adjustSeriesDimensions: _noop,
  47955. adjustSeriesValues: _noop,
  47956. updateSeriesValues: _noop,
  47957. updateOptions: function(options) {
  47958. this._options = options
  47959. },
  47960. dispose: function() {
  47961. this.series = null
  47962. },
  47963. add: function(series) {
  47964. var type = this.type;
  47965. this.series = vizUtils.map(series, function(singleSeries) {
  47966. return singleSeries.type === type ? singleSeries : null
  47967. })
  47968. }
  47969. }
  47970. },
  47971. /*!****************************************************************!*\
  47972. !*** ./artifacts/transpiled/viz/chart_components/crosshair.js ***!
  47973. \****************************************************************/
  47974. /*! dynamic exports provided */
  47975. /*! all exports used */
  47976. function(module, exports, __webpack_require__) {
  47977. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  47978. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  47979. var math = Math;
  47980. var mathAbs = math.abs;
  47981. var mathMin = math.min;
  47982. var mathMax = math.max;
  47983. var mathFloor = math.floor;
  47984. var HORIZONTAL = "horizontal";
  47985. var VERTICAL = "vertical";
  47986. var LABEL_BACKGROUND_PADDING_X = 8;
  47987. var LABEL_BACKGROUND_PADDING_Y = 4;
  47988. var CENTER = "center";
  47989. var RIGHT = "right";
  47990. var LEFT = "left";
  47991. var TOP = "top";
  47992. var BOTTOM = "bottom";
  47993. exports.getMargins = function() {
  47994. return {
  47995. x: LABEL_BACKGROUND_PADDING_X,
  47996. y: LABEL_BACKGROUND_PADDING_Y
  47997. }
  47998. };
  47999. function getRectangleBBox(bBox) {
  48000. return {
  48001. x: bBox.x - LABEL_BACKGROUND_PADDING_X,
  48002. y: bBox.y - LABEL_BACKGROUND_PADDING_Y,
  48003. width: bBox.width + 2 * LABEL_BACKGROUND_PADDING_X,
  48004. height: bBox.height + 2 * LABEL_BACKGROUND_PADDING_Y
  48005. }
  48006. }
  48007. function getLabelCheckerPosition(x, y, isHorizontal, canvas) {
  48008. var params = isHorizontal ? ["x", "width", "y", "height", y, 0] : ["y", "height", "x", "width", x, 1];
  48009. return function(bBox, position, coord) {
  48010. var labelCoord = {
  48011. x: coord.x,
  48012. y: coord.y
  48013. };
  48014. var rectangleBBox = getRectangleBBox(bBox);
  48015. var delta = isHorizontal ? coord.y - bBox.y - bBox.height / 2 : coord.y - bBox.y;
  48016. labelCoord.y = isHorizontal || !isHorizontal && position === BOTTOM ? coord.y + delta : coord.y;
  48017. if (rectangleBBox[params[0]] < 0) {
  48018. labelCoord[params[0]] -= rectangleBBox[params[0]]
  48019. } else {
  48020. if (rectangleBBox[params[0]] + rectangleBBox[params[1]] + delta * params[5] > canvas[params[1]]) {
  48021. labelCoord[params[0]] -= rectangleBBox[params[0]] + rectangleBBox[params[1]] + delta * params[5] - canvas[params[1]]
  48022. }
  48023. }
  48024. if (params[4] - rectangleBBox[params[3]] / 2 < 0) {
  48025. labelCoord[params[2]] -= params[4] - rectangleBBox[params[3]] / 2
  48026. } else {
  48027. if (params[4] + rectangleBBox[params[3]] / 2 > canvas[params[3]]) {
  48028. labelCoord[params[2]] -= params[4] + rectangleBBox[params[3]] / 2 - canvas[params[3]]
  48029. }
  48030. }
  48031. return labelCoord
  48032. }
  48033. }
  48034. function Crosshair(renderer, options, params, group) {
  48035. var that = this;
  48036. that._renderer = renderer;
  48037. that._crosshairGroup = group;
  48038. that._options = {};
  48039. that.update(options, params)
  48040. }
  48041. Crosshair.prototype = {
  48042. constructor: Crosshair,
  48043. update: function(options, params) {
  48044. var that = this;
  48045. var canvas = params.canvas;
  48046. that._canvas = {
  48047. top: canvas.top,
  48048. bottom: canvas.height - canvas.bottom,
  48049. left: canvas.left,
  48050. right: canvas.width - canvas.right,
  48051. width: canvas.width,
  48052. height: canvas.height
  48053. };
  48054. that._axes = params.axes;
  48055. that._panes = params.panes;
  48056. that._prepareOptions(options, HORIZONTAL);
  48057. that._prepareOptions(options, VERTICAL)
  48058. },
  48059. dispose: function() {
  48060. var that = this;
  48061. that._renderer = that._crosshairGroup = that._options = that._axes = that._canvas = that._horizontalGroup = that._verticalGroup = that._horizontal = that._vertical = that._circle = that._panes = null
  48062. },
  48063. _prepareOptions: function(options, direction) {
  48064. var lineOptions = options[direction + "Line"];
  48065. this._options[direction] = {
  48066. visible: lineOptions.visible,
  48067. line: {
  48068. stroke: lineOptions.color || options.color,
  48069. "stroke-width": lineOptions.width || options.width,
  48070. dashStyle: lineOptions.dashStyle || options.dashStyle,
  48071. opacity: lineOptions.opacity || options.opacity,
  48072. "stroke-linecap": "butt"
  48073. },
  48074. label: (0, _extend.extend)(true, {}, options.label, lineOptions.label)
  48075. }
  48076. },
  48077. _createLines: function(options, sharpParam, group) {
  48078. var lines = [];
  48079. var canvas = this._canvas;
  48080. var points = [canvas.left, canvas.top, canvas.left, canvas.top];
  48081. for (var i = 0; i < 2; i++) {
  48082. lines.push(this._renderer.path(points, "line").attr(options).sharp(sharpParam).append(group))
  48083. }
  48084. return lines
  48085. },
  48086. render: function() {
  48087. var that = this;
  48088. var renderer = that._renderer;
  48089. var options = that._options;
  48090. var verticalOptions = options.vertical;
  48091. var horizontalOptions = options.horizontal;
  48092. var extraOptions = horizontalOptions.visible ? horizontalOptions.line : verticalOptions.line;
  48093. var circleOptions = {
  48094. stroke: extraOptions.stroke,
  48095. "stroke-width": extraOptions["stroke-width"],
  48096. dashStyle: extraOptions.dashStyle,
  48097. opacity: extraOptions.opacity
  48098. };
  48099. var canvas = that._canvas;
  48100. that._horizontal = {};
  48101. that._vertical = {};
  48102. that._circle = renderer.circle(canvas.left, canvas.top, 0).attr(circleOptions).append(that._crosshairGroup);
  48103. that._horizontalGroup = renderer.g().append(that._crosshairGroup);
  48104. that._verticalGroup = renderer.g().append(that._crosshairGroup);
  48105. if (verticalOptions.visible) {
  48106. that._vertical.lines = that._createLines(verticalOptions.line, "h", that._verticalGroup);
  48107. that._vertical.labels = that._createLabels(that._axes[0], verticalOptions, false, that._verticalGroup)
  48108. }
  48109. if (horizontalOptions.visible) {
  48110. that._horizontal.lines = that._createLines(horizontalOptions.line, "v", that._horizontalGroup);
  48111. that._horizontal.labels = that._createLabels(that._axes[1], horizontalOptions, true, that._horizontalGroup)
  48112. }
  48113. that.hide()
  48114. },
  48115. _createLabels: function(axes, options, isHorizontal, group) {
  48116. var that = this;
  48117. var canvas = that._canvas;
  48118. var renderer = that._renderer;
  48119. var x;
  48120. var y;
  48121. var text;
  48122. var labels = [];
  48123. var background;
  48124. var currentLabelPos;
  48125. var labelOptions = options.label;
  48126. if (labelOptions.visible) {
  48127. axes.forEach(function(axis) {
  48128. var position = axis.getOptions().position;
  48129. if (axis.getTranslator().getBusinessRange().isEmpty()) {
  48130. return
  48131. }
  48132. currentLabelPos = axis.getLabelsPosition();
  48133. if (isHorizontal) {
  48134. y = canvas.top;
  48135. x = currentLabelPos
  48136. } else {
  48137. x = canvas.left;
  48138. y = currentLabelPos
  48139. }
  48140. var align = position === TOP || position === BOTTOM ? CENTER : position === RIGHT ? LEFT : RIGHT;
  48141. background = renderer.rect(0, 0, 0, 0).attr({
  48142. fill: labelOptions.backgroundColor || options.line.stroke
  48143. }).append(group);
  48144. text = renderer.text("0", 0, 0).css((0, _utils.patchFontOptions)(options.label.font)).attr({
  48145. align: align,
  48146. "class": labelOptions.cssClass
  48147. }).append(group);
  48148. labels.push({
  48149. text: text,
  48150. background: background,
  48151. axis: axis,
  48152. options: labelOptions,
  48153. pos: {
  48154. coord: currentLabelPos,
  48155. side: position
  48156. },
  48157. startXY: {
  48158. x: x,
  48159. y: y
  48160. }
  48161. })
  48162. })
  48163. }
  48164. return labels
  48165. },
  48166. _updateText: function(value, axisName, labels, point, func) {
  48167. var that = this;
  48168. labels.forEach(function(label) {
  48169. var axis = label.axis;
  48170. var coord = label.startXY;
  48171. var textElement = label.text;
  48172. var backgroundElement = label.background;
  48173. var text = "";
  48174. if (!axis.name || axis.name === axisName) {
  48175. text = axis.getFormattedValue(value, label.options, point)
  48176. }
  48177. if (text) {
  48178. textElement.attr({
  48179. text: text,
  48180. x: coord.x,
  48181. y: coord.y
  48182. });
  48183. textElement.attr(func(textElement.getBBox(), label.pos.side, coord));
  48184. that._updateLinesCanvas(label);
  48185. backgroundElement.attr(getRectangleBBox(textElement.getBBox()))
  48186. } else {
  48187. textElement.attr({
  48188. text: ""
  48189. });
  48190. backgroundElement.attr({
  48191. x: 0,
  48192. y: 0,
  48193. width: 0,
  48194. height: 0
  48195. })
  48196. }
  48197. })
  48198. },
  48199. hide: function() {
  48200. this._crosshairGroup.attr({
  48201. visibility: "hidden"
  48202. })
  48203. },
  48204. _updateLinesCanvas: function(label) {
  48205. var position = label.pos.side;
  48206. var labelCoord = label.pos.coord;
  48207. var coords = this._linesCanvas;
  48208. var canvas = this._canvas;
  48209. coords[position] = coords[position] !== canvas[position] && mathAbs(coords[position] - canvas[position]) < mathAbs(labelCoord - canvas[position]) ? coords[position] : labelCoord
  48210. },
  48211. _updateLines: function(lines, x, y, r, isHorizontal) {
  48212. var coords = this._linesCanvas;
  48213. var canvas = this._canvas;
  48214. var points = isHorizontal ? [
  48215. [mathMin(x - r, coords.left), canvas.top, x - r, canvas.top],
  48216. [x + r, canvas.top, mathMax(coords.right, x + r), canvas.top]
  48217. ] : [
  48218. [canvas.left, mathMin(coords.top, y - r), canvas.left, y - r],
  48219. [canvas.left, y + r, canvas.left, mathMax(coords.bottom, y + r)]
  48220. ];
  48221. for (var i = 0; i < 2; i++) {
  48222. lines[i].attr({
  48223. points: points[i]
  48224. }).sharp(isHorizontal ? "v" : "h", isHorizontal ? y === canvas.bottom ? -1 : 1 : x === canvas.right ? -1 : 1)
  48225. }
  48226. },
  48227. _resetLinesCanvas: function() {
  48228. var canvas = this._canvas;
  48229. this._linesCanvas = {
  48230. left: canvas.left,
  48231. right: canvas.right,
  48232. top: canvas.top,
  48233. bottom: canvas.bottom
  48234. }
  48235. },
  48236. _getClipRectForPane: function(x, y) {
  48237. var panes = this._panes;
  48238. var i;
  48239. var coords;
  48240. for (i = 0; i < panes.length; i++) {
  48241. coords = panes[i].coords;
  48242. if (coords.left <= x && coords.right >= x && coords.top <= y && coords.bottom >= y) {
  48243. return panes[i].clipRect
  48244. }
  48245. }
  48246. return {
  48247. id: null
  48248. }
  48249. },
  48250. show: function(data) {
  48251. var that = this;
  48252. var point = data.point;
  48253. var pointData = point.getCrosshairData(data.x, data.y);
  48254. var r = point.getPointRadius();
  48255. var horizontal = that._horizontal;
  48256. var vertical = that._vertical;
  48257. var rad = !r ? 0 : r + 3;
  48258. var canvas = that._canvas;
  48259. var x = mathFloor(pointData.x);
  48260. var y = mathFloor(pointData.y);
  48261. if (x >= canvas.left && x <= canvas.right && y >= canvas.top && y <= canvas.bottom) {
  48262. that._crosshairGroup.attr({
  48263. visibility: "visible"
  48264. });
  48265. that._resetLinesCanvas();
  48266. that._circle.attr({
  48267. cx: x,
  48268. cy: y,
  48269. r: rad,
  48270. "clip-path": that._getClipRectForPane(x, y).id
  48271. });
  48272. if (horizontal.lines) {
  48273. that._updateText(pointData.yValue, pointData.axis, horizontal.labels, point, getLabelCheckerPosition(x, y, true, canvas));
  48274. that._updateLines(horizontal.lines, x, y, rad, true);
  48275. that._horizontalGroup.attr({
  48276. translateY: y - canvas.top
  48277. })
  48278. }
  48279. if (vertical.lines) {
  48280. that._updateText(pointData.xValue, pointData.axis, vertical.labels, point, getLabelCheckerPosition(x, y, false, canvas));
  48281. that._updateLines(vertical.lines, x, y, rad, false);
  48282. that._verticalGroup.attr({
  48283. translateX: x - canvas.left
  48284. })
  48285. }
  48286. } else {
  48287. that.hide()
  48288. }
  48289. }
  48290. };
  48291. exports.Crosshair = Crosshair
  48292. },
  48293. /*!******************************************************!*\
  48294. !*** ./artifacts/transpiled/viz/core/annotations.js ***!
  48295. \******************************************************/
  48296. /*! dynamic exports provided */
  48297. /*! all exports used */
  48298. function(module, exports, __webpack_require__) {
  48299. Object.defineProperty(exports, "__esModule", {
  48300. value: true
  48301. });
  48302. exports.plugins = exports.__test_utils = exports.createAnnotations = void 0;
  48303. var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  48304. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  48305. var _tooltip = __webpack_require__( /*! ../core/tooltip */ 107);
  48306. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  48307. var _utils = __webpack_require__( /*! ./utils */ 10);
  48308. var _plaque = __webpack_require__( /*! ./plaque */ 403);
  48309. var _pointer = __webpack_require__( /*! ../../events/pointer */ 23);
  48310. var _pointer2 = _interopRequireDefault(_pointer);
  48311. var _drag = __webpack_require__( /*! ../../events/drag */ 56);
  48312. var _drag2 = _interopRequireDefault(_drag);
  48313. var _utils2 = __webpack_require__( /*! ../../events/utils */ 8);
  48314. var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  48315. var _events_engine2 = _interopRequireDefault(_events_engine);
  48316. function _interopRequireDefault(obj) {
  48317. return obj && obj.__esModule ? obj : {
  48318. "default": obj
  48319. }
  48320. }
  48321. var EVENT_NS = "annotations";
  48322. var DOT_EVENT_NS = "." + EVENT_NS;
  48323. var POINTER_ACTION = (0, _utils2.addNamespace)([_pointer2.default.down, _pointer2.default.move], EVENT_NS);
  48324. var POINTER_UP_EVENT_NAME = (0, _utils2.addNamespace)(_pointer2.default.up, EVENT_NS);
  48325. var DRAG_START_EVENT_NAME = _drag2.default.start + DOT_EVENT_NS;
  48326. var DRAG_EVENT_NAME = _drag2.default.move + DOT_EVENT_NS;
  48327. var DRAG_END_EVENT_NAME = _drag2.default.end + DOT_EVENT_NS;
  48328. function coreAnnotation(options, _draw) {
  48329. return {
  48330. type: options.type,
  48331. name: options.name,
  48332. x: options.x,
  48333. y: options.y,
  48334. value: options.value,
  48335. argument: options.argument,
  48336. axis: options.axis,
  48337. series: options.series,
  48338. options: options,
  48339. offsetX: options.offsetX,
  48340. offsetY: options.offsetY,
  48341. draw: function(widget, group) {
  48342. var _this = this;
  48343. var annotationGroup = widget._renderer.g().append(group);
  48344. this.plaque = new _plaque.Plaque(options, widget, annotationGroup, _draw.bind(this), (0, _type.isDefined)(options.value) || (0, _type.isDefined)(options.argument));
  48345. this.plaque.draw(widget._getAnnotationCoords(this));
  48346. if (options.allowDragging) {
  48347. annotationGroup.on(DRAG_START_EVENT_NAME, {
  48348. immediate: true
  48349. }, function(e) {
  48350. _this._dragOffsetX = _this.plaque.x - e.pageX;
  48351. _this._dragOffsetY = _this.plaque.y - e.pageY
  48352. }).on(DRAG_EVENT_NAME, function(e) {
  48353. _this.plaque.move(e.pageX + _this._dragOffsetX, e.pageY + _this._dragOffsetY)
  48354. }).on(DRAG_END_EVENT_NAME, function(e) {
  48355. _this.offsetX = (_this.offsetX || 0) + e.offset.x;
  48356. _this.offsetY = (_this.offsetY || 0) + e.offset.y
  48357. })
  48358. }
  48359. },
  48360. hitTest: function(x, y) {
  48361. return this.plaque.hitTest(x, y)
  48362. },
  48363. showTooltip: function(tooltip, _ref) {
  48364. var x = _ref.x,
  48365. y = _ref.y;
  48366. if (tooltip.annotation !== this) {
  48367. if (tooltip.show(this.options, {
  48368. x: x,
  48369. y: y
  48370. }, {
  48371. target: this.options
  48372. }, this.options.customizeTooltip)) {
  48373. tooltip.annotation = this
  48374. }
  48375. } else {
  48376. tooltip.move(x, y)
  48377. }
  48378. }
  48379. }
  48380. }
  48381. function labelAnnotation(options) {
  48382. return coreAnnotation(options, function(widget, group, _ref2) {
  48383. var width = _ref2.width,
  48384. height = _ref2.height;
  48385. var text = widget._renderer.text(options.text).css((0, _utils.patchFontOptions)(options.font)).attr({
  48386. "class": options.cssClass
  48387. }).append(group);
  48388. if ((0, _type.isDefined)(width) || (0, _type.isDefined)(height)) {
  48389. text.setMaxSize(width, height, {
  48390. wordWrap: options.wordWrap,
  48391. textOverflow: options.textOverflow
  48392. })
  48393. }
  48394. })
  48395. }
  48396. function imageAnnotation(options) {
  48397. var _ref3 = options.image || {},
  48398. width = _ref3.width,
  48399. height = _ref3.height,
  48400. url = _ref3.url,
  48401. location = _ref3.location;
  48402. return coreAnnotation(options, function(widget, group, _ref4) {
  48403. var outerWidth = _ref4.width,
  48404. outerHeight = _ref4.height;
  48405. var imageWidth = outerWidth > 0 ? Math.min(width, outerWidth) : width;
  48406. var imageHeight = outerHeight > 0 ? Math.min(height, outerHeight) : height;
  48407. widget._renderer.image(0, 0, imageWidth, imageHeight, url, location || "center").append(group)
  48408. })
  48409. }
  48410. function createAnnotation(item, commonOptions, customizeAnnotation) {
  48411. var options = (0, _extend.extend)(true, {}, commonOptions, item);
  48412. if (customizeAnnotation && customizeAnnotation.call) {
  48413. options = (0, _extend.extend)(true, options, customizeAnnotation(item))
  48414. }
  48415. if ("image" === options.type) {
  48416. return imageAnnotation(options)
  48417. } else {
  48418. if ("text" === options.type) {
  48419. return labelAnnotation(options)
  48420. }
  48421. }
  48422. }
  48423. var createAnnotations = exports.createAnnotations = function(items) {
  48424. var options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
  48425. var customizeAnnotation = arguments.length > 2 ? arguments[2] : void 0;
  48426. return items.reduce(function(arr, item) {
  48427. var annotation = createAnnotation(item, options, customizeAnnotation);
  48428. annotation && arr.push(annotation);
  48429. return arr
  48430. }, [])
  48431. };
  48432. exports.__test_utils = {
  48433. stub_createAnnotations: function(stub) {
  48434. this.old_createAnnotations = createAnnotations;
  48435. exports.createAnnotations = createAnnotations = stub
  48436. },
  48437. restore_createAnnotations: function() {
  48438. exports.createAnnotations = createAnnotations = this.old_createAnnotations
  48439. }
  48440. };
  48441. var chartPlugin = {
  48442. name: "annotations_chart",
  48443. init: function() {},
  48444. dispose: function() {},
  48445. members: {
  48446. _getAnnotationCoords: function(annotation) {
  48447. var coords = {
  48448. offsetX: annotation.offsetX,
  48449. offsetY: annotation.offsetY
  48450. };
  48451. var argCoordName = this._options.rotated ? "y" : "x";
  48452. var valCoordName = this._options.rotated ? "x" : "y";
  48453. var argAxis = this.getArgumentAxis();
  48454. var argument = argAxis.validateUnit(annotation.argument);
  48455. var axis = this.getValueAxis(annotation.axis);
  48456. var series;
  48457. var pane = (0, _type.isDefined)(axis) ? axis.pane : void 0;
  48458. if (annotation.series) {
  48459. series = this.series.filter(function(s) {
  48460. return s.name === annotation.series
  48461. })[0];
  48462. axis = series && series.getValueAxis();
  48463. (0, _type.isDefined)(axis) && (pane = axis.pane)
  48464. }
  48465. if ((0, _type.isDefined)(argument)) {
  48466. if (series) {
  48467. var center = series.getPointCenterByArg(argument);
  48468. center && (coords[argCoordName] = center[argCoordName])
  48469. } else {
  48470. coords[argCoordName] = argAxis.getTranslator().translate(argument)
  48471. }!(0, _type.isDefined)(pane) && (pane = argAxis.pane)
  48472. }
  48473. var value = axis && axis.validateUnit(annotation.value);
  48474. if ((0, _type.isDefined)(value)) {
  48475. coords[valCoordName] = axis && axis.getTranslator().translate(value);
  48476. !(0, _type.isDefined)(pane) && (0, _type.isDefined)(axis) && (pane = axis.pane)
  48477. }
  48478. coords.canvas = this._getCanvasForPane(pane);
  48479. if ((0, _type.isDefined)(coords[argCoordName]) && !(0, _type.isDefined)(value)) {
  48480. if (!(0, _type.isDefined)(axis) && !(0, _type.isDefined)(series)) {
  48481. coords[valCoordName] = argAxis.getAxisPosition()
  48482. } else {
  48483. if ((0, _type.isDefined)(axis) && !(0, _type.isDefined)(series)) {
  48484. coords[valCoordName] = this._argumentAxes.filter(function(a) {
  48485. return a.pane === axis.pane
  48486. })[0].getAxisPosition()
  48487. } else {
  48488. if ((0, _type.isDefined)(series) && series.checkSeriesViewportCoord(argAxis, coords[argCoordName])) {
  48489. coords[valCoordName] = series.getSeriesPairCoord(coords[argCoordName], true)
  48490. }
  48491. }
  48492. }
  48493. }
  48494. if (!(0, _type.isDefined)(argument) && (0, _type.isDefined)(coords[valCoordName])) {
  48495. if ((0, _type.isDefined)(axis) && !(0, _type.isDefined)(series)) {
  48496. coords[argCoordName] = axis.getAxisPosition()
  48497. } else {
  48498. if ((0, _type.isDefined)(series)) {
  48499. if (series.checkSeriesViewportCoord(axis, coords[valCoordName])) {
  48500. coords[argCoordName] = series.getSeriesPairCoord(coords[valCoordName], false)
  48501. }
  48502. }
  48503. }
  48504. }
  48505. return coords
  48506. },
  48507. _annotationsPointerEventHandler: function(event) {
  48508. var originalEvent = event.originalEvent || {};
  48509. var touch = originalEvent.touches && originalEvent.touches[0] || {};
  48510. var rootOffset = this._renderer.getRootOffset();
  48511. var coords = {
  48512. x: touch.pageX || originalEvent.pageX || event.pageX,
  48513. y: touch.pageY || originalEvent.pageY || event.pageY
  48514. };
  48515. var annotation = this._annotations.items.filter(function(a) {
  48516. return a.hitTest(coords.x - rootOffset.left, coords.y - rootOffset.top)
  48517. })[0];
  48518. if (!annotation || !annotation.options.tooltipEnabled) {
  48519. this._annotations.hideTooltip();
  48520. return
  48521. }
  48522. this.hideTooltip();
  48523. this.clearHover();
  48524. if (annotation.options.allowDragging && event.type === _pointer2.default.down) {
  48525. this._annotations._hideToolTipForDrag = true
  48526. }
  48527. if (!this._annotations._hideToolTipForDrag) {
  48528. annotation.showTooltip(this._annotations.tooltip, coords);
  48529. event.stopPropagation()
  48530. }
  48531. }
  48532. }
  48533. };
  48534. var corePlugin = {
  48535. name: "annotations_core",
  48536. init: function() {
  48537. this._annotations = {
  48538. items: [],
  48539. _hideToolTipForDrag: false,
  48540. tooltip: new _tooltip.Tooltip({
  48541. cssClass: "".concat(this._rootClassPrefix, "-annotation-tooltip"),
  48542. eventTrigger: this._eventTrigger,
  48543. widgetRoot: this.element()
  48544. }),
  48545. hideTooltip: function() {
  48546. this.tooltip.annotation = null;
  48547. this.tooltip.hide()
  48548. }
  48549. };
  48550. this._annotations.tooltip.setRendererOptions(this._getRendererOptions());
  48551. var tooltipOptions = (0, _extend.extend)({}, this._themeManager.getOptions("tooltip"));
  48552. tooltipOptions.customizeTooltip = void 0;
  48553. this._annotations.tooltip.update(tooltipOptions)
  48554. },
  48555. dispose: function() {
  48556. this._annotationsGroup.linkRemove().linkOff();
  48557. _events_engine2.default.off((0, _dom_adapter.getDocument)(), DOT_EVENT_NS);
  48558. this._annotationsGroup.off(DOT_EVENT_NS);
  48559. this._annotations.tooltip && this._annotations.tooltip.dispose()
  48560. },
  48561. extenders: {
  48562. _createHtmlStructure: function() {
  48563. var _this2 = this;
  48564. this._annotationsGroup = this._renderer.g().attr({
  48565. "class": "".concat(this._rootClassPrefix, "-annotations")
  48566. }).linkOn(this._renderer.root, "annotations").linkAppend();
  48567. _events_engine2.default.on((0, _dom_adapter.getDocument)(), POINTER_ACTION, function() {
  48568. return _this2._annotations.hideTooltip()
  48569. });
  48570. _events_engine2.default.on((0, _dom_adapter.getDocument)(), POINTER_UP_EVENT_NAME, function(event) {
  48571. _this2._annotations._hideToolTipForDrag = false;
  48572. _this2._annotationsPointerEventHandler(event)
  48573. });
  48574. this._annotationsGroup.on(POINTER_ACTION, this._annotationsPointerEventHandler.bind(this))
  48575. },
  48576. _renderExtraElements: function() {
  48577. var _this3 = this;
  48578. this._annotationsGroup.clear();
  48579. this._annotations.items.forEach(function(item) {
  48580. return item.draw(_this3, _this3._annotationsGroup)
  48581. })
  48582. },
  48583. _stopCurrentHandling: function() {
  48584. this._annotations.hideTooltip()
  48585. }
  48586. },
  48587. members: {
  48588. _buildAnnotations: function() {
  48589. this._annotations.items = [];
  48590. var items = this._getOption("annotations");
  48591. if (!items || !items.length) {
  48592. return
  48593. }
  48594. this._annotations.items = createAnnotations(items, this._getOption("commonAnnotationSettings"), this._getOption("customizeAnnotation"))
  48595. },
  48596. _getAnnotationCoords: function() {
  48597. return {}
  48598. }
  48599. },
  48600. customize: function(constructor) {
  48601. constructor.addChange({
  48602. code: "ANNOTATIONITEMS",
  48603. handler: function() {
  48604. this._requestChange(["ANNOTATIONS"])
  48605. },
  48606. isOptionChange: true,
  48607. option: "annotations"
  48608. });
  48609. constructor.addChange({
  48610. code: "ANNOTATIONSSETTINGS",
  48611. handler: function() {
  48612. this._requestChange(["ANNOTATIONS"])
  48613. },
  48614. isOptionChange: true,
  48615. option: "commonAnnotationSettings"
  48616. });
  48617. constructor.addChange({
  48618. code: "ANNOTATIONS",
  48619. handler: function() {
  48620. this._buildAnnotations();
  48621. this._change(["FORCE_RENDER"])
  48622. },
  48623. isThemeDependent: true,
  48624. isOptionChange: true
  48625. })
  48626. },
  48627. fontFields: ["commonAnnotationSettings.font"]
  48628. };
  48629. exports.plugins = {
  48630. core: corePlugin,
  48631. chart: chartPlugin
  48632. }
  48633. },
  48634. /*!**************************************************************!*\
  48635. !*** ./artifacts/transpiled/viz/translators/translator1d.js ***!
  48636. \**************************************************************/
  48637. /*! dynamic exports provided */
  48638. /*! all exports used */
  48639. function(module, exports, __webpack_require__) {
  48640. var _Number = Number;
  48641. function Translator1D() {
  48642. this.setDomain(arguments[0], arguments[1]).setCodomain(arguments[2], arguments[3])
  48643. }
  48644. Translator1D.prototype = {
  48645. constructor: Translator1D,
  48646. setDomain: function(domain1, domain2) {
  48647. var that = this;
  48648. that._domain1 = _Number(domain1);
  48649. that._domain2 = _Number(domain2);
  48650. that._domainDelta = that._domain2 - that._domain1;
  48651. return that
  48652. },
  48653. setCodomain: function(codomain1, codomain2) {
  48654. var that = this;
  48655. that._codomain1 = _Number(codomain1);
  48656. that._codomain2 = _Number(codomain2);
  48657. that._codomainDelta = that._codomain2 - that._codomain1;
  48658. return that
  48659. },
  48660. getDomain: function() {
  48661. return [this._domain1, this._domain2]
  48662. },
  48663. getCodomain: function() {
  48664. return [this._codomain1, this._codomain2]
  48665. },
  48666. getDomainStart: function() {
  48667. return this._domain1
  48668. },
  48669. getDomainEnd: function() {
  48670. return this._domain2
  48671. },
  48672. getCodomainStart: function() {
  48673. return this._codomain1
  48674. },
  48675. getCodomainEnd: function() {
  48676. return this._codomain2
  48677. },
  48678. getDomainRange: function() {
  48679. return this._domainDelta
  48680. },
  48681. getCodomainRange: function() {
  48682. return this._codomainDelta
  48683. },
  48684. translate: function(value) {
  48685. var ratio = (_Number(value) - this._domain1) / this._domainDelta;
  48686. return 0 <= ratio && ratio <= 1 ? this._codomain1 + ratio * this._codomainDelta : NaN
  48687. },
  48688. adjust: function(value) {
  48689. var ratio = (_Number(value) - this._domain1) / this._domainDelta;
  48690. var result = NaN;
  48691. if (ratio < 0) {
  48692. result = this._domain1
  48693. } else {
  48694. if (ratio > 1) {
  48695. result = this._domain2
  48696. } else {
  48697. if (0 <= ratio && ratio <= 1) {
  48698. result = _Number(value)
  48699. }
  48700. }
  48701. }
  48702. return result
  48703. }
  48704. };
  48705. exports.Translator1D = Translator1D
  48706. },
  48707. /*!*****************************************************************!*\
  48708. !*** ./artifacts/transpiled/viz/gauges/base_range_container.js ***!
  48709. \*****************************************************************/
  48710. /*! dynamic exports provided */
  48711. /*! all exports used */
  48712. function(module, exports, __webpack_require__) {
  48713. var iterateUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  48714. var BaseElement = __webpack_require__( /*! ./base_indicators */ 250).BaseElement;
  48715. var _Number = Number;
  48716. var _abs = Math.abs;
  48717. var _isString = __webpack_require__( /*! ../../core/utils/type */ 1).isString;
  48718. var _isArray = Array.isArray;
  48719. var _isFinite = isFinite;
  48720. var _each = iterateUtils.each;
  48721. var BaseRangeContainer = BaseElement.inherit({
  48722. _init: function() {
  48723. this._root = this._renderer.g().attr({
  48724. "class": "dxg-range-container"
  48725. }).linkOn(this._container, "range-container")
  48726. },
  48727. _dispose: function() {
  48728. this._root.linkOff()
  48729. },
  48730. clean: function() {
  48731. this._root.linkRemove().clear();
  48732. this._options = this.enabled = null;
  48733. return this
  48734. },
  48735. _getRanges: function() {
  48736. var that = this;
  48737. var options = that._options;
  48738. var translator = that._translator;
  48739. var totalStart = translator.getDomain()[0];
  48740. var totalEnd = translator.getDomain()[1];
  48741. var totalDelta = totalEnd - totalStart;
  48742. var isNotEmptySegment = totalDelta >= 0 ? isNotEmptySegmentAsc : isNotEmptySegmentDesc;
  48743. var subtractSegment = totalDelta >= 0 ? subtractSegmentAsc : subtractSegmentDesc;
  48744. var list = [];
  48745. var ranges = [];
  48746. var backgroundRanges = [{
  48747. start: totalStart,
  48748. end: totalEnd
  48749. }];
  48750. var threshold = _abs(totalDelta) / 1e4;
  48751. var backgroundColor = _isString(options.backgroundColor) ? options.backgroundColor : "none";
  48752. var width = options.width || {};
  48753. var startWidth = _Number(width > 0 ? width : width.start);
  48754. var endWidth = _Number(width > 0 ? width : width.end);
  48755. var deltaWidth = endWidth - startWidth;
  48756. if (void 0 !== options.ranges && !_isArray(options.ranges)) {
  48757. return null
  48758. }
  48759. if (!(startWidth >= 0 && endWidth >= 0 && startWidth + endWidth > 0)) {
  48760. return null
  48761. }
  48762. list = (_isArray(options.ranges) ? options.ranges : []).reduce(function(result, rangeOptions, i) {
  48763. rangeOptions = rangeOptions || {};
  48764. var start = translator.adjust(rangeOptions.startValue);
  48765. var end = translator.adjust(rangeOptions.endValue);
  48766. if (_isFinite(start) && _isFinite(end) && isNotEmptySegment(start, end, threshold)) {
  48767. result.push({
  48768. start: start,
  48769. end: end,
  48770. color: rangeOptions.color,
  48771. classIndex: i
  48772. })
  48773. }
  48774. return result
  48775. }, []);
  48776. var palette = that._themeManager.createPalette(options.palette, {
  48777. type: "indicatingSet",
  48778. extensionMode: options.paletteExtensionMode,
  48779. keepLastColorInEnd: true,
  48780. count: list.length
  48781. });
  48782. _each(list, function(_, item) {
  48783. var paletteColor = palette.getNextColor();
  48784. item.color = _isString(item.color) && item.color || paletteColor || "none";
  48785. item.className = "dxg-range dxg-range-" + item.classIndex;
  48786. delete item.classIndex
  48787. });
  48788. _each(list, function(_, item) {
  48789. var i;
  48790. var ii;
  48791. var sub;
  48792. var subs;
  48793. var range;
  48794. var newRanges = [];
  48795. var newBackgroundRanges = [];
  48796. for (i = 0, ii = ranges.length; i < ii; ++i) {
  48797. range = ranges[i];
  48798. subs = subtractSegment(range.start, range.end, item.start, item.end);
  48799. (sub = subs[0]) && (sub.color = range.color) && (sub.className = range.className) && newRanges.push(sub);
  48800. (sub = subs[1]) && (sub.color = range.color) && (sub.className = range.className) && newRanges.push(sub)
  48801. }
  48802. newRanges.push(item);
  48803. ranges = newRanges;
  48804. for (i = 0, ii = backgroundRanges.length; i < ii; ++i) {
  48805. range = backgroundRanges[i];
  48806. subs = subtractSegment(range.start, range.end, item.start, item.end);
  48807. (sub = subs[0]) && newBackgroundRanges.push(sub);
  48808. (sub = subs[1]) && newBackgroundRanges.push(sub)
  48809. }
  48810. backgroundRanges = newBackgroundRanges
  48811. });
  48812. _each(backgroundRanges, function(_, range) {
  48813. range.color = backgroundColor;
  48814. range.className = "dxg-range dxg-background-range";
  48815. ranges.push(range)
  48816. });
  48817. _each(ranges, function(_, range) {
  48818. range.startWidth = (range.start - totalStart) / totalDelta * deltaWidth + startWidth;
  48819. range.endWidth = (range.end - totalStart) / totalDelta * deltaWidth + startWidth
  48820. });
  48821. return ranges
  48822. },
  48823. render: function(options) {
  48824. var that = this;
  48825. that._options = options;
  48826. that._processOptions();
  48827. that._ranges = that._getRanges();
  48828. if (that._ranges) {
  48829. that.enabled = true;
  48830. that._root.linkAppend()
  48831. }
  48832. return that
  48833. },
  48834. resize: function(layout) {
  48835. var that = this;
  48836. that._root.clear();
  48837. if (that._isVisible(layout)) {
  48838. _each(that._ranges, function(_, range) {
  48839. that._createRange(range, layout).attr({
  48840. fill: range.color,
  48841. "class": range.className
  48842. }).append(that._root)
  48843. })
  48844. }
  48845. return that
  48846. },
  48847. _processOptions: null,
  48848. _isVisible: null,
  48849. _createRange: null,
  48850. getColorForValue: function(value) {
  48851. var color = null;
  48852. _each(this._ranges, function(_, range) {
  48853. if (range.start <= value && value <= range.end || range.start >= value && value >= range.end) {
  48854. color = range.color;
  48855. return false
  48856. }
  48857. });
  48858. return color
  48859. }
  48860. });
  48861. function subtractSegmentAsc(segmentStart, segmentEnd, otherStart, otherEnd) {
  48862. var result;
  48863. if (otherStart > segmentStart && otherEnd < segmentEnd) {
  48864. result = [{
  48865. start: segmentStart,
  48866. end: otherStart
  48867. }, {
  48868. start: otherEnd,
  48869. end: segmentEnd
  48870. }]
  48871. } else {
  48872. if (otherStart >= segmentEnd || otherEnd <= segmentStart) {
  48873. result = [{
  48874. start: segmentStart,
  48875. end: segmentEnd
  48876. }]
  48877. } else {
  48878. if (otherStart <= segmentStart && otherEnd >= segmentEnd) {
  48879. result = []
  48880. } else {
  48881. if (otherStart > segmentStart) {
  48882. result = [{
  48883. start: segmentStart,
  48884. end: otherStart
  48885. }]
  48886. } else {
  48887. if (otherEnd < segmentEnd) {
  48888. result = [{
  48889. start: otherEnd,
  48890. end: segmentEnd
  48891. }]
  48892. }
  48893. }
  48894. }
  48895. }
  48896. }
  48897. return result
  48898. }
  48899. function subtractSegmentDesc(segmentStart, segmentEnd, otherStart, otherEnd) {
  48900. var result;
  48901. if (otherStart < segmentStart && otherEnd > segmentEnd) {
  48902. result = [{
  48903. start: segmentStart,
  48904. end: otherStart
  48905. }, {
  48906. start: otherEnd,
  48907. end: segmentEnd
  48908. }]
  48909. } else {
  48910. if (otherStart <= segmentEnd || otherEnd >= segmentStart) {
  48911. result = [{
  48912. start: segmentStart,
  48913. end: segmentEnd
  48914. }]
  48915. } else {
  48916. if (otherStart >= segmentStart && otherEnd <= segmentEnd) {
  48917. result = []
  48918. } else {
  48919. if (otherStart < segmentStart) {
  48920. result = [{
  48921. start: segmentStart,
  48922. end: otherStart
  48923. }]
  48924. } else {
  48925. if (otherEnd > segmentEnd) {
  48926. result = [{
  48927. start: otherEnd,
  48928. end: segmentEnd
  48929. }]
  48930. }
  48931. }
  48932. }
  48933. }
  48934. }
  48935. return result
  48936. }
  48937. function isNotEmptySegmentAsc(start, end, threshold) {
  48938. return end - start >= threshold
  48939. }
  48940. function isNotEmptySegmentDesc(start, end, threshold) {
  48941. return start - end >= threshold
  48942. }
  48943. module.exports = BaseRangeContainer
  48944. },
  48945. /*!***********************************************************!*\
  48946. !*** ./artifacts/transpiled/viz/gauges/circular_gauge.js ***!
  48947. \***********************************************************/
  48948. /*! dynamic exports provided */
  48949. /*! all exports used */
  48950. function(module, exports, __webpack_require__) {
  48951. var _isFinite = isFinite;
  48952. var registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9);
  48953. var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
  48954. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  48955. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  48956. var dxBaseGauge = __webpack_require__( /*! ./base_gauge */ 145).dxBaseGauge;
  48957. var dxGauge = __webpack_require__( /*! ./common */ 205).dxGauge;
  48958. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  48959. var _normalizeAngle = vizUtils.normalizeAngle;
  48960. var _getCosAndSin = vizUtils.getCosAndSin;
  48961. var circularIndicatorsModule = __webpack_require__( /*! ./circular_indicators */ 799);
  48962. var createIndicatorCreator = __webpack_require__( /*! ./common */ 205).createIndicatorCreator;
  48963. var CircularRangeContainer = __webpack_require__( /*! ./circular_range_container */ 800);
  48964. var _abs = Math.abs;
  48965. var _max = Math.max;
  48966. var _min = Math.min;
  48967. var _round = Math.round;
  48968. var _each = each;
  48969. var PI = Math.PI;
  48970. function getSides(startAngle, endAngle) {
  48971. var startCosSin = _getCosAndSin(startAngle);
  48972. var endCosSin = _getCosAndSin(endAngle);
  48973. var startCos = startCosSin.cos;
  48974. var startSin = startCosSin.sin;
  48975. var endCos = endCosSin.cos;
  48976. var endSin = endCosSin.sin;
  48977. return {
  48978. left: startSin <= 0 && endSin >= 0 || startSin <= 0 && endSin <= 0 && startCos <= endCos || startSin >= 0 && endSin >= 0 && startCos >= endCos ? -1 : _min(startCos, endCos, 0),
  48979. right: startSin >= 0 && endSin <= 0 || startSin >= 0 && endSin >= 0 && startCos >= endCos || startSin <= 0 && endSin <= 0 && startCos <= endCos ? 1 : _max(startCos, endCos, 0),
  48980. up: startCos <= 0 && endCos >= 0 || startCos <= 0 && endCos <= 0 && startSin >= endSin || startCos >= 0 && endCos >= 0 && startSin <= endSin ? -1 : -_max(startSin, endSin, 0),
  48981. down: startCos >= 0 && endCos <= 0 || startCos >= 0 && endCos >= 0 && startSin <= endSin || startCos <= 0 && endCos <= 0 && startSin >= endSin ? 1 : -_min(startSin, endSin, 0)
  48982. }
  48983. }
  48984. var dxCircularGauge = dxGauge.inherit({
  48985. _rootClass: "dxg-circular-gauge",
  48986. _factoryMethods: {
  48987. rangeContainer: "createCircularRangeContainer",
  48988. indicator: "createCircularIndicator"
  48989. },
  48990. _gridSpacingFactor: 17,
  48991. _scaleTypes: {
  48992. type: "polarAxes",
  48993. drawingType: "circular"
  48994. },
  48995. _getThemeManagerOptions: function() {
  48996. var options = this.callBase.apply(this, arguments);
  48997. options.subTheme = "_circular";
  48998. return options
  48999. },
  49000. _updateScaleTickIndent: function(scaleOptions) {
  49001. var indentFromTick = scaleOptions.label.indentFromTick;
  49002. var length = scaleOptions.tick.visible ? scaleOptions.tick.length : 0;
  49003. var textParams = this._scale.measureLabels(extend({}, this._canvas));
  49004. var tickCorrection = length;
  49005. if ("inside" === scaleOptions.orientation) {
  49006. tickCorrection = 0
  49007. } else {
  49008. if ("center" === scaleOptions.orientation) {
  49009. tickCorrection = .5 * length
  49010. }
  49011. }
  49012. scaleOptions.label.indentFromAxis = indentFromTick >= 0 ? indentFromTick + tickCorrection : indentFromTick - tickCorrection - _max(textParams.width, textParams.height);
  49013. this._scale.updateOptions(scaleOptions)
  49014. },
  49015. _setupCodomain: function() {
  49016. var that = this;
  49017. var geometry = that.option("geometry") || {};
  49018. var startAngle = geometry.startAngle;
  49019. var endAngle = geometry.endAngle;
  49020. var sides;
  49021. startAngle = _isFinite(startAngle) ? _normalizeAngle(startAngle) : 225;
  49022. endAngle = _isFinite(endAngle) ? _normalizeAngle(endAngle) : -45;
  49023. if (_abs(startAngle - endAngle) < 1) {
  49024. endAngle -= 360;
  49025. sides = {
  49026. left: -1,
  49027. up: -1,
  49028. right: 1,
  49029. down: 1
  49030. }
  49031. } else {
  49032. startAngle < endAngle && (endAngle -= 360);
  49033. sides = getSides(startAngle, endAngle)
  49034. }
  49035. that._area = {
  49036. x: 0,
  49037. y: 0,
  49038. radius: 100,
  49039. startCoord: startAngle,
  49040. endCoord: endAngle,
  49041. sides: sides
  49042. };
  49043. that._translator.setCodomain(startAngle, endAngle)
  49044. },
  49045. _shiftScale: function(layout) {
  49046. var scale = this._scale;
  49047. var canvas = scale.getCanvas();
  49048. canvas.width = canvas.height = 2 * layout.radius;
  49049. scale.draw(canvas);
  49050. var centerCoords = scale.getCenter();
  49051. scale.shift({
  49052. right: layout.x - centerCoords.x,
  49053. bottom: layout.y - centerCoords.y
  49054. })
  49055. },
  49056. _getScaleLayoutValue: function() {
  49057. return this._area.radius
  49058. },
  49059. _getTicksOrientation: function(scaleOptions) {
  49060. return scaleOptions.orientation
  49061. },
  49062. _getTicksCoefficients: function(options) {
  49063. var coefs = {
  49064. inner: 0,
  49065. outer: 1
  49066. };
  49067. if ("inside" === options.orientation) {
  49068. coefs.inner = 1;
  49069. coefs.outer = 0
  49070. } else {
  49071. if ("center" === options.orientation) {
  49072. coefs.inner = coefs.outer = .5
  49073. }
  49074. }
  49075. return coefs
  49076. },
  49077. _correctScaleIndents: function(result, indentFromTick, textParams) {
  49078. if (indentFromTick >= 0) {
  49079. result.horizontalOffset = indentFromTick + textParams.width;
  49080. result.verticalOffset = indentFromTick + textParams.height
  49081. } else {
  49082. result.horizontalOffset = result.verticalOffset = 0;
  49083. result.min -= -indentFromTick + _max(textParams.width, textParams.height)
  49084. }
  49085. result.inverseHorizontalOffset = textParams.width / 2;
  49086. result.inverseVerticalOffset = textParams.height / 2
  49087. },
  49088. _measureMainElements: function(elements, scaleMeasurement) {
  49089. var that = this;
  49090. var radius = that._area.radius;
  49091. var maxRadius = 0;
  49092. var minRadius = 1 / 0;
  49093. var maxHorizontalOffset = 0;
  49094. var maxVerticalOffset = 0;
  49095. var maxInverseHorizontalOffset = 0;
  49096. var maxInverseVerticalOffset = 0;
  49097. var scale = that._scale;
  49098. _each(elements.concat(scale), function(_, element) {
  49099. var bounds = element.measure ? element.measure({
  49100. radius: radius - element.getOffset()
  49101. }) : scaleMeasurement;
  49102. bounds.min > 0 && (minRadius = _min(minRadius, bounds.min));
  49103. bounds.max > 0 && (maxRadius = _max(maxRadius, bounds.max));
  49104. bounds.horizontalOffset > 0 && (maxHorizontalOffset = _max(maxHorizontalOffset, bounds.max + bounds.horizontalOffset));
  49105. bounds.verticalOffset > 0 && (maxVerticalOffset = _max(maxVerticalOffset, bounds.max + bounds.verticalOffset));
  49106. bounds.inverseHorizontalOffset > 0 && (maxInverseHorizontalOffset = _max(maxInverseHorizontalOffset, bounds.inverseHorizontalOffset));
  49107. bounds.inverseVerticalOffset > 0 && (maxInverseVerticalOffset = _max(maxInverseVerticalOffset, bounds.inverseVerticalOffset))
  49108. });
  49109. maxHorizontalOffset = _max(maxHorizontalOffset - maxRadius, 0);
  49110. maxVerticalOffset = _max(maxVerticalOffset - maxRadius, 0);
  49111. return {
  49112. minRadius: minRadius,
  49113. maxRadius: maxRadius,
  49114. horizontalMargin: maxHorizontalOffset,
  49115. verticalMargin: maxVerticalOffset,
  49116. inverseHorizontalMargin: maxInverseHorizontalOffset,
  49117. inverseVerticalMargin: maxInverseVerticalOffset
  49118. }
  49119. },
  49120. _applyMainLayout: function(elements, scaleMeasurement) {
  49121. var measurements = this._measureMainElements(elements, scaleMeasurement);
  49122. var area = this._area;
  49123. var sides = area.sides;
  49124. var margins = {
  49125. left: (sides.left < -.1 ? measurements.horizontalMargin : measurements.inverseHorizontalMargin) || 0,
  49126. right: (sides.right > .1 ? measurements.horizontalMargin : measurements.inverseHorizontalMargin) || 0,
  49127. top: (sides.up < -.1 ? measurements.verticalMargin : measurements.inverseVerticalMargin) || 0,
  49128. bottom: (sides.down > .1 ? measurements.verticalMargin : measurements.inverseVerticalMargin) || 0
  49129. };
  49130. var rect = selectRectByAspectRatio(this._innerRect, (sides.down - sides.up) / (sides.right - sides.left), margins);
  49131. var radius = _min(getWidth(rect) / (sides.right - sides.left), getHeight(rect) / (sides.down - sides.up));
  49132. radius = radius - measurements.maxRadius + area.radius;
  49133. var x = rect.left - getWidth(rect) * sides.left / (sides.right - sides.left);
  49134. var y = rect.top - getHeight(rect) * sides.up / (sides.down - sides.up);
  49135. area.x = _round(x);
  49136. area.y = _round(y);
  49137. area.radius = radius;
  49138. rect.left -= margins.left;
  49139. rect.right += margins.right;
  49140. rect.top -= margins.top;
  49141. rect.bottom += margins.bottom;
  49142. this._innerRect = rect
  49143. },
  49144. _getElementLayout: function(offset) {
  49145. return {
  49146. x: this._area.x,
  49147. y: this._area.y,
  49148. radius: _round(this._area.radius - offset)
  49149. }
  49150. },
  49151. _getApproximateScreenRange: function() {
  49152. var that = this;
  49153. var area = that._area;
  49154. var r = _min(that._canvas.width / (area.sides.right - area.sides.left), that._canvas.height / (area.sides.down - area.sides.up));
  49155. r > area.totalRadius && (r = area.totalRadius);
  49156. r = .8 * r;
  49157. return -that._translator.getCodomainRange() * r * PI / 180
  49158. },
  49159. _getDefaultSize: function() {
  49160. return {
  49161. width: 300,
  49162. height: 300
  49163. }
  49164. },
  49165. _factory: objectUtils.clone(dxBaseGauge.prototype._factory)
  49166. });
  49167. function getWidth(rect) {
  49168. return rect.right - rect.left
  49169. }
  49170. function getHeight(rect) {
  49171. return rect.bottom - rect.top
  49172. }
  49173. function selectRectByAspectRatio(srcRect, aspectRatio, margins) {
  49174. var rect = extend({}, srcRect);
  49175. var selfAspectRatio;
  49176. var width = 0;
  49177. var height = 0;
  49178. margins = margins || {};
  49179. if (aspectRatio > 0) {
  49180. rect.left += margins.left || 0;
  49181. rect.right -= margins.right || 0;
  49182. rect.top += margins.top || 0;
  49183. rect.bottom -= margins.bottom || 0;
  49184. if (getWidth(rect) > 0 && getHeight(rect) > 0) {
  49185. selfAspectRatio = getHeight(rect) / getWidth(rect);
  49186. if (selfAspectRatio > 1) {
  49187. aspectRatio < selfAspectRatio ? width = getWidth(rect) : height = getHeight(rect)
  49188. } else {
  49189. aspectRatio > selfAspectRatio ? height = getHeight(rect) : width = getWidth(rect)
  49190. }
  49191. width > 0 || (width = height / aspectRatio);
  49192. height > 0 || (height = width * aspectRatio);
  49193. width = (getWidth(rect) - width) / 2;
  49194. height = (getHeight(rect) - height) / 2;
  49195. rect.left += width;
  49196. rect.right -= width;
  49197. rect.top += height;
  49198. rect.bottom -= height
  49199. } else {
  49200. rect.left = rect.right = (rect.left + rect.right) / 2;
  49201. rect.top = rect.bottom = (rect.top + rect.bottom) / 2
  49202. }
  49203. }
  49204. return rect
  49205. }
  49206. dxCircularGauge._TESTS_selectRectByAspectRatio = selectRectByAspectRatio;
  49207. var indicators = dxCircularGauge.prototype._factory.indicators = {};
  49208. dxCircularGauge.prototype._factory.createIndicator = createIndicatorCreator(indicators);
  49209. indicators._default = circularIndicatorsModule._default;
  49210. indicators.rectangleneedle = circularIndicatorsModule.rectangleneedle;
  49211. indicators.triangleneedle = circularIndicatorsModule.triangleneedle;
  49212. indicators.twocolorneedle = circularIndicatorsModule.twocolorneedle;
  49213. indicators.trianglemarker = circularIndicatorsModule.trianglemarker;
  49214. indicators.textcloud = circularIndicatorsModule.textcloud;
  49215. indicators.rangebar = circularIndicatorsModule.rangebar;
  49216. dxCircularGauge.prototype._factory.RangeContainer = CircularRangeContainer;
  49217. registerComponent("dxCircularGauge", dxCircularGauge);
  49218. module.exports = dxCircularGauge
  49219. },
  49220. /*!****************************************************************!*\
  49221. !*** ./artifacts/transpiled/viz/vector_map/projection.main.js ***!
  49222. \****************************************************************/
  49223. /*! dynamic exports provided */
  49224. /*! all exports used */
  49225. function(module, exports, __webpack_require__) {
  49226. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  49227. var eventEmitterModule = __webpack_require__( /*! ./event_emitter */ 416);
  49228. var _Number = Number;
  49229. var _min = Math.min;
  49230. var _max = Math.max;
  49231. var _abs = Math.abs;
  49232. var _round = Math.round;
  49233. var _ln = Math.log;
  49234. var _pow = Math.pow;
  49235. var TWO_TO_LN2 = 2 / Math.LN2;
  49236. var MIN_BOUNDS_RANGE = 1 / 3600 / 180 / 10;
  49237. var DEFAULT_MIN_ZOOM = 1;
  49238. var DEFAULT_MAX_ZOOM = 256;
  49239. var DEFAULT_CENTER = [NaN, NaN];
  49240. var DEFAULT_ENGINE_NAME = "mercator";
  49241. function floatsEqual(f1, f2) {
  49242. return _abs(f1 - f2) < 1e-8
  49243. }
  49244. function arraysEqual(a1, a2) {
  49245. return floatsEqual(a1[0], a2[0]) && floatsEqual(a1[1], a2[1])
  49246. }
  49247. function parseAndClamp(value, minValue, maxValue, defaultValue) {
  49248. var val = _Number(value);
  49249. return isFinite(val) ? _min(_max(val, minValue), maxValue) : defaultValue
  49250. }
  49251. function parseAndClampArray(value, minValue, maxValue, defaultValue) {
  49252. return [parseAndClamp(value[0], minValue[0], maxValue[0], defaultValue[0]), parseAndClamp(value[1], minValue[1], maxValue[1], defaultValue[1])]
  49253. }
  49254. function getEngine(engine) {
  49255. return engine instanceof Engine && engine || projection.get(engine) || projection.get(DEFAULT_ENGINE_NAME)
  49256. }
  49257. function Projection(parameters) {
  49258. var that = this;
  49259. that._initEvents();
  49260. that._params = parameters;
  49261. that._engine = getEngine();
  49262. that._center = that._engine.center();
  49263. that._adjustCenter()
  49264. }
  49265. Projection.prototype = {
  49266. constructor: Projection,
  49267. _minZoom: DEFAULT_MIN_ZOOM,
  49268. _maxZoom: DEFAULT_MAX_ZOOM,
  49269. _zoom: DEFAULT_MIN_ZOOM,
  49270. _center: DEFAULT_CENTER,
  49271. _canvas: {},
  49272. _scale: [],
  49273. dispose: function() {
  49274. this._disposeEvents()
  49275. },
  49276. setEngine: function(value) {
  49277. var that = this;
  49278. var engine = getEngine(value);
  49279. if (that._engine !== engine) {
  49280. that._engine = engine;
  49281. that._fire("engine");
  49282. if (that._changeCenter(engine.center())) {
  49283. that._triggerCenterChanged()
  49284. }
  49285. if (that._changeZoom(that._minZoom)) {
  49286. that._triggerZoomChanged()
  49287. }
  49288. that._adjustCenter();
  49289. that._setupScreen()
  49290. }
  49291. },
  49292. setBounds: function(bounds) {
  49293. if (void 0 !== bounds) {
  49294. this.setEngine(this._engine.original().bounds(bounds))
  49295. }
  49296. },
  49297. _setupScreen: function() {
  49298. var that = this;
  49299. var canvas = that._canvas;
  49300. var width = canvas.width;
  49301. var height = canvas.height;
  49302. var aspectRatio = that._engine.ar();
  49303. that._x0 = canvas.left + width / 2;
  49304. that._y0 = canvas.top + height / 2;
  49305. if (width / height <= aspectRatio) {
  49306. that._xRadius = width / 2;
  49307. that._yRadius = width / 2 / aspectRatio
  49308. } else {
  49309. that._xRadius = height / 2 * aspectRatio;
  49310. that._yRadius = height / 2
  49311. }
  49312. that._fire("screen")
  49313. },
  49314. setSize: function(canvas) {
  49315. var that = this;
  49316. that._canvas = canvas;
  49317. that._setupScreen()
  49318. },
  49319. _toScreen: function(coordinates) {
  49320. return [this._x0 + this._xRadius * coordinates[0], this._y0 + this._yRadius * coordinates[1]]
  49321. },
  49322. _fromScreen: function(coordinates) {
  49323. return [(coordinates[0] - this._x0) / this._xRadius, (coordinates[1] - this._y0) / this._yRadius]
  49324. },
  49325. _toTransformed: function(coordinates) {
  49326. return [coordinates[0] * this._zoom + this._xCenter, coordinates[1] * this._zoom + this._yCenter]
  49327. },
  49328. _toTransformedFast: function(coordinates) {
  49329. return [coordinates[0] * this._zoom, coordinates[1] * this._zoom]
  49330. },
  49331. _fromTransformed: function(coordinates) {
  49332. return [(coordinates[0] - this._xCenter) / this._zoom, (coordinates[1] - this._yCenter) / this._zoom]
  49333. },
  49334. _adjustCenter: function() {
  49335. var that = this;
  49336. var center = that._engine.project(that._center);
  49337. that._xCenter = -center[0] * that._zoom || 0;
  49338. that._yCenter = -center[1] * that._zoom || 0
  49339. },
  49340. project: function(coordinates) {
  49341. return this._engine.project(coordinates)
  49342. },
  49343. transform: function(coordinates) {
  49344. return this._toScreen(this._toTransformedFast(coordinates))
  49345. },
  49346. isInvertible: function() {
  49347. return this._engine.isInvertible()
  49348. },
  49349. getSquareSize: function(size) {
  49350. return [size[0] * this._zoom * this._xRadius, size[1] * this._zoom * this._yRadius]
  49351. },
  49352. getZoom: function() {
  49353. return this._zoom
  49354. },
  49355. _changeZoom: function(value) {
  49356. var that = this;
  49357. var oldZoom = that._zoom;
  49358. var newZoom = that._zoom = parseAndClamp(value, that._minZoom, that._maxZoom, that._minZoom);
  49359. var isChanged = !floatsEqual(oldZoom, newZoom);
  49360. if (isChanged) {
  49361. that._adjustCenter();
  49362. that._fire("zoom")
  49363. }
  49364. return isChanged
  49365. },
  49366. setZoom: function(value) {
  49367. if (this._engine.isInvertible() && this._changeZoom(value)) {
  49368. this._triggerZoomChanged()
  49369. }
  49370. },
  49371. getScaledZoom: function() {
  49372. return _round((this._scale.length - 1) * _ln(this._zoom) / _ln(this._maxZoom))
  49373. },
  49374. setScaledZoom: function(scaledZoom) {
  49375. this.setZoom(this._scale[_round(scaledZoom)])
  49376. },
  49377. changeScaledZoom: function(deltaZoom) {
  49378. this.setZoom(this._scale[_max(_min(_round(this.getScaledZoom() + deltaZoom), this._scale.length - 1), 0)])
  49379. },
  49380. getZoomScalePartition: function() {
  49381. return this._scale.length - 1
  49382. },
  49383. _setupScaling: function() {
  49384. var that = this;
  49385. var k = _round(TWO_TO_LN2 * _ln(that._maxZoom));
  49386. var i = 1;
  49387. k = k > 4 ? k : 4;
  49388. var step = _pow(that._maxZoom, 1 / k);
  49389. var zoom = that._minZoom;
  49390. that._scale = [zoom];
  49391. for (; i <= k; ++i) {
  49392. that._scale.push(zoom *= step)
  49393. }
  49394. },
  49395. setMaxZoom: function(maxZoom) {
  49396. var that = this;
  49397. that._minZoom = DEFAULT_MIN_ZOOM;
  49398. that._maxZoom = parseAndClamp(maxZoom, that._minZoom, _Number.MAX_VALUE, DEFAULT_MAX_ZOOM);
  49399. that._setupScaling();
  49400. if (that._zoom > that._maxZoom) {
  49401. that.setZoom(that._maxZoom)
  49402. }
  49403. that._fire("max-zoom")
  49404. },
  49405. getCenter: function() {
  49406. return this._center.slice()
  49407. },
  49408. setCenter: function(value) {
  49409. if (this._engine.isInvertible() && this._changeCenter(value || [])) {
  49410. this._triggerCenterChanged()
  49411. }
  49412. },
  49413. _changeCenter: function(value) {
  49414. var that = this;
  49415. var engine = that._engine;
  49416. var oldCenter = that._center;
  49417. var newCenter = that._center = parseAndClampArray(value, engine.min(), engine.max(), engine.center());
  49418. var isChanged = !arraysEqual(oldCenter, newCenter);
  49419. if (isChanged) {
  49420. that._adjustCenter();
  49421. that._fire("center")
  49422. }
  49423. return isChanged
  49424. },
  49425. _triggerCenterChanged: function() {
  49426. this._params.centerChanged(this.getCenter())
  49427. },
  49428. _triggerZoomChanged: function() {
  49429. this._params.zoomChanged(this.getZoom())
  49430. },
  49431. setCenterByPoint: function(coordinates, screenPosition) {
  49432. var that = this;
  49433. var p = that._engine.project(coordinates);
  49434. var q = that._fromScreen(screenPosition);
  49435. that.setCenter(that._engine.unproject([-q[0] / that._zoom + p[0], -q[1] / that._zoom + p[1]]))
  49436. },
  49437. beginMoveCenter: function() {
  49438. if (this._engine.isInvertible()) {
  49439. this._moveCenter = this._center
  49440. }
  49441. },
  49442. endMoveCenter: function() {
  49443. var that = this;
  49444. if (that._moveCenter) {
  49445. if (!arraysEqual(that._moveCenter, that._center)) {
  49446. that._triggerCenterChanged()
  49447. }
  49448. that._moveCenter = null
  49449. }
  49450. },
  49451. moveCenter: function(shift) {
  49452. var that = this;
  49453. if (that._moveCenter) {
  49454. var current = that._toScreen(that._toTransformed(that._engine.project(that._center)));
  49455. var center = that._engine.unproject(that._fromTransformed(that._fromScreen([current[0] + shift[0], current[1] + shift[1]])));
  49456. that._changeCenter(center)
  49457. }
  49458. },
  49459. getViewport: function() {
  49460. var that = this;
  49461. var unproject = that._engine.unproject;
  49462. var lt = unproject(that._fromTransformed([-1, -1]));
  49463. var lb = unproject(that._fromTransformed([-1, 1]));
  49464. var rt = unproject(that._fromTransformed([1, -1]));
  49465. var rb = unproject(that._fromTransformed([1, 1]));
  49466. var minMax = findMinMax([selectFarthestPoint(lt[0], lb[0], rt[0], rb[0]), selectFarthestPoint(lt[1], rt[1], lb[1], rb[1])], [selectFarthestPoint(rt[0], rb[0], lt[0], lb[0]), selectFarthestPoint(lb[1], rb[1], lt[1], rt[1])]);
  49467. return [].concat(minMax.min, minMax.max)
  49468. },
  49469. setViewport: function(viewport) {
  49470. var engine = this._engine;
  49471. var data = viewport ? getZoomAndCenterFromViewport(engine.project, engine.unproject, viewport) : [this._minZoom, engine.center()];
  49472. this.setZoom(data[0]);
  49473. this.setCenter(data[1])
  49474. },
  49475. getTransform: function() {
  49476. return {
  49477. translateX: this._xCenter * this._xRadius,
  49478. translateY: this._yCenter * this._yRadius
  49479. }
  49480. },
  49481. fromScreenPoint: function(coordinates) {
  49482. return this._engine.unproject(this._fromTransformed(this._fromScreen(coordinates)))
  49483. },
  49484. _eventNames: ["engine", "screen", "center", "zoom", "max-zoom"]
  49485. };
  49486. eventEmitterModule.makeEventEmitter(Projection);
  49487. function selectFarthestPoint(point1, point2, basePoint1, basePoint2) {
  49488. var basePoint = (basePoint1 + basePoint2) / 2;
  49489. return _abs(point1 - basePoint) > _abs(point2 - basePoint) ? point1 : point2
  49490. }
  49491. function selectClosestPoint(point1, point2, basePoint1, basePoint2) {
  49492. var basePoint = (basePoint1 + basePoint2) / 2;
  49493. return _abs(point1 - basePoint) < _abs(point2 - basePoint) ? point1 : point2
  49494. }
  49495. function getZoomAndCenterFromViewport(project, unproject, viewport) {
  49496. var lt = project([viewport[0], viewport[3]]);
  49497. var lb = project([viewport[0], viewport[1]]);
  49498. var rt = project([viewport[2], viewport[3]]);
  49499. var rb = project([viewport[2], viewport[1]]);
  49500. var l = selectClosestPoint(lt[0], lb[0], rt[0], rb[0]);
  49501. var r = selectClosestPoint(rt[0], rb[0], lt[0], lb[0]);
  49502. var t = selectClosestPoint(lt[1], rt[1], lb[1], rb[1]);
  49503. var b = selectClosestPoint(lb[1], rb[1], lt[1], rt[1]);
  49504. return [2 / _max(_abs(l - r), _abs(t - b)), unproject([(l + r) / 2, (t + b) / 2])]
  49505. }
  49506. function setMinMax(engine, p1, p2) {
  49507. var minMax = findMinMax(p1, p2);
  49508. engine.min = returnArray(minMax.min);
  49509. engine.max = returnArray(minMax.max)
  49510. }
  49511. function Engine(parameters) {
  49512. var that = this;
  49513. var project = createProjectMethod(parameters.to);
  49514. var unproject = parameters.from ? createUnprojectMethod(parameters.from) : returnValue(DEFAULT_CENTER);
  49515. that.project = project;
  49516. that.unproject = unproject;
  49517. that.original = returnValue(that);
  49518. that.source = function() {
  49519. return extend({}, parameters)
  49520. };
  49521. that.isInvertible = returnValue(!!parameters.from);
  49522. that.ar = returnValue(parameters.aspectRatio > 0 ? _Number(parameters.aspectRatio) : 1);
  49523. that.center = returnArray(unproject([0, 0]));
  49524. setMinMax(that, [unproject([-1, 0])[0], unproject([0, 1])[1]], [unproject([1, 0])[0], unproject([0, -1])[1]])
  49525. }
  49526. Engine.prototype.aspectRatio = function(aspectRatio) {
  49527. var engine = new Engine(extend(this.source(), {
  49528. aspectRatio: aspectRatio
  49529. }));
  49530. engine.original = this.original;
  49531. engine.min = this.min;
  49532. engine.max = this.max;
  49533. return engine
  49534. };
  49535. Engine.prototype.bounds = function(bounds) {
  49536. bounds = bounds || [];
  49537. var parameters = this.source();
  49538. var min = this.min();
  49539. var max = this.max();
  49540. var b1 = parseAndClampArray([bounds[0], bounds[1]], min, max, min);
  49541. var b2 = parseAndClampArray([bounds[2], bounds[3]], min, max, max);
  49542. var p1 = parameters.to(b1);
  49543. var p2 = parameters.to(b2);
  49544. var delta = _min(_abs(p2[0] - p1[0]) > MIN_BOUNDS_RANGE ? _abs(p2[0] - p1[0]) : 2, _abs(p2[1] - p1[1]) > MIN_BOUNDS_RANGE ? _abs(p2[1] - p1[1]) : 2);
  49545. if (delta < 2) {
  49546. extend(parameters, createProjectUnprojectMethods(parameters.to, parameters.from, p1, p2, delta))
  49547. }
  49548. var engine = new Engine(parameters);
  49549. engine.original = this.original;
  49550. setMinMax(engine, b1, b2);
  49551. return engine
  49552. };
  49553. function isEngine(engine) {
  49554. return engine instanceof Engine
  49555. }
  49556. function invertVerticalAxis(pair) {
  49557. return [pair[0], -pair[1]]
  49558. }
  49559. function createProjectMethod(method) {
  49560. return function(arg) {
  49561. return invertVerticalAxis(method(arg))
  49562. }
  49563. }
  49564. function createUnprojectMethod(method) {
  49565. return function(arg) {
  49566. return method(invertVerticalAxis(arg))
  49567. }
  49568. }
  49569. function returnValue(value) {
  49570. return function() {
  49571. return value
  49572. }
  49573. }
  49574. function returnArray(value) {
  49575. return function() {
  49576. return value.slice()
  49577. }
  49578. }
  49579. function projection(parameters) {
  49580. return parameters && parameters.to ? new Engine(parameters) : null
  49581. }
  49582. function findMinMax(p1, p2) {
  49583. return {
  49584. min: [_min(p1[0], p2[0]), _min(p1[1], p2[1])],
  49585. max: [_max(p1[0], p2[0]), _max(p1[1], p2[1])]
  49586. }
  49587. }
  49588. var projectionsCache = {};
  49589. projection.get = function(name) {
  49590. return projectionsCache[name] || null
  49591. };
  49592. projection.add = function(name, engine) {
  49593. if (!projectionsCache[name] && isEngine(engine)) {
  49594. projectionsCache[name] = engine
  49595. }
  49596. return projection
  49597. };
  49598. function createProjectUnprojectMethods(project, unproject, p1, p2, delta) {
  49599. var x0 = (p1[0] + p2[0]) / 2 - delta / 2;
  49600. var y0 = (p1[1] + p2[1]) / 2 - delta / 2;
  49601. var k = 2 / delta;
  49602. return {
  49603. to: function(coordinates) {
  49604. var p = project(coordinates);
  49605. return [-1 + (p[0] - x0) * k, -1 + (p[1] - y0) * k]
  49606. },
  49607. from: function(coordinates) {
  49608. var p = [x0 + (coordinates[0] + 1) / k, y0 + (coordinates[1] + 1) / k];
  49609. return unproject(p)
  49610. }
  49611. }
  49612. }
  49613. exports.Projection = Projection;
  49614. exports.projection = projection;
  49615. exports._TESTS_Engine = Engine
  49616. },
  49617. /*!**************************************************************!*\
  49618. !*** ./artifacts/transpiled/viz/vector_map/event_emitter.js ***!
  49619. \**************************************************************/
  49620. /*! dynamic exports provided */
  49621. /*! all exports used */
  49622. function(module, exports, __webpack_require__) {
  49623. var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
  49624. var eventEmitterMethods = {
  49625. _initEvents: function() {
  49626. var names = this._eventNames;
  49627. var i;
  49628. var ii = names.length;
  49629. var events = this._events = {};
  49630. for (i = 0; i < ii; ++i) {
  49631. events[names[i]] = Callbacks()
  49632. }
  49633. },
  49634. _disposeEvents: function() {
  49635. var events = this._events;
  49636. var name;
  49637. for (name in events) {
  49638. events[name].empty()
  49639. }
  49640. this._events = null
  49641. },
  49642. on: function(handlers) {
  49643. var events = this._events;
  49644. var name;
  49645. for (name in handlers) {
  49646. events[name].add(handlers[name])
  49647. }
  49648. return dispose;
  49649. function dispose() {
  49650. for (name in handlers) {
  49651. events[name].remove(handlers[name])
  49652. }
  49653. }
  49654. },
  49655. _fire: function(name, arg) {
  49656. this._events[name].fire(arg)
  49657. }
  49658. };
  49659. exports.makeEventEmitter = function(target) {
  49660. var proto = target.prototype;
  49661. var name;
  49662. for (name in eventEmitterMethods) {
  49663. proto[name] = eventEmitterMethods[name]
  49664. }
  49665. };
  49666. exports._TESTS_eventEmitterMethods = eventEmitterMethods
  49667. },
  49668. /*!***********************************************************!*\
  49669. !*** ./artifacts/transpiled/viz/vector_map/projection.js ***!
  49670. \***********************************************************/
  49671. /*! dynamic exports provided */
  49672. /*! all exports used */
  49673. function(module, exports, __webpack_require__) {
  49674. var projectionModule = __webpack_require__( /*! ./projection.main */ 415);
  49675. var projection = projectionModule.projection;
  49676. var _min = Math.min;
  49677. var _max = Math.max;
  49678. var _sin = Math.sin;
  49679. var _asin = Math.asin;
  49680. var _tan = Math.tan;
  49681. var _atan = Math.atan;
  49682. var _exp = Math.exp;
  49683. var _log = Math.log;
  49684. var PI = Math.PI;
  49685. var PI_DIV_4 = PI / 4;
  49686. var GEO_LON_BOUND = 180;
  49687. var GEO_LAT_BOUND = 90;
  49688. var RADIANS = PI / 180;
  49689. var MERCATOR_LAT_BOUND = (2 * _atan(_exp(PI)) - PI / 2) / RADIANS;
  49690. var MILLER_LAT_BOUND = (2.5 * _atan(_exp(.8 * PI)) - .625 * PI) / RADIANS;
  49691. function clamp(value, threshold) {
  49692. return _max(_min(value, +threshold), -threshold)
  49693. }
  49694. projection.add("mercator", projection({
  49695. aspectRatio: 1,
  49696. to: function(coordinates) {
  49697. return [coordinates[0] / GEO_LON_BOUND, _log(_tan(PI_DIV_4 + clamp(coordinates[1], MERCATOR_LAT_BOUND) * RADIANS / 2)) / PI]
  49698. },
  49699. from: function(coordinates) {
  49700. return [coordinates[0] * GEO_LON_BOUND, (2 * _atan(_exp(coordinates[1] * PI)) - PI / 2) / RADIANS]
  49701. }
  49702. }));
  49703. projection.add("equirectangular", projection({
  49704. aspectRatio: 2,
  49705. to: function(coordinates) {
  49706. return [coordinates[0] / GEO_LON_BOUND, coordinates[1] / GEO_LAT_BOUND]
  49707. },
  49708. from: function(coordinates) {
  49709. return [coordinates[0] * GEO_LON_BOUND, coordinates[1] * GEO_LAT_BOUND]
  49710. }
  49711. }));
  49712. projection.add("lambert", projection({
  49713. aspectRatio: 2,
  49714. to: function(coordinates) {
  49715. return [coordinates[0] / GEO_LON_BOUND, _sin(clamp(coordinates[1], GEO_LAT_BOUND) * RADIANS)]
  49716. },
  49717. from: function(coordinates) {
  49718. return [coordinates[0] * GEO_LON_BOUND, _asin(clamp(coordinates[1], 1)) / RADIANS]
  49719. }
  49720. }));
  49721. projection.add("miller", projection({
  49722. aspectRatio: 1,
  49723. to: function(coordinates) {
  49724. return [coordinates[0] / GEO_LON_BOUND, 1.25 * _log(_tan(PI_DIV_4 + clamp(coordinates[1], MILLER_LAT_BOUND) * RADIANS * .4)) / PI]
  49725. },
  49726. from: function(coordinates) {
  49727. return [coordinates[0] * GEO_LON_BOUND, (2.5 * _atan(_exp(.8 * coordinates[1] * PI)) - .625 * PI) / RADIANS]
  49728. }
  49729. }));
  49730. exports.projection = projection
  49731. },
  49732. /*!***************************************************************!*\
  49733. !*** ./artifacts/transpiled/viz/sparklines/base_sparkline.js ***!
  49734. \***************************************************************/
  49735. /*! dynamic exports provided */
  49736. /*! all exports used */
  49737. function(module, exports, __webpack_require__) {
  49738. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  49739. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  49740. var ready = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48).add;
  49741. var isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
  49742. var BaseWidget = __webpack_require__( /*! ../core/base_widget */ 96);
  49743. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  49744. var DEFAULT_LINE_SPACING = 2;
  49745. var DEFAULT_EVENTS_DELAY = 100;
  49746. var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
  49747. var translator2DModule = __webpack_require__( /*! ../translators/translator2d */ 249);
  49748. var _extend = extend;
  49749. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  49750. function generateDefaultCustomizeTooltipCallback(fontOptions, rtlEnabled) {
  49751. var lineSpacing = fontOptions.lineSpacing;
  49752. var lineHeight = (void 0 !== lineSpacing && null !== lineSpacing ? lineSpacing : DEFAULT_LINE_SPACING) + fontOptions.size;
  49753. return function(customizeObject) {
  49754. var html = "";
  49755. var vt = customizeObject.valueText;
  49756. for (var i = 0; i < vt.length; i += 2) {
  49757. html += "<tr><td>" + vt[i] + "</td><td style='width: 15px'></td><td style='text-align: " + (rtlEnabled ? "left" : "right") + "'>" + vt[i + 1] + "</td></tr>"
  49758. }
  49759. return {
  49760. html: "<table style='border-spacing:0px; line-height: " + lineHeight + "px'>" + html + "</table>"
  49761. }
  49762. }
  49763. }
  49764. function generateCustomizeTooltipCallback(customizeTooltip, fontOptions, rtlEnabled) {
  49765. var defaultCustomizeTooltip = generateDefaultCustomizeTooltipCallback(fontOptions, rtlEnabled);
  49766. if (isFunction(customizeTooltip)) {
  49767. return function(customizeObject) {
  49768. var res = customizeTooltip.call(customizeObject, customizeObject);
  49769. if (!("html" in res) && !("text" in res)) {
  49770. _extend(res, defaultCustomizeTooltip.call(customizeObject, customizeObject))
  49771. }
  49772. return res
  49773. }
  49774. } else {
  49775. return defaultCustomizeTooltip
  49776. }
  49777. }
  49778. function createAxis(isHorizontal) {
  49779. var translator = new translator2DModule.Translator2D({}, {}, {
  49780. shiftZeroValue: !isHorizontal,
  49781. isHorizontal: !!isHorizontal
  49782. });
  49783. return {
  49784. getTranslator: function() {
  49785. return translator
  49786. },
  49787. update: function(range, canvas, options) {
  49788. translator.update(range, canvas, options)
  49789. },
  49790. getVisibleArea: function() {
  49791. var visibleArea = translator.getCanvasVisibleArea();
  49792. return [visibleArea.min, visibleArea.max]
  49793. },
  49794. visualRange: _noop,
  49795. calculateInterval: _noop,
  49796. getMarginOptions: function() {
  49797. return {}
  49798. }
  49799. }
  49800. }
  49801. var BaseSparkline = BaseWidget.inherit({
  49802. _getLayoutItems: _noop,
  49803. _useLinks: false,
  49804. _themeDependentChanges: ["OPTIONS"],
  49805. _initCore: function() {
  49806. var that = this;
  49807. that._tooltipTracker = that._renderer.root;
  49808. that._tooltipTracker.attr({
  49809. "pointer-events": "visible"
  49810. });
  49811. that._createHtmlElements();
  49812. that._initTooltipEvents();
  49813. that._argumentAxis = createAxis(true);
  49814. that._valueAxis = createAxis()
  49815. },
  49816. _getDefaultSize: function() {
  49817. return this._defaultSize
  49818. },
  49819. _disposeCore: function() {
  49820. this._disposeWidgetElements();
  49821. this._disposeTooltipEvents();
  49822. this._ranges = null
  49823. },
  49824. _optionChangesOrder: ["OPTIONS"],
  49825. _change_OPTIONS: function() {
  49826. this._prepareOptions();
  49827. this._change(["UPDATE"])
  49828. },
  49829. _customChangesOrder: ["UPDATE"],
  49830. _change_UPDATE: function() {
  49831. this._update()
  49832. },
  49833. _update: function() {
  49834. var that = this;
  49835. if (that._tooltipShown) {
  49836. that._tooltipShown = false;
  49837. that._tooltip.hide()
  49838. }
  49839. that._cleanWidgetElements();
  49840. that._updateWidgetElements();
  49841. that._drawWidgetElements()
  49842. },
  49843. _updateWidgetElements: function() {
  49844. var canvas = this._getCorrectCanvas();
  49845. this._updateRange();
  49846. this._argumentAxis.update(this._ranges.arg, canvas, this._getStick());
  49847. this._valueAxis.update(this._ranges.val, canvas)
  49848. },
  49849. _getStick: function() {},
  49850. _applySize: function(rect) {
  49851. this._allOptions.size = {
  49852. width: rect[2] - rect[0],
  49853. height: rect[3] - rect[1]
  49854. };
  49855. this._change(["UPDATE"])
  49856. },
  49857. _setupResizeHandler: _noop,
  49858. _prepareOptions: function() {
  49859. return _extend(true, {}, this._themeManager.theme(), this.option())
  49860. },
  49861. _getTooltipCoords: function() {
  49862. var canvas = this._canvas;
  49863. var rootOffset = this._renderer.getRootOffset();
  49864. return {
  49865. x: canvas.width / 2 + rootOffset.left,
  49866. y: canvas.height / 2 + rootOffset.top
  49867. }
  49868. },
  49869. _initTooltipEvents: function() {
  49870. var that = this;
  49871. var data = {
  49872. widget: that
  49873. };
  49874. that._showTooltipCallback = function() {
  49875. var tooltip;
  49876. if (!that._tooltipShown) {
  49877. that._tooltipShown = true;
  49878. tooltip = that._getTooltip();
  49879. tooltip.isEnabled() && that._tooltip.show(that._getTooltipData(), that._getTooltipCoords(), {})
  49880. }
  49881. that._DEBUG_showCallback && that._DEBUG_showCallback()
  49882. };
  49883. that._hideTooltipCallback = function() {
  49884. var tooltipWasShown = that._tooltipShown;
  49885. that._hideTooltipTimeout = null;
  49886. if (that._tooltipShown) {
  49887. that._tooltipShown = false;
  49888. that._tooltip.hide()
  49889. }
  49890. that._DEBUG_hideCallback && that._DEBUG_hideCallback(tooltipWasShown)
  49891. };
  49892. that._disposeCallbacks = function() {
  49893. that = that._showTooltipCallback = that._hideTooltipCallback = that._disposeCallbacks = null
  49894. };
  49895. that._tooltipTracker.on(mouseEvents, data).on(touchEvents, data);
  49896. that._tooltipTracker.on(menuEvents)
  49897. },
  49898. _stopCurrentHandling: function() {
  49899. this._hideTooltip()
  49900. },
  49901. _disposeTooltipEvents: function() {
  49902. var that = this;
  49903. clearTimeout(that._hideTooltipTimeout);
  49904. that._tooltipTracker.off();
  49905. that._disposeCallbacks()
  49906. },
  49907. _getTooltip: function() {
  49908. var that = this;
  49909. if (!that._tooltip) {
  49910. _initTooltip.apply(this, arguments);
  49911. that._setTooltipRendererOptions(that._tooltipRendererOptions);
  49912. that._tooltipRendererOptions = null;
  49913. that._setTooltipOptions()
  49914. }
  49915. return that._tooltip
  49916. }
  49917. });
  49918. var menuEvents = {
  49919. "contextmenu.sparkline-tooltip": function(event) {
  49920. if (eventUtils.isTouchEvent(event) || eventUtils.isPointerEvent(event)) {
  49921. event.preventDefault()
  49922. }
  49923. },
  49924. "MSHoldVisual.sparkline-tooltip": function(event) {
  49925. event.preventDefault()
  49926. }
  49927. };
  49928. var mouseEvents = {
  49929. "mouseover.sparkline-tooltip": function(event) {
  49930. isPointerDownCalled = false;
  49931. var widget = event.data.widget;
  49932. widget._x = event.pageX;
  49933. widget._y = event.pageY;
  49934. widget._tooltipTracker.off(mouseMoveEvents).on(mouseMoveEvents, event.data);
  49935. widget._showTooltip()
  49936. },
  49937. "mouseout.sparkline-tooltip": function(event) {
  49938. if (isPointerDownCalled) {
  49939. return
  49940. }
  49941. var widget = event.data.widget;
  49942. widget._tooltipTracker.off(mouseMoveEvents);
  49943. widget._hideTooltip(DEFAULT_EVENTS_DELAY)
  49944. }
  49945. };
  49946. var mouseMoveEvents = {
  49947. "mousemove.sparkline-tooltip": function(event) {
  49948. var widget = event.data.widget;
  49949. widget._x = event.pageX;
  49950. widget._y = event.pageY;
  49951. widget._showTooltip()
  49952. }
  49953. };
  49954. var active_touch_tooltip_widget = null;
  49955. var touchStartTooltipProcessing = function(event) {
  49956. var widget = active_touch_tooltip_widget;
  49957. if (widget && widget !== event.data.widget) {
  49958. widget._hideTooltip(DEFAULT_EVENTS_DELAY)
  49959. }
  49960. widget = active_touch_tooltip_widget = event.data.widget;
  49961. widget._showTooltip();
  49962. widget._touch = true
  49963. };
  49964. var touchStartDocumentProcessing = function() {
  49965. var widget = active_touch_tooltip_widget;
  49966. if (widget) {
  49967. if (!widget._touch) {
  49968. widget._hideTooltip(DEFAULT_EVENTS_DELAY);
  49969. active_touch_tooltip_widget = null
  49970. }
  49971. widget._touch = null
  49972. }
  49973. };
  49974. var touchEndDocumentProcessing = function() {
  49975. var widget = active_touch_tooltip_widget;
  49976. if (widget) {
  49977. widget._hideTooltip(DEFAULT_EVENTS_DELAY);
  49978. active_touch_tooltip_widget = null
  49979. }
  49980. };
  49981. var isPointerDownCalled = false;
  49982. var touchEvents = {
  49983. "pointerdown.sparkline-tooltip": touchStartTooltipProcessing,
  49984. "touchstart.sparkline-tooltip": touchStartTooltipProcessing
  49985. };
  49986. ready(function() {
  49987. eventsEngine.subscribeGlobal(domAdapter.getDocument(), {
  49988. "pointerdown.sparkline-tooltip": function() {
  49989. isPointerDownCalled = true;
  49990. touchStartDocumentProcessing()
  49991. },
  49992. "touchstart.sparkline-tooltip": touchStartDocumentProcessing,
  49993. "pointerup.sparkline-tooltip": touchEndDocumentProcessing,
  49994. "touchend.sparkline-tooltip": touchEndDocumentProcessing
  49995. })
  49996. });
  49997. module.exports = BaseSparkline;
  49998. module.exports._DEBUG_reset = function() {
  49999. active_touch_tooltip_widget = null
  50000. };
  50001. BaseSparkline.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin);
  50002. var _initTooltip = BaseSparkline.prototype._initTooltip;
  50003. BaseSparkline.prototype._initTooltip = _noop;
  50004. var _disposeTooltip = BaseSparkline.prototype._disposeTooltip;
  50005. BaseSparkline.prototype._disposeTooltip = function() {
  50006. if (this._tooltip) {
  50007. _disposeTooltip.apply(this, arguments)
  50008. }
  50009. };
  50010. BaseSparkline.prototype._setTooltipRendererOptions = function() {
  50011. var options = this._getRendererOptions();
  50012. if (this._tooltip) {
  50013. this._tooltip.setRendererOptions(options)
  50014. } else {
  50015. this._tooltipRendererOptions = options
  50016. }
  50017. };
  50018. BaseSparkline.prototype._setTooltipOptions = function() {
  50019. var tooltip = this._tooltip;
  50020. var options = tooltip && this._getOption("tooltip");
  50021. tooltip && tooltip.update(_extend({}, options, {
  50022. customizeTooltip: generateCustomizeTooltipCallback(options.customizeTooltip, options.font, this.option("rtlEnabled")),
  50023. enabled: options.enabled && this._isTooltipEnabled()
  50024. }))
  50025. };
  50026. BaseSparkline.prototype._showTooltip = function() {
  50027. var that = this;
  50028. ++that._DEBUG_clearHideTooltipTimeout;
  50029. clearTimeout(that._hideTooltipTimeout);
  50030. that._hideTooltipTimeout = null;
  50031. that._showTooltipCallback()
  50032. };
  50033. BaseSparkline.prototype._hideTooltip = function(delay) {
  50034. var that = this;
  50035. ++that._DEBUG_clearShowTooltipTimeout;
  50036. clearTimeout(that._hideTooltipTimeout);
  50037. if (delay) {
  50038. ++that._DEBUG_hideTooltipTimeoutSet;
  50039. that._hideTooltipTimeout = setTimeout(that._hideTooltipCallback, delay)
  50040. } else {
  50041. that._hideTooltipCallback()
  50042. }
  50043. };
  50044. var exportPlugin = extend(true, {}, __webpack_require__( /*! ../core/export */ 93).plugin, {
  50045. init: _noop,
  50046. dispose: _noop,
  50047. customize: null,
  50048. members: {
  50049. _getExportMenuOptions: null
  50050. }
  50051. });
  50052. BaseSparkline.addPlugin(exportPlugin)
  50053. },
  50054. /*!****************************************************************!*\
  50055. !*** ./artifacts/transpiled/viz/tree_map/tiling.squarified.js ***!
  50056. \****************************************************************/
  50057. /*! dynamic exports provided */
  50058. /*! all exports used */
  50059. function(module, exports, __webpack_require__) {
  50060. var _max = Math.max;
  50061. var _squarify = __webpack_require__( /*! ./tiling.squarified.base */ 420);
  50062. function accumulate(total, current) {
  50063. return _max(total, current)
  50064. }
  50065. function squarified(data) {
  50066. return _squarify(data, accumulate, false)
  50067. }
  50068. __webpack_require__( /*! ./tiling */ 120).addAlgorithm("squarified", squarified);
  50069. module.exports = squarified
  50070. },
  50071. /*!*********************************************************************!*\
  50072. !*** ./artifacts/transpiled/viz/tree_map/tiling.squarified.base.js ***!
  50073. \*********************************************************************/
  50074. /*! dynamic exports provided */
  50075. /*! all exports used */
  50076. function(module, exports, __webpack_require__) {
  50077. var _max = Math.max;
  50078. var _round = Math.round;
  50079. var tiling = __webpack_require__( /*! ./tiling */ 120);
  50080. function compare(a, b) {
  50081. return b.value - a.value
  50082. }
  50083. function getAspectRatio(value) {
  50084. return _max(value, 1 / value)
  50085. }
  50086. function findAppropriateCollection(nodes, head, context) {
  50087. var bestAspectRatio = 1 / 0;
  50088. var nextAspectRatio;
  50089. var sum = 0;
  50090. var nextSum;
  50091. var i;
  50092. var j;
  50093. var ii = nodes.length;
  50094. var coeff = context.areaToValue / context.staticSide;
  50095. var totalAspectRatio;
  50096. for (i = head; i < ii;) {
  50097. nextSum = sum + nodes[i].value;
  50098. totalAspectRatio = context.staticSide / coeff / nextSum;
  50099. nextAspectRatio = 0;
  50100. for (j = head; j <= i; ++j) {
  50101. nextAspectRatio = context.accumulate(nextAspectRatio, getAspectRatio(totalAspectRatio * nodes[j].value / nextSum), j - head + 1)
  50102. }
  50103. if (nextAspectRatio < bestAspectRatio) {
  50104. bestAspectRatio = nextAspectRatio;
  50105. sum = nextSum;
  50106. ++i
  50107. } else {
  50108. break
  50109. }
  50110. }
  50111. return {
  50112. sum: sum,
  50113. count: i - head,
  50114. side: _round(coeff * sum)
  50115. }
  50116. }
  50117. function getArea(rect) {
  50118. return (rect[2] - rect[0]) * (rect[3] - rect[1])
  50119. }
  50120. function doStep(nodes, head, context) {
  50121. var sidesData = tiling.buildSidesData(context.rect, context.directions, context.staticSideIndex);
  50122. var area = getArea(context.rect);
  50123. var rowData = area > 0 ? findAppropriateCollection(nodes, head, {
  50124. areaToValue: area / context.sum,
  50125. accumulate: context.accumulate,
  50126. staticSide: sidesData.staticSide
  50127. }) : {
  50128. sum: 1,
  50129. side: sidesData.variedSide,
  50130. count: nodes.length - head
  50131. };
  50132. tiling.calculateRectangles(nodes, head, context.rect, sidesData, rowData);
  50133. context.sum -= rowData.sum;
  50134. return head + rowData.count
  50135. }
  50136. module.exports = function(data, accumulate, isFixedStaticSide) {
  50137. var items = data.items;
  50138. var ii = items.length;
  50139. var i;
  50140. var context = {
  50141. sum: data.sum,
  50142. rect: data.rect,
  50143. directions: data.directions,
  50144. accumulate: accumulate
  50145. };
  50146. if (isFixedStaticSide) {
  50147. context.staticSideIndex = tiling.getStaticSideIndex(context.rect)
  50148. }
  50149. items.sort(compare);
  50150. for (i = 0; i < ii;) {
  50151. i = doStep(items, i, context)
  50152. }
  50153. }
  50154. },
  50155. /*!******************************************************************!*\
  50156. !*** ./artifacts/transpiled/viz/tree_map/colorizing.discrete.js ***!
  50157. \******************************************************************/
  50158. /*! dynamic exports provided */
  50159. /*! all exports used */
  50160. function(module, exports, __webpack_require__) {
  50161. function discreteColorizer(options, themeManager, root) {
  50162. var palette = themeManager.createPalette(options.palette, {
  50163. useHighlight: true,
  50164. extensionMode: options.paletteExtensionMode,
  50165. count: options.colorizeGroups ? getNodesCount(root) : getLeafsCount(root)
  50166. });
  50167. return (options.colorizeGroups ? discreteGroupColorizer : discreteLeafColorizer)(palette, root)
  50168. }
  50169. function getLeafsCount(root) {
  50170. var allNodes = root.nodes.slice();
  50171. var i;
  50172. var ii = allNodes.length;
  50173. var count = 0;
  50174. var node;
  50175. for (i = 0; i < ii; ++i) {
  50176. node = allNodes[i];
  50177. if (node.isNode()) {
  50178. count = Math.max(count, getLeafsCount(node))
  50179. } else {
  50180. count += 1
  50181. }
  50182. }
  50183. return count
  50184. }
  50185. function discreteLeafColorizer(palette) {
  50186. var colors = palette.generateColors();
  50187. return function(node) {
  50188. return colors[node.index]
  50189. }
  50190. }
  50191. function getNodesCount(root) {
  50192. var allNodes = root.nodes.slice();
  50193. var i;
  50194. var ii = allNodes.length;
  50195. var count = 0;
  50196. var node;
  50197. for (i = 0; i < ii; ++i) {
  50198. node = allNodes[i];
  50199. if (node.isNode()) {
  50200. count += getNodesCount(node) + 1
  50201. }
  50202. }
  50203. return count
  50204. }
  50205. function prepareDiscreteGroupColors(palette, root) {
  50206. var colors = {};
  50207. var allNodes = root.nodes.slice();
  50208. var i;
  50209. var ii = allNodes.length;
  50210. var node;
  50211. for (i = 0; i < ii; ++i) {
  50212. node = allNodes[i];
  50213. if (node.isNode()) {
  50214. allNodes = allNodes.concat(node.nodes);
  50215. ii = allNodes.length
  50216. } else {
  50217. if (!colors[node.parent._id]) {
  50218. colors[node.parent._id] = palette.getNextColor()
  50219. }
  50220. }
  50221. }
  50222. return colors
  50223. }
  50224. function discreteGroupColorizer(palette, root) {
  50225. var colors = prepareDiscreteGroupColors(palette, root);
  50226. return function(node) {
  50227. return colors[node._id]
  50228. }
  50229. }
  50230. __webpack_require__( /*! ./colorizing */ 121).addColorizer("discrete", discreteColorizer);
  50231. module.exports = discreteColorizer
  50232. },
  50233. /*!****************************************************!*\
  50234. !*** ./artifacts/transpiled/viz/tree_map/hover.js ***!
  50235. \****************************************************/
  50236. /*! dynamic exports provided */
  50237. /*! all exports used */
  50238. function(module, exports, __webpack_require__) {
  50239. var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
  50240. var nodeProto = __webpack_require__( /*! ./node */ 166).prototype;
  50241. var expand = __webpack_require__( /*! ../core/helpers */ 142).expand;
  50242. var common = __webpack_require__( /*! ./common */ 251);
  50243. var _parseScalar = __webpack_require__( /*! ../core/utils */ 10).parseScalar;
  50244. var _buildRectAppearance = common.buildRectAppearance;
  50245. var STATE_CODE = 1;
  50246. __webpack_require__( /*! ./api */ 146);
  50247. __webpack_require__( /*! ./states */ 423);
  50248. proto._eventsMap.onHoverChanged = {
  50249. name: "hoverChanged"
  50250. };
  50251. expand(proto._handlers, "calculateAdditionalStates", function(states, options) {
  50252. states[1] = options.hoverStyle ? _buildRectAppearance(options.hoverStyle) : {}
  50253. });
  50254. __webpack_require__( /*! ./tree_map.base */ 70).addChange({
  50255. code: "HOVER_ENABLED",
  50256. handler: function() {
  50257. var hoverEnabled = _parseScalar(this._getOption("hoverEnabled", true), true);
  50258. if (!hoverEnabled) {
  50259. this.clearHover()
  50260. }
  50261. this._hoverEnabled = hoverEnabled
  50262. },
  50263. isThemeDependent: true,
  50264. isOptionChange: true,
  50265. option: "hoverEnabled"
  50266. });
  50267. nodeProto.statesMap[1] = 1;
  50268. nodeProto.additionalStates.push(1);
  50269. expand(proto, "_extendProxyType", function(proto) {
  50270. var that = this;
  50271. proto.setHover = function() {
  50272. that._hoverNode(this._id)
  50273. };
  50274. proto.isHovered = function() {
  50275. return that._hoverIndex === this._id
  50276. }
  50277. });
  50278. expand(proto, "_onNodesCreated", function() {
  50279. this._hoverIndex = -1
  50280. });
  50281. expand(proto, "_changeGroupSettings", function() {
  50282. var that = this;
  50283. that._groupHoverEnabled = _parseScalar(that._getOption("group").hoverEnabled, true);
  50284. if (!that._groupHoverEnabled) {
  50285. that.clearHover()
  50286. }
  50287. });
  50288. proto._applyHoverState = function(index, state) {
  50289. setNodeStateRecursive(this._nodes[index], STATE_CODE, state);
  50290. this._eventTrigger("hoverChanged", {
  50291. node: this._nodes[index].proxy
  50292. })
  50293. };
  50294. function setNodeStateRecursive(node, code, state) {
  50295. var nodes = node.isNode() && node.nodes;
  50296. var i;
  50297. var ii = nodes && nodes.length;
  50298. node.setState(code, state);
  50299. for (i = 0; i < ii; ++i) {
  50300. setNodeStateRecursive(nodes[i], code, state)
  50301. }
  50302. }
  50303. proto._hoverNode = function(index) {
  50304. var that = this;
  50305. var currentIndex = that._hoverIndex;
  50306. if (that._hoverEnabled && currentIndex !== index) {
  50307. if (!that._groupHoverEnabled && index >= 0 && that._nodes[index].isNode()) {
  50308. that.clearHover();
  50309. return
  50310. }
  50311. that._context.suspend();
  50312. that._hoverIndex = -1;
  50313. if (currentIndex >= 0) {
  50314. that._applyHoverState(currentIndex, false)
  50315. }
  50316. that._hoverIndex = index;
  50317. if (index >= 0) {
  50318. that._applyHoverState(index, true)
  50319. }
  50320. that._context.resume()
  50321. }
  50322. };
  50323. proto.clearHover = function() {
  50324. this._hoverNode(-1)
  50325. }
  50326. },
  50327. /*!*****************************************************!*\
  50328. !*** ./artifacts/transpiled/viz/tree_map/states.js ***!
  50329. \*****************************************************/
  50330. /*! dynamic exports provided */
  50331. /*! all exports used */
  50332. function(module, exports, __webpack_require__) {
  50333. var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
  50334. var nodeProto = __webpack_require__( /*! ./node */ 166).prototype;
  50335. var handlers = proto._handlers;
  50336. var _calculateState = handlers.calculateState;
  50337. var _buildState = nodeProto._buildState;
  50338. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  50339. handlers.calculateState = function(options) {
  50340. var states = {
  50341. 0: _calculateState(options)
  50342. };
  50343. handlers.calculateAdditionalStates(states, options);
  50344. return states
  50345. };
  50346. handlers.calculateAdditionalStates = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  50347. nodeProto.code = 0;
  50348. nodeProto.statesMap = {
  50349. 0: 0
  50350. };
  50351. nodeProto.additionalStates = [];
  50352. nodeProto._buildState = function(state, extra) {
  50353. var states = {
  50354. 0: _buildState(state[0], extra)
  50355. };
  50356. if (this.additionalStates.length) {
  50357. buildAdditionalStates(states, states[0], state, this.additionalStates)
  50358. }
  50359. return states
  50360. };
  50361. nodeProto._getState = function() {
  50362. return this.state[this.statesMap[this.code]]
  50363. };
  50364. nodeProto.setState = function(code, state) {
  50365. if (state) {
  50366. this.code |= code
  50367. } else {
  50368. this.code &= ~code
  50369. }
  50370. this.ctx.change(["TILES"])
  50371. };
  50372. function buildAdditionalStates(states, base, source, list) {
  50373. var i;
  50374. var ii = list.length;
  50375. for (i = 0; i < ii; ++i) {
  50376. states[list[i]] = _extend({}, base, source[list[i]])
  50377. }
  50378. }
  50379. },
  50380. /*!******************************************************!*\
  50381. !*** ./artifacts/transpiled/viz/tree_map/tooltip.js ***!
  50382. \******************************************************/
  50383. /*! dynamic exports provided */
  50384. /*! all exports used */
  50385. function(module, exports, __webpack_require__) {
  50386. var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
  50387. var expand = __webpack_require__( /*! ../core/helpers */ 142).expand;
  50388. __webpack_require__( /*! ./api */ 146);
  50389. expand(proto, "_extendProxyType", function(proto) {
  50390. var that = this;
  50391. proto.showTooltip = function(coords) {
  50392. that._showTooltip(this._id, coords)
  50393. }
  50394. });
  50395. expand(proto, "_onNodesCreated", function() {
  50396. if (this._tooltipIndex >= 0) {
  50397. this._tooltip.hide()
  50398. }
  50399. this._tooltipIndex = -1
  50400. });
  50401. expand(proto, "_onTilingPerformed", function() {
  50402. if (this._tooltipIndex >= 0) {
  50403. this._moveTooltip(this._nodes[this._tooltipIndex])
  50404. }
  50405. });
  50406. function getCoords(rect, renderer) {
  50407. var offset = renderer.getRootOffset();
  50408. return [(rect[0] + rect[2]) / 2 + offset.left, (rect[1] + rect[3]) / 2 + offset.top]
  50409. }
  50410. proto._showTooltip = function(index, coords) {
  50411. var that = this;
  50412. var tooltip = that._tooltip;
  50413. var node = that._nodes[index];
  50414. var state = that._tooltipIndex === index || tooltip.show({
  50415. value: node.value,
  50416. valueText: tooltip.formatValue(node.value),
  50417. node: node.proxy
  50418. }, {
  50419. x: 0,
  50420. y: 0,
  50421. offset: 0
  50422. }, {
  50423. node: node.proxy
  50424. });
  50425. if (state) {
  50426. that._moveTooltip(node, coords)
  50427. } else {
  50428. tooltip.hide()
  50429. }
  50430. that._tooltipIndex = state ? index : -1
  50431. };
  50432. proto._moveTooltip = function(node, coords) {
  50433. var xy = coords || node.rect && getCoords(node.rect, this._renderer) || [-1e3, -1e3];
  50434. this._tooltip.move(xy[0], xy[1], 0)
  50435. };
  50436. proto.hideTooltip = function() {
  50437. if (this._tooltipIndex >= 0) {
  50438. this._tooltipIndex = -1;
  50439. this._tooltip.hide()
  50440. }
  50441. };
  50442. __webpack_require__( /*! ./tree_map.base */ 70).addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin)
  50443. },
  50444. /*!***************************************************!*\
  50445. !*** ./artifacts/transpiled/viz/funnel/funnel.js ***!
  50446. \***************************************************/
  50447. /*! dynamic exports provided */
  50448. /*! all exports used */
  50449. function(module, exports, __webpack_require__) {
  50450. var tiling = __webpack_require__( /*! ./tiling */ 837);
  50451. var dynamicSlope = __webpack_require__( /*! ./tiling.funnel */ 838);
  50452. var dynamicHeight = __webpack_require__( /*! ./tiling.pyramid */ 839);
  50453. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  50454. var Item = __webpack_require__( /*! ./item */ 840);
  50455. var NODES_CREATE_CHANGE = "NODES_CREATE";
  50456. tiling.addAlgorithm("dynamicslope", dynamicSlope, true);
  50457. tiling.addAlgorithm("dynamicheight", dynamicHeight);
  50458. function invertFigure(figure) {
  50459. return figure.map(function(coord, index) {
  50460. return index % 2 ? 1 - coord : coord
  50461. })
  50462. }
  50463. var dxFunnel = __webpack_require__( /*! ../core/base_widget */ 96).inherit({
  50464. _rootClass: "dxf-funnel",
  50465. _rootClassPrefix: "dxf",
  50466. _proxyData: [],
  50467. _optionChangesMap: {
  50468. dataSource: "DATA_SOURCE",
  50469. neckWidth: NODES_CREATE_CHANGE,
  50470. neckHeight: NODES_CREATE_CHANGE,
  50471. inverted: NODES_CREATE_CHANGE,
  50472. algorithm: NODES_CREATE_CHANGE,
  50473. item: NODES_CREATE_CHANGE,
  50474. valueField: NODES_CREATE_CHANGE,
  50475. argumentField: NODES_CREATE_CHANGE,
  50476. colorField: NODES_CREATE_CHANGE,
  50477. palette: NODES_CREATE_CHANGE,
  50478. paletteExtensionMode: NODES_CREATE_CHANGE,
  50479. sortData: NODES_CREATE_CHANGE
  50480. },
  50481. _themeDependentChanges: [NODES_CREATE_CHANGE],
  50482. _getDefaultSize: function() {
  50483. return {
  50484. width: 400,
  50485. height: 400
  50486. }
  50487. },
  50488. _themeSection: "funnel",
  50489. _fontFields: ["legend.title.font", "legend.title.subtitle.font", "legend.font"],
  50490. _optionChangesOrder: ["DATA_SOURCE"],
  50491. _initialChanges: ["DATA_SOURCE"],
  50492. _initCore: function() {
  50493. this._group = this._renderer.g().append(this._renderer.root);
  50494. this._items = []
  50495. },
  50496. _eventsMap: {
  50497. onHoverChanged: {
  50498. name: "hoverChanged"
  50499. },
  50500. onSelectionChanged: {
  50501. name: "selectionChanged"
  50502. }
  50503. },
  50504. _disposeCore: noop,
  50505. _applySize: function(rect) {
  50506. this._rect = rect.slice();
  50507. this._change(["TILING"]);
  50508. return this._rect
  50509. },
  50510. _getAlignmentRect: function() {
  50511. return this._rect
  50512. },
  50513. _change_TILING: function() {
  50514. var that = this;
  50515. var items = that._items;
  50516. var rect = that._rect;
  50517. var convertCoord = function(coord, index) {
  50518. var offset = index % 2;
  50519. return rect[0 + offset] + (rect[2 + offset] - rect[0 + offset]) * coord
  50520. };
  50521. this._group.clear();
  50522. items.forEach(function(item, index) {
  50523. var coords = item.figure.map(convertCoord);
  50524. var element = that._renderer.path([], "area").attr({
  50525. points: coords
  50526. }).append(that._group);
  50527. item.coords = coords;
  50528. item.element = element
  50529. });
  50530. this._requestChange(["TILES"])
  50531. },
  50532. _customChangesOrder: [NODES_CREATE_CHANGE, "LAYOUT", "TILING", "TILES", "DRAWN"],
  50533. _dataSourceChangedHandler: function() {
  50534. this._requestChange([NODES_CREATE_CHANGE])
  50535. },
  50536. _change_DRAWN: function() {
  50537. this._drawn()
  50538. },
  50539. _change_DATA_SOURCE: function() {
  50540. this._change(["DRAWN"]);
  50541. this._updateDataSource()
  50542. },
  50543. _change_NODES_CREATE: function() {
  50544. this._buildNodes()
  50545. },
  50546. _change_TILES: function() {
  50547. this._applyTilesAppearance()
  50548. },
  50549. _suspend: function() {
  50550. if (!this._applyingChanges) {
  50551. this._suspendChanges()
  50552. }
  50553. },
  50554. _resume: function() {
  50555. if (!this._applyingChanges) {
  50556. this._resumeChanges()
  50557. }
  50558. },
  50559. _applyTilesAppearance: function() {
  50560. this._items.forEach(function(item) {
  50561. var state = item.getState();
  50562. item.element.smartAttr(item.states[state])
  50563. })
  50564. },
  50565. _hitTestTargets: function(x, y) {
  50566. var that = this;
  50567. var data;
  50568. this._proxyData.some(function(callback) {
  50569. data = callback.call(that, x, y);
  50570. if (data) {
  50571. return true
  50572. }
  50573. });
  50574. return data
  50575. },
  50576. clearHover: function() {
  50577. this._suspend();
  50578. this._items.forEach(function(item) {
  50579. item.isHovered() && item.hover(false)
  50580. });
  50581. this._resume()
  50582. },
  50583. clearSelection: function() {
  50584. this._suspend();
  50585. this._items.forEach(function(item) {
  50586. item.isSelected() && item.select(false)
  50587. });
  50588. this._resume()
  50589. },
  50590. _getData: function() {
  50591. var that = this;
  50592. var data = that._dataSourceItems() || [];
  50593. var valueField = that._getOption("valueField", true);
  50594. var argumentField = that._getOption("argumentField", true);
  50595. var colorField = that._getOption("colorField", true);
  50596. var processedData = data.reduce(function(d, item) {
  50597. var value = Number(item[valueField]);
  50598. if (value >= 0) {
  50599. d[0].push({
  50600. value: value,
  50601. color: item[colorField],
  50602. argument: item[argumentField],
  50603. dataItem: item
  50604. });
  50605. d[1] += value
  50606. }
  50607. return d
  50608. }, [
  50609. [], 0
  50610. ]);
  50611. var items = processedData[0];
  50612. if (!processedData[1]) {
  50613. items = items.map(function(item) {
  50614. item.value += 1;
  50615. return item
  50616. })
  50617. }
  50618. if (data.length > 0 && 0 === items.length) {
  50619. that._incidentOccurred("E2005", valueField)
  50620. }
  50621. if (that._getOption("sortData", true)) {
  50622. items.sort(function(a, b) {
  50623. return b.value - a.value
  50624. })
  50625. }
  50626. return items
  50627. },
  50628. _buildNodes: function() {
  50629. var that = this;
  50630. var data = that._getData();
  50631. var algorithm = tiling.getAlgorithm(that._getOption("algorithm", true));
  50632. var percents = algorithm.normalizeValues(data);
  50633. var itemOptions = that._getOption("item");
  50634. var figures = algorithm.getFigures(percents, that._getOption("neckWidth", true), that._getOption("neckHeight", true));
  50635. var palette = that._themeManager.createPalette(that._getOption("palette", true), {
  50636. useHighlight: true,
  50637. extensionMode: that._getOption("paletteExtensionMode", true),
  50638. count: figures.length
  50639. });
  50640. that._items = figures.map(function(figure, index) {
  50641. var curData = data[index];
  50642. var node = new Item(that, {
  50643. figure: figure,
  50644. data: curData,
  50645. percent: percents[index],
  50646. id: index,
  50647. color: curData.color || palette.getNextColor(),
  50648. itemOptions: itemOptions
  50649. });
  50650. return node
  50651. });
  50652. if (that._getOption("inverted", true)) {
  50653. that._items.forEach(function(item) {
  50654. item.figure = invertFigure(item.figure)
  50655. })
  50656. }
  50657. that._renderer.initHatching();
  50658. that._change(["TILING", "DRAWN"])
  50659. },
  50660. _showTooltip: noop,
  50661. hideTooltip: noop,
  50662. getAllItems: function() {
  50663. return this._items.slice()
  50664. },
  50665. _getLegendData: function() {
  50666. return this._items.map(function(item) {
  50667. return {
  50668. id: item.id,
  50669. visible: true,
  50670. text: item.argument,
  50671. item: item,
  50672. states: item.states
  50673. }
  50674. })
  50675. },
  50676. _getMinSize: function() {
  50677. var adaptiveLayout = this._getOption("adaptiveLayout");
  50678. return [adaptiveLayout.width, adaptiveLayout.height]
  50679. }
  50680. });
  50681. __webpack_require__( /*! ../../core/component_registrator */ 9)("dxFunnel", dxFunnel);
  50682. module.exports = dxFunnel;
  50683. dxFunnel.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin)
  50684. },
  50685. /*!***************************************************!*\
  50686. !*** ./artifacts/transpiled/viz/sankey/sankey.js ***!
  50687. \***************************************************/
  50688. /*! dynamic exports provided */
  50689. /*! all exports used */
  50690. function(module, exports, __webpack_require__) {
  50691. var _constants = __webpack_require__( /*! ./constants */ 427);
  50692. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  50693. var Node = __webpack_require__( /*! ./node_item */ 845);
  50694. var Link = __webpack_require__( /*! ./link_item */ 846);
  50695. var defaultLayoutBuilder = __webpack_require__( /*! ./layout */ 847);
  50696. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  50697. var _isString = typeUtils.isString;
  50698. var _isNumber = typeUtils.isNumeric;
  50699. function moveLabel(node, labelOptions, availableLabelWidth, rect) {
  50700. if (node.label.getBBox().width > availableLabelWidth) {
  50701. node.labelText.applyEllipsis(availableLabelWidth)
  50702. }
  50703. var bBox = node.label.getBBox();
  50704. var verticalOffset = labelOptions.verticalOffset;
  50705. var horizontalOffset = labelOptions.horizontalOffset;
  50706. var labelOffsetY = Math.round(node.rect.y + node.rect.height / 2 - bBox.y - bBox.height / 2) + verticalOffset;
  50707. var labelOffsetX = node.rect.x + horizontalOffset + node.rect.width - bBox.x;
  50708. if (labelOffsetX + bBox.width >= rect[2] - rect[0]) {
  50709. labelOffsetX = node.rect.x - horizontalOffset - bBox.x - bBox.width
  50710. }
  50711. if (labelOffsetY >= rect[3]) {
  50712. labelOffsetY = rect[3]
  50713. }
  50714. if (labelOffsetY - bBox.height < rect[1]) {
  50715. labelOffsetY = node.rect.y - bBox.y + verticalOffset
  50716. }
  50717. node.labelText.attr({
  50718. translateX: labelOffsetX,
  50719. translateY: labelOffsetY
  50720. })
  50721. }
  50722. function getConnectedLinks(layout, nodeName, linkType) {
  50723. var result = [];
  50724. var attrName = "in" === linkType ? "_to" : "_from";
  50725. var invertedAttrName = "in" === linkType ? "_from" : "_to";
  50726. layout.links.map(function(link) {
  50727. return link[attrName]._name === nodeName
  50728. }).forEach(function(connected, idx) {
  50729. connected && result.push({
  50730. index: idx,
  50731. weight: layout.links[idx]._weight,
  50732. node: layout.links[idx][invertedAttrName]._name
  50733. })
  50734. });
  50735. return result
  50736. }
  50737. var dxSankey = __webpack_require__( /*! ../core/base_widget */ 96).inherit({
  50738. _rootClass: "dxs-sankey",
  50739. _rootClassPrefix: "dxs",
  50740. _proxyData: [],
  50741. _optionChangesMap: {
  50742. dataSource: "DATA_SOURCE",
  50743. sortData: "DATA_SOURCE",
  50744. alignment: "DATA_SOURCE",
  50745. node: "BUILD_LAYOUT",
  50746. link: "BUILD_LAYOUT",
  50747. palette: "BUILD_LAYOUT",
  50748. paletteExtensionMode: "BUILD_LAYOUT"
  50749. },
  50750. _themeDependentChanges: ["BUILD_LAYOUT"],
  50751. _getDefaultSize: function() {
  50752. return {
  50753. width: 400,
  50754. height: 400
  50755. }
  50756. },
  50757. _themeSection: "sankey",
  50758. _fontFields: ["label.font"],
  50759. _optionChangesOrder: ["DATA_SOURCE"],
  50760. _initialChanges: ["DATA_SOURCE"],
  50761. _initCore: function() {
  50762. this._groupLinks = this._renderer.g().append(this._renderer.root);
  50763. this._groupNodes = this._renderer.g().append(this._renderer.root);
  50764. this._groupLabels = this._renderer.g().attr({
  50765. "class": this._rootClassPrefix + "-labels"
  50766. }).append(this._renderer.root);
  50767. this._drawLabels = true;
  50768. this._nodes = [];
  50769. this._links = [];
  50770. this._gradients = []
  50771. },
  50772. _disposeCore: noop,
  50773. _applySize: function(rect) {
  50774. this._rect = rect.slice();
  50775. var adaptiveLayout = this._getOption("adaptiveLayout");
  50776. if (adaptiveLayout.keepLabels || this._rect[2] - this._rect[0] > adaptiveLayout.width) {
  50777. this._drawLabels = true
  50778. } else {
  50779. this._drawLabels = false
  50780. }
  50781. this._change(["BUILD_LAYOUT"]);
  50782. return this._rect
  50783. },
  50784. _eventsMap: {
  50785. onNodeHoverChanged: {
  50786. name: "nodeHoverChanged"
  50787. },
  50788. onLinkHoverChanged: {
  50789. name: "linkHoverChanged"
  50790. }
  50791. },
  50792. _customChangesOrder: ["BUILD_LAYOUT", "NODES_DRAW", "LINKS_DRAW", "LABELS", "DRAWN"],
  50793. _dataSourceChangedHandler: function() {
  50794. this._requestChange(["BUILD_LAYOUT"])
  50795. },
  50796. _change_DRAWN: function() {
  50797. this._drawn()
  50798. },
  50799. _change_DATA_SOURCE: function() {
  50800. this._change(["DRAWN"]);
  50801. this._updateDataSource()
  50802. },
  50803. _change_LABELS: function() {
  50804. this._applyLabelsAppearance()
  50805. },
  50806. _change_BUILD_LAYOUT: function() {
  50807. this._groupNodes.clear();
  50808. this._groupLinks.clear();
  50809. this._groupLabels.clear();
  50810. this._buildLayout()
  50811. },
  50812. _change_NODES_DRAW: function() {
  50813. var that = this;
  50814. var nodes = that._nodes;
  50815. nodes.forEach(function(node, index) {
  50816. var element = that._renderer.rect().attr(node.rect).append(that._groupNodes);
  50817. node.element = element
  50818. });
  50819. this._applyNodesAppearance()
  50820. },
  50821. _change_LINKS_DRAW: function() {
  50822. var that = this;
  50823. var links = that._links;
  50824. links.forEach(function(link, index) {
  50825. var group = that._renderer.g().attr({
  50826. "class": "link",
  50827. "data-link-idx": index
  50828. }).append(that._groupLinks);
  50829. link.overlayElement = that._renderer.path([], "area").attr({
  50830. d: link.d
  50831. }).append(group);
  50832. link.element = that._renderer.path([], "area").attr({
  50833. d: link.d
  50834. }).append(group)
  50835. });
  50836. this._applyLinksAppearance()
  50837. },
  50838. _suspend: function() {
  50839. if (!this._applyingChanges) {
  50840. this._suspendChanges()
  50841. }
  50842. },
  50843. _resume: function() {
  50844. if (!this._applyingChanges) {
  50845. this._resumeChanges()
  50846. }
  50847. },
  50848. _showTooltip: noop,
  50849. hideTooltip: noop,
  50850. clearHover: function() {
  50851. this._suspend();
  50852. this._nodes.forEach(function(node) {
  50853. node.isHovered() && node.hover(false)
  50854. });
  50855. this._links.forEach(function(link) {
  50856. link.isHovered() && link.hover(false);
  50857. link.isAdjacentNodeHovered() && link.adjacentNodeHover(false)
  50858. });
  50859. this._resume()
  50860. },
  50861. _applyNodesAppearance: function() {
  50862. this._nodes.forEach(function(node) {
  50863. var state = node.getState();
  50864. node.element.smartAttr(node.states[state])
  50865. })
  50866. },
  50867. _applyLinksAppearance: function() {
  50868. this._links.forEach(function(link) {
  50869. var state = link.getState();
  50870. link.element.smartAttr(link.states[state]);
  50871. link.overlayElement.smartAttr(link.overlayStates[state])
  50872. })
  50873. },
  50874. _hitTestTargets: function(x, y) {
  50875. var that = this;
  50876. var data;
  50877. this._proxyData.some(function(callback) {
  50878. data = callback.call(that, x, y);
  50879. if (data) {
  50880. return true
  50881. }
  50882. });
  50883. return data
  50884. },
  50885. _getData: function() {
  50886. var that = this;
  50887. var data = that._dataSourceItems() || [];
  50888. var sourceField = that._getOption("sourceField", true);
  50889. var targetField = that._getOption("targetField", true);
  50890. var weightField = that._getOption("weightField", true);
  50891. var processedData = [];
  50892. data.forEach(function(item) {
  50893. var hasItemOwnProperty = Object.prototype.hasOwnProperty.bind(item);
  50894. if (!hasItemOwnProperty(sourceField)) {
  50895. that._incidentOccurred("E2007", sourceField)
  50896. } else {
  50897. if (!hasItemOwnProperty(targetField)) {
  50898. that._incidentOccurred("E2007", targetField)
  50899. } else {
  50900. if (!hasItemOwnProperty(weightField)) {
  50901. that._incidentOccurred("E2007", weightField)
  50902. } else {
  50903. if (!_isString(item[sourceField])) {
  50904. that._incidentOccurred("E2008", sourceField)
  50905. } else {
  50906. if (!_isString(item[targetField])) {
  50907. that._incidentOccurred("E2008", targetField)
  50908. } else {
  50909. if (!_isNumber(item[weightField]) || item[weightField] <= 0) {
  50910. that._incidentOccurred("E2009", weightField)
  50911. } else {
  50912. processedData.push([item[sourceField], item[targetField], item[weightField]])
  50913. }
  50914. }
  50915. }
  50916. }
  50917. }
  50918. }
  50919. });
  50920. return processedData
  50921. },
  50922. _buildLayout: function() {
  50923. var _this = this;
  50924. var that = this;
  50925. var data = that._getData();
  50926. var availableRect = this._rect;
  50927. var nodeOptions = that._getOption("node");
  50928. var sortData = that._getOption("sortData");
  50929. var layoutBuilder = that._getOption("layoutBuilder", true) || defaultLayoutBuilder;
  50930. var rect = {
  50931. x: availableRect[0],
  50932. y: availableRect[1],
  50933. width: availableRect[2] - availableRect[0],
  50934. height: availableRect[3] - availableRect[1]
  50935. };
  50936. var layout = layoutBuilder.computeLayout(data, sortData, {
  50937. availableRect: rect,
  50938. nodePadding: nodeOptions.padding,
  50939. nodeWidth: nodeOptions.width,
  50940. nodeAlign: that._getOption("alignment", true)
  50941. }, that._incidentOccurred);
  50942. that._layoutMap = layout;
  50943. if (!Object.prototype.hasOwnProperty.call(layout, "error")) {
  50944. var nodeColors = {};
  50945. var nodeIdx = 0;
  50946. var linkOptions = that._getOption("link");
  50947. var totalNodesNum = layout.nodes.map(function(item) {
  50948. return item.length
  50949. }).reduce(function(previousValue, currentValue) {
  50950. return previousValue + currentValue
  50951. }, 0);
  50952. var palette = that._themeManager.createPalette(that._getOption("palette", true), {
  50953. useHighlight: true,
  50954. extensionMode: that._getOption("paletteExtensionMode", true),
  50955. count: totalNodesNum
  50956. });
  50957. that._nodes = [];
  50958. that._links = [];
  50959. that._gradients.forEach(function(gradient) {
  50960. gradient.dispose()
  50961. });
  50962. that._gradients = [];
  50963. that._shadowFilter && that._shadowFilter.dispose();
  50964. layout.nodes.forEach(function(cascadeNodes) {
  50965. cascadeNodes.forEach(function(node) {
  50966. var color = nodeOptions.color || palette.getNextColor();
  50967. var nodeItem = new Node(that, {
  50968. id: nodeIdx,
  50969. color: color,
  50970. rect: node,
  50971. options: nodeOptions,
  50972. linksIn: getConnectedLinks(layout, node._name, "in"),
  50973. linksOut: getConnectedLinks(layout, node._name, "out")
  50974. });
  50975. that._nodes.push(nodeItem);
  50976. nodeIdx++;
  50977. nodeColors[node._name] = color
  50978. })
  50979. });
  50980. layout.links.forEach(function(link) {
  50981. var gradient = null;
  50982. if (linkOptions.colorMode === _constants.COLOR_MODE_GRADIENT) {
  50983. gradient = that._renderer.linearGradient([{
  50984. offset: "0%",
  50985. "stop-color": nodeColors[link._from._name]
  50986. }, {
  50987. offset: "100%",
  50988. "stop-color": nodeColors[link._to._name]
  50989. }]);
  50990. _this._gradients.push(gradient)
  50991. }
  50992. var color = linkOptions.color;
  50993. if (linkOptions.colorMode === _constants.COLOR_MODE_SOURCE) {
  50994. color = nodeColors[link._from._name]
  50995. } else {
  50996. if (linkOptions.colorMode === _constants.COLOR_MODE_TARGET) {
  50997. color = nodeColors[link._to._name]
  50998. }
  50999. }
  51000. var linkItem = new Link(that, {
  51001. d: link.d,
  51002. boundingRect: link._boundingRect,
  51003. color: color,
  51004. options: linkOptions,
  51005. connection: {
  51006. source: link._from._name,
  51007. target: link._to._name,
  51008. weight: link._weight
  51009. },
  51010. gradient: gradient
  51011. });
  51012. that._links.push(linkItem)
  51013. });
  51014. that._renderer.initHatching();
  51015. that._change(["NODES_DRAW", "LINKS_DRAW", "LABELS"])
  51016. }
  51017. that._change(["DRAWN"])
  51018. },
  51019. _applyLabelsAppearance: function() {
  51020. var that = this;
  51021. var labelOptions = that._getOption("label");
  51022. var availableWidth = that._rect[2] - that._rect[0];
  51023. var nodeOptions = that._getOption("node");
  51024. that._shadowFilter = that._renderer.shadowFilter("-50%", "-50%", "200%", "200%").attr(labelOptions.shadow);
  51025. that._groupLabels.clear();
  51026. if (that._drawLabels && labelOptions.visible) {
  51027. var availableLabelWidth = (availableWidth - (nodeOptions.width + labelOptions.horizontalOffset) - that._layoutMap.cascades.length * nodeOptions.width) / (that._layoutMap.cascades.length - 1) - labelOptions.horizontalOffset;
  51028. that._nodes.forEach(function(node) {
  51029. that._createLabel(node, labelOptions, that._shadowFilter.id);
  51030. moveLabel(node, labelOptions, availableLabelWidth, that._rect)
  51031. });
  51032. if ("none" !== labelOptions.overlappingBehavior) {
  51033. that._nodes.forEach(function(thisNode) {
  51034. var thisBox = thisNode.label.getBBox();
  51035. that._nodes.forEach(function(otherNode) {
  51036. var otherBox = otherNode.label.getBBox();
  51037. if (thisNode.id !== otherNode.id && defaultLayoutBuilder.overlap(thisBox, otherBox)) {
  51038. if ("ellipsis" === labelOptions.overlappingBehavior) {
  51039. thisNode.labelText.applyEllipsis(otherBox.x - thisBox.x)
  51040. } else {
  51041. if ("hide" === labelOptions.overlappingBehavior) {
  51042. thisNode.labelText.remove()
  51043. }
  51044. }
  51045. }
  51046. })
  51047. })
  51048. }
  51049. }
  51050. },
  51051. _createLabel: function(node, labelOptions, filter) {
  51052. var textData = labelOptions.customizeText(node);
  51053. var settings = node.getLabelAttributes(labelOptions, filter);
  51054. if (textData) {
  51055. node.label = this._renderer.g().append(this._groupLabels);
  51056. node.labelText = this._renderer.text(textData).attr(settings.attr).css(settings.css);
  51057. node.labelText.append(node.label)
  51058. }
  51059. },
  51060. _getMinSize: function() {
  51061. var adaptiveLayout = this._getOption("adaptiveLayout");
  51062. return [adaptiveLayout.width, adaptiveLayout.height]
  51063. },
  51064. getAllNodes: function() {
  51065. return this._nodes.slice()
  51066. },
  51067. getAllLinks: function() {
  51068. return this._links.slice()
  51069. }
  51070. });
  51071. __webpack_require__( /*! ../../core/component_registrator */ 9)("dxSankey", dxSankey);
  51072. module.exports = dxSankey;
  51073. dxSankey.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin)
  51074. },
  51075. /*!******************************************************!*\
  51076. !*** ./artifacts/transpiled/viz/sankey/constants.js ***!
  51077. \******************************************************/
  51078. /*! dynamic exports provided */
  51079. /*! all exports used */
  51080. function(module, exports, __webpack_require__) {
  51081. Object.defineProperty(exports, "__esModule", {
  51082. value: true
  51083. });
  51084. exports.COLOR_MODE_GRADIENT = "gradient";
  51085. exports.COLOR_MODE_SOURCE = "source";
  51086. exports.COLOR_MODE_TARGET = "target";
  51087. exports.COLOR_MODE_NONE = "none"
  51088. },
  51089. /*!**************************************************!*\
  51090. !*** ./artifacts/transpiled/viz/sankey/graph.js ***!
  51091. \**************************************************/
  51092. /*! dynamic exports provided */
  51093. /*! all exports used */
  51094. function(module, exports, __webpack_require__) {
  51095. var WHITE = "white";
  51096. var GRAY = "gray";
  51097. var BLACK = "black";
  51098. var routines = {
  51099. maxOfArray: function(arr, callback) {
  51100. var m = 0;
  51101. var callback_function = function(v) {
  51102. return v
  51103. };
  51104. if (callback) {
  51105. callback_function = callback
  51106. }
  51107. for (var i = 0; i < arr.length; i++) {
  51108. if (callback_function(arr[i]) > m) {
  51109. m = callback_function(arr[i])
  51110. }
  51111. }
  51112. return m
  51113. }
  51114. };
  51115. var getVertices = function(links) {
  51116. var vert = [];
  51117. links.forEach(function(link) {
  51118. if (vert.indexOf(link[0]) === -1) {
  51119. vert.push(link[0])
  51120. }
  51121. if (vert.indexOf(link[1]) === -1) {
  51122. vert.push(link[1])
  51123. }
  51124. });
  51125. return vert
  51126. };
  51127. var getAdjacentVertices = function(links, vertex) {
  51128. var avert = [];
  51129. links.forEach(function(link) {
  51130. if (link[0] === vertex && avert.indexOf(link[1]) === -1) {
  51131. avert.push(link[1])
  51132. }
  51133. });
  51134. return avert
  51135. };
  51136. var getReverseAdjacentVertices = function(links, vertex) {
  51137. var avert = [];
  51138. links.forEach(function(link) {
  51139. if (link[1] === vertex && avert.indexOf(link[0]) === -1) {
  51140. avert.push(link[0])
  51141. }
  51142. });
  51143. return avert
  51144. };
  51145. var struct = {
  51146. _hasCycle: false,
  51147. _sortedList: [],
  51148. hasCycle: function(links) {
  51149. var _this = this;
  51150. this._hasCycle = false;
  51151. this._sortedList = [];
  51152. var vertices = {};
  51153. var allVertices = getVertices(links);
  51154. allVertices.forEach(function(vertex) {
  51155. vertices[vertex] = {
  51156. color: WHITE
  51157. }
  51158. });
  51159. allVertices.forEach(function(vertex) {
  51160. if (vertices[vertex].color === WHITE) {
  51161. _this._depthFirstSearch(links, vertices, vertex)
  51162. }
  51163. });
  51164. this._sortedList.reverse();
  51165. return this._hasCycle
  51166. },
  51167. _depthFirstSearch: function(links, vertices, vertex) {
  51168. vertices[vertex].color = GRAY;
  51169. var averts = getAdjacentVertices(links, vertex);
  51170. for (var a = 0; a < averts.length; a++) {
  51171. if (vertices[averts[a]].color === WHITE) {
  51172. this._depthFirstSearch(links, vertices, averts[a])
  51173. } else {
  51174. if (vertices[averts[a]].color === GRAY) {
  51175. this._hasCycle = true
  51176. }
  51177. }
  51178. }
  51179. this._sortedList.push({
  51180. name: vertex,
  51181. lp: null,
  51182. incoming: getReverseAdjacentVertices(links, vertex),
  51183. outgoing: getAdjacentVertices(links, vertex)
  51184. });
  51185. vertices[vertex].color = BLACK
  51186. },
  51187. computeLongestPaths: function(links) {
  51188. var sortedVertices = this._sortedList;
  51189. sortedVertices.forEach(function(vertex) {
  51190. var averts = getReverseAdjacentVertices(links, vertex.name);
  51191. if (0 === averts.length) {
  51192. vertex.lp = 0
  51193. } else {
  51194. var maxLP = [];
  51195. averts.forEach(function(adjacentVertex) {
  51196. maxLP.push(sortedVertices.filter(function(sv) {
  51197. return sv.name === adjacentVertex
  51198. })[0].lp)
  51199. });
  51200. vertex.lp = routines.maxOfArray(maxLP) + 1
  51201. }
  51202. });
  51203. return this._sortedList
  51204. }
  51205. };
  51206. module.exports = {
  51207. struct: struct,
  51208. routines: routines,
  51209. getVertices: getVertices,
  51210. getAdjacentVertices: getAdjacentVertices,
  51211. getReverseAdjacentVertices: getReverseAdjacentVertices
  51212. }
  51213. }, , ,
  51214. /*!********************************************************!*\
  51215. !*** ./artifacts/transpiled/exporter/excel_creator.js ***!
  51216. \********************************************************/
  51217. /*! dynamic exports provided */
  51218. /*! all exports used */
  51219. function(module, exports, __webpack_require__) {
  51220. var _class = __webpack_require__( /*! ../core/class */ 15);
  51221. var _class2 = _interopRequireDefault(_class);
  51222. var _window = __webpack_require__( /*! ../core/utils/window */ 7);
  51223. var _type = __webpack_require__( /*! ../core/utils/type */ 1);
  51224. var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
  51225. var _ui = __webpack_require__( /*! ../ui/widget/ui.errors */ 17);
  51226. var _ui2 = _interopRequireDefault(_ui);
  51227. var _string = __webpack_require__( /*! ../core/utils/string */ 44);
  51228. var _string2 = _interopRequireDefault(_string);
  51229. var _jszip = __webpack_require__( /*! jszip */ 432);
  51230. var _jszip2 = _interopRequireDefault(_jszip);
  51231. var _file_saver = __webpack_require__( /*! ./file_saver */ 207);
  51232. var _file_saver2 = _interopRequireDefault(_file_saver);
  51233. var _excel_format_converter = __webpack_require__( /*! ./excel_format_converter */ 178);
  51234. var _excel_format_converter2 = _interopRequireDefault(_excel_format_converter);
  51235. var _excel = __webpack_require__( /*! ./excel/excel.file */ 433);
  51236. var _excel2 = _interopRequireDefault(_excel);
  51237. function _interopRequireDefault(obj) {
  51238. return obj && obj.__esModule ? obj : {
  51239. "default": obj
  51240. }
  51241. }
  51242. function _typeof(obj) {
  51243. "@babel/helpers - typeof";
  51244. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  51245. return typeof obj
  51246. } : function(obj) {
  51247. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  51248. }, _typeof(obj)
  51249. }
  51250. var XML_TAG = '<?xml version="1.0" encoding="utf-8"?>';
  51251. var GROUP_SHEET_PR_XML = '<sheetPr><outlinePr summaryBelow="0"/></sheetPr>';
  51252. var SINGLE_SHEET_PR_XML = "<sheetPr/>";
  51253. var BASE_STYLE_XML2 = '<borders count="1"><border><left style="thin"><color rgb="FFD3D3D3"/></left><right style="thin"><color rgb="FFD3D3D3"/></right><top style="thin"><color rgb="FFD3D3D3"/></top><bottom style="thin"><color rgb="FFD3D3D3"/></bottom></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>';
  51254. var OPEN_XML_FORMAT_URL = "http://schemas.openxmlformats.org";
  51255. var RELATIONSHIP_PART_NAME = "rels";
  51256. var XL_FOLDER_NAME = "xl";
  51257. var WORKBOOK_FILE_NAME = "workbook.xml";
  51258. var CONTENTTYPES_FILE_NAME = "[Content_Types].xml";
  51259. var SHAREDSTRING_FILE_NAME = "sharedStrings.xml";
  51260. var STYLE_FILE_NAME = "styles.xml";
  51261. var WORKSHEETS_FOLDER = "worksheets";
  51262. var WORKSHEET_FILE_NAME = "sheet1.xml";
  51263. var WORKSHEET_HEADER_XML = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">';
  51264. var VALID_TYPES = {
  51265. "boolean": "b",
  51266. date: "d",
  51267. number: "n",
  51268. string: "s"
  51269. };
  51270. var EXCEL_START_TIME = Date.UTC(1899, 11, 30);
  51271. var DAYS_COUNT_BEFORE_29_FEB_1900 = 60;
  51272. var MAX_DIGIT_WIDTH_IN_PIXELS = 7;
  51273. var UNSUPPORTED_FORMAT_MAPPING = {
  51274. quarter: "shortDate",
  51275. quarterAndYear: "shortDate",
  51276. minute: "longTime",
  51277. millisecond: "longTime"
  51278. };
  51279. var ExcelCreator = _class2.default.inherit({
  51280. _getXMLTag: function(tagName, attributes, content) {
  51281. var result = "<" + tagName;
  51282. var i;
  51283. var length = attributes.length;
  51284. var attr;
  51285. for (i = 0; i < length; i++) {
  51286. attr = attributes[i];
  51287. if (void 0 !== attr.value) {
  51288. result = result + " " + attr.name + '="' + attr.value + '"'
  51289. }
  51290. }
  51291. return (0, _type.isDefined)(content) ? result + ">" + content + "</" + tagName + ">" : result + " />"
  51292. },
  51293. _convertToExcelCellRef: function(zeroBasedRowIndex, zeroBasedCellIndex) {
  51294. var columnName = "";
  51295. var max = 26;
  51296. var charCode;
  51297. var isCellIndexFound;
  51298. while (!isCellIndexFound) {
  51299. charCode = 65 + (zeroBasedCellIndex >= max ? zeroBasedCellIndex % max : Math.ceil(zeroBasedCellIndex));
  51300. columnName = String.fromCharCode(charCode) + columnName;
  51301. if (zeroBasedCellIndex >= max) {
  51302. zeroBasedCellIndex = Math.floor(zeroBasedCellIndex / max) - 1
  51303. } else {
  51304. isCellIndexFound = true
  51305. }
  51306. }
  51307. return columnName + (zeroBasedRowIndex + 1)
  51308. },
  51309. _convertToExcelCellRefAndTrackMaxIndex: function(rowIndex, cellIndex) {
  51310. if (this._maxRowIndex < Number(rowIndex)) {
  51311. this._maxRowIndex = Number(rowIndex)
  51312. }
  51313. if (this._maxColumnIndex < Number(cellIndex)) {
  51314. this._maxColumnIndex = Number(cellIndex)
  51315. }
  51316. return this._convertToExcelCellRef(rowIndex, cellIndex)
  51317. },
  51318. _getDataType: function(dataType) {
  51319. return VALID_TYPES[dataType] || VALID_TYPES.string
  51320. },
  51321. _tryGetExcelCellDataType: function(object) {
  51322. if ((0, _type.isDefined)(object)) {
  51323. if ("number" === typeof object) {
  51324. if (isFinite(object)) {
  51325. return VALID_TYPES.number
  51326. } else {
  51327. return VALID_TYPES.string
  51328. }
  51329. } else {
  51330. if ((0, _type.isString)(object)) {
  51331. return VALID_TYPES.string
  51332. } else {
  51333. if ((0, _type.isDate)(object)) {
  51334. return VALID_TYPES.number
  51335. } else {
  51336. if ((0, _type.isBoolean)(object)) {
  51337. return VALID_TYPES.boolean
  51338. }
  51339. }
  51340. }
  51341. }
  51342. }
  51343. },
  51344. _formatObjectConverter: function(format, dataType) {
  51345. var result = {
  51346. format: format,
  51347. precision: format && format.precision,
  51348. dataType: dataType
  51349. };
  51350. if ((0, _type.isObject)(format)) {
  51351. return (0, _extend.extend)(result, format, {
  51352. format: format.formatter || format.type,
  51353. currency: format.currency
  51354. })
  51355. }
  51356. return result
  51357. },
  51358. _tryConvertToExcelNumberFormat: function(format, dataType) {
  51359. var newFormat = this._formatObjectConverter(format, dataType);
  51360. format = newFormat.format;
  51361. var currency = newFormat.currency;
  51362. dataType = newFormat.dataType;
  51363. if ((0, _type.isDefined)(format) && "date" === dataType) {
  51364. format = UNSUPPORTED_FORMAT_MAPPING[format && format.type || format] || format
  51365. }
  51366. return _excel_format_converter2.default.convertFormat(format, newFormat.precision, dataType, currency)
  51367. },
  51368. _appendString: function(value) {
  51369. if ((0, _type.isDefined)(value)) {
  51370. value = String(value);
  51371. if (value.length) {
  51372. value = _string2.default.encodeHtml(value);
  51373. if (void 0 === this._stringHash[value]) {
  51374. this._stringHash[value] = this._stringArray.length;
  51375. this._stringArray.push(value)
  51376. }
  51377. return this._stringHash[value]
  51378. }
  51379. }
  51380. },
  51381. _tryGetExcelDateValue: function(date) {
  51382. var days;
  51383. var totalTime;
  51384. if ((0, _type.isDate)(date)) {
  51385. days = Math.floor((Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - EXCEL_START_TIME) / 864e5);
  51386. if (days < DAYS_COUNT_BEFORE_29_FEB_1900) {
  51387. days--
  51388. }
  51389. totalTime = (3600 * date.getHours() + 60 * date.getMinutes() + date.getSeconds()) / 86400;
  51390. return days + totalTime
  51391. }
  51392. },
  51393. _prepareValue: function(rowIndex, cellIndex) {
  51394. var dataProvider = this._dataProvider;
  51395. var cellData = dataProvider.getCellData(rowIndex, cellIndex) || {};
  51396. var value = cellData.value;
  51397. var cellSourceData = cellData.cellSourceData;
  51398. var sourceValue;
  51399. var type = this._getDataType(dataProvider.getCellType(rowIndex, cellIndex));
  51400. if (type === VALID_TYPES.date && !(0, _type.isDate)(value)) {
  51401. type = VALID_TYPES.string
  51402. }
  51403. switch (type) {
  51404. case VALID_TYPES.string:
  51405. sourceValue = value;
  51406. value = this._appendString(value);
  51407. break;
  51408. case VALID_TYPES.date:
  51409. sourceValue = value;
  51410. value = this._tryGetExcelDateValue(value);
  51411. type = VALID_TYPES.number
  51412. }
  51413. return {
  51414. value: value,
  51415. type: type,
  51416. sourceValue: sourceValue,
  51417. cellSourceData: cellSourceData
  51418. }
  51419. },
  51420. _callCustomizeExcelCell: function(_ref) {
  51421. var dataProvider = _ref.dataProvider,
  51422. value = _ref.value,
  51423. style = _ref.style,
  51424. sourceData = _ref.sourceData;
  51425. var styleCopy = _excel2.default.copyCellFormat(style);
  51426. var args = {
  51427. value: value,
  51428. numberFormat: styleCopy.numberFormat,
  51429. clearStyle: function() {
  51430. this.horizontalAlignment = null;
  51431. this.verticalAlignment = null;
  51432. this.wrapTextEnabled = null;
  51433. this.font = null;
  51434. this.numberFormat = null
  51435. }
  51436. };
  51437. if ((0, _type.isDefined)(styleCopy)) {
  51438. if ((0, _type.isDefined)(styleCopy.alignment)) {
  51439. args.horizontalAlignment = styleCopy.alignment.horizontal;
  51440. args.verticalAlignment = styleCopy.alignment.vertical;
  51441. args.wrapTextEnabled = styleCopy.alignment.wrapText
  51442. }
  51443. args.backgroundColor = styleCopy.backgroundColor;
  51444. args.fillPatternType = styleCopy.fillPatternType;
  51445. args.fillPatternColor = styleCopy.fillPatternColor;
  51446. args.font = styleCopy.font
  51447. }
  51448. dataProvider.customizeExcelCell(args, sourceData);
  51449. var newStyle = styleCopy || {};
  51450. newStyle.font = args.font;
  51451. newStyle.alignment = newStyle.alignment || {};
  51452. newStyle.alignment.horizontal = args.horizontalAlignment;
  51453. newStyle.alignment.vertical = args.verticalAlignment;
  51454. newStyle.alignment.wrapText = args.wrapTextEnabled;
  51455. newStyle.backgroundColor = args.backgroundColor;
  51456. newStyle.fillPatternType = args.fillPatternType;
  51457. newStyle.fillPatternColor = args.fillPatternColor;
  51458. newStyle.numberFormat = args.numberFormat;
  51459. return {
  51460. value: args.value,
  51461. style: newStyle
  51462. }
  51463. },
  51464. _getDataArray: function() {
  51465. var that = this;
  51466. var rowIndex;
  51467. var cellIndex;
  51468. var cellsArray;
  51469. var cellData;
  51470. var result = [];
  51471. var dataProvider = that._dataProvider;
  51472. var rowsLength = dataProvider.getRowsCount();
  51473. var columns = dataProvider.getColumns();
  51474. var cellsLength;
  51475. for (rowIndex = 0; rowIndex < rowsLength; rowIndex++) {
  51476. cellsArray = [];
  51477. cellsLength = columns.length;
  51478. for (cellIndex = 0; cellIndex !== cellsLength; cellIndex++) {
  51479. cellData = that._prepareValue(rowIndex, cellIndex);
  51480. var styleArrayIndex = dataProvider.getStyleId(rowIndex, cellIndex);
  51481. var cellStyleId = this._styleArrayIndexToCellStyleIdMap[styleArrayIndex];
  51482. if (dataProvider.hasCustomizeExcelCell && dataProvider.hasCustomizeExcelCell()) {
  51483. var value = cellData.sourceValue || cellData.value;
  51484. var modifiedExcelCell = this._callCustomizeExcelCell({
  51485. dataProvider: dataProvider,
  51486. value: value,
  51487. style: that._styleArray[styleArrayIndex],
  51488. sourceData: cellData.cellSourceData
  51489. });
  51490. if (modifiedExcelCell.value !== value) {
  51491. if (_typeof(modifiedExcelCell.value) !== _typeof(value) || "number" === typeof modifiedExcelCell.value && !isFinite(modifiedExcelCell.value)) {
  51492. var cellDataType = this._tryGetExcelCellDataType(modifiedExcelCell.value);
  51493. if ((0, _type.isDefined)(cellDataType)) {
  51494. cellData.type = cellDataType
  51495. }
  51496. }
  51497. switch (cellData.type) {
  51498. case VALID_TYPES.string:
  51499. cellData.value = this._appendString(modifiedExcelCell.value);
  51500. break;
  51501. case VALID_TYPES.date:
  51502. cellData.value = modifiedExcelCell.value;
  51503. break;
  51504. case VALID_TYPES.number:
  51505. var newValue = modifiedExcelCell.value;
  51506. var excelDateValue = this._tryGetExcelDateValue(newValue);
  51507. if ((0, _type.isDefined)(excelDateValue)) {
  51508. newValue = excelDateValue
  51509. }
  51510. cellData.value = newValue;
  51511. break;
  51512. default:
  51513. cellData.value = modifiedExcelCell.value
  51514. }
  51515. }
  51516. cellStyleId = this._excelFile.registerCellFormat(modifiedExcelCell.style)
  51517. }
  51518. cellsArray.push({
  51519. style: cellStyleId,
  51520. value: cellData.value,
  51521. type: cellData.type
  51522. })
  51523. }
  51524. if (!that._needSheetPr && dataProvider.getGroupLevel(rowIndex) > 0) {
  51525. that._needSheetPr = true
  51526. }
  51527. result.push(cellsArray)
  51528. }
  51529. return result
  51530. },
  51531. _calculateWidth: function(pixelsWidth) {
  51532. pixelsWidth = parseInt(pixelsWidth, 10);
  51533. if (!pixelsWidth || pixelsWidth < 5) {
  51534. pixelsWidth = 100
  51535. }
  51536. return Math.min(255, Math.floor((pixelsWidth - 5) / MAX_DIGIT_WIDTH_IN_PIXELS * 100 + .5) / 100)
  51537. },
  51538. _prepareStyleData: function() {
  51539. var _this = this;
  51540. var that = this;
  51541. var styles = that._dataProvider.getStyles();
  51542. that._dataProvider.getColumns().forEach(function(column) {
  51543. that._colsArray.push(that._calculateWidth(column.width))
  51544. });
  51545. var fonts = [{
  51546. size: 11,
  51547. color: {
  51548. theme: 1
  51549. },
  51550. name: "Calibri",
  51551. family: 2,
  51552. scheme: "minor",
  51553. bold: false
  51554. }, {
  51555. size: 11,
  51556. color: {
  51557. theme: 1
  51558. },
  51559. name: "Calibri",
  51560. family: 2,
  51561. scheme: "minor",
  51562. bold: true
  51563. }];
  51564. this._excelFile.registerFont(fonts[0]);
  51565. this._excelFile.registerFont(fonts[1]);
  51566. styles.forEach(function(style) {
  51567. var numberFormat = that._tryConvertToExcelNumberFormat(style.format, style.dataType);
  51568. if (!(0, _type.isDefined)(numberFormat)) {
  51569. numberFormat = 0
  51570. }
  51571. that._styleArray.push({
  51572. font: fonts[Number(!!style.bold)],
  51573. numberFormat: numberFormat,
  51574. alignment: {
  51575. vertical: "top",
  51576. wrapText: !!style.wrapText,
  51577. horizontal: style.alignment || "left"
  51578. }
  51579. })
  51580. });
  51581. that._styleArrayIndexToCellStyleIdMap = that._styleArray.map(function(item) {
  51582. return _this._excelFile.registerCellFormat(item)
  51583. })
  51584. },
  51585. _prepareCellData: function() {
  51586. this._cellsArray = this._getDataArray()
  51587. },
  51588. _createXMLRelationships: function(xmlRelationships) {
  51589. return this._getXMLTag("Relationships", [{
  51590. name: "xmlns",
  51591. value: OPEN_XML_FORMAT_URL + "/package/2006/relationships"
  51592. }], xmlRelationships)
  51593. },
  51594. _createXMLRelationship: function(id, type, target) {
  51595. return this._getXMLTag("Relationship", [{
  51596. name: "Id",
  51597. value: "rId" + id
  51598. }, {
  51599. name: "Type",
  51600. value: OPEN_XML_FORMAT_URL + "/officeDocument/2006/relationships/" + type
  51601. }, {
  51602. name: "Target",
  51603. value: target
  51604. }])
  51605. },
  51606. _getWorkbookContent: function() {
  51607. var content = '<bookViews><workbookView xWindow="0" yWindow="0" windowWidth="0" windowHeight="0"/></bookViews><sheets><sheet name="Sheet" sheetId="1" r:id="rId1" /></sheets><definedNames><definedName name="_xlnm.Print_Titles" localSheetId="0">Sheet!$1:$1</definedName><definedName name="_xlnm._FilterDatabase" hidden="0" localSheetId="0">Sheet!$A$1:$F$6332</definedName></definedNames>';
  51608. return XML_TAG + this._getXMLTag("workbook", [{
  51609. name: "xmlns:r",
  51610. value: OPEN_XML_FORMAT_URL + "/officeDocument/2006/relationships"
  51611. }, {
  51612. name: "xmlns",
  51613. value: OPEN_XML_FORMAT_URL + "/spreadsheetml/2006/main"
  51614. }], content)
  51615. },
  51616. _getContentTypesContent: function() {
  51617. return XML_TAG + '<Types xmlns="' + OPEN_XML_FORMAT_URL + '/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="xml" ContentType="application/xml" /><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /></Types>'
  51618. },
  51619. _generateStylesXML: function() {
  51620. var that = this;
  51621. var folder = that._zip.folder(XL_FOLDER_NAME);
  51622. var XML = "";
  51623. XML += this._excelFile.generateNumberFormatsXml();
  51624. XML += this._excelFile.generateFontsXml();
  51625. XML += this._excelFile.generateFillsXml();
  51626. XML += BASE_STYLE_XML2;
  51627. XML += this._excelFile.generateCellFormatsXml();
  51628. XML += that._getXMLTag("cellStyles", [{
  51629. name: "count",
  51630. value: 1
  51631. }], that._getXMLTag("cellStyle", [{
  51632. name: "name",
  51633. value: "Normal"
  51634. }, {
  51635. name: "xfId",
  51636. value: 0
  51637. }, {
  51638. name: "builtinId",
  51639. value: 0
  51640. }]));
  51641. XML = XML_TAG + that._getXMLTag("styleSheet", [{
  51642. name: "xmlns",
  51643. value: OPEN_XML_FORMAT_URL + "/spreadsheetml/2006/main"
  51644. }], XML);
  51645. folder.file(STYLE_FILE_NAME, XML);
  51646. that._styleArray = []
  51647. },
  51648. _generateStringsXML: function() {
  51649. var folder = this._zip.folder(XL_FOLDER_NAME);
  51650. var stringIndex;
  51651. var stringsLength = this._stringArray.length;
  51652. var sharedStringXml = XML_TAG;
  51653. for (stringIndex = 0; stringIndex < stringsLength; stringIndex++) {
  51654. this._stringArray[stringIndex] = this._getXMLTag("si", [], this._getXMLTag("t", [], this._stringArray[stringIndex]))
  51655. }
  51656. sharedStringXml += this._getXMLTag("sst", [{
  51657. name: "xmlns",
  51658. value: OPEN_XML_FORMAT_URL + "/spreadsheetml/2006/main"
  51659. }, {
  51660. name: "count",
  51661. value: this._stringArray.length
  51662. }, {
  51663. name: "uniqueCount",
  51664. value: this._stringArray.length
  51665. }], this._stringArray.join(""));
  51666. folder.file(SHAREDSTRING_FILE_NAME, sharedStringXml);
  51667. this._stringArray = []
  51668. },
  51669. _getPaneXML: function() {
  51670. var attributes = [{
  51671. name: "activePane",
  51672. value: "bottomLeft"
  51673. }, {
  51674. name: "state",
  51675. value: "frozen"
  51676. }];
  51677. var frozenArea = this._dataProvider.getFrozenArea();
  51678. if (!(frozenArea.x || frozenArea.y)) {
  51679. return ""
  51680. }
  51681. if (frozenArea.x) {
  51682. attributes.push({
  51683. name: "xSplit",
  51684. value: frozenArea.x
  51685. })
  51686. }
  51687. if (frozenArea.y) {
  51688. attributes.push({
  51689. name: "ySplit",
  51690. value: frozenArea.y
  51691. })
  51692. }
  51693. attributes.push({
  51694. name: "topLeftCell",
  51695. value: this._convertToExcelCellRefAndTrackMaxIndex(frozenArea.y, frozenArea.x)
  51696. });
  51697. return this._getXMLTag("pane", attributes)
  51698. },
  51699. _getAutoFilterXML: function(maxCellIndex) {
  51700. if (this._options.autoFilterEnabled) {
  51701. return '<autoFilter ref="A' + this._dataProvider.getHeaderRowCount() + ":" + maxCellIndex + '" />'
  51702. }
  51703. return ""
  51704. },
  51705. _getIgnoredErrorsXML: function(maxCellIndex) {
  51706. if (this._options.ignoreErrors) {
  51707. return '<ignoredErrors><ignoredError sqref="A1:' + maxCellIndex + '" numberStoredAsText="1" /></ignoredErrors>'
  51708. }
  51709. return ""
  51710. },
  51711. _generateWorksheetXML: function() {
  51712. var colIndex;
  51713. var rowIndex;
  51714. var cellData;
  51715. var xmlCells;
  51716. var xmlRows = [];
  51717. var rowsLength = this._cellsArray.length;
  51718. var cellsLength;
  51719. var colsLength = this._colsArray.length;
  51720. var rSpans = "1:" + colsLength;
  51721. var headerRowCount = this._dataProvider.getHeaderRowCount ? this._dataProvider.getHeaderRowCount() : 1;
  51722. var xmlResult = [WORKSHEET_HEADER_XML];
  51723. xmlResult.push(this._needSheetPr ? GROUP_SHEET_PR_XML : SINGLE_SHEET_PR_XML);
  51724. xmlResult.push('<dimension ref="A1:C1"/>');
  51725. xmlResult.push("<sheetViews><sheetView ");
  51726. xmlResult.push(this._rtlEnabled ? 'rightToLeft="1" ' : "");
  51727. xmlResult.push('tabSelected="1" workbookViewId="0">');
  51728. xmlResult.push(this._getPaneXML());
  51729. xmlResult.push("</sheetView></sheetViews>");
  51730. xmlResult.push('<sheetFormatPr defaultRowHeight="15"');
  51731. xmlResult.push(' outlineLevelRow="' + (this._dataProvider.getRowsCount() > 0 ? this._dataProvider.getGroupLevel(0) : 0) + '"');
  51732. xmlResult.push(' x14ac:dyDescent="0.25"/>');
  51733. for (colIndex = 0; colIndex < colsLength; colIndex++) {
  51734. this._colsArray[colIndex] = this._getXMLTag("col", [{
  51735. name: "width",
  51736. value: this._colsArray[colIndex]
  51737. }, {
  51738. name: "min",
  51739. value: Number(colIndex) + 1
  51740. }, {
  51741. name: "max",
  51742. value: Number(colIndex) + 1
  51743. }])
  51744. }
  51745. xmlResult.push(this._getXMLTag("cols", [], this._colsArray.join("")) + "<sheetData>");
  51746. for (rowIndex = 0; rowIndex < rowsLength; rowIndex++) {
  51747. xmlCells = [];
  51748. cellsLength = this._cellsArray[rowIndex].length;
  51749. for (colIndex = 0; colIndex < cellsLength; colIndex++) {
  51750. rowIndex = Number(rowIndex);
  51751. cellData = this._cellsArray[rowIndex][colIndex];
  51752. xmlCells.push(this._getXMLTag("c", [{
  51753. name: "r",
  51754. value: this._convertToExcelCellRefAndTrackMaxIndex(rowIndex, colIndex)
  51755. }, {
  51756. name: "s",
  51757. value: cellData.style
  51758. }, {
  51759. name: "t",
  51760. value: cellData.type
  51761. }], (0, _type.isDefined)(cellData.value) ? this._getXMLTag("v", [], cellData.value) : null))
  51762. }
  51763. xmlRows.push(this._getXMLTag("row", [{
  51764. name: "r",
  51765. value: Number(rowIndex) + 1
  51766. }, {
  51767. name: "spans",
  51768. value: rSpans
  51769. }, {
  51770. name: "outlineLevel",
  51771. value: rowIndex >= headerRowCount ? this._dataProvider.getGroupLevel(rowIndex) : 0
  51772. }, {
  51773. name: "x14ac:dyDescent",
  51774. value: "0.25"
  51775. }], xmlCells.join("")));
  51776. this._cellsArray[rowIndex] = null;
  51777. if (xmlRows.length > 1e4) {
  51778. xmlResult.push(xmlRows.join(""));
  51779. xmlRows = []
  51780. }
  51781. }
  51782. xmlResult.push(xmlRows.join(""));
  51783. xmlRows = [];
  51784. var rightBottomCellRef = this._convertToExcelCellRef(this._maxRowIndex, this._maxColumnIndex);
  51785. xmlResult.push("</sheetData>" + this._getAutoFilterXML(rightBottomCellRef) + this._generateMergingXML() + this._getIgnoredErrorsXML(rightBottomCellRef) + "</worksheet>");
  51786. this._zip.folder(XL_FOLDER_NAME).folder(WORKSHEETS_FOLDER).file(WORKSHEET_FILE_NAME, xmlResult.join(""));
  51787. this._colsArray = [];
  51788. this._cellsArray = [];
  51789. xmlResult = []
  51790. },
  51791. _generateMergingXML: function() {
  51792. var k;
  51793. var l;
  51794. var cellIndex;
  51795. var rowIndex;
  51796. var rowsLength = (0, _type.isDefined)(this._dataProvider.getHeaderRowCount) ? this._dataProvider.getHeaderRowCount() : this._dataProvider.getRowsCount();
  51797. var columnsLength = this._dataProvider.getColumns().length;
  51798. var usedArea = [];
  51799. var mergeArray = [];
  51800. var mergeIndex;
  51801. var mergeXML = "";
  51802. for (rowIndex = 0; rowIndex < rowsLength; rowIndex++) {
  51803. for (cellIndex = 0; cellIndex !== columnsLength; cellIndex++) {
  51804. if (!(0, _type.isDefined)(usedArea[rowIndex]) || !(0, _type.isDefined)(usedArea[rowIndex][cellIndex])) {
  51805. var cellMerge = this._dataProvider.getCellMerging(rowIndex, cellIndex);
  51806. if (cellMerge.colspan || cellMerge.rowspan) {
  51807. mergeArray.push({
  51808. start: this._convertToExcelCellRefAndTrackMaxIndex(rowIndex, cellIndex),
  51809. end: this._convertToExcelCellRefAndTrackMaxIndex(rowIndex + (cellMerge.rowspan || 0), cellIndex + (cellMerge.colspan || 0))
  51810. });
  51811. for (k = rowIndex; k <= rowIndex + cellMerge.rowspan || 0; k++) {
  51812. for (l = cellIndex; l <= cellIndex + cellMerge.colspan || 0; l++) {
  51813. if (!(0, _type.isDefined)(usedArea[k])) {
  51814. usedArea[k] = []
  51815. }
  51816. usedArea[k][l] = true
  51817. }
  51818. }
  51819. }
  51820. }
  51821. }
  51822. }
  51823. var mergeArrayLength = mergeArray.length;
  51824. for (mergeIndex = 0; mergeIndex < mergeArrayLength; mergeIndex++) {
  51825. mergeXML += this._getXMLTag("mergeCell", [{
  51826. name: "ref",
  51827. value: mergeArray[mergeIndex].start + ":" + mergeArray[mergeIndex].end
  51828. }])
  51829. }
  51830. return mergeXML.length ? this._getXMLTag("mergeCells", [{
  51831. name: "count",
  51832. value: mergeArrayLength
  51833. }], mergeXML) : ""
  51834. },
  51835. _generateCommonXML: function() {
  51836. var relsFileContent = XML_TAG + this._createXMLRelationships(this._createXMLRelationship(1, "officeDocument", "xl/" + WORKBOOK_FILE_NAME));
  51837. var folder = this._zip.folder(XL_FOLDER_NAME);
  51838. var relsXML = XML_TAG;
  51839. this._zip.folder("_" + RELATIONSHIP_PART_NAME).file("." + RELATIONSHIP_PART_NAME, relsFileContent);
  51840. var xmlRelationships = this._createXMLRelationship(1, "worksheet", "worksheets/" + WORKSHEET_FILE_NAME) + this._createXMLRelationship(2, "styles", STYLE_FILE_NAME) + this._createXMLRelationship(3, "sharedStrings", SHAREDSTRING_FILE_NAME);
  51841. relsXML += this._createXMLRelationships(xmlRelationships);
  51842. folder.folder("_" + RELATIONSHIP_PART_NAME).file(WORKBOOK_FILE_NAME + ".rels", relsXML);
  51843. folder.file(WORKBOOK_FILE_NAME, this._getWorkbookContent());
  51844. this._zip.file(CONTENTTYPES_FILE_NAME, this._getContentTypesContent())
  51845. },
  51846. _generateContent: function() {
  51847. this._prepareStyleData();
  51848. this._prepareCellData();
  51849. this._generateWorkXML();
  51850. this._generateCommonXML()
  51851. },
  51852. _generateWorkXML: function() {
  51853. this._generateStylesXML();
  51854. this._generateStringsXML();
  51855. this._generateWorksheetXML()
  51856. },
  51857. ctor: function(dataProvider, options) {
  51858. this._rtlEnabled = options && !!options.rtlEnabled;
  51859. this._options = options;
  51860. this._maxRowIndex = 0;
  51861. this._maxColumnIndex = 0;
  51862. this._stringArray = [];
  51863. this._stringHash = {};
  51864. this._styleArray = [];
  51865. this._colsArray = [];
  51866. this._cellsArray = [];
  51867. this._needSheetPr = false;
  51868. this._dataProvider = dataProvider;
  51869. this._excelFile = new _excel2.default;
  51870. if ((0, _type.isDefined)(ExcelCreator.JSZip)) {
  51871. this._zip = new ExcelCreator.JSZip
  51872. } else {
  51873. this._zip = null
  51874. }
  51875. },
  51876. _checkZipState: function() {
  51877. if (!this._zip) {
  51878. throw _ui2.default.Error("E1041", "JSZip")
  51879. }
  51880. },
  51881. ready: function() {
  51882. return this._dataProvider.ready()
  51883. },
  51884. getData: function(isBlob) {
  51885. var options = {
  51886. type: isBlob ? "blob" : "base64",
  51887. compression: "DEFLATE",
  51888. mimeType: _file_saver2.default.MIME_TYPES.EXCEL
  51889. };
  51890. this._checkZipState();
  51891. this._generateContent();
  51892. return this._zip.generateAsync ? this._zip.generateAsync(options) : this._zip.generate(options)
  51893. }
  51894. });
  51895. ExcelCreator.JSZip = _jszip2.default;
  51896. exports.ExcelCreator = ExcelCreator;
  51897. exports.getData = function(data, options, callback) {
  51898. var excelCreator = new exports.ExcelCreator(data, options);
  51899. excelCreator._checkZipState();
  51900. excelCreator.ready().done(function() {
  51901. if (excelCreator._zip.generateAsync) {
  51902. excelCreator.getData((0, _type.isFunction)((0, _window.getWindow)().Blob)).then(callback)
  51903. } else {
  51904. callback(excelCreator.getData((0, _type.isFunction)((0, _window.getWindow)().Blob)))
  51905. }
  51906. })
  51907. };
  51908. exports.__internals = {
  51909. CONTENTTYPES_FILE_NAME: CONTENTTYPES_FILE_NAME,
  51910. RELATIONSHIP_PART_NAME: RELATIONSHIP_PART_NAME,
  51911. XL_FOLDER_NAME: XL_FOLDER_NAME,
  51912. WORKBOOK_FILE_NAME: WORKBOOK_FILE_NAME,
  51913. STYLE_FILE_NAME: STYLE_FILE_NAME,
  51914. WORKSHEET_FILE_NAME: WORKSHEET_FILE_NAME,
  51915. WORKSHEETS_FOLDER: WORKSHEETS_FOLDER,
  51916. WORKSHEET_HEADER_XML: WORKSHEET_HEADER_XML,
  51917. SHAREDSTRING_FILE_NAME: SHAREDSTRING_FILE_NAME,
  51918. GROUP_SHEET_PR_XML: GROUP_SHEET_PR_XML,
  51919. SINGLE_SHEET_PR_XML: SINGLE_SHEET_PR_XML,
  51920. BASE_STYLE_XML2: BASE_STYLE_XML2,
  51921. XML_TAG: XML_TAG
  51922. }
  51923. },
  51924. /*!*******************************!*\
  51925. !*** external "window.JSZip" ***!
  51926. \*******************************/
  51927. /*! dynamic exports provided */
  51928. /*! all exports used */
  51929. function(module, exports) {
  51930. module.exports = window.JSZip
  51931. },
  51932. /*!***********************************************************!*\
  51933. !*** ./artifacts/transpiled/exporter/excel/excel.file.js ***!
  51934. \***********************************************************/
  51935. /*! dynamic exports provided */
  51936. /*! all exports used */
  51937. function(module, exports, __webpack_require__) {
  51938. Object.defineProperty(exports, "__esModule", {
  51939. value: true
  51940. });
  51941. exports.default = void 0;
  51942. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  51943. var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
  51944. var _excel2 = _interopRequireDefault(_excel);
  51945. var _excel3 = __webpack_require__( /*! ./excel.cell_format_helper */ 434);
  51946. var _excel4 = _interopRequireDefault(_excel3);
  51947. var _excel5 = __webpack_require__( /*! ./excel.fill_helper */ 259);
  51948. var _excel6 = _interopRequireDefault(_excel5);
  51949. var _excel7 = __webpack_require__( /*! ./excel.font_helper */ 261);
  51950. var _excel8 = _interopRequireDefault(_excel7);
  51951. var _excel9 = __webpack_require__( /*! ./excel.number_format_helper */ 437);
  51952. var _excel10 = _interopRequireDefault(_excel9);
  51953. function _interopRequireDefault(obj) {
  51954. return obj && obj.__esModule ? obj : {
  51955. "default": obj
  51956. }
  51957. }
  51958. function _classCallCheck(instance, Constructor) {
  51959. if (!(instance instanceof Constructor)) {
  51960. throw new TypeError("Cannot call a class as a function")
  51961. }
  51962. }
  51963. function _defineProperties(target, props) {
  51964. for (var i = 0; i < props.length; i++) {
  51965. var descriptor = props[i];
  51966. descriptor.enumerable = descriptor.enumerable || false;
  51967. descriptor.configurable = true;
  51968. if ("value" in descriptor) {
  51969. descriptor.writable = true
  51970. }
  51971. Object.defineProperty(target, descriptor.key, descriptor)
  51972. }
  51973. }
  51974. function _createClass(Constructor, protoProps, staticProps) {
  51975. if (protoProps) {
  51976. _defineProperties(Constructor.prototype, protoProps)
  51977. }
  51978. if (staticProps) {
  51979. _defineProperties(Constructor, staticProps)
  51980. }
  51981. Object.defineProperty(Constructor, "prototype", {
  51982. writable: false
  51983. });
  51984. return Constructor
  51985. }
  51986. var ExcelFile = function() {
  51987. function ExcelFile() {
  51988. _classCallCheck(this, ExcelFile);
  51989. this._cellFormatTags = [];
  51990. this._fillTags = [];
  51991. this._fontTags = [];
  51992. this._numberFormatTags = [];
  51993. this._fillTags.push(_excel6.default.tryCreateTag({
  51994. patternFill: {
  51995. patternType: "none"
  51996. }
  51997. }))
  51998. }
  51999. _createClass(ExcelFile, [{
  52000. key: "registerCellFormat",
  52001. value: function(cellFormat) {
  52002. var result;
  52003. var cellFormatTag = _excel4.default.tryCreateTag(cellFormat, {
  52004. registerFill: this.registerFill.bind(this),
  52005. registerFont: this.registerFont.bind(this),
  52006. registerNumberFormat: this.registerNumberFormat.bind(this)
  52007. });
  52008. if ((0, _type.isDefined)(cellFormatTag)) {
  52009. for (var i = 0; i < this._cellFormatTags.length; i++) {
  52010. if (_excel4.default.areEqual(this._cellFormatTags[i], cellFormatTag)) {
  52011. result = i;
  52012. break
  52013. }
  52014. }
  52015. if (void 0 === result) {
  52016. result = this._cellFormatTags.push(cellFormatTag) - 1
  52017. }
  52018. }
  52019. return result
  52020. }
  52021. }, {
  52022. key: "generateCellFormatsXml",
  52023. value: function() {
  52024. var cellFormatTagsAsXmlStringsArray = this._cellFormatTags.map(function(tag) {
  52025. return _excel4.default.toXml(tag)
  52026. });
  52027. return _excel2.default.toXml("cellXfs", {
  52028. count: cellFormatTagsAsXmlStringsArray.length
  52029. }, cellFormatTagsAsXmlStringsArray.join(""))
  52030. }
  52031. }, {
  52032. key: "registerFill",
  52033. value: function(fill) {
  52034. var result;
  52035. var fillTag = _excel6.default.tryCreateTag(fill);
  52036. if ((0, _type.isDefined)(fillTag)) {
  52037. for (var i = 0; i < this._fillTags.length; i++) {
  52038. if (_excel6.default.areEqual(this._fillTags[i], fillTag)) {
  52039. result = i;
  52040. break
  52041. }
  52042. }
  52043. if (void 0 === result) {
  52044. if (this._fillTags.length < 2) {
  52045. this._fillTags.push(_excel6.default.tryCreateTag({
  52046. patternFill: {
  52047. patternType: "Gray125"
  52048. }
  52049. }))
  52050. }
  52051. result = this._fillTags.push(fillTag) - 1
  52052. }
  52053. }
  52054. return result
  52055. }
  52056. }, {
  52057. key: "generateFillsXml",
  52058. value: function() {
  52059. var tagsAsXmlStringsArray = this._fillTags.map(function(tag) {
  52060. return _excel6.default.toXml(tag)
  52061. });
  52062. return _excel2.default.toXml("fills", {
  52063. count: tagsAsXmlStringsArray.length
  52064. }, tagsAsXmlStringsArray.join(""))
  52065. }
  52066. }, {
  52067. key: "registerFont",
  52068. value: function(font) {
  52069. var result;
  52070. var fontTag = _excel8.default.tryCreateTag(font);
  52071. if ((0, _type.isDefined)(fontTag)) {
  52072. for (var i = 0; i < this._fontTags.length; i++) {
  52073. if (_excel8.default.areEqual(this._fontTags[i], fontTag)) {
  52074. result = i;
  52075. break
  52076. }
  52077. }
  52078. if (void 0 === result) {
  52079. result = this._fontTags.push(fontTag) - 1
  52080. }
  52081. }
  52082. return result
  52083. }
  52084. }, {
  52085. key: "generateFontsXml",
  52086. value: function() {
  52087. var xmlStringsArray = this._fontTags.map(function(tag) {
  52088. return _excel8.default.toXml(tag)
  52089. });
  52090. return _excel2.default.toXml("fonts", {
  52091. count: xmlStringsArray.length
  52092. }, xmlStringsArray.join(""))
  52093. }
  52094. }, {
  52095. key: "_convertNumberFormatIndexToId",
  52096. value: function(index) {
  52097. var CUSTOM_FORMAT_ID_START_VALUE = 165;
  52098. return CUSTOM_FORMAT_ID_START_VALUE + index
  52099. }
  52100. }, {
  52101. key: "registerNumberFormat",
  52102. value: function(numberFormat) {
  52103. var result;
  52104. var tag = _excel10.default.tryCreateTag(numberFormat);
  52105. if ((0, _type.isDefined)(tag)) {
  52106. for (var i = 0; i < this._numberFormatTags.length; i++) {
  52107. if (_excel10.default.areEqual(this._numberFormatTags[i], tag)) {
  52108. result = this._numberFormatTags[i][_excel10.default.ID_PROPERTY_NAME];
  52109. break
  52110. }
  52111. }
  52112. if (void 0 === result) {
  52113. tag[_excel10.default.ID_PROPERTY_NAME] = this._convertNumberFormatIndexToId(this._numberFormatTags.length);
  52114. result = tag[_excel10.default.ID_PROPERTY_NAME];
  52115. this._numberFormatTags.push(tag)
  52116. }
  52117. }
  52118. return result
  52119. }
  52120. }, {
  52121. key: "generateNumberFormatsXml",
  52122. value: function() {
  52123. if (this._numberFormatTags.length > 0) {
  52124. var xmlStringsArray = this._numberFormatTags.map(function(tag) {
  52125. return _excel10.default.toXml(tag)
  52126. });
  52127. return _excel2.default.toXml("numFmts", {
  52128. count: xmlStringsArray.length
  52129. }, xmlStringsArray.join(""))
  52130. } else {
  52131. return ""
  52132. }
  52133. }
  52134. }], [{
  52135. key: "copyCellFormat",
  52136. value: function(source) {
  52137. return _excel4.default.copy(source)
  52138. }
  52139. }]);
  52140. return ExcelFile
  52141. }();
  52142. exports.default = ExcelFile;
  52143. module.exports = ExcelFile
  52144. },
  52145. /*!*************************************************************************!*\
  52146. !*** ./artifacts/transpiled/exporter/excel/excel.cell_format_helper.js ***!
  52147. \*************************************************************************/
  52148. /*! dynamic exports provided */
  52149. /*! all exports used */
  52150. function(module, exports, __webpack_require__) {
  52151. Object.defineProperty(exports, "__esModule", {
  52152. value: true
  52153. });
  52154. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  52155. var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
  52156. var _excel2 = _interopRequireDefault(_excel);
  52157. var _excel3 = __webpack_require__( /*! ./excel.cell_alignment_helper */ 435);
  52158. var _excel4 = _interopRequireDefault(_excel3);
  52159. var _excel5 = __webpack_require__( /*! ./excel.fill_helper */ 259);
  52160. var _excel6 = _interopRequireDefault(_excel5);
  52161. var _excel7 = __webpack_require__( /*! ./excel.font_helper */ 261);
  52162. var _excel8 = _interopRequireDefault(_excel7);
  52163. function _interopRequireDefault(obj) {
  52164. return obj && obj.__esModule ? obj : {
  52165. "default": obj
  52166. }
  52167. }
  52168. var cellFormatHelper = {
  52169. tryCreateTag: function(sourceObj, sharedItemsContainer) {
  52170. var result = null;
  52171. if ((0, _type.isDefined)(sourceObj)) {
  52172. var numberFormatId;
  52173. if ("number" === typeof sourceObj.numberFormat) {
  52174. numberFormatId = sourceObj.numberFormat
  52175. } else {
  52176. numberFormatId = sharedItemsContainer.registerNumberFormat(sourceObj.numberFormat)
  52177. }
  52178. var fill = sourceObj.fill;
  52179. if (!(0, _type.isDefined)(fill)) {
  52180. fill = _excel6.default.tryCreateFillFromSimpleFormat(sourceObj)
  52181. }
  52182. result = {
  52183. numberFormatId: numberFormatId,
  52184. alignment: _excel4.default.tryCreateTag(sourceObj.alignment),
  52185. fontId: sharedItemsContainer.registerFont(sourceObj.font),
  52186. fillId: sharedItemsContainer.registerFill(fill)
  52187. };
  52188. if (cellFormatHelper.isEmpty(result)) {
  52189. result = null
  52190. }
  52191. }
  52192. return result
  52193. },
  52194. copy: function(source) {
  52195. var result;
  52196. if (null === source) {
  52197. result = null
  52198. } else {
  52199. if ((0, _type.isDefined)(source)) {
  52200. result = {};
  52201. if (void 0 !== source.numberFormat) {
  52202. result.numberFormat = source.numberFormat
  52203. }
  52204. if (void 0 !== source.fill) {
  52205. result.fill = _excel6.default.copy(source.fill)
  52206. } else {
  52207. _excel6.default.copySimpleFormat(source, result)
  52208. }
  52209. if (void 0 !== source.alignment) {
  52210. result.alignment = _excel4.default.copy(source.alignment)
  52211. }
  52212. if (void 0 !== source.font) {
  52213. result.font = _excel8.default.copy(source.font)
  52214. }
  52215. }
  52216. }
  52217. return result
  52218. },
  52219. areEqual: function(leftTag, rightTag) {
  52220. return cellFormatHelper.isEmpty(leftTag) && cellFormatHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.fontId === rightTag.fontId && leftTag.numberFormatId === rightTag.numberFormatId && leftTag.fillId === rightTag.fillId && _excel4.default.areEqual(leftTag.alignment, rightTag.alignment)
  52221. },
  52222. isEmpty: function(tag) {
  52223. return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.fontId) && !(0, _type.isDefined)(tag.numberFormatId) && !(0, _type.isDefined)(tag.fillId) && _excel4.default.isEmpty(tag.alignment)
  52224. },
  52225. toXml: function(tag) {
  52226. var isAlignmentEmpty = _excel4.default.isEmpty(tag.alignment);
  52227. var applyNumberFormat;
  52228. if ((0, _type.isDefined)(tag.numberFormatId)) {
  52229. applyNumberFormat = tag.numberFormatId > 0 ? 1 : 0
  52230. }
  52231. return _excel2.default.toXml("xf", {
  52232. xfId: 0,
  52233. applyAlignment: isAlignmentEmpty ? null : 1,
  52234. fontId: tag.fontId,
  52235. applyNumberFormat: applyNumberFormat,
  52236. fillId: tag.fillId,
  52237. numFmtId: tag.numberFormatId
  52238. }, isAlignmentEmpty ? null : _excel4.default.toXml(tag.alignment))
  52239. }
  52240. };
  52241. exports.default = cellFormatHelper
  52242. },
  52243. /*!****************************************************************************!*\
  52244. !*** ./artifacts/transpiled/exporter/excel/excel.cell_alignment_helper.js ***!
  52245. \****************************************************************************/
  52246. /*! dynamic exports provided */
  52247. /*! all exports used */
  52248. function(module, exports, __webpack_require__) {
  52249. Object.defineProperty(exports, "__esModule", {
  52250. value: true
  52251. });
  52252. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  52253. var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
  52254. var _excel2 = _interopRequireDefault(_excel);
  52255. function _interopRequireDefault(obj) {
  52256. return obj && obj.__esModule ? obj : {
  52257. "default": obj
  52258. }
  52259. }
  52260. var cellAlignmentHelper = {
  52261. tryCreateTag: function(sourceObj) {
  52262. var result = null;
  52263. if ((0, _type.isDefined)(sourceObj)) {
  52264. result = {
  52265. vertical: sourceObj.vertical,
  52266. wrapText: sourceObj.wrapText,
  52267. horizontal: sourceObj.horizontal
  52268. };
  52269. if (cellAlignmentHelper.isEmpty(result)) {
  52270. result = null
  52271. }
  52272. }
  52273. return result
  52274. },
  52275. copy: function(source) {
  52276. var result = null;
  52277. if ((0, _type.isDefined)(source)) {
  52278. result = {};
  52279. if (void 0 !== source.horizontal) {
  52280. result.horizontal = source.horizontal
  52281. }
  52282. if (void 0 !== source.vertical) {
  52283. result.vertical = source.vertical
  52284. }
  52285. if (void 0 !== source.wrapText) {
  52286. result.wrapText = source.wrapText
  52287. }
  52288. }
  52289. return result
  52290. },
  52291. areEqual: function(leftTag, rightTag) {
  52292. return cellAlignmentHelper.isEmpty(leftTag) && cellAlignmentHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.vertical === rightTag.vertical && leftTag.wrapText === rightTag.wrapText && leftTag.horizontal === rightTag.horizontal
  52293. },
  52294. isEmpty: function(tag) {
  52295. return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.vertical) && !(0, _type.isDefined)(tag.wrapText) && !(0, _type.isDefined)(tag.horizontal)
  52296. },
  52297. toXml: function(tag) {
  52298. return _excel2.default.toXml("alignment", {
  52299. vertical: tag.vertical,
  52300. wrapText: (0, _type.isDefined)(tag.wrapText) ? Number(tag.wrapText) : void 0,
  52301. horizontal: tag.horizontal
  52302. })
  52303. }
  52304. };
  52305. exports.default = cellAlignmentHelper
  52306. },
  52307. /*!**************************************************************************!*\
  52308. !*** ./artifacts/transpiled/exporter/excel/excel.pattern_fill_helper.js ***!
  52309. \**************************************************************************/
  52310. /*! dynamic exports provided */
  52311. /*! all exports used */
  52312. function(module, exports, __webpack_require__) {
  52313. Object.defineProperty(exports, "__esModule", {
  52314. value: true
  52315. });
  52316. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  52317. var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
  52318. var _excel2 = _interopRequireDefault(_excel);
  52319. var _excel3 = __webpack_require__( /*! ./excel.color_helper */ 260);
  52320. var _excel4 = _interopRequireDefault(_excel3);
  52321. function _interopRequireDefault(obj) {
  52322. return obj && obj.__esModule ? obj : {
  52323. "default": obj
  52324. }
  52325. }
  52326. var patternFillHelper = {
  52327. tryCreateTag: function(sourceObj) {
  52328. var result = null;
  52329. if ((0, _type.isDefined)(sourceObj)) {
  52330. result = {
  52331. patternType: sourceObj.patternType,
  52332. backgroundColor: _excel4.default.tryCreateTag(sourceObj.backgroundColor),
  52333. foregroundColor: _excel4.default.tryCreateTag(sourceObj.foregroundColor)
  52334. };
  52335. if (patternFillHelper.isEmpty(result)) {
  52336. result = null
  52337. }
  52338. }
  52339. return result
  52340. },
  52341. copy: function(source) {
  52342. var result = null;
  52343. if ((0, _type.isDefined)(source)) {
  52344. result = {};
  52345. if (void 0 !== source.patternType) {
  52346. result.patternType = source.patternType
  52347. }
  52348. if (void 0 !== source.backgroundColor) {
  52349. result.backgroundColor = _excel4.default.copy(source.backgroundColor)
  52350. }
  52351. if (void 0 !== source.foregroundColor) {
  52352. result.foregroundColor = _excel4.default.copy(source.foregroundColor)
  52353. }
  52354. }
  52355. return result
  52356. },
  52357. areEqual: function(leftTag, rightTag) {
  52358. return patternFillHelper.isEmpty(leftTag) && patternFillHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.patternType === rightTag.patternType && _excel4.default.areEqual(leftTag.backgroundColor, rightTag.backgroundColor) && _excel4.default.areEqual(leftTag.foregroundColor, rightTag.foregroundColor)
  52359. },
  52360. isEmpty: function(tag) {
  52361. return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.patternType)
  52362. },
  52363. toXml: function(tag) {
  52364. var content = [(0, _type.isDefined)(tag.foregroundColor) ? _excel4.default.toXml("fgColor", tag.foregroundColor) : "", (0, _type.isDefined)(tag.backgroundColor) ? _excel4.default.toXml("bgColor", tag.backgroundColor) : ""].join("");
  52365. return _excel2.default.toXml("patternFill", {
  52366. patternType: tag.patternType
  52367. }, content)
  52368. }
  52369. };
  52370. exports.default = patternFillHelper
  52371. },
  52372. /*!***************************************************************************!*\
  52373. !*** ./artifacts/transpiled/exporter/excel/excel.number_format_helper.js ***!
  52374. \***************************************************************************/
  52375. /*! dynamic exports provided */
  52376. /*! all exports used */
  52377. function(module, exports, __webpack_require__) {
  52378. Object.defineProperty(exports, "__esModule", {
  52379. value: true
  52380. });
  52381. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  52382. var _excel = __webpack_require__( /*! ./excel.tag_helper */ 79);
  52383. var _excel2 = _interopRequireDefault(_excel);
  52384. function _interopRequireDefault(obj) {
  52385. return obj && obj.__esModule ? obj : {
  52386. "default": obj
  52387. }
  52388. }
  52389. var numberFormatHelper = {
  52390. ID_PROPERTY_NAME: "id",
  52391. tryCreateTag: function(sourceObj) {
  52392. var result = null;
  52393. if ("string" === typeof sourceObj) {
  52394. result = {
  52395. formatCode: sourceObj
  52396. };
  52397. if (numberFormatHelper.isEmpty(result)) {
  52398. result = null
  52399. }
  52400. }
  52401. return result
  52402. },
  52403. areEqual: function(leftTag, rightTag) {
  52404. return numberFormatHelper.isEmpty(leftTag) && numberFormatHelper.isEmpty(rightTag) || (0, _type.isDefined)(leftTag) && (0, _type.isDefined)(rightTag) && leftTag.formatCode === rightTag.formatCode
  52405. },
  52406. isEmpty: function(tag) {
  52407. return !(0, _type.isDefined)(tag) || !(0, _type.isDefined)(tag.formatCode) || "" === tag.formatCode
  52408. },
  52409. toXml: function(tag) {
  52410. return _excel2.default.toXml("numFmt", {
  52411. numFmtId: tag[numberFormatHelper.ID_PROPERTY_NAME],
  52412. formatCode: tag.formatCode
  52413. })
  52414. }
  52415. };
  52416. exports.default = numberFormatHelper
  52417. },
  52418. /*!******************************************************!*\
  52419. !*** ./artifacts/transpiled/exporter/svg_creator.js ***!
  52420. \******************************************************/
  52421. /*! dynamic exports provided */
  52422. /*! all exports used */
  52423. function(module, exports, __webpack_require__) {
  52424. var $ = __webpack_require__( /*! ../core/renderer */ 2);
  52425. var ajax = __webpack_require__( /*! ../core/utils/ajax */ 58);
  52426. var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow();
  52427. var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction;
  52428. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  52429. var svgUtils = __webpack_require__( /*! ../core/utils/svg */ 209);
  52430. var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
  52431. var when = deferredUtils.when;
  52432. var Deferred = deferredUtils.Deferred;
  52433. exports.svgCreator = {
  52434. _markup: "",
  52435. _imageArray: {},
  52436. _imageDeferreds: [],
  52437. _getBinaryFile: function(src, callback) {
  52438. ajax.sendRequest({
  52439. url: src,
  52440. method: "GET",
  52441. responseType: "arraybuffer"
  52442. }).done(callback).fail(function() {
  52443. callback(false)
  52444. })
  52445. },
  52446. _loadImages: function() {
  52447. var that = this;
  52448. each(that._imageArray, function(src) {
  52449. var deferred = new Deferred;
  52450. that._imageDeferreds.push(deferred);
  52451. that._getBinaryFile(src, function(response) {
  52452. if (!response) {
  52453. delete that._imageArray[src];
  52454. deferred.resolve();
  52455. return
  52456. }
  52457. var i;
  52458. var binary = "";
  52459. var bytes = new Uint8Array(response);
  52460. var length = bytes.byteLength;
  52461. for (i = 0; i < length; i++) {
  52462. binary += String.fromCharCode(bytes[i])
  52463. }
  52464. that._imageArray[src] = "data:image/png;base64," + window.btoa(binary);
  52465. deferred.resolve()
  52466. })
  52467. })
  52468. },
  52469. _parseImages: function(element) {
  52470. var href;
  52471. var that = this;
  52472. if ("image" === element.tagName) {
  52473. href = $(element).attr("href") || $(element).attr("xlink:href");
  52474. if (!that._imageArray[href]) {
  52475. that._imageArray[href] = ""
  52476. }
  52477. }
  52478. each(element.childNodes, function(_, element) {
  52479. that._parseImages(element)
  52480. })
  52481. },
  52482. _prepareImages: function(svgElem) {
  52483. this._parseImages(svgElem);
  52484. this._loadImages();
  52485. return when.apply($, this._imageDeferreds)
  52486. },
  52487. getData: function(data, options) {
  52488. var markup;
  52489. var that = this;
  52490. var xmlVersion = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
  52491. var blob = new Deferred;
  52492. var svgElem = svgUtils.getSvgElement(data);
  52493. var $svgObject = $(svgElem);
  52494. markup = xmlVersion + svgUtils.getSvgMarkup($svgObject.get(0), options.backgroundColor);
  52495. that._prepareImages(svgElem).done(function() {
  52496. each(that._imageArray, function(href, dataURI) {
  52497. var regexpString = "href=['|\"]".concat(href, "['|\"]");
  52498. markup = markup.replace(new RegExp(regexpString, "gi"), 'href="'.concat(dataURI, '"'))
  52499. });
  52500. blob.resolve(isFunction(window.Blob) ? that._getBlob(markup) : that._getBase64(markup))
  52501. });
  52502. return blob
  52503. },
  52504. _getBlob: function(markup) {
  52505. return new window.Blob([markup], {
  52506. type: "image/svg+xml"
  52507. })
  52508. },
  52509. _getBase64: function(markup) {
  52510. return window.btoa(markup)
  52511. }
  52512. };
  52513. exports.getData = function(data, options, callback) {
  52514. return exports.svgCreator.getData(data, options).done(callback)
  52515. }
  52516. },
  52517. /*!***************************************************!*\
  52518. !*** ./artifacts/transpiled/core/http_request.js ***!
  52519. \***************************************************/
  52520. /*! dynamic exports provided */
  52521. /*! all exports used */
  52522. function(module, exports, __webpack_require__) {
  52523. var windowUtils = __webpack_require__( /*! ./utils/window */ 7);
  52524. var window = windowUtils.getWindow();
  52525. var injector = __webpack_require__( /*! ./utils/dependency_injector */ 54);
  52526. var nativeXMLHttpRequest = {
  52527. getXhr: function() {
  52528. return new window.XMLHttpRequest
  52529. }
  52530. };
  52531. module.exports = injector(nativeXMLHttpRequest)
  52532. },
  52533. /*!******************************************************!*\
  52534. !*** ./artifacts/transpiled/exporter/pdf_creator.js ***!
  52535. \******************************************************/
  52536. /*! dynamic exports provided */
  52537. /*! all exports used */
  52538. function(module, exports, __webpack_require__) {
  52539. var VERSION = __webpack_require__( /*! ../core/version */ 157);
  52540. var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow();
  52541. var imageCreator = __webpack_require__( /*! ./image_creator */ 262).imageCreator;
  52542. var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction;
  52543. var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
  52544. var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
  52545. var when = deferredUtils.when;
  52546. var Deferred = deferredUtils.Deferred;
  52547. var mainPageTemplate = "%PDF-1.3\r\n2 0 obj\r\n<</ProcSet[/PDF/ImageB/ImageC/ImageI]/XObject<</I0 5 0 R>>>>\r\nendobj\r\n4 0 obj\r\n<</Type/Pages/Kids[1 0 R]/Count 1>>\r\nendobj\r\n7 0 obj\r\n<</OpenAction[1 0 R /FitH null]/Type/Catalog/Pages 4 0 R/PageLayout/OneColumn>>\r\nendobj\r\n1 0 obj\r\n<</Type/Page/Resources 2 0 R/MediaBox[0 0 _width_ _height_]/Contents 3 0 R/Parent 4 0 R>>\r\nendobj\r\n";
  52548. var contentTemplate = "3 0 obj\r\n<</Length 52>>stream\r\n0.20 w\n0 G\nq _width_ 0 0 _height_ 0.00 0.00 cm /I0 Do Q\r\nendstream\r\nendobj\r\n";
  52549. var infoTemplate = "6 0 obj\r\n<</CreationDate _date_/Producer(DevExtreme _version_)>>\r\nendobj\r\n";
  52550. var imageStartTemplate = "5 0 obj\r\n<</Type/XObject/Subtype/Image/Width _width_/Height _height_/ColorSpace/DeviceRGB/BitsPerComponent 8/Filter/DCTDecode/Length _length_>>stream\r\n";
  52551. var imageEndTemplate = "\r\nendstream\r\nendobj\r\n";
  52552. var trailerTemplate = "trailer\r\n<<\r\n/Size 8\r\n/Root 7 0 R\r\n/Info 6 0 R\r\n>>\r\nstartxref\r\n_length_\r\n%%EOF";
  52553. var xrefTemplate = "xref\r\n0 8\r\n0000000000 65535 f\r\n0000000241 00000 n\r\n0000000010 00000 n\r\n_main_ 00000 n\r\n0000000089 00000 n\r\n_image_ 00000 n\r\n_info_ 00000 n\r\n0000000143 00000 n\r\n";
  52554. var pad = function pad(str, len) {
  52555. return str.length < len ? pad("0" + str, len) : str
  52556. };
  52557. var composePdfString = function(imageString, options, curDate) {
  52558. var margin = 2 * (options.margin || 0);
  52559. var width = options.width + margin;
  52560. var height = options.height + margin;
  52561. var widthPt = (.75 * width).toFixed(2);
  52562. var heightPt = (.75 * height).toFixed(2);
  52563. var mainPage = mainPageTemplate.replace("_width_", widthPt).replace("_height_", heightPt);
  52564. var content = contentTemplate.replace("_width_", widthPt).replace("_height_", heightPt);
  52565. var info = infoTemplate.replace("_date_", curDate).replace("_version_", VERSION);
  52566. var image = imageStartTemplate.replace("_width_", width).replace("_height_", height).replace("_length_", imageString.length) + imageString + imageEndTemplate;
  52567. var xref = getXref(mainPage.length, content.length, info.length);
  52568. var mainContent = mainPage + content + info + image;
  52569. var trailer = trailerTemplate.replace("_length_", mainContent.length);
  52570. return mainContent + xref + trailer
  52571. };
  52572. var getXref = function(mainPageLength, contentLength, infoLength) {
  52573. return xrefTemplate.replace("_main_", pad(mainPageLength + "", 10)).replace("_info_", pad(mainPageLength + contentLength + "", 10)).replace("_image_", pad(mainPageLength + contentLength + infoLength + "", 10))
  52574. };
  52575. var getCurDate = function() {
  52576. return new Date
  52577. };
  52578. var getBlob = function(binaryData) {
  52579. var i = 0;
  52580. var dataArray = new Uint8Array(binaryData.length);
  52581. for (; i < binaryData.length; i++) {
  52582. dataArray[i] = binaryData.charCodeAt(i)
  52583. }
  52584. return new window.Blob([dataArray.buffer], {
  52585. type: "application/pdf"
  52586. })
  52587. };
  52588. var getBase64 = function(binaryData) {
  52589. return window.btoa(binaryData)
  52590. };
  52591. exports.getData = function(data, options, callback) {
  52592. var imageData = imageCreator.getImageData(data, extend({}, options, {
  52593. format: "JPEG"
  52594. }));
  52595. var blob = new Deferred;
  52596. blob.done(callback);
  52597. return when(imageData).done(function(imageString) {
  52598. var binaryData = composePdfString(imageString, options, getCurDate());
  52599. var pdfData = isFunction(window.Blob) ? getBlob(binaryData) : getBase64(binaryData);
  52600. blob.resolve(pdfData)
  52601. })
  52602. };
  52603. exports.__tests = {
  52604. set_composePdfString: function(func) {
  52605. exports.__tests.composePdfString = composePdfString;
  52606. composePdfString = func
  52607. },
  52608. restore_composePdfString: function(func) {
  52609. if (exports.__tests.composePdfString) {
  52610. composePdfString = exports.__tests.composePdfString;
  52611. exports.__tests.composePdfString = null
  52612. }
  52613. },
  52614. set_getCurDate: function(func) {
  52615. exports.__tests.getCurDate = getCurDate;
  52616. getCurDate = func
  52617. },
  52618. restore_getCurDate: function(func) {
  52619. if (exports.__tests.getCurDate) {
  52620. getCurDate = exports.__tests.getCurDate;
  52621. exports.__tests.getCurDate = null
  52622. }
  52623. },
  52624. set_getBlob: function(func) {
  52625. exports.__tests.getBlob = getBlob;
  52626. getBlob = func
  52627. },
  52628. restore_getBlob: function(func) {
  52629. if (exports.__tests.getBlob) {
  52630. getBlob = exports.__tests.getBlob;
  52631. exports.__tests.getBlob = null
  52632. }
  52633. },
  52634. set_getBase64: function(func) {
  52635. exports.__tests.getBase64 = getBase64;
  52636. getBase64 = func
  52637. },
  52638. restore_getBase64: function(func) {
  52639. if (exports.__tests.getBase64) {
  52640. getBase64 = exports.__tests.getBase64;
  52641. exports.__tests.getBase64 = null
  52642. }
  52643. }
  52644. }
  52645. },
  52646. /*!****************************************************************!*\
  52647. !*** ./artifacts/transpiled/exporter/exceljs/excelExporter.js ***!
  52648. \****************************************************************/
  52649. /*! dynamic exports provided */
  52650. /*! all exports used */
  52651. function(module, exports, __webpack_require__) {
  52652. Object.defineProperty(exports, "__esModule", {
  52653. value: true
  52654. });
  52655. exports.exportDataGrid = void 0;
  52656. var _exportDataGrid = __webpack_require__( /*! ./exportDataGrid */ 442);
  52657. exports.exportDataGrid = _exportDataGrid.exportDataGrid
  52658. },
  52659. /*!*****************************************************************!*\
  52660. !*** ./artifacts/transpiled/exporter/exceljs/exportDataGrid.js ***!
  52661. \*****************************************************************/
  52662. /*! dynamic exports provided */
  52663. /*! all exports used */
  52664. function(module, exports, __webpack_require__) {
  52665. Object.defineProperty(exports, "__esModule", {
  52666. value: true
  52667. });
  52668. exports.MAX_EXCEL_COLUMN_WIDTH = exports.exportDataGrid = void 0;
  52669. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  52670. var _excel_format_converter = __webpack_require__( /*! ../excel_format_converter */ 178);
  52671. var _excel_format_converter2 = _interopRequireDefault(_excel_format_converter);
  52672. var _message = __webpack_require__( /*! ../../localization/message */ 13);
  52673. var _message2 = _interopRequireDefault(_message);
  52674. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  52675. function _interopRequireDefault(obj) {
  52676. return obj && obj.__esModule ? obj : {
  52677. "default": obj
  52678. }
  52679. }
  52680. var MAX_DIGIT_WIDTH_IN_PIXELS = 7;
  52681. var MAX_EXCEL_COLUMN_WIDTH = 255;
  52682. function exportDataGrid(options) {
  52683. if (!(0, _type.isDefined)(options)) {
  52684. return
  52685. }
  52686. var customizeCell = options.customizeCell,
  52687. component = options.component,
  52688. worksheet = options.worksheet,
  52689. _options$topLeftCell = options.topLeftCell,
  52690. topLeftCell = void 0 === _options$topLeftCell ? {
  52691. row: 1,
  52692. column: 1
  52693. } : _options$topLeftCell,
  52694. autoFilterEnabled = options.autoFilterEnabled,
  52695. _options$keepColumnWi = options.keepColumnWidths,
  52696. keepColumnWidths = void 0 === _options$keepColumnWi ? true : _options$keepColumnWi,
  52697. _options$selectedRows = options.selectedRowsOnly,
  52698. selectedRowsOnly = void 0 === _options$selectedRows ? false : _options$selectedRows,
  52699. _options$loadPanel = options.loadPanel,
  52700. loadPanel = void 0 === _options$loadPanel ? {
  52701. enabled: true,
  52702. text: _message2.default.format("dxDataGrid-exporting")
  52703. } : _options$loadPanel;
  52704. var initialLoadPanelOptions = (0, _extend.extend)({}, component.option("loadPanel"));
  52705. if ("animation" in component.option("loadPanel")) {
  52706. loadPanel.animation = null
  52707. }
  52708. component.option("loadPanel", loadPanel);
  52709. worksheet.properties.outlineProperties = {
  52710. summaryBelow: false,
  52711. summaryRight: false
  52712. };
  52713. var cellsRange = {
  52714. from: {
  52715. row: topLeftCell.row,
  52716. column: topLeftCell.column
  52717. },
  52718. to: {
  52719. row: topLeftCell.row,
  52720. column: topLeftCell.column
  52721. }
  52722. };
  52723. var dataProvider = component.getDataProvider(selectedRowsOnly);
  52724. return new Promise(function(resolve) {
  52725. dataProvider.ready().done(function() {
  52726. var columns = dataProvider.getColumns();
  52727. var headerRowCount = dataProvider.getHeaderRowCount();
  52728. var dataRowsCount = dataProvider.getRowsCount();
  52729. if (keepColumnWidths) {
  52730. _setColumnsWidth(worksheet, columns, cellsRange.from.column)
  52731. }
  52732. var mergedCells = [];
  52733. var mergeRanges = [];
  52734. for (var rowIndex = 0; rowIndex < dataRowsCount; rowIndex++) {
  52735. var row = worksheet.getRow(cellsRange.from.row + rowIndex);
  52736. _exportRow(rowIndex, columns.length, row, cellsRange.from.column, dataProvider, customizeCell, headerRowCount, mergedCells, mergeRanges);
  52737. if (rowIndex >= headerRowCount) {
  52738. row.outlineLevel = dataProvider.getGroupLevel(rowIndex)
  52739. }
  52740. if (rowIndex >= 1) {
  52741. cellsRange.to.row++
  52742. }
  52743. }
  52744. _mergeCells(worksheet, topLeftCell, mergeRanges);
  52745. cellsRange.to.column += columns.length > 0 ? columns.length - 1 : 0;
  52746. var worksheetViewSettings = worksheet.views[0] || {};
  52747. if (component.option("rtlEnabled")) {
  52748. worksheetViewSettings.rightToLeft = true
  52749. }
  52750. if (headerRowCount > 0) {
  52751. if (Object.keys(worksheetViewSettings).indexOf("state") === -1) {
  52752. (0, _extend.extend)(worksheetViewSettings, {
  52753. state: "frozen",
  52754. ySplit: cellsRange.from.row + dataProvider.getFrozenArea().y - 1
  52755. })
  52756. }
  52757. _setAutoFilter(dataProvider, worksheet, component, cellsRange, autoFilterEnabled)
  52758. }
  52759. if (Object.keys(worksheetViewSettings).length > 0) {
  52760. worksheet.views = [worksheetViewSettings]
  52761. }
  52762. resolve(cellsRange)
  52763. }).always(function() {
  52764. component.option("loadPanel", initialLoadPanelOptions)
  52765. })
  52766. })
  52767. }
  52768. function _exportRow(rowIndex, cellCount, row, startColumnIndex, dataProvider, customizeCell, headerRowCount, mergedCells, mergeRanges) {
  52769. var styles = dataProvider.getStyles();
  52770. for (var cellIndex = 0; cellIndex < cellCount; cellIndex++) {
  52771. var cellData = dataProvider.getCellData(rowIndex, cellIndex, true);
  52772. var gridCell = cellData.cellSourceData;
  52773. var excelCell = row.getCell(startColumnIndex + cellIndex);
  52774. excelCell.value = cellData.value;
  52775. if ((0, _type.isDefined)(excelCell.value)) {
  52776. var _styles$dataProvider$ = styles[dataProvider.getStyleId(rowIndex, cellIndex)],
  52777. bold = _styles$dataProvider$.bold,
  52778. alignment = _styles$dataProvider$.alignment,
  52779. wrapText = _styles$dataProvider$.wrapText,
  52780. format = _styles$dataProvider$.format,
  52781. dataType = _styles$dataProvider$.dataType;
  52782. var numberFormat = _tryConvertToExcelNumberFormat(format, dataType);
  52783. if ((0, _type.isDefined)(numberFormat)) {
  52784. numberFormat = numberFormat.replace(/&quot;/g, "")
  52785. } else {
  52786. if ((0, _type.isString)(excelCell.value) && /^[@=+-]/.test(excelCell.value)) {
  52787. numberFormat = "@"
  52788. }
  52789. }
  52790. _setNumberFormat(excelCell, numberFormat);
  52791. _setFont(excelCell, bold);
  52792. _setAlignment(excelCell, wrapText, alignment)
  52793. }
  52794. if ((0, _type.isDefined)(customizeCell)) {
  52795. customizeCell({
  52796. cell: excelCell,
  52797. excelCell: excelCell,
  52798. gridCell: gridCell
  52799. })
  52800. }
  52801. if (rowIndex < headerRowCount) {
  52802. var mergeRange = _tryGetMergeRange(rowIndex, cellIndex, mergedCells, dataProvider);
  52803. if ((0, _type.isDefined)(mergeRange)) {
  52804. mergeRanges.push(mergeRange)
  52805. }
  52806. }
  52807. }
  52808. }
  52809. function _setAutoFilter(dataProvider, worksheet, component, cellsRange, autoFilterEnabled) {
  52810. if (!(0, _type.isDefined)(autoFilterEnabled)) {
  52811. autoFilterEnabled = !!component.option("export.excelFilterEnabled")
  52812. }
  52813. if (autoFilterEnabled) {
  52814. if (!(0, _type.isDefined)(worksheet.autoFilter) && dataProvider.getRowsCount() > 0) {
  52815. worksheet.autoFilter = cellsRange
  52816. }
  52817. }
  52818. }
  52819. function _setNumberFormat(excelCell, numberFormat) {
  52820. excelCell.numFmt = numberFormat
  52821. }
  52822. function _tryConvertToExcelNumberFormat(format, dataType) {
  52823. var newFormat = _formatObjectConverter(format, dataType);
  52824. var currency = newFormat.currency;
  52825. format = newFormat.format;
  52826. dataType = newFormat.dataType;
  52827. return _excel_format_converter2.default.convertFormat(format, newFormat.precision, dataType, currency)
  52828. }
  52829. function _formatObjectConverter(format, dataType) {
  52830. var result = {
  52831. format: format,
  52832. precision: format && format.precision,
  52833. dataType: dataType
  52834. };
  52835. if ((0, _type.isObject)(format)) {
  52836. return (0, _extend.extend)(result, format, {
  52837. format: format.formatter || format.type,
  52838. currency: format.currency
  52839. })
  52840. }
  52841. return result
  52842. }
  52843. function _setFont(excelCell, bold) {
  52844. if ((0, _type.isDefined)(bold)) {
  52845. excelCell.font = excelCell.font || {};
  52846. excelCell.font.bold = bold
  52847. }
  52848. }
  52849. function _setAlignment(excelCell, wrapText, horizontalAlignment) {
  52850. excelCell.alignment = excelCell.alignment || {};
  52851. if ((0, _type.isDefined)(wrapText)) {
  52852. excelCell.alignment.wrapText = wrapText
  52853. }
  52854. if ((0, _type.isDefined)(horizontalAlignment)) {
  52855. excelCell.alignment.horizontal = horizontalAlignment
  52856. }
  52857. }
  52858. function _setColumnsWidth(worksheet, columns, startColumnIndex) {
  52859. if (!(0, _type.isDefined)(columns)) {
  52860. return
  52861. }
  52862. for (var i = 0; i < columns.length; i++) {
  52863. var columnWidth = columns[i].width;
  52864. if ("number" === typeof columnWidth && isFinite(columnWidth)) {
  52865. worksheet.getColumn(startColumnIndex + i).width = Math.min(MAX_EXCEL_COLUMN_WIDTH, Math.floor(columnWidth / MAX_DIGIT_WIDTH_IN_PIXELS * 100) / 100)
  52866. }
  52867. }
  52868. }
  52869. function _tryGetMergeRange(rowIndex, cellIndex, mergedCells, dataProvider) {
  52870. if (!mergedCells[rowIndex] || !mergedCells[rowIndex][cellIndex]) {
  52871. var cellMerge = dataProvider.getCellMerging(rowIndex, cellIndex);
  52872. if (cellMerge.colspan || cellMerge.rowspan) {
  52873. for (var i = rowIndex; i <= rowIndex + cellMerge.rowspan || 0; i++) {
  52874. for (var j = cellIndex; j <= cellIndex + cellMerge.colspan || 0; j++) {
  52875. if (!mergedCells[i]) {
  52876. mergedCells[i] = []
  52877. }
  52878. mergedCells[i][j] = true
  52879. }
  52880. }
  52881. return {
  52882. start: {
  52883. row: rowIndex,
  52884. column: cellIndex
  52885. },
  52886. end: {
  52887. row: rowIndex + (cellMerge.rowspan || 0),
  52888. column: cellIndex + (cellMerge.colspan || 0)
  52889. }
  52890. }
  52891. }
  52892. }
  52893. }
  52894. function _mergeCells(worksheet, topLeftCell, mergeRanges) {
  52895. mergeRanges.forEach(function(mergeRange) {
  52896. worksheet.mergeCells(mergeRange.start.row + topLeftCell.row, mergeRange.start.column + topLeftCell.column, mergeRange.end.row + topLeftCell.row, mergeRange.end.column + topLeftCell.column)
  52897. })
  52898. }
  52899. exports.exportDataGrid = exportDataGrid;
  52900. exports.MAX_EXCEL_COLUMN_WIDTH = MAX_EXCEL_COLUMN_WIDTH
  52901. },
  52902. /*!***************************************************************!*\
  52903. !*** ./artifacts/transpiled/localization/default_messages.js ***!
  52904. \***************************************************************/
  52905. /*! dynamic exports provided */
  52906. /*! all exports used */
  52907. function(module, exports, __webpack_require__) {
  52908. module.exports = {
  52909. en: {
  52910. Yes: "Yes",
  52911. No: "No",
  52912. Cancel: "Cancel",
  52913. Clear: "Clear",
  52914. Done: "Done",
  52915. Loading: "Loading...",
  52916. Select: "Select...",
  52917. Search: "Search",
  52918. Back: "Back",
  52919. OK: "OK",
  52920. "dxCollectionWidget-noDataText": "No data to display",
  52921. "dxDropDownEditor-selectLabel": "Select",
  52922. "validation-required": "Required",
  52923. "validation-required-formatted": "{0} is required",
  52924. "validation-numeric": "Value must be a number",
  52925. "validation-numeric-formatted": "{0} must be a number",
  52926. "validation-range": "Value is out of range",
  52927. "validation-range-formatted": "{0} is out of range",
  52928. "validation-stringLength": "The length of the value is not correct",
  52929. "validation-stringLength-formatted": "The length of {0} is not correct",
  52930. "validation-custom": "Value is invalid",
  52931. "validation-custom-formatted": "{0} is invalid",
  52932. "validation-compare": "Values do not match",
  52933. "validation-compare-formatted": "{0} does not match",
  52934. "validation-pattern": "Value does not match pattern",
  52935. "validation-pattern-formatted": "{0} does not match pattern",
  52936. "validation-email": "Email is invalid",
  52937. "validation-email-formatted": "{0} is invalid",
  52938. "validation-mask": "Value is invalid",
  52939. "dxLookup-searchPlaceholder": "Minimum character number: {0}",
  52940. "dxList-pullingDownText": "Pull down to refresh...",
  52941. "dxList-pulledDownText": "Release to refresh...",
  52942. "dxList-refreshingText": "Refreshing...",
  52943. "dxList-pageLoadingText": "Loading...",
  52944. "dxList-nextButtonText": "More",
  52945. "dxList-selectAll": "Select All",
  52946. "dxListEditDecorator-delete": "Delete",
  52947. "dxListEditDecorator-more": "More",
  52948. "dxScrollView-pullingDownText": "Pull down to refresh...",
  52949. "dxScrollView-pulledDownText": "Release to refresh...",
  52950. "dxScrollView-refreshingText": "Refreshing...",
  52951. "dxScrollView-reachBottomText": "Loading...",
  52952. "dxDateBox-simulatedDataPickerTitleTime": "Select time",
  52953. "dxDateBox-simulatedDataPickerTitleDate": "Select date",
  52954. "dxDateBox-simulatedDataPickerTitleDateTime": "Select date and time",
  52955. "dxDateBox-validation-datetime": "Value must be a date or time",
  52956. "dxFileUploader-selectFile": "Select file",
  52957. "dxFileUploader-dropFile": "or Drop file here",
  52958. "dxFileUploader-bytes": "bytes",
  52959. "dxFileUploader-kb": "kb",
  52960. "dxFileUploader-Mb": "Mb",
  52961. "dxFileUploader-Gb": "Gb",
  52962. "dxFileUploader-upload": "Upload",
  52963. "dxFileUploader-uploaded": "Uploaded",
  52964. "dxFileUploader-readyToUpload": "Ready to upload",
  52965. "dxFileUploader-uploadFailedMessage": "Upload failed",
  52966. "dxFileUploader-invalidFileExtension": "File type is not allowed",
  52967. "dxFileUploader-invalidMaxFileSize": "File is too large",
  52968. "dxFileUploader-invalidMinFileSize": "File is too small",
  52969. "dxRangeSlider-ariaFrom": "From",
  52970. "dxRangeSlider-ariaTill": "Till",
  52971. "dxSwitch-switchedOnText": "ON",
  52972. "dxSwitch-switchedOffText": "OFF",
  52973. "dxForm-optionalMark": "optional",
  52974. "dxForm-requiredMessage": "{0} is required",
  52975. "dxNumberBox-invalidValueMessage": "Value must be a number",
  52976. "dxNumberBox-noDataText": "No data",
  52977. "dxDataGrid-columnChooserTitle": "Column Chooser",
  52978. "dxDataGrid-columnChooserEmptyText": "Drag a column here to hide it",
  52979. "dxDataGrid-groupContinuesMessage": "Continues on the next page",
  52980. "dxDataGrid-groupContinuedMessage": "Continued from the previous page",
  52981. "dxDataGrid-groupHeaderText": "Group by This Column",
  52982. "dxDataGrid-ungroupHeaderText": "Ungroup",
  52983. "dxDataGrid-ungroupAllText": "Ungroup All",
  52984. "dxDataGrid-editingEditRow": "Edit",
  52985. "dxDataGrid-editingSaveRowChanges": "Save",
  52986. "dxDataGrid-editingCancelRowChanges": "Cancel",
  52987. "dxDataGrid-editingDeleteRow": "Delete",
  52988. "dxDataGrid-editingUndeleteRow": "Undelete",
  52989. "dxDataGrid-editingConfirmDeleteMessage": "Are you sure you want to delete this record?",
  52990. "dxDataGrid-validationCancelChanges": "Cancel changes",
  52991. "dxDataGrid-groupPanelEmptyText": "Drag a column header here to group by that column",
  52992. "dxDataGrid-noDataText": "No data",
  52993. "dxDataGrid-searchPanelPlaceholder": "Search...",
  52994. "dxDataGrid-filterRowShowAllText": "(All)",
  52995. "dxDataGrid-filterRowResetOperationText": "Reset",
  52996. "dxDataGrid-filterRowOperationEquals": "Equals",
  52997. "dxDataGrid-filterRowOperationNotEquals": "Does not equal",
  52998. "dxDataGrid-filterRowOperationLess": "Less than",
  52999. "dxDataGrid-filterRowOperationLessOrEquals": "Less than or equal to",
  53000. "dxDataGrid-filterRowOperationGreater": "Greater than",
  53001. "dxDataGrid-filterRowOperationGreaterOrEquals": "Greater than or equal to",
  53002. "dxDataGrid-filterRowOperationStartsWith": "Starts with",
  53003. "dxDataGrid-filterRowOperationContains": "Contains",
  53004. "dxDataGrid-filterRowOperationNotContains": "Does not contain",
  53005. "dxDataGrid-filterRowOperationEndsWith": "Ends with",
  53006. "dxDataGrid-filterRowOperationBetween": "Between",
  53007. "dxDataGrid-filterRowOperationBetweenStartText": "Start",
  53008. "dxDataGrid-filterRowOperationBetweenEndText": "End",
  53009. "dxDataGrid-applyFilterText": "Apply filter",
  53010. "dxDataGrid-trueText": "true",
  53011. "dxDataGrid-falseText": "false",
  53012. "dxDataGrid-sortingAscendingText": "Sort Ascending",
  53013. "dxDataGrid-sortingDescendingText": "Sort Descending",
  53014. "dxDataGrid-sortingClearText": "Clear Sorting",
  53015. "dxDataGrid-editingSaveAllChanges": "Save changes",
  53016. "dxDataGrid-editingCancelAllChanges": "Discard changes",
  53017. "dxDataGrid-editingAddRow": "Add a row",
  53018. "dxDataGrid-summaryMin": "Min: {0}",
  53019. "dxDataGrid-summaryMinOtherColumn": "Min of {1} is {0}",
  53020. "dxDataGrid-summaryMax": "Max: {0}",
  53021. "dxDataGrid-summaryMaxOtherColumn": "Max of {1} is {0}",
  53022. "dxDataGrid-summaryAvg": "Avg: {0}",
  53023. "dxDataGrid-summaryAvgOtherColumn": "Avg of {1} is {0}",
  53024. "dxDataGrid-summarySum": "Sum: {0}",
  53025. "dxDataGrid-summarySumOtherColumn": "Sum of {1} is {0}",
  53026. "dxDataGrid-summaryCount": "Count: {0}",
  53027. "dxDataGrid-columnFixingFix": "Fix",
  53028. "dxDataGrid-columnFixingUnfix": "Unfix",
  53029. "dxDataGrid-columnFixingLeftPosition": "To the left",
  53030. "dxDataGrid-columnFixingRightPosition": "To the right",
  53031. "dxDataGrid-exportTo": "Export",
  53032. "dxDataGrid-exportToExcel": "Export to Excel file",
  53033. "dxDataGrid-exporting": "Exporting...",
  53034. "dxDataGrid-excelFormat": "Excel file",
  53035. "dxDataGrid-selectedRows": "Selected rows",
  53036. "dxDataGrid-exportSelectedRows": "Export selected rows",
  53037. "dxDataGrid-exportAll": "Export all data",
  53038. "dxDataGrid-headerFilterEmptyValue": "(Blanks)",
  53039. "dxDataGrid-headerFilterOK": "OK",
  53040. "dxDataGrid-headerFilterCancel": "Cancel",
  53041. "dxDataGrid-ariaColumn": "Column",
  53042. "dxDataGrid-ariaValue": "Value",
  53043. "dxDataGrid-ariaFilterCell": "Filter cell",
  53044. "dxDataGrid-ariaCollapse": "Collapse",
  53045. "dxDataGrid-ariaExpand": "Expand",
  53046. "dxDataGrid-ariaDataGrid": "Data grid",
  53047. "dxDataGrid-ariaSearchInGrid": "Search in data grid",
  53048. "dxDataGrid-ariaSelectAll": "Select all",
  53049. "dxDataGrid-ariaSelectRow": "Select row",
  53050. "dxDataGrid-filterBuilderPopupTitle": "Filter Builder",
  53051. "dxDataGrid-filterPanelCreateFilter": "Create Filter",
  53052. "dxDataGrid-filterPanelClearFilter": "Clear",
  53053. "dxDataGrid-filterPanelFilterEnabledHint": "Enable the filter",
  53054. "dxTreeList-ariaTreeList": "Tree list",
  53055. "dxTreeList-editingAddRowToNode": "Add",
  53056. "dxPager-infoText": "Page {0} of {1} ({2} items)",
  53057. "dxPager-pagesCountText": "of",
  53058. "dxPivotGrid-grandTotal": "Grand Total",
  53059. "dxPivotGrid-total": "{0} Total",
  53060. "dxPivotGrid-fieldChooserTitle": "Field Chooser",
  53061. "dxPivotGrid-showFieldChooser": "Show Field Chooser",
  53062. "dxPivotGrid-expandAll": "Expand All",
  53063. "dxPivotGrid-collapseAll": "Collapse All",
  53064. "dxPivotGrid-sortColumnBySummary": 'Sort "{0}" by This Column',
  53065. "dxPivotGrid-sortRowBySummary": 'Sort "{0}" by This Row',
  53066. "dxPivotGrid-removeAllSorting": "Remove All Sorting",
  53067. "dxPivotGrid-dataNotAvailable": "N/A",
  53068. "dxPivotGrid-rowFields": "Row Fields",
  53069. "dxPivotGrid-columnFields": "Column Fields",
  53070. "dxPivotGrid-dataFields": "Data Fields",
  53071. "dxPivotGrid-filterFields": "Filter Fields",
  53072. "dxPivotGrid-allFields": "All Fields",
  53073. "dxPivotGrid-columnFieldArea": "Drop Column Fields Here",
  53074. "dxPivotGrid-dataFieldArea": "Drop Data Fields Here",
  53075. "dxPivotGrid-rowFieldArea": "Drop Row Fields Here",
  53076. "dxPivotGrid-filterFieldArea": "Drop Filter Fields Here",
  53077. "dxScheduler-editorLabelTitle": "Subject",
  53078. "dxScheduler-editorLabelStartDate": "Start Date",
  53079. "dxScheduler-editorLabelEndDate": "End Date",
  53080. "dxScheduler-editorLabelDescription": "Description",
  53081. "dxScheduler-editorLabelRecurrence": "Repeat",
  53082. "dxScheduler-openAppointment": "Open appointment",
  53083. "dxScheduler-recurrenceNever": "Never",
  53084. "dxScheduler-recurrenceDaily": "Daily",
  53085. "dxScheduler-recurrenceWeekly": "Weekly",
  53086. "dxScheduler-recurrenceMonthly": "Monthly",
  53087. "dxScheduler-recurrenceYearly": "Yearly",
  53088. "dxScheduler-recurrenceRepeatEvery": "Repeat Every",
  53089. "dxScheduler-recurrenceRepeatOn": "Repeat On",
  53090. "dxScheduler-recurrenceEnd": "End repeat",
  53091. "dxScheduler-recurrenceAfter": "After",
  53092. "dxScheduler-recurrenceOn": "On",
  53093. "dxScheduler-recurrenceRepeatDaily": "day(s)",
  53094. "dxScheduler-recurrenceRepeatWeekly": "week(s)",
  53095. "dxScheduler-recurrenceRepeatMonthly": "month(s)",
  53096. "dxScheduler-recurrenceRepeatYearly": "year(s)",
  53097. "dxScheduler-switcherDay": "Day",
  53098. "dxScheduler-switcherWeek": "Week",
  53099. "dxScheduler-switcherWorkWeek": "Work Week",
  53100. "dxScheduler-switcherMonth": "Month",
  53101. "dxScheduler-switcherAgenda": "Agenda",
  53102. "dxScheduler-switcherTimelineDay": "Timeline Day",
  53103. "dxScheduler-switcherTimelineWeek": "Timeline Week",
  53104. "dxScheduler-switcherTimelineWorkWeek": "Timeline Work Week",
  53105. "dxScheduler-switcherTimelineMonth": "Timeline Month",
  53106. "dxScheduler-recurrenceRepeatOnDate": "on date",
  53107. "dxScheduler-recurrenceRepeatCount": "occurrence(s)",
  53108. "dxScheduler-allDay": "All day",
  53109. "dxScheduler-confirmRecurrenceEditMessage": "Do you want to edit only this appointment or the whole series?",
  53110. "dxScheduler-confirmRecurrenceDeleteMessage": "Do you want to delete only this appointment or the whole series?",
  53111. "dxScheduler-confirmRecurrenceEditSeries": "Edit series",
  53112. "dxScheduler-confirmRecurrenceDeleteSeries": "Delete series",
  53113. "dxScheduler-confirmRecurrenceEditOccurrence": "Edit appointment",
  53114. "dxScheduler-confirmRecurrenceDeleteOccurrence": "Delete appointment",
  53115. "dxScheduler-noTimezoneTitle": "No timezone",
  53116. "dxScheduler-moreAppointments": "{0} more",
  53117. "dxCalendar-todayButtonText": "Today",
  53118. "dxCalendar-ariaWidgetName": "Calendar",
  53119. "dxColorView-ariaRed": "Red",
  53120. "dxColorView-ariaGreen": "Green",
  53121. "dxColorView-ariaBlue": "Blue",
  53122. "dxColorView-ariaAlpha": "Transparency",
  53123. "dxColorView-ariaHex": "Color code",
  53124. "dxTagBox-selected": "{0} selected",
  53125. "dxTagBox-allSelected": "All selected ({0})",
  53126. "dxTagBox-moreSelected": "{0} more",
  53127. "vizExport-printingButtonText": "Print",
  53128. "vizExport-titleMenuText": "Exporting/Printing",
  53129. "vizExport-exportButtonText": "{0} file",
  53130. "dxFilterBuilder-and": "And",
  53131. "dxFilterBuilder-or": "Or",
  53132. "dxFilterBuilder-notAnd": "Not And",
  53133. "dxFilterBuilder-notOr": "Not Or",
  53134. "dxFilterBuilder-addCondition": "Add Condition",
  53135. "dxFilterBuilder-addGroup": "Add Group",
  53136. "dxFilterBuilder-enterValueText": "<enter a value>",
  53137. "dxFilterBuilder-filterOperationEquals": "Equals",
  53138. "dxFilterBuilder-filterOperationNotEquals": "Does not equal",
  53139. "dxFilterBuilder-filterOperationLess": "Is less than",
  53140. "dxFilterBuilder-filterOperationLessOrEquals": "Is less than or equal to",
  53141. "dxFilterBuilder-filterOperationGreater": "Is greater than",
  53142. "dxFilterBuilder-filterOperationGreaterOrEquals": "Is greater than or equal to",
  53143. "dxFilterBuilder-filterOperationStartsWith": "Starts with",
  53144. "dxFilterBuilder-filterOperationContains": "Contains",
  53145. "dxFilterBuilder-filterOperationNotContains": "Does not contain",
  53146. "dxFilterBuilder-filterOperationEndsWith": "Ends with",
  53147. "dxFilterBuilder-filterOperationIsBlank": "Is blank",
  53148. "dxFilterBuilder-filterOperationIsNotBlank": "Is not blank",
  53149. "dxFilterBuilder-filterOperationBetween": "Is between",
  53150. "dxFilterBuilder-filterOperationAnyOf": "Is any of",
  53151. "dxFilterBuilder-filterOperationNoneOf": "Is none of",
  53152. "dxHtmlEditor-dialogColorCaption": "Change Font Color",
  53153. "dxHtmlEditor-dialogBackgroundCaption": "Change Background Color",
  53154. "dxHtmlEditor-dialogLinkCaption": "Add Link",
  53155. "dxHtmlEditor-dialogLinkUrlField": "URL",
  53156. "dxHtmlEditor-dialogLinkTextField": "Text",
  53157. "dxHtmlEditor-dialogLinkTargetField": "Open link in new window",
  53158. "dxHtmlEditor-dialogImageCaption": "Add Image",
  53159. "dxHtmlEditor-dialogImageUrlField": "URL",
  53160. "dxHtmlEditor-dialogImageAltField": "Alternate text",
  53161. "dxHtmlEditor-dialogImageWidthField": "Width (px)",
  53162. "dxHtmlEditor-dialogImageHeightField": "Height (px)",
  53163. "dxHtmlEditor-heading": "Heading",
  53164. "dxHtmlEditor-normalText": "Normal text",
  53165. "dxFileManager-newFolderName": "Untitled folder",
  53166. "dxFileManager-errorNoAccess": "Access denied. The operation cannot be completed.",
  53167. "dxFileManager-errorDirectoryExistsFormat": "Directory '{0}' already exists.",
  53168. "dxFileManager-errorFileExistsFormat": "File '{0}' already exists.",
  53169. "dxFileManager-errorFileNotFoundFormat": "File '{0}' not found",
  53170. "dxFileManager-errorDefault": "Unspecified error."
  53171. }
  53172. }
  53173. },
  53174. /*!**********************************************************************!*\
  53175. !*** ./artifacts/transpiled/localization/cldr-data/parentLocales.js ***!
  53176. \**********************************************************************/
  53177. /*! dynamic exports provided */
  53178. /*! all exports used */
  53179. function(module, exports, __webpack_require__) {
  53180. module.exports = {
  53181. "en-150": "en-001",
  53182. "en-AG": "en-001",
  53183. "en-AI": "en-001",
  53184. "en-AU": "en-001",
  53185. "en-BB": "en-001",
  53186. "en-BM": "en-001",
  53187. "en-BS": "en-001",
  53188. "en-BW": "en-001",
  53189. "en-BZ": "en-001",
  53190. "en-CC": "en-001",
  53191. "en-CK": "en-001",
  53192. "en-CM": "en-001",
  53193. "en-CX": "en-001",
  53194. "en-CY": "en-001",
  53195. "en-DG": "en-001",
  53196. "en-DM": "en-001",
  53197. "en-ER": "en-001",
  53198. "en-FJ": "en-001",
  53199. "en-FK": "en-001",
  53200. "en-FM": "en-001",
  53201. "en-GB": "en-001",
  53202. "en-GD": "en-001",
  53203. "en-GG": "en-001",
  53204. "en-GH": "en-001",
  53205. "en-GI": "en-001",
  53206. "en-GM": "en-001",
  53207. "en-GY": "en-001",
  53208. "en-HK": "en-001",
  53209. "en-IE": "en-001",
  53210. "en-IL": "en-001",
  53211. "en-IM": "en-001",
  53212. "en-IN": "en-001",
  53213. "en-IO": "en-001",
  53214. "en-JE": "en-001",
  53215. "en-JM": "en-001",
  53216. "en-KE": "en-001",
  53217. "en-KI": "en-001",
  53218. "en-KN": "en-001",
  53219. "en-KY": "en-001",
  53220. "en-LC": "en-001",
  53221. "en-LR": "en-001",
  53222. "en-LS": "en-001",
  53223. "en-MG": "en-001",
  53224. "en-MO": "en-001",
  53225. "en-MS": "en-001",
  53226. "en-MT": "en-001",
  53227. "en-MU": "en-001",
  53228. "en-MV": "en-001",
  53229. "en-MW": "en-001",
  53230. "en-MY": "en-001",
  53231. "en-NA": "en-001",
  53232. "en-NF": "en-001",
  53233. "en-NG": "en-001",
  53234. "en-NR": "en-001",
  53235. "en-NU": "en-001",
  53236. "en-NZ": "en-001",
  53237. "en-PG": "en-001",
  53238. "en-PK": "en-001",
  53239. "en-PN": "en-001",
  53240. "en-PW": "en-001",
  53241. "en-RW": "en-001",
  53242. "en-SB": "en-001",
  53243. "en-SC": "en-001",
  53244. "en-SD": "en-001",
  53245. "en-SG": "en-001",
  53246. "en-SH": "en-001",
  53247. "en-SL": "en-001",
  53248. "en-SS": "en-001",
  53249. "en-SX": "en-001",
  53250. "en-SZ": "en-001",
  53251. "en-TC": "en-001",
  53252. "en-TK": "en-001",
  53253. "en-TO": "en-001",
  53254. "en-TT": "en-001",
  53255. "en-TV": "en-001",
  53256. "en-TZ": "en-001",
  53257. "en-UG": "en-001",
  53258. "en-VC": "en-001",
  53259. "en-VG": "en-001",
  53260. "en-VU": "en-001",
  53261. "en-WS": "en-001",
  53262. "en-ZA": "en-001",
  53263. "en-ZM": "en-001",
  53264. "en-ZW": "en-001",
  53265. "en-AT": "en-150",
  53266. "en-BE": "en-150",
  53267. "en-CH": "en-150",
  53268. "en-DE": "en-150",
  53269. "en-DK": "en-150",
  53270. "en-FI": "en-150",
  53271. "en-NL": "en-150",
  53272. "en-SE": "en-150",
  53273. "en-SI": "en-150",
  53274. "hi-Latn": "en-IN",
  53275. "es-AR": "es-419",
  53276. "es-BO": "es-419",
  53277. "es-BR": "es-419",
  53278. "es-BZ": "es-419",
  53279. "es-CL": "es-419",
  53280. "es-CO": "es-419",
  53281. "es-CR": "es-419",
  53282. "es-CU": "es-419",
  53283. "es-DO": "es-419",
  53284. "es-EC": "es-419",
  53285. "es-GT": "es-419",
  53286. "es-HN": "es-419",
  53287. "es-MX": "es-419",
  53288. "es-NI": "es-419",
  53289. "es-PA": "es-419",
  53290. "es-PE": "es-419",
  53291. "es-PR": "es-419",
  53292. "es-PY": "es-419",
  53293. "es-SV": "es-419",
  53294. "es-US": "es-419",
  53295. "es-UY": "es-419",
  53296. "es-VE": "es-419",
  53297. nb: "no",
  53298. nn: "no",
  53299. "pt-AO": "pt-PT",
  53300. "pt-CH": "pt-PT",
  53301. "pt-CV": "pt-PT",
  53302. "pt-FR": "pt-PT",
  53303. "pt-GQ": "pt-PT",
  53304. "pt-GW": "pt-PT",
  53305. "pt-LU": "pt-PT",
  53306. "pt-MO": "pt-PT",
  53307. "pt-MZ": "pt-PT",
  53308. "pt-ST": "pt-PT",
  53309. "pt-TL": "pt-PT",
  53310. "az-Arab": "und",
  53311. "az-Cyrl": "und",
  53312. "bal-Latn": "und",
  53313. "blt-Latn": "und",
  53314. "bm-Nkoo": "und",
  53315. "bs-Cyrl": "und",
  53316. "byn-Latn": "und",
  53317. "cu-Glag": "und",
  53318. "dje-Arab": "und",
  53319. "dyo-Arab": "und",
  53320. "en-Dsrt": "und",
  53321. "en-Shaw": "und",
  53322. "ff-Adlm": "und",
  53323. "ff-Arab": "und",
  53324. "ha-Arab": "und",
  53325. "iu-Latn": "und",
  53326. "kk-Arab": "und",
  53327. "ks-Deva": "und",
  53328. "ku-Arab": "und",
  53329. "ky-Arab": "und",
  53330. "ky-Latn": "und",
  53331. "ml-Arab": "und",
  53332. "mn-Mong": "und",
  53333. "mni-Mtei": "und",
  53334. "ms-Arab": "und",
  53335. "pa-Arab": "und",
  53336. "sat-Deva": "und",
  53337. "sd-Deva": "und",
  53338. "sd-Khoj": "und",
  53339. "sd-Sind": "und",
  53340. "shi-Latn": "und",
  53341. "so-Arab": "und",
  53342. "sr-Latn": "und",
  53343. "sw-Arab": "und",
  53344. "tg-Arab": "und",
  53345. "ug-Cyrl": "und",
  53346. "uz-Arab": "und",
  53347. "uz-Cyrl": "und",
  53348. "vai-Latn": "und",
  53349. "wo-Arab": "und",
  53350. "yo-Arab": "und",
  53351. "yue-Hans": "und",
  53352. "zh-Hant": "und",
  53353. "zh-Hant-MO": "zh-Hant-HK"
  53354. }
  53355. },
  53356. /*!******************************************************!*\
  53357. !*** ./artifacts/transpiled/core/events_strategy.js ***!
  53358. \******************************************************/
  53359. /*! dynamic exports provided */
  53360. /*! all exports used */
  53361. function(module, exports, __webpack_require__) {
  53362. var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26);
  53363. var isFunction = __webpack_require__( /*! ./utils/type */ 1).isFunction;
  53364. var each = __webpack_require__( /*! ./utils/iterator */ 3).each;
  53365. var Class = __webpack_require__( /*! ./class */ 15);
  53366. module.exports = Class.inherit({
  53367. ctor: function(owner) {
  53368. this._events = {};
  53369. this._owner = owner
  53370. },
  53371. hasEvent: function(eventName) {
  53372. var callbacks = this._events[eventName];
  53373. if (callbacks) {
  53374. return callbacks.has()
  53375. }
  53376. return false
  53377. },
  53378. fireEvent: function(eventName, eventArgs) {
  53379. var callbacks = this._events[eventName];
  53380. if (callbacks) {
  53381. callbacks.fireWith(this._owner, eventArgs)
  53382. }
  53383. },
  53384. on: function(eventName, eventHandler) {
  53385. var callbacks = this._events[eventName];
  53386. if (!callbacks) {
  53387. callbacks = Callbacks();
  53388. this._events[eventName] = callbacks
  53389. }
  53390. var addFn = callbacks.originalAdd || callbacks.add;
  53391. addFn.call(callbacks, eventHandler)
  53392. },
  53393. off: function(eventName, eventHandler) {
  53394. var callbacks = this._events[eventName];
  53395. if (callbacks) {
  53396. if (isFunction(eventHandler)) {
  53397. callbacks.remove(eventHandler)
  53398. } else {
  53399. callbacks.empty()
  53400. }
  53401. }
  53402. },
  53403. dispose: function() {
  53404. each(this._events, function() {
  53405. this.empty()
  53406. })
  53407. }
  53408. })
  53409. },
  53410. /*!**********************************************************************************!*\
  53411. !*** ./artifacts/transpiled/mobile/init_mobile_viewport/init_mobile_viewport.js ***!
  53412. \**********************************************************************************/
  53413. /*! dynamic exports provided */
  53414. /*! all exports used */
  53415. function(module, exports, __webpack_require__) {
  53416. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  53417. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  53418. var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
  53419. var window = windowUtils.getWindow();
  53420. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  53421. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  53422. var resizeCallbacks = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 130);
  53423. var support = __webpack_require__( /*! ../../core/utils/support */ 43);
  53424. var styleUtils = __webpack_require__( /*! ../../core/utils/style */ 85);
  53425. var devices = __webpack_require__( /*! ../../core/devices */ 16);
  53426. var initMobileViewport = function(options) {
  53427. options = extend({}, options);
  53428. var realDevice = devices.real();
  53429. var allowZoom = options.allowZoom;
  53430. var allowPan = options.allowPan;
  53431. var allowSelection = "allowSelection" in options ? options.allowSelection : "generic" === realDevice.platform;
  53432. var metaSelector = "meta[name=viewport]";
  53433. if (!$(metaSelector).length) {
  53434. $("<meta>").attr("name", "viewport").appendTo("head")
  53435. }
  53436. var metaVerbs = ["width=device-width"];
  53437. var msTouchVerbs = [];
  53438. if (allowZoom) {
  53439. msTouchVerbs.push("pinch-zoom")
  53440. } else {
  53441. metaVerbs.push("initial-scale=1.0", "maximum-scale=1.0, user-scalable=no")
  53442. }
  53443. if (allowPan) {
  53444. msTouchVerbs.push("pan-x", "pan-y")
  53445. }
  53446. if (!allowPan && !allowZoom) {
  53447. $("html, body").css({
  53448. msContentZooming: "none",
  53449. msUserSelect: "none",
  53450. overflow: "hidden"
  53451. })
  53452. } else {
  53453. $("html").css("msOverflowStyle", "-ms-autohiding-scrollbar")
  53454. }
  53455. if (!allowSelection && support.supportProp("userSelect")) {
  53456. $(".dx-viewport").css(styleUtils.styleProp("userSelect"), "none")
  53457. }
  53458. $(metaSelector).attr("content", metaVerbs.join());
  53459. $("html").css("msTouchAction", msTouchVerbs.join(" ") || "none");
  53460. realDevice = devices.real();
  53461. if (support.touch && !("win" === realDevice.platform && 10 === realDevice.version[0])) {
  53462. eventsEngine.off(domAdapter.getDocument(), ".dxInitMobileViewport");
  53463. eventsEngine.on(domAdapter.getDocument(), "dxpointermove.dxInitMobileViewport", function(e) {
  53464. var count = e.pointers.length;
  53465. var isTouchEvent = "touch" === e.pointerType;
  53466. var zoomDisabled = !allowZoom && count > 1;
  53467. var panDisabled = !allowPan && 1 === count && !e.isScrollingEvent;
  53468. if (isTouchEvent && (zoomDisabled || panDisabled)) {
  53469. e.preventDefault()
  53470. }
  53471. })
  53472. }
  53473. if (realDevice.ios) {
  53474. var isPhoneGap = "file:" === domAdapter.getLocation().protocol;
  53475. if (!isPhoneGap) {
  53476. resizeCallbacks.add(function() {
  53477. var windowWidth = $(window).width();
  53478. $("body").width(windowWidth)
  53479. })
  53480. }
  53481. }
  53482. if (realDevice.android) {
  53483. resizeCallbacks.add(function() {
  53484. setTimeout(function() {
  53485. var activeElement = domAdapter.getActiveElement();
  53486. activeElement.scrollIntoViewIfNeeded ? activeElement.scrollIntoViewIfNeeded() : activeElement.scrollIntoView(false)
  53487. })
  53488. })
  53489. }
  53490. };
  53491. exports.initMobileViewport = initMobileViewport
  53492. },
  53493. /*!**********************************************************!*\
  53494. !*** ./artifacts/transpiled/events/pointer/mspointer.js ***!
  53495. \**********************************************************/
  53496. /*! dynamic exports provided */
  53497. /*! all exports used */
  53498. function(module, exports, __webpack_require__) {
  53499. var BaseStrategy = __webpack_require__( /*! ./base */ 154);
  53500. var Observer = __webpack_require__( /*! ./observer */ 266);
  53501. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  53502. var eventMap = {
  53503. dxpointerdown: "pointerdown",
  53504. dxpointermove: "pointermove",
  53505. dxpointerup: "pointerup",
  53506. dxpointercancel: "pointercancel",
  53507. dxpointerover: "pointerover",
  53508. dxpointerout: "pointerout",
  53509. dxpointerenter: "pointerenter",
  53510. dxpointerleave: "pointerleave"
  53511. };
  53512. var observer;
  53513. var activated = false;
  53514. var activateStrategy = function() {
  53515. if (activated) {
  53516. return
  53517. }
  53518. observer = new Observer(eventMap, function(a, b) {
  53519. return a.pointerId === b.pointerId
  53520. }, function(e) {
  53521. if (e.isPrimary) {
  53522. observer.reset()
  53523. }
  53524. });
  53525. activated = true
  53526. };
  53527. var MsPointerStrategy = BaseStrategy.inherit({
  53528. ctor: function() {
  53529. this.callBase.apply(this, arguments);
  53530. activateStrategy()
  53531. },
  53532. _fireEvent: function(args) {
  53533. return this.callBase(extend({
  53534. pointers: observer.pointers(),
  53535. pointerId: args.originalEvent.pointerId
  53536. }, args))
  53537. }
  53538. });
  53539. MsPointerStrategy.map = eventMap;
  53540. MsPointerStrategy.resetObserver = function() {
  53541. observer.reset()
  53542. };
  53543. module.exports = MsPointerStrategy
  53544. },
  53545. /*!****************************************************************!*\
  53546. !*** ./artifacts/transpiled/events/pointer/mouse_and_touch.js ***!
  53547. \****************************************************************/
  53548. /*! dynamic exports provided */
  53549. /*! all exports used */
  53550. function(module, exports, __webpack_require__) {
  53551. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  53552. var BaseStrategy = __webpack_require__( /*! ./base */ 154);
  53553. var MouseStrategy = __webpack_require__( /*! ./mouse */ 267);
  53554. var TouchStrategy = __webpack_require__( /*! ./touch */ 265);
  53555. var eventUtils = __webpack_require__( /*! ../utils */ 8);
  53556. var eventMap = {
  53557. dxpointerdown: "touchstart mousedown",
  53558. dxpointermove: "touchmove mousemove",
  53559. dxpointerup: "touchend mouseup",
  53560. dxpointercancel: "touchcancel",
  53561. dxpointerover: "mouseover",
  53562. dxpointerout: "mouseout",
  53563. dxpointerenter: "mouseenter",
  53564. dxpointerleave: "mouseleave"
  53565. };
  53566. var activated = false;
  53567. var activateStrategy = function() {
  53568. if (activated) {
  53569. return
  53570. }
  53571. MouseStrategy.activate();
  53572. activated = true
  53573. };
  53574. var MouseAndTouchStrategy = BaseStrategy.inherit({
  53575. EVENT_LOCK_TIMEOUT: 100,
  53576. ctor: function() {
  53577. this.callBase.apply(this, arguments);
  53578. activateStrategy()
  53579. },
  53580. _handler: function(e) {
  53581. var isMouseEvent = eventUtils.isMouseEvent(e);
  53582. if (!isMouseEvent) {
  53583. this._skipNextEvents = true
  53584. }
  53585. if (isMouseEvent && this._mouseLocked) {
  53586. return
  53587. }
  53588. if (isMouseEvent && this._skipNextEvents) {
  53589. this._skipNextEvents = false;
  53590. this._mouseLocked = true;
  53591. clearTimeout(this._unlockMouseTimer);
  53592. var that = this;
  53593. this._unlockMouseTimer = setTimeout(function() {
  53594. that._mouseLocked = false
  53595. }, this.EVENT_LOCK_TIMEOUT);
  53596. return
  53597. }
  53598. return this.callBase(e)
  53599. },
  53600. _fireEvent: function(args) {
  53601. var isMouseEvent = eventUtils.isMouseEvent(args.originalEvent);
  53602. var normalizer = isMouseEvent ? MouseStrategy.normalize : TouchStrategy.normalize;
  53603. return this.callBase(extend(normalizer(args.originalEvent), args))
  53604. },
  53605. dispose: function() {
  53606. this.callBase();
  53607. this._skipNextEvents = false;
  53608. this._mouseLocked = false;
  53609. clearTimeout(this._unlockMouseTimer)
  53610. }
  53611. });
  53612. MouseAndTouchStrategy.map = eventMap;
  53613. MouseAndTouchStrategy.resetObserver = MouseStrategy.resetObserver;
  53614. module.exports = MouseAndTouchStrategy
  53615. },
  53616. /*!**********************************************!*\
  53617. !*** ./artifacts/transpiled/localization.js ***!
  53618. \**********************************************/
  53619. /*! dynamic exports provided */
  53620. /*! all exports used */
  53621. function(module, exports, __webpack_require__) {
  53622. var core = __webpack_require__( /*! ./localization/core */ 87);
  53623. var message = __webpack_require__( /*! ./localization/message */ 13);
  53624. var number = __webpack_require__( /*! ./localization/number */ 51);
  53625. var date = __webpack_require__( /*! ./localization/date */ 32);
  53626. __webpack_require__( /*! ./localization/currency */ 152);
  53627. exports.locale = core.locale.bind(core);
  53628. exports.loadMessages = message.load.bind(message);
  53629. exports.formatMessage = message.format.bind(message);
  53630. exports.formatNumber = number.format.bind(number);
  53631. exports.parseNumber = number.parse.bind(number);
  53632. exports.formatDate = date.format.bind(date);
  53633. exports.parseDate = date.parse.bind(date);
  53634. exports.message = message;
  53635. exports.number = number;
  53636. exports.date = date
  53637. },
  53638. /*!*************************************************************!*\
  53639. !*** ./artifacts/transpiled/integration/jquery/renderer.js ***!
  53640. \*************************************************************/
  53641. /*! dynamic exports provided */
  53642. /*! all exports used */
  53643. function(module, exports, __webpack_require__) {
  53644. var jQuery = __webpack_require__( /*! jquery */ 55);
  53645. var rendererBase = __webpack_require__( /*! ../../core/renderer_base */ 253);
  53646. var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
  53647. if (useJQuery) {
  53648. rendererBase.set(jQuery)
  53649. }
  53650. },
  53651. /*!**********************************************************!*\
  53652. !*** ./artifacts/transpiled/integration/jquery/hooks.js ***!
  53653. \**********************************************************/
  53654. /*! dynamic exports provided */
  53655. /*! all exports used */
  53656. function(module, exports, __webpack_require__) {
  53657. var jQuery = __webpack_require__( /*! jquery */ 55);
  53658. var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
  53659. var compareVersion = __webpack_require__( /*! ../../core/utils/version */ 61).compare;
  53660. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  53661. var isNumeric = __webpack_require__( /*! ../../core/utils/type */ 1).isNumeric;
  53662. var setEventFixMethod = __webpack_require__( /*! ../../events/utils */ 8).setEventFixMethod;
  53663. var registerEvent = __webpack_require__( /*! ../../events/core/event_registrator */ 71);
  53664. var hookTouchProps = __webpack_require__( /*! ../../events/core/hook_touch_props */ 254);
  53665. if (useJQuery) {
  53666. if (compareVersion(jQuery.fn.jquery, [3]) < 0) {
  53667. var POINTER_TYPE_MAP = {
  53668. 2: "touch",
  53669. 3: "pen",
  53670. 4: "mouse"
  53671. };
  53672. each(["MSPointerDown", "MSPointerMove", "MSPointerUp", "MSPointerCancel", "MSPointerOver", "MSPointerOut", "mouseenter", "mouseleave", "pointerdown", "pointermove", "pointerup", "pointercancel", "pointerover", "pointerout", "pointerenter", "pointerleave"], function() {
  53673. jQuery.event.fixHooks[this] = {
  53674. filter: function(event, originalEvent) {
  53675. var pointerType = originalEvent.pointerType;
  53676. if (isNumeric(pointerType)) {
  53677. event.pointerType = POINTER_TYPE_MAP[pointerType]
  53678. }
  53679. return event
  53680. },
  53681. props: jQuery.event.mouseHooks.props.concat(["pointerId", "pointerType", "originalTarget", "width", "height", "pressure", "result", "tiltX", "charCode", "tiltY", "detail", "isPrimary", "prevValue"])
  53682. }
  53683. });
  53684. each(["touchstart", "touchmove", "touchend", "touchcancel"], function() {
  53685. jQuery.event.fixHooks[this] = {
  53686. filter: function(event, originalEvent) {
  53687. hookTouchProps(function(name, hook) {
  53688. event[name] = hook(originalEvent)
  53689. });
  53690. return event
  53691. },
  53692. props: jQuery.event.mouseHooks.props.concat(["touches", "changedTouches", "targetTouches", "detail", "result", "originalTarget", "charCode", "prevValue"])
  53693. }
  53694. });
  53695. jQuery.event.fixHooks.wheel = jQuery.event.mouseHooks;
  53696. var DX_EVENT_HOOKS = {
  53697. props: jQuery.event.mouseHooks.props.concat(["pointerType", "pointerId", "pointers"])
  53698. };
  53699. registerEvent.callbacks.add(function(name) {
  53700. jQuery.event.fixHooks[name] = DX_EVENT_HOOKS
  53701. });
  53702. var fix = function(event, originalEvent) {
  53703. var fixHook = jQuery.event.fixHooks[originalEvent.type] || jQuery.event.mouseHooks;
  53704. var props = fixHook.props ? jQuery.event.props.concat(fixHook.props) : jQuery.event.props;
  53705. var propIndex = props.length;
  53706. while (propIndex--) {
  53707. var prop = props[propIndex];
  53708. event[prop] = originalEvent[prop]
  53709. }
  53710. return fixHook.filter ? fixHook.filter(event, originalEvent) : event
  53711. };
  53712. setEventFixMethod(fix)
  53713. } else {
  53714. hookTouchProps(function(name, hook) {
  53715. jQuery.event.addProp(name, hook)
  53716. })
  53717. }
  53718. }
  53719. },
  53720. /*!*************************************************************!*\
  53721. !*** ./artifacts/transpiled/integration/jquery/deferred.js ***!
  53722. \*************************************************************/
  53723. /*! dynamic exports provided */
  53724. /*! all exports used */
  53725. function(module, exports, __webpack_require__) {
  53726. var jQuery = __webpack_require__( /*! jquery */ 55);
  53727. var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
  53728. var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
  53729. var compareVersion = __webpack_require__( /*! ../../core/utils/version */ 61).compare;
  53730. if (useJQuery) {
  53731. var Deferred = jQuery.Deferred;
  53732. var strategy = {
  53733. Deferred: Deferred
  53734. };
  53735. strategy.when = compareVersion(jQuery.fn.jquery, [3]) < 0 ? jQuery.when : function(singleArg) {
  53736. if (0 === arguments.length) {
  53737. return (new Deferred).resolve()
  53738. } else {
  53739. if (1 === arguments.length) {
  53740. return singleArg && singleArg.then ? singleArg : (new Deferred).resolve(singleArg)
  53741. } else {
  53742. return jQuery.when.apply(jQuery, arguments)
  53743. }
  53744. }
  53745. };
  53746. deferredUtils.setStrategy(strategy)
  53747. }
  53748. },
  53749. /*!***************************************************************!*\
  53750. !*** ./artifacts/transpiled/integration/jquery/hold_ready.js ***!
  53751. \***************************************************************/
  53752. /*! dynamic exports provided */
  53753. /*! all exports used */
  53754. function(module, exports, __webpack_require__) {
  53755. var jQuery = __webpack_require__( /*! jquery */ 55);
  53756. var themes_callback = __webpack_require__( /*! ../../ui/themes_callback */ 269);
  53757. var ready = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48).add;
  53758. if (jQuery && !themes_callback.fired()) {
  53759. var holdReady = jQuery.holdReady || jQuery.fn.holdReady;
  53760. holdReady(true);
  53761. themes_callback.add(function() {
  53762. ready(function() {
  53763. holdReady(false)
  53764. })
  53765. })
  53766. }
  53767. },
  53768. /*!***********************************************************!*\
  53769. !*** ./artifacts/transpiled/integration/jquery/events.js ***!
  53770. \***********************************************************/
  53771. /*! dynamic exports provided */
  53772. /*! all exports used */
  53773. function(module, exports, __webpack_require__) {
  53774. var jQuery = __webpack_require__( /*! jquery */ 55);
  53775. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  53776. var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
  53777. var registerEventCallbacks = __webpack_require__( /*! ../../events/core/event_registrator_callbacks */ 122);
  53778. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  53779. if (useJQuery) {
  53780. registerEventCallbacks.add(function(name, eventObject) {
  53781. jQuery.event.special[name] = eventObject
  53782. });
  53783. if (eventsEngine.passiveEventHandlersSupported()) {
  53784. eventsEngine.forcePassiveFalseEventNames.forEach(function(eventName) {
  53785. jQuery.event.special[eventName] = {
  53786. setup: function(data, namespaces, handler) {
  53787. domAdapter.listen(this, eventName, handler, {
  53788. passive: false
  53789. })
  53790. }
  53791. }
  53792. })
  53793. }
  53794. eventsEngine.set({
  53795. on: function(element) {
  53796. jQuery(element).on.apply(jQuery(element), Array.prototype.slice.call(arguments, 1))
  53797. },
  53798. one: function(element) {
  53799. jQuery(element).one.apply(jQuery(element), Array.prototype.slice.call(arguments, 1))
  53800. },
  53801. off: function(element) {
  53802. jQuery(element).off.apply(jQuery(element), Array.prototype.slice.call(arguments, 1))
  53803. },
  53804. trigger: function(element) {
  53805. jQuery(element).trigger.apply(jQuery(element), Array.prototype.slice.call(arguments, 1))
  53806. },
  53807. triggerHandler: function(element) {
  53808. jQuery(element).triggerHandler.apply(jQuery(element), Array.prototype.slice.call(arguments, 1))
  53809. },
  53810. Event: jQuery.Event
  53811. })
  53812. }
  53813. },
  53814. /*!***********************************************************!*\
  53815. !*** ./artifacts/transpiled/integration/jquery/easing.js ***!
  53816. \***********************************************************/
  53817. /*! dynamic exports provided */
  53818. /*! all exports used */
  53819. function(module, exports, __webpack_require__) {
  53820. var jQuery = __webpack_require__( /*! jquery */ 55);
  53821. var easing = __webpack_require__( /*! ../../animation/easing */ 264);
  53822. if (jQuery) {
  53823. easing.setEasing(jQuery.easing)
  53824. }
  53825. },
  53826. /*!*****************************************************************!*\
  53827. !*** ./artifacts/transpiled/integration/jquery/element_data.js ***!
  53828. \*****************************************************************/
  53829. /*! dynamic exports provided */
  53830. /*! all exports used */
  53831. function(module, exports, __webpack_require__) {
  53832. var jQuery = __webpack_require__( /*! jquery */ 55);
  53833. var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39);
  53834. var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
  53835. if (useJQuery) {
  53836. dataUtils.setDataStrategy(jQuery)
  53837. }
  53838. },
  53839. /*!************************************************************!*\
  53840. !*** ./artifacts/transpiled/integration/jquery/element.js ***!
  53841. \************************************************************/
  53842. /*! dynamic exports provided */
  53843. /*! all exports used */
  53844. function(module, exports, __webpack_require__) {
  53845. var setPublicElementWrapper = __webpack_require__( /*! ../../core/utils/dom */ 12).setPublicElementWrapper;
  53846. var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
  53847. var getPublicElement = function($element) {
  53848. return $element
  53849. };
  53850. if (useJQuery) {
  53851. setPublicElementWrapper(getPublicElement)
  53852. }
  53853. },
  53854. /*!**************************************************************************!*\
  53855. !*** ./artifacts/transpiled/integration/jquery/component_registrator.js ***!
  53856. \**************************************************************************/
  53857. /*! dynamic exports provided */
  53858. /*! all exports used */
  53859. function(module, exports, __webpack_require__) {
  53860. var jQuery = __webpack_require__( /*! jquery */ 55);
  53861. var componentRegistratorCallbacks = __webpack_require__( /*! ../../core/component_registrator_callbacks */ 153);
  53862. var errors = __webpack_require__( /*! ../../core/errors */ 21);
  53863. if (jQuery) {
  53864. var registerJQueryComponent = function(name, componentClass) {
  53865. jQuery.fn[name] = function(options) {
  53866. var isMemberInvoke = "string" === typeof options;
  53867. var result;
  53868. if (isMemberInvoke) {
  53869. var memberName = options;
  53870. var memberArgs = [].slice.call(arguments).slice(1);
  53871. this.each(function() {
  53872. var instance = componentClass.getInstance(this);
  53873. if (!instance) {
  53874. throw errors.Error("E0009", name)
  53875. }
  53876. var member = instance[memberName];
  53877. var memberValue = member.apply(instance, memberArgs);
  53878. if (void 0 === result) {
  53879. result = memberValue
  53880. }
  53881. })
  53882. } else {
  53883. this.each(function() {
  53884. var instance = componentClass.getInstance(this);
  53885. if (instance) {
  53886. instance.option(options)
  53887. } else {
  53888. new componentClass(this, options)
  53889. }
  53890. });
  53891. result = this
  53892. }
  53893. return result
  53894. }
  53895. };
  53896. componentRegistratorCallbacks.add(registerJQueryComponent)
  53897. }
  53898. },
  53899. /*!*********************************************************!*\
  53900. !*** ./artifacts/transpiled/integration/jquery/ajax.js ***!
  53901. \*********************************************************/
  53902. /*! dynamic exports provided */
  53903. /*! all exports used */
  53904. function(module, exports, __webpack_require__) {
  53905. var jQuery = __webpack_require__( /*! jquery */ 55);
  53906. var ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58);
  53907. var useJQuery = __webpack_require__( /*! ./use_jquery */ 80)();
  53908. if (useJQuery) {
  53909. ajax.inject({
  53910. sendRequest: function(options) {
  53911. if (!options.responseType && !options.upload) {
  53912. return jQuery.ajax(options)
  53913. }
  53914. return this.callBase.apply(this, [options])
  53915. }
  53916. })
  53917. }
  53918. },
  53919. /*!*****************************************************!*\
  53920. !*** ./artifacts/transpiled/integration/angular.js ***!
  53921. \*****************************************************/
  53922. /*! dynamic exports provided */
  53923. /*! all exports used */
  53924. function(module, exports, __webpack_require__) {
  53925. var angular = __webpack_require__( /*! angular */ 270);
  53926. if (angular) {
  53927. __webpack_require__( /*! ./jquery */ 268);
  53928. __webpack_require__( /*! ./angular/component_registrator */ 461);
  53929. __webpack_require__( /*! ./angular/event_registrator */ 472);
  53930. __webpack_require__( /*! ./angular/components */ 473);
  53931. __webpack_require__( /*! ./angular/action_executors */ 474)
  53932. }
  53933. },
  53934. /*!***************************************************************************!*\
  53935. !*** ./artifacts/transpiled/integration/angular/component_registrator.js ***!
  53936. \***************************************************************************/
  53937. /*! dynamic exports provided */
  53938. /*! all exports used */
  53939. function(module, exports, __webpack_require__) {
  53940. var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
  53941. var _renderer2 = _interopRequireDefault(_renderer);
  53942. var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  53943. var _events_engine2 = _interopRequireDefault(_events_engine);
  53944. var _config = __webpack_require__( /*! ../../core/config */ 31);
  53945. var _config2 = _interopRequireDefault(_config);
  53946. var _component_registrator_callbacks = __webpack_require__( /*! ../../core/component_registrator_callbacks */ 153);
  53947. var _component_registrator_callbacks2 = _interopRequireDefault(_component_registrator_callbacks);
  53948. var _class = __webpack_require__( /*! ../../core/class */ 15);
  53949. var _class2 = _interopRequireDefault(_class);
  53950. var _callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
  53951. var _callbacks2 = _interopRequireDefault(_callbacks);
  53952. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  53953. var _type2 = _interopRequireDefault(_type);
  53954. var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  53955. var _iterator2 = _interopRequireDefault(_iterator);
  53956. var _array = __webpack_require__( /*! ../../core/utils/array */ 14);
  53957. var _array2 = _interopRequireDefault(_array);
  53958. var _locker = __webpack_require__( /*! ../../core/utils/locker */ 271);
  53959. var _locker2 = _interopRequireDefault(_locker);
  53960. var _ui = __webpack_require__( /*! ../../ui/widget/ui.widget */ 18);
  53961. var _ui2 = _interopRequireDefault(_ui);
  53962. var _editor = __webpack_require__( /*! ../../ui/editor/editor */ 49);
  53963. var _editor2 = _interopRequireDefault(_editor);
  53964. var _template = __webpack_require__( /*! ./template */ 466);
  53965. var _template2 = _interopRequireDefault(_template);
  53966. var _module = __webpack_require__( /*! ./module */ 180);
  53967. var _module2 = _interopRequireDefault(_module);
  53968. var _uiCollection_widget = __webpack_require__( /*! ../../ui/collection/ui.collection_widget.edit */ 53);
  53969. var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget);
  53970. var _data = __webpack_require__( /*! ../../core/utils/data */ 20);
  53971. var _data2 = _interopRequireDefault(_data);
  53972. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  53973. var _extend2 = _interopRequireDefault(_extend);
  53974. var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
  53975. var _inflector2 = _interopRequireDefault(_inflector);
  53976. var _errors = __webpack_require__( /*! ../../core/errors */ 21);
  53977. var _errors2 = _interopRequireDefault(_errors);
  53978. function _interopRequireDefault(obj) {
  53979. return obj && obj.__esModule ? obj : {
  53980. "default": obj
  53981. }
  53982. }
  53983. function _typeof(obj) {
  53984. "@babel/helpers - typeof";
  53985. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  53986. return typeof obj
  53987. } : function(obj) {
  53988. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  53989. }, _typeof(obj)
  53990. }
  53991. var each = _iterator2.default.each;
  53992. var inArray = _array2.default.inArray;
  53993. var compileSetter = _data2.default.compileSetter;
  53994. var compileGetter = _data2.default.compileGetter;
  53995. var extendFromObject = _extend2.default.extendFromObject;
  53996. var ITEM_ALIAS_ATTRIBUTE_NAME = "dxItemAlias";
  53997. var SKIP_APPLY_ACTION_CATEGORIES = ["rendering"];
  53998. var NG_MODEL_OPTION = "value";
  53999. var safeApply = function(func, scope) {
  54000. if (scope.$root.$$phase) {
  54001. return func(scope)
  54002. } else {
  54003. return scope.$apply(function() {
  54004. return func(scope)
  54005. })
  54006. }
  54007. };
  54008. var ComponentBuilder = _class2.default.inherit({
  54009. ctor: function(options) {
  54010. this._componentDisposing = (0, _callbacks2.default)();
  54011. this._optionChangedCallbacks = (0, _callbacks2.default)();
  54012. this._ngLocker = new _locker2.default;
  54013. this._scope = options.scope;
  54014. this._$element = options.$element;
  54015. this._$templates = options.$templates;
  54016. this._componentClass = options.componentClass;
  54017. this._parse = options.parse;
  54018. this._compile = options.compile;
  54019. this._itemAlias = options.itemAlias;
  54020. this._transcludeFn = options.transcludeFn;
  54021. this._digestCallbacks = options.dxDigestCallbacks;
  54022. this._normalizeOptions(options.ngOptions);
  54023. this._initComponentBindings();
  54024. this._initComponent(this._scope);
  54025. if (!options.ngOptions) {
  54026. this._addOptionsStringWatcher(options.ngOptionsString)
  54027. }
  54028. },
  54029. _addOptionsStringWatcher: function(optionsString) {
  54030. var _this = this;
  54031. var clearOptionsStringWatcher = this._scope.$watch(optionsString, function(newOptions) {
  54032. if (!newOptions) {
  54033. return
  54034. }
  54035. clearOptionsStringWatcher();
  54036. _this._normalizeOptions(newOptions);
  54037. _this._initComponentBindings();
  54038. _this._component.option(_this._evalOptions(_this._scope))
  54039. });
  54040. this._componentDisposing.add(clearOptionsStringWatcher)
  54041. },
  54042. _normalizeOptions: function(options) {
  54043. var _this2 = this;
  54044. this._ngOptions = extendFromObject({}, options);
  54045. if (!options) {
  54046. return
  54047. }
  54048. if (!Object.prototype.hasOwnProperty.call(options, "bindingOptions") && options.bindingOptions) {
  54049. this._ngOptions.bindingOptions = options.bindingOptions
  54050. }
  54051. if (options.bindingOptions) {
  54052. each(options.bindingOptions, function(key, value) {
  54053. if ("string" === _type2.default.type(value)) {
  54054. _this2._ngOptions.bindingOptions[key] = {
  54055. dataPath: value
  54056. }
  54057. }
  54058. })
  54059. }
  54060. },
  54061. _initComponent: function(scope) {
  54062. this._component = new this._componentClass(this._$element, this._evalOptions(scope));
  54063. this._component._isHidden = true;
  54064. this._handleDigestPhase()
  54065. },
  54066. _handleDigestPhase: function() {
  54067. var _this3 = this;
  54068. var beginUpdate = function() {
  54069. _this3._component.beginUpdate()
  54070. };
  54071. var endUpdate = function() {
  54072. _this3._component.endUpdate()
  54073. };
  54074. this._digestCallbacks.begin.add(beginUpdate);
  54075. this._digestCallbacks.end.add(endUpdate);
  54076. this._componentDisposing.add(function() {
  54077. _this3._digestCallbacks.begin.remove(beginUpdate);
  54078. _this3._digestCallbacks.end.remove(endUpdate)
  54079. })
  54080. },
  54081. _initComponentBindings: function() {
  54082. var _this4 = this;
  54083. var optionDependencies = {};
  54084. if (!this._ngOptions.bindingOptions) {
  54085. return
  54086. }
  54087. each(this._ngOptions.bindingOptions, function(optionPath, value) {
  54088. var separatorIndex = optionPath.search(/\[|\./);
  54089. var optionForSubscribe = separatorIndex > -1 ? optionPath.substring(0, separatorIndex) : optionPath;
  54090. var prevWatchMethod;
  54091. var clearWatcher;
  54092. var valuePath = value.dataPath;
  54093. var deepWatch = true;
  54094. var forcePlainWatchMethod = false;
  54095. if (void 0 !== value.deep) {
  54096. forcePlainWatchMethod = deepWatch = !!value.deep
  54097. }
  54098. if (!optionDependencies[optionForSubscribe]) {
  54099. optionDependencies[optionForSubscribe] = {}
  54100. }
  54101. optionDependencies[optionForSubscribe][optionPath] = valuePath;
  54102. var watchCallback = function(newValue, oldValue) {
  54103. if (_this4._ngLocker.locked(optionPath)) {
  54104. return
  54105. }
  54106. _this4._ngLocker.obtain(optionPath);
  54107. _this4._component.option(optionPath, newValue);
  54108. updateWatcher();
  54109. if (_this4._component._optionValuesEqual(optionPath, oldValue, newValue) && _this4._ngLocker.locked(optionPath)) {
  54110. _this4._ngLocker.release(optionPath)
  54111. }
  54112. };
  54113. var updateWatcher = function() {
  54114. var watchMethod = Array.isArray(_this4._scope.$eval(valuePath)) && !forcePlainWatchMethod ? "$watchCollection" : "$watch";
  54115. if (prevWatchMethod !== watchMethod) {
  54116. if (clearWatcher) {
  54117. clearWatcher()
  54118. }
  54119. clearWatcher = _this4._scope[watchMethod](valuePath, watchCallback, deepWatch);
  54120. prevWatchMethod = watchMethod
  54121. }
  54122. };
  54123. updateWatcher();
  54124. _this4._componentDisposing.add(clearWatcher)
  54125. });
  54126. this._optionChangedCallbacks.add(function(args) {
  54127. var optionName = args.name;
  54128. var fullName = args.fullName;
  54129. var component = args.component;
  54130. if (_this4._ngLocker.locked(fullName)) {
  54131. _this4._ngLocker.release(fullName);
  54132. return
  54133. }
  54134. if (!optionDependencies || !optionDependencies[optionName]) {
  54135. return
  54136. }
  54137. var isActivePhase = _this4._scope.$root.$$phase;
  54138. var obtainOption = function() {
  54139. _this4._ngLocker.obtain(fullName)
  54140. };
  54141. if (isActivePhase) {
  54142. _this4._digestCallbacks.begin.add(obtainOption)
  54143. } else {
  54144. obtainOption()
  54145. }
  54146. safeApply(function() {
  54147. each(optionDependencies[optionName], function(optionPath, valuePath) {
  54148. if (!_this4._optionsAreLinked(fullName, optionPath)) {
  54149. return
  54150. }
  54151. var value = component.option(optionPath);
  54152. _this4._parse(valuePath).assign(_this4._scope, value);
  54153. var scopeValue = _this4._parse(valuePath)(_this4._scope);
  54154. if (scopeValue !== value) {
  54155. args.component.option(optionPath, scopeValue)
  54156. }
  54157. })
  54158. }, _this4._scope);
  54159. var releaseOption = function releaseOption() {
  54160. if (_this4._ngLocker.locked(fullName)) {
  54161. _this4._ngLocker.release(fullName)
  54162. }
  54163. _this4._digestCallbacks.begin.remove(obtainOption);
  54164. _this4._digestCallbacks.end.remove(releaseOption)
  54165. };
  54166. if (isActivePhase) {
  54167. _this4._digestCallbacks.end.addPrioritized(releaseOption)
  54168. } else {
  54169. releaseOption()
  54170. }
  54171. })
  54172. },
  54173. _optionsAreNested: function(optionPath1, optionPath2) {
  54174. var parentSeparator = optionPath1[optionPath2.length];
  54175. return 0 === optionPath1.indexOf(optionPath2) && ("." === parentSeparator || "[" === parentSeparator)
  54176. },
  54177. _optionsAreLinked: function(optionPath1, optionPath2) {
  54178. if (optionPath1 === optionPath2) {
  54179. return true
  54180. }
  54181. return optionPath1.length > optionPath2.length ? this._optionsAreNested(optionPath1, optionPath2) : this._optionsAreNested(optionPath2, optionPath1)
  54182. },
  54183. _compilerByTemplate: function(template) {
  54184. var _this5 = this;
  54185. var scopeItemsPath = this._getScopeItemsPath();
  54186. return function(options) {
  54187. var $resultMarkup = (0, _renderer2.default)(template).clone();
  54188. var dataIsScope = options.model && options.model.constructor === _this5._scope.$root.constructor;
  54189. var templateScope = dataIsScope ? options.model : options.noModel ? _this5._scope : _this5._createScopeWithData(options);
  54190. if (scopeItemsPath) {
  54191. _this5._synchronizeScopes(templateScope, scopeItemsPath, options.index)
  54192. }
  54193. $resultMarkup.appendTo(options.container);
  54194. if (!options.noModel) {
  54195. _events_engine2.default.on($resultMarkup, "$destroy", function() {
  54196. var destroyAlreadyCalled = !templateScope.$parent;
  54197. if (destroyAlreadyCalled) {
  54198. return
  54199. }
  54200. templateScope.$destroy()
  54201. })
  54202. }
  54203. var ngTemplate = _this5._compile($resultMarkup, _this5._transcludeFn);
  54204. _this5._applyAsync(function(scope) {
  54205. ngTemplate(scope, null, {
  54206. parentBoundTranscludeFn: _this5._transcludeFn
  54207. })
  54208. }, templateScope);
  54209. return $resultMarkup
  54210. }
  54211. },
  54212. _applyAsync: function(func, scope) {
  54213. var _this6 = this;
  54214. func(scope);
  54215. if (!scope.$root.$$phase) {
  54216. if (!this._renderingTimer) {
  54217. this._renderingTimer = setTimeout(function() {
  54218. scope.$apply();
  54219. _this6._renderingTimer = null
  54220. })
  54221. }
  54222. this._componentDisposing.add(function() {
  54223. clearTimeout(_this6._renderingTimer)
  54224. })
  54225. }
  54226. },
  54227. _getScopeItemsPath: function() {
  54228. if (this._componentClass.subclassOf(_uiCollection_widget2.default) && this._ngOptions.bindingOptions && this._ngOptions.bindingOptions.items) {
  54229. return this._ngOptions.bindingOptions.items.dataPath
  54230. }
  54231. },
  54232. _createScopeWithData: function(options) {
  54233. var newScope = this._scope.$new();
  54234. if (this._itemAlias) {
  54235. newScope[this._itemAlias] = options.model
  54236. }
  54237. if (_type2.default.isDefined(options.index)) {
  54238. newScope.$index = options.index
  54239. }
  54240. return newScope
  54241. },
  54242. _synchronizeScopes: function(itemScope, parentPrefix, itemIndex) {
  54243. if (this._itemAlias && "object" !== _typeof(itemScope[this._itemAlias])) {
  54244. this._synchronizeScopeField({
  54245. parentScope: this._scope,
  54246. childScope: itemScope,
  54247. fieldPath: this._itemAlias,
  54248. parentPrefix: parentPrefix,
  54249. itemIndex: itemIndex
  54250. })
  54251. }
  54252. },
  54253. _synchronizeScopeField: function(args) {
  54254. var parentScope = args.parentScope;
  54255. var childScope = args.childScope;
  54256. var fieldPath = args.fieldPath;
  54257. var parentPrefix = args.parentPrefix;
  54258. var itemIndex = args.itemIndex;
  54259. var innerPathSuffix = fieldPath === this._itemAlias ? "" : "." + fieldPath;
  54260. var collectionField = void 0 !== itemIndex;
  54261. var optionOuterBag = [parentPrefix];
  54262. if (collectionField) {
  54263. if (!_type2.default.isNumeric(itemIndex)) {
  54264. return
  54265. }
  54266. optionOuterBag.push("[", itemIndex, "]")
  54267. }
  54268. optionOuterBag.push(innerPathSuffix);
  54269. var optionOuterPath = optionOuterBag.join("");
  54270. var clearParentWatcher = parentScope.$watch(optionOuterPath, function(newValue, oldValue) {
  54271. if (newValue !== oldValue) {
  54272. compileSetter(fieldPath)(childScope, newValue)
  54273. }
  54274. });
  54275. var clearItemWatcher = childScope.$watch(fieldPath, function(newValue, oldValue) {
  54276. if (newValue !== oldValue) {
  54277. if (collectionField && !compileGetter(parentPrefix)(parentScope)[itemIndex]) {
  54278. clearItemWatcher();
  54279. return
  54280. }
  54281. compileSetter(optionOuterPath)(parentScope, newValue)
  54282. }
  54283. });
  54284. this._componentDisposing.add([clearParentWatcher, clearItemWatcher])
  54285. },
  54286. _evalOptions: function(scope) {
  54287. var _this8 = this;
  54288. var result = extendFromObject({}, this._ngOptions);
  54289. delete result.bindingOptions;
  54290. if (this._ngOptions.bindingOptions) {
  54291. each(this._ngOptions.bindingOptions, function(key, value) {
  54292. result[key] = scope.$eval(value.dataPath)
  54293. })
  54294. }
  54295. result._optionChangedCallbacks = this._optionChangedCallbacks;
  54296. result._disposingCallbacks = this._componentDisposing;
  54297. result.onActionCreated = function(component, action, config) {
  54298. if (config && inArray(config.category, SKIP_APPLY_ACTION_CATEGORIES) > -1) {
  54299. return action
  54300. }
  54301. var wrappedAction = function() {
  54302. var _this7 = this;
  54303. var args = arguments;
  54304. if (!scope || !scope.$root || scope.$root.$$phase) {
  54305. return action.apply(this, args)
  54306. }
  54307. return safeApply(function() {
  54308. return action.apply(_this7, args)
  54309. }, scope)
  54310. };
  54311. return wrappedAction
  54312. };
  54313. result.beforeActionExecute = result.onActionCreated;
  54314. result.nestedComponentOptions = function(component) {
  54315. return {
  54316. templatesRenderAsynchronously: component.option("templatesRenderAsynchronously"),
  54317. forceApplyBindings: component.option("forceApplyBindings"),
  54318. modelByElement: component.option("modelByElement"),
  54319. onActionCreated: component.option("onActionCreated"),
  54320. beforeActionExecute: component.option("beforeActionExecute"),
  54321. nestedComponentOptions: component.option("nestedComponentOptions")
  54322. }
  54323. };
  54324. result.templatesRenderAsynchronously = true;
  54325. if ((0, _config2.default)().wrapActionsBeforeExecute) {
  54326. result.forceApplyBindings = function() {
  54327. safeApply(function() {}, scope)
  54328. }
  54329. }
  54330. result.integrationOptions = {
  54331. createTemplate: function(element) {
  54332. return new _template2.default(element, _this8._compilerByTemplate.bind(_this8))
  54333. },
  54334. watchMethod: function(fn, callback, options) {
  54335. options = options || {};
  54336. var immediateValue;
  54337. var skipCallback = options.skipImmediate;
  54338. var disposeWatcher = scope.$watch(function() {
  54339. var value = fn();
  54340. if (value instanceof Date) {
  54341. value = value.valueOf()
  54342. }
  54343. return value
  54344. }, function(newValue) {
  54345. var isSameValue = immediateValue === newValue;
  54346. if (!skipCallback && (!isSameValue || isSameValue && options.deep)) {
  54347. callback(newValue)
  54348. }
  54349. skipCallback = false
  54350. }, options.deep);
  54351. if (!skipCallback) {
  54352. immediateValue = fn();
  54353. callback(immediateValue)
  54354. }
  54355. if ((0, _config2.default)().wrapActionsBeforeExecute) {
  54356. _this8._applyAsync(function() {}, scope)
  54357. }
  54358. return disposeWatcher
  54359. },
  54360. templates: {
  54361. "dx-polymorph-widget": {
  54362. render: function(options) {
  54363. var widgetName = options.model.widget;
  54364. if (!widgetName) {
  54365. return
  54366. }
  54367. if ("button" === widgetName || "tabs" === widgetName || "dropDownMenu" === widgetName) {
  54368. var deprecatedName = widgetName;
  54369. widgetName = _inflector2.default.camelize("dx-" + widgetName);
  54370. _errors2.default.log("W0001", "dxToolbar - 'widget' item field", deprecatedName, "16.1", "Use: '" + widgetName + "' instead")
  54371. }
  54372. var markup = (0, _renderer2.default)("<div>").attr(_inflector2.default.dasherize(widgetName), "options").get(0);
  54373. var newScope = _this8._scope.$new();
  54374. newScope.options = options.model.options;
  54375. options.container.append(markup);
  54376. _this8._compile(markup)(newScope)
  54377. }
  54378. }
  54379. }
  54380. };
  54381. result.modelByElement = function() {
  54382. return scope
  54383. };
  54384. return result
  54385. }
  54386. });
  54387. ComponentBuilder = ComponentBuilder.inherit({
  54388. ctor: function(options) {
  54389. this._componentName = options.componentName;
  54390. this._ngModel = options.ngModel;
  54391. this._ngModelController = options.ngModelController;
  54392. this.callBase.apply(this, arguments)
  54393. },
  54394. _isNgModelRequired: function() {
  54395. return (this._componentClass.subclassOf(_editor2.default) || this._componentClass.prototype instanceof _editor2.default) && this._ngModel
  54396. },
  54397. _initComponentBindings: function() {
  54398. this.callBase.apply(this, arguments);
  54399. this._initNgModelBinding()
  54400. },
  54401. _initNgModelBinding: function() {
  54402. var _this9 = this;
  54403. if (!this._isNgModelRequired()) {
  54404. return
  54405. }
  54406. var clearNgModelWatcher = this._scope.$watch(this._ngModel, function(newValue, oldValue) {
  54407. if (_this9._ngLocker.locked(NG_MODEL_OPTION)) {
  54408. return
  54409. }
  54410. if (newValue === oldValue) {
  54411. return
  54412. }
  54413. _this9._component.option(NG_MODEL_OPTION, newValue)
  54414. });
  54415. this._optionChangedCallbacks.add(function(args) {
  54416. _this9._ngLocker.obtain(NG_MODEL_OPTION);
  54417. try {
  54418. if (args.name !== NG_MODEL_OPTION) {
  54419. return
  54420. }
  54421. _this9._ngModelController.$setViewValue(args.value)
  54422. } finally {
  54423. if (_this9._ngLocker.locked(NG_MODEL_OPTION)) {
  54424. _this9._ngLocker.release(NG_MODEL_OPTION)
  54425. }
  54426. }
  54427. });
  54428. this._componentDisposing.add(clearNgModelWatcher)
  54429. },
  54430. _evalOptions: function() {
  54431. if (!this._isNgModelRequired()) {
  54432. return this.callBase.apply(this, arguments)
  54433. }
  54434. var result = this.callBase.apply(this, arguments);
  54435. result[NG_MODEL_OPTION] = this._parse(this._ngModel)(this._scope);
  54436. return result
  54437. }
  54438. });
  54439. var registeredComponents = {};
  54440. var registerComponentDirective = function(name) {
  54441. var priority = "dxValidator" !== name ? 1 : 10;
  54442. _module2.default.directive(name, ["$compile", "$parse", "dxDigestCallbacks", function($compile, $parse, dxDigestCallbacks) {
  54443. return {
  54444. restrict: "A",
  54445. require: "^?ngModel",
  54446. priority: priority,
  54447. compile: function($element) {
  54448. var componentClass = registeredComponents[name];
  54449. var $content = componentClass.subclassOf(_ui2.default) ? $element.contents().detach() : null;
  54450. return function(scope, $element, attrs, ngModelController, transcludeFn) {
  54451. $element.append($content);
  54452. safeApply(function() {
  54453. new ComponentBuilder({
  54454. componentClass: componentClass,
  54455. componentName: name,
  54456. compile: $compile,
  54457. parse: $parse,
  54458. $element: $element,
  54459. scope: scope,
  54460. ngOptionsString: attrs[name],
  54461. ngOptions: attrs[name] ? scope.$eval(attrs[name]) : {},
  54462. ngModel: attrs.ngModel,
  54463. ngModelController: ngModelController,
  54464. transcludeFn: transcludeFn,
  54465. itemAlias: attrs[ITEM_ALIAS_ATTRIBUTE_NAME],
  54466. dxDigestCallbacks: dxDigestCallbacks
  54467. })
  54468. }, scope)
  54469. }
  54470. }
  54471. }
  54472. }])
  54473. };
  54474. _component_registrator_callbacks2.default.add(function(name, componentClass) {
  54475. if (!registeredComponents[name]) {
  54476. registerComponentDirective(name)
  54477. }
  54478. registeredComponents[name] = componentClass
  54479. })
  54480. },
  54481. /*!****************************************************!*\
  54482. !*** ./artifacts/transpiled/ui/widget/template.js ***!
  54483. \****************************************************/
  54484. /*! dynamic exports provided */
  54485. /*! all exports used */
  54486. function(module, exports, __webpack_require__) {
  54487. var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
  54488. var _renderer2 = _interopRequireDefault(_renderer);
  54489. var _ui = __webpack_require__( /*! ./ui.template_base */ 74);
  54490. var _ui2 = _interopRequireDefault(_ui);
  54491. var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12);
  54492. var _template_engine_registry = __webpack_require__( /*! ./template_engine_registry */ 210);
  54493. __webpack_require__( /*! ./template_engines */ 463);
  54494. function _interopRequireDefault(obj) {
  54495. return obj && obj.__esModule ? obj : {
  54496. "default": obj
  54497. }
  54498. }(0, _template_engine_registry.registerTemplateEngine)("default", {
  54499. compile: function(element) {
  54500. return (0, _dom.normalizeTemplateElement)(element)
  54501. },
  54502. render: function(template, model, index) {
  54503. return template.clone()
  54504. }
  54505. });
  54506. (0, _template_engine_registry.setTemplateEngine)("default");
  54507. var Template = _ui2.default.inherit({
  54508. ctor: function(element) {
  54509. this._element = element
  54510. },
  54511. _renderCore: function(options) {
  54512. var transclude = options.transclude;
  54513. if (!transclude && !this._compiledTemplate) {
  54514. this._compiledTemplate = (0, _template_engine_registry.getCurrentTemplateEngine)().compile(this._element)
  54515. }
  54516. return (0, _renderer2.default)("<div>").append(transclude ? this._element : (0, _template_engine_registry.getCurrentTemplateEngine)().render(this._compiledTemplate, options.model, options.index)).contents()
  54517. },
  54518. source: function() {
  54519. return (0, _renderer2.default)(this._element).clone()
  54520. }
  54521. });
  54522. module.exports = Template
  54523. },
  54524. /*!************************************************************!*\
  54525. !*** ./artifacts/transpiled/ui/widget/template_engines.js ***!
  54526. \************************************************************/
  54527. /*! dynamic exports provided */
  54528. /*! all exports used */
  54529. function(module, exports, __webpack_require__) {
  54530. var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12);
  54531. var _template_engine_registry = __webpack_require__( /*! ./template_engine_registry */ 210);
  54532. (0, _template_engine_registry.registerTemplateEngine)("jquery-tmpl", {
  54533. compile: function(element) {
  54534. return (0, _dom.extractTemplateMarkup)(element)
  54535. },
  54536. render: function(template, data) {
  54537. return jQuery.tmpl(template, data)
  54538. }
  54539. });
  54540. (0, _template_engine_registry.registerTemplateEngine)("jsrender", {
  54541. compile: function(element) {
  54542. return (jQuery ? jQuery : jsrender).templates((0, _dom.extractTemplateMarkup)(element))
  54543. },
  54544. render: function(template, data) {
  54545. return template.render(data)
  54546. }
  54547. });
  54548. (0, _template_engine_registry.registerTemplateEngine)("mustache", {
  54549. compile: function(element) {
  54550. return (0, _dom.extractTemplateMarkup)(element)
  54551. },
  54552. render: function(template, data) {
  54553. return Mustache.render(template, data)
  54554. }
  54555. });
  54556. (0, _template_engine_registry.registerTemplateEngine)("hogan", {
  54557. compile: function(element) {
  54558. return Hogan.compile((0, _dom.extractTemplateMarkup)(element))
  54559. },
  54560. render: function(template, data) {
  54561. return template.render(data)
  54562. }
  54563. });
  54564. (0, _template_engine_registry.registerTemplateEngine)("underscore", {
  54565. compile: function(element) {
  54566. return _.template((0, _dom.extractTemplateMarkup)(element))
  54567. },
  54568. render: function(template, data) {
  54569. return template(data)
  54570. }
  54571. });
  54572. (0, _template_engine_registry.registerTemplateEngine)("handlebars", {
  54573. compile: function(element) {
  54574. return Handlebars.compile((0, _dom.extractTemplateMarkup)(element))
  54575. },
  54576. render: function(template, data) {
  54577. return template(data)
  54578. }
  54579. });
  54580. (0, _template_engine_registry.registerTemplateEngine)("doT", {
  54581. compile: function(element) {
  54582. return doT.template((0, _dom.extractTemplateMarkup)(element))
  54583. },
  54584. render: function(template, data) {
  54585. return template(data)
  54586. }
  54587. })
  54588. },
  54589. /*!*******************************************************!*\
  54590. !*** ./artifacts/transpiled/ui/overlay/ui.overlay.js ***!
  54591. \*******************************************************/
  54592. /*! dynamic exports provided */
  54593. /*! all exports used */
  54594. function(module, exports, __webpack_require__) {
  54595. function _typeof(obj) {
  54596. "@babel/helpers - typeof";
  54597. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  54598. return typeof obj
  54599. } : function(obj) {
  54600. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  54601. }, _typeof(obj)
  54602. }
  54603. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  54604. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  54605. var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
  54606. var ready = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48).add;
  54607. var window = windowUtils.getWindow();
  54608. var navigator = windowUtils.getNavigator();
  54609. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  54610. var fx = __webpack_require__( /*! ../../animation/fx */ 38);
  54611. var translator = __webpack_require__( /*! ../../animation/translator */ 27);
  54612. var compareVersions = __webpack_require__( /*! ../../core/utils/version */ 61).compare;
  54613. var viewPortUtils = __webpack_require__( /*! ../../core/utils/view_port */ 78);
  54614. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  54615. var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  54616. var getPublicElement = __webpack_require__( /*! ../../core/utils/dom */ 12).getPublicElement;
  54617. var viewPortChanged = viewPortUtils.changeCallback;
  54618. var hideTopOverlayCallback = __webpack_require__( /*! ../../mobile/hide_top_overlay */ 213).hideCallback;
  54619. var positionUtils = __webpack_require__( /*! ../../animation/position */ 77);
  54620. var fitIntoRange = __webpack_require__( /*! ../../core/utils/math */ 28).fitIntoRange;
  54621. var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
  54622. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  54623. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  54624. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  54625. var devices = __webpack_require__( /*! ../../core/devices */ 16);
  54626. var browser = __webpack_require__( /*! ../../core/utils/browser */ 25);
  54627. var registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9);
  54628. var Widget = __webpack_require__( /*! ../widget/ui.widget */ 18);
  54629. var KeyboardProcessor = __webpack_require__( /*! ../widget/ui.keyboard_processor */ 167);
  54630. var selectors = __webpack_require__( /*! ../widget/selectors */ 66);
  54631. var dragEvents = __webpack_require__( /*! ../../events/drag */ 56);
  54632. var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
  54633. var pointerEvents = __webpack_require__( /*! ../../events/pointer */ 23);
  54634. var Resizable = __webpack_require__( /*! ../resizable */ 173);
  54635. var EmptyTemplate = __webpack_require__( /*! ../widget/empty_template */ 109);
  54636. var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred;
  54637. var zIndexPool = __webpack_require__( /*! ./z_index */ 465);
  54638. var swatch = __webpack_require__( /*! ../widget/swatch_container */ 150);
  54639. var OVERLAY_CLASS = "dx-overlay";
  54640. var OVERLAY_WRAPPER_CLASS = "dx-overlay-wrapper";
  54641. var OVERLAY_CONTENT_CLASS = "dx-overlay-content";
  54642. var OVERLAY_SHADER_CLASS = "dx-overlay-shader";
  54643. var OVERLAY_MODAL_CLASS = "dx-overlay-modal";
  54644. var INNER_OVERLAY_CLASS = "dx-inner-overlay";
  54645. var INVISIBLE_STATE_CLASS = "dx-state-invisible";
  54646. var ANONYMOUS_TEMPLATE_NAME = "content";
  54647. var RTL_DIRECTION_CLASS = "dx-rtl";
  54648. var ACTIONS = ["onShowing", "onShown", "onHiding", "onHidden", "onPositioning", "onPositioned", "onResizeStart", "onResize", "onResizeEnd"];
  54649. var OVERLAY_STACK = [];
  54650. var DISABLED_STATE_CLASS = "dx-state-disabled";
  54651. var PREVENT_SAFARI_SCROLLING_CLASS = "dx-prevent-safari-scrolling";
  54652. var TAB_KEY = "tab";
  54653. var POSITION_ALIASES = {
  54654. top: {
  54655. my: "top center",
  54656. at: "top center"
  54657. },
  54658. bottom: {
  54659. my: "bottom center",
  54660. at: "bottom center"
  54661. },
  54662. right: {
  54663. my: "right center",
  54664. at: "right center"
  54665. },
  54666. left: {
  54667. my: "left center",
  54668. at: "left center"
  54669. },
  54670. center: {
  54671. my: "center",
  54672. at: "center"
  54673. },
  54674. "right bottom": {
  54675. my: "right bottom",
  54676. at: "right bottom"
  54677. },
  54678. "right top": {
  54679. my: "right top",
  54680. at: "right top"
  54681. },
  54682. "left bottom": {
  54683. my: "left bottom",
  54684. at: "left bottom"
  54685. },
  54686. "left top": {
  54687. my: "left top",
  54688. at: "left top"
  54689. }
  54690. };
  54691. var realDevice = devices.real();
  54692. var realVersion = realDevice.version;
  54693. var firefoxDesktop = browser.mozilla && "desktop" === realDevice.deviceType;
  54694. var iOS = "ios" === realDevice.platform;
  54695. var hasSafariAddressBar = browser.safari && "desktop" !== realDevice.deviceType;
  54696. var iOS7_0andBelow = iOS && compareVersions(realVersion, [7, 1]) < 0;
  54697. var android4_0nativeBrowser = "android" === realDevice.platform && 0 === compareVersions(realVersion, [4, 0], 2) && navigator.userAgent.indexOf("Chrome") === -1;
  54698. var forceRepaint = function($element) {
  54699. if (iOS7_0andBelow || firefoxDesktop) {
  54700. $element.width()
  54701. }
  54702. if (android4_0nativeBrowser) {
  54703. var $parents = $element.parents();
  54704. var inScrollView = $parents.is(".dx-scrollable-native");
  54705. if (!inScrollView) {
  54706. $parents.css("backfaceVisibility", "hidden");
  54707. $parents.css("backfaceVisibility");
  54708. $parents.css("backfaceVisibility", "visible")
  54709. }
  54710. }
  54711. };
  54712. var getElement = function(value) {
  54713. return value && $(value.target || value)
  54714. };
  54715. ready(function() {
  54716. eventsEngine.subscribeGlobal(domAdapter.getDocument(), pointerEvents.down, function(e) {
  54717. for (var i = OVERLAY_STACK.length - 1; i >= 0; i--) {
  54718. if (!OVERLAY_STACK[i]._proxiedDocumentDownHandler(e)) {
  54719. return
  54720. }
  54721. }
  54722. })
  54723. });
  54724. var Overlay = Widget.inherit({
  54725. _supportedKeys: function() {
  54726. var offsetSize = 5;
  54727. var move = function(top, left, e) {
  54728. if (!this.option("dragEnabled")) {
  54729. return
  54730. }
  54731. e.preventDefault();
  54732. e.stopPropagation();
  54733. var allowedOffsets = this._allowedOffsets();
  54734. var offset = {
  54735. top: fitIntoRange(top, -allowedOffsets.top, allowedOffsets.bottom),
  54736. left: fitIntoRange(left, -allowedOffsets.left, allowedOffsets.right)
  54737. };
  54738. this._changePosition(offset)
  54739. };
  54740. return extend(this.callBase(), {
  54741. escape: function() {
  54742. this.hide()
  54743. },
  54744. upArrow: move.bind(this, -offsetSize, 0),
  54745. downArrow: move.bind(this, offsetSize, 0),
  54746. leftArrow: move.bind(this, 0, -offsetSize),
  54747. rightArrow: move.bind(this, 0, offsetSize)
  54748. })
  54749. },
  54750. _getDefaultOptions: function() {
  54751. return extend(this.callBase(), {
  54752. activeStateEnabled: false,
  54753. visible: false,
  54754. deferRendering: true,
  54755. shading: true,
  54756. shadingColor: "",
  54757. position: {
  54758. my: "center",
  54759. at: "center"
  54760. },
  54761. width: function() {
  54762. return .8 * $(window).width()
  54763. },
  54764. minWidth: null,
  54765. maxWidth: null,
  54766. height: function() {
  54767. return .8 * $(window).height()
  54768. },
  54769. minHeight: null,
  54770. maxHeight: null,
  54771. animation: {
  54772. show: {
  54773. type: "pop",
  54774. duration: 300,
  54775. from: {
  54776. scale: .55
  54777. }
  54778. },
  54779. hide: {
  54780. type: "pop",
  54781. duration: 300,
  54782. to: {
  54783. opacity: 0,
  54784. scale: .55
  54785. },
  54786. from: {
  54787. opacity: 1,
  54788. scale: 1
  54789. }
  54790. }
  54791. },
  54792. closeOnOutsideClick: false,
  54793. closeOnBackButton: true,
  54794. onShowing: null,
  54795. onShown: null,
  54796. onHiding: null,
  54797. onHidden: null,
  54798. contentTemplate: "content",
  54799. dragEnabled: false,
  54800. resizeEnabled: false,
  54801. onResizeStart: null,
  54802. onResize: null,
  54803. onResizeEnd: null,
  54804. innerOverlay: false,
  54805. target: void 0,
  54806. container: void 0,
  54807. hideTopOverlayHandler: void 0,
  54808. closeOnTargetScroll: false,
  54809. onPositioned: null,
  54810. boundaryOffset: {
  54811. h: 0,
  54812. v: 0
  54813. },
  54814. propagateOutsideClick: false,
  54815. ignoreChildEvents: true,
  54816. _checkParentVisibility: true
  54817. })
  54818. },
  54819. _defaultOptionsRules: function() {
  54820. return this.callBase().concat([{
  54821. device: function() {
  54822. var realDevice = devices.real();
  54823. var realPlatform = realDevice.platform;
  54824. var realVersion = realDevice.version;
  54825. return "android" === realPlatform && compareVersions(realVersion, [4, 2]) < 0
  54826. },
  54827. options: {
  54828. animation: {
  54829. show: {
  54830. type: "fade",
  54831. duration: 400
  54832. },
  54833. hide: {
  54834. type: "fade",
  54835. duration: 400,
  54836. to: {
  54837. opacity: 0
  54838. },
  54839. from: {
  54840. opacity: 1
  54841. }
  54842. }
  54843. }
  54844. }
  54845. }, {
  54846. device: function() {
  54847. return !windowUtils.hasWindow()
  54848. },
  54849. options: {
  54850. width: null,
  54851. height: null,
  54852. animation: null,
  54853. _checkParentVisibility: false
  54854. }
  54855. }])
  54856. },
  54857. _setOptionsByReference: function() {
  54858. this.callBase();
  54859. extend(this._optionsByReference, {
  54860. animation: true
  54861. })
  54862. },
  54863. _getAnonymousTemplateName: function() {
  54864. return ANONYMOUS_TEMPLATE_NAME
  54865. },
  54866. _wrapper: function() {
  54867. return this._$wrapper
  54868. },
  54869. _container: function() {
  54870. return this._$content
  54871. },
  54872. _eventBindingTarget: function() {
  54873. return this._$content
  54874. },
  54875. _init: function() {
  54876. this.callBase();
  54877. this._initActions();
  54878. this._initCloseOnOutsideClickHandler();
  54879. this._initTabTerminatorHandler();
  54880. this._$wrapper = $("<div>").addClass(OVERLAY_WRAPPER_CLASS);
  54881. this._$content = $("<div>").addClass(OVERLAY_CONTENT_CLASS);
  54882. this._initInnerOverlayClass();
  54883. var $element = this.$element();
  54884. this._$wrapper.addClass($element.attr("class"));
  54885. $element.addClass(OVERLAY_CLASS);
  54886. this._$wrapper.attr("data-bind", "dxControlsDescendantBindings: true");
  54887. eventsEngine.on(this._$wrapper, "MSPointerDown", noop);
  54888. eventsEngine.on(this._$wrapper, "focusin", function(e) {
  54889. e.stopPropagation()
  54890. });
  54891. this._toggleViewPortSubscription(true)
  54892. },
  54893. _initOptions: function(options) {
  54894. this._initTarget(options.target);
  54895. var container = void 0 === options.container ? this.option("container") : options.container;
  54896. this._initContainer(container);
  54897. this._initHideTopOverlayHandler(options.hideTopOverlayHandler);
  54898. this.callBase(options)
  54899. },
  54900. _initInnerOverlayClass: function() {
  54901. this._$content.toggleClass(INNER_OVERLAY_CLASS, this.option("innerOverlay"))
  54902. },
  54903. _initTarget: function(target) {
  54904. if (!typeUtils.isDefined(target)) {
  54905. return
  54906. }
  54907. var options = this.option();
  54908. each(["position.of", "animation.show.from.position.of", "animation.show.to.position.of", "animation.hide.from.position.of", "animation.hide.to.position.of"], function(_, path) {
  54909. var pathParts = path.split(".");
  54910. var option = options;
  54911. while (option) {
  54912. if (1 === pathParts.length) {
  54913. if (typeUtils.isPlainObject(option)) {
  54914. option[pathParts.shift()] = target
  54915. }
  54916. break
  54917. } else {
  54918. option = option[pathParts.shift()]
  54919. }
  54920. }
  54921. })
  54922. },
  54923. _initContainer: function(container) {
  54924. container = void 0 === container ? viewPortUtils.value() : container;
  54925. var $element = this.$element();
  54926. var $container = $element.closest(container);
  54927. if (!$container.length) {
  54928. $container = $(container).first()
  54929. }
  54930. this._$container = $container.length ? $container : $element.parent()
  54931. },
  54932. _initHideTopOverlayHandler: function(handler) {
  54933. this._hideTopOverlayHandler = void 0 !== handler ? handler : this._defaultHideTopOverlayHandler.bind(this)
  54934. },
  54935. _defaultHideTopOverlayHandler: function() {
  54936. this.hide()
  54937. },
  54938. _initActions: function() {
  54939. this._actions = {};
  54940. each(ACTIONS, function(_, action) {
  54941. this._actions[action] = this._createActionByOption(action, {
  54942. excludeValidators: ["disabled", "readOnly"]
  54943. }) || noop
  54944. }.bind(this))
  54945. },
  54946. _initCloseOnOutsideClickHandler: function() {
  54947. var that = this;
  54948. this._proxiedDocumentDownHandler = function() {
  54949. return that._documentDownHandler.apply(that, arguments)
  54950. }
  54951. },
  54952. _documentDownHandler: function(e) {
  54953. if (this._showAnimationProcessing) {
  54954. this._stopAnimation()
  54955. }
  54956. var closeOnOutsideClick = this.option("closeOnOutsideClick");
  54957. if (typeUtils.isFunction(closeOnOutsideClick)) {
  54958. closeOnOutsideClick = closeOnOutsideClick(e)
  54959. }
  54960. var $container = this._$content;
  54961. var isAttachedTarget = $(window.document).is(e.target) || domUtils.contains(window.document, e.target);
  54962. var isInnerOverlay = $(e.target).closest("." + INNER_OVERLAY_CLASS).length;
  54963. var outsideClick = isAttachedTarget && !isInnerOverlay && !($container.is(e.target) || domUtils.contains($container.get(0), e.target));
  54964. if (outsideClick && closeOnOutsideClick) {
  54965. if (this.option("shading")) {
  54966. e.preventDefault()
  54967. }
  54968. this.hide()
  54969. }
  54970. return this.option("propagateOutsideClick")
  54971. },
  54972. _initTemplates: function() {
  54973. this.callBase();
  54974. this._defaultTemplates.content = new EmptyTemplate(this)
  54975. },
  54976. _isTopOverlay: function() {
  54977. var overlayStack = this._overlayStack();
  54978. for (var i = overlayStack.length - 1; i >= 0; i--) {
  54979. var tabbableElements = overlayStack[i]._findTabbableBounds();
  54980. if (tabbableElements.first || tabbableElements.last) {
  54981. return overlayStack[i] === this
  54982. }
  54983. }
  54984. return false
  54985. },
  54986. _overlayStack: function() {
  54987. return OVERLAY_STACK
  54988. },
  54989. _zIndexInitValue: function() {
  54990. return Overlay.baseZIndex()
  54991. },
  54992. _toggleViewPortSubscription: function(toggle) {
  54993. viewPortChanged.remove(this._viewPortChangeHandle);
  54994. if (toggle) {
  54995. this._viewPortChangeHandle = this._viewPortChangeHandler.bind(this);
  54996. viewPortChanged.add(this._viewPortChangeHandle)
  54997. }
  54998. },
  54999. _viewPortChangeHandler: function() {
  55000. this._initContainer(this.option("container"));
  55001. this._refresh()
  55002. },
  55003. _renderVisibilityAnimate: function(visible) {
  55004. this._stopAnimation();
  55005. return visible ? this._show() : this._hide()
  55006. },
  55007. _normalizePosition: function() {
  55008. var position = this.option("position");
  55009. this._position = "function" === typeof position ? position() : position
  55010. },
  55011. _getAnimationConfig: function() {
  55012. var animation = this.option("animation");
  55013. if (typeUtils.isFunction(animation)) {
  55014. animation = animation.call(this)
  55015. }
  55016. return animation
  55017. },
  55018. _show: function() {
  55019. var that = this;
  55020. var deferred = new Deferred;
  55021. this._parentHidden = this._isParentHidden();
  55022. deferred.done(function() {
  55023. delete that._parentHidden
  55024. });
  55025. if (this._parentHidden) {
  55026. this._isHidden = true;
  55027. return deferred.resolve()
  55028. }
  55029. if (this._currentVisible) {
  55030. return (new Deferred).resolve().promise()
  55031. }
  55032. this._currentVisible = true;
  55033. this._isShown = false;
  55034. this._normalizePosition();
  55035. var animation = that._getAnimationConfig() || {};
  55036. var showAnimation = this._normalizeAnimation(animation.show, "to");
  55037. var startShowAnimation = showAnimation && showAnimation.start || noop;
  55038. var completeShowAnimation = showAnimation && showAnimation.complete || noop;
  55039. if (this._isHidingActionCanceled) {
  55040. delete this._isHidingActionCanceled;
  55041. deferred.resolve()
  55042. } else {
  55043. var show = function() {
  55044. this._renderVisibility(true);
  55045. if (this._isShowingActionCanceled) {
  55046. delete this._isShowingActionCanceled;
  55047. deferred.resolve();
  55048. return
  55049. }
  55050. this._animate(showAnimation, function() {
  55051. if (that.option("focusStateEnabled")) {
  55052. eventsEngine.trigger(that._focusTarget(), "focus")
  55053. }
  55054. completeShowAnimation.apply(this, arguments);
  55055. that._showAnimationProcessing = false;
  55056. that._isShown = true;
  55057. that._actions.onShown();
  55058. that._toggleSafariScrolling(false);
  55059. deferred.resolve()
  55060. }, function() {
  55061. startShowAnimation.apply(this, arguments);
  55062. that._showAnimationProcessing = true
  55063. })
  55064. }.bind(this);
  55065. if (this.option("templatesRenderAsynchronously")) {
  55066. this._stopShowTimer();
  55067. this._asyncShowTimeout = setTimeout(show)
  55068. } else {
  55069. show()
  55070. }
  55071. }
  55072. return deferred.promise()
  55073. },
  55074. _normalizeAnimation: function(animation, prop) {
  55075. if (animation) {
  55076. animation = extend({
  55077. type: "slide"
  55078. }, animation);
  55079. if (animation[prop] && "object" === _typeof(animation[prop])) {
  55080. extend(animation[prop], {
  55081. position: this._position
  55082. })
  55083. }
  55084. }
  55085. return animation
  55086. },
  55087. _hide: function() {
  55088. if (!this._currentVisible) {
  55089. return (new Deferred).resolve().promise()
  55090. }
  55091. this._currentVisible = false;
  55092. var that = this;
  55093. var deferred = new Deferred;
  55094. var animation = that._getAnimationConfig() || {};
  55095. var hideAnimation = this._normalizeAnimation(animation.hide, "from");
  55096. var startHideAnimation = hideAnimation && hideAnimation.start || noop;
  55097. var completeHideAnimation = hideAnimation && hideAnimation.complete || noop;
  55098. var hidingArgs = {
  55099. cancel: false
  55100. };
  55101. if (this._isShowingActionCanceled) {
  55102. deferred.resolve()
  55103. } else {
  55104. this._actions.onHiding(hidingArgs);
  55105. that._toggleSafariScrolling(true);
  55106. if (hidingArgs.cancel) {
  55107. this._isHidingActionCanceled = true;
  55108. this.option("visible", true);
  55109. deferred.resolve()
  55110. } else {
  55111. this._forceFocusLost();
  55112. this._toggleShading(false);
  55113. this._toggleSubscriptions(false);
  55114. this._stopShowTimer();
  55115. this._animate(hideAnimation, function() {
  55116. that._$content.css("pointerEvents", "");
  55117. that._renderVisibility(false);
  55118. completeHideAnimation.apply(this, arguments);
  55119. that._actions.onHidden();
  55120. deferred.resolve()
  55121. }, function() {
  55122. that._$content.css("pointerEvents", "none");
  55123. startHideAnimation.apply(this, arguments)
  55124. })
  55125. }
  55126. }
  55127. return deferred.promise()
  55128. },
  55129. _forceFocusLost: function() {
  55130. var activeElement = domAdapter.getActiveElement();
  55131. var shouldResetActiveElement = !!this._$content.find(activeElement).length;
  55132. if (shouldResetActiveElement) {
  55133. domUtils.resetActiveElement()
  55134. }
  55135. },
  55136. _animate: function(animation, completeCallback, startCallback) {
  55137. if (animation) {
  55138. startCallback = startCallback || animation.start || noop;
  55139. fx.animate(this._$content, extend({}, animation, {
  55140. start: startCallback,
  55141. complete: completeCallback
  55142. }))
  55143. } else {
  55144. completeCallback()
  55145. }
  55146. },
  55147. _stopAnimation: function() {
  55148. fx.stop(this._$content, true)
  55149. },
  55150. _renderVisibility: function(visible) {
  55151. if (visible && this._isParentHidden()) {
  55152. return
  55153. }
  55154. this._currentVisible = visible;
  55155. this._stopAnimation();
  55156. if (!visible) {
  55157. domUtils.triggerHidingEvent(this._$content)
  55158. }
  55159. this._toggleVisibility(visible);
  55160. this._$content.toggleClass(INVISIBLE_STATE_CLASS, !visible);
  55161. this._updateZIndexStackPosition(visible);
  55162. if (visible) {
  55163. this._renderContent();
  55164. var showingArgs = {
  55165. cancel: false
  55166. };
  55167. this._actions.onShowing(showingArgs);
  55168. if (showingArgs.cancel) {
  55169. this._toggleVisibility(false);
  55170. this._$content.toggleClass(INVISIBLE_STATE_CLASS, true);
  55171. this._updateZIndexStackPosition(false);
  55172. this._moveFromContainer();
  55173. this._isShowingActionCanceled = true;
  55174. this.option("visible", false);
  55175. return
  55176. }
  55177. this._moveToContainer();
  55178. this._renderGeometry();
  55179. domUtils.triggerShownEvent(this._$content);
  55180. domUtils.triggerResizeEvent(this._$content)
  55181. } else {
  55182. this._moveFromContainer()
  55183. }
  55184. this._toggleShading(visible);
  55185. this._toggleSubscriptions(visible)
  55186. },
  55187. _updateZIndexStackPosition: function(pushToStack) {
  55188. var overlayStack = this._overlayStack();
  55189. var index = inArray(this, overlayStack);
  55190. if (pushToStack) {
  55191. if (index === -1) {
  55192. this._zIndex = zIndexPool.create(this._zIndexInitValue());
  55193. overlayStack.push(this)
  55194. }
  55195. this._$wrapper.css("zIndex", this._zIndex);
  55196. this._$content.css("zIndex", this._zIndex)
  55197. } else {
  55198. if (index !== -1) {
  55199. overlayStack.splice(index, 1);
  55200. zIndexPool.remove(this._zIndex)
  55201. }
  55202. }
  55203. },
  55204. _toggleShading: function(visible) {
  55205. this._$wrapper.toggleClass(OVERLAY_MODAL_CLASS, this.option("shading") && !this.option("container"));
  55206. this._$wrapper.toggleClass(OVERLAY_SHADER_CLASS, visible && this.option("shading"));
  55207. this._$wrapper.css("backgroundColor", this.option("shading") ? this.option("shadingColor") : "");
  55208. this._toggleTabTerminator(visible && this.option("shading"))
  55209. },
  55210. _initTabTerminatorHandler: function() {
  55211. var that = this;
  55212. this._proxiedTabTerminatorHandler = function() {
  55213. that._tabKeyHandler.apply(that, arguments)
  55214. }
  55215. },
  55216. _toggleTabTerminator: function(enabled) {
  55217. var eventName = eventUtils.addNamespace("keydown", this.NAME);
  55218. if (enabled) {
  55219. eventsEngine.on(domAdapter.getDocument(), eventName, this._proxiedTabTerminatorHandler)
  55220. } else {
  55221. eventsEngine.off(domAdapter.getDocument(), eventName, this._proxiedTabTerminatorHandler)
  55222. }
  55223. },
  55224. _findTabbableBounds: function() {
  55225. var $elements = this._$wrapper.find("*");
  55226. var elementsCount = $elements.length - 1;
  55227. var result = {
  55228. first: null,
  55229. last: null
  55230. };
  55231. for (var i = 0; i <= elementsCount; i++) {
  55232. if (!result.first && $elements.eq(i).is(selectors.tabbable)) {
  55233. result.first = $elements.eq(i)
  55234. }
  55235. if (!result.last && $elements.eq(elementsCount - i).is(selectors.tabbable)) {
  55236. result.last = $elements.eq(elementsCount - i)
  55237. }
  55238. if (result.first && result.last) {
  55239. break
  55240. }
  55241. }
  55242. return result
  55243. },
  55244. _tabKeyHandler: function(e) {
  55245. if (eventUtils.normalizeKeyName(e) !== TAB_KEY || !this._isTopOverlay()) {
  55246. return
  55247. }
  55248. var tabbableElements = this._findTabbableBounds();
  55249. var $firstTabbable = tabbableElements.first;
  55250. var $lastTabbable = tabbableElements.last;
  55251. var isTabOnLast = !e.shiftKey && e.target === $lastTabbable.get(0);
  55252. var isShiftTabOnFirst = e.shiftKey && e.target === $firstTabbable.get(0);
  55253. var isEmptyTabList = 0 === tabbableElements.length;
  55254. var isOutsideTarget = !domUtils.contains(this._$wrapper.get(0), e.target);
  55255. if (isTabOnLast || isShiftTabOnFirst || isEmptyTabList || isOutsideTarget) {
  55256. e.preventDefault();
  55257. var $focusElement = e.shiftKey ? $lastTabbable : $firstTabbable;
  55258. eventsEngine.trigger($focusElement, "focusin");
  55259. eventsEngine.trigger($focusElement, "focus")
  55260. }
  55261. },
  55262. _toggleSubscriptions: function(enabled) {
  55263. if (windowUtils.hasWindow()) {
  55264. this._toggleHideTopOverlayCallback(enabled);
  55265. this._toggleParentsScrollSubscription(enabled)
  55266. }
  55267. },
  55268. _toggleHideTopOverlayCallback: function(subscribe) {
  55269. if (!this._hideTopOverlayHandler) {
  55270. return
  55271. }
  55272. if (subscribe && this.option("closeOnBackButton")) {
  55273. hideTopOverlayCallback.add(this._hideTopOverlayHandler)
  55274. } else {
  55275. hideTopOverlayCallback.remove(this._hideTopOverlayHandler)
  55276. }
  55277. },
  55278. _toggleParentsScrollSubscription: function(subscribe) {
  55279. if (!this._position) {
  55280. return
  55281. }
  55282. var target = this._position.of || $();
  55283. var closeOnScroll = this.option("closeOnTargetScroll");
  55284. var $parents = getElement(target).parents();
  55285. var scrollEvent = eventUtils.addNamespace("scroll", this.NAME);
  55286. if ("generic" === devices.real().platform) {
  55287. $parents = $parents.add(window)
  55288. }
  55289. this._proxiedTargetParentsScrollHandler = this._proxiedTargetParentsScrollHandler || function(e) {
  55290. this._targetParentsScrollHandler(e)
  55291. }.bind(this);
  55292. eventsEngine.off($().add(this._$prevTargetParents), scrollEvent, this._proxiedTargetParentsScrollHandler);
  55293. if (subscribe && closeOnScroll) {
  55294. eventsEngine.on($parents, scrollEvent, this._proxiedTargetParentsScrollHandler);
  55295. this._$prevTargetParents = $parents
  55296. }
  55297. },
  55298. _targetParentsScrollHandler: function(e) {
  55299. var closeHandled = false;
  55300. var closeOnScroll = this.option("closeOnTargetScroll");
  55301. if (typeUtils.isFunction(closeOnScroll)) {
  55302. closeHandled = closeOnScroll(e)
  55303. }
  55304. if (!closeHandled && !this._showAnimationProcessing) {
  55305. this.hide()
  55306. }
  55307. },
  55308. _render: function() {
  55309. this.callBase();
  55310. this._appendContentToElement();
  55311. this._renderVisibilityAnimate(this.option("visible"))
  55312. },
  55313. _appendContentToElement: function() {
  55314. if (!this._$content.parent().is(this.$element())) {
  55315. this._$content.appendTo(this.$element())
  55316. }
  55317. },
  55318. _renderContent: function() {
  55319. var shouldDeferRendering = !this._currentVisible && this.option("deferRendering");
  55320. var isParentHidden = this.option("visible") && this._isParentHidden();
  55321. if (isParentHidden) {
  55322. this._isHidden = true;
  55323. return
  55324. }
  55325. if (this._contentAlreadyRendered || shouldDeferRendering) {
  55326. return
  55327. }
  55328. this._contentAlreadyRendered = true;
  55329. this._appendContentToElement();
  55330. this.callBase()
  55331. },
  55332. _isParentHidden: function() {
  55333. if (!this.option("_checkParentVisibility")) {
  55334. return false
  55335. }
  55336. if (void 0 !== this._parentHidden) {
  55337. return this._parentHidden
  55338. }
  55339. var $parent = this.$element().parent();
  55340. if ($parent.is(":visible")) {
  55341. return false
  55342. }
  55343. var isHidden = false;
  55344. $parent.add($parent.parents()).each(function() {
  55345. var $element = $(this);
  55346. if ("none" === $element.css("display")) {
  55347. isHidden = true;
  55348. return false
  55349. }
  55350. });
  55351. return isHidden || !domAdapter.getBody().contains($parent.get(0))
  55352. },
  55353. _renderContentImpl: function() {
  55354. var _this = this;
  55355. var whenContentRendered = new Deferred;
  55356. var contentTemplateOption = this.option("contentTemplate");
  55357. var contentTemplate = this._getTemplate(contentTemplateOption);
  55358. var transclude = this._getAnonymousTemplateName() === contentTemplateOption;
  55359. contentTemplate && contentTemplate.render({
  55360. container: getPublicElement(this.$content()),
  55361. noModel: true,
  55362. transclude: transclude,
  55363. onRendered: function() {
  55364. whenContentRendered.resolve()
  55365. }
  55366. });
  55367. this._renderDrag();
  55368. this._renderResize();
  55369. this._renderScrollTerminator();
  55370. whenContentRendered.done(function() {
  55371. if (_this.option("visible")) {
  55372. _this._moveToContainer()
  55373. }
  55374. });
  55375. return whenContentRendered.promise()
  55376. },
  55377. _renderDrag: function() {
  55378. var $dragTarget = this._getDragTarget();
  55379. if (!$dragTarget) {
  55380. return
  55381. }
  55382. var startEventName = eventUtils.addNamespace(dragEvents.start, this.NAME);
  55383. var updateEventName = eventUtils.addNamespace(dragEvents.move, this.NAME);
  55384. eventsEngine.off($dragTarget, startEventName);
  55385. eventsEngine.off($dragTarget, updateEventName);
  55386. if (!this.option("dragEnabled")) {
  55387. return
  55388. }
  55389. eventsEngine.on($dragTarget, startEventName, this._dragStartHandler.bind(this));
  55390. eventsEngine.on($dragTarget, updateEventName, this._dragUpdateHandler.bind(this))
  55391. },
  55392. _renderResize: function() {
  55393. this._resizable = this._createComponent(this._$content, Resizable, {
  55394. handles: this.option("resizeEnabled") ? "all" : "none",
  55395. onResizeEnd: this._resizeEndHandler.bind(this),
  55396. onResize: this._actions.onResize.bind(this),
  55397. onResizeStart: this._actions.onResizeStart.bind(this),
  55398. minHeight: 100,
  55399. minWidth: 100,
  55400. area: this._getDragResizeContainer()
  55401. })
  55402. },
  55403. _resizeEndHandler: function() {
  55404. this._positionChangeHandled = true;
  55405. var width = this._resizable.option("width");
  55406. var height = this._resizable.option("height");
  55407. width && this.option("width", width);
  55408. height && this.option("height", height);
  55409. this._actions.onResizeEnd()
  55410. },
  55411. _renderScrollTerminator: function() {
  55412. var $scrollTerminator = this._wrapper();
  55413. var terminatorEventName = eventUtils.addNamespace(dragEvents.move, this.NAME);
  55414. eventsEngine.off($scrollTerminator, terminatorEventName);
  55415. eventsEngine.on($scrollTerminator, terminatorEventName, {
  55416. validate: function() {
  55417. return true
  55418. },
  55419. getDirection: function() {
  55420. return "both"
  55421. },
  55422. _toggleGestureCover: function(toggle) {
  55423. if (!toggle) {
  55424. this._toggleGestureCoverImpl(toggle)
  55425. }
  55426. },
  55427. _clearSelection: noop,
  55428. isNative: true
  55429. }, function(e) {
  55430. var originalEvent = e.originalEvent.originalEvent;
  55431. e._cancelPreventDefault = true;
  55432. if (originalEvent && "mousemove" !== originalEvent.type) {
  55433. e.preventDefault()
  55434. }
  55435. })
  55436. },
  55437. _getDragTarget: function() {
  55438. return this.$content()
  55439. },
  55440. _dragStartHandler: function(e) {
  55441. e.targetElements = [];
  55442. this._prevOffset = {
  55443. x: 0,
  55444. y: 0
  55445. };
  55446. var allowedOffsets = this._allowedOffsets();
  55447. e.maxTopOffset = allowedOffsets.top;
  55448. e.maxBottomOffset = allowedOffsets.bottom;
  55449. e.maxLeftOffset = allowedOffsets.left;
  55450. e.maxRightOffset = allowedOffsets.right
  55451. },
  55452. _getDragResizeContainer: function() {
  55453. var isContainerDefined = viewPortUtils.originalViewPort().get(0) || this.option("container");
  55454. var $container = !isContainerDefined ? $(window) : this._$container;
  55455. return $container
  55456. },
  55457. _deltaSize: function() {
  55458. var $content = this._$content;
  55459. var $container = this._getDragResizeContainer();
  55460. var contentWidth = $content.outerWidth();
  55461. var contentHeight = $content.outerHeight();
  55462. var containerWidth = $container.outerWidth();
  55463. var containerHeight = $container.outerHeight();
  55464. if (this._isWindow($container)) {
  55465. var document = domAdapter.getDocument();
  55466. var fullPageHeight = Math.max($(document).outerHeight(), containerHeight);
  55467. var fullPageWidth = Math.max($(document).outerWidth(), containerWidth);
  55468. containerHeight = fullPageHeight;
  55469. containerWidth = fullPageWidth
  55470. }
  55471. return {
  55472. width: containerWidth - contentWidth,
  55473. height: containerHeight - contentHeight
  55474. }
  55475. },
  55476. _dragUpdateHandler: function(e) {
  55477. var offset = e.offset;
  55478. var prevOffset = this._prevOffset;
  55479. var targetOffset = {
  55480. top: offset.y - prevOffset.y,
  55481. left: offset.x - prevOffset.x
  55482. };
  55483. this._changePosition(targetOffset);
  55484. this._prevOffset = offset
  55485. },
  55486. _changePosition: function(offset) {
  55487. var position = translator.locate(this._$content);
  55488. translator.move(this._$content, {
  55489. left: position.left + offset.left,
  55490. top: position.top + offset.top
  55491. });
  55492. this._positionChangeHandled = true
  55493. },
  55494. _allowedOffsets: function() {
  55495. var position = translator.locate(this._$content);
  55496. var deltaSize = this._deltaSize();
  55497. var isAllowedDrag = deltaSize.height >= 0 && deltaSize.width >= 0;
  55498. var shaderOffset = this.option("shading") && !this.option("container") && !this._isWindow(this._getContainer()) ? translator.locate(this._$wrapper) : {
  55499. top: 0,
  55500. left: 0
  55501. };
  55502. var boundaryOffset = this.option("boundaryOffset");
  55503. return {
  55504. top: isAllowedDrag ? position.top + shaderOffset.top + boundaryOffset.v : 0,
  55505. bottom: isAllowedDrag ? -position.top - shaderOffset.top + deltaSize.height - boundaryOffset.v : 0,
  55506. left: isAllowedDrag ? position.left + shaderOffset.left + boundaryOffset.h : 0,
  55507. right: isAllowedDrag ? -position.left - shaderOffset.left + deltaSize.width - boundaryOffset.h : 0
  55508. }
  55509. },
  55510. _moveFromContainer: function() {
  55511. this._$content.appendTo(this.$element());
  55512. this._detachWrapperToContainer()
  55513. },
  55514. _detachWrapperToContainer: function() {
  55515. this._$wrapper.detach()
  55516. },
  55517. _moveToContainer: function() {
  55518. this._attachWrapperToContainer();
  55519. this._$content.appendTo(this._$wrapper)
  55520. },
  55521. _attachWrapperToContainer: function() {
  55522. var $element = this.$element();
  55523. var containerDefined = void 0 !== this.option("container");
  55524. var renderContainer = containerDefined ? this._$container : swatch.getSwatchContainer($element);
  55525. if (renderContainer && renderContainer[0] === $element.parent()[0]) {
  55526. renderContainer = $element
  55527. }
  55528. this._$wrapper.appendTo(renderContainer)
  55529. },
  55530. _fixHeightAfterSafariAddressBarResizing: function() {
  55531. if (this._isWindow(this._getContainer()) && hasSafariAddressBar) {
  55532. this._$wrapper.css("minHeight", window.innerHeight)
  55533. }
  55534. },
  55535. _renderGeometry: function(isDimensionChanged) {
  55536. if (this.option("visible") && windowUtils.hasWindow()) {
  55537. this._renderGeometryImpl(isDimensionChanged)
  55538. }
  55539. },
  55540. _renderGeometryImpl: function(isDimensionChanged) {
  55541. this._stopAnimation();
  55542. this._normalizePosition();
  55543. this._renderShading();
  55544. this._fixHeightAfterSafariAddressBarResizing();
  55545. this._renderDimensions();
  55546. var resultPosition = this._renderPosition();
  55547. this._actions.onPositioned({
  55548. position: resultPosition
  55549. })
  55550. },
  55551. _fixWrapperPosition: function() {
  55552. this._$wrapper.css("position", this._useFixedPosition() ? "fixed" : "absolute")
  55553. },
  55554. _useFixedPosition: function() {
  55555. var $container = this._getContainer();
  55556. return this._isWindow($container) && (!iOS || void 0 !== this._bodyScrollTop)
  55557. },
  55558. _toggleSafariScrolling: function(scrollingEnabled) {
  55559. if (iOS && this._useFixedPosition()) {
  55560. var body = domAdapter.getBody();
  55561. if (scrollingEnabled) {
  55562. $(body).removeClass(PREVENT_SAFARI_SCROLLING_CLASS);
  55563. window.scrollTo(0, this._bodyScrollTop);
  55564. this._bodyScrollTop = void 0
  55565. } else {
  55566. if (this.option("visible")) {
  55567. this._bodyScrollTop = window.pageYOffset;
  55568. $(body).addClass(PREVENT_SAFARI_SCROLLING_CLASS)
  55569. }
  55570. }
  55571. }
  55572. },
  55573. _renderShading: function() {
  55574. this._fixWrapperPosition();
  55575. this._renderShadingDimensions();
  55576. this._renderShadingPosition()
  55577. },
  55578. _renderShadingPosition: function() {
  55579. if (this.option("shading")) {
  55580. var $container = this._getContainer();
  55581. positionUtils.setup(this._$wrapper, {
  55582. my: "top left",
  55583. at: "top left",
  55584. of: $container
  55585. })
  55586. }
  55587. },
  55588. _renderShadingDimensions: function() {
  55589. var wrapperWidth;
  55590. var wrapperHeight;
  55591. if (this.option("shading")) {
  55592. var $container = this._getContainer();
  55593. wrapperWidth = this._isWindow($container) ? "100%" : $container.outerWidth(), wrapperHeight = this._isWindow($container) ? "100%" : $container.outerHeight()
  55594. } else {
  55595. wrapperWidth = "";
  55596. wrapperHeight = ""
  55597. }
  55598. this._$wrapper.css({
  55599. width: wrapperWidth,
  55600. height: wrapperHeight
  55601. })
  55602. },
  55603. _isWindow: function($element) {
  55604. return !!$element && typeUtils.isWindow($element.get(0))
  55605. },
  55606. _getContainer: function() {
  55607. var position = this._position;
  55608. var container = this.option("container");
  55609. var positionOf = position ? position.of || window : null;
  55610. return getElement(container || positionOf)
  55611. },
  55612. _renderDimensions: function() {
  55613. var content = this._$content.get(0);
  55614. this._$content.css({
  55615. minWidth: this._getOptionValue("minWidth", content),
  55616. maxWidth: this._getOptionValue("maxWidth", content),
  55617. minHeight: this._getOptionValue("minHeight", content),
  55618. maxHeight: this._getOptionValue("maxHeight", content),
  55619. width: this._getOptionValue("width", content),
  55620. height: this._getOptionValue("height", content)
  55621. })
  55622. },
  55623. _renderPosition: function() {
  55624. if (this._positionChangeHandled) {
  55625. var allowedOffsets = this._allowedOffsets();
  55626. this._changePosition({
  55627. top: fitIntoRange(0, -allowedOffsets.top, allowedOffsets.bottom),
  55628. left: fitIntoRange(0, -allowedOffsets.left, allowedOffsets.right)
  55629. })
  55630. } else {
  55631. this._renderOverlayBoundaryOffset();
  55632. translator.resetPosition(this._$content);
  55633. var position = this._transformStringPosition(this._position, POSITION_ALIASES);
  55634. var resultPosition = positionUtils.setup(this._$content, position);
  55635. forceRepaint(this._$content);
  55636. this._actions.onPositioning();
  55637. return resultPosition
  55638. }
  55639. },
  55640. _transformStringPosition: function(position, positionAliases) {
  55641. if (typeUtils.isString(position)) {
  55642. position = extend({}, positionAliases[position])
  55643. }
  55644. return position
  55645. },
  55646. _renderOverlayBoundaryOffset: function() {
  55647. var boundaryOffset = this.option("boundaryOffset");
  55648. this._$content.css("margin", boundaryOffset.v + "px " + boundaryOffset.h + "px")
  55649. },
  55650. _focusTarget: function() {
  55651. return this._$content
  55652. },
  55653. _attachKeyboardEvents: function() {
  55654. this._keyboardProcessor = new KeyboardProcessor({
  55655. element: this._$content,
  55656. handler: this._keyboardHandler,
  55657. context: this
  55658. })
  55659. },
  55660. _keyboardHandler: function(options) {
  55661. var e = options.originalEvent;
  55662. var $target = $(e.target);
  55663. if ($target.is(this._$content) || !this.option("ignoreChildEvents")) {
  55664. this.callBase.apply(this, arguments)
  55665. }
  55666. },
  55667. _isVisible: function() {
  55668. return this.option("visible")
  55669. },
  55670. _visibilityChanged: function(visible) {
  55671. if (visible) {
  55672. if (this.option("visible")) {
  55673. this._renderVisibilityAnimate(visible)
  55674. }
  55675. } else {
  55676. this._renderVisibilityAnimate(visible)
  55677. }
  55678. },
  55679. _dimensionChanged: function() {
  55680. this._renderGeometry(true)
  55681. },
  55682. _clean: function() {
  55683. if (!this._contentAlreadyRendered) {
  55684. this.$content().empty()
  55685. }
  55686. this._renderVisibility(false);
  55687. this._stopShowTimer();
  55688. this._cleanFocusState()
  55689. },
  55690. _stopShowTimer: function() {
  55691. if (this._asyncShowTimeout) {
  55692. clearTimeout(this._asyncShowTimeout)
  55693. }
  55694. this._asyncShowTimeout = null
  55695. },
  55696. _dispose: function() {
  55697. fx.stop(this._$content, false);
  55698. clearTimeout(this._deferShowTimer);
  55699. this._toggleViewPortSubscription(false);
  55700. this._toggleSubscriptions(false);
  55701. this._updateZIndexStackPosition(false);
  55702. this._toggleTabTerminator(false);
  55703. this._toggleSafariScrolling(true);
  55704. this._actions = null;
  55705. this.callBase();
  55706. zIndexPool.remove(this._zIndex);
  55707. this._$wrapper.remove();
  55708. this._$content.remove()
  55709. },
  55710. _toggleDisabledState: function(value) {
  55711. this.callBase.apply(this, arguments);
  55712. this._$content.toggleClass(DISABLED_STATE_CLASS, Boolean(value))
  55713. },
  55714. _toggleRTLDirection: function(rtl) {
  55715. this._$content.toggleClass(RTL_DIRECTION_CLASS, rtl)
  55716. },
  55717. _optionChanged: function(args) {
  55718. var value = args.value;
  55719. if (inArray(args.name, ACTIONS) > -1) {
  55720. this._initActions();
  55721. return
  55722. }
  55723. switch (args.name) {
  55724. case "dragEnabled":
  55725. this._renderDrag();
  55726. this._renderGeometry();
  55727. break;
  55728. case "resizeEnabled":
  55729. this._renderResize();
  55730. this._renderGeometry();
  55731. break;
  55732. case "shading":
  55733. case "shadingColor":
  55734. this._toggleShading(this.option("visible"));
  55735. break;
  55736. case "width":
  55737. case "height":
  55738. case "minWidth":
  55739. case "maxWidth":
  55740. case "minHeight":
  55741. case "maxHeight":
  55742. case "boundaryOffset":
  55743. this._renderGeometry();
  55744. break;
  55745. case "position":
  55746. this._positionChangeHandled = false;
  55747. this._renderGeometry();
  55748. break;
  55749. case "visible":
  55750. this._renderVisibilityAnimate(value).done(function() {
  55751. if (!this._animateDeferred) {
  55752. return
  55753. }
  55754. this._animateDeferred.resolveWith(this)
  55755. }.bind(this));
  55756. break;
  55757. case "target":
  55758. this._initTarget(value);
  55759. this._invalidate();
  55760. break;
  55761. case "container":
  55762. this._initContainer(value);
  55763. this._invalidate();
  55764. break;
  55765. case "innerOverlay":
  55766. this._initInnerOverlayClass();
  55767. break;
  55768. case "deferRendering":
  55769. case "contentTemplate":
  55770. this._contentAlreadyRendered = false;
  55771. this._clean();
  55772. this._invalidate();
  55773. break;
  55774. case "closeOnBackButton":
  55775. this._toggleHideTopOverlayCallback(this.option("visible"));
  55776. break;
  55777. case "closeOnTargetScroll":
  55778. this._toggleParentsScrollSubscription(this.option("visible"));
  55779. break;
  55780. case "closeOnOutsideClick":
  55781. case "animation":
  55782. case "propagateOutsideClick":
  55783. break;
  55784. case "rtlEnabled":
  55785. this._contentAlreadyRendered = false;
  55786. this.option("visible", false);
  55787. this.callBase(args);
  55788. break;
  55789. default:
  55790. this.callBase(args)
  55791. }
  55792. },
  55793. toggle: function(showing) {
  55794. showing = void 0 === showing ? !this.option("visible") : showing;
  55795. if (showing === this.option("visible")) {
  55796. return (new Deferred).resolve().promise()
  55797. }
  55798. var animateDeferred = new Deferred;
  55799. this._animateDeferred = animateDeferred;
  55800. this.option("visible", showing);
  55801. return animateDeferred.promise().done(function() {
  55802. delete this._animateDeferred
  55803. }.bind(this))
  55804. },
  55805. $content: function() {
  55806. return this._$content
  55807. },
  55808. show: function() {
  55809. return this.toggle(true)
  55810. },
  55811. hide: function() {
  55812. return this.toggle(false)
  55813. },
  55814. content: function() {
  55815. return getPublicElement(this._$content)
  55816. },
  55817. repaint: function() {
  55818. this._renderGeometry();
  55819. domUtils.triggerResizeEvent(this._$content)
  55820. }
  55821. });
  55822. Overlay.baseZIndex = function(zIndex) {
  55823. return zIndexPool.base(zIndex)
  55824. };
  55825. registerComponent("dxOverlay", Overlay);
  55826. module.exports = Overlay
  55827. },
  55828. /*!****************************************************!*\
  55829. !*** ./artifacts/transpiled/ui/overlay/z_index.js ***!
  55830. \****************************************************/
  55831. /*! dynamic exports provided */
  55832. /*! all exports used */
  55833. function(module, exports, __webpack_require__) {
  55834. Object.defineProperty(exports, "__esModule", {
  55835. value: true
  55836. });
  55837. exports.clearStack = exports.remove = exports.create = exports.base = void 0;
  55838. var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
  55839. var baseZIndex = 1500;
  55840. var zIndexStack = [];
  55841. exports.base = function(ZIndex) {
  55842. baseZIndex = (0, _common.ensureDefined)(ZIndex, baseZIndex);
  55843. return baseZIndex
  55844. };
  55845. exports.create = function() {
  55846. var baseIndex = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : baseZIndex;
  55847. var length = zIndexStack.length;
  55848. var index = (length ? zIndexStack[length - 1] : baseIndex) + 1;
  55849. zIndexStack.push(index);
  55850. return index
  55851. };
  55852. exports.remove = function(zIndex) {
  55853. var position = zIndexStack.indexOf(zIndex);
  55854. if (position >= 0) {
  55855. zIndexStack.splice(position, 1)
  55856. }
  55857. };
  55858. exports.clearStack = function() {
  55859. zIndexStack = []
  55860. }
  55861. },
  55862. /*!**************************************************************!*\
  55863. !*** ./artifacts/transpiled/integration/angular/template.js ***!
  55864. \**************************************************************/
  55865. /*! dynamic exports provided */
  55866. /*! all exports used */
  55867. function(module, exports, __webpack_require__) {
  55868. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  55869. var TemplateBase = __webpack_require__( /*! ../../ui/widget/ui.template_base */ 74);
  55870. var isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
  55871. var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
  55872. var NgTemplate = TemplateBase.inherit({
  55873. ctor: function(element, templateCompiler) {
  55874. this._element = element;
  55875. this._compiledTemplate = templateCompiler(domUtils.normalizeTemplateElement(this._element))
  55876. },
  55877. _renderCore: function(options) {
  55878. var compiledTemplate = this._compiledTemplate;
  55879. return isFunction(compiledTemplate) ? compiledTemplate(options) : compiledTemplate
  55880. },
  55881. source: function() {
  55882. return $(this._element).clone()
  55883. }
  55884. });
  55885. module.exports = NgTemplate
  55886. },
  55887. /*!*************************************************************************!*\
  55888. !*** ./artifacts/transpiled/ui/collection/ui.collection_widget.base.js ***!
  55889. \*************************************************************************/
  55890. /*! dynamic exports provided */
  55891. /*! all exports used */
  55892. function(module, exports, __webpack_require__) {
  55893. var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
  55894. var _renderer2 = _interopRequireDefault(_renderer);
  55895. var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  55896. var _events_engine2 = _interopRequireDefault(_events_engine);
  55897. var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
  55898. var _common2 = _interopRequireDefault(_common);
  55899. var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12);
  55900. var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  55901. var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
  55902. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  55903. var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6);
  55904. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  55905. var _array = __webpack_require__( /*! ../../core/utils/array */ 14);
  55906. var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  55907. var _iterator2 = _interopRequireDefault(_iterator);
  55908. var _action = __webpack_require__( /*! ../../core/action */ 111);
  55909. var _action2 = _interopRequireDefault(_action);
  55910. var _guid = __webpack_require__( /*! ../../core/guid */ 40);
  55911. var _guid2 = _interopRequireDefault(_guid);
  55912. var _ui = __webpack_require__( /*! ../widget/ui.widget */ 18);
  55913. var _ui2 = _interopRequireDefault(_ui);
  55914. var _utils = __webpack_require__( /*! ../../events/utils */ 8);
  55915. var _utils2 = _interopRequireDefault(_utils);
  55916. var _pointer = __webpack_require__( /*! ../../events/pointer */ 23);
  55917. var _pointer2 = _interopRequireDefault(_pointer);
  55918. var _data_helper = __webpack_require__( /*! ../../data_helper */ 84);
  55919. var _data_helper2 = _interopRequireDefault(_data_helper);
  55920. var _item = __webpack_require__( /*! ./item */ 126);
  55921. var _item2 = _interopRequireDefault(_item);
  55922. var _selectors = __webpack_require__( /*! ../widget/selectors */ 66);
  55923. var _selectors2 = _interopRequireDefault(_selectors);
  55924. var _message = __webpack_require__( /*! ../../localization/message */ 13);
  55925. var _message2 = _interopRequireDefault(_message);
  55926. var _hold = __webpack_require__( /*! ../../events/hold */ 88);
  55927. var _hold2 = _interopRequireDefault(_hold);
  55928. var _data = __webpack_require__( /*! ../../core/utils/data */ 20);
  55929. var _click = __webpack_require__( /*! ../../events/click */ 19);
  55930. var _click2 = _interopRequireDefault(_click);
  55931. var _contextmenu = __webpack_require__( /*! ../../events/contextmenu */ 168);
  55932. var _contextmenu2 = _interopRequireDefault(_contextmenu);
  55933. var _bindable_template = __webpack_require__( /*! ../widget/bindable_template */ 65);
  55934. var _bindable_template2 = _interopRequireDefault(_bindable_template);
  55935. function _interopRequireDefault(obj) {
  55936. return obj && obj.__esModule ? obj : {
  55937. "default": obj
  55938. }
  55939. }
  55940. var COLLECTION_CLASS = "dx-collection";
  55941. var ITEM_CLASS = "dx-item";
  55942. var CONTENT_CLASS_POSTFIX = "-content";
  55943. var ITEM_CONTENT_PLACEHOLDER_CLASS = "dx-item-content-placeholder";
  55944. var ITEM_DATA_KEY = "dxItemData";
  55945. var ITEM_INDEX_KEY = "dxItemIndex";
  55946. var ITEM_TEMPLATE_ID_PREFIX = "tmpl-";
  55947. var ITEMS_SELECTOR = "[data-options*='dxItem']";
  55948. var SELECTED_ITEM_CLASS = "dx-item-selected";
  55949. var ITEM_RESPONSE_WAIT_CLASS = "dx-item-response-wait";
  55950. var EMPTY_COLLECTION = "dx-empty-collection";
  55951. var TEMPLATE_WRAPPER_CLASS = "dx-template-wrapper";
  55952. var ITEM_PATH_REGEX = /^([^.]+\[\d+\]\.)+([\w.]+)$/;
  55953. var FOCUS_UP = "up";
  55954. var FOCUS_DOWN = "down";
  55955. var FOCUS_LEFT = "left";
  55956. var FOCUS_RIGHT = "right";
  55957. var FOCUS_PAGE_UP = "pageup";
  55958. var FOCUS_PAGE_DOWN = "pagedown";
  55959. var FOCUS_LAST = "last";
  55960. var FOCUS_FIRST = "first";
  55961. var CollectionWidget = _ui2.default.inherit({
  55962. _activeStateUnit: "." + ITEM_CLASS,
  55963. _supportedKeys: function() {
  55964. var enter = function(e) {
  55965. var $itemElement = (0, _renderer2.default)(this.option("focusedElement"));
  55966. if (!$itemElement.length) {
  55967. return
  55968. }
  55969. this._itemClickHandler((0, _extend.extend)({}, e, {
  55970. target: $itemElement,
  55971. currentTarget: $itemElement
  55972. }))
  55973. };
  55974. var space = function(e) {
  55975. e.preventDefault();
  55976. enter.call(this, e)
  55977. };
  55978. var move = function(location, e) {
  55979. e.preventDefault();
  55980. e.stopPropagation();
  55981. this._moveFocus(location, e)
  55982. };
  55983. return (0, _extend.extend)(this.callBase(), {
  55984. space: space,
  55985. enter: enter,
  55986. leftArrow: move.bind(this, FOCUS_LEFT),
  55987. rightArrow: move.bind(this, FOCUS_RIGHT),
  55988. upArrow: move.bind(this, FOCUS_UP),
  55989. downArrow: move.bind(this, FOCUS_DOWN),
  55990. pageUp: move.bind(this, FOCUS_UP),
  55991. pageDown: move.bind(this, FOCUS_DOWN),
  55992. home: move.bind(this, FOCUS_FIRST),
  55993. end: move.bind(this, FOCUS_LAST)
  55994. })
  55995. },
  55996. _getDefaultOptions: function() {
  55997. return (0, _extend.extend)(this.callBase(), {
  55998. selectOnFocus: false,
  55999. loopItemFocus: true,
  56000. items: [],
  56001. itemTemplate: "item",
  56002. onItemRendered: null,
  56003. onItemClick: null,
  56004. onItemHold: null,
  56005. itemHoldTimeout: 750,
  56006. onItemContextMenu: null,
  56007. onFocusedItemChanged: null,
  56008. noDataText: _message2.default.format("dxCollectionWidget-noDataText"),
  56009. dataSource: null,
  56010. _itemAttributes: {},
  56011. itemTemplateProperty: "template",
  56012. focusOnSelectedItem: true,
  56013. focusedElement: null,
  56014. displayExpr: void 0,
  56015. disabledExpr: function(data) {
  56016. return data ? data.disabled : void 0
  56017. },
  56018. visibleExpr: function(data) {
  56019. return data ? data.visible : void 0
  56020. }
  56021. })
  56022. },
  56023. _getAnonymousTemplateName: function() {
  56024. return "item"
  56025. },
  56026. _init: function() {
  56027. this._compileDisplayGetter();
  56028. this.callBase();
  56029. this._cleanRenderedItems();
  56030. this._refreshDataSource()
  56031. },
  56032. _compileDisplayGetter: function() {
  56033. var displayExpr = this.option("displayExpr");
  56034. this._displayGetter = displayExpr ? (0, _data.compileGetter)(this.option("displayExpr")) : void 0
  56035. },
  56036. _initTemplates: function() {
  56037. this._initItemsFromMarkup();
  56038. this.callBase();
  56039. this._initDefaultItemTemplate()
  56040. },
  56041. _initDefaultItemTemplate: function() {
  56042. var fieldsMap = this._getFieldsMap();
  56043. this._defaultTemplates.item = new _bindable_template2.default(function($container, data) {
  56044. if ((0, _type.isPlainObject)(data)) {
  56045. this._prepareDefaultItemTemplate(data, $container)
  56046. } else {
  56047. if (fieldsMap && (0, _type.isFunction)(fieldsMap.text)) {
  56048. data = fieldsMap.text(data)
  56049. }
  56050. $container.text(String(_common2.default.ensureDefined(data, "")))
  56051. }
  56052. }.bind(this), this._getBindableFields(), this.option("integrationOptions.watchMethod"), fieldsMap)
  56053. },
  56054. _getBindableFields: function() {
  56055. return ["text", "html"]
  56056. },
  56057. _getFieldsMap: function() {
  56058. if (this._displayGetter) {
  56059. return {
  56060. text: this._displayGetter
  56061. }
  56062. }
  56063. },
  56064. _prepareDefaultItemTemplate: function(data, $container) {
  56065. if ((0, _type.isDefined)(data.text)) {
  56066. $container.text(data.text)
  56067. }
  56068. if ((0, _type.isDefined)(data.html)) {
  56069. $container.html(data.html)
  56070. }
  56071. },
  56072. _initItemsFromMarkup: function() {
  56073. var _this = this;
  56074. var $items = this.$element().contents().filter(ITEMS_SELECTOR);
  56075. if (!$items.length || this.option("items").length) {
  56076. return
  56077. }
  56078. var items = [].slice.call($items).map(function(item) {
  56079. var $item = (0, _renderer2.default)(item);
  56080. var result = (0, _dom.getElementOptions)(item).dxItem;
  56081. var isTemplateRequired = $item.html().trim() && !result.template;
  56082. if (isTemplateRequired) {
  56083. result.template = _this._prepareItemTemplate($item)
  56084. } else {
  56085. $item.remove()
  56086. }
  56087. return result
  56088. });
  56089. this.option("items", items)
  56090. },
  56091. _prepareItemTemplate: function($item) {
  56092. var templateId = ITEM_TEMPLATE_ID_PREFIX + new _guid2.default;
  56093. var $template = $item.detach().clone().removeAttr("data-options").addClass(TEMPLATE_WRAPPER_CLASS);
  56094. this._saveTemplate(templateId, $template);
  56095. return templateId
  56096. },
  56097. _dataSourceOptions: function() {
  56098. return {
  56099. paginate: false
  56100. }
  56101. },
  56102. _cleanRenderedItems: function() {
  56103. this._renderedItemsCount = 0
  56104. },
  56105. _focusTarget: function() {
  56106. return this.$element()
  56107. },
  56108. _focusInHandler: function(e) {
  56109. this.callBase.apply(this, arguments);
  56110. if ((0, _array.inArray)(e.target, this._focusTarget()) === -1) {
  56111. return
  56112. }
  56113. var $focusedElement = (0, _renderer2.default)(this.option("focusedElement"));
  56114. if ($focusedElement.length) {
  56115. this._setFocusedItem($focusedElement)
  56116. } else {
  56117. var $activeItem = this._getActiveItem();
  56118. if ($activeItem.length) {
  56119. this.option("focusedElement", (0, _dom.getPublicElement)($activeItem))
  56120. }
  56121. }
  56122. },
  56123. _focusOutHandler: function() {
  56124. this.callBase.apply(this, arguments);
  56125. var $target = (0, _renderer2.default)(this.option("focusedElement"));
  56126. this._updateFocusedItemState($target, false)
  56127. },
  56128. _getActiveItem: function(last) {
  56129. var $focusedElement = (0, _renderer2.default)(this.option("focusedElement"));
  56130. if ($focusedElement.length) {
  56131. return $focusedElement
  56132. }
  56133. var index = this.option("focusOnSelectedItem") ? this.option("selectedIndex") : 0;
  56134. var activeElements = this._getActiveElement();
  56135. var lastIndex = activeElements.length - 1;
  56136. if (index < 0) {
  56137. index = last ? lastIndex : 0
  56138. }
  56139. return activeElements.eq(index)
  56140. },
  56141. _moveFocus: function(location) {
  56142. var $items = this._getAvailableItems();
  56143. var $newTarget;
  56144. switch (location) {
  56145. case FOCUS_PAGE_UP:
  56146. case FOCUS_UP:
  56147. $newTarget = this._prevItem($items);
  56148. break;
  56149. case FOCUS_PAGE_DOWN:
  56150. case FOCUS_DOWN:
  56151. $newTarget = this._nextItem($items);
  56152. break;
  56153. case FOCUS_RIGHT:
  56154. $newTarget = this.option("rtlEnabled") ? this._prevItem($items) : this._nextItem($items);
  56155. break;
  56156. case FOCUS_LEFT:
  56157. $newTarget = this.option("rtlEnabled") ? this._nextItem($items) : this._prevItem($items);
  56158. break;
  56159. case FOCUS_FIRST:
  56160. $newTarget = $items.first();
  56161. break;
  56162. case FOCUS_LAST:
  56163. $newTarget = $items.last();
  56164. break;
  56165. default:
  56166. return false
  56167. }
  56168. if (0 !== $newTarget.length) {
  56169. this.option("focusedElement", (0, _dom.getPublicElement)($newTarget))
  56170. }
  56171. },
  56172. _getVisibleItems: function($itemElements) {
  56173. $itemElements = $itemElements || this._itemElements();
  56174. return $itemElements.filter(":visible")
  56175. },
  56176. _getAvailableItems: function($itemElements) {
  56177. return this._getVisibleItems($itemElements).not(".dx-state-disabled")
  56178. },
  56179. _prevItem: function($items) {
  56180. var $target = this._getActiveItem();
  56181. var targetIndex = $items.index($target);
  56182. var $last = $items.last();
  56183. var $item = (0, _renderer2.default)($items[targetIndex - 1]);
  56184. var loop = this.option("loopItemFocus");
  56185. if (0 === $item.length && loop) {
  56186. $item = $last
  56187. }
  56188. return $item
  56189. },
  56190. _nextItem: function($items) {
  56191. var $target = this._getActiveItem(true);
  56192. var targetIndex = $items.index($target);
  56193. var $first = $items.first();
  56194. var $item = (0, _renderer2.default)($items[targetIndex + 1]);
  56195. var loop = this.option("loopItemFocus");
  56196. if (0 === $item.length && loop) {
  56197. $item = $first
  56198. }
  56199. return $item
  56200. },
  56201. _selectFocusedItem: function($target) {
  56202. this.selectItem($target)
  56203. },
  56204. _updateFocusedItemState: function(target, isFocused, needCleanItemId) {
  56205. var $target = (0, _renderer2.default)(target);
  56206. if ($target.length) {
  56207. this._refreshActiveDescendant();
  56208. this._refreshItemId($target, needCleanItemId);
  56209. this._toggleFocusClass(isFocused, $target)
  56210. }
  56211. },
  56212. _refreshActiveDescendant: function($target) {
  56213. this.setAria("activedescendant", (0, _type.isDefined)(this.option("focusedElement")) ? this.getFocusedItemId() : null, $target)
  56214. },
  56215. _refreshItemId: function($target, needCleanItemId) {
  56216. if (!needCleanItemId && this.option("focusedElement")) {
  56217. this.setAria("id", this.getFocusedItemId(), $target)
  56218. } else {
  56219. this.setAria("id", null, $target)
  56220. }
  56221. },
  56222. _setFocusedItem: function($target) {
  56223. if (!$target || !$target.length) {
  56224. return
  56225. }
  56226. this._updateFocusedItemState($target, true);
  56227. this.onFocusedItemChanged(this.getFocusedItemId());
  56228. if (this.option("selectOnFocus")) {
  56229. this._selectFocusedItem($target)
  56230. }
  56231. },
  56232. _findItemElementByItem: function(item) {
  56233. var result = (0, _renderer2.default)();
  56234. var that = this;
  56235. this.itemElements().each(function() {
  56236. var $item = (0, _renderer2.default)(this);
  56237. if ($item.data(that._itemDataKey()) === item) {
  56238. result = $item;
  56239. return false
  56240. }
  56241. });
  56242. return result
  56243. },
  56244. _getIndexByItem: function(item) {
  56245. return this.option("items").indexOf(item)
  56246. },
  56247. _itemOptionChanged: function(item, property, value, oldValue) {
  56248. var $item = this._findItemElementByItem(item);
  56249. if (!$item.length) {
  56250. return
  56251. }
  56252. if (!this.constructor.ItemClass.getInstance($item).setDataField(property, value)) {
  56253. this._refreshItem($item, item)
  56254. }
  56255. var isDisabling = "disabled" === property && value;
  56256. if (isDisabling) {
  56257. this._resetItemFocus($item)
  56258. }
  56259. },
  56260. _resetItemFocus: function($item) {
  56261. if ($item.is(this.option("focusedElement"))) {
  56262. this.option("focusedElement", null)
  56263. }
  56264. },
  56265. _refreshItem: function($item) {
  56266. var itemData = this._getItemData($item);
  56267. var index = $item.data(this._itemIndexKey());
  56268. this._renderItem(this._renderedItemsCount + index, itemData, null, $item)
  56269. },
  56270. _optionChanged: function(args) {
  56271. if ("items" === args.name) {
  56272. var matches = args.fullName.match(ITEM_PATH_REGEX);
  56273. if (matches && matches.length) {
  56274. var property = matches[matches.length - 1];
  56275. var itemPath = args.fullName.replace("." + property, "");
  56276. var item = this.option(itemPath);
  56277. this._itemOptionChanged(item, property, args.value, args.previousValue);
  56278. return
  56279. }
  56280. }
  56281. switch (args.name) {
  56282. case "items":
  56283. case "_itemAttributes":
  56284. case "itemTemplateProperty":
  56285. this._cleanRenderedItems();
  56286. this._invalidate();
  56287. break;
  56288. case "dataSource":
  56289. this._refreshDataSource();
  56290. this._renderEmptyMessage();
  56291. break;
  56292. case "noDataText":
  56293. this._renderEmptyMessage();
  56294. break;
  56295. case "itemTemplate":
  56296. this._invalidate();
  56297. break;
  56298. case "onItemRendered":
  56299. this._createItemRenderAction();
  56300. break;
  56301. case "onItemClick":
  56302. break;
  56303. case "onItemHold":
  56304. case "itemHoldTimeout":
  56305. this._attachHoldEvent();
  56306. break;
  56307. case "onItemContextMenu":
  56308. this._attachContextMenuEvent();
  56309. break;
  56310. case "onFocusedItemChanged":
  56311. this.onFocusedItemChanged = this._createActionByOption("onFocusedItemChanged");
  56312. break;
  56313. case "selectOnFocus":
  56314. case "loopItemFocus":
  56315. case "focusOnSelectedItem":
  56316. break;
  56317. case "focusedElement":
  56318. this._updateFocusedItemState(args.previousValue, false, true);
  56319. this._setFocusedItem((0, _renderer2.default)(args.value));
  56320. break;
  56321. case "displayExpr":
  56322. this._compileDisplayGetter();
  56323. this._initDefaultItemTemplate();
  56324. this._invalidate();
  56325. break;
  56326. case "visibleExpr":
  56327. case "disabledExpr":
  56328. this._invalidate();
  56329. break;
  56330. default:
  56331. this.callBase(args)
  56332. }
  56333. },
  56334. _invalidate: function() {
  56335. this.option("focusedElement", null);
  56336. return this.callBase.apply(this, arguments)
  56337. },
  56338. _loadNextPage: function() {
  56339. var dataSource = this._dataSource;
  56340. this._expectNextPageLoading();
  56341. dataSource.pageIndex(1 + dataSource.pageIndex());
  56342. return dataSource.load()
  56343. },
  56344. _expectNextPageLoading: function() {
  56345. this._startIndexForAppendedItems = 0
  56346. },
  56347. _expectLastItemLoading: function() {
  56348. this._startIndexForAppendedItems = -1
  56349. },
  56350. _forgetNextPageLoading: function() {
  56351. this._startIndexForAppendedItems = null
  56352. },
  56353. _dataSourceChangedHandler: function(newItems) {
  56354. var items = this.option("items");
  56355. if (this._initialized && items && this._shouldAppendItems()) {
  56356. this._renderedItemsCount = items.length;
  56357. if (!this._isLastPage() || this._startIndexForAppendedItems !== -1) {
  56358. this.option().items = items.concat(newItems.slice(this._startIndexForAppendedItems))
  56359. }
  56360. this._forgetNextPageLoading();
  56361. this._refreshContent()
  56362. } else {
  56363. this.option("items", newItems.slice())
  56364. }
  56365. },
  56366. _refreshContent: function() {
  56367. this._prepareContent();
  56368. this._renderContent()
  56369. },
  56370. _dataSourceLoadErrorHandler: function() {
  56371. this._forgetNextPageLoading();
  56372. this.option("items", this.option("items"))
  56373. },
  56374. _shouldAppendItems: function() {
  56375. return null != this._startIndexForAppendedItems && this._allowDynamicItemsAppend()
  56376. },
  56377. _allowDynamicItemsAppend: function() {
  56378. return false
  56379. },
  56380. _clean: function() {
  56381. this._cleanFocusState();
  56382. this._cleanItemContainer()
  56383. },
  56384. _cleanItemContainer: function() {
  56385. (0, _renderer2.default)(this._itemContainer()).empty()
  56386. },
  56387. _dispose: function() {
  56388. this.callBase();
  56389. clearTimeout(this._itemFocusTimeout)
  56390. },
  56391. _refresh: function() {
  56392. this._cleanRenderedItems();
  56393. this.callBase.apply(this, arguments)
  56394. },
  56395. _itemContainer: function() {
  56396. return this.$element()
  56397. },
  56398. _itemClass: function() {
  56399. return ITEM_CLASS
  56400. },
  56401. _itemContentClass: function() {
  56402. return this._itemClass() + CONTENT_CLASS_POSTFIX
  56403. },
  56404. _selectedItemClass: function() {
  56405. return SELECTED_ITEM_CLASS
  56406. },
  56407. _itemResponseWaitClass: function() {
  56408. return ITEM_RESPONSE_WAIT_CLASS
  56409. },
  56410. _itemSelector: function() {
  56411. return "." + this._itemClass()
  56412. },
  56413. _itemDataKey: function() {
  56414. return ITEM_DATA_KEY
  56415. },
  56416. _itemIndexKey: function() {
  56417. return ITEM_INDEX_KEY
  56418. },
  56419. _itemElements: function() {
  56420. return this._itemContainer().find(this._itemSelector())
  56421. },
  56422. _initMarkup: function() {
  56423. this.callBase();
  56424. this.onFocusedItemChanged = this._createActionByOption("onFocusedItemChanged");
  56425. this.$element().addClass(COLLECTION_CLASS);
  56426. this._prepareContent()
  56427. },
  56428. _prepareContent: _common2.default.deferRenderer(function() {
  56429. this._renderContentImpl()
  56430. }),
  56431. _renderContent: function() {
  56432. this._fireContentReadyAction()
  56433. },
  56434. _render: function() {
  56435. this.callBase();
  56436. this._attachClickEvent();
  56437. this._attachHoldEvent();
  56438. this._attachContextMenuEvent()
  56439. },
  56440. _attachClickEvent: function() {
  56441. var itemSelector = this._itemSelector();
  56442. var clickEventNamespace = _utils2.default.addNamespace(_click2.default.name, this.NAME);
  56443. var pointerDownEventNamespace = _utils2.default.addNamespace(_pointer2.default.down, this.NAME);
  56444. var that = this;
  56445. var pointerDownAction = new _action2.default(function(args) {
  56446. var event = args.event;
  56447. that._itemPointerDownHandler(event)
  56448. });
  56449. _events_engine2.default.off(this._itemContainer(), clickEventNamespace, itemSelector);
  56450. _events_engine2.default.off(this._itemContainer(), pointerDownEventNamespace, itemSelector);
  56451. _events_engine2.default.on(this._itemContainer(), clickEventNamespace, itemSelector, function(e) {
  56452. this._itemClickHandler(e)
  56453. }.bind(this));
  56454. _events_engine2.default.on(this._itemContainer(), pointerDownEventNamespace, itemSelector, function(e) {
  56455. pointerDownAction.execute({
  56456. element: (0, _renderer2.default)(e.target),
  56457. event: e
  56458. })
  56459. })
  56460. },
  56461. _itemClickHandler: function(e, args, config) {
  56462. this._itemDXEventHandler(e, "onItemClick", args, config)
  56463. },
  56464. _itemPointerDownHandler: function(e) {
  56465. if (!this.option("focusStateEnabled")) {
  56466. return
  56467. }
  56468. this._itemFocusHandler = function() {
  56469. clearTimeout(this._itemFocusTimeout);
  56470. this._itemFocusHandler = null;
  56471. if (e.isDefaultPrevented()) {
  56472. return
  56473. }
  56474. var $target = (0, _renderer2.default)(e.target);
  56475. var $closestItem = $target.closest(this._itemElements());
  56476. var $closestFocusable = this._closestFocusable($target);
  56477. if ($closestItem.length && $closestFocusable && (0, _array.inArray)($closestFocusable.get(0), this._focusTarget()) !== -1) {
  56478. this.option("focusedElement", (0, _dom.getPublicElement)($closestItem))
  56479. }
  56480. }.bind(this);
  56481. this._itemFocusTimeout = setTimeout(this._forcePointerDownFocus.bind(this))
  56482. },
  56483. _closestFocusable: function($target) {
  56484. if ($target.is(_selectors2.default.focusable)) {
  56485. return $target
  56486. } else {
  56487. $target = $target.parent();
  56488. while ($target.length && !_dom_adapter2.default.isDocument($target.get(0))) {
  56489. if ($target.is(_selectors2.default.focusable)) {
  56490. return $target
  56491. }
  56492. $target = $target.parent()
  56493. }
  56494. }
  56495. },
  56496. _forcePointerDownFocus: function() {
  56497. this._itemFocusHandler && this._itemFocusHandler()
  56498. },
  56499. _updateFocusState: function() {
  56500. this.callBase.apply(this, arguments);
  56501. this._forcePointerDownFocus()
  56502. },
  56503. _attachHoldEvent: function() {
  56504. var $itemContainer = this._itemContainer();
  56505. var itemSelector = this._itemSelector();
  56506. var eventName = _utils2.default.addNamespace(_hold2.default.name, this.NAME);
  56507. _events_engine2.default.off($itemContainer, eventName, itemSelector);
  56508. _events_engine2.default.on($itemContainer, eventName, itemSelector, {
  56509. timeout: this._getHoldTimeout()
  56510. }, this._itemHoldHandler.bind(this))
  56511. },
  56512. _getHoldTimeout: function() {
  56513. return this.option("itemHoldTimeout")
  56514. },
  56515. _shouldFireHoldEvent: function() {
  56516. return this.hasActionSubscription("onItemHold")
  56517. },
  56518. _itemHoldHandler: function(e) {
  56519. if (this._shouldFireHoldEvent()) {
  56520. this._itemDXEventHandler(e, "onItemHold")
  56521. } else {
  56522. e.cancel = true
  56523. }
  56524. },
  56525. _attachContextMenuEvent: function() {
  56526. var $itemContainer = this._itemContainer();
  56527. var itemSelector = this._itemSelector();
  56528. var eventName = _utils2.default.addNamespace(_contextmenu2.default.name, this.NAME);
  56529. _events_engine2.default.off($itemContainer, eventName, itemSelector);
  56530. _events_engine2.default.on($itemContainer, eventName, itemSelector, this._itemContextMenuHandler.bind(this))
  56531. },
  56532. _shouldFireContextMenuEvent: function() {
  56533. return this.hasActionSubscription("onItemContextMenu")
  56534. },
  56535. _itemContextMenuHandler: function(e) {
  56536. if (this._shouldFireContextMenuEvent()) {
  56537. this._itemDXEventHandler(e, "onItemContextMenu")
  56538. } else {
  56539. e.cancel = true
  56540. }
  56541. },
  56542. _renderContentImpl: function() {
  56543. var items = this.option("items") || [];
  56544. if (this._renderedItemsCount) {
  56545. this._renderItems(items.slice(this._renderedItemsCount))
  56546. } else {
  56547. this._renderItems(items)
  56548. }
  56549. },
  56550. _renderItems: function(items) {
  56551. if (items.length) {
  56552. _iterator2.default.each(items, function(index, itemData) {
  56553. this._renderItem(this._renderedItemsCount + index, itemData)
  56554. }.bind(this))
  56555. }
  56556. this._renderEmptyMessage()
  56557. },
  56558. _renderItem: function(index, itemData, $container, $itemToReplace) {
  56559. $container = $container || this._itemContainer();
  56560. var $itemFrame = this._renderItemFrame(index, itemData, $container, $itemToReplace);
  56561. this._setElementData($itemFrame, itemData, index);
  56562. $itemFrame.attr(this.option("_itemAttributes"));
  56563. this._attachItemClickEvent(itemData, $itemFrame);
  56564. var $itemContent = this._getItemContent($itemFrame);
  56565. var renderContentPromise = this._renderItemContent({
  56566. index: index,
  56567. itemData: itemData,
  56568. container: (0, _dom.getPublicElement)($itemContent),
  56569. contentClass: this._itemContentClass(),
  56570. defaultTemplateName: this.option("itemTemplate")
  56571. });
  56572. var that = this;
  56573. (0, _deferred.when)(renderContentPromise).done(function($itemContent) {
  56574. that._postprocessRenderItem({
  56575. itemElement: $itemFrame,
  56576. itemContent: $itemContent,
  56577. itemData: itemData,
  56578. itemIndex: index
  56579. });
  56580. that._executeItemRenderAction(index, itemData, (0, _dom.getPublicElement)($itemFrame))
  56581. });
  56582. return $itemFrame
  56583. },
  56584. _getItemContent: function($itemFrame) {
  56585. var $itemContent = $itemFrame.find("." + ITEM_CONTENT_PLACEHOLDER_CLASS);
  56586. $itemContent.removeClass(ITEM_CONTENT_PLACEHOLDER_CLASS);
  56587. return $itemContent
  56588. },
  56589. _attachItemClickEvent: function(itemData, $itemElement) {
  56590. if (!itemData || !itemData.onClick) {
  56591. return
  56592. }
  56593. _events_engine2.default.on($itemElement, _click2.default.name, function(e) {
  56594. this._itemEventHandlerByHandler($itemElement, itemData.onClick, {
  56595. event: e
  56596. })
  56597. }.bind(this))
  56598. },
  56599. _renderItemContent: function(args) {
  56600. var itemTemplateName = this._getItemTemplateName(args);
  56601. var itemTemplate = this._getTemplate(itemTemplateName);
  56602. this._addItemContentClasses(args);
  56603. var $templateResult = (0, _renderer2.default)(this._createItemByTemplate(itemTemplate, args));
  56604. if (!$templateResult.hasClass(TEMPLATE_WRAPPER_CLASS)) {
  56605. return args.container
  56606. }
  56607. return this._renderItemContentByNode(args, $templateResult)
  56608. },
  56609. _renderItemContentByNode: function(args, $node) {
  56610. (0, _renderer2.default)(args.container).replaceWith($node);
  56611. args.container = (0, _dom.getPublicElement)($node);
  56612. this._addItemContentClasses(args);
  56613. return $node
  56614. },
  56615. _addItemContentClasses: function(args) {
  56616. var classes = [ITEM_CLASS + CONTENT_CLASS_POSTFIX, args.contentClass];
  56617. (0, _renderer2.default)(args.container).addClass(classes.join(" "))
  56618. },
  56619. _appendItemToContainer: function($container, $itemFrame, index) {
  56620. $itemFrame.appendTo($container)
  56621. },
  56622. _renderItemFrame: function(index, itemData, $container, $itemToReplace) {
  56623. var $itemFrame = (0, _renderer2.default)("<div>");
  56624. new this.constructor.ItemClass($itemFrame, this._itemOptions(), itemData || {});
  56625. if ($itemToReplace && $itemToReplace.length) {
  56626. $itemToReplace.replaceWith($itemFrame)
  56627. } else {
  56628. this._appendItemToContainer.call(this, $container, $itemFrame, index)
  56629. }
  56630. return $itemFrame
  56631. },
  56632. _itemOptions: function() {
  56633. var that = this;
  56634. return {
  56635. watchMethod: function() {
  56636. return that.option("integrationOptions.watchMethod")
  56637. },
  56638. owner: that,
  56639. fieldGetter: function(field) {
  56640. var expr = that.option(field + "Expr");
  56641. var getter = (0, _data.compileGetter)(expr);
  56642. return getter
  56643. }
  56644. }
  56645. },
  56646. _postprocessRenderItem: _common2.default.noop,
  56647. _executeItemRenderAction: function(index, itemData, itemElement) {
  56648. this._getItemRenderAction()({
  56649. itemElement: itemElement,
  56650. itemIndex: index,
  56651. itemData: itemData
  56652. })
  56653. },
  56654. _setElementData: function(element, data, index) {
  56655. element.addClass([ITEM_CLASS, this._itemClass()].join(" ")).data(this._itemDataKey(), data).data(this._itemIndexKey(), index)
  56656. },
  56657. _createItemRenderAction: function() {
  56658. return this._itemRenderAction = this._createActionByOption("onItemRendered", {
  56659. element: this.element(),
  56660. excludeValidators: ["disabled", "readOnly"],
  56661. category: "rendering"
  56662. })
  56663. },
  56664. _getItemRenderAction: function() {
  56665. return this._itemRenderAction || this._createItemRenderAction()
  56666. },
  56667. _getItemTemplateName: function(args) {
  56668. var data = args.itemData;
  56669. var templateProperty = args.templateProperty || this.option("itemTemplateProperty");
  56670. var template = data && data[templateProperty];
  56671. return template || args.defaultTemplateName
  56672. },
  56673. _createItemByTemplate: function(itemTemplate, renderArgs) {
  56674. return itemTemplate.render({
  56675. model: renderArgs.itemData,
  56676. container: renderArgs.container,
  56677. index: renderArgs.index
  56678. })
  56679. },
  56680. _emptyMessageContainer: function() {
  56681. return this._itemContainer()
  56682. },
  56683. _renderEmptyMessage: function(items) {
  56684. items = items || this.option("items");
  56685. var noDataText = this.option("noDataText");
  56686. var hideNoData = !noDataText || items && items.length || this._isDataSourceLoading();
  56687. if (hideNoData && this._$noData) {
  56688. this._$noData.remove();
  56689. this._$noData = null;
  56690. this.setAria("label", void 0)
  56691. }
  56692. if (!hideNoData) {
  56693. this._$noData = this._$noData || (0, _renderer2.default)("<div>").addClass("dx-empty-message");
  56694. this._$noData.appendTo(this._emptyMessageContainer()).html(noDataText);
  56695. this.setAria("label", noDataText)
  56696. }
  56697. this.$element().toggleClass(EMPTY_COLLECTION, !hideNoData)
  56698. },
  56699. _itemDXEventHandler: function(dxEvent, handlerOptionName, actionArgs, actionConfig) {
  56700. this._itemEventHandler(dxEvent.target, handlerOptionName, (0, _extend.extend)(actionArgs, {
  56701. event: dxEvent
  56702. }), actionConfig)
  56703. },
  56704. _itemEventHandler: function(initiator, handlerOptionName, actionArgs, actionConfig) {
  56705. var action = this._createActionByOption(handlerOptionName, (0, _extend.extend)({
  56706. validatingTargetName: "itemElement"
  56707. }, actionConfig));
  56708. return this._itemEventHandlerImpl(initiator, action, actionArgs)
  56709. },
  56710. _itemEventHandlerByHandler: function(initiator, handler, actionArgs, actionConfig) {
  56711. var action = this._createAction(handler, (0, _extend.extend)({
  56712. validatingTargetName: "itemElement"
  56713. }, actionConfig));
  56714. return this._itemEventHandlerImpl(initiator, action, actionArgs)
  56715. },
  56716. _itemEventHandlerImpl: function(initiator, action, actionArgs) {
  56717. var $itemElement = this._closestItemElement((0, _renderer2.default)(initiator));
  56718. var args = (0, _extend.extend)({}, actionArgs);
  56719. return action((0, _extend.extend)(actionArgs, this._extendActionArgs($itemElement), args))
  56720. },
  56721. _extendActionArgs: function($itemElement) {
  56722. return {
  56723. itemElement: (0, _dom.getPublicElement)($itemElement),
  56724. itemIndex: this._itemElements().index($itemElement),
  56725. itemData: this._getItemData($itemElement)
  56726. }
  56727. },
  56728. _closestItemElement: function($element) {
  56729. return (0, _renderer2.default)($element).closest(this._itemSelector())
  56730. },
  56731. _getItemData: function(itemElement) {
  56732. return (0, _renderer2.default)(itemElement).data(this._itemDataKey())
  56733. },
  56734. _getSummaryItemsWidth: function(items, includeMargin) {
  56735. var result = 0;
  56736. if (items) {
  56737. _iterator2.default.each(items, function(_, item) {
  56738. result += (0, _renderer2.default)(item).outerWidth(includeMargin || false)
  56739. })
  56740. }
  56741. return result
  56742. },
  56743. getFocusedItemId: function() {
  56744. if (!this._focusedItemId) {
  56745. this._focusedItemId = "dx-" + new _guid2.default
  56746. }
  56747. return this._focusedItemId
  56748. },
  56749. itemElements: function() {
  56750. return this._itemElements()
  56751. },
  56752. itemsContainer: function() {
  56753. return this._itemContainer()
  56754. }
  56755. }).include(_data_helper2.default);
  56756. CollectionWidget.ItemClass = _item2.default;
  56757. module.exports = CollectionWidget
  56758. },
  56759. /*!***************************************************!*\
  56760. !*** ./artifacts/transpiled/data/remote_query.js ***!
  56761. \***************************************************/
  56762. /*! dynamic exports provided */
  56763. /*! all exports used */
  56764. function(module, exports, __webpack_require__) {
  56765. var queryAdapters = __webpack_require__( /*! ./query_adapters */ 181);
  56766. var errorsModule = __webpack_require__( /*! ./errors */ 36);
  56767. var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
  56768. var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction;
  56769. var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred;
  56770. var arrayQueryImpl = __webpack_require__( /*! ./array_query */ 155);
  56771. var remoteQueryImpl = function remoteQueryImpl(url, queryOptions, tasks) {
  56772. tasks = tasks || [];
  56773. queryOptions = queryOptions || {};
  56774. var createTask = function(name, args) {
  56775. return {
  56776. name: name,
  56777. args: args
  56778. }
  56779. };
  56780. var exec = function(executorTask) {
  56781. var d = new Deferred;
  56782. var _adapterFactory;
  56783. var _adapter;
  56784. var _taskQueue;
  56785. var _currentTask;
  56786. var _mergedSortArgs;
  56787. var rejectWithNotify = function(error) {
  56788. var handler = queryOptions.errorHandler;
  56789. if (handler) {
  56790. handler(error)
  56791. }
  56792. errorsModule._errorHandler(error);
  56793. d.reject(error)
  56794. };
  56795. function mergeSortTask(task) {
  56796. switch (task.name) {
  56797. case "sortBy":
  56798. _mergedSortArgs = [task.args];
  56799. return true;
  56800. case "thenBy":
  56801. if (!_mergedSortArgs) {
  56802. throw errorsModule.errors.Error("E4004")
  56803. }
  56804. _mergedSortArgs.push(task.args);
  56805. return true
  56806. }
  56807. return false
  56808. }
  56809. function unmergeSortTasks() {
  56810. var head = _taskQueue[0];
  56811. var unmergedTasks = [];
  56812. if (head && "multiSort" === head.name) {
  56813. _taskQueue.shift();
  56814. each(head.args[0], function() {
  56815. unmergedTasks.push(createTask(unmergedTasks.length ? "thenBy" : "sortBy", this))
  56816. })
  56817. }
  56818. _taskQueue = unmergedTasks.concat(_taskQueue)
  56819. }
  56820. try {
  56821. _adapterFactory = queryOptions.adapter;
  56822. if (!isFunction(_adapterFactory)) {
  56823. _adapterFactory = queryAdapters[_adapterFactory]
  56824. }
  56825. _adapter = _adapterFactory(queryOptions);
  56826. _taskQueue = [].concat(tasks).concat(executorTask);
  56827. var optimize = _adapter.optimize;
  56828. if (optimize) {
  56829. optimize(_taskQueue)
  56830. }
  56831. while (_taskQueue.length) {
  56832. _currentTask = _taskQueue[0];
  56833. if (!mergeSortTask(_currentTask)) {
  56834. if (_mergedSortArgs) {
  56835. _taskQueue.unshift(createTask("multiSort", [_mergedSortArgs]));
  56836. _mergedSortArgs = null;
  56837. continue
  56838. }
  56839. if ("enumerate" !== String(_currentTask.name)) {
  56840. if (!_adapter[_currentTask.name] || false === _adapter[_currentTask.name].apply(_adapter, _currentTask.args)) {
  56841. break
  56842. }
  56843. }
  56844. }
  56845. _taskQueue.shift()
  56846. }
  56847. unmergeSortTasks();
  56848. _adapter.exec(url).done(function(result, extra) {
  56849. if (!_taskQueue.length) {
  56850. d.resolve(result, extra)
  56851. } else {
  56852. var clientChain = arrayQueryImpl(result, {
  56853. errorHandler: queryOptions.errorHandler
  56854. });
  56855. each(_taskQueue, function() {
  56856. clientChain = clientChain[this.name].apply(clientChain, this.args)
  56857. });
  56858. clientChain.done(d.resolve).fail(d.reject)
  56859. }
  56860. }).fail(rejectWithNotify)
  56861. } catch (x) {
  56862. rejectWithNotify(x)
  56863. }
  56864. return d.promise()
  56865. };
  56866. var query = {};
  56867. each(["sortBy", "thenBy", "filter", "slice", "select", "groupBy"], function() {
  56868. var name = String(this);
  56869. query[name] = function() {
  56870. return remoteQueryImpl(url, queryOptions, tasks.concat(createTask(name, arguments)))
  56871. }
  56872. });
  56873. each(["count", "min", "max", "sum", "avg", "aggregate", "enumerate"], function() {
  56874. var name = String(this);
  56875. query[name] = function() {
  56876. return exec.call(this, createTask(name, arguments))
  56877. }
  56878. });
  56879. return query
  56880. };
  56881. module.exports = remoteQueryImpl
  56882. },
  56883. /*!**********************************************************************************!*\
  56884. !*** ./artifacts/transpiled/ui/collection/ui.collection_widget.edit.strategy.js ***!
  56885. \**********************************************************************************/
  56886. /*! dynamic exports provided */
  56887. /*! all exports used */
  56888. function(module, exports, __webpack_require__) {
  56889. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  56890. var Class = __webpack_require__( /*! ../../core/class */ 15);
  56891. var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
  56892. var abstract = Class.abstract;
  56893. var EditStrategy = Class.inherit({
  56894. ctor: function(collectionWidget) {
  56895. this._collectionWidget = collectionWidget
  56896. },
  56897. getIndexByItemData: abstract,
  56898. getItemDataByIndex: abstract,
  56899. getKeysByItems: abstract,
  56900. getItemsByKeys: abstract,
  56901. itemsGetter: abstract,
  56902. getKeyByIndex: function(index) {
  56903. var resultIndex = this._denormalizeItemIndex(index);
  56904. return this.getKeysByItems([this.getItemDataByIndex(resultIndex)])[0]
  56905. },
  56906. _equalKeys: function(key1, key2) {
  56907. if (this._collectionWidget._isKeySpecified()) {
  56908. return commonUtils.equalByValue(key1, key2)
  56909. } else {
  56910. return key1 === key2
  56911. }
  56912. },
  56913. beginCache: function() {
  56914. this._cache = {}
  56915. },
  56916. endCache: function() {
  56917. this._cache = null
  56918. },
  56919. getIndexByKey: abstract,
  56920. getNormalizedIndex: function(value) {
  56921. if (this._isNormalizedItemIndex(value)) {
  56922. return value
  56923. }
  56924. if (this._isItemIndex(value)) {
  56925. return this._normalizeItemIndex(value)
  56926. }
  56927. if (this._isDOMNode(value)) {
  56928. return this._getNormalizedItemIndex(value)
  56929. }
  56930. return this._normalizeItemIndex(this.getIndexByItemData(value))
  56931. },
  56932. getIndex: function(value) {
  56933. if (this._isNormalizedItemIndex(value)) {
  56934. return this._denormalizeItemIndex(value)
  56935. }
  56936. if (this._isItemIndex(value)) {
  56937. return value
  56938. }
  56939. if (this._isDOMNode(value)) {
  56940. return this._denormalizeItemIndex(this._getNormalizedItemIndex(value))
  56941. }
  56942. return this.getIndexByItemData(value)
  56943. },
  56944. getItemElement: function(value) {
  56945. if (this._isNormalizedItemIndex(value)) {
  56946. return this._getItemByNormalizedIndex(value)
  56947. }
  56948. if (this._isItemIndex(value)) {
  56949. return this._getItemByNormalizedIndex(this._normalizeItemIndex(value))
  56950. }
  56951. if (this._isDOMNode(value)) {
  56952. return $(value)
  56953. }
  56954. var normalizedItemIndex = this._normalizeItemIndex(this.getIndexByItemData(value));
  56955. return this._getItemByNormalizedIndex(normalizedItemIndex)
  56956. },
  56957. deleteItemAtIndex: abstract,
  56958. itemPlacementFunc: function(movingIndex, destinationIndex) {
  56959. return this._itemsFromSameParent(movingIndex, destinationIndex) && movingIndex < destinationIndex ? "after" : "before"
  56960. },
  56961. moveItemAtIndexToIndex: abstract,
  56962. _isNormalizedItemIndex: function(index) {
  56963. return "number" === typeof index && Math.round(index) === index
  56964. },
  56965. _isDOMNode: function(value) {
  56966. var $value;
  56967. try {
  56968. $value = $(value)
  56969. } catch (error) {
  56970. return false
  56971. }
  56972. return $value && $value.length && $value.get(0).nodeType
  56973. },
  56974. _isItemIndex: abstract,
  56975. _getNormalizedItemIndex: abstract,
  56976. _normalizeItemIndex: abstract,
  56977. _denormalizeItemIndex: abstract,
  56978. _getItemByNormalizedIndex: abstract,
  56979. _itemsFromSameParent: abstract
  56980. });
  56981. module.exports = EditStrategy
  56982. },
  56983. /*!**************************************************************************!*\
  56984. !*** ./artifacts/transpiled/ui/selection/selection.strategy.deferred.js ***!
  56985. \**************************************************************************/
  56986. /*! dynamic exports provided */
  56987. /*! all exports used */
  56988. function(module, exports, __webpack_require__) {
  56989. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  56990. var SelectionStrategy = __webpack_require__( /*! ./selection.strategy */ 272);
  56991. var errors = __webpack_require__( /*! ../widget/ui.errors */ 17);
  56992. var dataQuery = __webpack_require__( /*! ../../data/query */ 42);
  56993. var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred;
  56994. module.exports = SelectionStrategy.inherit({
  56995. getSelectedItems: function() {
  56996. return this._loadFilteredData(this.options.selectionFilter)
  56997. },
  56998. getSelectedItemKeys: function() {
  56999. var d = new Deferred;
  57000. var that = this;
  57001. var key = this.options.key();
  57002. var select = typeUtils.isString(key) ? [key] : key;
  57003. this._loadFilteredData(this.options.selectionFilter, null, select).done(function(items) {
  57004. var keys = items.map(function(item) {
  57005. return that.options.keyOf(item)
  57006. });
  57007. d.resolve(keys)
  57008. }).fail(d.reject);
  57009. return d.promise()
  57010. },
  57011. selectedItemKeys: function(keys, preserve, isDeselect, isSelectAll) {
  57012. if (isSelectAll) {
  57013. var filter = this.options.filter();
  57014. if (!filter) {
  57015. this._setOption("selectionFilter", isDeselect ? [] : null)
  57016. } else {
  57017. this._addSelectionFilter(isDeselect, filter, isSelectAll)
  57018. }
  57019. } else {
  57020. if (!preserve) {
  57021. this._setOption("selectionFilter", [])
  57022. }
  57023. for (var i = 0; i < keys.length; i++) {
  57024. if (isDeselect) {
  57025. this.removeSelectedItem(keys[i])
  57026. } else {
  57027. this.addSelectedItem(keys[i])
  57028. }
  57029. }
  57030. }
  57031. this.onSelectionChanged();
  57032. return (new Deferred).resolve()
  57033. },
  57034. setSelectedItems: function(keys) {
  57035. this._setOption("selectionFilter", null);
  57036. for (var i = 0; i < keys.length; i++) {
  57037. this.addSelectedItem(keys[i])
  57038. }
  57039. },
  57040. isItemDataSelected: function(itemData) {
  57041. return this.isItemKeySelected(itemData)
  57042. },
  57043. isItemKeySelected: function(itemData) {
  57044. var selectionFilter = this.options.selectionFilter;
  57045. if (!selectionFilter) {
  57046. return true
  57047. }
  57048. return !!dataQuery([itemData]).filter(selectionFilter).toArray().length
  57049. },
  57050. _getFilterByKey: function(key) {
  57051. var keyField = this.options.key();
  57052. var filter = [keyField, "=", key];
  57053. if (Array.isArray(keyField)) {
  57054. filter = [];
  57055. for (var i = 0; i < keyField.length; i++) {
  57056. filter.push([keyField[i], "=", key[keyField[i]]]);
  57057. if (i !== keyField.length - 1) {
  57058. filter.push("and")
  57059. }
  57060. }
  57061. }
  57062. return filter
  57063. },
  57064. addSelectedItem: function(key) {
  57065. var filter = this._getFilterByKey(key);
  57066. this._addSelectionFilter(false, filter)
  57067. },
  57068. removeSelectedItem: function(key) {
  57069. var filter = this._getFilterByKey(key);
  57070. this._addSelectionFilter(true, filter)
  57071. },
  57072. validate: function() {
  57073. var key = this.options.key;
  57074. if (key && void 0 === key()) {
  57075. throw errors.Error("E1042", "Deferred selection")
  57076. }
  57077. },
  57078. _findSubFilter: function(selectionFilter, filter) {
  57079. if (!selectionFilter) {
  57080. return -1
  57081. }
  57082. var filterString = JSON.stringify(filter);
  57083. for (var index = 0; index < selectionFilter.length; index++) {
  57084. var subFilter = selectionFilter[index];
  57085. if (subFilter && JSON.stringify(subFilter) === filterString) {
  57086. return index
  57087. }
  57088. }
  57089. return -1
  57090. },
  57091. _isLastSubFilter: function(selectionFilter, filter) {
  57092. if (selectionFilter && filter) {
  57093. return this._findSubFilter(selectionFilter, filter) === selectionFilter.length - 1 || 0 === this._findSubFilter([selectionFilter], filter)
  57094. }
  57095. return false
  57096. },
  57097. _addFilterOperator: function(selectionFilter, filterOperator) {
  57098. if (selectionFilter.length > 1 && typeUtils.isString(selectionFilter[1]) && selectionFilter[1] !== filterOperator) {
  57099. selectionFilter = [selectionFilter]
  57100. }
  57101. if (selectionFilter.length) {
  57102. selectionFilter.push(filterOperator)
  57103. }
  57104. return selectionFilter
  57105. },
  57106. _denormalizeFilter: function(filter) {
  57107. if (filter && typeUtils.isString(filter[0])) {
  57108. filter = [filter]
  57109. }
  57110. return filter
  57111. },
  57112. _addSelectionFilter: function(isDeselect, filter, isSelectAll) {
  57113. var that = this;
  57114. var currentFilter = isDeselect ? ["!", filter] : filter;
  57115. var currentOperation = isDeselect ? "and" : "or";
  57116. var needAddFilter = true;
  57117. var selectionFilter = that.options.selectionFilter || [];
  57118. selectionFilter = that._denormalizeFilter(selectionFilter);
  57119. if (selectionFilter && selectionFilter.length) {
  57120. that._removeSameFilter(selectionFilter, filter, isDeselect, isSelectAll);
  57121. var filterIndex = that._removeSameFilter(selectionFilter, filter, !isDeselect);
  57122. var isKeyOperatorsAfterRemoved = this._isKeyFilter(filter) && this._hasKeyFiltersOnlyStartingFromIndex(selectionFilter, filterIndex);
  57123. needAddFilter = filter.length && !isKeyOperatorsAfterRemoved;
  57124. if (needAddFilter) {
  57125. selectionFilter = that._addFilterOperator(selectionFilter, currentOperation)
  57126. }
  57127. }
  57128. if (needAddFilter) {
  57129. selectionFilter.push(currentFilter)
  57130. }
  57131. selectionFilter = that._normalizeFilter(selectionFilter);
  57132. that._setOption("selectionFilter", !isDeselect && !selectionFilter.length ? null : selectionFilter)
  57133. },
  57134. _normalizeFilter: function(filter) {
  57135. if (filter && 1 === filter.length) {
  57136. filter = filter[0]
  57137. }
  57138. return filter
  57139. },
  57140. _removeFilterByIndex: function(filter, filterIndex, isSelectAll) {
  57141. var operation = filter[1];
  57142. if (filterIndex > 0) {
  57143. filter.splice(filterIndex - 1, 2)
  57144. } else {
  57145. filter.splice(filterIndex, 2)
  57146. }
  57147. if (isSelectAll && "and" === operation) {
  57148. filter.splice(0, filter.length)
  57149. }
  57150. },
  57151. _isSimpleKeyFilter: function(filter, key) {
  57152. return 3 === filter.length && filter[0] === key && "=" === filter[1]
  57153. },
  57154. _isKeyFilter: function(filter) {
  57155. if (2 === filter.length && "!" === filter[0]) {
  57156. return this._isKeyFilter(filter[1])
  57157. }
  57158. var keyField = this.options.key();
  57159. if (Array.isArray(keyField)) {
  57160. if (filter.length !== 2 * keyField.length - 1) {
  57161. return false
  57162. }
  57163. for (var i = 0; i < keyField.length; i++) {
  57164. if (i > 0 && "and" !== filter[i]) {
  57165. return false
  57166. }
  57167. if (!this._isSimpleKeyFilter(filter[2 * i], keyField[i])) {
  57168. return false
  57169. }
  57170. }
  57171. return true
  57172. }
  57173. return this._isSimpleKeyFilter(filter, keyField)
  57174. },
  57175. _hasKeyFiltersOnlyStartingFromIndex: function(selectionFilter, filterIndex) {
  57176. if (filterIndex >= 0) {
  57177. for (var i = filterIndex; i < selectionFilter.length; i++) {
  57178. if ("string" !== typeof selectionFilter[i] && !this._isKeyFilter(selectionFilter[i])) {
  57179. return false
  57180. }
  57181. }
  57182. return true
  57183. }
  57184. return false
  57185. },
  57186. _removeSameFilter: function(selectionFilter, filter, inverted, isSelectAll) {
  57187. filter = inverted ? ["!", filter] : filter;
  57188. if (JSON.stringify(filter) === JSON.stringify(selectionFilter)) {
  57189. selectionFilter.splice(0, selectionFilter.length);
  57190. return 0
  57191. }
  57192. var filterIndex = this._findSubFilter(selectionFilter, filter);
  57193. if (filterIndex >= 0) {
  57194. this._removeFilterByIndex(selectionFilter, filterIndex, isSelectAll);
  57195. return filterIndex
  57196. } else {
  57197. for (var i = 0; i < selectionFilter.length; i++) {
  57198. if (Array.isArray(selectionFilter[i]) && selectionFilter[i].length > 2) {
  57199. var _filterIndex = this._removeSameFilter(selectionFilter[i], filter, false, isSelectAll);
  57200. if (_filterIndex >= 0) {
  57201. if (!selectionFilter[i].length) {
  57202. this._removeFilterByIndex(selectionFilter, i, isSelectAll)
  57203. } else {
  57204. if (1 === selectionFilter[i].length) {
  57205. selectionFilter[i] = selectionFilter[i][0]
  57206. }
  57207. }
  57208. return _filterIndex
  57209. }
  57210. }
  57211. }
  57212. return -1
  57213. }
  57214. },
  57215. getSelectAllState: function() {
  57216. var filter = this.options.filter();
  57217. var selectionFilter = this.options.selectionFilter;
  57218. if (!selectionFilter) {
  57219. return true
  57220. }
  57221. if (!selectionFilter.length) {
  57222. return false
  57223. }
  57224. if (!filter || !filter.length) {
  57225. return
  57226. }
  57227. selectionFilter = this._denormalizeFilter(selectionFilter);
  57228. if (this._isLastSubFilter(selectionFilter, filter)) {
  57229. return true
  57230. }
  57231. if (this._isLastSubFilter(selectionFilter, ["!", filter])) {
  57232. return false
  57233. }
  57234. return
  57235. }
  57236. })
  57237. },
  57238. /*!**************************************************************************!*\
  57239. !*** ./artifacts/transpiled/ui/selection/selection.strategy.standard.js ***!
  57240. \**************************************************************************/
  57241. /*! dynamic exports provided */
  57242. /*! all exports used */
  57243. function(module, exports, __webpack_require__) {
  57244. var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
  57245. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  57246. var getKeyHash = commonUtils.getKeyHash;
  57247. var dataQuery = __webpack_require__( /*! ../../data/query */ 42);
  57248. var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
  57249. var SelectionFilterCreator = __webpack_require__( /*! ../../core/utils/selection_filter */ 284).SelectionFilterCreator;
  57250. var when = deferredUtils.when;
  57251. var Deferred = deferredUtils.Deferred;
  57252. var errors = __webpack_require__( /*! ../widget/ui.errors */ 17);
  57253. var SelectionStrategy = __webpack_require__( /*! ./selection.strategy */ 272);
  57254. module.exports = SelectionStrategy.inherit({
  57255. ctor: function(options) {
  57256. this.callBase(options);
  57257. this._initSelectedItemKeyHash()
  57258. },
  57259. _initSelectedItemKeyHash: function() {
  57260. this._setOption("keyHashIndices", this.options.equalByReference ? null : {})
  57261. },
  57262. getSelectedItemKeys: function() {
  57263. return this.options.selectedItemKeys.slice(0)
  57264. },
  57265. getSelectedItems: function() {
  57266. return this.options.selectedItems.slice(0)
  57267. },
  57268. _preserveSelectionUpdate: function(items, isDeselect) {
  57269. var keyOf = this.options.keyOf;
  57270. var keyIndicesToRemoveMap;
  57271. var keyIndex;
  57272. var i;
  57273. if (!keyOf) {
  57274. return
  57275. }
  57276. var isBatchDeselect = isDeselect && items.length > 1 && !this.options.equalByReference;
  57277. if (isBatchDeselect) {
  57278. keyIndicesToRemoveMap = {}
  57279. }
  57280. for (i = 0; i < items.length; i++) {
  57281. var item = items[i];
  57282. var key = keyOf(item);
  57283. if (isDeselect) {
  57284. keyIndex = this.removeSelectedItem(key, keyIndicesToRemoveMap);
  57285. if (keyIndicesToRemoveMap && keyIndex >= 0) {
  57286. keyIndicesToRemoveMap[keyIndex] = true
  57287. }
  57288. } else {
  57289. this.addSelectedItem(key, item)
  57290. }
  57291. }
  57292. if (isBatchDeselect) {
  57293. this._batchRemoveSelectedItems(keyIndicesToRemoveMap)
  57294. }
  57295. },
  57296. _batchRemoveSelectedItems: function(keyIndicesToRemoveMap) {
  57297. var selectedItemKeys = this.options.selectedItemKeys.slice(0);
  57298. var selectedItems = this.options.selectedItems.slice(0);
  57299. this.options.selectedItemKeys.length = 0;
  57300. this.options.selectedItems.length = 0;
  57301. for (var i = 0; i < selectedItemKeys.length; i++) {
  57302. if (!keyIndicesToRemoveMap[i]) {
  57303. this.options.selectedItemKeys.push(selectedItemKeys[i]);
  57304. this.options.selectedItems.push(selectedItems[i])
  57305. }
  57306. }
  57307. this._initSelectedItemKeyHash();
  57308. this.updateSelectedItemKeyHash(this.options.selectedItemKeys)
  57309. },
  57310. _loadSelectedItemsCore: function(keys, isDeselect, isSelectAll) {
  57311. var deferred = new Deferred;
  57312. var key = this.options.key();
  57313. if (!keys.length && !isSelectAll) {
  57314. deferred.resolve([]);
  57315. return deferred
  57316. }
  57317. var filter = this.options.filter();
  57318. if (isSelectAll && isDeselect && !filter) {
  57319. deferred.resolve(this.getSelectedItems());
  57320. return deferred
  57321. }
  57322. var selectionFilterCreator = new SelectionFilterCreator(keys, isSelectAll);
  57323. var combinedFilter = selectionFilterCreator.getCombinedFilter(key, filter);
  57324. var deselectedItems = [];
  57325. if (isDeselect) {
  57326. deselectedItems = combinedFilter ? dataQuery(this.options.selectedItems).filter(combinedFilter).toArray() : this.options.selectedItems.slice(0)
  57327. }
  57328. var filteredItems = deselectedItems.length ? deselectedItems : this.options.plainItems(true).filter(this.options.isSelectableItem).map(this.options.getItemData);
  57329. var localFilter = selectionFilterCreator.getLocalFilter(this.options.keyOf, this.equalKeys.bind(this), this.options.equalByReference, key);
  57330. filteredItems = filteredItems.filter(localFilter);
  57331. if (deselectedItems.length || !isSelectAll && filteredItems.length === keys.length) {
  57332. deferred.resolve(filteredItems)
  57333. } else {
  57334. deferred = this._loadFilteredData(combinedFilter, localFilter, null, isSelectAll)
  57335. }
  57336. return deferred
  57337. },
  57338. _replaceSelectionUpdate: function(items) {
  57339. var internalKeys = [];
  57340. var keyOf = this.options.keyOf;
  57341. if (!keyOf) {
  57342. return
  57343. }
  57344. for (var i = 0; i < items.length; i++) {
  57345. var item = items[i];
  57346. var key = keyOf(item);
  57347. internalKeys.push(key)
  57348. }
  57349. this.setSelectedItems(internalKeys, items)
  57350. },
  57351. _warnOnIncorrectKeys: function(keys) {
  57352. var allowNullValue = this.options.allowNullValue;
  57353. for (var i = 0; i < keys.length; i++) {
  57354. var key = keys[i];
  57355. if ((!allowNullValue || null !== key) && !this.isItemKeySelected(key)) {
  57356. errors.log("W1002", key)
  57357. }
  57358. }
  57359. },
  57360. _loadSelectedItems: function(keys, isDeselect, isSelectAll) {
  57361. var that = this;
  57362. var deferred = new Deferred;
  57363. when(that._lastLoadDeferred).always(function() {
  57364. that._loadSelectedItemsCore(keys, isDeselect, isSelectAll).done(deferred.resolve).fail(deferred.reject)
  57365. });
  57366. that._lastLoadDeferred = deferred;
  57367. return deferred
  57368. },
  57369. selectedItemKeys: function(keys, preserve, isDeselect, isSelectAll) {
  57370. var that = this;
  57371. var deferred = that._loadSelectedItems(keys, isDeselect, isSelectAll);
  57372. deferred.done(function(items) {
  57373. if (preserve) {
  57374. that._preserveSelectionUpdate(items, isDeselect)
  57375. } else {
  57376. that._replaceSelectionUpdate(items)
  57377. }
  57378. if (!isSelectAll && !isDeselect) {
  57379. that._warnOnIncorrectKeys(keys)
  57380. }
  57381. that.onSelectionChanged()
  57382. });
  57383. return deferred
  57384. },
  57385. addSelectedItem: function(key, itemData) {
  57386. var keyHash = this._getKeyHash(key);
  57387. if (this._indexOfSelectedItemKey(keyHash) === -1) {
  57388. if (!typeUtils.isObject(keyHash) && this.options.keyHashIndices) {
  57389. this.options.keyHashIndices[keyHash] = [this.options.selectedItemKeys.length]
  57390. }
  57391. this.options.selectedItemKeys.push(key);
  57392. this.options.addedItemKeys.push(key);
  57393. this.options.addedItems.push(itemData);
  57394. this.options.selectedItems.push(itemData)
  57395. }
  57396. },
  57397. _getSelectedIndexByKey: function(key, ignoreIndicesMap) {
  57398. var selectedItemKeys = this.options.selectedItemKeys;
  57399. for (var index = 0; index < selectedItemKeys.length; index++) {
  57400. if ((!ignoreIndicesMap || !ignoreIndicesMap[index]) && this.equalKeys(selectedItemKeys[index], key)) {
  57401. return index
  57402. }
  57403. }
  57404. return -1
  57405. },
  57406. _getSelectedIndexByHash: function(key, ignoreIndicesMap) {
  57407. var indices = this.options.keyHashIndices[key];
  57408. if (indices && indices.length > 1 && ignoreIndicesMap) {
  57409. indices = indices.filter(function(index) {
  57410. return !ignoreIndicesMap[index]
  57411. })
  57412. }
  57413. return indices && indices[0] >= 0 ? indices[0] : -1
  57414. },
  57415. _indexOfSelectedItemKey: function(key, ignoreIndicesMap) {
  57416. var selectedIndex;
  57417. if (this.options.equalByReference) {
  57418. selectedIndex = this.options.selectedItemKeys.indexOf(key)
  57419. } else {
  57420. if (typeUtils.isObject(key)) {
  57421. selectedIndex = this._getSelectedIndexByKey(key, ignoreIndicesMap)
  57422. } else {
  57423. selectedIndex = this._getSelectedIndexByHash(key, ignoreIndicesMap)
  57424. }
  57425. }
  57426. return selectedIndex
  57427. },
  57428. _shiftSelectedKeyIndices: function(keyIndex) {
  57429. for (var currentKeyIndex = keyIndex; currentKeyIndex < this.options.selectedItemKeys.length; currentKeyIndex++) {
  57430. var currentKey = this.options.selectedItemKeys[currentKeyIndex];
  57431. var currentKeyHash = getKeyHash(currentKey);
  57432. var currentKeyIndices = this.options.keyHashIndices[currentKeyHash];
  57433. if (!currentKeyIndices) {
  57434. continue
  57435. }
  57436. for (var i = 0; i < currentKeyIndices.length; i++) {
  57437. if (currentKeyIndices[i] > keyIndex) {
  57438. currentKeyIndices[i]--
  57439. }
  57440. }
  57441. }
  57442. },
  57443. removeSelectedItem: function(key, keyIndicesToRemoveMap) {
  57444. var keyHash = this._getKeyHash(key);
  57445. var isBatchDeselect = !!keyIndicesToRemoveMap;
  57446. var keyIndex = this._indexOfSelectedItemKey(keyHash, keyIndicesToRemoveMap);
  57447. if (keyIndex < 0) {
  57448. return keyIndex
  57449. }
  57450. this.options.removedItemKeys.push(key);
  57451. this.options.removedItems.push(this.options.selectedItems[keyIndex]);
  57452. if (isBatchDeselect) {
  57453. return keyIndex
  57454. }
  57455. this.options.selectedItemKeys.splice(keyIndex, 1);
  57456. this.options.selectedItems.splice(keyIndex, 1);
  57457. if (typeUtils.isObject(keyHash) || !this.options.keyHashIndices) {
  57458. return keyIndex
  57459. }
  57460. var keyIndices = this.options.keyHashIndices[keyHash];
  57461. if (!keyIndices) {
  57462. return keyIndex
  57463. }
  57464. keyIndices.shift();
  57465. if (!keyIndices.length) {
  57466. delete this.options.keyHashIndices[keyHash]
  57467. }
  57468. this._shiftSelectedKeyIndices(keyIndex);
  57469. return keyIndex
  57470. },
  57471. _updateAddedItemKeys: function(keys, items) {
  57472. for (var i = 0; i < keys.length; i++) {
  57473. if (!this.isItemKeySelected(keys[i])) {
  57474. this.options.addedItemKeys.push(keys[i]);
  57475. this.options.addedItems.push(items[i])
  57476. }
  57477. }
  57478. },
  57479. _updateRemovedItemKeys: function(keys, oldSelectedKeys, oldSelectedItems) {
  57480. for (var i = 0; i < oldSelectedKeys.length; i++) {
  57481. if (!this.isItemKeySelected(oldSelectedKeys[i])) {
  57482. this.options.removedItemKeys.push(oldSelectedKeys[i]);
  57483. this.options.removedItems.push(oldSelectedItems[i])
  57484. }
  57485. }
  57486. },
  57487. _getKeyHash: function(key) {
  57488. return this.options.equalByReference ? key : getKeyHash(key)
  57489. },
  57490. setSelectedItems: function(keys, items) {
  57491. this._updateAddedItemKeys(keys, items);
  57492. var oldSelectedKeys = this.options.selectedItemKeys;
  57493. var oldSelectedItems = this.options.selectedItems;
  57494. if (!this.options.equalByReference) {
  57495. this._initSelectedItemKeyHash();
  57496. this.updateSelectedItemKeyHash(keys)
  57497. }
  57498. this._setOption("selectedItemKeys", keys);
  57499. this._setOption("selectedItems", items);
  57500. this._updateRemovedItemKeys(keys, oldSelectedKeys, oldSelectedItems)
  57501. },
  57502. isItemDataSelected: function(itemData) {
  57503. var key = this.options.keyOf(itemData);
  57504. return this.isItemKeySelected(key)
  57505. },
  57506. isItemKeySelected: function(key) {
  57507. var keyHash = this._getKeyHash(key);
  57508. var index = this._indexOfSelectedItemKey(keyHash);
  57509. return index !== -1
  57510. },
  57511. getSelectAllState: function(visibleOnly) {
  57512. if (visibleOnly) {
  57513. return this._getVisibleSelectAllState()
  57514. } else {
  57515. return this._getFullSelectAllState()
  57516. }
  57517. }
  57518. })
  57519. },
  57520. /*!***********************************************************************!*\
  57521. !*** ./artifacts/transpiled/integration/angular/event_registrator.js ***!
  57522. \***********************************************************************/
  57523. /*! dynamic exports provided */
  57524. /*! all exports used */
  57525. function(module, exports, __webpack_require__) {
  57526. var eventRegistratorCallbacks = __webpack_require__( /*! ../../events/core/event_registrator_callbacks */ 122);
  57527. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  57528. var ngModule = __webpack_require__( /*! ./module */ 180);
  57529. eventRegistratorCallbacks.add(function(name) {
  57530. var ngEventName = name.slice(0, 2) + name.charAt(2).toUpperCase() + name.slice(3);
  57531. ngModule.directive(ngEventName, ["$parse", function($parse) {
  57532. return function(scope, element, attr) {
  57533. var attrValue = attr[ngEventName].trim();
  57534. var handler;
  57535. var eventOptions = {};
  57536. if ("{" === attrValue.charAt(0)) {
  57537. eventOptions = scope.$eval(attrValue);
  57538. handler = $parse(eventOptions.execute)
  57539. } else {
  57540. handler = $parse(attr[ngEventName])
  57541. }
  57542. eventsEngine.on(element, name, eventOptions, function(e) {
  57543. scope.$apply(function() {
  57544. handler(scope, {
  57545. $event: e
  57546. })
  57547. })
  57548. })
  57549. }
  57550. }])
  57551. })
  57552. },
  57553. /*!****************************************************************!*\
  57554. !*** ./artifacts/transpiled/integration/angular/components.js ***!
  57555. \****************************************************************/
  57556. /*! dynamic exports provided */
  57557. /*! all exports used */
  57558. function(module, exports, __webpack_require__) {
  57559. var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
  57560. var ngModule = __webpack_require__( /*! ./module */ 180);
  57561. ngModule.service("dxDigestCallbacks", ["$rootScope", function($rootScope) {
  57562. var begin = Callbacks();
  57563. var prioritizedEnd = Callbacks();
  57564. var end = Callbacks();
  57565. var digestPhase = false;
  57566. $rootScope.$watch(function() {
  57567. if (digestPhase) {
  57568. return
  57569. }
  57570. digestPhase = true;
  57571. begin.fire();
  57572. $rootScope.$$postDigest(function() {
  57573. digestPhase = false;
  57574. prioritizedEnd.fire();
  57575. end.fire()
  57576. })
  57577. });
  57578. return {
  57579. begin: {
  57580. add: function(callback) {
  57581. if (digestPhase) {
  57582. callback()
  57583. }
  57584. begin.add(callback)
  57585. },
  57586. remove: begin.remove.bind(begin)
  57587. },
  57588. end: {
  57589. add: end.add.bind(end),
  57590. addPrioritized: prioritizedEnd.add.bind(prioritizedEnd),
  57591. remove: end.remove.bind(end)
  57592. }
  57593. }
  57594. }])
  57595. },
  57596. /*!**********************************************************************!*\
  57597. !*** ./artifacts/transpiled/integration/angular/action_executors.js ***!
  57598. \**********************************************************************/
  57599. /*! dynamic exports provided */
  57600. /*! all exports used */
  57601. function(module, exports, __webpack_require__) {
  57602. var Action = __webpack_require__( /*! ../../core/action */ 111);
  57603. Action.registerExecutor({
  57604. ngExpression: {
  57605. execute: function(e) {
  57606. if ("string" === typeof e.action) {
  57607. e.context.$eval(e.action)
  57608. }
  57609. }
  57610. }
  57611. })
  57612. },
  57613. /*!******************************************************!*\
  57614. !*** ./artifacts/transpiled/integration/knockout.js ***!
  57615. \******************************************************/
  57616. /*! dynamic exports provided */
  57617. /*! all exports used */
  57618. function(module, exports, __webpack_require__) {
  57619. var ko = __webpack_require__( /*! knockout */ 62);
  57620. if (ko) {
  57621. var errors = __webpack_require__( /*! ../core/errors */ 21);
  57622. var compareVersion = __webpack_require__( /*! ../core/utils/version */ 61).compare;
  57623. if (compareVersion(ko.version, [2, 3]) < 0) {
  57624. throw errors.Error("E0013")
  57625. }
  57626. __webpack_require__( /*! ./knockout/component_registrator */ 476);
  57627. __webpack_require__( /*! ./knockout/event_registrator */ 478);
  57628. __webpack_require__( /*! ./knockout/components */ 479);
  57629. __webpack_require__( /*! ./knockout/validation */ 480);
  57630. __webpack_require__( /*! ./knockout/variable_wrapper_utils */ 481);
  57631. __webpack_require__( /*! ./knockout/clean_node */ 482);
  57632. __webpack_require__( /*! ./knockout/clean_node_old */ 483)
  57633. }
  57634. },
  57635. /*!****************************************************************************!*\
  57636. !*** ./artifacts/transpiled/integration/knockout/component_registrator.js ***!
  57637. \****************************************************************************/
  57638. /*! dynamic exports provided */
  57639. /*! all exports used */
  57640. function(module, exports, __webpack_require__) {
  57641. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  57642. var ko = __webpack_require__( /*! knockout */ 62);
  57643. var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
  57644. var errors = __webpack_require__( /*! ../../core/errors */ 21);
  57645. var inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
  57646. var isPlainObject = __webpack_require__( /*! ../../core/utils/type */ 1).isPlainObject;
  57647. var registerComponentCallbacks = __webpack_require__( /*! ../../core/component_registrator_callbacks */ 153);
  57648. var Widget = __webpack_require__( /*! ../../ui/widget/ui.widget */ 18);
  57649. var KoTemplate = __webpack_require__( /*! ./template */ 477);
  57650. var Editor = __webpack_require__( /*! ../../ui/editor/editor */ 49);
  57651. var Locker = __webpack_require__( /*! ../../core/utils/locker */ 271);
  57652. var getClosestNodeWithContext = __webpack_require__( /*! ./utils */ 273).getClosestNodeWithContext;
  57653. var config = __webpack_require__( /*! ../../core/config */ 31);
  57654. var LOCKS_DATA_KEY = "dxKoLocks";
  57655. var CREATED_WITH_KO_DATA_KEY = "dxKoCreation";
  57656. var editorsBindingHandlers = [];
  57657. var registerComponentKoBinding = function(componentName, componentClass) {
  57658. if (componentClass.subclassOf(Editor)) {
  57659. editorsBindingHandlers.push(componentName)
  57660. }
  57661. ko.bindingHandlers[componentName] = {
  57662. init: function(domNode, valueAccessor) {
  57663. var $element = $(domNode);
  57664. var optionChangedCallbacks = Callbacks();
  57665. var optionsByReference = {};
  57666. var component;
  57667. var knockoutConfig = config().knockout;
  57668. var isBindingPropertyPredicateName = knockoutConfig && knockoutConfig.isBindingPropertyPredicateName;
  57669. var isBindingPropertyPredicate;
  57670. var ctorOptions = {
  57671. onInitializing: function() {
  57672. optionsByReference = this._getOptionsByReference();
  57673. ko.computed(function() {
  57674. var model = ko.unwrap(valueAccessor());
  57675. if (component) {
  57676. component.beginUpdate()
  57677. }
  57678. isBindingPropertyPredicate = isBindingPropertyPredicateName && model && model[isBindingPropertyPredicateName];
  57679. unwrapModel(model);
  57680. if (component) {
  57681. component.endUpdate()
  57682. }
  57683. }, null, {
  57684. disposeWhenNodeIsRemoved: domNode
  57685. });
  57686. component = this
  57687. },
  57688. modelByElement: function($element) {
  57689. if ($element.length) {
  57690. var node = getClosestNodeWithContext($element.get(0));
  57691. return ko.dataFor(node)
  57692. }
  57693. },
  57694. nestedComponentOptions: function(component) {
  57695. return {
  57696. modelByElement: component.option("modelByElement"),
  57697. nestedComponentOptions: component.option("nestedComponentOptions")
  57698. }
  57699. },
  57700. _optionChangedCallbacks: optionChangedCallbacks,
  57701. integrationOptions: {
  57702. watchMethod: function(fn, callback, options) {
  57703. options = options || {};
  57704. var skipCallback = options.skipImmediate;
  57705. var watcher = ko.computed(function() {
  57706. var newValue = ko.unwrap(fn());
  57707. if (!skipCallback) {
  57708. callback(newValue)
  57709. }
  57710. skipCallback = false
  57711. });
  57712. return function() {
  57713. watcher.dispose()
  57714. }
  57715. },
  57716. templates: {
  57717. "dx-polymorph-widget": {
  57718. render: function(options) {
  57719. var widgetName = ko.utils.unwrapObservable(options.model.widget);
  57720. if (!widgetName) {
  57721. return
  57722. }
  57723. if ("button" === widgetName || "tabs" === widgetName || "dropDownMenu" === widgetName) {
  57724. var deprecatedName = widgetName;
  57725. widgetName = inflector.camelize("dx-" + widgetName);
  57726. errors.log("W0001", "dxToolbar - 'widget' item field", deprecatedName, "16.1", "Use: '" + widgetName + "' instead")
  57727. }
  57728. var markup = $("<div>").attr("data-bind", widgetName + ": options").get(0);
  57729. $(options.container).append(markup);
  57730. ko.applyBindings(options.model, markup)
  57731. }
  57732. }
  57733. },
  57734. createTemplate: function(element) {
  57735. return new KoTemplate(element)
  57736. }
  57737. }
  57738. };
  57739. var optionNameToModelMap = {};
  57740. var applyModelValueToOption = function(optionName, modelValue, unwrap) {
  57741. var locks = $element.data(LOCKS_DATA_KEY);
  57742. var optionValue = unwrap ? ko.unwrap(modelValue) : modelValue;
  57743. if (ko.isWriteableObservable(modelValue)) {
  57744. optionNameToModelMap[optionName] = modelValue
  57745. }
  57746. if (component) {
  57747. if (locks.locked(optionName)) {
  57748. return
  57749. }
  57750. locks.obtain(optionName);
  57751. try {
  57752. if (ko.ignoreDependencies) {
  57753. ko.ignoreDependencies(component.option, component, [optionName, optionValue])
  57754. } else {
  57755. component.option(optionName, optionValue)
  57756. }
  57757. } finally {
  57758. locks.release(optionName)
  57759. }
  57760. } else {
  57761. ctorOptions[optionName] = optionValue
  57762. }
  57763. };
  57764. var handleOptionChanged = function(args) {
  57765. var optionName = args.fullName;
  57766. var optionValue = args.value;
  57767. if (!(optionName in optionNameToModelMap)) {
  57768. return
  57769. }
  57770. var $element = this._$element;
  57771. var locks = $element.data(LOCKS_DATA_KEY);
  57772. if (locks.locked(optionName)) {
  57773. return
  57774. }
  57775. locks.obtain(optionName);
  57776. try {
  57777. optionNameToModelMap[optionName](optionValue)
  57778. } finally {
  57779. locks.release(optionName)
  57780. }
  57781. };
  57782. var createComponent = function() {
  57783. optionChangedCallbacks.add(handleOptionChanged);
  57784. $element.data(CREATED_WITH_KO_DATA_KEY, true).data(LOCKS_DATA_KEY, new Locker);
  57785. new componentClass($element, ctorOptions);
  57786. ctorOptions = null
  57787. };
  57788. var unwrapModelValue = function(currentModel, propertyName, propertyPath) {
  57789. if (propertyPath === isBindingPropertyPredicateName) {
  57790. return
  57791. }
  57792. if (!isBindingPropertyPredicate || isBindingPropertyPredicate(propertyPath, propertyName, currentModel)) {
  57793. var unwrappedPropertyValue;
  57794. ko.computed(function() {
  57795. var propertyValue = currentModel[propertyName];
  57796. applyModelValueToOption(propertyPath, propertyValue, true);
  57797. unwrappedPropertyValue = ko.unwrap(propertyValue)
  57798. }, null, {
  57799. disposeWhenNodeIsRemoved: domNode
  57800. });
  57801. if (isPlainObject(unwrappedPropertyValue)) {
  57802. if (!optionsByReference[propertyPath]) {
  57803. unwrapModel(unwrappedPropertyValue, propertyPath)
  57804. }
  57805. }
  57806. } else {
  57807. applyModelValueToOption(propertyPath, currentModel[propertyName], false)
  57808. }
  57809. };
  57810. var unwrapModel = function(model, propertyPath) {
  57811. for (var propertyName in model) {
  57812. if (Object.prototype.hasOwnProperty.call(model, propertyName)) {
  57813. unwrapModelValue(model, propertyName, propertyPath ? [propertyPath, propertyName].join(".") : propertyName)
  57814. }
  57815. }
  57816. };
  57817. createComponent();
  57818. return {
  57819. controlsDescendantBindings: componentClass.subclassOf(Widget)
  57820. }
  57821. }
  57822. };
  57823. if ("dxValidator" === componentName) {
  57824. ko.bindingHandlers.dxValidator.after = editorsBindingHandlers
  57825. }
  57826. };
  57827. registerComponentCallbacks.add(function(name, componentClass) {
  57828. registerComponentKoBinding(name, componentClass)
  57829. })
  57830. },
  57831. /*!***************************************************************!*\
  57832. !*** ./artifacts/transpiled/integration/knockout/template.js ***!
  57833. \***************************************************************/
  57834. /*! dynamic exports provided */
  57835. /*! all exports used */
  57836. function(module, exports, __webpack_require__) {
  57837. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  57838. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  57839. var ko = __webpack_require__( /*! knockout */ 62);
  57840. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  57841. var TemplateBase = __webpack_require__( /*! ../../ui/widget/ui.template_base */ 74);
  57842. var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
  57843. var getClosestNodeWithContext = __webpack_require__( /*! ./utils */ 273).getClosestNodeWithContext;
  57844. var getParentContext = function(data) {
  57845. var parentNode = domAdapter.createElement("div");
  57846. ko.applyBindingsToNode(parentNode, null, data);
  57847. var parentContext = ko.contextFor(parentNode);
  57848. ko.cleanNode(parentNode);
  57849. return parentContext
  57850. };
  57851. var KoTemplate = TemplateBase.inherit({
  57852. ctor: function(element) {
  57853. this._element = element;
  57854. this._template = $("<div>").append(domUtils.normalizeTemplateElement(element));
  57855. this._registerKoTemplate()
  57856. },
  57857. _registerKoTemplate: function() {
  57858. var template = this._template.get(0);
  57859. new ko.templateSources.anonymousTemplate(template).nodes(template)
  57860. },
  57861. _prepareDataForContainer: function(data, container) {
  57862. if (container && container.length) {
  57863. var containerElement = container.get(0);
  57864. var node = getClosestNodeWithContext(containerElement);
  57865. var containerContext = ko.contextFor(node);
  57866. data = void 0 !== data ? data : ko.dataFor(node) || {};
  57867. if (containerContext) {
  57868. return data === containerContext.$data ? containerContext : containerContext.createChildContext(data)
  57869. }
  57870. }
  57871. return getParentContext(data).createChildContext(data)
  57872. },
  57873. _renderCore: function(options) {
  57874. var model = this._prepareDataForContainer(options.model, $(options.container));
  57875. if (typeUtils.isDefined(options.index)) {
  57876. model.$index = options.index
  57877. }
  57878. var $placeholder = $("<div>").appendTo(options.container);
  57879. var $result;
  57880. ko.renderTemplate(this._template.get(0), model, {
  57881. afterRender: function(nodes) {
  57882. $result = $(nodes)
  57883. }
  57884. }, $placeholder.get(0), "replaceNode");
  57885. return $result
  57886. },
  57887. source: function() {
  57888. return $(this._element).clone()
  57889. },
  57890. dispose: function() {
  57891. this._template.remove()
  57892. }
  57893. });
  57894. module.exports = KoTemplate
  57895. },
  57896. /*!************************************************************************!*\
  57897. !*** ./artifacts/transpiled/integration/knockout/event_registrator.js ***!
  57898. \************************************************************************/
  57899. /*! dynamic exports provided */
  57900. /*! all exports used */
  57901. function(module, exports, __webpack_require__) {
  57902. var $ = __webpack_require__( /*! ../../core/renderer */ 2);
  57903. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  57904. var ko = __webpack_require__( /*! knockout */ 62);
  57905. var isPlainObject = __webpack_require__( /*! ../../core/utils/type */ 1).isPlainObject;
  57906. var eventRegistratorCallbacks = __webpack_require__( /*! ../../events/core/event_registrator_callbacks */ 122);
  57907. var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
  57908. eventRegistratorCallbacks.add(function(name) {
  57909. var koBindingEventName = eventUtils.addNamespace(name, name + "Binding");
  57910. ko.bindingHandlers[name] = {
  57911. update: function(element, valueAccessor, allBindingsAccessor, viewModel) {
  57912. var $element = $(element);
  57913. var unwrappedValue = ko.utils.unwrapObservable(valueAccessor());
  57914. var eventSource = unwrappedValue.execute ? unwrappedValue.execute : unwrappedValue;
  57915. eventsEngine.off($element, koBindingEventName);
  57916. eventsEngine.on($element, koBindingEventName, isPlainObject(unwrappedValue) ? unwrappedValue : {}, function(e) {
  57917. eventSource.call(viewModel, viewModel, e)
  57918. })
  57919. }
  57920. }
  57921. })
  57922. },
  57923. /*!*****************************************************************!*\
  57924. !*** ./artifacts/transpiled/integration/knockout/components.js ***!
  57925. \*****************************************************************/
  57926. /*! dynamic exports provided */
  57927. /*! all exports used */
  57928. function(module, exports, __webpack_require__) {
  57929. var ko = __webpack_require__( /*! knockout */ 62);
  57930. var iconUtils = __webpack_require__( /*! ../../core/utils/icon */ 60);
  57931. ko.bindingHandlers.dxControlsDescendantBindings = {
  57932. init: function(_, valueAccessor) {
  57933. return {
  57934. controlsDescendantBindings: ko.unwrap(valueAccessor())
  57935. }
  57936. }
  57937. };
  57938. ko.bindingHandlers.dxIcon = {
  57939. init: function(element, valueAccessor) {
  57940. var options = ko.utils.unwrapObservable(valueAccessor()) || {};
  57941. var iconElement = iconUtils.getImageContainer(options);
  57942. ko.virtualElements.emptyNode(element);
  57943. if (iconElement) {
  57944. ko.virtualElements.prepend(element, iconElement.get(0))
  57945. }
  57946. },
  57947. update: function(element, valueAccessor) {
  57948. var options = ko.utils.unwrapObservable(valueAccessor()) || {};
  57949. var iconElement = iconUtils.getImageContainer(options);
  57950. ko.virtualElements.emptyNode(element);
  57951. if (iconElement) {
  57952. ko.virtualElements.prepend(element, iconElement.get(0))
  57953. }
  57954. }
  57955. };
  57956. ko.virtualElements.allowedBindings.dxIcon = true
  57957. },
  57958. /*!*****************************************************************!*\
  57959. !*** ./artifacts/transpiled/integration/knockout/validation.js ***!
  57960. \*****************************************************************/
  57961. /*! dynamic exports provided */
  57962. /*! all exports used */
  57963. function(module, exports, __webpack_require__) {
  57964. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  57965. var Class = __webpack_require__( /*! ../../core/class */ 15);
  57966. var EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 82);
  57967. var ValidationEngine = __webpack_require__( /*! ../../ui/validation_engine */ 99);
  57968. var ko = __webpack_require__( /*! knockout */ 62);
  57969. var koDxValidator = Class.inherit({
  57970. ctor: function(target, option) {
  57971. var that = this;
  57972. that.target = target;
  57973. that.validationRules = option.validationRules;
  57974. that.name = option.name;
  57975. that.isValid = ko.observable(true);
  57976. that.validationError = ko.observable();
  57977. each(this.validationRules, function(_, rule) {
  57978. rule.validator = that
  57979. })
  57980. },
  57981. validate: function() {
  57982. var result = ValidationEngine.validate(this.target(), this.validationRules, this.name);
  57983. this._applyValidationResult(result);
  57984. return result
  57985. },
  57986. reset: function() {
  57987. this.target(null);
  57988. var result = {
  57989. isValid: true,
  57990. brokenRule: null
  57991. };
  57992. this._applyValidationResult(result);
  57993. return result
  57994. },
  57995. _applyValidationResult: function(result) {
  57996. result.validator = this;
  57997. this.target.dxValidator.isValid(result.isValid);
  57998. this.target.dxValidator.validationError(result.brokenRule);
  57999. this.fireEvent("validated", [result])
  58000. }
  58001. }).include(EventsMixin);
  58002. ko.extenders.dxValidator = function(target, option) {
  58003. target.dxValidator = new koDxValidator(target, option);
  58004. target.subscribe(target.dxValidator.validate.bind(target.dxValidator));
  58005. return target
  58006. };
  58007. ValidationEngine.registerModelForValidation = function(model) {
  58008. each(model, function(name, member) {
  58009. if (ko.isObservable(member) && member.dxValidator) {
  58010. ValidationEngine.registerValidatorInGroup(model, member.dxValidator)
  58011. }
  58012. })
  58013. };
  58014. ValidationEngine.unregisterModelForValidation = function(model) {
  58015. each(model, function(name, member) {
  58016. if (ko.isObservable(member) && member.dxValidator) {
  58017. ValidationEngine.removeRegisteredValidator(model, member.dxValidator)
  58018. }
  58019. })
  58020. };
  58021. ValidationEngine.validateModel = ValidationEngine.validateGroup
  58022. },
  58023. /*!*****************************************************************************!*\
  58024. !*** ./artifacts/transpiled/integration/knockout/variable_wrapper_utils.js ***!
  58025. \*****************************************************************************/
  58026. /*! dynamic exports provided */
  58027. /*! all exports used */
  58028. function(module, exports, __webpack_require__) {
  58029. var ko = __webpack_require__( /*! knockout */ 62);
  58030. var variableWrapper = __webpack_require__( /*! ../../core/utils/variable_wrapper */ 86);
  58031. variableWrapper.inject({
  58032. isWrapped: ko.isObservable,
  58033. isWritableWrapped: ko.isWritableObservable,
  58034. wrap: ko.observable,
  58035. unwrap: function(value) {
  58036. if (ko.isObservable(value)) {
  58037. return ko.utils.unwrapObservable(value)
  58038. }
  58039. return this.callBase(value)
  58040. },
  58041. assign: function(variable, value) {
  58042. if (ko.isObservable(variable)) {
  58043. variable(value)
  58044. } else {
  58045. this.callBase(variable, value)
  58046. }
  58047. }
  58048. })
  58049. },
  58050. /*!*****************************************************************!*\
  58051. !*** ./artifacts/transpiled/integration/knockout/clean_node.js ***!
  58052. \*****************************************************************/
  58053. /*! dynamic exports provided */
  58054. /*! all exports used */
  58055. function(module, exports, __webpack_require__) {
  58056. var elementData = __webpack_require__( /*! ../../core/element_data */ 39);
  58057. var afterCleanData = elementData.afterCleanData;
  58058. var strategyChanging = elementData.strategyChanging;
  58059. var ko = __webpack_require__( /*! knockout */ 62);
  58060. var compareVersion = __webpack_require__( /*! ../../core/utils/version */ 61).compare;
  58061. var originalKOCleanExternalData = ko.utils.domNodeDisposal.cleanExternalData;
  58062. var patchCleanData = function() {
  58063. afterCleanData(function(nodes) {
  58064. for (var i = 0; i < nodes.length; i++) {
  58065. nodes[i].cleanedByJquery = true
  58066. }
  58067. for (i = 0; i < nodes.length; i++) {
  58068. if (!nodes[i].cleanedByKo) {
  58069. ko.cleanNode(nodes[i])
  58070. }
  58071. delete nodes[i].cleanedByKo
  58072. }
  58073. for (i = 0; i < nodes.length; i++) {
  58074. delete nodes[i].cleanedByJquery
  58075. }
  58076. });
  58077. ko.utils.domNodeDisposal.cleanExternalData = function(node) {
  58078. node.cleanedByKo = true;
  58079. if (!node.cleanedByJquery) {
  58080. elementData.cleanData([node])
  58081. }
  58082. }
  58083. };
  58084. var restoreOriginCleanData = function() {
  58085. afterCleanData(function() {});
  58086. ko.utils.domNodeDisposal.cleanExternalData = originalKOCleanExternalData
  58087. };
  58088. patchCleanData();
  58089. strategyChanging.add(function(strategy) {
  58090. var isJQuery = !!strategy.fn;
  58091. if (isJQuery && compareVersion(strategy.fn.jquery, [2, 0]) < 0) {
  58092. restoreOriginCleanData()
  58093. }
  58094. })
  58095. },
  58096. /*!*********************************************************************!*\
  58097. !*** ./artifacts/transpiled/integration/knockout/clean_node_old.js ***!
  58098. \*********************************************************************/
  58099. /*! dynamic exports provided */
  58100. /*! all exports used */
  58101. function(module, exports, __webpack_require__) {
  58102. var ko = __webpack_require__( /*! knockout */ 62);
  58103. var compareVersion = __webpack_require__( /*! ../../core/utils/version */ 61).compare;
  58104. var strategyChanging = __webpack_require__( /*! ../../core/element_data */ 39).strategyChanging;
  58105. var patchCleanData = function(jQuery) {
  58106. var cleanKoData = function(element, andSelf) {
  58107. var cleanNode = function() {
  58108. ko.cleanNode(this)
  58109. };
  58110. if (andSelf) {
  58111. element.each(cleanNode)
  58112. } else {
  58113. element.find("*").each(cleanNode)
  58114. }
  58115. };
  58116. var originalEmpty = jQuery.fn.empty;
  58117. jQuery.fn.empty = function() {
  58118. cleanKoData(this, false);
  58119. return originalEmpty.apply(this, arguments)
  58120. };
  58121. var originalRemove = jQuery.fn.remove;
  58122. jQuery.fn.remove = function(selector, keepData) {
  58123. if (!keepData) {
  58124. var subject = this;
  58125. if (selector) {
  58126. subject = subject.filter(selector)
  58127. }
  58128. cleanKoData(subject, true)
  58129. }
  58130. return originalRemove.call(this, selector, keepData)
  58131. };
  58132. var originalHtml = jQuery.fn.html;
  58133. jQuery.fn.html = function(value) {
  58134. if ("string" === typeof value) {
  58135. cleanKoData(this, false)
  58136. }
  58137. return originalHtml.apply(this, arguments)
  58138. };
  58139. var originalReplaceWith = jQuery.fn.replaceWith;
  58140. jQuery.fn.replaceWith = function() {
  58141. var result = originalReplaceWith.apply(this, arguments);
  58142. if (!this.parent().length) {
  58143. cleanKoData(this, true)
  58144. }
  58145. return result
  58146. }
  58147. };
  58148. strategyChanging.add(function(strategy) {
  58149. var isJQuery = !!strategy.fn;
  58150. if (isJQuery && compareVersion(strategy.fn.jquery, [2, 0]) < 0) {
  58151. patchCleanData(strategy)
  58152. }
  58153. })
  58154. },
  58155. /*!****************************************************************!*\
  58156. !*** ./artifacts/transpiled/localization/globalize/message.js ***!
  58157. \****************************************************************/
  58158. /*! dynamic exports provided */
  58159. /*! all exports used */
  58160. function(module, exports, __webpack_require__) {
  58161. __webpack_require__( /*! ./core */ 127);
  58162. var Globalize = __webpack_require__( /*! globalize */ 72);
  58163. var messageLocalization = __webpack_require__( /*! ../message */ 13);
  58164. var coreLocalization = __webpack_require__( /*! ../core */ 87);
  58165. __webpack_require__( /*! globalize/message */ 72);
  58166. if (Globalize && Globalize.formatMessage) {
  58167. var DEFAULT_LOCALE = "en";
  58168. var originalLoadMessages = Globalize.loadMessages;
  58169. Globalize.loadMessages = function(messages) {
  58170. messageLocalization.load(messages)
  58171. };
  58172. var globalizeMessageLocalization = {
  58173. ctor: function() {
  58174. this.load(this._dictionary)
  58175. },
  58176. load: function(messages) {
  58177. this.callBase(messages);
  58178. originalLoadMessages(messages)
  58179. },
  58180. getMessagesByLocales: function() {
  58181. return Globalize.cldr.get("globalize-messages")
  58182. },
  58183. getFormatter: function(key, locale) {
  58184. var currentLocale = locale || coreLocalization.locale();
  58185. var formatter = this._getFormatterBase(key, locale);
  58186. if (!formatter) {
  58187. formatter = this._formatterByGlobalize(key, locale)
  58188. }
  58189. if (!formatter && currentLocale !== DEFAULT_LOCALE) {
  58190. formatter = this.getFormatter(key, DEFAULT_LOCALE)
  58191. }
  58192. return formatter
  58193. },
  58194. _formatterByGlobalize: function(key, locale) {
  58195. var currentGlobalize = !locale || locale === coreLocalization.locale() ? Globalize : new Globalize(locale);
  58196. var result;
  58197. if (this._messageLoaded(key, locale)) {
  58198. result = currentGlobalize.messageFormatter(key)
  58199. }
  58200. return result
  58201. },
  58202. _messageLoaded: function(key, locale) {
  58203. var currentCldr = locale ? new Globalize(locale).cldr : Globalize.locale();
  58204. var value = currentCldr.get(["globalize-messages/{bundle}", key]);
  58205. return !!value
  58206. },
  58207. _loadSingle: function(key, value, locale) {
  58208. var data = {};
  58209. data[locale] = {};
  58210. data[locale][key] = value;
  58211. this.load(data)
  58212. }
  58213. };
  58214. messageLocalization.inject(globalizeMessageLocalization)
  58215. }
  58216. },
  58217. /*!*************************************************************!*\
  58218. !*** ./artifacts/transpiled/localization/globalize/date.js ***!
  58219. \*************************************************************/
  58220. /*! dynamic exports provided */
  58221. /*! all exports used */
  58222. function(module, exports, __webpack_require__) {
  58223. __webpack_require__( /*! ./core */ 127);
  58224. __webpack_require__( /*! ./number */ 183);
  58225. __webpack_require__( /*! globalize/date */ 72);
  58226. var timeData = {
  58227. supplemental: {
  58228. version: {
  58229. _cldrVersion: "28",
  58230. _unicodeVersion: "8.0.0",
  58231. _number: "$Revision: 11969 $"
  58232. },
  58233. timeData: {
  58234. "001": {
  58235. _allowed: "H h",
  58236. _preferred: "H"
  58237. },
  58238. DE: {
  58239. _allowed: "H",
  58240. _preferred: "H"
  58241. },
  58242. JP: {
  58243. _allowed: "H K h",
  58244. _preferred: "H"
  58245. },
  58246. RU: {
  58247. _allowed: "H",
  58248. _preferred: "H"
  58249. },
  58250. US: {
  58251. _allowed: "H h",
  58252. _preferred: "h"
  58253. }
  58254. }
  58255. }
  58256. };
  58257. var enCaGregorian = {
  58258. main: {
  58259. en: {
  58260. identity: {
  58261. version: {
  58262. _cldrVersion: "28",
  58263. _number: "$Revision: 11972 $"
  58264. },
  58265. language: "en"
  58266. },
  58267. dates: {
  58268. calendars: {
  58269. gregorian: {
  58270. months: {
  58271. format: {
  58272. abbreviated: {
  58273. 1: "Jan",
  58274. 2: "Feb",
  58275. 3: "Mar",
  58276. 4: "Apr",
  58277. 5: "May",
  58278. 6: "Jun",
  58279. 7: "Jul",
  58280. 8: "Aug",
  58281. 9: "Sep",
  58282. 10: "Oct",
  58283. 11: "Nov",
  58284. 12: "Dec"
  58285. },
  58286. narrow: {
  58287. 1: "J",
  58288. 2: "F",
  58289. 3: "M",
  58290. 4: "A",
  58291. 5: "M",
  58292. 6: "J",
  58293. 7: "J",
  58294. 8: "A",
  58295. 9: "S",
  58296. 10: "O",
  58297. 11: "N",
  58298. 12: "D"
  58299. },
  58300. wide: {
  58301. 1: "January",
  58302. 2: "February",
  58303. 3: "March",
  58304. 4: "April",
  58305. 5: "May",
  58306. 6: "June",
  58307. 7: "July",
  58308. 8: "August",
  58309. 9: "September",
  58310. 10: "October",
  58311. 11: "November",
  58312. 12: "December"
  58313. }
  58314. },
  58315. "stand-alone": {
  58316. abbreviated: {
  58317. 1: "Jan",
  58318. 2: "Feb",
  58319. 3: "Mar",
  58320. 4: "Apr",
  58321. 5: "May",
  58322. 6: "Jun",
  58323. 7: "Jul",
  58324. 8: "Aug",
  58325. 9: "Sep",
  58326. 10: "Oct",
  58327. 11: "Nov",
  58328. 12: "Dec"
  58329. },
  58330. narrow: {
  58331. 1: "J",
  58332. 2: "F",
  58333. 3: "M",
  58334. 4: "A",
  58335. 5: "M",
  58336. 6: "J",
  58337. 7: "J",
  58338. 8: "A",
  58339. 9: "S",
  58340. 10: "O",
  58341. 11: "N",
  58342. 12: "D"
  58343. },
  58344. wide: {
  58345. 1: "January",
  58346. 2: "February",
  58347. 3: "March",
  58348. 4: "April",
  58349. 5: "May",
  58350. 6: "June",
  58351. 7: "July",
  58352. 8: "August",
  58353. 9: "September",
  58354. 10: "October",
  58355. 11: "November",
  58356. 12: "December"
  58357. }
  58358. }
  58359. },
  58360. days: {
  58361. format: {
  58362. abbreviated: {
  58363. sun: "Sun",
  58364. mon: "Mon",
  58365. tue: "Tue",
  58366. wed: "Wed",
  58367. thu: "Thu",
  58368. fri: "Fri",
  58369. sat: "Sat"
  58370. },
  58371. narrow: {
  58372. sun: "S",
  58373. mon: "M",
  58374. tue: "T",
  58375. wed: "W",
  58376. thu: "T",
  58377. fri: "F",
  58378. sat: "S"
  58379. },
  58380. "short": {
  58381. sun: "Su",
  58382. mon: "Mo",
  58383. tue: "Tu",
  58384. wed: "We",
  58385. thu: "Th",
  58386. fri: "Fr",
  58387. sat: "Sa"
  58388. },
  58389. wide: {
  58390. sun: "Sunday",
  58391. mon: "Monday",
  58392. tue: "Tuesday",
  58393. wed: "Wednesday",
  58394. thu: "Thursday",
  58395. fri: "Friday",
  58396. sat: "Saturday"
  58397. }
  58398. },
  58399. "stand-alone": {
  58400. abbreviated: {
  58401. sun: "Sun",
  58402. mon: "Mon",
  58403. tue: "Tue",
  58404. wed: "Wed",
  58405. thu: "Thu",
  58406. fri: "Fri",
  58407. sat: "Sat"
  58408. },
  58409. narrow: {
  58410. sun: "S",
  58411. mon: "M",
  58412. tue: "T",
  58413. wed: "W",
  58414. thu: "T",
  58415. fri: "F",
  58416. sat: "S"
  58417. },
  58418. "short": {
  58419. sun: "Su",
  58420. mon: "Mo",
  58421. tue: "Tu",
  58422. wed: "We",
  58423. thu: "Th",
  58424. fri: "Fr",
  58425. sat: "Sa"
  58426. },
  58427. wide: {
  58428. sun: "Sunday",
  58429. mon: "Monday",
  58430. tue: "Tuesday",
  58431. wed: "Wednesday",
  58432. thu: "Thursday",
  58433. fri: "Friday",
  58434. sat: "Saturday"
  58435. }
  58436. }
  58437. },
  58438. quarters: {
  58439. format: {
  58440. abbreviated: {
  58441. 1: "Q1",
  58442. 2: "Q2",
  58443. 3: "Q3",
  58444. 4: "Q4"
  58445. },
  58446. narrow: {
  58447. 1: "1",
  58448. 2: "2",
  58449. 3: "3",
  58450. 4: "4"
  58451. },
  58452. wide: {
  58453. 1: "1st quarter",
  58454. 2: "2nd quarter",
  58455. 3: "3rd quarter",
  58456. 4: "4th quarter"
  58457. }
  58458. },
  58459. "stand-alone": {
  58460. abbreviated: {
  58461. 1: "Q1",
  58462. 2: "Q2",
  58463. 3: "Q3",
  58464. 4: "Q4"
  58465. },
  58466. narrow: {
  58467. 1: "1",
  58468. 2: "2",
  58469. 3: "3",
  58470. 4: "4"
  58471. },
  58472. wide: {
  58473. 1: "1st quarter",
  58474. 2: "2nd quarter",
  58475. 3: "3rd quarter",
  58476. 4: "4th quarter"
  58477. }
  58478. }
  58479. },
  58480. dayPeriods: {
  58481. format: {
  58482. abbreviated: {
  58483. midnight: "midnight",
  58484. am: "AM",
  58485. "am-alt-variant": "am",
  58486. noon: "noon",
  58487. pm: "PM",
  58488. "pm-alt-variant": "pm",
  58489. morning1: "in the morning",
  58490. afternoon1: "in the afternoon",
  58491. evening1: "in the evening",
  58492. night1: "at night"
  58493. },
  58494. narrow: {
  58495. midnight: "mi",
  58496. am: "a",
  58497. "am-alt-variant": "am",
  58498. noon: "n",
  58499. pm: "p",
  58500. "pm-alt-variant": "pm",
  58501. morning1: "in the morning",
  58502. afternoon1: "in the afternoon",
  58503. evening1: "in the evening",
  58504. night1: "at night"
  58505. },
  58506. wide: {
  58507. midnight: "midnight",
  58508. am: "AM",
  58509. "am-alt-variant": "am",
  58510. noon: "noon",
  58511. pm: "PM",
  58512. "pm-alt-variant": "pm",
  58513. morning1: "in the morning",
  58514. afternoon1: "in the afternoon",
  58515. evening1: "in the evening",
  58516. night1: "at night"
  58517. }
  58518. },
  58519. "stand-alone": {
  58520. abbreviated: {
  58521. midnight: "midnight",
  58522. am: "AM",
  58523. "am-alt-variant": "am",
  58524. noon: "noon",
  58525. pm: "PM",
  58526. "pm-alt-variant": "pm",
  58527. morning1: "in the morning",
  58528. afternoon1: "in the afternoon",
  58529. evening1: "in the evening",
  58530. night1: "at night"
  58531. },
  58532. narrow: {
  58533. midnight: "midnight",
  58534. am: "AM",
  58535. "am-alt-variant": "am",
  58536. noon: "noon",
  58537. pm: "PM",
  58538. "pm-alt-variant": "pm",
  58539. morning1: "in the morning",
  58540. afternoon1: "in the afternoon",
  58541. evening1: "in the evening",
  58542. night1: "at night"
  58543. },
  58544. wide: {
  58545. midnight: "midnight",
  58546. am: "AM",
  58547. "am-alt-variant": "am",
  58548. noon: "noon",
  58549. pm: "PM",
  58550. "pm-alt-variant": "pm",
  58551. morning1: "morning",
  58552. afternoon1: "afternoon",
  58553. evening1: "evening",
  58554. night1: "night"
  58555. }
  58556. }
  58557. },
  58558. eras: {
  58559. eraNames: {
  58560. 0: "Before Christ",
  58561. "0-alt-variant": "Before Common Era",
  58562. 1: "Anno Domini",
  58563. "1-alt-variant": "Common Era"
  58564. },
  58565. eraAbbr: {
  58566. 0: "BC",
  58567. "0-alt-variant": "BCE",
  58568. 1: "AD",
  58569. "1-alt-variant": "CE"
  58570. },
  58571. eraNarrow: {
  58572. 0: "B",
  58573. "0-alt-variant": "BCE",
  58574. 1: "A",
  58575. "1-alt-variant": "CE"
  58576. }
  58577. },
  58578. dateFormats: {
  58579. full: "EEEE, MMMM d, y",
  58580. "long": "MMMM d, y",
  58581. medium: "MMM d, y",
  58582. "short": "M/d/yy"
  58583. },
  58584. timeFormats: {
  58585. full: "h:mm:ss a zzzz",
  58586. "long": "h:mm:ss a z",
  58587. medium: "h:mm:ss a",
  58588. "short": "h:mm a"
  58589. },
  58590. dateTimeFormats: {
  58591. full: "{1} 'at' {0}",
  58592. "long": "{1} 'at' {0}",
  58593. medium: "{1}, {0}",
  58594. "short": "{1}, {0}",
  58595. availableFormats: {
  58596. d: "d",
  58597. E: "ccc",
  58598. Ed: "d E",
  58599. Ehm: "E h:mm a",
  58600. EHm: "E HH:mm",
  58601. Ehms: "E h:mm:ss a",
  58602. EHms: "E HH:mm:ss",
  58603. Gy: "y G",
  58604. GyMMM: "MMM y G",
  58605. GyMMMd: "MMM d, y G",
  58606. GyMMMEd: "E, MMM d, y G",
  58607. h: "h a",
  58608. H: "HH",
  58609. hm: "h:mm a",
  58610. Hm: "HH:mm",
  58611. hms: "h:mm:ss a",
  58612. Hms: "HH:mm:ss",
  58613. hmsv: "h:mm:ss a v",
  58614. Hmsv: "HH:mm:ss v",
  58615. hmv: "h:mm a v",
  58616. Hmv: "HH:mm v",
  58617. M: "L",
  58618. Md: "M/d",
  58619. MEd: "E, M/d",
  58620. MMM: "LLL",
  58621. MMMd: "MMM d",
  58622. MMMEd: "E, MMM d",
  58623. MMMMd: "MMMM d",
  58624. ms: "mm:ss",
  58625. y: "y",
  58626. yM: "M/y",
  58627. yMd: "M/d/y",
  58628. yMEd: "E, M/d/y",
  58629. yMMM: "MMM y",
  58630. yMMMd: "MMM d, y",
  58631. yMMMEd: "E, MMM d, y",
  58632. yMMMM: "MMMM y",
  58633. yQQQ: "QQQ y",
  58634. yQQQQ: "QQQQ y"
  58635. },
  58636. appendItems: {
  58637. Day: "{0} ({2}: {1})",
  58638. "Day-Of-Week": "{0} {1}",
  58639. Era: "{0} {1}",
  58640. Hour: "{0} ({2}: {1})",
  58641. Minute: "{0} ({2}: {1})",
  58642. Month: "{0} ({2}: {1})",
  58643. Quarter: "{0} ({2}: {1})",
  58644. Second: "{0} ({2}: {1})",
  58645. Timezone: "{0} {1}",
  58646. Week: "{0} ({2}: {1})",
  58647. Year: "{0} {1}"
  58648. },
  58649. intervalFormats: {
  58650. intervalFormatFallback: "{0} \u2013 {1}",
  58651. d: {
  58652. d: "d \u2013 d"
  58653. },
  58654. h: {
  58655. a: "h a \u2013 h a",
  58656. h: "h \u2013 h a"
  58657. },
  58658. H: {
  58659. H: "HH \u2013 HH"
  58660. },
  58661. hm: {
  58662. a: "h:mm a \u2013 h:mm a",
  58663. h: "h:mm \u2013 h:mm a",
  58664. m: "h:mm \u2013 h:mm a"
  58665. },
  58666. Hm: {
  58667. H: "HH:mm \u2013 HH:mm",
  58668. m: "HH:mm \u2013 HH:mm"
  58669. },
  58670. hmv: {
  58671. a: "h:mm a \u2013 h:mm a v",
  58672. h: "h:mm \u2013 h:mm a v",
  58673. m: "h:mm \u2013 h:mm a v"
  58674. },
  58675. Hmv: {
  58676. H: "HH:mm \u2013 HH:mm v",
  58677. m: "HH:mm \u2013 HH:mm v"
  58678. },
  58679. hv: {
  58680. a: "h a \u2013 h a v",
  58681. h: "h \u2013 h a v"
  58682. },
  58683. Hv: {
  58684. H: "HH \u2013 HH v"
  58685. },
  58686. M: {
  58687. M: "M \u2013 M"
  58688. },
  58689. Md: {
  58690. d: "M/d \u2013 M/d",
  58691. M: "M/d \u2013 M/d"
  58692. },
  58693. MEd: {
  58694. d: "E, M/d \u2013 E, M/d",
  58695. M: "E, M/d \u2013 E, M/d"
  58696. },
  58697. MMM: {
  58698. M: "MMM \u2013 MMM"
  58699. },
  58700. MMMd: {
  58701. d: "MMM d \u2013 d",
  58702. M: "MMM d \u2013 MMM d"
  58703. },
  58704. MMMEd: {
  58705. d: "E, MMM d \u2013 E, MMM d",
  58706. M: "E, MMM d \u2013 E, MMM d"
  58707. },
  58708. y: {
  58709. y: "y \u2013 y"
  58710. },
  58711. yM: {
  58712. M: "M/y \u2013 M/y",
  58713. y: "M/y \u2013 M/y"
  58714. },
  58715. yMd: {
  58716. d: "M/d/y \u2013 M/d/y",
  58717. M: "M/d/y \u2013 M/d/y",
  58718. y: "M/d/y \u2013 M/d/y"
  58719. },
  58720. yMEd: {
  58721. d: "E, M/d/y \u2013 E, M/d/y",
  58722. M: "E, M/d/y \u2013 E, M/d/y",
  58723. y: "E, M/d/y \u2013 E, M/d/y"
  58724. },
  58725. yMMM: {
  58726. M: "MMM \u2013 MMM y",
  58727. y: "MMM y \u2013 MMM y"
  58728. },
  58729. yMMMd: {
  58730. d: "MMM d \u2013 d, y",
  58731. M: "MMM d \u2013 MMM d, y",
  58732. y: "MMM d, y \u2013 MMM d, y"
  58733. },
  58734. yMMMEd: {
  58735. d: "E, MMM d \u2013 E, MMM d, y",
  58736. M: "E, MMM d \u2013 E, MMM d, y",
  58737. y: "E, MMM d, y \u2013 E, MMM d, y"
  58738. },
  58739. yMMMM: {
  58740. M: "MMMM \u2013 MMMM y",
  58741. y: "MMMM y \u2013 MMMM y"
  58742. }
  58743. }
  58744. }
  58745. }
  58746. }
  58747. }
  58748. }
  58749. }
  58750. };
  58751. var weekData = {
  58752. supplemental: {
  58753. version: {
  58754. _cldrVersion: "28",
  58755. _unicodeVersion: "8.0.0",
  58756. _number: "$Revision: 11969 $"
  58757. },
  58758. weekData: {
  58759. minDays: {
  58760. "001": "1",
  58761. US: "1",
  58762. DE: "4"
  58763. },
  58764. firstDay: {
  58765. "001": "mon",
  58766. DE: "mon",
  58767. RU: "mon",
  58768. JP: "sun",
  58769. US: "sun"
  58770. },
  58771. weekendStart: {
  58772. "001": "sat"
  58773. },
  58774. weekendEnd: {
  58775. "001": "sun"
  58776. }
  58777. }
  58778. }
  58779. };
  58780. var ACCEPTABLE_JSON_FORMAT_PROPERTIES = ["skeleton", "date", "time", "datetime", "raw"];
  58781. var Globalize = __webpack_require__( /*! globalize */ 72);
  58782. var dateLocalization = __webpack_require__( /*! ../date */ 32);
  58783. var isObject = __webpack_require__( /*! ../../core/utils/type */ 1).isObject;
  58784. var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  58785. var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  58786. if (Globalize && Globalize.formatDate) {
  58787. if ("en" === Globalize.locale().locale) {
  58788. Globalize.load(weekData, timeData, enCaGregorian);
  58789. Globalize.locale("en")
  58790. }
  58791. var formattersCache = {};
  58792. var FORMATS_TO_GLOBALIZE_MAP = {
  58793. shortdate: {
  58794. path: "dateTimeFormats/availableFormats/yMd"
  58795. },
  58796. shorttime: {
  58797. path: "timeFormats/short"
  58798. },
  58799. longdate: {
  58800. path: "dateFormats/full"
  58801. },
  58802. longtime: {
  58803. path: "timeFormats/medium"
  58804. },
  58805. monthandday: {
  58806. path: "dateTimeFormats/availableFormats/MMMMd"
  58807. },
  58808. monthandyear: {
  58809. path: "dateTimeFormats/availableFormats/yMMMM"
  58810. },
  58811. quarterandyear: {
  58812. path: "dateTimeFormats/availableFormats/yQQQ"
  58813. },
  58814. day: {
  58815. path: "dateTimeFormats/availableFormats/d"
  58816. },
  58817. year: {
  58818. path: "dateTimeFormats/availableFormats/y"
  58819. },
  58820. shortdateshorttime: {
  58821. path: "dateTimeFormats/short",
  58822. parts: ["shorttime", "shortdate"]
  58823. },
  58824. mediumdatemediumtime: {
  58825. path: "dateTimeFormats/medium",
  58826. parts: ["shorttime", "monthandday"]
  58827. },
  58828. longdatelongtime: {
  58829. path: "dateTimeFormats/medium",
  58830. parts: ["longtime", "longdate"]
  58831. },
  58832. month: {
  58833. pattern: "LLLL"
  58834. },
  58835. shortyear: {
  58836. pattern: "yy"
  58837. },
  58838. dayofweek: {
  58839. pattern: "EEEE"
  58840. },
  58841. quarter: {
  58842. pattern: "QQQ"
  58843. },
  58844. millisecond: {
  58845. pattern: "SSS"
  58846. },
  58847. hour: {
  58848. pattern: "HH"
  58849. },
  58850. minute: {
  58851. pattern: "mm"
  58852. },
  58853. second: {
  58854. pattern: "ss"
  58855. }
  58856. };
  58857. var globalizeDateLocalization = {
  58858. _getPatternByFormat: function(format) {
  58859. var that = this;
  58860. var lowerFormat = format.toLowerCase();
  58861. var globalizeFormat = FORMATS_TO_GLOBALIZE_MAP[lowerFormat];
  58862. if ("datetime-local" === lowerFormat) {
  58863. return "yyyy-MM-ddTHH':'mm':'ss"
  58864. }
  58865. if (!globalizeFormat) {
  58866. return
  58867. }
  58868. var result = globalizeFormat.path && that._getFormatStringByPath(globalizeFormat.path) || globalizeFormat.pattern;
  58869. if (globalizeFormat.parts) {
  58870. iteratorUtils.each(globalizeFormat.parts, function(index, part) {
  58871. result = result.replace("{" + index + "}", that._getPatternByFormat(part))
  58872. })
  58873. }
  58874. return result
  58875. },
  58876. _getFormatStringByPath: function(path) {
  58877. return Globalize.locale().main("dates/calendars/gregorian/" + path)
  58878. },
  58879. getPeriodNames: function() {
  58880. var json = Globalize.locale().main("dates/calendars/gregorian/dayPeriods/stand-alone/wide");
  58881. return [json.am, json.pm]
  58882. },
  58883. getMonthNames: function(format, type) {
  58884. var months = Globalize.locale().main("dates/calendars/gregorian/months/" + ("format" === type ? type : "stand-alone") + "/" + (format || "wide"));
  58885. return iteratorUtils.map(months, function(month) {
  58886. return month
  58887. })
  58888. },
  58889. getDayNames: function(format) {
  58890. var days = Globalize.locale().main("dates/calendars/gregorian/days/stand-alone/" + (format || "wide"));
  58891. return iteratorUtils.map(days, function(day) {
  58892. return day
  58893. })
  58894. },
  58895. getTimeSeparator: function() {
  58896. return Globalize.locale().main("numbers/symbols-numberSystem-latn/timeSeparator")
  58897. },
  58898. format: function(date, _format) {
  58899. if (!date) {
  58900. return
  58901. }
  58902. if (!_format) {
  58903. return date
  58904. }
  58905. var formatter;
  58906. var formatCacheKey;
  58907. if ("function" === typeof _format) {
  58908. return _format(date)
  58909. }
  58910. if (_format.formatter) {
  58911. return _format.formatter(date)
  58912. }
  58913. _format = _format.type || _format;
  58914. if ("string" === typeof _format) {
  58915. formatCacheKey = Globalize.locale().locale + ":" + _format;
  58916. formatter = formattersCache[formatCacheKey];
  58917. if (!formatter) {
  58918. _format = {
  58919. raw: this._getPatternByFormat(_format) || _format
  58920. };
  58921. formatter = formattersCache[formatCacheKey] = Globalize.dateFormatter(_format)
  58922. }
  58923. } else {
  58924. if (!this._isAcceptableFormat(_format)) {
  58925. return
  58926. }
  58927. formatter = Globalize.dateFormatter(_format)
  58928. }
  58929. return formatter(date)
  58930. },
  58931. parse: function(text, format) {
  58932. if (!text) {
  58933. return
  58934. }
  58935. if (!format || "function" === typeof format || isObject(format) && !this._isAcceptableFormat(format)) {
  58936. if (format) {
  58937. var parsedValue = this.callBase(text, format);
  58938. if (parsedValue) {
  58939. return parsedValue
  58940. }
  58941. }
  58942. return Globalize.parseDate(text)
  58943. }
  58944. if (format.parser) {
  58945. return format.parser(text)
  58946. }
  58947. if ("string" === typeof format) {
  58948. format = {
  58949. raw: this._getPatternByFormat(format) || format
  58950. }
  58951. }
  58952. return Globalize.parseDate(text, format)
  58953. },
  58954. _isAcceptableFormat: function(format) {
  58955. if (format.parser) {
  58956. return true
  58957. }
  58958. for (var i = 0; i < ACCEPTABLE_JSON_FORMAT_PROPERTIES.length; i++) {
  58959. if (Object.prototype.hasOwnProperty.call(format, ACCEPTABLE_JSON_FORMAT_PROPERTIES[i])) {
  58960. return true
  58961. }
  58962. }
  58963. },
  58964. firstDayOfWeekIndex: function() {
  58965. var firstDay = Globalize.locale().supplemental.weekData.firstDay();
  58966. return inArray(firstDay, this._getDayKeys())
  58967. },
  58968. _getDayKeys: function() {
  58969. var days = Globalize.locale().main("dates/calendars/gregorian/days/format/short");
  58970. return iteratorUtils.map(days, function(day, key) {
  58971. return key
  58972. })
  58973. }
  58974. };
  58975. dateLocalization.inject(globalizeDateLocalization)
  58976. }
  58977. },
  58978. /*!*****************************************************************!*\
  58979. !*** ./artifacts/transpiled/localization/globalize/currency.js ***!
  58980. \*****************************************************************/
  58981. /*! dynamic exports provided */
  58982. /*! all exports used */
  58983. function(module, exports, __webpack_require__) {
  58984. function _typeof(obj) {
  58985. "@babel/helpers - typeof";
  58986. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  58987. return typeof obj
  58988. } : function(obj) {
  58989. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
  58990. }, _typeof(obj)
  58991. }
  58992. __webpack_require__( /*! ./core */ 127);
  58993. __webpack_require__( /*! ./number */ 183);
  58994. __webpack_require__( /*! ../currency */ 152);
  58995. __webpack_require__( /*! globalize/currency */ 72);
  58996. var enCurrencyUSD = {
  58997. main: {
  58998. en: {
  58999. identity: {
  59000. version: {
  59001. _cldrVersion: "28",
  59002. _number: "$Revision: 11972 $"
  59003. },
  59004. language: "en"
  59005. },
  59006. numbers: {
  59007. currencies: {
  59008. USD: {
  59009. displayName: "US Dollar",
  59010. "displayName-count-one": "US dollar",
  59011. "displayName-count-other": "US dollars",
  59012. symbol: "$",
  59013. "symbol-alt-narrow": "$"
  59014. }
  59015. }
  59016. }
  59017. }
  59018. }
  59019. };
  59020. var currencyData = {
  59021. supplemental: {
  59022. version: {
  59023. _cldrVersion: "28",
  59024. _unicodeVersion: "8.0.0",
  59025. _number: "$Revision: 11969 $"
  59026. },
  59027. currencyData: {
  59028. fractions: {
  59029. DEFAULT: {
  59030. _rounding: "0",
  59031. _digits: "2"
  59032. }
  59033. }
  59034. }
  59035. }
  59036. };
  59037. var Globalize = __webpack_require__( /*! globalize */ 72);
  59038. var config = __webpack_require__( /*! ../../core/config */ 31);
  59039. var numberLocalization = __webpack_require__( /*! ../number */ 51);
  59040. if (Globalize && Globalize.formatCurrency) {
  59041. if ("en" === Globalize.locale().locale) {
  59042. Globalize.load(enCurrencyUSD, currencyData);
  59043. Globalize.locale("en")
  59044. }
  59045. var formattersCache = {};
  59046. var getFormatter = function(currency, format) {
  59047. var formatter;
  59048. var formatCacheKey;
  59049. if ("object" === _typeof(format)) {
  59050. formatCacheKey = Globalize.locale().locale + ":" + currency + ":" + JSON.stringify(format)
  59051. } else {
  59052. formatCacheKey = Globalize.locale().locale + ":" + currency + ":" + format
  59053. }
  59054. formatter = formattersCache[formatCacheKey];
  59055. if (!formatter) {
  59056. formatter = formattersCache[formatCacheKey] = Globalize.currencyFormatter(currency, format)
  59057. }
  59058. return formatter
  59059. };
  59060. var globalizeCurrencyLocalization = {
  59061. _formatNumberCore: function(value, format, formatConfig) {
  59062. if ("currency" === format) {
  59063. var currency = formatConfig && formatConfig.currency || config().defaultCurrency;
  59064. return getFormatter(currency, this._normalizeFormatConfig(format, formatConfig, value))(value)
  59065. }
  59066. return this.callBase.apply(this, arguments)
  59067. },
  59068. _normalizeFormatConfig: function(format, formatConfig, value) {
  59069. var config = this.callBase(format, formatConfig, value);
  59070. if ("currency" === format) {
  59071. config.style = "accounting"
  59072. }
  59073. return config
  59074. },
  59075. format: function(value, _format) {
  59076. if ("number" !== typeof value) {
  59077. return value
  59078. }
  59079. _format = this._normalizeFormat(_format);
  59080. if (_format) {
  59081. if ("default" === _format.currency) {
  59082. _format.currency = config().defaultCurrency
  59083. }
  59084. if ("currency" === _format.type) {
  59085. return this._formatNumber(value, this._parseNumberFormatString("currency"), _format)
  59086. } else {
  59087. if (!_format.type && _format.currency) {
  59088. return getFormatter(_format.currency, _format)(value)
  59089. }
  59090. }
  59091. }
  59092. return this.callBase.apply(this, arguments)
  59093. },
  59094. getCurrencySymbol: function(currency) {
  59095. if (!currency) {
  59096. currency = config().defaultCurrency
  59097. }
  59098. return Globalize.cldr.main("numbers/currencies/" + currency)
  59099. },
  59100. getOpenXmlCurrencyFormat: function(currency) {
  59101. var currencySymbol = this.getCurrencySymbol(currency).symbol;
  59102. var currencyFormat = Globalize.cldr.main("numbers/currencyFormats-numberSystem-latn");
  59103. var i;
  59104. var result;
  59105. var symbol;
  59106. var encodeSymbols;
  59107. if (currencyFormat.accounting) {
  59108. encodeSymbols = {
  59109. ".00": "{0}",
  59110. "'": "\\'",
  59111. "\\(": "\\(",
  59112. "\\)": "\\)",
  59113. " ": "\\ ",
  59114. '"': "&quot;",
  59115. "\\\xa4": currencySymbol
  59116. };
  59117. result = currencyFormat.accounting.split(";");
  59118. for (i = 0; i < result.length; i++) {
  59119. for (symbol in encodeSymbols) {
  59120. if (Object.prototype.hasOwnProperty.call(encodeSymbols, symbol)) {
  59121. result[i] = result[i].replace(new RegExp(symbol, "g"), encodeSymbols[symbol])
  59122. }
  59123. }
  59124. }
  59125. return 2 === result.length ? result[0] + "_);" + result[1] : result[0]
  59126. }
  59127. }
  59128. };
  59129. numberLocalization.inject(globalizeCurrencyLocalization)
  59130. }
  59131. },
  59132. /*!**************************************************!*\
  59133. !*** ./artifacts/transpiled/data/data_source.js ***!
  59134. \**************************************************/
  59135. /*! dynamic exports provided */
  59136. /*! all exports used */
  59137. function(module, exports, __webpack_require__) {
  59138. module.exports = __webpack_require__( /*! ./data_source/data_source */ 45).DataSource
  59139. },
  59140. /*!**************************************************!*\
  59141. !*** ./artifacts/transpiled/data/local_store.js ***!
  59142. \**************************************************/
  59143. /*! dynamic exports provided */
  59144. /*! all exports used */
  59145. function(module, exports, __webpack_require__) {
  59146. var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
  59147. var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
  59148. var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
  59149. var window = windowUtils.getWindow();
  59150. var Class = __webpack_require__( /*! ../core/class */ 15);
  59151. var abstract = Class.abstract;
  59152. var errors = __webpack_require__( /*! ./errors */ 36).errors;
  59153. var ArrayStore = __webpack_require__( /*! ./array_store */ 68);
  59154. var LocalStoreBackend = Class.inherit({
  59155. ctor: function(store, storeOptions) {
  59156. this._store = store;
  59157. this._dirty = !!storeOptions.data;
  59158. this.save();
  59159. var immediate = this._immediate = storeOptions.immediate;
  59160. var flushInterval = Math.max(100, storeOptions.flushInterval || 1e4);
  59161. if (!immediate) {
  59162. var saveProxy = this.save.bind(this);
  59163. setInterval(saveProxy, flushInterval);
  59164. eventsEngine.on(window, "beforeunload", saveProxy);
  59165. if (window.cordova) {
  59166. domAdapter.listen(domAdapter.getDocument(), "pause", saveProxy, false)
  59167. }
  59168. }
  59169. },
  59170. notifyChanged: function() {
  59171. this._dirty = true;
  59172. if (this._immediate) {
  59173. this.save()
  59174. }
  59175. },
  59176. load: function() {
  59177. this._store._array = this._loadImpl();
  59178. this._dirty = false
  59179. },
  59180. save: function() {
  59181. if (!this._dirty) {
  59182. return
  59183. }
  59184. this._saveImpl(this._store._array);
  59185. this._dirty = false
  59186. },
  59187. _loadImpl: abstract,
  59188. _saveImpl: abstract
  59189. });
  59190. var DomLocalStoreBackend = LocalStoreBackend.inherit({
  59191. ctor: function(store, storeOptions) {
  59192. var name = storeOptions.name;
  59193. if (!name) {
  59194. throw errors.Error("E4013")
  59195. }
  59196. this._key = "dx-data-localStore-" + name;
  59197. this.callBase(store, storeOptions)
  59198. },
  59199. _loadImpl: function() {
  59200. var raw = window.localStorage.getItem(this._key);
  59201. if (raw) {
  59202. return JSON.parse(raw)
  59203. }
  59204. return []
  59205. },
  59206. _saveImpl: function(array) {
  59207. if (!array.length) {
  59208. window.localStorage.removeItem(this._key)
  59209. } else {
  59210. window.localStorage.setItem(this._key, JSON.stringify(array))
  59211. }
  59212. }
  59213. });
  59214. var localStoreBackends = {
  59215. dom: DomLocalStoreBackend
  59216. };
  59217. var LocalStore = ArrayStore.inherit({
  59218. ctor: function(options) {
  59219. if ("string" === typeof options) {
  59220. options = {
  59221. name: options
  59222. }
  59223. } else {
  59224. options = options || {}
  59225. }
  59226. this.callBase(options);
  59227. this._backend = new localStoreBackends[options.backend || "dom"](this, options);
  59228. this._backend.load()
  59229. },
  59230. clear: function() {
  59231. this.callBase();
  59232. this._backend.notifyChanged()
  59233. },
  59234. _insertImpl: function(values) {
  59235. var b = this._backend;
  59236. return this.callBase(values).done(b.notifyChanged.bind(b))
  59237. },
  59238. _updateImpl: function(key, values) {
  59239. var b = this._backend;
  59240. return this.callBase(key, values).done(b.notifyChanged.bind(b))
  59241. },
  59242. _removeImpl: function(key) {
  59243. var b = this._backend;
  59244. return this.callBase(key).done(b.notifyChanged.bind(b))
  59245. }
  59246. }, "local");
  59247. module.exports = LocalStore
  59248. },
  59249. /*!********************************************************!*\
  59250. !*** ./artifacts/transpiled/data/endpoint_selector.js ***!
  59251. \********************************************************/
  59252. /*! dynamic exports provided */
  59253. /*! all exports used */
  59254. function(module, exports, __webpack_require__) {
  59255. var errors = __webpack_require__( /*! ../core/errors */ 21);
  59256. var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow();
  59257. var proxyUrlFormatter = __webpack_require__( /*! ./proxy_url_formatter */ 275);
  59258. var IS_WINJS_ORIGIN;
  59259. var IS_LOCAL_ORIGIN;
  59260. function isLocalHostName(url) {
  59261. return /^(localhost$|127\.)/i.test(url)
  59262. }
  59263. var EndpointSelector = function(config) {
  59264. this.config = config;
  59265. IS_WINJS_ORIGIN = "ms-appx:" === window.location.protocol;
  59266. IS_LOCAL_ORIGIN = isLocalHostName(window.location.hostname)
  59267. };
  59268. EndpointSelector.prototype = {
  59269. urlFor: function(key) {
  59270. var bag = this.config[key];
  59271. if (!bag) {
  59272. throw errors.Error("E0006")
  59273. }
  59274. if (proxyUrlFormatter.isProxyUsed()) {
  59275. return proxyUrlFormatter.formatProxyUrl(bag.local)
  59276. }
  59277. if (bag.production) {
  59278. if (IS_WINJS_ORIGIN && !Debug.debuggerEnabled || !IS_WINJS_ORIGIN && !IS_LOCAL_ORIGIN) {
  59279. return bag.production
  59280. }
  59281. }
  59282. return bag.local
  59283. }
  59284. };
  59285. module.exports = EndpointSelector
  59286. },
  59287. /*!************************************************************!*\
  59288. !*** ./artifacts/transpiled/bundles/modules/data.odata.js ***!
  59289. \************************************************************/
  59290. /*! dynamic exports provided */
  59291. /*! all exports used */
  59292. function(module, exports, __webpack_require__) {
  59293. __webpack_require__( /*! ./data */ 274);
  59294. DevExpress.data.ODataStore = __webpack_require__( /*! ../../data/odata/store */ 276);
  59295. DevExpress.data.ODataContext = __webpack_require__( /*! ../../data/odata/context */ 491);
  59296. DevExpress.data.utils = DevExpress.data.utils || {};
  59297. DevExpress.data.utils.odata = {};
  59298. DevExpress.data.utils.odata.keyConverters = __webpack_require__( /*! ../../data/odata/utils */ 110).keyConverters;
  59299. DevExpress.data.EdmLiteral = __webpack_require__( /*! ../../data/odata/utils */ 110).EdmLiteral;
  59300. var ODataUtilsModule = __webpack_require__( /*! ../../data/odata/utils */ 110);
  59301. DevExpress.data.utils.odata.serializePropName = ODataUtilsModule.serializePropName;
  59302. DevExpress.data.utils.odata.serializeValue = ODataUtilsModule.serializeValue;
  59303. DevExpress.data.utils.odata.serializeKey = ODataUtilsModule.serializeKey;
  59304. DevExpress.data.utils.odata.sendRequest = ODataUtilsModule.sendRequest;
  59305. DevExpress.data.OData__internals = ODataUtilsModule.OData__internals;
  59306. DevExpress.data.queryAdapters = DevExpress.data.queryAdapters || {};
  59307. DevExpress.data.queryAdapters.odata = __webpack_require__( /*! ../../data/odata/query_adapter */ 156).odata
  59308. },
  59309. /*!****************************************************!*\
  59310. !*** ./artifacts/transpiled/data/odata/context.js ***!
  59311. \****************************************************/
  59312. /*! dynamic exports provided */
  59313. /*! all exports used */
  59314. function(module, exports, __webpack_require__) {
  59315. var Class = __webpack_require__( /*! ../../core/class */ 15);
  59316. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  59317. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  59318. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  59319. var errorsModule = __webpack_require__( /*! ../errors */ 36);
  59320. var ODataStore = __webpack_require__( /*! ./store */ 276);
  59321. var mixins = __webpack_require__( /*! ./mixins */ 277);
  59322. var deferredUtils = __webpack_require__( /*! ../../core/utils/deferred */ 6);
  59323. var when = deferredUtils.when;
  59324. var Deferred = deferredUtils.Deferred;
  59325. __webpack_require__( /*! ./query_adapter */ 156);
  59326. var ODataContext = Class.inherit({
  59327. ctor: function(options) {
  59328. var that = this;
  59329. that._extractServiceOptions(options);
  59330. that._errorHandler = options.errorHandler;
  59331. each(options.entities || [], function(entityAlias, entityOptions) {
  59332. that[entityAlias] = new ODataStore(extend({}, options, {
  59333. url: that._url + "/" + encodeURIComponent(entityOptions.name || entityAlias)
  59334. }, entityOptions))
  59335. })
  59336. },
  59337. get: function(operationName, params) {
  59338. return this.invoke(operationName, params, "GET")
  59339. },
  59340. invoke: function(operationName, params, httpMethod) {
  59341. params = params || {};
  59342. httpMethod = (httpMethod || "POST").toLowerCase();
  59343. var d = new Deferred;
  59344. var url = this._url + "/" + encodeURIComponent(operationName);
  59345. var payload;
  59346. if (4 === this.version()) {
  59347. if ("get" === httpMethod) {
  59348. url = mixins.formatFunctionInvocationUrl(url, mixins.escapeServiceOperationParams(params, this.version()));
  59349. params = null
  59350. } else {
  59351. if ("post" === httpMethod) {
  59352. payload = params;
  59353. params = null
  59354. }
  59355. }
  59356. }
  59357. when(this._sendRequest(url, httpMethod, mixins.escapeServiceOperationParams(params, this.version()), payload)).done(function(r) {
  59358. if (typeUtils.isPlainObject(r) && operationName in r) {
  59359. r = r[operationName]
  59360. }
  59361. d.resolve(r)
  59362. }).fail(this._errorHandler).fail(errorsModule._errorHandler).fail(d.reject);
  59363. return d.promise()
  59364. },
  59365. objectLink: function(entityAlias, key) {
  59366. var store = this[entityAlias];
  59367. if (!store) {
  59368. throw errorsModule.errors.Error("E4015", entityAlias)
  59369. }
  59370. if (!typeUtils.isDefined(key)) {
  59371. return null
  59372. }
  59373. return {
  59374. __metadata: {
  59375. uri: store._byKeyUrl(key, true)
  59376. }
  59377. }
  59378. }
  59379. }).include(mixins.SharedMethods);
  59380. module.exports = ODataContext
  59381. }, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
  59382. /*!*****************************************************!*\
  59383. !*** ./artifacts/transpiled/bundles/modules/viz.js ***!
  59384. \*****************************************************/
  59385. /*! dynamic exports provided */
  59386. /*! all exports used */
  59387. function(module, exports, __webpack_require__) {
  59388. __webpack_require__( /*! ./core */ 147);
  59389. module.exports = DevExpress.viz = DevExpress.viz || {}
  59390. },
  59391. /*!*******************************************!*\
  59392. !*** ./artifacts/transpiled/viz/chart.js ***!
  59393. \*******************************************/
  59394. /*! dynamic exports provided */
  59395. /*! all exports used */
  59396. function(module, exports, __webpack_require__) {
  59397. var _common = __webpack_require__( /*! ../core/utils/common */ 4);
  59398. var _extend2 = __webpack_require__( /*! ../core/utils/extend */ 0);
  59399. var _array = __webpack_require__( /*! ../core/utils/array */ 14);
  59400. var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
  59401. var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9);
  59402. var _component_registrator2 = _interopRequireDefault(_component_registrator);
  59403. var _utils = __webpack_require__( /*! ./core/utils */ 10);
  59404. var _type = __webpack_require__( /*! ../core/utils/type */ 1);
  59405. var _math = __webpack_require__( /*! ../core/utils/math */ 28);
  59406. var _base_chart = __webpack_require__( /*! ./chart_components/base_chart */ 240);
  59407. var _layout_manager = __webpack_require__( /*! ./chart_components/layout_manager */ 402);
  59408. var _layout_manager2 = _interopRequireDefault(_layout_manager);
  59409. var _multi_axes_synchronizer = __webpack_require__( /*! ./chart_components/multi_axes_synchronizer */ 778);
  59410. var _multi_axes_synchronizer2 = _interopRequireDefault(_multi_axes_synchronizer);
  59411. var _advanced_chart = __webpack_require__( /*! ./chart_components/advanced_chart */ 404);
  59412. var _scroll_bar = __webpack_require__( /*! ./chart_components/scroll_bar */ 787);
  59413. var _scroll_bar2 = _interopRequireDefault(_scroll_bar);
  59414. var _crosshair = __webpack_require__( /*! ./chart_components/crosshair */ 410);
  59415. var _crosshair2 = _interopRequireDefault(_crosshair);
  59416. var _range_data_calculator = __webpack_require__( /*! ./series/helpers/range_data_calculator */ 247);
  59417. var _range_data_calculator2 = _interopRequireDefault(_range_data_calculator);
  59418. var _range = __webpack_require__( /*! ./translators/range */ 108);
  59419. var _range2 = _interopRequireDefault(_range);
  59420. function _interopRequireDefault(obj) {
  59421. return obj && obj.__esModule ? obj : {
  59422. "default": obj
  59423. }
  59424. }
  59425. function _defineProperty(obj, key, value) {
  59426. if (key in obj) {
  59427. Object.defineProperty(obj, key, {
  59428. value: value,
  59429. enumerable: true,
  59430. configurable: true,
  59431. writable: true
  59432. })
  59433. } else {
  59434. obj[key] = value
  59435. }
  59436. return obj
  59437. }
  59438. var DEFAULT_PANE_NAME = "default";
  59439. var VISUAL_RANGE = "VISUAL_RANGE";
  59440. var DEFAULT_PANES = [{
  59441. name: DEFAULT_PANE_NAME,
  59442. border: {}
  59443. }];
  59444. var _isArray = Array.isArray;
  59445. function getFirstAxisNameForPane(axes, paneName, defaultPane) {
  59446. var result;
  59447. for (var i = 0; i < axes.length; i++) {
  59448. if (axes[i].pane === paneName || void 0 === axes[i].pane && paneName === defaultPane) {
  59449. result = axes[i].name;
  59450. break
  59451. }
  59452. }
  59453. if (!result) {
  59454. result = axes[0].name
  59455. }
  59456. return result
  59457. }
  59458. function changeVisibilityAxisGrids(axis, gridVisibility, minorGridVisibility) {
  59459. var gridOpt = axis.getOptions().grid;
  59460. var minorGridOpt = axis.getOptions().minorGrid;
  59461. gridOpt.visible = gridVisibility;
  59462. minorGridOpt && (minorGridOpt.visible = minorGridVisibility)
  59463. }
  59464. function hideGridsOnNonFirstValueAxisForPane(axesForPane) {
  59465. var axisShown = false;
  59466. var hiddenStubAxis = [];
  59467. var minorGridVisibility = axesForPane.some(function(axis) {
  59468. var minorGridOptions = axis.getOptions().minorGrid;
  59469. return minorGridOptions && minorGridOptions.visible
  59470. });
  59471. var gridVisibility = axesForPane.some(function(axis) {
  59472. var gridOptions = axis.getOptions().grid;
  59473. return gridOptions && gridOptions.visible
  59474. });
  59475. if (axesForPane.length > 1) {
  59476. axesForPane.forEach(function(axis) {
  59477. var gridOpt = axis.getOptions().grid;
  59478. if (axisShown) {
  59479. changeVisibilityAxisGrids(axis, false, false)
  59480. } else {
  59481. if (gridOpt && gridOpt.visible) {
  59482. if (axis.getTranslator().getBusinessRange().isEmpty()) {
  59483. changeVisibilityAxisGrids(axis, false, false);
  59484. hiddenStubAxis.push(axis)
  59485. } else {
  59486. axisShown = true;
  59487. changeVisibilityAxisGrids(axis, gridVisibility, minorGridVisibility)
  59488. }
  59489. }
  59490. }
  59491. });
  59492. !axisShown && hiddenStubAxis.length && changeVisibilityAxisGrids(hiddenStubAxis[0], gridVisibility, minorGridVisibility)
  59493. }
  59494. }
  59495. function findAxisOptions(valueAxes, valueAxesOptions, axisName) {
  59496. var result;
  59497. var axInd;
  59498. for (axInd = 0; axInd < valueAxesOptions.length; axInd++) {
  59499. if (valueAxesOptions[axInd].name === axisName) {
  59500. result = valueAxesOptions[axInd];
  59501. result.priority = axInd;
  59502. break
  59503. }
  59504. }
  59505. if (!result) {
  59506. for (axInd = 0; axInd < valueAxes.length; axInd++) {
  59507. if (valueAxes[axInd].name === axisName) {
  59508. result = valueAxes[axInd].getOptions();
  59509. result.priority = valueAxes[axInd].priority;
  59510. break
  59511. }
  59512. }
  59513. }
  59514. return result
  59515. }
  59516. function findAxis(paneName, axisName, axes) {
  59517. for (var i = 0; i < axes.length; i++) {
  59518. var axis = axes[i];
  59519. if (axis.name === axisName && axis.pane === paneName) {
  59520. return axis
  59521. }
  59522. }
  59523. if (paneName) {
  59524. return findAxis(void 0, axisName, axes)
  59525. }
  59526. }
  59527. function compareAxes(a, b) {
  59528. return a.priority - b.priority
  59529. }
  59530. function doesPaneExist(panes, paneName) {
  59531. var found = false;
  59532. (0, _iterator.each)(panes, function(_, pane) {
  59533. if (pane.name === paneName) {
  59534. found = true;
  59535. return false
  59536. }
  59537. });
  59538. return found
  59539. }
  59540. var prepareSegmentRectPoints = function(left, top, width, height, borderOptions) {
  59541. var maxSW = ~~((width < height ? width : height) / 2);
  59542. var sw = borderOptions.width || 0;
  59543. var newSW = sw < maxSW ? sw : maxSW;
  59544. left += newSW / 2;
  59545. top += newSW / 2;
  59546. width -= newSW;
  59547. height -= newSW;
  59548. var right = left + width;
  59549. var bottom = top + height;
  59550. var points = [];
  59551. var segments = [];
  59552. var segmentSequence;
  59553. var visiblyOpt = 0;
  59554. var prevSegmentVisibility = 0;
  59555. var allSegment = {
  59556. top: [
  59557. [left, top],
  59558. [right, top]
  59559. ],
  59560. right: [
  59561. [right, top],
  59562. [right, bottom]
  59563. ],
  59564. bottom: [
  59565. [right, bottom],
  59566. [left, bottom]
  59567. ],
  59568. left: [
  59569. [left, bottom],
  59570. [left, top]
  59571. ]
  59572. };
  59573. (0, _iterator.each)(allSegment, function(seg) {
  59574. var visibility = !!borderOptions[seg];
  59575. visiblyOpt = 2 * visiblyOpt + ~~visibility
  59576. });
  59577. switch (visiblyOpt) {
  59578. case 13:
  59579. case 9:
  59580. segmentSequence = ["left", "top", "right", "bottom"];
  59581. break;
  59582. case 11:
  59583. segmentSequence = ["bottom", "left", "top", "right"];
  59584. break;
  59585. default:
  59586. segmentSequence = ["top", "right", "bottom", "left"]
  59587. }(0, _iterator.each)(segmentSequence, function(_, seg) {
  59588. var segmentVisibility = !!borderOptions[seg];
  59589. if (!prevSegmentVisibility && segments.length) {
  59590. points.push(segments);
  59591. segments = []
  59592. }
  59593. if (segmentVisibility) {
  59594. (0, _iterator.each)(allSegment[seg].slice(prevSegmentVisibility), function(_, segment) {
  59595. segments = segments.concat(segment)
  59596. })
  59597. }
  59598. prevSegmentVisibility = ~~segmentVisibility
  59599. });
  59600. segments.length && points.push(segments);
  59601. 1 === points.length && (points = points[0]);
  59602. return {
  59603. points: points,
  59604. pathType: 15 === visiblyOpt ? "area" : "line"
  59605. }
  59606. };
  59607. function accumulate(field, src1, src2, auxSpacing) {
  59608. var val1 = src1[field] || 0;
  59609. var val2 = src2[field] || 0;
  59610. return val1 + val2 + (val1 && val2 ? auxSpacing : 0)
  59611. }
  59612. function pickMax(field, src1, src2) {
  59613. return pickMaxValue(src1[field], src2[field])
  59614. }
  59615. function pickMaxValue(val1, val2) {
  59616. return Math.max(val1 || 0, val2 || 0)
  59617. }
  59618. function getAxisMargins(axis) {
  59619. return axis.getMargins()
  59620. }
  59621. function getHorizontalAxesMargins(axes, getMarginsFunc) {
  59622. return axes.reduce(function(margins, axis) {
  59623. var axisMargins = getMarginsFunc(axis);
  59624. var paneMargins = margins.panes[axis.pane] = margins.panes[axis.pane] || {};
  59625. var spacing = axis.getMultipleAxesSpacing();
  59626. paneMargins.top = accumulate("top", paneMargins, axisMargins, spacing);
  59627. paneMargins.bottom = accumulate("bottom", paneMargins, axisMargins, spacing);
  59628. paneMargins.left = pickMax("left", paneMargins, axisMargins);
  59629. paneMargins.right = pickMax("right", paneMargins, axisMargins);
  59630. margins.top = pickMax("top", paneMargins, margins);
  59631. margins.bottom = pickMax("bottom", paneMargins, margins);
  59632. margins.left = pickMax("left", paneMargins, margins);
  59633. margins.right = pickMax("right", paneMargins, margins);
  59634. return margins
  59635. }, {
  59636. panes: {}
  59637. })
  59638. }
  59639. function getVerticalAxesMargins(axes) {
  59640. return axes.reduce(function(margins, axis) {
  59641. var axisMargins = axis.getMargins();
  59642. var paneMargins = margins.panes[axis.pane] = margins.panes[axis.pane] || {};
  59643. var spacing = axis.getMultipleAxesSpacing();
  59644. paneMargins.top = pickMax("top", paneMargins, axisMargins);
  59645. paneMargins.bottom = pickMax("bottom", paneMargins, axisMargins);
  59646. paneMargins.left = accumulate("left", paneMargins, axisMargins, spacing);
  59647. paneMargins.right = accumulate("right", paneMargins, axisMargins, spacing);
  59648. margins.top = pickMax("top", paneMargins, margins);
  59649. margins.bottom = pickMax("bottom", paneMargins, margins);
  59650. margins.left = pickMax("left", paneMargins, margins);
  59651. margins.right = pickMax("right", paneMargins, margins);
  59652. return margins
  59653. }, {
  59654. panes: {}
  59655. })
  59656. }
  59657. function performActionOnAxes(axes, action, actionArgument1, actionArgument2, actionArgument3) {
  59658. axes.forEach(function(axis) {
  59659. axis[action](actionArgument1 && actionArgument1[axis.pane], actionArgument2 && actionArgument2[axis.pane] || actionArgument2, actionArgument3)
  59660. })
  59661. }
  59662. function shrinkCanvases(isRotated, canvases, verticalMargins, horizontalMargins) {
  59663. function getMargin(side, margins, pane) {
  59664. var m = (isRotated ? ["left", "right"] : ["top", "bottom"]).indexOf(side) === -1 ? margins : margins.panes[pane] || {};
  59665. return m[side]
  59666. }
  59667. function getMaxMargin(side, margins1, margins2, pane) {
  59668. return pickMaxValue(getMargin(side, margins1, pane), getMargin(side, margins2, pane))
  59669. }
  59670. for (var pane in canvases) {
  59671. canvases[pane].top = canvases[pane].originalTop + getMaxMargin("top", verticalMargins, horizontalMargins, pane);
  59672. canvases[pane].bottom = canvases[pane].originalBottom + getMaxMargin("bottom", verticalMargins, horizontalMargins, pane);
  59673. canvases[pane].left = canvases[pane].originalLeft + getMaxMargin("left", verticalMargins, horizontalMargins, pane);
  59674. canvases[pane].right = canvases[pane].originalRight + getMaxMargin("right", verticalMargins, horizontalMargins, pane)
  59675. }
  59676. return canvases
  59677. }
  59678. function drawAxesWithTicks(axes, condition, canvases, panesBorderOptions) {
  59679. if (condition) {
  59680. performActionOnAxes(axes, "createTicks", canvases);
  59681. _multi_axes_synchronizer2.default.synchronize(axes)
  59682. }
  59683. performActionOnAxes(axes, "draw", !condition && canvases, panesBorderOptions)
  59684. }
  59685. function shiftAxis(side1, side2) {
  59686. var shifts = {};
  59687. return function(axis) {
  59688. var shift = shifts[axis.pane] = shifts[axis.pane] || {
  59689. top: 0,
  59690. left: 0,
  59691. bottom: 0,
  59692. right: 0
  59693. };
  59694. var spacing = axis.getMultipleAxesSpacing();
  59695. var margins = axis.getMargins();
  59696. axis.shift(shift);
  59697. shift[side1] = accumulate(side1, shift, margins, spacing);
  59698. shift[side2] = accumulate(side2, shift, margins, spacing)
  59699. }
  59700. }
  59701. function getCommonSize(side, margins) {
  59702. var size = 0;
  59703. var pane;
  59704. for (pane in margins.panes) {
  59705. var paneMargins = margins.panes[pane];
  59706. size += "height" === side ? paneMargins.top + paneMargins.bottom : paneMargins.left + paneMargins.right
  59707. }
  59708. return size
  59709. }
  59710. function checkUsedSpace(sizeShortage, side, axes, getMarginFunc) {
  59711. var size = 0;
  59712. if (sizeShortage[side] > 0) {
  59713. size = getCommonSize(side, getMarginFunc(axes, getAxisMargins));
  59714. performActionOnAxes(axes, "hideTitle");
  59715. sizeShortage[side] -= size - getCommonSize(side, getMarginFunc(axes, getAxisMargins))
  59716. }
  59717. if (sizeShortage[side] > 0) {
  59718. performActionOnAxes(axes, "hideOuterElements")
  59719. }
  59720. }
  59721. function axisAnimationEnabled(drawOptions, series) {
  59722. var pointsCount = series.reduce(function(sum, s) {
  59723. return sum += s.getPoints().length
  59724. }, 0) / series.length;
  59725. return drawOptions.animate && pointsCount <= drawOptions.animationPointsLimit
  59726. }
  59727. var dxChart = _advanced_chart.AdvancedChart.inherit({
  59728. _themeSection: "chart",
  59729. _fontFields: ["crosshair.label.font"],
  59730. _setDeprecatedOptions: function() {
  59731. this.callBase.apply(this, arguments);
  59732. (0, _extend2.extend)(this._deprecatedOptions, {
  59733. useAggregation: {
  59734. since: "18.1",
  59735. message: "Use the 'commonSeriesSettings.aggregation.enabled' or 'series.aggregation.enabled' option instead"
  59736. },
  59737. "argumentAxis.min": {
  59738. since: "18.2",
  59739. message: "Use the 'argumentAxis.visualRange' option instead"
  59740. },
  59741. "argumentAxis.max": {
  59742. since: "18.2",
  59743. message: "Use the 'argumentAxis.visualRange' option instead"
  59744. },
  59745. "valueAxis.min": {
  59746. since: "18.2",
  59747. message: "Use the 'valueAxis.visualRange' option instead"
  59748. },
  59749. "valueAxis.max": {
  59750. since: "18.2",
  59751. message: "Use the 'valueAxis.visualRange' option instead"
  59752. },
  59753. zoomingMode: {
  59754. since: "18.2",
  59755. message: "Use the 'zoomAndPan' option instead"
  59756. },
  59757. scrollingMode: {
  59758. since: "18.2",
  59759. message: "Use the 'zoomAndPan' option instead"
  59760. }
  59761. })
  59762. },
  59763. _partialOptionChangesMap: {
  59764. visualRange: VISUAL_RANGE,
  59765. _customVisualRange: VISUAL_RANGE,
  59766. strips: "REFRESH_AXES",
  59767. constantLines: "REFRESH_AXES"
  59768. },
  59769. _partialOptionChangesPath: {
  59770. argumentAxis: ["strips", "constantLines", "visualRange", "_customVisualRange"],
  59771. valueAxis: ["strips", "constantLines", "visualRange", "_customVisualRange"]
  59772. },
  59773. _initCore: function() {
  59774. this.paneAxis = {};
  59775. this._panesClipRects = {};
  59776. this.callBase()
  59777. },
  59778. _disposeCore: function() {
  59779. var that = this;
  59780. var disposeObjectsInArray = this._disposeObjectsInArray;
  59781. var panesClipRects = that._panesClipRects;
  59782. that.callBase();
  59783. disposeObjectsInArray.call(panesClipRects, "fixed");
  59784. disposeObjectsInArray.call(panesClipRects, "base");
  59785. disposeObjectsInArray.call(panesClipRects, "wide");
  59786. that._panesClipRects = null
  59787. },
  59788. _correctAxes: function() {
  59789. this._correctValueAxes(true)
  59790. },
  59791. _getExtraOptions: _common.noop,
  59792. _cleanPanesClipRects: function(clipArrayName) {
  59793. var that = this;
  59794. var clipArray = that._panesClipRects[clipArrayName];
  59795. (0, _iterator.each)(clipArray || [], function(_, clipRect) {
  59796. clipRect && clipRect.dispose()
  59797. });
  59798. that._panesClipRects[clipArrayName] = []
  59799. },
  59800. _createPanes: function() {
  59801. var that = this;
  59802. var panes = that.option("panes");
  59803. var panesNameCounter = 0;
  59804. var defaultPane;
  59805. if (!panes || _isArray(panes) && !panes.length) {
  59806. panes = DEFAULT_PANES
  59807. }
  59808. that._cleanPanesClipRects("fixed");
  59809. that._cleanPanesClipRects("base");
  59810. that._cleanPanesClipRects("wide");
  59811. defaultPane = that.option("defaultPane");
  59812. panes = (0, _extend2.extend)(true, [], _isArray(panes) ? panes : [panes]);
  59813. (0, _iterator.each)(panes, function(_, pane) {
  59814. pane.name = !(0, _type.isDefined)(pane.name) ? DEFAULT_PANE_NAME + panesNameCounter++ : pane.name
  59815. });
  59816. if ((0, _type.isDefined)(defaultPane)) {
  59817. if (!doesPaneExist(panes, defaultPane)) {
  59818. that._incidentOccurred("W2101", [defaultPane]);
  59819. defaultPane = panes[panes.length - 1].name
  59820. }
  59821. } else {
  59822. defaultPane = panes[panes.length - 1].name
  59823. }
  59824. that.defaultPane = defaultPane;
  59825. panes = that._isRotated() ? panes.reverse() : panes;
  59826. return panes
  59827. },
  59828. _getAxisRenderingOptions: function() {
  59829. return {
  59830. axisType: "xyAxes",
  59831. drawingType: "linear"
  59832. }
  59833. },
  59834. _prepareAxisOptions: function(typeSelector, userOptions, rotated) {
  59835. return {
  59836. isHorizontal: "argumentAxis" === typeSelector !== rotated,
  59837. containerColor: this._themeManager.getOptions("containerBackgroundColor")
  59838. }
  59839. },
  59840. _checkPaneName: function(seriesTheme) {
  59841. var paneList = (0, _utils.map)(this.panes, function(pane) {
  59842. return pane.name
  59843. });
  59844. seriesTheme.pane = seriesTheme.pane || this.defaultPane;
  59845. return (0, _array.inArray)(seriesTheme.pane, paneList) !== -1
  59846. },
  59847. _getValueAxis: function(paneName, axisName) {
  59848. var that = this;
  59849. var valueAxes = that._valueAxes;
  59850. var valueAxisOptions = that.option("valueAxis") || {};
  59851. var valueAxesOptions = _isArray(valueAxisOptions) ? valueAxisOptions : [valueAxisOptions];
  59852. var rotated = that._isRotated();
  59853. var crosshairMargins = that._getCrosshairMargins();
  59854. var axisOptions;
  59855. var axis;
  59856. axisName = axisName || getFirstAxisNameForPane(valueAxes, paneName, that.defaultPane);
  59857. axis = findAxis(paneName, axisName, valueAxes);
  59858. if (!axis) {
  59859. axisOptions = findAxisOptions(valueAxes, valueAxesOptions, axisName);
  59860. if (!axisOptions) {
  59861. that._incidentOccurred("W2102", [axisName]);
  59862. axisOptions = {
  59863. name: axisName,
  59864. priority: valueAxes.length
  59865. }
  59866. }
  59867. axis = that._createAxis(false, that._populateAxesOptions("valueAxis", axisOptions, {
  59868. pane: paneName,
  59869. name: axisName,
  59870. optionPath: _isArray(valueAxisOptions) ? "valueAxis[".concat(axisOptions.priority, "]") : "valueAxis",
  59871. crosshairMargin: rotated ? crosshairMargins.y : crosshairMargins.x
  59872. }, rotated));
  59873. axis.applyVisualRangeSetter(that._getVisualRangeSetter());
  59874. valueAxes.push(axis)
  59875. }
  59876. axis.setPane(paneName);
  59877. return axis
  59878. },
  59879. _correctValueAxes: function(needHideGrids) {
  59880. var that = this;
  59881. var synchronizeMultiAxes = that._themeManager.getOptions("synchronizeMultiAxes");
  59882. var valueAxes = that._valueAxes;
  59883. var paneWithAxis = {};
  59884. that.series.forEach(function(series) {
  59885. var axis = series.getValueAxis();
  59886. paneWithAxis[axis.pane] = true
  59887. });
  59888. that.panes.forEach(function(pane) {
  59889. var paneName = pane.name;
  59890. if (!paneWithAxis[paneName]) {
  59891. that._getValueAxis(paneName)
  59892. }
  59893. if (needHideGrids && synchronizeMultiAxes) {
  59894. hideGridsOnNonFirstValueAxisForPane(valueAxes.filter(function(axis) {
  59895. return axis.pane === paneName
  59896. }))
  59897. }
  59898. });
  59899. that._valueAxes = valueAxes.filter(function(axis) {
  59900. if (!axis.pane) {
  59901. axis.setPane(that.defaultPane)
  59902. }
  59903. return doesPaneExist(that.panes, axis.pane)
  59904. }).sort(compareAxes);
  59905. var defaultAxis = this.getValueAxis();
  59906. that._valueAxes.forEach(function(axis) {
  59907. var optionPath = axis.getOptions().optionPath;
  59908. if (optionPath) {
  59909. var axesWithSamePath = that._valueAxes.filter(function(a) {
  59910. return a.getOptions().optionPath === optionPath
  59911. });
  59912. if (axesWithSamePath.length > 1) {
  59913. if (axesWithSamePath.some(function(a) {
  59914. return a === defaultAxis
  59915. })) {
  59916. axesWithSamePath.forEach(function(a) {
  59917. if (a !== defaultAxis) {
  59918. a.getOptions().optionPath = null
  59919. }
  59920. })
  59921. } else {
  59922. axesWithSamePath.forEach(function(a, i) {
  59923. if (0 !== i) {
  59924. a.getOptions().optionPath = null
  59925. }
  59926. })
  59927. }
  59928. }
  59929. }
  59930. })
  59931. },
  59932. _getSeriesForPane: function(paneName) {
  59933. var paneSeries = [];
  59934. (0, _iterator.each)(this.series, function(_, oneSeries) {
  59935. if (oneSeries.pane === paneName) {
  59936. paneSeries.push(oneSeries)
  59937. }
  59938. });
  59939. return paneSeries
  59940. },
  59941. _createPanesBorderOptions: function() {
  59942. var commonBorderOptions = this._themeManager.getOptions("commonPaneSettings").border;
  59943. var panesBorderOptions = {};
  59944. this.panes.forEach(function(pane) {
  59945. return panesBorderOptions[pane.name] = (0, _extend2.extend)(true, {}, commonBorderOptions, pane.border)
  59946. });
  59947. return panesBorderOptions
  59948. },
  59949. _createScrollBar: function() {
  59950. var that = this;
  59951. var scrollBarOptions = that._themeManager.getOptions("scrollBar") || {};
  59952. var scrollBarGroup = that._scrollBarGroup;
  59953. if (scrollBarOptions.visible) {
  59954. scrollBarOptions.rotated = that._isRotated();
  59955. that._scrollBar = (that._scrollBar || new _scroll_bar2.default.ScrollBar(that._renderer, scrollBarGroup)).update(scrollBarOptions)
  59956. } else {
  59957. scrollBarGroup.linkRemove();
  59958. that._scrollBar && that._scrollBar.dispose();
  59959. that._scrollBar = null
  59960. }
  59961. },
  59962. _prepareToRender: function(drawOptions) {
  59963. var panesBorderOptions = this._createPanesBorderOptions();
  59964. this._createPanesBackground();
  59965. this._appendAxesGroups();
  59966. this._adjustViewport();
  59967. return panesBorderOptions
  59968. },
  59969. _adjustViewport: function() {
  59970. var that = this;
  59971. var series = that._getVisibleSeries();
  59972. var argumentAxis = that.getArgumentAxis();
  59973. var useAggregation = series.some(function(s) {
  59974. return s.useAggregation()
  59975. });
  59976. var adjustOnZoom = that._themeManager.getOptions("adjustOnZoom");
  59977. var alignToBounds = !argumentAxis.dataVisualRangeIsReduced();
  59978. if (!useAggregation && !adjustOnZoom) {
  59979. return
  59980. }
  59981. that._valueAxes.forEach(function(axis) {
  59982. return axis.adjust(alignToBounds)
  59983. })
  59984. },
  59985. _recreateSizeDependentObjects: function(isCanvasChanged) {
  59986. var that = this;
  59987. var series = that._getVisibleSeries();
  59988. var useAggregation = series.some(function(s) {
  59989. return s.useAggregation()
  59990. });
  59991. var zoomChanged = that._isZooming();
  59992. if (!useAggregation) {
  59993. return
  59994. }
  59995. that._argumentAxes.forEach(function(axis) {
  59996. axis.updateCanvas(that._canvas)
  59997. });
  59998. series.forEach(function(series) {
  59999. if (series.useAggregation() && (isCanvasChanged || zoomChanged || !series._useAllAggregatedPoints)) {
  60000. series.createPoints()
  60001. }
  60002. });
  60003. that._processSeriesFamilies()
  60004. },
  60005. _isZooming: function() {
  60006. var that = this;
  60007. var argumentAxis = that.getArgumentAxis();
  60008. if (!argumentAxis || !argumentAxis.getTranslator()) {
  60009. return false
  60010. }
  60011. var businessRange = argumentAxis.getTranslator().getBusinessRange();
  60012. var zoomRange = argumentAxis.getViewport();
  60013. var min = zoomRange ? zoomRange.min : 0;
  60014. var max = zoomRange ? zoomRange.max : 0;
  60015. if ("logarithmic" === businessRange.axisType) {
  60016. min = (0, _utils.getLog)(min, businessRange.base);
  60017. max = (0, _utils.getLog)(max, businessRange.base)
  60018. }
  60019. var viewportDistance = "discrete" === businessRange.axisType ? (0, _utils.getCategoriesInfo)(businessRange.categories, min, max).categories.length : Math.abs(max - min);
  60020. var precision = (0, _math.getPrecision)(viewportDistance);
  60021. precision = precision > 1 ? Math.pow(10, precision - 2) : 1;
  60022. var zoomChanged = Math.round((that._zoomLength - viewportDistance) * precision) / precision !== 0;
  60023. that._zoomLength = viewportDistance;
  60024. return zoomChanged
  60025. },
  60026. _handleSeriesDataUpdated: function() {
  60027. var that = this;
  60028. var viewport = new _range2.default.Range;
  60029. that.series.forEach(function(s) {
  60030. viewport.addRange(s.getArgumentRange())
  60031. });
  60032. that._argumentAxes.forEach(function(axis) {
  60033. axis.updateCanvas(that._canvas);
  60034. axis.setBusinessRange(viewport, that._axesReinitialized)
  60035. });
  60036. that.callBase()
  60037. },
  60038. _isLegendInside: function() {
  60039. return this._legend && "inside" === this._legend.getPosition()
  60040. },
  60041. _isRotated: function() {
  60042. return this._themeManager.getOptions("rotated")
  60043. },
  60044. _getLayoutTargets: function() {
  60045. return this.panes
  60046. },
  60047. _applyClipRects: function(panesBorderOptions) {
  60048. var that = this;
  60049. var canvasClipRectID = that._getCanvasClipRectID();
  60050. var i;
  60051. that._drawPanesBorders(panesBorderOptions);
  60052. that._createClipRectsForPanes();
  60053. for (i = 0; i < that._argumentAxes.length; i++) {
  60054. that._argumentAxes[i].applyClipRects(that._getElementsClipRectID(that._argumentAxes[i].pane), canvasClipRectID)
  60055. }
  60056. for (i = 0; i < that._valueAxes.length; i++) {
  60057. that._valueAxes[i].applyClipRects(that._getElementsClipRectID(that._valueAxes[i].pane), canvasClipRectID)
  60058. }
  60059. that._fillPanesBackground()
  60060. },
  60061. _updateLegendPosition: function(drawOptions, legendHasInsidePosition) {
  60062. var that = this;
  60063. if (drawOptions.drawLegend && that._legend && legendHasInsidePosition) {
  60064. var panes = that.panes;
  60065. var newCanvas = (0, _extend2.extend)({}, panes[0].canvas);
  60066. var layoutManager = new _layout_manager2.default.LayoutManager;
  60067. newCanvas.right = panes[panes.length - 1].canvas.right;
  60068. newCanvas.bottom = panes[panes.length - 1].canvas.bottom;
  60069. layoutManager.setOptions({
  60070. width: 0,
  60071. height: 0
  60072. });
  60073. layoutManager.layoutElements([that._legend], newCanvas, _common.noop, [{
  60074. canvas: newCanvas
  60075. }], void 0)
  60076. }
  60077. },
  60078. _allowLegendInsidePosition: function() {
  60079. return true
  60080. },
  60081. _applyExtraSettings: function(series) {
  60082. var that = this;
  60083. var paneIndex = that._getPaneIndex(series.pane);
  60084. var panesClipRects = that._panesClipRects;
  60085. var wideClipRect = panesClipRects.wide[paneIndex];
  60086. series.setClippingParams(panesClipRects.base[paneIndex].id, wideClipRect && wideClipRect.id, that._getPaneBorderVisibility(paneIndex))
  60087. },
  60088. _updatePanesCanvases: function(drawOptions) {
  60089. if (!drawOptions.recreateCanvas) {
  60090. return
  60091. }(0, _utils.updatePanesCanvases)(this.panes, this._canvas, this._isRotated())
  60092. },
  60093. _renderScaleBreaks: function() {
  60094. this._valueAxes.concat(this._argumentAxes).forEach(function(axis) {
  60095. axis.drawScaleBreaks()
  60096. })
  60097. },
  60098. _applyPointMarkersAutoHiding: function() {
  60099. var that = this;
  60100. if (!that._themeManager.getOptions("autoHidePointMarkers")) {
  60101. that.series.forEach(function(s) {
  60102. return s.autoHidePointMarkers = false
  60103. });
  60104. return
  60105. }
  60106. that.panes.forEach(function(pane) {
  60107. var series = that.series.filter(function(s) {
  60108. return s.pane === pane.name && s.usePointsToDefineAutoHiding()
  60109. });
  60110. var argAxis = that.getArgumentAxis();
  60111. var argVisualRange = argAxis.visualRange();
  60112. var argTranslator = argAxis.getTranslator();
  60113. var argAxisType = argAxis.getOptions().type;
  60114. var argViewPortFilter = _range_data_calculator2.default.getViewPortFilter(argVisualRange || {});
  60115. var points = [];
  60116. var overloadedSeries = {};
  60117. series.forEach(function(s) {
  60118. var valAxis = s.getValueAxis();
  60119. var valVisualRange = valAxis.visualRange();
  60120. var valTranslator = valAxis.getTranslator();
  60121. var seriesIndex = that.series.indexOf(s);
  60122. var valViewPortFilter = _range_data_calculator2.default.getViewPortFilter(valVisualRange || {});
  60123. overloadedSeries[seriesIndex] = {};
  60124. series.forEach(function(sr) {
  60125. return overloadedSeries[seriesIndex][that.series.indexOf(sr)] = 0
  60126. });
  60127. var seriesPoints = [];
  60128. s.getPoints().filter(function(p) {
  60129. return p.getOptions().visible && argViewPortFilter(p.argument) && (valViewPortFilter(p.getMinValue(true)) || valViewPortFilter(p.getMaxValue(true)))
  60130. }).forEach(function(p) {
  60131. var tp = {
  60132. seriesIndex: seriesIndex,
  60133. argument: p.argument,
  60134. value: p.getMaxValue(true),
  60135. size: p.bubbleSize || p.getOptions().size
  60136. };
  60137. if (p.getMinValue(true) !== p.getMaxValue(true)) {
  60138. var mp = (0, _extend2.extend)({}, tp);
  60139. mp.value = p.getMinValue(true);
  60140. mp.x = argTranslator.to(mp.argument, 1);
  60141. mp.y = valTranslator.to(mp.value, 1);
  60142. seriesPoints.push(mp)
  60143. }
  60144. tp.x = argTranslator.to(tp.argument, 1);
  60145. tp.y = valTranslator.to(tp.value, 1);
  60146. seriesPoints.push(tp)
  60147. });
  60148. overloadedSeries[seriesIndex].pointsCount = seriesPoints.length;
  60149. overloadedSeries[seriesIndex].total = 0;
  60150. overloadedSeries[seriesIndex].continuousSeries = 0;
  60151. points = points.concat(seriesPoints)
  60152. });
  60153. var sortingCallback = "discrete" === argAxisType ? function(p1, p2) {
  60154. return argVisualRange.categories.indexOf(p1.argument) - argVisualRange.categories.indexOf(p2.argument)
  60155. } : function(p1, p2) {
  60156. return p1.argument - p2.argument
  60157. };
  60158. points.sort(sortingCallback);
  60159. var isContinuousSeries = false;
  60160. for (var i = 0; i < points.length - 1; i++) {
  60161. var curPoint = points[i];
  60162. var size = curPoint.size;
  60163. if ((0, _type.isDefined)(curPoint.x) && (0, _type.isDefined)(curPoint.y)) {
  60164. for (var j = i + 1; j < points.length; j++) {
  60165. var nextPoint = points[j];
  60166. var next_x = (0, _type.isDefined)(nextPoint) ? nextPoint.x : null;
  60167. var next_y = (0, _type.isDefined)(nextPoint) ? nextPoint.y : null;
  60168. if (!(0, _type.isDefined)(next_x) || Math.abs(curPoint.x - next_x) >= size) {
  60169. isContinuousSeries &= j !== i + 1;
  60170. break
  60171. } else {
  60172. var distance = (0, _type.isDefined)(next_x) && (0, _type.isDefined)(next_y) && Math.sqrt(Math.pow(curPoint.x - next_x, 2) + Math.pow(curPoint.y - next_y, 2));
  60173. if (distance && distance < size) {
  60174. overloadedSeries[curPoint.seriesIndex][nextPoint.seriesIndex]++;
  60175. overloadedSeries[curPoint.seriesIndex].total++;
  60176. if (!isContinuousSeries) {
  60177. overloadedSeries[curPoint.seriesIndex].continuousSeries++;
  60178. isContinuousSeries = true
  60179. }
  60180. }
  60181. }
  60182. }
  60183. }
  60184. }
  60185. series.forEach(function(s) {
  60186. var seriesIndex = that.series.indexOf(s);
  60187. s.autoHidePointMarkers = false;
  60188. var tickCount = argAxis.getTicksValues().majorTicksValues.length;
  60189. if (s.autoHidePointMarkersEnabled() && ("discrete" === argAxisType || overloadedSeries[seriesIndex].pointsCount > tickCount)) {
  60190. for (var index in overloadedSeries[seriesIndex]) {
  60191. var _i = parseInt(index);
  60192. if (isNaN(_i) || overloadedSeries[seriesIndex].total / overloadedSeries[seriesIndex].continuousSeries < 3) {
  60193. continue
  60194. }
  60195. if (_i === seriesIndex) {
  60196. if (2 * overloadedSeries[_i][_i] >= overloadedSeries[_i].pointsCount) {
  60197. s.autoHidePointMarkers = true;
  60198. break
  60199. }
  60200. } else {
  60201. if (overloadedSeries[seriesIndex].total >= overloadedSeries[seriesIndex].pointsCount) {
  60202. s.autoHidePointMarkers = true;
  60203. break
  60204. }
  60205. }
  60206. }
  60207. }
  60208. })
  60209. })
  60210. },
  60211. _renderAxes: function(drawOptions, panesBorderOptions) {
  60212. function calculateTitlesWidth(axes) {
  60213. return axes.map(function(axis) {
  60214. if (!axis.getTitle) {
  60215. return 0
  60216. }
  60217. var title = axis.getTitle();
  60218. return title ? title.bBox.width : 0
  60219. })
  60220. }
  60221. var that = this;
  60222. var rotated = that._isRotated();
  60223. var synchronizeMultiAxes = that._themeManager.getOptions("synchronizeMultiAxes");
  60224. var extendedArgAxes = (that._scrollBar ? [that._scrollBar] : []).concat(that._argumentAxes);
  60225. var verticalAxes = rotated ? extendedArgAxes : that._valueAxes;
  60226. var horizontalAxes = rotated ? that._valueAxes : extendedArgAxes;
  60227. var allAxes = verticalAxes.concat(horizontalAxes);
  60228. that._updatePanesCanvases(drawOptions);
  60229. var panesCanvases = that.panes.reduce(function(canvases, pane) {
  60230. canvases[pane.name] = (0, _extend2.extend)({}, pane.canvas);
  60231. return canvases
  60232. }, {});
  60233. var cleanPanesCanvases = (0, _extend2.extend)(true, {}, panesCanvases);
  60234. if (!drawOptions.adjustAxes) {
  60235. drawAxesWithTicks(verticalAxes, !rotated && synchronizeMultiAxes, panesCanvases, panesBorderOptions);
  60236. drawAxesWithTicks(horizontalAxes, rotated && synchronizeMultiAxes, panesCanvases, panesBorderOptions);
  60237. performActionOnAxes(allAxes, "prepareAnimation");
  60238. that._renderScaleBreaks();
  60239. return false
  60240. }
  60241. if (that._scrollBar) {
  60242. that._scrollBar.setPane(that.panes)
  60243. }
  60244. var vAxesMargins = {
  60245. panes: {}
  60246. };
  60247. var hAxesMargins = getHorizontalAxesMargins(horizontalAxes, function(axis) {
  60248. return axis.estimateMargins(panesCanvases[axis.pane])
  60249. });
  60250. panesCanvases = shrinkCanvases(rotated, panesCanvases, vAxesMargins, hAxesMargins);
  60251. drawAxesWithTicks(verticalAxes, !rotated && synchronizeMultiAxes, panesCanvases, panesBorderOptions);
  60252. vAxesMargins = getVerticalAxesMargins(verticalAxes);
  60253. panesCanvases = shrinkCanvases(rotated, panesCanvases, vAxesMargins, hAxesMargins);
  60254. drawAxesWithTicks(horizontalAxes, rotated && synchronizeMultiAxes, panesCanvases, panesBorderOptions);
  60255. hAxesMargins = getHorizontalAxesMargins(horizontalAxes, getAxisMargins);
  60256. panesCanvases = shrinkCanvases(rotated, panesCanvases, vAxesMargins, hAxesMargins);
  60257. var oldTitlesWidth = calculateTitlesWidth(verticalAxes);
  60258. performActionOnAxes(allAxes, "updateSize", panesCanvases, axisAnimationEnabled(drawOptions, that._getVisibleSeries()));
  60259. horizontalAxes.forEach(shiftAxis("top", "bottom"));
  60260. verticalAxes.forEach(shiftAxis("left", "right"));
  60261. that._renderScaleBreaks();
  60262. that.panes.forEach(function(pane) {
  60263. (0, _extend2.extend)(pane.canvas, panesCanvases[pane.name])
  60264. });
  60265. that._valueAxes.forEach(function(axis) {
  60266. axis.setInitRange()
  60267. });
  60268. verticalAxes.forEach(function(axis, i) {
  60269. if (axis.hasWrap && axis.hasWrap()) {
  60270. var title = axis.getTitle();
  60271. var newTitleWidth = title ? title.bBox.width : 0;
  60272. var offset = newTitleWidth - oldTitlesWidth[i];
  60273. if ("right" === axis.getOptions().position) {
  60274. vAxesMargins.right += offset
  60275. } else {
  60276. vAxesMargins.left += offset;
  60277. that.panes.forEach(function(_ref) {
  60278. var name = _ref.name;
  60279. return vAxesMargins.panes[name].left += offset
  60280. })
  60281. }
  60282. panesCanvases = shrinkCanvases(rotated, panesCanvases, vAxesMargins, hAxesMargins);
  60283. performActionOnAxes(allAxes, "updateSize", panesCanvases, false, false);
  60284. oldTitlesWidth = calculateTitlesWidth(verticalAxes)
  60285. }
  60286. });
  60287. return cleanPanesCanvases
  60288. },
  60289. _shrinkAxes: function(sizeShortage, panesCanvases) {
  60290. if (!sizeShortage || !panesCanvases) {
  60291. return
  60292. }
  60293. this._renderer.stopAllAnimations(true);
  60294. var that = this;
  60295. var rotated = that._isRotated();
  60296. var extendedArgAxes = (that._scrollBar ? [that._scrollBar] : []).concat(that._argumentAxes);
  60297. var verticalAxes = rotated ? extendedArgAxes : that._valueAxes;
  60298. var horizontalAxes = rotated ? that._valueAxes : extendedArgAxes;
  60299. var allAxes = verticalAxes.concat(horizontalAxes);
  60300. if (sizeShortage.width || sizeShortage.height) {
  60301. checkUsedSpace(sizeShortage, "height", horizontalAxes, getHorizontalAxesMargins);
  60302. checkUsedSpace(sizeShortage, "width", verticalAxes, getVerticalAxesMargins);
  60303. performActionOnAxes(allAxes, "updateSize", panesCanvases);
  60304. panesCanvases = shrinkCanvases(rotated, panesCanvases, getVerticalAxesMargins(verticalAxes), getHorizontalAxesMargins(horizontalAxes, getAxisMargins));
  60305. performActionOnAxes(allAxes, "updateSize", panesCanvases);
  60306. horizontalAxes.forEach(shiftAxis("top", "bottom"));
  60307. verticalAxes.forEach(shiftAxis("left", "right"));
  60308. that.panes.forEach(function(pane) {
  60309. (0, _extend2.extend)(pane.canvas, panesCanvases[pane.name])
  60310. })
  60311. }
  60312. },
  60313. _getPanesParameters: function() {
  60314. var that = this;
  60315. var panes = that.panes;
  60316. var params = [];
  60317. for (var i = 0; i < panes.length; i++) {
  60318. if (that._getPaneBorderVisibility(i)) {
  60319. params.push({
  60320. coords: panes[i].borderCoords,
  60321. clipRect: that._panesClipRects.fixed[i]
  60322. })
  60323. }
  60324. }
  60325. return params
  60326. },
  60327. _createCrosshairCursor: function() {
  60328. var that = this;
  60329. var options = that._themeManager.getOptions("crosshair") || {};
  60330. var argumentAxis = that.getArgumentAxis();
  60331. var axes = !that._isRotated() ? [
  60332. [argumentAxis], that._valueAxes
  60333. ] : [that._valueAxes, [argumentAxis]];
  60334. var parameters = {
  60335. canvas: that._getCommonCanvas(),
  60336. panes: that._getPanesParameters(),
  60337. axes: axes
  60338. };
  60339. if (!options || !options.enabled) {
  60340. return
  60341. }
  60342. if (!that._crosshair) {
  60343. that._crosshair = new _crosshair2.default.Crosshair(that._renderer, options, parameters, that._crosshairCursorGroup)
  60344. } else {
  60345. that._crosshair.update(options, parameters)
  60346. }
  60347. that._crosshair.render()
  60348. },
  60349. _getCommonCanvas: function() {
  60350. var commonCanvas;
  60351. var panes = this.panes;
  60352. for (var i = 0; i < panes.length; i++) {
  60353. var canvas = panes[i].canvas;
  60354. if (!commonCanvas) {
  60355. commonCanvas = (0, _extend2.extend)({}, canvas)
  60356. } else {
  60357. commonCanvas.right = canvas.right;
  60358. commonCanvas.bottom = canvas.bottom
  60359. }
  60360. }
  60361. return commonCanvas
  60362. },
  60363. _createPanesBackground: function() {
  60364. var that = this;
  60365. var defaultBackgroundColor = that._themeManager.getOptions("commonPaneSettings").backgroundColor;
  60366. var renderer = that._renderer;
  60367. var rects = [];
  60368. that._panesBackgroundGroup.clear();
  60369. for (var i = 0; i < that.panes.length; i++) {
  60370. var backgroundColor = that.panes[i].backgroundColor || defaultBackgroundColor;
  60371. if (!backgroundColor || "none" === backgroundColor) {
  60372. rects.push(null);
  60373. continue
  60374. }
  60375. var rect = renderer.rect(0, 0, 0, 0).attr({
  60376. fill: backgroundColor,
  60377. "stroke-width": 0
  60378. }).append(that._panesBackgroundGroup);
  60379. rects.push(rect)
  60380. }
  60381. that.panesBackground = rects
  60382. },
  60383. _fillPanesBackground: function() {
  60384. var that = this;
  60385. (0, _iterator.each)(that.panes, function(i, pane) {
  60386. var bc = pane.borderCoords;
  60387. if (null !== that.panesBackground[i]) {
  60388. that.panesBackground[i].attr({
  60389. x: bc.left,
  60390. y: bc.top,
  60391. width: bc.width,
  60392. height: bc.height
  60393. })
  60394. }
  60395. })
  60396. },
  60397. _calcPaneBorderCoords: function(pane) {
  60398. var canvas = pane.canvas;
  60399. var bc = pane.borderCoords = pane.borderCoords || {};
  60400. bc.left = canvas.left;
  60401. bc.top = canvas.top;
  60402. bc.right = canvas.width - canvas.right;
  60403. bc.bottom = canvas.height - canvas.bottom;
  60404. bc.width = Math.max(bc.right - bc.left, 0);
  60405. bc.height = Math.max(bc.bottom - bc.top, 0)
  60406. },
  60407. _drawPanesBorders: function(panesBorderOptions) {
  60408. var that = this;
  60409. var rotated = that._isRotated();
  60410. that._panesBorderGroup.linkRemove().clear();
  60411. (0, _iterator.each)(that.panes, function(i, pane) {
  60412. var borderOptions = panesBorderOptions[pane.name];
  60413. var attr = {
  60414. fill: "none",
  60415. stroke: borderOptions.color,
  60416. "stroke-opacity": borderOptions.opacity,
  60417. "stroke-width": borderOptions.width,
  60418. dashStyle: borderOptions.dashStyle,
  60419. "stroke-linecap": "square"
  60420. };
  60421. that._calcPaneBorderCoords(pane, rotated);
  60422. if (!borderOptions.visible) {
  60423. return
  60424. }
  60425. var bc = pane.borderCoords;
  60426. var segmentRectParams = prepareSegmentRectPoints(bc.left, bc.top, bc.width, bc.height, borderOptions);
  60427. that._renderer.path(segmentRectParams.points, segmentRectParams.pathType).attr(attr).append(that._panesBorderGroup)
  60428. });
  60429. that._panesBorderGroup.linkAppend()
  60430. },
  60431. _createClipRect: function(clipArray, index, left, top, width, height) {
  60432. var that = this;
  60433. var clipRect = clipArray[index];
  60434. if (!clipRect) {
  60435. clipRect = that._renderer.clipRect(left, top, width, height);
  60436. clipArray[index] = clipRect
  60437. } else {
  60438. clipRect.attr({
  60439. x: left,
  60440. y: top,
  60441. width: width,
  60442. height: height
  60443. })
  60444. }
  60445. },
  60446. _createClipRectsForPanes: function() {
  60447. var that = this;
  60448. var canvas = that._canvas;
  60449. (0, _iterator.each)(that.panes, function(i, pane) {
  60450. var needWideClipRect = false;
  60451. var bc = pane.borderCoords;
  60452. var left = bc.left;
  60453. var top = bc.top;
  60454. var width = bc.width;
  60455. var height = bc.height;
  60456. var panesClipRects = that._panesClipRects;
  60457. that._createClipRect(panesClipRects.fixed, i, left, top, width, height);
  60458. that._createClipRect(panesClipRects.base, i, left, top, width, height);
  60459. (0, _iterator.each)(that.series, function(_, series) {
  60460. if (series.pane === pane.name && (series.isFinancialSeries() || series.areErrorBarsVisible())) {
  60461. needWideClipRect = true
  60462. }
  60463. });
  60464. if (needWideClipRect) {
  60465. if (that._isRotated()) {
  60466. top = 0;
  60467. height = canvas.height
  60468. } else {
  60469. left = 0;
  60470. width = canvas.width
  60471. }
  60472. that._createClipRect(panesClipRects.wide, i, left, top, width, height)
  60473. } else {
  60474. panesClipRects.wide[i] = null
  60475. }
  60476. })
  60477. },
  60478. _getPaneIndex: function(paneName) {
  60479. var paneIndex;
  60480. (0, _iterator.each)(this.panes, function(index, pane) {
  60481. if (pane.name === paneName) {
  60482. paneIndex = index;
  60483. return false
  60484. }
  60485. });
  60486. return paneIndex
  60487. },
  60488. _getPaneBorderVisibility: function(paneIndex) {
  60489. var commonPaneBorderVisible = this._themeManager.getOptions("commonPaneSettings").border.visible;
  60490. var pane = this.panes[paneIndex] || {};
  60491. var paneBorder = pane.border || {};
  60492. return "visible" in paneBorder ? paneBorder.visible : commonPaneBorderVisible
  60493. },
  60494. _getElementsClipRectID: function(paneName) {
  60495. return this._panesClipRects.fixed[this._getPaneIndex(paneName)].id
  60496. },
  60497. _getCanvasForPane: function(paneName) {
  60498. var panes = this.panes;
  60499. var panesNumber = panes.length;
  60500. for (var i = 0; i < panesNumber; i++) {
  60501. if (panes[i].name === paneName) {
  60502. return panes[i].canvas
  60503. }
  60504. }
  60505. },
  60506. _getTrackerSettings: function() {
  60507. var that = this;
  60508. var themeManager = that._themeManager;
  60509. return (0, _extend2.extend)(this.callBase(), {
  60510. chart: that,
  60511. rotated: that._isRotated(),
  60512. crosshair: that._getCrosshairOptions().enabled ? that._crosshair : null,
  60513. stickyHovering: themeManager.getOptions("stickyHovering")
  60514. })
  60515. },
  60516. _resolveLabelOverlappingStack: function() {
  60517. var that = this;
  60518. var isRotated = that._isRotated();
  60519. var shiftDirection = isRotated ? function(box, length) {
  60520. return {
  60521. x: box.x - length,
  60522. y: box.y
  60523. }
  60524. } : function(box, length) {
  60525. return {
  60526. x: box.x,
  60527. y: box.y - length
  60528. }
  60529. };
  60530. (0, _iterator.each)(that._getStackPoints(), function(_, stacks) {
  60531. (0, _iterator.each)(stacks, function(_, points) {
  60532. _base_chart.overlapping.resolveLabelOverlappingInOneDirection(points, that._getCommonCanvas(), isRotated, shiftDirection, function(a, b) {
  60533. var coordPosition = isRotated ? 1 : 0;
  60534. var figureCenter1 = a.labels[0].getFigureCenter()[coordPosition];
  60535. var figureCenter12 = b.labels[0].getFigureCenter()[coordPosition];
  60536. if (figureCenter1 - figureCenter12 === 0) {
  60537. return (a.value() - b.value()) * (a.labels[0].getPoint().series.getValueAxis().getTranslator().isInverted() ? -1 : 1)
  60538. }
  60539. return 0
  60540. })
  60541. })
  60542. })
  60543. },
  60544. _getStackPoints: function() {
  60545. var stackPoints = {};
  60546. var visibleSeries = this._getVisibleSeries();
  60547. (0, _iterator.each)(visibleSeries, function(_, singleSeries) {
  60548. var points = singleSeries.getPoints();
  60549. var stackName = singleSeries.getStackName() || null;
  60550. (0, _iterator.each)(points, function(_, point) {
  60551. var argument = point.argument;
  60552. if (!stackPoints[argument]) {
  60553. stackPoints[argument] = {}
  60554. }
  60555. if (!stackPoints[argument][stackName]) {
  60556. stackPoints[argument][stackName] = []
  60557. }
  60558. stackPoints[argument][stackName].push(point)
  60559. })
  60560. });
  60561. return stackPoints
  60562. },
  60563. _getCrosshairOptions: function() {
  60564. return this._getOption("crosshair")
  60565. },
  60566. _parseVisualRangeOption: function(fullName, value) {
  60567. var that = this;
  60568. var name = fullName.split(/[.[]/)[0];
  60569. var index = fullName.match(/\d+/g);
  60570. if (fullName.indexOf("visualRange") > 0) {
  60571. that._setCustomVisualRange("argumentAxis" === name, (0, _type.isDefined)(index) ? parseInt(index[0]) : index, value)
  60572. } else {
  60573. if (("object" === (0, _type.type)(value) || "array" === (0, _type.type)(value)) && name.indexOf("Axis") > 0 && JSON.stringify(value).indexOf("visualRange") > 0) {
  60574. if ((0, _type.isDefined)(value.visualRange)) {
  60575. that._setCustomVisualRange("argumentAxis" === name, (0, _type.isDefined)(index) ? parseInt(index[0]) : index, value.visualRange)
  60576. } else {
  60577. if (_isArray(value)) {
  60578. value.forEach(function(a, i) {
  60579. return that._setCustomVisualRange("argumentAxis" === name, i, a.visualRange)
  60580. })
  60581. }
  60582. }
  60583. }
  60584. }
  60585. },
  60586. _setCustomVisualRange: function(isArgumentAxis, index, value) {
  60587. var that = this;
  60588. var axesName = isArgumentAxis ? "argumentAxis" : "valueAxis";
  60589. var options = that._options[axesName];
  60590. if (!options) {
  60591. return
  60592. }
  60593. if (isArgumentAxis || !(0, _type.isDefined)(index)) {
  60594. options._customVisualRange = value
  60595. } else {
  60596. options[index]._customVisualRange = value
  60597. }
  60598. that._axesReinitialized = true
  60599. },
  60600. zoomArgument: function(min, max) {
  60601. var that = this;
  60602. if (!that._initialized || !(0, _type.isDefined)(min) && !(0, _type.isDefined)(max)) {
  60603. return
  60604. }
  60605. that.getArgumentAxis().visualRange([min, max])
  60606. },
  60607. resetVisualRange: function() {
  60608. var that = this;
  60609. that._argumentAxes.forEach(function(axis) {
  60610. axis.resetVisualRange(that.getArgumentAxis() !== axis)
  60611. });
  60612. that._valueAxes.forEach(function(axis) {
  60613. return axis.resetVisualRange(false)
  60614. });
  60615. that._requestChange([VISUAL_RANGE])
  60616. },
  60617. _getVisualRangeSetter: function() {
  60618. var chart = this;
  60619. return function(axis, _ref2) {
  60620. var skipEventRising = _ref2.skipEventRising,
  60621. range = _ref2.range;
  60622. if (axis.getOptions().optionPath) {
  60623. chart._parseVisualRangeOption(axis.getOptions().optionPath + ".visualRange", range);
  60624. axis.setCustomVisualRange(range)
  60625. }
  60626. axis.skipEventRising = skipEventRising;
  60627. if (axis.isArgumentAxis) {
  60628. if (axis !== chart.getArgumentAxis()) {
  60629. return
  60630. }
  60631. chart._argumentAxes.filter(function(a) {
  60632. return a !== axis
  60633. }).forEach(function(a) {
  60634. return a.visualRange(range, {
  60635. start: true,
  60636. end: true
  60637. })
  60638. })
  60639. }
  60640. if (chart._applyingChanges) {
  60641. chart._change_VISUAL_RANGE()
  60642. } else {
  60643. chart._requestChange([VISUAL_RANGE])
  60644. }
  60645. }
  60646. },
  60647. getVisibleArgumentBounds: function() {
  60648. var translator = this._argumentAxes[0].getTranslator();
  60649. var range = translator.getBusinessRange();
  60650. var isDiscrete = "discrete" === range.axisType;
  60651. var categories = range.categories;
  60652. return {
  60653. minVisible: isDiscrete ? range.minVisible || categories[0] : range.minVisible,
  60654. maxVisible: isDiscrete ? range.maxVisible || categories[categories.length - 1] : range.maxVisible
  60655. }
  60656. },
  60657. _change_VISUAL_RANGE: function() {
  60658. var that = this;
  60659. that._recreateSizeDependentObjects(false);
  60660. if (!that._changes.has("FULL_RENDER")) {
  60661. that._doRender({
  60662. force: true,
  60663. drawTitle: false,
  60664. drawLegend: false,
  60665. adjustAxes: this.option("adjustAxesOnZoom") || false,
  60666. animate: false
  60667. });
  60668. that._raiseZoomEndHandlers()
  60669. }
  60670. },
  60671. _change_FULL_RENDER: function() {
  60672. this.callBase();
  60673. if (this._changes.has(VISUAL_RANGE)) {
  60674. this._raiseZoomEndHandlers()
  60675. }
  60676. },
  60677. _raiseZoomEndHandlers: function() {
  60678. this._argumentAxes.forEach(function(axis) {
  60679. return axis.handleZoomEnd()
  60680. });
  60681. this._valueAxes.forEach(function(axis) {
  60682. return axis.handleZoomEnd()
  60683. })
  60684. },
  60685. _notifyOptionChanged: function(option, value, previousValue) {
  60686. this.callBase.apply(this, arguments);
  60687. if (!this._optionChangedLocker) {
  60688. this._parseVisualRangeOption(option, value)
  60689. }
  60690. },
  60691. _setOptionsByReference: function() {
  60692. this.callBase();
  60693. (0, _extend2.extend)(this._optionsByReference, {
  60694. "argumentAxis.visualRange": true,
  60695. "valueAxis.visualRange": true
  60696. })
  60697. },
  60698. option: function option() {
  60699. var option = this.callBase.apply(this, arguments);
  60700. if ("array" === (0, _type.type)(this._options.valueAxis)) {
  60701. for (var i = 0; i < this._options.valueAxis.length; i++) {
  60702. var optionPath = "valueAxis[".concat(i, "].visualRange");
  60703. this._optionsByReference[optionPath] = true
  60704. }
  60705. }
  60706. return option
  60707. },
  60708. _optionChanged: function(arg) {
  60709. var that = this;
  60710. if (!that._optionChangedLocker) {
  60711. if (arg.fullName.indexOf("visualRange") > 0) {
  60712. var axisPath;
  60713. if (arg.fullName) {
  60714. axisPath = arg.fullName.slice(0, arg.fullName.indexOf("."))
  60715. }
  60716. var visualRange = arg.value;
  60717. var options = {
  60718. skipEventRising: true
  60719. };
  60720. var pathElements = arg.fullName.split(".");
  60721. var destElem = pathElements[pathElements.length - 1];
  60722. if ("endValue" === destElem || "startValue" === destElem) {
  60723. options = {
  60724. allowPartialUpdate: true
  60725. };
  60726. visualRange = _defineProperty({}, destElem, arg.value)
  60727. }
  60728. var axis = [that.getArgumentAxis()].concat(that._valueAxes).filter(function(a) {
  60729. return a.getOptions().optionPath === axisPath
  60730. })[0];
  60731. if (axis) {
  60732. axis.visualRange(visualRange, options)
  60733. }
  60734. } else {
  60735. if (that.getPartialChangeOptionsName(arg).indexOf("visualRange") > -1) {
  60736. if ("argumentAxis" === arg.name) {
  60737. that.getArgumentAxis().visualRange(arg.value.visualRange)
  60738. } else {
  60739. if ("valueAxis" === arg.name) {
  60740. if ("object" === (0, _type.type)(arg.value)) {
  60741. that._valueAxes[0].visualRange(arg.value.visualRange)
  60742. } else {
  60743. arg.value.forEach(function(v, index) {
  60744. if ((0, _type.isDefined)(v.visualRange) && (0, _type.isDefined)(that._valueAxes[index])) {
  60745. that._valueAxes[index].visualRange(arg.value[index].visualRange)
  60746. }
  60747. })
  60748. }
  60749. }
  60750. }
  60751. }
  60752. }
  60753. }
  60754. that.callBase(arg)
  60755. },
  60756. _notify: function() {
  60757. var that = this;
  60758. that.callBase();
  60759. if (true === that.option("disableTwoWayBinding")) {
  60760. return
  60761. }
  60762. var argumentVisualRange = (0, _utils.convertVisualRangeObject)(this._argumentAxes[0].visualRange(), !_isArray(that.option("argumentAxis.visualRange")));
  60763. if (!this._argumentAxes[0].skipEventRising || !rangesAreEqual(argumentVisualRange, that.option("argumentAxis.visualRange"))) {
  60764. that.option("argumentAxis.visualRange", argumentVisualRange)
  60765. } else {
  60766. this._argumentAxes[0].skipEventRising = null
  60767. }
  60768. that._valueAxes.forEach(function(axis) {
  60769. if (axis.getOptions().optionPath) {
  60770. var path = "".concat(axis.getOptions().optionPath, ".visualRange");
  60771. var visualRange = (0, _utils.convertVisualRangeObject)(axis.visualRange(), !_isArray(that.option(path)));
  60772. if (!axis.skipEventRising || !rangesAreEqual(visualRange, that.option(path))) {
  60773. that.option(path, visualRange)
  60774. } else {
  60775. axis.skipEventRising = null
  60776. }
  60777. }
  60778. })
  60779. }
  60780. });
  60781. function rangesAreEqual(range, rangeFromOptions) {
  60782. if (_isArray(rangeFromOptions)) {
  60783. return range.length === rangeFromOptions.length && range.every(function(item, i) {
  60784. return item === rangeFromOptions[i]
  60785. })
  60786. } else {
  60787. return range.startValue === rangeFromOptions.startValue && range.endValue === rangeFromOptions.endValue
  60788. }
  60789. }
  60790. dxChart.addPlugin(__webpack_require__( /*! ./chart_components/shutter_zoom */ 788));
  60791. dxChart.addPlugin(__webpack_require__( /*! ./chart_components/zoom_and_pan */ 789));
  60792. dxChart.addPlugin(__webpack_require__( /*! ./core/annotations */ 411).plugins.core);
  60793. dxChart.addPlugin(__webpack_require__( /*! ./core/annotations */ 411).plugins.chart);
  60794. (0, _component_registrator2.default)("dxChart", dxChart);
  60795. module.exports = dxChart;
  60796. module.exports._test_prepareSegmentRectPoints = function() {
  60797. var original = prepareSegmentRectPoints.original || prepareSegmentRectPoints;
  60798. if (arguments[0]) {
  60799. prepareSegmentRectPoints = arguments[0]
  60800. }
  60801. prepareSegmentRectPoints.original = original;
  60802. prepareSegmentRectPoints.restore = function() {
  60803. prepareSegmentRectPoints = original
  60804. };
  60805. return prepareSegmentRectPoints
  60806. }
  60807. },
  60808. /*!***************************************************************!*\
  60809. !*** ./artifacts/transpiled/viz/core/themes/generic.light.js ***!
  60810. \***************************************************************/
  60811. /*! dynamic exports provided */
  60812. /*! all exports used */
  60813. function(module, exports, __webpack_require__) {
  60814. var WHITE = "#ffffff";
  60815. var BLACK = "#000000";
  60816. var LIGHT_GREY = "#d3d3d3";
  60817. var GREY_GREEN = "#303030";
  60818. var SOME_GREY = "#2b2b2b";
  60819. var RED = "#ff0000";
  60820. var PRIMARY_TITLE_COLOR = "#232323";
  60821. var SECONDARY_TITLE_COLOR = "#767676";
  60822. var NONE = "none";
  60823. var SOLID = "solid";
  60824. var TOP = "top";
  60825. var RIGHT = "right";
  60826. var BOTTOM = "bottom";
  60827. var LEFT = "left";
  60828. var CENTER = "center";
  60829. var INSIDE = "inside";
  60830. var OUTSIDE = "outside";
  60831. var themeModule = __webpack_require__( /*! ../../themes */ 50);
  60832. var registerTheme = themeModule.registerTheme;
  60833. var registerThemeAlias = themeModule.registerThemeAlias;
  60834. registerTheme({
  60835. name: "generic.light",
  60836. isDefault: true,
  60837. font: {
  60838. color: SECONDARY_TITLE_COLOR,
  60839. family: "'Segoe UI', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif",
  60840. weight: 400,
  60841. size: 12,
  60842. cursor: "default"
  60843. },
  60844. redrawOnResize: true,
  60845. backgroundColor: WHITE,
  60846. primaryTitleColor: PRIMARY_TITLE_COLOR,
  60847. secondaryTitleColor: SECONDARY_TITLE_COLOR,
  60848. gridColor: LIGHT_GREY,
  60849. axisColor: SECONDARY_TITLE_COLOR,
  60850. title: {
  60851. backgroundColor: WHITE,
  60852. font: {
  60853. size: 28,
  60854. family: "'Segoe UI Light', 'Helvetica Neue Light', 'Segoe UI', 'Helvetica Neue', 'Trebuchet MS', Verdana, sans-serif",
  60855. weight: 200
  60856. },
  60857. subtitle: {
  60858. font: {
  60859. size: 16
  60860. },
  60861. offset: 0,
  60862. wordWrap: "normal",
  60863. textOverflow: "ellipsis"
  60864. },
  60865. wordWrap: "normal",
  60866. textOverflow: "ellipsis"
  60867. },
  60868. loadingIndicator: {
  60869. text: "Loading..."
  60870. },
  60871. "export": {
  60872. backgroundColor: WHITE,
  60873. margin: 10,
  60874. font: {
  60875. size: 14,
  60876. color: PRIMARY_TITLE_COLOR,
  60877. weight: 400
  60878. },
  60879. button: {
  60880. margin: {
  60881. top: 8,
  60882. left: 10,
  60883. right: 10,
  60884. bottom: 8
  60885. },
  60886. "default": {
  60887. color: "#333",
  60888. borderColor: "#ddd",
  60889. backgroundColor: WHITE
  60890. },
  60891. hover: {
  60892. color: "#333",
  60893. borderColor: "#bebebe",
  60894. backgroundColor: "#e6e6e6"
  60895. },
  60896. focus: {
  60897. color: BLACK,
  60898. borderColor: "#9d9d9d",
  60899. backgroundColor: "#e6e6e6"
  60900. },
  60901. active: {
  60902. color: "#333",
  60903. borderColor: "#9d9d9d",
  60904. backgroundColor: "#d4d4d4"
  60905. }
  60906. },
  60907. shadowColor: LIGHT_GREY
  60908. },
  60909. tooltip: {
  60910. enabled: false,
  60911. border: {
  60912. width: 1,
  60913. color: LIGHT_GREY,
  60914. dashStyle: SOLID,
  60915. visible: true
  60916. },
  60917. font: {
  60918. color: PRIMARY_TITLE_COLOR
  60919. },
  60920. color: WHITE,
  60921. arrowLength: 10,
  60922. paddingLeftRight: 18,
  60923. paddingTopBottom: 15,
  60924. textAlignment: "center",
  60925. shared: false,
  60926. location: CENTER,
  60927. shadow: {
  60928. opacity: .4,
  60929. offsetX: 0,
  60930. offsetY: 4,
  60931. blur: 2,
  60932. color: BLACK
  60933. }
  60934. },
  60935. legend: {
  60936. hoverMode: "includePoints",
  60937. verticalAlignment: TOP,
  60938. horizontalAlignment: RIGHT,
  60939. position: OUTSIDE,
  60940. visible: true,
  60941. margin: 10,
  60942. markerSize: 12,
  60943. border: {
  60944. visible: false,
  60945. width: 1,
  60946. cornerRadius: 0,
  60947. dashStyle: SOLID
  60948. },
  60949. paddingLeftRight: 20,
  60950. paddingTopBottom: 15,
  60951. columnCount: 0,
  60952. rowCount: 0,
  60953. columnItemSpacing: 20,
  60954. rowItemSpacing: 8,
  60955. title: {
  60956. backgroundColor: WHITE,
  60957. margin: {
  60958. left: 0,
  60959. bottom: 9,
  60960. right: 0,
  60961. top: 0
  60962. },
  60963. font: {
  60964. size: 18,
  60965. weight: 200
  60966. },
  60967. subtitle: {
  60968. offset: 0,
  60969. font: {
  60970. size: 14
  60971. },
  60972. wordWrap: "none",
  60973. textOverflow: "ellipsis"
  60974. },
  60975. wordWrap: "none",
  60976. textOverflow: "ellipsis"
  60977. }
  60978. },
  60979. "chart:common": {
  60980. animation: {
  60981. enabled: true,
  60982. duration: 1e3,
  60983. easing: "easeOutCubic",
  60984. maxPointCountSupported: 300
  60985. },
  60986. commonSeriesSettings: {
  60987. border: {
  60988. visible: false,
  60989. width: 2
  60990. },
  60991. showInLegend: true,
  60992. visible: true,
  60993. hoverMode: "nearestPoint",
  60994. selectionMode: "includePoints",
  60995. hoverStyle: {
  60996. hatching: {
  60997. direction: RIGHT,
  60998. width: 2,
  60999. step: 6,
  61000. opacity: .75
  61001. },
  61002. border: {
  61003. visible: false,
  61004. width: 3
  61005. }
  61006. },
  61007. selectionStyle: {
  61008. hatching: {
  61009. direction: RIGHT,
  61010. width: 2,
  61011. step: 6,
  61012. opacity: .5
  61013. },
  61014. border: {
  61015. visible: false,
  61016. width: 3
  61017. }
  61018. },
  61019. valueErrorBar: {
  61020. displayMode: "auto",
  61021. value: 1,
  61022. color: BLACK,
  61023. lineWidth: 2,
  61024. edgeLength: 8
  61025. },
  61026. label: {
  61027. visible: false,
  61028. alignment: CENTER,
  61029. rotationAngle: 0,
  61030. horizontalOffset: 0,
  61031. verticalOffset: 0,
  61032. radialOffset: 0,
  61033. showForZeroValues: true,
  61034. customizeText: void 0,
  61035. maxLabelCount: void 0,
  61036. position: OUTSIDE,
  61037. font: {
  61038. color: WHITE
  61039. },
  61040. border: {
  61041. visible: false,
  61042. width: 1,
  61043. color: LIGHT_GREY,
  61044. dashStyle: SOLID
  61045. },
  61046. connector: {
  61047. visible: false,
  61048. width: 1
  61049. }
  61050. }
  61051. },
  61052. seriesSelectionMode: "single",
  61053. pointSelectionMode: "single",
  61054. equalRowHeight: true,
  61055. dataPrepareSettings: {
  61056. checkTypeForAllData: false,
  61057. convertToAxisDataType: true,
  61058. sortingMethod: true
  61059. },
  61060. title: {
  61061. margin: 10
  61062. },
  61063. adaptiveLayout: {
  61064. width: 80,
  61065. height: 80,
  61066. keepLabels: true
  61067. },
  61068. _rtl: {
  61069. legend: {
  61070. itemTextPosition: LEFT
  61071. }
  61072. },
  61073. resolveLabelOverlapping: NONE
  61074. },
  61075. "chart:common:axis": {
  61076. visible: true,
  61077. valueMarginsEnabled: true,
  61078. placeholderSize: null,
  61079. logarithmBase: 10,
  61080. discreteAxisDivisionMode: "betweenLabels",
  61081. width: 1,
  61082. label: {
  61083. visible: true
  61084. },
  61085. grid: {
  61086. visible: false,
  61087. width: 1
  61088. },
  61089. minorGrid: {
  61090. visible: false,
  61091. width: 1,
  61092. opacity: .3
  61093. },
  61094. tick: {
  61095. visible: true,
  61096. width: 1,
  61097. length: 7,
  61098. shift: 3
  61099. },
  61100. minorTick: {
  61101. visible: false,
  61102. width: 1,
  61103. opacity: .3,
  61104. length: 7,
  61105. shift: 3
  61106. },
  61107. stripStyle: {
  61108. paddingLeftRight: 10,
  61109. paddingTopBottom: 5
  61110. },
  61111. constantLineStyle: {
  61112. width: 1,
  61113. color: BLACK,
  61114. dashStyle: SOLID,
  61115. label: {
  61116. visible: true,
  61117. position: INSIDE
  61118. }
  61119. },
  61120. marker: {
  61121. label: {}
  61122. }
  61123. },
  61124. chart: {
  61125. commonSeriesSettings: {
  61126. type: "line",
  61127. stack: "default",
  61128. aggregation: {
  61129. enabled: void 0
  61130. },
  61131. point: {
  61132. visible: true,
  61133. symbol: "circle",
  61134. size: 12,
  61135. border: {
  61136. visible: false,
  61137. width: 1
  61138. },
  61139. hoverMode: "onlyPoint",
  61140. selectionMode: "onlyPoint",
  61141. hoverStyle: {
  61142. border: {
  61143. visible: true,
  61144. width: 4
  61145. }
  61146. },
  61147. selectionStyle: {
  61148. border: {
  61149. visible: true,
  61150. width: 4
  61151. }
  61152. }
  61153. },
  61154. scatter: {},
  61155. line: {
  61156. width: 2,
  61157. dashStyle: SOLID,
  61158. hoverStyle: {
  61159. width: 3,
  61160. hatching: {
  61161. direction: NONE
  61162. }
  61163. },
  61164. selectionStyle: {
  61165. width: 3
  61166. }
  61167. },
  61168. stackedline: {
  61169. width: 2,
  61170. dashStyle: SOLID,
  61171. hoverStyle: {
  61172. width: 3,
  61173. hatching: {
  61174. direction: NONE
  61175. }
  61176. },
  61177. selectionStyle: {
  61178. width: 3
  61179. }
  61180. },
  61181. stackedspline: {
  61182. width: 2,
  61183. dashStyle: SOLID,
  61184. hoverStyle: {
  61185. width: 3,
  61186. hatching: {
  61187. direction: NONE
  61188. }
  61189. },
  61190. selectionStyle: {
  61191. width: 3
  61192. }
  61193. },
  61194. fullstackedline: {
  61195. width: 2,
  61196. dashStyle: SOLID,
  61197. hoverStyle: {
  61198. width: 3,
  61199. hatching: {
  61200. direction: NONE
  61201. }
  61202. },
  61203. selectionStyle: {
  61204. width: 3
  61205. }
  61206. },
  61207. fullstackedspline: {
  61208. width: 2,
  61209. dashStyle: SOLID,
  61210. hoverStyle: {
  61211. width: 3,
  61212. hatching: {
  61213. direction: NONE
  61214. }
  61215. },
  61216. selectionStyle: {
  61217. width: 3
  61218. }
  61219. },
  61220. stepline: {
  61221. width: 2,
  61222. dashStyle: SOLID,
  61223. hoverStyle: {
  61224. width: 3,
  61225. hatching: {
  61226. direction: NONE
  61227. }
  61228. },
  61229. selectionStyle: {
  61230. width: 3
  61231. }
  61232. },
  61233. area: {
  61234. point: {
  61235. visible: false
  61236. },
  61237. opacity: .5
  61238. },
  61239. stackedarea: {
  61240. point: {
  61241. visible: false
  61242. },
  61243. opacity: .5
  61244. },
  61245. fullstackedarea: {
  61246. point: {
  61247. visible: false
  61248. },
  61249. opacity: .5
  61250. },
  61251. fullstackedsplinearea: {
  61252. point: {
  61253. visible: false
  61254. },
  61255. opacity: .5
  61256. },
  61257. steparea: {
  61258. border: {
  61259. visible: true,
  61260. width: 2
  61261. },
  61262. point: {
  61263. visible: false
  61264. },
  61265. hoverStyle: {
  61266. border: {
  61267. visible: true,
  61268. width: 3
  61269. }
  61270. },
  61271. selectionStyle: {
  61272. border: {
  61273. visible: true,
  61274. width: 3
  61275. }
  61276. },
  61277. opacity: .5
  61278. },
  61279. spline: {
  61280. width: 2,
  61281. hoverStyle: {
  61282. width: 3,
  61283. hatching: {
  61284. direction: NONE
  61285. }
  61286. },
  61287. selectionStyle: {
  61288. width: 3
  61289. }
  61290. },
  61291. splinearea: {
  61292. point: {
  61293. visible: false
  61294. },
  61295. opacity: .5
  61296. },
  61297. stackedsplinearea: {
  61298. point: {
  61299. visible: false
  61300. },
  61301. opacity: .5
  61302. },
  61303. bar: {
  61304. cornerRadius: 0,
  61305. point: {
  61306. hoverStyle: {
  61307. border: {
  61308. visible: false
  61309. }
  61310. },
  61311. selectionStyle: {
  61312. border: {
  61313. visible: false
  61314. }
  61315. }
  61316. }
  61317. },
  61318. stackedbar: {
  61319. cornerRadius: 0,
  61320. point: {
  61321. hoverStyle: {
  61322. border: {
  61323. visible: false
  61324. }
  61325. },
  61326. selectionStyle: {
  61327. border: {
  61328. visible: false
  61329. }
  61330. }
  61331. },
  61332. label: {
  61333. position: INSIDE
  61334. }
  61335. },
  61336. fullstackedbar: {
  61337. cornerRadius: 0,
  61338. point: {
  61339. hoverStyle: {
  61340. border: {
  61341. visible: false
  61342. }
  61343. },
  61344. selectionStyle: {
  61345. border: {
  61346. visible: false
  61347. }
  61348. }
  61349. },
  61350. label: {
  61351. position: INSIDE
  61352. }
  61353. },
  61354. rangebar: {
  61355. cornerRadius: 0,
  61356. point: {
  61357. hoverStyle: {
  61358. border: {
  61359. visible: false
  61360. }
  61361. },
  61362. selectionStyle: {
  61363. border: {
  61364. visible: false
  61365. }
  61366. }
  61367. }
  61368. },
  61369. rangearea: {
  61370. point: {
  61371. visible: false
  61372. },
  61373. opacity: .5
  61374. },
  61375. rangesplinearea: {
  61376. point: {
  61377. visible: false
  61378. },
  61379. opacity: .5
  61380. },
  61381. bubble: {
  61382. opacity: .5,
  61383. point: {
  61384. hoverStyle: {
  61385. border: {
  61386. visible: false
  61387. }
  61388. },
  61389. selectionStyle: {
  61390. border: {
  61391. visible: false
  61392. }
  61393. }
  61394. }
  61395. },
  61396. candlestick: {
  61397. width: 1,
  61398. reduction: {
  61399. color: RED
  61400. },
  61401. hoverStyle: {
  61402. width: 3,
  61403. hatching: {
  61404. direction: NONE
  61405. }
  61406. },
  61407. selectionStyle: {
  61408. width: 3
  61409. },
  61410. point: {
  61411. border: {
  61412. visible: true
  61413. }
  61414. }
  61415. },
  61416. stock: {
  61417. width: 1,
  61418. reduction: {
  61419. color: RED
  61420. },
  61421. hoverStyle: {
  61422. width: 3,
  61423. hatching: {
  61424. direction: NONE
  61425. }
  61426. },
  61427. selectionStyle: {
  61428. width: 3
  61429. },
  61430. point: {
  61431. border: {
  61432. visible: true
  61433. }
  61434. }
  61435. }
  61436. },
  61437. crosshair: {
  61438. enabled: false,
  61439. color: "#f05b41",
  61440. width: 1,
  61441. dashStyle: SOLID,
  61442. label: {
  61443. visible: false,
  61444. font: {
  61445. color: WHITE,
  61446. size: 12
  61447. }
  61448. },
  61449. verticalLine: {
  61450. visible: true
  61451. },
  61452. horizontalLine: {
  61453. visible: true
  61454. }
  61455. },
  61456. commonAxisSettings: {
  61457. multipleAxesSpacing: 5,
  61458. forceUserTickInterval: false,
  61459. breakStyle: {
  61460. width: 5,
  61461. color: "#ababab",
  61462. line: "waved"
  61463. },
  61464. label: {
  61465. displayMode: "standard",
  61466. overlappingBehavior: "hide",
  61467. indentFromAxis: 10,
  61468. wordWrap: "normal",
  61469. textOverflow: "none"
  61470. },
  61471. title: {
  61472. font: {
  61473. size: 16
  61474. },
  61475. margin: 6,
  61476. alignment: CENTER
  61477. },
  61478. constantLineStyle: {
  61479. paddingLeftRight: 10,
  61480. paddingTopBottom: 10
  61481. }
  61482. },
  61483. horizontalAxis: {
  61484. position: BOTTOM,
  61485. axisDivisionFactor: 70,
  61486. label: {
  61487. rotationAngle: 90,
  61488. staggeringSpacing: 5,
  61489. alignment: CENTER
  61490. },
  61491. stripStyle: {
  61492. label: {
  61493. horizontalAlignment: CENTER,
  61494. verticalAlignment: TOP
  61495. }
  61496. },
  61497. constantLineStyle: {
  61498. label: {
  61499. horizontalAlignment: RIGHT,
  61500. verticalAlignment: TOP
  61501. }
  61502. },
  61503. constantLines: []
  61504. },
  61505. verticalAxis: {
  61506. position: LEFT,
  61507. axisDivisionFactor: 40,
  61508. label: {
  61509. alignment: RIGHT
  61510. },
  61511. stripStyle: {
  61512. label: {
  61513. horizontalAlignment: LEFT,
  61514. verticalAlignment: CENTER
  61515. }
  61516. },
  61517. constantLineStyle: {
  61518. label: {
  61519. horizontalAlignment: LEFT,
  61520. verticalAlignment: TOP
  61521. }
  61522. },
  61523. constantLines: []
  61524. },
  61525. argumentAxis: {
  61526. endOnTick: false,
  61527. workWeek: [1, 2, 3, 4, 5]
  61528. },
  61529. valueAxis: {
  61530. grid: {
  61531. visible: true
  61532. },
  61533. autoBreaksEnabled: false,
  61534. maxAutoBreakCount: 4
  61535. },
  61536. commonPaneSettings: {
  61537. backgroundColor: NONE,
  61538. border: {
  61539. color: LIGHT_GREY,
  61540. width: 1,
  61541. visible: false,
  61542. top: true,
  61543. bottom: true,
  61544. left: true,
  61545. right: true,
  61546. dashStyle: SOLID
  61547. }
  61548. },
  61549. scrollBar: {
  61550. visible: false,
  61551. offset: 5,
  61552. color: "gray",
  61553. width: 10
  61554. },
  61555. adjustOnZoom: true,
  61556. autoHidePointMarkers: true,
  61557. rotated: false,
  61558. zoomingMode: NONE,
  61559. scrollingMode: NONE,
  61560. synchronizeMultiAxes: true,
  61561. stickyHovering: true,
  61562. equalBarWidth: true,
  61563. barGroupPadding: .3,
  61564. minBubbleSize: 12,
  61565. maxBubbleSize: .2,
  61566. zoomAndPan: {
  61567. dragBoxStyle: {
  61568. color: "#2a2a2a",
  61569. opacity: .2
  61570. },
  61571. panKey: "shift",
  61572. allowMouseWheel: true,
  61573. allowTouchGestures: true
  61574. },
  61575. commonAnnotationSettings: {
  61576. font: {
  61577. color: "#333333"
  61578. },
  61579. tooltipEnabled: true,
  61580. border: {
  61581. width: 1,
  61582. color: "#dddddd",
  61583. dashStyle: SOLID,
  61584. visible: true
  61585. },
  61586. color: WHITE,
  61587. opacity: .9,
  61588. arrowLength: 14,
  61589. arrowWidth: 14,
  61590. paddingLeftRight: 10,
  61591. paddingTopBottom: 10,
  61592. shadow: {
  61593. opacity: .15,
  61594. offsetX: 0,
  61595. offsetY: 1,
  61596. blur: 4,
  61597. color: BLACK
  61598. },
  61599. image: {
  61600. width: 30,
  61601. height: 30
  61602. },
  61603. wordWrap: "normal",
  61604. textOverflow: "ellipsis",
  61605. allowDragging: false
  61606. }
  61607. },
  61608. pie: {
  61609. innerRadius: .5,
  61610. minDiameter: .5,
  61611. type: "pie",
  61612. dataPrepareSettings: {
  61613. _skipArgumentSorting: true
  61614. },
  61615. commonSeriesSettings: {
  61616. pie: {
  61617. border: {
  61618. visible: false,
  61619. width: 2,
  61620. color: WHITE
  61621. },
  61622. hoverStyle: {
  61623. hatching: {
  61624. direction: RIGHT,
  61625. width: 4,
  61626. step: 10,
  61627. opacity: .75
  61628. },
  61629. border: {
  61630. visible: false,
  61631. width: 2
  61632. }
  61633. },
  61634. selectionStyle: {
  61635. hatching: {
  61636. direction: RIGHT,
  61637. width: 4,
  61638. step: 10,
  61639. opacity: .5
  61640. },
  61641. border: {
  61642. visible: false,
  61643. width: 2
  61644. }
  61645. }
  61646. },
  61647. doughnut: {
  61648. border: {
  61649. visible: false,
  61650. width: 2,
  61651. color: WHITE
  61652. },
  61653. hoverStyle: {
  61654. hatching: {
  61655. direction: RIGHT,
  61656. width: 4,
  61657. step: 10,
  61658. opacity: .75
  61659. },
  61660. border: {
  61661. visible: false,
  61662. width: 2
  61663. }
  61664. },
  61665. selectionStyle: {
  61666. hatching: {
  61667. direction: RIGHT,
  61668. width: 4,
  61669. step: 10,
  61670. opacity: .5
  61671. },
  61672. border: {
  61673. visible: false,
  61674. width: 2
  61675. }
  61676. }
  61677. },
  61678. donut: {
  61679. border: {
  61680. visible: false,
  61681. width: 2,
  61682. color: WHITE
  61683. },
  61684. hoverStyle: {
  61685. hatching: {
  61686. direction: RIGHT,
  61687. width: 4,
  61688. step: 10,
  61689. opacity: .75
  61690. },
  61691. border: {
  61692. visible: false,
  61693. width: 2
  61694. }
  61695. },
  61696. selectionStyle: {
  61697. hatching: {
  61698. direction: RIGHT,
  61699. width: 4,
  61700. step: 10,
  61701. opacity: .5
  61702. },
  61703. border: {
  61704. visible: false,
  61705. width: 2
  61706. }
  61707. }
  61708. },
  61709. label: {
  61710. textOverflow: "ellipsis",
  61711. wordWrap: "normal"
  61712. }
  61713. },
  61714. legend: {
  61715. hoverMode: "allArgumentPoints",
  61716. backgroundColor: NONE
  61717. },
  61718. adaptiveLayout: {
  61719. keepLabels: false
  61720. }
  61721. },
  61722. gauge: {
  61723. scale: {
  61724. tick: {
  61725. visible: true,
  61726. length: 5,
  61727. width: 2,
  61728. opacity: 1
  61729. },
  61730. minorTick: {
  61731. visible: false,
  61732. length: 3,
  61733. width: 1,
  61734. opacity: 1
  61735. },
  61736. label: {
  61737. visible: true,
  61738. alignment: CENTER,
  61739. hideFirstOrLast: "last",
  61740. overlappingBehavior: "hide"
  61741. },
  61742. position: TOP,
  61743. endOnTick: false
  61744. },
  61745. rangeContainer: {
  61746. offset: 0,
  61747. width: 5,
  61748. backgroundColor: "#808080"
  61749. },
  61750. valueIndicators: {
  61751. _default: {
  61752. color: "#c2c2c2"
  61753. },
  61754. rangebar: {
  61755. space: 2,
  61756. size: 10,
  61757. color: "#cbc5cf",
  61758. backgroundColor: NONE,
  61759. text: {
  61760. indent: 0,
  61761. font: {
  61762. size: 14,
  61763. color: null
  61764. }
  61765. }
  61766. },
  61767. twocolorneedle: {
  61768. secondColor: "#e18e92"
  61769. },
  61770. trianglemarker: {
  61771. space: 2,
  61772. length: 14,
  61773. width: 13,
  61774. color: "#8798a5"
  61775. },
  61776. textcloud: {
  61777. arrowLength: 5,
  61778. horizontalOffset: 6,
  61779. verticalOffset: 3,
  61780. color: "#679ec5",
  61781. text: {
  61782. font: {
  61783. color: WHITE,
  61784. size: 18
  61785. }
  61786. }
  61787. }
  61788. },
  61789. indicator: {
  61790. hasPositiveMeaning: true,
  61791. layout: {
  61792. horizontalAlignment: CENTER,
  61793. verticalAlignment: BOTTOM
  61794. },
  61795. text: {
  61796. font: {
  61797. size: 18
  61798. }
  61799. }
  61800. },
  61801. _circular: {
  61802. scale: {
  61803. scaleDivisionFactor: 17,
  61804. orientation: OUTSIDE,
  61805. label: {
  61806. indentFromTick: 10
  61807. }
  61808. },
  61809. rangeContainer: {
  61810. orientation: OUTSIDE
  61811. },
  61812. valueIndicatorType: "rectangleneedle",
  61813. subvalueIndicatorType: "trianglemarker",
  61814. valueIndicators: {
  61815. _type: "rectangleneedle",
  61816. _default: {
  61817. offset: 20,
  61818. indentFromCenter: 0,
  61819. width: 2,
  61820. spindleSize: 14,
  61821. spindleGapSize: 10,
  61822. beginAdaptingAtRadius: 50
  61823. },
  61824. triangleneedle: {
  61825. width: 4
  61826. },
  61827. twocolorneedle: {
  61828. space: 2,
  61829. secondFraction: .4
  61830. },
  61831. rangebar: {
  61832. offset: 30
  61833. },
  61834. trianglemarker: {
  61835. offset: 6
  61836. },
  61837. textcloud: {
  61838. offset: -6
  61839. }
  61840. }
  61841. },
  61842. _linear: {
  61843. scale: {
  61844. scaleDivisionFactor: 25,
  61845. horizontalOrientation: RIGHT,
  61846. verticalOrientation: BOTTOM,
  61847. label: {
  61848. indentFromTick: -10
  61849. }
  61850. },
  61851. rangeContainer: {
  61852. horizontalOrientation: RIGHT,
  61853. verticalOrientation: BOTTOM
  61854. },
  61855. valueIndicatorType: "rangebar",
  61856. subvalueIndicatorType: "trianglemarker",
  61857. valueIndicators: {
  61858. _type: "rectangle",
  61859. _default: {
  61860. offset: 2.5,
  61861. length: 15,
  61862. width: 15
  61863. },
  61864. rectangle: {
  61865. width: 10
  61866. },
  61867. rangebar: {
  61868. offset: 10,
  61869. horizontalOrientation: RIGHT,
  61870. verticalOrientation: BOTTOM
  61871. },
  61872. trianglemarker: {
  61873. offset: 10,
  61874. horizontalOrientation: LEFT,
  61875. verticalOrientation: TOP
  61876. },
  61877. textcloud: {
  61878. offset: -1,
  61879. horizontalOrientation: LEFT,
  61880. verticalOrientation: TOP
  61881. }
  61882. }
  61883. }
  61884. },
  61885. barGauge: {
  61886. backgroundColor: "#e0e0e0",
  61887. relativeInnerRadius: .3,
  61888. barSpacing: 4,
  61889. resolveLabelOverlapping: "hide",
  61890. label: {
  61891. indent: 20,
  61892. connectorWidth: 2,
  61893. font: {
  61894. size: 16
  61895. }
  61896. },
  61897. legend: {
  61898. visible: false
  61899. },
  61900. indicator: {
  61901. hasPositiveMeaning: true,
  61902. layout: {
  61903. horizontalAlignment: CENTER,
  61904. verticalAlignment: BOTTOM
  61905. },
  61906. text: {
  61907. font: {
  61908. size: 18
  61909. }
  61910. }
  61911. }
  61912. },
  61913. rangeSelector: {
  61914. scale: {
  61915. valueMarginsEnabled: true,
  61916. width: 1,
  61917. color: BLACK,
  61918. opacity: .1,
  61919. showCustomBoundaryTicks: true,
  61920. label: {
  61921. overlappingBehavior: "hide",
  61922. alignment: CENTER,
  61923. visible: true,
  61924. topIndent: 7,
  61925. font: {
  61926. size: 11
  61927. }
  61928. },
  61929. tick: {
  61930. width: 1,
  61931. color: BLACK,
  61932. opacity: .17,
  61933. visible: true,
  61934. length: 12
  61935. },
  61936. minorTick: {
  61937. width: 1,
  61938. color: BLACK,
  61939. opacity: .05,
  61940. visible: true,
  61941. length: 12
  61942. },
  61943. marker: {
  61944. width: 1,
  61945. color: "#000000",
  61946. opacity: .1,
  61947. visible: true,
  61948. separatorHeight: 33,
  61949. topIndent: 10,
  61950. textLeftIndent: 7,
  61951. textTopIndent: 11,
  61952. label: {}
  61953. },
  61954. logarithmBase: 10,
  61955. workWeek: [1, 2, 3, 4, 5],
  61956. breakStyle: {
  61957. width: 5,
  61958. color: "#ababab",
  61959. line: "waved"
  61960. },
  61961. endOnTick: false
  61962. },
  61963. selectedRangeColor: "#606060",
  61964. sliderMarker: {
  61965. visible: true,
  61966. paddingTopBottom: 2,
  61967. paddingLeftRight: 4,
  61968. color: "#606060",
  61969. invalidRangeColor: RED,
  61970. font: {
  61971. color: WHITE,
  61972. size: 11
  61973. }
  61974. },
  61975. sliderHandle: {
  61976. width: 1,
  61977. color: BLACK,
  61978. opacity: .2
  61979. },
  61980. shutter: {
  61981. opacity: .75
  61982. },
  61983. background: {
  61984. color: "#c0bae1",
  61985. visible: true,
  61986. image: {
  61987. location: "full"
  61988. }
  61989. },
  61990. behavior: {
  61991. snapToTicks: true,
  61992. animationEnabled: true,
  61993. moveSelectedRangeByClick: true,
  61994. manualRangeSelectionEnabled: true,
  61995. allowSlidersSwap: true,
  61996. callValueChanged: "onMovingComplete"
  61997. },
  61998. redrawOnResize: true,
  61999. chart: {
  62000. equalBarWidth: true,
  62001. barGroupPadding: .3,
  62002. minBubbleSize: 12,
  62003. maxBubbleSize: .2,
  62004. topIndent: .1,
  62005. bottomIndent: 0,
  62006. valueAxis: {
  62007. inverted: false,
  62008. logarithmBase: 10
  62009. },
  62010. commonSeriesSettings: {
  62011. type: "area",
  62012. aggregation: {
  62013. enabled: void 0
  62014. },
  62015. point: {
  62016. visible: false
  62017. },
  62018. scatter: {
  62019. point: {
  62020. visible: true
  62021. }
  62022. }
  62023. }
  62024. }
  62025. },
  62026. map: {
  62027. title: {
  62028. margin: 10
  62029. },
  62030. background: {
  62031. borderWidth: 1,
  62032. borderColor: "#cacaca"
  62033. },
  62034. layer: {
  62035. label: {
  62036. enabled: false,
  62037. stroke: WHITE,
  62038. "stroke-width": 1,
  62039. "stroke-opacity": .7,
  62040. font: {
  62041. color: SOME_GREY,
  62042. size: 12
  62043. }
  62044. }
  62045. },
  62046. "layer:area": {
  62047. borderWidth: 1,
  62048. borderColor: WHITE,
  62049. color: "#d2d2d2",
  62050. hoveredBorderColor: GREY_GREEN,
  62051. selectedBorderWidth: 2,
  62052. selectedBorderColor: GREY_GREEN,
  62053. label: {
  62054. "stroke-width": 2,
  62055. font: {
  62056. size: 16
  62057. }
  62058. }
  62059. },
  62060. "layer:line": {
  62061. borderWidth: 2,
  62062. color: "#ba8365",
  62063. hoveredColor: "#a94813",
  62064. selectedBorderWidth: 3,
  62065. selectedColor: "#e55100",
  62066. label: {
  62067. "stroke-width": 2,
  62068. font: {
  62069. size: 16
  62070. }
  62071. }
  62072. },
  62073. "layer:marker": {
  62074. label: {
  62075. enabled: true,
  62076. "stroke-width": 1,
  62077. font: {
  62078. size: 12
  62079. }
  62080. }
  62081. },
  62082. "layer:marker:dot": {
  62083. borderWidth: 2,
  62084. borderColor: WHITE,
  62085. size: 8,
  62086. selectedStep: 2,
  62087. backStep: 18,
  62088. backColor: WHITE,
  62089. backOpacity: .32,
  62090. shadow: true
  62091. },
  62092. "layer:marker:bubble": {
  62093. minSize: 20,
  62094. maxSize: 50,
  62095. hoveredBorderWidth: 1,
  62096. hoveredBorderColor: GREY_GREEN,
  62097. selectedBorderWidth: 2,
  62098. selectedBorderColor: GREY_GREEN
  62099. },
  62100. "layer:marker:pie": {
  62101. size: 50,
  62102. hoveredBorderWidth: 1,
  62103. hoveredBorderColor: GREY_GREEN,
  62104. selectedBorderWidth: 2,
  62105. selectedBorderColor: GREY_GREEN
  62106. },
  62107. "layer:marker:image": {
  62108. size: 20
  62109. },
  62110. legend: {
  62111. verticalAlignment: BOTTOM,
  62112. horizontalAlignment: RIGHT,
  62113. position: INSIDE,
  62114. backgroundOpacity: .65,
  62115. border: {
  62116. visible: true
  62117. },
  62118. paddingLeftRight: 16,
  62119. paddingTopBottom: 12
  62120. },
  62121. controlBar: {
  62122. borderColor: "#5d5d5d",
  62123. borderWidth: 3,
  62124. color: WHITE,
  62125. margin: 20,
  62126. opacity: .3
  62127. },
  62128. _rtl: {
  62129. legend: {
  62130. itemTextPosition: LEFT
  62131. }
  62132. }
  62133. },
  62134. treeMap: {
  62135. tile: {
  62136. border: {
  62137. width: 1,
  62138. opacity: .2,
  62139. color: "#000000"
  62140. },
  62141. color: "#5f8b95",
  62142. hoverStyle: {
  62143. hatching: {
  62144. opacity: .75,
  62145. step: 6,
  62146. width: 2,
  62147. direction: "right"
  62148. },
  62149. border: {}
  62150. },
  62151. selectionStyle: {
  62152. hatching: {
  62153. opacity: .5,
  62154. step: 6,
  62155. width: 2,
  62156. direction: "right"
  62157. },
  62158. border: {
  62159. opacity: 1
  62160. }
  62161. },
  62162. label: {
  62163. visible: true,
  62164. paddingLeftRight: 5,
  62165. paddingTopBottom: 4,
  62166. stroke: "#000000",
  62167. "stroke-width": 1,
  62168. "stroke-opacity": .3,
  62169. font: {
  62170. color: "#ffffff",
  62171. weight: 300
  62172. },
  62173. shadow: {
  62174. opacity: .8,
  62175. offsetX: 0,
  62176. offsetY: 1,
  62177. blur: 1,
  62178. color: "#000000"
  62179. },
  62180. wordWrap: "normal",
  62181. textOverflow: "ellipsis"
  62182. }
  62183. },
  62184. group: {
  62185. padding: 4,
  62186. border: {
  62187. width: 1
  62188. },
  62189. color: "#eeeeee",
  62190. hoverStyle: {
  62191. hatching: {
  62192. opacity: 0,
  62193. step: 6,
  62194. width: 2,
  62195. direction: "right"
  62196. },
  62197. border: {}
  62198. },
  62199. selectionStyle: {
  62200. hatching: {
  62201. opacity: 0,
  62202. step: 6,
  62203. width: 2,
  62204. direction: "right"
  62205. },
  62206. border: {}
  62207. },
  62208. label: {
  62209. visible: true,
  62210. paddingLeftRight: 5,
  62211. paddingTopBottom: 4,
  62212. font: {
  62213. color: SECONDARY_TITLE_COLOR,
  62214. weight: 600
  62215. },
  62216. textOverflow: "ellipsis"
  62217. }
  62218. },
  62219. title: {
  62220. subtitle: {}
  62221. },
  62222. tooltip: {},
  62223. loadingIndicator: {}
  62224. },
  62225. sparkline: {
  62226. lineColor: "#666666",
  62227. lineWidth: 2,
  62228. areaOpacity: .2,
  62229. minColor: "#e8c267",
  62230. maxColor: "#e55253",
  62231. barPositiveColor: "#a9a9a9",
  62232. barNegativeColor: "#d7d7d7",
  62233. winColor: "#a9a9a9",
  62234. lossColor: "#d7d7d7",
  62235. firstLastColor: "#666666",
  62236. pointSymbol: "circle",
  62237. pointColor: WHITE,
  62238. pointSize: 4,
  62239. type: "line",
  62240. argumentField: "arg",
  62241. valueField: "val",
  62242. winlossThreshold: 0,
  62243. showFirstLast: true,
  62244. showMinMax: false,
  62245. tooltip: {
  62246. enabled: true
  62247. }
  62248. },
  62249. bullet: {
  62250. color: "#e8c267",
  62251. targetColor: "#666666",
  62252. targetWidth: 4,
  62253. showTarget: true,
  62254. showZeroLevel: true,
  62255. tooltip: {
  62256. enabled: true
  62257. }
  62258. },
  62259. polar: {
  62260. commonSeriesSettings: {
  62261. type: "scatter",
  62262. closed: true,
  62263. point: {
  62264. visible: true,
  62265. symbol: "circle",
  62266. size: 12,
  62267. border: {
  62268. visible: false,
  62269. width: 1
  62270. },
  62271. hoverMode: "onlyPoint",
  62272. selectionMode: "onlyPoint",
  62273. hoverStyle: {
  62274. border: {
  62275. visible: true,
  62276. width: 4
  62277. },
  62278. size: 12
  62279. },
  62280. selectionStyle: {
  62281. border: {
  62282. visible: true,
  62283. width: 4
  62284. },
  62285. size: 12
  62286. }
  62287. },
  62288. scatter: {},
  62289. line: {
  62290. width: 2,
  62291. dashStyle: SOLID,
  62292. hoverStyle: {
  62293. width: 3,
  62294. hatching: {
  62295. direction: NONE
  62296. }
  62297. },
  62298. selectionStyle: {
  62299. width: 3
  62300. }
  62301. },
  62302. area: {
  62303. point: {
  62304. visible: false
  62305. },
  62306. opacity: .5
  62307. },
  62308. stackedline: {
  62309. width: 2
  62310. },
  62311. bar: {
  62312. opacity: .8
  62313. },
  62314. stackedbar: {
  62315. opacity: .8
  62316. }
  62317. },
  62318. adaptiveLayout: {
  62319. width: 80,
  62320. height: 80,
  62321. keepLabels: true
  62322. },
  62323. equalBarWidth: true,
  62324. barGroupPadding: .3,
  62325. commonAxisSettings: {
  62326. visible: true,
  62327. forceUserTickInterval: false,
  62328. label: {
  62329. overlappingBehavior: "hide",
  62330. indentFromAxis: 5
  62331. },
  62332. grid: {
  62333. visible: true
  62334. },
  62335. minorGrid: {
  62336. visible: true
  62337. },
  62338. tick: {
  62339. visible: true
  62340. },
  62341. title: {
  62342. font: {
  62343. size: 16
  62344. },
  62345. margin: 10
  62346. }
  62347. },
  62348. argumentAxis: {
  62349. startAngle: 0,
  62350. firstPointOnStartAngle: false,
  62351. period: void 0
  62352. },
  62353. valueAxis: {
  62354. endOnTick: false,
  62355. tick: {
  62356. visible: false
  62357. }
  62358. },
  62359. horizontalAxis: {
  62360. position: TOP,
  62361. axisDivisionFactor: 50,
  62362. label: {
  62363. alignment: CENTER
  62364. }
  62365. },
  62366. verticalAxis: {
  62367. position: TOP,
  62368. axisDivisionFactor: 30,
  62369. label: {
  62370. alignment: RIGHT
  62371. }
  62372. }
  62373. },
  62374. funnel: {
  62375. sortData: true,
  62376. valueField: "val",
  62377. colorField: "color",
  62378. argumentField: "arg",
  62379. hoverEnabled: true,
  62380. selectionMode: "single",
  62381. item: {
  62382. border: {
  62383. visible: false,
  62384. width: 2,
  62385. color: WHITE
  62386. },
  62387. hoverStyle: {
  62388. hatching: {
  62389. opacity: .75,
  62390. step: 6,
  62391. width: 2,
  62392. direction: RIGHT
  62393. },
  62394. border: {}
  62395. },
  62396. selectionStyle: {
  62397. hatching: {
  62398. opacity: .5,
  62399. step: 6,
  62400. width: 2,
  62401. direction: RIGHT
  62402. },
  62403. border: {}
  62404. }
  62405. },
  62406. title: {
  62407. margin: 10
  62408. },
  62409. adaptiveLayout: {
  62410. width: 80,
  62411. height: 80,
  62412. keepLabels: true
  62413. },
  62414. legend: {
  62415. visible: false
  62416. },
  62417. _rtl: {
  62418. legend: {
  62419. itemTextPosition: LEFT
  62420. }
  62421. },
  62422. tooltip: {
  62423. customizeTooltip: function(info) {
  62424. return {
  62425. text: info.item.argument + " " + info.valueText
  62426. }
  62427. }
  62428. },
  62429. inverted: false,
  62430. algorithm: "dynamicSlope",
  62431. neckWidth: 0,
  62432. neckHeight: 0,
  62433. resolveLabelOverlapping: "shift",
  62434. label: {
  62435. textOverflow: "ellipsis",
  62436. wordWrap: "normal",
  62437. visible: true,
  62438. horizontalAlignment: RIGHT,
  62439. horizontalOffset: 0,
  62440. verticalOffset: 0,
  62441. showForZeroValues: false,
  62442. customizeText: function(info) {
  62443. return info.item.argument + " " + info.valueText
  62444. },
  62445. position: "columns",
  62446. font: {
  62447. color: WHITE
  62448. },
  62449. border: {
  62450. visible: false,
  62451. width: 1,
  62452. color: LIGHT_GREY,
  62453. dashStyle: SOLID
  62454. },
  62455. connector: {
  62456. visible: true,
  62457. width: 1,
  62458. opacity: .5
  62459. }
  62460. }
  62461. },
  62462. sankey: {
  62463. sourceField: "source",
  62464. targetField: "target",
  62465. weightField: "weight",
  62466. hoverEnabled: true,
  62467. alignment: CENTER,
  62468. adaptiveLayout: {
  62469. width: 80,
  62470. height: 80,
  62471. keepLabels: true
  62472. },
  62473. label: {
  62474. visible: true,
  62475. horizontalOffset: 8,
  62476. verticalOffset: 0,
  62477. overlappingBehavior: "ellipsis",
  62478. useNodeColors: false,
  62479. font: {
  62480. color: BLACK,
  62481. weight: 500
  62482. },
  62483. border: {
  62484. visible: false,
  62485. width: 2,
  62486. color: WHITE
  62487. },
  62488. customizeText: function(info) {
  62489. return info.title
  62490. },
  62491. shadow: {
  62492. opacity: .2,
  62493. offsetX: 0,
  62494. offsetY: 1,
  62495. blur: 1,
  62496. color: WHITE
  62497. }
  62498. },
  62499. title: {
  62500. margin: 10,
  62501. font: {
  62502. size: 28,
  62503. weight: 200
  62504. },
  62505. subtitle: {
  62506. font: {
  62507. size: 16
  62508. }
  62509. }
  62510. },
  62511. tooltip: {
  62512. enabled: true
  62513. },
  62514. node: {
  62515. padding: 30,
  62516. width: 8,
  62517. opacity: 1,
  62518. border: {
  62519. color: WHITE,
  62520. width: 1,
  62521. visible: false
  62522. },
  62523. hoverStyle: {
  62524. hatching: {
  62525. opacity: .75,
  62526. step: 6,
  62527. width: 2,
  62528. direction: RIGHT
  62529. },
  62530. border: {}
  62531. }
  62532. },
  62533. link: {
  62534. color: "#888888",
  62535. colorMode: "none",
  62536. opacity: .3,
  62537. border: {
  62538. color: WHITE,
  62539. width: 1,
  62540. visible: false
  62541. },
  62542. hoverStyle: {
  62543. opacity: .5,
  62544. hatching: {
  62545. opacity: .75,
  62546. step: 6,
  62547. width: 2,
  62548. direction: RIGHT
  62549. },
  62550. border: {}
  62551. }
  62552. }
  62553. }
  62554. });
  62555. registerThemeAlias("generic.light.compact", "generic.light")
  62556. },
  62557. /*!**************************************************************!*\
  62558. !*** ./artifacts/transpiled/viz/core/themes/generic.dark.js ***!
  62559. \**************************************************************/
  62560. /*! dynamic exports provided */
  62561. /*! all exports used */
  62562. function(module, exports, __webpack_require__) {
  62563. var themeModule = __webpack_require__( /*! ../../themes */ 50);
  62564. var registerTheme = themeModule.registerTheme;
  62565. var registerThemeAlias = themeModule.registerThemeAlias;
  62566. var WHITE = "#ffffff";
  62567. var BLACK = "#000000";
  62568. var SOME_GREY = "#2b2b2b";
  62569. var RANGE_COLOR = "#b5b5b5";
  62570. var GREY_GREEN = "#303030";
  62571. var AREA_LAYER_COLOR = "#686868";
  62572. var LINE_COLOR = "#c7c7c7";
  62573. var TARGET_COLOR = "#8e8e8e";
  62574. var POSITIVE_COLOR = "#b8b8b8";
  62575. var BORDER_COLOR = "#494949";
  62576. registerTheme({
  62577. name: "generic.dark",
  62578. font: {
  62579. color: "#808080"
  62580. },
  62581. backgroundColor: "#2a2a2a",
  62582. primaryTitleColor: "#dedede",
  62583. secondaryTitleColor: "#a3a3a3",
  62584. gridColor: "#555555",
  62585. axisColor: "#a3a3a3",
  62586. "export": {
  62587. backgroundColor: "#2a2a2a",
  62588. font: {
  62589. color: "#dbdbdb"
  62590. },
  62591. button: {
  62592. "default": {
  62593. color: "#dedede",
  62594. borderColor: "#4d4d4d",
  62595. backgroundColor: "#2e2e2e"
  62596. },
  62597. hover: {
  62598. color: "#dedede",
  62599. borderColor: "#6c6c6c",
  62600. backgroundColor: "#444"
  62601. },
  62602. focus: {
  62603. color: "#dedede",
  62604. borderColor: "#8d8d8d",
  62605. backgroundColor: "#444444"
  62606. },
  62607. active: {
  62608. color: "#dedede",
  62609. borderColor: "#8d8d8d",
  62610. backgroundColor: "#555555"
  62611. }
  62612. },
  62613. shadowColor: "#292929"
  62614. },
  62615. tooltip: {
  62616. color: SOME_GREY,
  62617. border: {
  62618. color: BORDER_COLOR
  62619. },
  62620. font: {
  62621. color: "#929292"
  62622. }
  62623. },
  62624. "chart:common": {
  62625. commonSeriesSettings: {
  62626. label: {
  62627. border: {
  62628. color: BORDER_COLOR
  62629. }
  62630. },
  62631. valueErrorBar: {
  62632. color: WHITE
  62633. }
  62634. }
  62635. },
  62636. "chart:common:axis": {
  62637. constantLineStyle: {
  62638. color: WHITE
  62639. }
  62640. },
  62641. chart: {
  62642. commonPaneSettings: {
  62643. border: {
  62644. color: BORDER_COLOR
  62645. }
  62646. },
  62647. commonAxisSettings: {
  62648. breakStyle: {
  62649. color: "#818181"
  62650. }
  62651. },
  62652. zoomAndPan: {
  62653. dragBoxStyle: {
  62654. color: WHITE
  62655. }
  62656. },
  62657. commonAnnotationSettings: {
  62658. font: {
  62659. color: "#929292"
  62660. },
  62661. border: {
  62662. color: BORDER_COLOR
  62663. },
  62664. color: SOME_GREY,
  62665. shadow: {
  62666. opacity: .008,
  62667. offsetY: 4,
  62668. blur: 8
  62669. }
  62670. }
  62671. },
  62672. gauge: {
  62673. rangeContainer: {
  62674. backgroundColor: RANGE_COLOR
  62675. },
  62676. valueIndicators: {
  62677. _default: {
  62678. color: RANGE_COLOR
  62679. },
  62680. rangebar: {
  62681. color: "#84788b"
  62682. },
  62683. twocolorneedle: {
  62684. secondColor: "#ba544d"
  62685. },
  62686. trianglemarker: {
  62687. color: "#b7918f"
  62688. },
  62689. textcloud: {
  62690. color: "#ba544d"
  62691. }
  62692. }
  62693. },
  62694. barGauge: {
  62695. backgroundColor: "#3c3c3c"
  62696. },
  62697. rangeSelector: {
  62698. scale: {
  62699. tick: {
  62700. color: WHITE,
  62701. opacity: .32
  62702. },
  62703. minorTick: {
  62704. color: WHITE,
  62705. opacity: .1
  62706. },
  62707. breakStyle: {
  62708. color: "#818181"
  62709. }
  62710. },
  62711. selectedRangeColor: RANGE_COLOR,
  62712. sliderMarker: {
  62713. color: RANGE_COLOR,
  62714. font: {
  62715. color: GREY_GREEN
  62716. }
  62717. },
  62718. sliderHandle: {
  62719. color: WHITE,
  62720. opacity: .2
  62721. },
  62722. shutter: {
  62723. color: SOME_GREY,
  62724. opacity: .9
  62725. }
  62726. },
  62727. map: {
  62728. background: {
  62729. borderColor: "#3f3f3f"
  62730. },
  62731. layer: {
  62732. label: {
  62733. stroke: BLACK,
  62734. font: {
  62735. color: WHITE
  62736. }
  62737. }
  62738. },
  62739. "layer:area": {
  62740. borderColor: GREY_GREEN,
  62741. color: AREA_LAYER_COLOR,
  62742. hoveredBorderColor: WHITE,
  62743. selectedBorderColor: WHITE
  62744. },
  62745. "layer:line": {
  62746. color: "#c77244",
  62747. hoveredColor: "#ff5d04",
  62748. selectedColor: "#ff784f"
  62749. },
  62750. "layer:marker:bubble": {
  62751. hoveredBorderColor: WHITE,
  62752. selectedBorderColor: WHITE
  62753. },
  62754. "layer:marker:pie": {
  62755. hoveredBorderColor: WHITE,
  62756. selectedBorderColor: WHITE
  62757. },
  62758. legend: {
  62759. border: {
  62760. color: "#3f3f3f"
  62761. },
  62762. font: {
  62763. color: WHITE
  62764. }
  62765. },
  62766. controlBar: {
  62767. borderColor: LINE_COLOR,
  62768. color: GREY_GREEN
  62769. }
  62770. },
  62771. treeMap: {
  62772. group: {
  62773. color: "#4c4c4c",
  62774. label: {
  62775. font: {
  62776. color: "#a3a3a3"
  62777. }
  62778. }
  62779. }
  62780. },
  62781. sparkline: {
  62782. lineColor: LINE_COLOR,
  62783. firstLastColor: LINE_COLOR,
  62784. barPositiveColor: POSITIVE_COLOR,
  62785. barNegativeColor: TARGET_COLOR,
  62786. winColor: POSITIVE_COLOR,
  62787. lossColor: TARGET_COLOR,
  62788. pointColor: GREY_GREEN
  62789. },
  62790. bullet: {
  62791. targetColor: TARGET_COLOR
  62792. },
  62793. funnel: {
  62794. item: {
  62795. border: {
  62796. color: "#2a2a2a"
  62797. }
  62798. }
  62799. },
  62800. sankey: {
  62801. label: {
  62802. font: {
  62803. color: WHITE
  62804. },
  62805. shadow: {
  62806. opacity: 0
  62807. }
  62808. },
  62809. node: {
  62810. border: {
  62811. color: "#2a2a2a"
  62812. }
  62813. },
  62814. link: {
  62815. color: "#888888",
  62816. border: {
  62817. color: "#2a2a2a"
  62818. },
  62819. hoverStyle: {
  62820. color: "#bbbbbb"
  62821. }
  62822. }
  62823. }
  62824. }, "generic.light");
  62825. registerThemeAlias("generic.dark.compact", "generic.dark")
  62826. },
  62827. /*!******************************************************************!*\
  62828. !*** ./artifacts/transpiled/viz/core/themes/generic.contrast.js ***!
  62829. \******************************************************************/
  62830. /*! dynamic exports provided */
  62831. /*! all exports used */
  62832. function(module, exports, __webpack_require__) {
  62833. var themeModule = __webpack_require__( /*! ../../themes */ 50);
  62834. var registerTheme = themeModule.registerTheme;
  62835. var registerThemeAlias = themeModule.registerThemeAlias;
  62836. var WHITE = "#ffffff";
  62837. var BLACK = "#000000";
  62838. var CONTRAST_ACTIVE = "#cf00da";
  62839. var MARKER_COLOR = "#f8ca00";
  62840. var AREA_LAYER_COLOR = "#686868";
  62841. registerTheme({
  62842. name: "generic.contrast",
  62843. defaultPalette: "Bright",
  62844. font: {
  62845. color: WHITE
  62846. },
  62847. backgroundColor: BLACK,
  62848. primaryTitleColor: WHITE,
  62849. secondaryTitleColor: WHITE,
  62850. gridColor: WHITE,
  62851. axisColor: WHITE,
  62852. "export": {
  62853. backgroundColor: BLACK,
  62854. font: {
  62855. color: WHITE
  62856. },
  62857. button: {
  62858. "default": {
  62859. color: WHITE,
  62860. borderColor: WHITE,
  62861. backgroundColor: BLACK
  62862. },
  62863. hover: {
  62864. color: WHITE,
  62865. borderColor: WHITE,
  62866. backgroundColor: "#cf00d7"
  62867. },
  62868. focus: {
  62869. color: WHITE,
  62870. borderColor: "#cf00d7",
  62871. backgroundColor: BLACK
  62872. },
  62873. active: {
  62874. color: BLACK,
  62875. borderColor: WHITE,
  62876. backgroundColor: WHITE
  62877. }
  62878. },
  62879. borderColor: WHITE,
  62880. menuButtonColor: BLACK,
  62881. activeBackgroundColor: WHITE,
  62882. activeColor: BLACK,
  62883. selectedBorderColor: CONTRAST_ACTIVE,
  62884. selectedColor: CONTRAST_ACTIVE,
  62885. shadowColor: "none"
  62886. },
  62887. tooltip: {
  62888. border: {
  62889. color: WHITE
  62890. },
  62891. font: {
  62892. color: WHITE
  62893. },
  62894. color: BLACK
  62895. },
  62896. "chart:common": {
  62897. commonSeriesSettings: {
  62898. valueErrorBar: {
  62899. color: WHITE
  62900. },
  62901. hoverStyle: {
  62902. hatching: {
  62903. opacity: .5
  62904. }
  62905. },
  62906. selectionStyle: {
  62907. hatching: {
  62908. opacity: .35
  62909. }
  62910. },
  62911. label: {
  62912. font: {
  62913. color: WHITE
  62914. },
  62915. border: {
  62916. color: WHITE
  62917. }
  62918. }
  62919. }
  62920. },
  62921. "chart:common:axis": {
  62922. constantLineStyle: {
  62923. color: WHITE
  62924. }
  62925. },
  62926. chart: {
  62927. commonSeriesSettings: {},
  62928. crosshair: {
  62929. color: "#cf00d7"
  62930. },
  62931. commonPaneSettings: {
  62932. backgroundColor: BLACK,
  62933. border: {
  62934. color: WHITE
  62935. }
  62936. },
  62937. scrollBar: {
  62938. color: WHITE
  62939. },
  62940. commonAxisSettings: {
  62941. breakStyle: {
  62942. color: "#cf00d7"
  62943. }
  62944. },
  62945. zoomAndPan: {
  62946. dragBoxStyle: {
  62947. color: WHITE,
  62948. opacity: .7
  62949. }
  62950. },
  62951. commonAnnotationSettings: {
  62952. font: {
  62953. color: WHITE
  62954. },
  62955. border: {
  62956. color: WHITE
  62957. },
  62958. color: BLACK
  62959. }
  62960. },
  62961. pie: {
  62962. commonSeriesSettings: {
  62963. pie: {
  62964. hoverStyle: {
  62965. hatching: {
  62966. opacity: .5
  62967. }
  62968. },
  62969. selectionStyle: {
  62970. hatching: {
  62971. opacity: .35
  62972. }
  62973. }
  62974. },
  62975. doughnut: {
  62976. hoverStyle: {
  62977. hatching: {
  62978. opacity: .5
  62979. }
  62980. },
  62981. selectionStyle: {
  62982. hatching: {
  62983. opacity: .35
  62984. }
  62985. }
  62986. },
  62987. donut: {
  62988. hoverStyle: {
  62989. hatching: {
  62990. opacity: .5
  62991. }
  62992. },
  62993. selectionStyle: {
  62994. hatching: {
  62995. opacity: .35
  62996. }
  62997. }
  62998. }
  62999. }
  63000. },
  63001. gauge: {
  63002. rangeContainer: {
  63003. backgroundColor: WHITE
  63004. },
  63005. valueIndicators: {
  63006. _default: {
  63007. color: WHITE
  63008. },
  63009. rangebar: {
  63010. color: WHITE,
  63011. backgroundColor: BLACK
  63012. },
  63013. twocolorneedle: {
  63014. secondColor: WHITE
  63015. },
  63016. trianglemarker: {
  63017. color: WHITE
  63018. },
  63019. textcloud: {
  63020. color: WHITE,
  63021. text: {
  63022. font: {
  63023. color: BLACK
  63024. }
  63025. }
  63026. }
  63027. }
  63028. },
  63029. barGauge: {
  63030. backgroundColor: "#3c3c3c"
  63031. },
  63032. rangeSelector: {
  63033. scale: {
  63034. tick: {
  63035. color: WHITE,
  63036. opacity: .4
  63037. },
  63038. minorTick: {
  63039. color: WHITE,
  63040. opacity: .12
  63041. },
  63042. breakStyle: {
  63043. color: "#cf00d7"
  63044. }
  63045. },
  63046. selectedRangeColor: CONTRAST_ACTIVE,
  63047. sliderMarker: {
  63048. color: CONTRAST_ACTIVE
  63049. },
  63050. sliderHandle: {
  63051. color: CONTRAST_ACTIVE,
  63052. opacity: 1
  63053. },
  63054. shutter: {
  63055. opacity: .75
  63056. },
  63057. background: {
  63058. color: BLACK
  63059. }
  63060. },
  63061. map: {
  63062. background: {
  63063. borderColor: WHITE
  63064. },
  63065. layer: {
  63066. label: {
  63067. stroke: BLACK,
  63068. font: {
  63069. color: WHITE
  63070. }
  63071. }
  63072. },
  63073. "layer:area": {
  63074. borderColor: BLACK,
  63075. color: AREA_LAYER_COLOR,
  63076. hoveredBorderColor: WHITE,
  63077. selectedBorderColor: WHITE,
  63078. label: {
  63079. font: {
  63080. opacity: 1
  63081. }
  63082. }
  63083. },
  63084. "layer:line": {
  63085. color: "#267cff",
  63086. hoveredColor: "#f613ff",
  63087. selectedColor: WHITE
  63088. },
  63089. "layer:marker:dot": {
  63090. borderColor: BLACK,
  63091. color: MARKER_COLOR,
  63092. backColor: BLACK,
  63093. backOpacity: .32
  63094. },
  63095. "layer:marker:bubble": {
  63096. color: MARKER_COLOR,
  63097. hoveredBorderColor: WHITE,
  63098. selectedBorderColor: WHITE
  63099. },
  63100. "layer:marker:pie": {
  63101. hoveredBorderColor: WHITE,
  63102. selectedBorderColor: WHITE
  63103. },
  63104. controlBar: {
  63105. borderColor: WHITE,
  63106. color: BLACK,
  63107. opacity: .3
  63108. }
  63109. },
  63110. treeMap: {
  63111. tile: {
  63112. color: "#70c92f"
  63113. },
  63114. group: {
  63115. color: "#797979",
  63116. label: {
  63117. font: {
  63118. color: WHITE
  63119. }
  63120. }
  63121. }
  63122. },
  63123. sparkline: {
  63124. pointColor: BLACK
  63125. },
  63126. bullet: {},
  63127. polar: {
  63128. commonSeriesSettings: {}
  63129. },
  63130. funnel: {
  63131. label: {
  63132. connector: {
  63133. opacity: 1
  63134. }
  63135. }
  63136. },
  63137. sankey: {
  63138. label: {
  63139. font: {
  63140. color: WHITE
  63141. },
  63142. shadow: {
  63143. opacity: 0
  63144. }
  63145. },
  63146. node: {
  63147. border: {
  63148. visible: true,
  63149. width: 1,
  63150. color: WHITE
  63151. }
  63152. },
  63153. link: {
  63154. opacity: .5,
  63155. border: {
  63156. visible: true,
  63157. width: 1,
  63158. color: WHITE
  63159. },
  63160. hoverStyle: {
  63161. opacity: .9
  63162. }
  63163. }
  63164. }
  63165. }, "generic.light");
  63166. registerThemeAlias("generic.contrast.compact", "generic.contrast")
  63167. },
  63168. /*!*****************************************************************!*\
  63169. !*** ./artifacts/transpiled/viz/core/themes/generic.carmine.js ***!
  63170. \*****************************************************************/
  63171. /*! dynamic exports provided */
  63172. /*! all exports used */
  63173. function(module, exports, __webpack_require__) {
  63174. var themeModule = __webpack_require__( /*! ../../themes */ 50);
  63175. var registerTheme = themeModule.registerTheme;
  63176. var registerThemeAlias = themeModule.registerThemeAlias;
  63177. var ACCENT_COLOR = "#f05b41";
  63178. var BACKGROUND_COLOR = "#fff";
  63179. var TITLE_COLOR = "#333";
  63180. var SUBTITLE_COLOR = "#8899a8";
  63181. var TEXT_COLOR = "#707070";
  63182. var BORDER_COLOR = "#dee1e3";
  63183. registerTheme({
  63184. name: "generic.carmine",
  63185. defaultPalette: "Carmine",
  63186. backgroundColor: BACKGROUND_COLOR,
  63187. primaryTitleColor: TITLE_COLOR,
  63188. secondaryTitleColor: SUBTITLE_COLOR,
  63189. gridColor: BORDER_COLOR,
  63190. axisColor: TEXT_COLOR,
  63191. "export": {
  63192. backgroundColor: BACKGROUND_COLOR,
  63193. font: {
  63194. color: TITLE_COLOR
  63195. },
  63196. button: {
  63197. "default": {
  63198. color: TITLE_COLOR,
  63199. borderColor: "#b1b7bd",
  63200. backgroundColor: BACKGROUND_COLOR
  63201. },
  63202. hover: {
  63203. color: TITLE_COLOR,
  63204. borderColor: "#b1b7bd",
  63205. backgroundColor: "#faf2f0"
  63206. },
  63207. focus: {
  63208. color: TITLE_COLOR,
  63209. borderColor: "#6d7781",
  63210. backgroundColor: "#faf2f0"
  63211. },
  63212. active: {
  63213. color: TITLE_COLOR,
  63214. borderColor: "#6d7781",
  63215. backgroundColor: "#f5e7e4"
  63216. }
  63217. }
  63218. },
  63219. legend: {
  63220. font: {
  63221. color: TEXT_COLOR
  63222. }
  63223. },
  63224. tooltip: {
  63225. color: BACKGROUND_COLOR,
  63226. border: {
  63227. color: BORDER_COLOR
  63228. },
  63229. font: {
  63230. color: TITLE_COLOR
  63231. }
  63232. },
  63233. "chart:common": {
  63234. commonSeriesSettings: {
  63235. label: {
  63236. border: {
  63237. color: BORDER_COLOR
  63238. }
  63239. }
  63240. }
  63241. },
  63242. chart: {
  63243. commonPaneSettings: {
  63244. border: {
  63245. color: BORDER_COLOR
  63246. }
  63247. },
  63248. commonAxisSettings: {
  63249. breakStyle: {
  63250. color: "#c1c5c7"
  63251. }
  63252. },
  63253. commonAnnotationSettings: {
  63254. font: {
  63255. color: TITLE_COLOR
  63256. },
  63257. border: {
  63258. color: BORDER_COLOR
  63259. },
  63260. color: BACKGROUND_COLOR
  63261. }
  63262. },
  63263. rangeSelector: {
  63264. scale: {
  63265. breakStyle: {
  63266. color: "#c1c5c7"
  63267. },
  63268. tick: {
  63269. opacity: .12
  63270. }
  63271. },
  63272. selectedRangeColor: ACCENT_COLOR,
  63273. sliderMarker: {
  63274. color: ACCENT_COLOR
  63275. },
  63276. sliderHandle: {
  63277. color: ACCENT_COLOR,
  63278. opacity: .5
  63279. }
  63280. },
  63281. sparkline: {
  63282. pointColor: BACKGROUND_COLOR,
  63283. minColor: "#f0ad4e",
  63284. maxColor: "#f74d61"
  63285. },
  63286. treeMap: {
  63287. group: {
  63288. color: BORDER_COLOR,
  63289. label: {
  63290. font: {
  63291. color: SUBTITLE_COLOR
  63292. }
  63293. }
  63294. }
  63295. },
  63296. bullet: {
  63297. color: ACCENT_COLOR
  63298. },
  63299. gauge: {
  63300. valueIndicators: {
  63301. rangebar: {
  63302. color: ACCENT_COLOR
  63303. },
  63304. textcloud: {
  63305. color: ACCENT_COLOR
  63306. }
  63307. }
  63308. }
  63309. }, "generic.light");
  63310. registerThemeAlias("generic.carmine.compact", "generic.carmine")
  63311. },
  63312. /*!******************************************************************!*\
  63313. !*** ./artifacts/transpiled/viz/core/themes/generic.darkmoon.js ***!
  63314. \******************************************************************/
  63315. /*! dynamic exports provided */
  63316. /*! all exports used */
  63317. function(module, exports, __webpack_require__) {
  63318. var themeModule = __webpack_require__( /*! ../../themes */ 50);
  63319. var registerTheme = themeModule.registerTheme;
  63320. var registerThemeAlias = themeModule.registerThemeAlias;
  63321. var ACCENT_COLOR = "#3debd3";
  63322. var BACKGROUND_COLOR = "#465672";
  63323. var TITLE_COLOR = "#fff";
  63324. var SUBTITLE_COLOR = "#919bac";
  63325. var TEXT_COLOR = "#c7ccd4";
  63326. var BORDER_COLOR = "#596980";
  63327. registerTheme({
  63328. name: "generic.darkmoon",
  63329. defaultPalette: "Dark Moon",
  63330. backgroundColor: BACKGROUND_COLOR,
  63331. primaryTitleColor: TITLE_COLOR,
  63332. secondaryTitleColor: SUBTITLE_COLOR,
  63333. gridColor: BORDER_COLOR,
  63334. axisColor: TEXT_COLOR,
  63335. "export": {
  63336. backgroundColor: BACKGROUND_COLOR,
  63337. font: {
  63338. color: TITLE_COLOR
  63339. },
  63340. button: {
  63341. "default": {
  63342. color: TITLE_COLOR,
  63343. borderColor: "#7a889e",
  63344. backgroundColor: BACKGROUND_COLOR
  63345. },
  63346. hover: {
  63347. color: TITLE_COLOR,
  63348. borderColor: "#9da8b8",
  63349. backgroundColor: "#596e92"
  63350. },
  63351. focus: {
  63352. color: TITLE_COLOR,
  63353. borderColor: "#c4cad4",
  63354. backgroundColor: "#596e92"
  63355. },
  63356. active: {
  63357. color: TITLE_COLOR,
  63358. borderColor: "#c4cad4",
  63359. backgroundColor: "#6b80a4"
  63360. }
  63361. }
  63362. },
  63363. legend: {
  63364. font: {
  63365. color: TEXT_COLOR
  63366. }
  63367. },
  63368. tooltip: {
  63369. color: "#62789e",
  63370. border: {
  63371. color: BORDER_COLOR
  63372. },
  63373. font: {
  63374. color: TITLE_COLOR
  63375. }
  63376. },
  63377. "chart:common": {
  63378. commonSeriesSettings: {
  63379. label: {
  63380. border: {
  63381. color: BORDER_COLOR
  63382. }
  63383. }
  63384. }
  63385. },
  63386. chart: {
  63387. commonPaneSettings: {
  63388. border: {
  63389. color: BORDER_COLOR
  63390. }
  63391. },
  63392. commonAxisSettings: {
  63393. breakStyle: {
  63394. color: "#73869e"
  63395. }
  63396. },
  63397. commonAnnotationSettings: {
  63398. font: {
  63399. color: TITLE_COLOR
  63400. },
  63401. border: {
  63402. color: BORDER_COLOR
  63403. },
  63404. color: "#62789e"
  63405. }
  63406. },
  63407. gauge: {
  63408. valueIndicators: {
  63409. rangebar: {
  63410. color: ACCENT_COLOR
  63411. },
  63412. textcloud: {
  63413. color: ACCENT_COLOR,
  63414. text: {
  63415. font: {
  63416. color: BACKGROUND_COLOR
  63417. }
  63418. }
  63419. }
  63420. }
  63421. },
  63422. barGauge: {
  63423. backgroundColor: "#526280"
  63424. },
  63425. funnel: {
  63426. item: {
  63427. border: {
  63428. color: BACKGROUND_COLOR
  63429. }
  63430. }
  63431. },
  63432. sparkline: {
  63433. pointColor: BACKGROUND_COLOR,
  63434. minColor: "#f0ad4e",
  63435. maxColor: "#f9517e"
  63436. },
  63437. treeMap: {
  63438. group: {
  63439. color: BORDER_COLOR,
  63440. label: {
  63441. font: {
  63442. color: TITLE_COLOR
  63443. }
  63444. }
  63445. }
  63446. },
  63447. map: {
  63448. background: {
  63449. borderColor: BORDER_COLOR
  63450. },
  63451. "layer:area": {
  63452. color: "#97a3b6",
  63453. borderColor: BACKGROUND_COLOR
  63454. }
  63455. },
  63456. rangeSelector: {
  63457. shutter: {
  63458. color: BACKGROUND_COLOR
  63459. },
  63460. scale: {
  63461. breakStyle: {
  63462. color: "#73869e"
  63463. },
  63464. tick: {
  63465. opacity: .2
  63466. }
  63467. },
  63468. selectedRangeColor: ACCENT_COLOR,
  63469. sliderMarker: {
  63470. color: ACCENT_COLOR,
  63471. font: {
  63472. color: "#000"
  63473. }
  63474. },
  63475. sliderHandle: {
  63476. color: ACCENT_COLOR,
  63477. opacity: .5
  63478. }
  63479. },
  63480. bullet: {
  63481. color: ACCENT_COLOR
  63482. },
  63483. sankey: {
  63484. link: {
  63485. border: {
  63486. color: BACKGROUND_COLOR
  63487. }
  63488. },
  63489. node: {
  63490. border: {
  63491. color: BACKGROUND_COLOR
  63492. }
  63493. }
  63494. }
  63495. }, "generic.dark");
  63496. registerThemeAlias("generic.darkmoon.compact", "generic.darkmoon")
  63497. },
  63498. /*!******************************************************************!*\
  63499. !*** ./artifacts/transpiled/viz/core/themes/generic.softblue.js ***!
  63500. \******************************************************************/
  63501. /*! dynamic exports provided */
  63502. /*! all exports used */
  63503. function(module, exports, __webpack_require__) {
  63504. var themeModule = __webpack_require__( /*! ../../themes */ 50);
  63505. var registerTheme = themeModule.registerTheme;
  63506. var registerThemeAlias = themeModule.registerThemeAlias;
  63507. var ACCENT_COLOR = "#7ab8eb";
  63508. var BACKGROUND_COLOR = "#fff";
  63509. var TITLE_COLOR = "#333";
  63510. var SUBTITLE_COLOR = "#99a1a8";
  63511. var TEXT_COLOR = "#707070";
  63512. var BORDER_COLOR = "#e8eaeb";
  63513. registerTheme({
  63514. name: "generic.softblue",
  63515. defaultPalette: "Soft Blue",
  63516. backgroundColor: BACKGROUND_COLOR,
  63517. primaryTitleColor: TITLE_COLOR,
  63518. secondaryTitleColor: SUBTITLE_COLOR,
  63519. gridColor: BORDER_COLOR,
  63520. axisColor: TEXT_COLOR,
  63521. "export": {
  63522. backgroundColor: BACKGROUND_COLOR,
  63523. font: {
  63524. color: TITLE_COLOR
  63525. },
  63526. button: {
  63527. "default": {
  63528. color: TITLE_COLOR,
  63529. borderColor: "#c9d0d4",
  63530. backgroundColor: BACKGROUND_COLOR
  63531. },
  63532. hover: {
  63533. color: TITLE_COLOR,
  63534. borderColor: "#a7b2b9",
  63535. backgroundColor: "#e6e6e6"
  63536. },
  63537. focus: {
  63538. color: TITLE_COLOR,
  63539. borderColor: "#82929b",
  63540. backgroundColor: "#e6e6e6"
  63541. },
  63542. active: {
  63543. color: TITLE_COLOR,
  63544. borderColor: "#82929b",
  63545. backgroundColor: "#d4d4d4"
  63546. }
  63547. }
  63548. },
  63549. legend: {
  63550. font: {
  63551. color: TEXT_COLOR
  63552. }
  63553. },
  63554. tooltip: {
  63555. color: BACKGROUND_COLOR,
  63556. border: {
  63557. color: BORDER_COLOR
  63558. },
  63559. font: {
  63560. color: TITLE_COLOR
  63561. }
  63562. },
  63563. "chart:common": {
  63564. commonSeriesSettings: {
  63565. label: {
  63566. border: {
  63567. color: BORDER_COLOR
  63568. }
  63569. }
  63570. }
  63571. },
  63572. chart: {
  63573. commonPaneSettings: {
  63574. border: {
  63575. color: BORDER_COLOR
  63576. }
  63577. },
  63578. commonAxisSettings: {
  63579. breakStyle: {
  63580. color: "#cfd2d3"
  63581. }
  63582. },
  63583. commonAnnotationSettings: {
  63584. color: BACKGROUND_COLOR,
  63585. border: {
  63586. color: BORDER_COLOR
  63587. },
  63588. font: {
  63589. color: TITLE_COLOR
  63590. }
  63591. }
  63592. },
  63593. rangeSelector: {
  63594. scale: {
  63595. breakStyle: {
  63596. color: "#cfd2d3"
  63597. },
  63598. tick: {
  63599. opacity: .12
  63600. }
  63601. },
  63602. selectedRangeColor: ACCENT_COLOR,
  63603. sliderMarker: {
  63604. color: ACCENT_COLOR
  63605. },
  63606. sliderHandle: {
  63607. color: ACCENT_COLOR,
  63608. opacity: .5
  63609. }
  63610. },
  63611. sparkline: {
  63612. pointColor: BACKGROUND_COLOR,
  63613. minColor: "#f0ad4e",
  63614. maxColor: "#d9534f"
  63615. },
  63616. treeMap: {
  63617. group: {
  63618. color: BORDER_COLOR,
  63619. label: {
  63620. font: {
  63621. color: SUBTITLE_COLOR
  63622. }
  63623. }
  63624. }
  63625. },
  63626. bullet: {
  63627. color: ACCENT_COLOR
  63628. },
  63629. gauge: {
  63630. valueIndicators: {
  63631. rangebar: {
  63632. color: ACCENT_COLOR
  63633. },
  63634. textcloud: {
  63635. color: ACCENT_COLOR
  63636. }
  63637. }
  63638. }
  63639. }, "generic.light");
  63640. registerThemeAlias("generic.softblue.compact", "generic.softblue")
  63641. },
  63642. /*!********************************************************************!*\
  63643. !*** ./artifacts/transpiled/viz/core/themes/generic.darkviolet.js ***!
  63644. \********************************************************************/
  63645. /*! dynamic exports provided */
  63646. /*! all exports used */
  63647. function(module, exports, __webpack_require__) {
  63648. var themeModule = __webpack_require__( /*! ../../themes */ 50);
  63649. var registerTheme = themeModule.registerTheme;
  63650. var registerThemeAlias = themeModule.registerThemeAlias;
  63651. var ACCENT_COLOR = "#9c63ff";
  63652. var BACKGROUND_COLOR = "#17171f";
  63653. var TITLE_COLOR = "#f5f6f7";
  63654. var SUBTITLE_COLOR = "#fff";
  63655. var TEXT_COLOR = "#b2b2b6";
  63656. var BORDER_COLOR = "#343840";
  63657. registerTheme({
  63658. name: "generic.darkviolet",
  63659. defaultPalette: "Dark Violet",
  63660. backgroundColor: BACKGROUND_COLOR,
  63661. primaryTitleColor: TITLE_COLOR,
  63662. secondaryTitleColor: SUBTITLE_COLOR,
  63663. gridColor: BORDER_COLOR,
  63664. axisColor: TEXT_COLOR,
  63665. "export": {
  63666. backgroundColor: BACKGROUND_COLOR,
  63667. font: {
  63668. color: TITLE_COLOR
  63669. },
  63670. button: {
  63671. "default": {
  63672. color: TITLE_COLOR,
  63673. borderColor: "#414152",
  63674. backgroundColor: BACKGROUND_COLOR
  63675. },
  63676. hover: {
  63677. color: TITLE_COLOR,
  63678. borderColor: "#5c5c74",
  63679. backgroundColor: "#2d2d3c"
  63680. },
  63681. focus: {
  63682. color: TITLE_COLOR,
  63683. borderColor: "#7c7c97",
  63684. backgroundColor: "#2d2d3c"
  63685. },
  63686. active: {
  63687. color: TITLE_COLOR,
  63688. borderColor: "#7c7c97",
  63689. backgroundColor: "#3c3c51"
  63690. }
  63691. }
  63692. },
  63693. legend: {
  63694. font: {
  63695. color: TEXT_COLOR
  63696. }
  63697. },
  63698. tooltip: {
  63699. color: BACKGROUND_COLOR,
  63700. border: {
  63701. color: "#414152"
  63702. },
  63703. font: {
  63704. color: TITLE_COLOR
  63705. }
  63706. },
  63707. "chart:common": {
  63708. commonSeriesSettings: {
  63709. label: {
  63710. border: {
  63711. color: BORDER_COLOR
  63712. }
  63713. }
  63714. }
  63715. },
  63716. chart: {
  63717. commonPaneSettings: {
  63718. border: {
  63719. color: BORDER_COLOR
  63720. }
  63721. },
  63722. commonAxisSettings: {
  63723. breakStyle: {
  63724. color: "#575e6b"
  63725. }
  63726. },
  63727. commonAnnotationSettings: {
  63728. font: {
  63729. color: TITLE_COLOR
  63730. },
  63731. border: {
  63732. color: "#414152"
  63733. },
  63734. color: BACKGROUND_COLOR
  63735. }
  63736. },
  63737. funnel: {
  63738. item: {
  63739. border: {
  63740. color: BACKGROUND_COLOR
  63741. }
  63742. }
  63743. },
  63744. sparkline: {
  63745. pointColor: BACKGROUND_COLOR,
  63746. minColor: "#f0ad4e",
  63747. maxColor: "#d9534f"
  63748. },
  63749. treeMap: {
  63750. group: {
  63751. color: BORDER_COLOR,
  63752. label: {
  63753. font: {
  63754. color: SUBTITLE_COLOR
  63755. }
  63756. }
  63757. }
  63758. },
  63759. rangeSelector: {
  63760. shutter: {
  63761. color: BACKGROUND_COLOR
  63762. },
  63763. scale: {
  63764. breakStyle: {
  63765. color: "#575e6b"
  63766. },
  63767. tick: {
  63768. opacity: .2
  63769. }
  63770. },
  63771. selectedRangeColor: ACCENT_COLOR,
  63772. sliderMarker: {
  63773. color: ACCENT_COLOR,
  63774. font: {
  63775. color: "#fff"
  63776. }
  63777. },
  63778. sliderHandle: {
  63779. color: ACCENT_COLOR,
  63780. opacity: .5
  63781. }
  63782. },
  63783. bullet: {
  63784. color: ACCENT_COLOR
  63785. },
  63786. gauge: {
  63787. valueIndicators: {
  63788. rangebar: {
  63789. color: ACCENT_COLOR
  63790. },
  63791. textcloud: {
  63792. color: ACCENT_COLOR
  63793. }
  63794. }
  63795. },
  63796. sankey: {
  63797. link: {
  63798. border: {
  63799. color: BACKGROUND_COLOR
  63800. }
  63801. },
  63802. node: {
  63803. border: {
  63804. color: BACKGROUND_COLOR
  63805. }
  63806. }
  63807. }
  63808. }, "generic.dark");
  63809. registerThemeAlias("generic.darkviolet.compact", "generic.darkviolet")
  63810. },
  63811. /*!*******************************************************************!*\
  63812. !*** ./artifacts/transpiled/viz/core/themes/generic.greenmist.js ***!
  63813. \*******************************************************************/
  63814. /*! dynamic exports provided */
  63815. /*! all exports used */
  63816. function(module, exports, __webpack_require__) {
  63817. var themeModule = __webpack_require__( /*! ../../themes */ 50);
  63818. var registerTheme = themeModule.registerTheme;
  63819. var registerThemeAlias = themeModule.registerThemeAlias;
  63820. var ACCENT_COLOR = "#3cbab2";
  63821. var BACKGROUND_COLOR = "#f5f5f5";
  63822. var TITLE_COLOR = "#28484f";
  63823. var SUBTITLE_COLOR = "#7eb2be";
  63824. var TEXT_COLOR = "#657c80";
  63825. var BORDER_COLOR = "#dedede";
  63826. registerTheme({
  63827. name: "generic.greenmist",
  63828. defaultPalette: "Green Mist",
  63829. backgroundColor: BACKGROUND_COLOR,
  63830. primaryTitleColor: TITLE_COLOR,
  63831. secondaryTitleColor: SUBTITLE_COLOR,
  63832. gridColor: BORDER_COLOR,
  63833. axisColor: TEXT_COLOR,
  63834. "export": {
  63835. backgroundColor: BACKGROUND_COLOR,
  63836. font: {
  63837. color: TITLE_COLOR
  63838. },
  63839. button: {
  63840. "default": {
  63841. color: TITLE_COLOR,
  63842. borderColor: "#a2b4b8",
  63843. backgroundColor: BACKGROUND_COLOR
  63844. },
  63845. hover: {
  63846. color: TITLE_COLOR,
  63847. borderColor: "#7f989e",
  63848. backgroundColor: "rgba(222, 222, 222, 0.4)"
  63849. },
  63850. focus: {
  63851. color: TITLE_COLOR,
  63852. borderColor: "#5f777c",
  63853. backgroundColor: "rgba(222, 222, 222, 0.4)"
  63854. },
  63855. active: {
  63856. color: TITLE_COLOR,
  63857. borderColor: "#5f777c",
  63858. backgroundColor: "rgba(222, 222, 222, 0.8)"
  63859. }
  63860. }
  63861. },
  63862. legend: {
  63863. font: {
  63864. color: TEXT_COLOR
  63865. }
  63866. },
  63867. tooltip: {
  63868. color: "#fff",
  63869. border: {
  63870. color: BORDER_COLOR
  63871. },
  63872. font: {
  63873. color: TITLE_COLOR
  63874. }
  63875. },
  63876. "chart:common": {
  63877. commonSeriesSettings: {
  63878. label: {
  63879. border: {
  63880. color: BORDER_COLOR
  63881. }
  63882. }
  63883. }
  63884. },
  63885. chart: {
  63886. commonPaneSettings: {
  63887. border: {
  63888. color: BORDER_COLOR
  63889. }
  63890. },
  63891. commonAxisSettings: {
  63892. breakStyle: {
  63893. color: "#c1c1c1"
  63894. }
  63895. },
  63896. commonAnnotationSettings: {
  63897. color: "#fff",
  63898. border: {
  63899. color: BORDER_COLOR
  63900. },
  63901. font: {
  63902. color: TITLE_COLOR
  63903. }
  63904. }
  63905. },
  63906. funnel: {
  63907. item: {
  63908. border: {
  63909. color: BACKGROUND_COLOR
  63910. }
  63911. }
  63912. },
  63913. sparkline: {
  63914. pointColor: BACKGROUND_COLOR,
  63915. minColor: "#ffc852",
  63916. maxColor: "#f74a5e"
  63917. },
  63918. treeMap: {
  63919. group: {
  63920. color: BORDER_COLOR,
  63921. label: {
  63922. font: {
  63923. color: SUBTITLE_COLOR
  63924. }
  63925. }
  63926. }
  63927. },
  63928. rangeSelector: {
  63929. shutter: {
  63930. color: BACKGROUND_COLOR
  63931. },
  63932. scale: {
  63933. breakStyle: {
  63934. color: "#c1c1c1"
  63935. },
  63936. tick: {
  63937. opacity: .12
  63938. }
  63939. },
  63940. selectedRangeColor: ACCENT_COLOR,
  63941. sliderMarker: {
  63942. color: ACCENT_COLOR
  63943. },
  63944. sliderHandle: {
  63945. color: ACCENT_COLOR,
  63946. opacity: .5
  63947. }
  63948. },
  63949. bullet: {
  63950. color: ACCENT_COLOR
  63951. },
  63952. gauge: {
  63953. valueIndicators: {
  63954. rangebar: {
  63955. color: ACCENT_COLOR
  63956. },
  63957. textcloud: {
  63958. color: ACCENT_COLOR
  63959. }
  63960. }
  63961. }
  63962. }, "generic.light");
  63963. registerThemeAlias("generic.greenmist.compact", "generic.greenmist")
  63964. },
  63965. /*!**********************************************************!*\
  63966. !*** ./artifacts/transpiled/viz/core/themes/material.js ***!
  63967. \**********************************************************/
  63968. /*! dynamic exports provided */
  63969. /*! all exports used */
  63970. function(module, exports, __webpack_require__) {
  63971. var themeModule = __webpack_require__( /*! ../../themes */ 50);
  63972. var registerTheme = themeModule.registerTheme;
  63973. var registerThemeAlias = themeModule.registerThemeAlias;
  63974. var FONT_FAMILY = "'Roboto', 'RobotoFallback', 'Helvetica', 'Arial', sans-serif";
  63975. var LIGHT_TITLE_COLOR = "rgba(0,0,0,0.87)";
  63976. var LIGHT_LABEL_COLOR = "rgba(0,0,0,0.54)";
  63977. var DARK_TITLE_COLOR = "rgba(255,255,255,0.87)";
  63978. var DARK_LABEL_COLOR = "rgba(255,255,255,0.54)";
  63979. var DARK_BACKGROUND_COLOR = "#363640";
  63980. var WHITE = "#ffffff";
  63981. var BLACK = "#000000";
  63982. var RANGE_COLOR = "#b5b5b5";
  63983. var AREA_LAYER_COLOR = "#686868";
  63984. var LINE_COLOR = "#c7c7c7";
  63985. var TARGET_COLOR = "#8e8e8e";
  63986. var POSITIVE_COLOR = "#b8b8b8";
  63987. var LABEL_BORDER_COLOR = "#494949";
  63988. var BREAK_STYLE_COLOR = "#818181";
  63989. registerTheme({
  63990. name: "material",
  63991. defaultPalette: "Material",
  63992. font: {
  63993. family: FONT_FAMILY
  63994. },
  63995. title: {
  63996. margin: {
  63997. top: 20,
  63998. bottom: 20,
  63999. left: 0,
  64000. right: 0
  64001. },
  64002. font: {
  64003. size: 20,
  64004. family: FONT_FAMILY,
  64005. weight: 500
  64006. },
  64007. horizontalAlignment: "left",
  64008. subtitle: {
  64009. font: {
  64010. size: 14
  64011. },
  64012. horizontalAlignment: "left"
  64013. }
  64014. },
  64015. tooltip: {
  64016. shadow: {
  64017. opacity: 0
  64018. },
  64019. border: {
  64020. visible: false
  64021. },
  64022. paddingLeftRight: 8,
  64023. paddingTopBottom: 6,
  64024. arrowLength: 0,
  64025. location: "edge",
  64026. color: "#616161",
  64027. font: {
  64028. color: WHITE
  64029. },
  64030. cornerRadius: 4
  64031. },
  64032. chart: {
  64033. commonAxisSettings: {
  64034. minorTick: {
  64035. opacity: .5
  64036. },
  64037. label: {
  64038. font: {
  64039. size: 11
  64040. }
  64041. }
  64042. },
  64043. commonAnnotationSettings: {
  64044. font: {
  64045. color: WHITE
  64046. },
  64047. border: {
  64048. color: "#616161"
  64049. },
  64050. color: "#616161",
  64051. arrowLength: 14,
  64052. arrowWidth: 0,
  64053. shadow: {
  64054. opacity: .08,
  64055. offsetY: 4,
  64056. blur: 8
  64057. },
  64058. cornerRadius: 4
  64059. }
  64060. },
  64061. pie: {
  64062. title: {
  64063. horizontalAlignment: "center",
  64064. subtitle: {
  64065. horizontalAlignment: "center"
  64066. }
  64067. }
  64068. },
  64069. polar: {
  64070. commonAxisSettings: {
  64071. minorTick: {
  64072. opacity: .5
  64073. }
  64074. },
  64075. title: {
  64076. horizontalAlignment: "center",
  64077. subtitle: {
  64078. horizontalAlignment: "center"
  64079. }
  64080. }
  64081. },
  64082. funnel: {
  64083. title: {
  64084. horizontalAlignment: "center",
  64085. subtitle: {
  64086. horizontalAlignment: "center"
  64087. }
  64088. }
  64089. },
  64090. gauge: {
  64091. title: {
  64092. horizontalAlignment: "center",
  64093. subtitle: {
  64094. horizontalAlignment: "center"
  64095. }
  64096. }
  64097. },
  64098. barGauge: {
  64099. title: {
  64100. horizontalAlignment: "center",
  64101. subtitle: {
  64102. horizontalAlignment: "center"
  64103. }
  64104. }
  64105. },
  64106. rangeSelector: {
  64107. sliderHandle: {
  64108. opacity: .5
  64109. }
  64110. },
  64111. treeMap: {
  64112. group: {
  64113. label: {
  64114. font: {
  64115. weight: 500
  64116. }
  64117. }
  64118. }
  64119. }
  64120. }, "generic.light");
  64121. registerTheme({
  64122. name: "material.light",
  64123. gridColor: "#e0e0e0",
  64124. axisColor: LIGHT_LABEL_COLOR,
  64125. primaryTitleColor: LIGHT_TITLE_COLOR,
  64126. legend: {
  64127. font: {
  64128. color: LIGHT_LABEL_COLOR
  64129. }
  64130. },
  64131. chart: {
  64132. scrollBar: {
  64133. color: "#bfbfbf",
  64134. opacity: .7
  64135. }
  64136. },
  64137. gauge: {
  64138. rangeContainer: {
  64139. backgroundColor: "rgba(0,0,0,0.2)"
  64140. }
  64141. },
  64142. barGauge: {
  64143. backgroundColor: "#efefef"
  64144. }
  64145. }, "material");
  64146. registerTheme({
  64147. name: "material.dark",
  64148. gridColor: "#515159",
  64149. backgroundColor: DARK_BACKGROUND_COLOR,
  64150. axisColor: DARK_LABEL_COLOR,
  64151. font: {
  64152. color: DARK_LABEL_COLOR
  64153. },
  64154. primaryTitleColor: DARK_TITLE_COLOR,
  64155. secondaryTitleColor: DARK_TITLE_COLOR,
  64156. tooltip: {
  64157. color: "#000"
  64158. },
  64159. "export": {
  64160. backgroundColor: DARK_BACKGROUND_COLOR,
  64161. font: {
  64162. color: "#dbdbdb"
  64163. },
  64164. button: {
  64165. "default": {
  64166. color: "#dedede",
  64167. borderColor: "#4d4d4d",
  64168. backgroundColor: DARK_BACKGROUND_COLOR
  64169. },
  64170. hover: {
  64171. color: "#dedede",
  64172. borderColor: "#6c6c6c",
  64173. backgroundColor: "#3f3f4b"
  64174. },
  64175. focus: {
  64176. color: "#dedede",
  64177. borderColor: "#8d8d8d",
  64178. backgroundColor: "#494956"
  64179. },
  64180. active: {
  64181. color: "#dedede",
  64182. borderColor: "#8d8d8d",
  64183. backgroundColor: "#494956"
  64184. }
  64185. },
  64186. shadowColor: "#292929"
  64187. },
  64188. "chart:common": {
  64189. commonSeriesSettings: {
  64190. label: {
  64191. border: {
  64192. color: LABEL_BORDER_COLOR
  64193. }
  64194. },
  64195. valueErrorBar: {
  64196. color: WHITE
  64197. }
  64198. }
  64199. },
  64200. "chart:common:axis": {
  64201. constantLineStyle: {
  64202. color: WHITE
  64203. }
  64204. },
  64205. chart: {
  64206. commonPaneSettings: {
  64207. border: {
  64208. color: LABEL_BORDER_COLOR
  64209. }
  64210. },
  64211. commonAxisSettings: {
  64212. breakStyle: {
  64213. color: BREAK_STYLE_COLOR
  64214. }
  64215. },
  64216. zoomAndPan: {
  64217. dragBoxStyle: {
  64218. color: WHITE
  64219. }
  64220. },
  64221. commonAnnotationSettings: {
  64222. border: {
  64223. color: "#000"
  64224. },
  64225. color: "#000"
  64226. }
  64227. },
  64228. gauge: {
  64229. rangeContainer: {
  64230. backgroundColor: RANGE_COLOR
  64231. },
  64232. valueIndicators: {
  64233. _default: {
  64234. color: RANGE_COLOR
  64235. },
  64236. rangebar: {
  64237. color: "#84788b"
  64238. },
  64239. twocolorneedle: {
  64240. secondColor: "#ba544d"
  64241. },
  64242. trianglemarker: {
  64243. color: "#b7918f"
  64244. },
  64245. textcloud: {
  64246. color: "#ba544d"
  64247. }
  64248. }
  64249. },
  64250. barGauge: {
  64251. backgroundColor: "#3c3c3c"
  64252. },
  64253. rangeSelector: {
  64254. scale: {
  64255. tick: {
  64256. color: WHITE,
  64257. opacity: .32
  64258. },
  64259. minorTick: {
  64260. color: WHITE,
  64261. opacity: .1
  64262. },
  64263. breakStyle: {
  64264. color: BREAK_STYLE_COLOR
  64265. }
  64266. },
  64267. selectedRangeColor: RANGE_COLOR,
  64268. sliderMarker: {
  64269. color: RANGE_COLOR,
  64270. font: {
  64271. color: DARK_BACKGROUND_COLOR
  64272. }
  64273. },
  64274. sliderHandle: {
  64275. color: WHITE,
  64276. opacity: .2
  64277. },
  64278. shutter: {
  64279. color: WHITE,
  64280. opacity: .1
  64281. }
  64282. },
  64283. map: {
  64284. background: {
  64285. borderColor: "#3f3f3f"
  64286. },
  64287. layer: {
  64288. label: {
  64289. stroke: BLACK,
  64290. font: {
  64291. color: WHITE
  64292. }
  64293. }
  64294. },
  64295. "layer:area": {
  64296. borderColor: DARK_BACKGROUND_COLOR,
  64297. color: AREA_LAYER_COLOR,
  64298. hoveredBorderColor: WHITE,
  64299. selectedBorderColor: WHITE
  64300. },
  64301. "layer:line": {
  64302. color: "#c77244",
  64303. hoveredColor: "#ff5d04",
  64304. selectedColor: "#ff784f"
  64305. },
  64306. "layer:marker:bubble": {
  64307. hoveredBorderColor: WHITE,
  64308. selectedBorderColor: WHITE
  64309. },
  64310. "layer:marker:pie": {
  64311. hoveredBorderColor: WHITE,
  64312. selectedBorderColor: WHITE
  64313. },
  64314. legend: {
  64315. border: {
  64316. color: "#3f3f3f"
  64317. },
  64318. font: {
  64319. color: WHITE
  64320. }
  64321. },
  64322. controlBar: {
  64323. borderColor: LINE_COLOR,
  64324. color: DARK_BACKGROUND_COLOR
  64325. }
  64326. },
  64327. treeMap: {
  64328. group: {
  64329. color: "#4c4c4c",
  64330. label: {
  64331. font: {
  64332. color: "#a3a3a3"
  64333. }
  64334. }
  64335. }
  64336. },
  64337. sparkline: {
  64338. lineColor: LINE_COLOR,
  64339. firstLastColor: LINE_COLOR,
  64340. barPositiveColor: POSITIVE_COLOR,
  64341. barNegativeColor: TARGET_COLOR,
  64342. winColor: POSITIVE_COLOR,
  64343. lossColor: TARGET_COLOR,
  64344. pointColor: DARK_BACKGROUND_COLOR
  64345. },
  64346. bullet: {
  64347. targetColor: TARGET_COLOR
  64348. },
  64349. funnel: {
  64350. item: {
  64351. border: {
  64352. color: DARK_BACKGROUND_COLOR
  64353. }
  64354. }
  64355. },
  64356. sankey: {
  64357. label: {
  64358. font: {
  64359. color: WHITE
  64360. }
  64361. }
  64362. }
  64363. }, "material");
  64364. function registerMaterialColorScheme(accentName, themeName, accentColor) {
  64365. registerTheme({
  64366. name: "material." + accentName + "." + themeName,
  64367. rangeSelector: {
  64368. selectedRangeColor: accentColor,
  64369. sliderMarker: {
  64370. color: accentColor
  64371. },
  64372. sliderHandle: {
  64373. color: accentColor
  64374. }
  64375. },
  64376. map: {
  64377. "layer:marker:dot": {
  64378. color: accentColor
  64379. },
  64380. "layer:marker:bubble": {
  64381. color: accentColor
  64382. },
  64383. legend: {
  64384. markerColor: accentColor
  64385. }
  64386. },
  64387. bullet: {
  64388. color: accentColor
  64389. },
  64390. gauge: {
  64391. valueIndicators: {
  64392. rangebar: {
  64393. color: accentColor
  64394. },
  64395. textcloud: {
  64396. color: accentColor
  64397. }
  64398. }
  64399. }
  64400. }, "material." + themeName)
  64401. }
  64402. var materialAccents = {
  64403. blue: "#03a9f4",
  64404. lime: "#cddc39",
  64405. orange: "#ff5722",
  64406. purple: "#9c27b0",
  64407. teal: "#009688"
  64408. };
  64409. for (var accent in materialAccents) {
  64410. if (Object.prototype.hasOwnProperty.call(materialAccents, accent)) {
  64411. var color = materialAccents[accent];
  64412. registerMaterialColorScheme(accent, "light", color);
  64413. registerMaterialColorScheme(accent, "dark", color);
  64414. registerThemeAlias("material.".concat(accent, ".light.compact"), "material.".concat(accent, ".light"));
  64415. registerThemeAlias("material.".concat(accent, ".dark.compact"), "material.".concat(accent, ".dark"))
  64416. }
  64417. }
  64418. },
  64419. /*!*****************************************************!*\
  64420. !*** ./artifacts/transpiled/viz/core/themes/ios.js ***!
  64421. \*****************************************************/
  64422. /*! dynamic exports provided */
  64423. /*! all exports used */
  64424. function(module, exports, __webpack_require__) {
  64425. var themeModule = __webpack_require__( /*! ../../themes */ 50);
  64426. var IOS7_DEFAULT = "ios7.default";
  64427. var SECONDARY_TEXT_COLOR = "#767676";
  64428. var BORDER_COLOR = "#d3d3d3";
  64429. var BLACK = "#000000";
  64430. themeModule.registerTheme({
  64431. name: IOS7_DEFAULT,
  64432. backgroundColor: "#ffffff",
  64433. primaryTitleColor: BLACK,
  64434. secondaryTitleColor: SECONDARY_TEXT_COLOR,
  64435. gridColor: "#ececec",
  64436. axisColor: SECONDARY_TEXT_COLOR,
  64437. legend: {
  64438. font: {
  64439. color: BLACK
  64440. }
  64441. },
  64442. tooltip: {
  64443. font: {
  64444. color: SECONDARY_TEXT_COLOR
  64445. }
  64446. },
  64447. "chart:common": {
  64448. commonSeriesSettings: {
  64449. label: {
  64450. border: {
  64451. color: BORDER_COLOR
  64452. }
  64453. }
  64454. }
  64455. },
  64456. chart: {
  64457. commonPaneSettings: {
  64458. border: {
  64459. color: BORDER_COLOR
  64460. }
  64461. }
  64462. },
  64463. rangeSelector: {
  64464. scale: {
  64465. tick: {
  64466. color: BLACK,
  64467. opacity: .1
  64468. },
  64469. minorTick: {
  64470. color: BLACK,
  64471. opacity: .03
  64472. }
  64473. }
  64474. },
  64475. treeMap: {
  64476. group: {
  64477. label: {
  64478. font: {
  64479. color: SECONDARY_TEXT_COLOR
  64480. }
  64481. }
  64482. }
  64483. }
  64484. }, "generic.light")
  64485. },
  64486. /*!**********************************************************!*\
  64487. !*** ./artifacts/transpiled/viz/core/errors_warnings.js ***!
  64488. \**********************************************************/
  64489. /*! dynamic exports provided */
  64490. /*! all exports used */
  64491. function(module, exports, __webpack_require__) {
  64492. var errorUtils = __webpack_require__( /*! ../../core/utils/error */ 129);
  64493. var errors = __webpack_require__( /*! ../../core/errors */ 21);
  64494. module.exports = errorUtils(errors.ERROR_MESSAGES, {
  64495. E2001: "Invalid data source",
  64496. E2002: "Axis type and data type are incompatible",
  64497. E2003: 'The "{0}" data source field contains data of unsupported type',
  64498. E2004: 'The "{0}" data source field is inconsistent',
  64499. E2005: 'The value field "{0}" is absent in the data source or all its values are negative',
  64500. E2006: "A cycle is detected in provided data",
  64501. E2007: 'The value field "{0}" is absent in the data source',
  64502. E2008: 'The value field "{0}" must be a string',
  64503. E2009: 'The value field "{0}" must be a positive numeric value',
  64504. E2101: "Unknown series type: {0}",
  64505. E2102: "Ambiguity occurred between two value axes with the same name",
  64506. E2103: 'The "{0}" option is given an invalid value. Assign a function instead',
  64507. E2104: "Invalid logarithm base",
  64508. E2105: 'Invalid value of a "{0}"',
  64509. E2106: "Invalid visible range",
  64510. E2202: "Invalid {0} scale value",
  64511. E2203: "The range you are trying to set is invalid",
  64512. W2002: "The {0} series cannot be drawn because the {1} data field is missing",
  64513. W2003: "Tick interval is too small",
  64514. W2101: 'The "{0}" pane does not exist; the last pane is used by default',
  64515. W2102: 'A value axis with the "{0}" name was created automatically',
  64516. W2103: "The chart title was hidden due to the container size",
  64517. W2104: "The legend was hidden due to the container size",
  64518. W2105: 'The title of the "{0}" axis was hidden due to the container size',
  64519. W2106: 'The labels of the "{0}" axis were hidden due to the container size',
  64520. W2107: "The export menu was hidden due to the container size",
  64521. W2108: "The browser does not support exporting images to {0} format.",
  64522. W2301: "Invalid value range"
  64523. })
  64524. },
  64525. /*!**************************************************************!*\
  64526. !*** ./artifacts/transpiled/viz/core/renderers/animation.js ***!
  64527. \**************************************************************/
  64528. /*! dynamic exports provided */
  64529. /*! all exports used */
  64530. function(module, exports, __webpack_require__) {
  64531. var animationFrame = __webpack_require__( /*! ../../../animation/frame */ 112);
  64532. var noop = function() {};
  64533. var easingFunctions = {
  64534. easeOutCubic: function(pos, start, end) {
  64535. return 1 === pos ? end : (1 - Math.pow(1 - pos, 3)) * (end - start) + +start
  64536. },
  64537. linear: function(pos, start, end) {
  64538. return 1 === pos ? end : pos * (end - start) + +start
  64539. }
  64540. };
  64541. exports.easingFunctions = easingFunctions;
  64542. var animationSvgStep = {
  64543. segments: function segments(elem, params, progress, easing, currentParams) {
  64544. var from = params.from;
  64545. var to = params.to;
  64546. var curSeg;
  64547. var seg;
  64548. var i;
  64549. var j;
  64550. var segments = [];
  64551. for (i = 0; i < from.length; i++) {
  64552. curSeg = from[i];
  64553. seg = [curSeg[0]];
  64554. if (curSeg.length > 1) {
  64555. for (j = 1; j < curSeg.length; j++) {
  64556. seg.push(easing(progress, curSeg[j], to[i][j]))
  64557. }
  64558. }
  64559. segments.push(seg)
  64560. }
  64561. currentParams.segments = params.end && 1 === progress ? params.end : segments;
  64562. elem.attr({
  64563. segments: segments
  64564. })
  64565. },
  64566. arc: function(elem, params, progress, easing) {
  64567. var from = params.from;
  64568. var to = params.to;
  64569. var current = {};
  64570. for (var i in from) {
  64571. current[i] = easing(progress, from[i], to[i])
  64572. }
  64573. elem.attr(current)
  64574. },
  64575. transform: function(elem, params, progress, easing, currentParams) {
  64576. var from = params.from;
  64577. var to = params.to;
  64578. var current = {};
  64579. for (var i in from) {
  64580. current[i] = currentParams[i] = easing(progress, from[i], to[i])
  64581. }
  64582. elem.attr(current)
  64583. },
  64584. base: function(elem, params, progress, easing, currentParams, attributeName) {
  64585. var obj = {};
  64586. obj[attributeName] = currentParams[attributeName] = easing(progress, params.from, params.to);
  64587. elem.attr(obj)
  64588. },
  64589. _: noop,
  64590. complete: function(element, currentSettings) {
  64591. element.attr(currentSettings)
  64592. }
  64593. };
  64594. function step(now) {
  64595. var that = this;
  64596. var animateStep = that._animateStep;
  64597. var attrName;
  64598. that._progress = that._calcProgress(now);
  64599. for (attrName in that.params) {
  64600. var anim = animateStep[attrName] || animateStep.base;
  64601. anim(that.element, that.params[attrName], that._progress, that._easing, that._currentParams, attrName)
  64602. }
  64603. that.options.step && that.options.step(that._easing(that._progress, 0, 1), that._progress);
  64604. if (1 === that._progress) {
  64605. return that.stop()
  64606. }
  64607. return true
  64608. }
  64609. function delayTick(now) {
  64610. if (now - this._startTime >= this.delay) {
  64611. this.tick = step
  64612. }
  64613. return true
  64614. }
  64615. function start(now) {
  64616. this._startTime = now;
  64617. this.tick = this.delay ? delayTick : step;
  64618. return true
  64619. }
  64620. function Animation(element, params, options) {
  64621. var that = this;
  64622. that._progress = 0;
  64623. that.element = element;
  64624. that.params = params;
  64625. that.options = options;
  64626. that.duration = options.partitionDuration ? options.duration * options.partitionDuration : options.duration;
  64627. that.delay = options.delay && options.duration * options.delay || 0;
  64628. that._animateStep = options.animateStep || animationSvgStep;
  64629. that._easing = easingFunctions[options.easing] || easingFunctions.easeOutCubic;
  64630. that._currentParams = {};
  64631. that.tick = start
  64632. }
  64633. Animation.prototype = {
  64634. _calcProgress: function(now) {
  64635. return Math.min(1, (now - this.delay - this._startTime) / this.duration)
  64636. },
  64637. stop: function(disableComplete) {
  64638. var that = this;
  64639. var options = that.options;
  64640. var animateStep = that._animateStep;
  64641. that.stop = that.tick = noop;
  64642. animateStep.complete && animateStep.complete(that.element, that._currentParams);
  64643. options.complete && !disableComplete && options.complete()
  64644. }
  64645. };
  64646. function AnimationController(element) {
  64647. var that = this;
  64648. that._animationCount = 0;
  64649. that._timerId = null;
  64650. that._animations = {};
  64651. that.element = element
  64652. }
  64653. exports.AnimationController = AnimationController;
  64654. AnimationController.prototype = {
  64655. _loop: function() {
  64656. var that = this;
  64657. var animations = that._animations;
  64658. var activeAnimation = 0;
  64659. var now = (new Date).getTime();
  64660. var an;
  64661. var endAnimation = that._endAnimation;
  64662. for (an in animations) {
  64663. if (!animations[an].tick(now)) {
  64664. delete animations[an]
  64665. }
  64666. activeAnimation++
  64667. }
  64668. if (0 === activeAnimation) {
  64669. that.stop();
  64670. that._endAnimationTimer = endAnimation && setTimeout(function() {
  64671. if (0 === that._animationCount) {
  64672. endAnimation();
  64673. that._endAnimation = null
  64674. }
  64675. });
  64676. return
  64677. }
  64678. that._timerId = animationFrame.requestAnimationFrame.call(null, function() {
  64679. that._loop()
  64680. }, that.element)
  64681. },
  64682. addAnimation: function(animation) {
  64683. var that = this;
  64684. that._animations[that._animationCount++] = animation;
  64685. clearTimeout(that._endAnimationTimer);
  64686. if (!that._timerId) {
  64687. clearTimeout(that._startDelay);
  64688. that._startDelay = setTimeout(function() {
  64689. that._timerId = 1;
  64690. that._loop()
  64691. }, 0)
  64692. }
  64693. },
  64694. animateElement: function(elem, params, options) {
  64695. if (elem && params && options) {
  64696. elem.animation && elem.animation.stop();
  64697. this.addAnimation(elem.animation = new Animation(elem, params, options))
  64698. }
  64699. },
  64700. onEndAnimation: function(endAnimation) {
  64701. this._animationCount ? this._endAnimation = endAnimation : endAnimation()
  64702. },
  64703. dispose: function() {
  64704. this.stop();
  64705. this.element = null
  64706. },
  64707. stop: function() {
  64708. var that = this;
  64709. that._animations = {};
  64710. that._animationCount = 0;
  64711. animationFrame.cancelAnimationFrame(that._timerId);
  64712. clearTimeout(that._startDelay);
  64713. clearTimeout(that._endAnimationTimer);
  64714. that._timerId = null
  64715. },
  64716. lock: function() {
  64717. var an;
  64718. var animations = this._animations;
  64719. var unstoppable;
  64720. var hasUnstoppableInAnimations;
  64721. for (an in animations) {
  64722. unstoppable = animations[an].options.unstoppable;
  64723. hasUnstoppableInAnimations = hasUnstoppableInAnimations || unstoppable;
  64724. if (!unstoppable) {
  64725. animations[an].stop(true);
  64726. delete animations[an]
  64727. }
  64728. }!hasUnstoppableInAnimations && this.stop()
  64729. }
  64730. };
  64731. exports.animationSvgStep = animationSvgStep;
  64732. exports.Animation = Animation;
  64733. exports.noop = noop
  64734. },
  64735. /*!*************************************************!*\
  64736. !*** ./artifacts/transpiled/viz/core/layout.js ***!
  64737. \*************************************************/
  64738. /*! dynamic exports provided */
  64739. /*! all exports used */
  64740. function(module, exports, __webpack_require__) {
  64741. var _normalizeEnum = __webpack_require__( /*! ./utils */ 10).normalizeEnum;
  64742. var _min = Math.min;
  64743. var _max = Math.max;
  64744. var _round = Math.round;
  64745. var ALIGN_START = 0;
  64746. var ALIGN_MIDDLE = 1;
  64747. var ALIGN_END = 2;
  64748. var horizontalAlignmentMap = {
  64749. left: ALIGN_START,
  64750. center: ALIGN_MIDDLE,
  64751. right: ALIGN_END
  64752. };
  64753. var verticalAlignmentMap = {
  64754. top: ALIGN_START,
  64755. center: ALIGN_MIDDLE,
  64756. bottom: ALIGN_END
  64757. };
  64758. var sideMap = {
  64759. horizontal: 0,
  64760. vertical: 1
  64761. };
  64762. var slicersMap = {};
  64763. var BBOX_CEIL_CORRECTION = 2;
  64764. slicersMap[ALIGN_START] = function(a, b, size) {
  64765. return [a, _min(b, a + size)]
  64766. };
  64767. slicersMap[ALIGN_MIDDLE] = function(a, b, size) {
  64768. return [_max(a, (a + b - size) / 2), _min(b, (a + b + size) / 2)]
  64769. };
  64770. slicersMap[ALIGN_END] = function(a, b, size) {
  64771. return [_max(a, b - size), b]
  64772. };
  64773. function pickValue(value, map, defaultValue) {
  64774. var val = _normalizeEnum(value);
  64775. return val in map ? map[val] : defaultValue
  64776. }
  64777. function normalizeLayoutOptions(options) {
  64778. var side = pickValue(options.side, sideMap, 1);
  64779. var alignment = [pickValue(options.horizontalAlignment, horizontalAlignmentMap, ALIGN_MIDDLE), pickValue(options.verticalAlignment, verticalAlignmentMap, ALIGN_START)];
  64780. return {
  64781. side: side,
  64782. primary: bringToEdge(alignment[side]),
  64783. secondary: alignment[1 - side],
  64784. weak: options.weak,
  64785. priority: options.priority || 0,
  64786. header: options.header,
  64787. position: options.position
  64788. }
  64789. }
  64790. function bringToEdge(primary) {
  64791. return primary < 2 ? 0 : 2
  64792. }
  64793. function getConjugateSide(side) {
  64794. return 1 - side
  64795. }
  64796. function getSlice(alignment, a, b, size) {
  64797. return slicersMap[alignment](a, b, size)
  64798. }
  64799. function getShrink(alignment, size) {
  64800. return (alignment > 0 ? -1 : 1) * size
  64801. }
  64802. function processForward(item, rect, minSize) {
  64803. var side = item.side;
  64804. var size = item.element.measure([rect[2] - rect[0], rect[3] - rect[1]]);
  64805. var minSide = "indside" === item.position ? 0 : minSize[side];
  64806. var isValid = size[side] < rect[2 + side] - rect[side] - minSide;
  64807. if (isValid) {
  64808. if ("inside" !== item.position) {
  64809. rect[item.primary + side] += getShrink(item.primary, size[side])
  64810. }
  64811. item.size = size
  64812. }
  64813. return isValid
  64814. }
  64815. function processRectBackward(item, rect, alignmentRect) {
  64816. var primarySide = item.side;
  64817. var secondarySide = getConjugateSide(primarySide);
  64818. var itemRect = [];
  64819. var secondary = getSlice(item.secondary, alignmentRect[secondarySide], alignmentRect[2 + secondarySide], item.size[secondarySide]);
  64820. itemRect[primarySide] = _round(itemRect[2 + primarySide] = rect[item.primary + primarySide] + ("inside" === item.position ? getShrink(item.primary, item.size[primarySide]) : 0));
  64821. itemRect[item.primary + primarySide] = _round(rect[item.primary + primarySide] - getShrink(item.primary, item.size[primarySide]));
  64822. if ("inside" !== item.position) {
  64823. rect[item.primary + primarySide] = itemRect[item.primary + primarySide]
  64824. }
  64825. itemRect[secondarySide] = _round(secondary[0]);
  64826. itemRect[2 + secondarySide] = _round(secondary[1]);
  64827. return itemRect
  64828. }
  64829. function processBackward(item, rect, alignmentRect, fitRect, size, targetRect) {
  64830. var itemRect = processRectBackward(item, rect, alignmentRect);
  64831. var itemFitRect = processRectBackward(item, fitRect, fitRect);
  64832. if (size[item.side] > 0) {
  64833. size[item.side] -= item.size[item.side];
  64834. targetRect[item.primary + item.side] = itemRect[item.primary + item.side];
  64835. item.element.freeSpace()
  64836. } else {
  64837. item.element.move(itemRect, itemFitRect)
  64838. }
  64839. }
  64840. function Layout() {
  64841. this._targets = []
  64842. }
  64843. Layout.prototype = {
  64844. constructor: Layout,
  64845. dispose: function() {
  64846. this._targets = null
  64847. },
  64848. add: function(target) {
  64849. this._targets.push(target)
  64850. },
  64851. forward: function(targetRect, minSize) {
  64852. var rect = targetRect.slice();
  64853. var targets = createTargets(this._targets);
  64854. var i;
  64855. var ii = targets.length;
  64856. var cache = [];
  64857. for (i = 0; i < ii; ++i) {
  64858. if (processForward(targets[i], rect, minSize)) {
  64859. cache.push(targets[i])
  64860. } else {
  64861. targets[i].element.freeSpace()
  64862. }
  64863. }
  64864. this._cache = cache.reverse();
  64865. return rect
  64866. },
  64867. backward: function(targetRect, alignmentRect) {
  64868. var size = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : [0, 0];
  64869. var backwardRect = targetRect.slice();
  64870. var fitRect = targetRect.slice();
  64871. var targets = this._cache;
  64872. var targetSide = 0;
  64873. var target;
  64874. var i;
  64875. var ii = targets.length;
  64876. for (i = 0; i < ii; ++i) {
  64877. target = targets[i];
  64878. if (target.side !== targetSide) {
  64879. backwardRect = targetRect.slice()
  64880. }
  64881. processBackward(target, backwardRect, alignmentRect, fitRect, size, targetRect);
  64882. targetSide = target.side
  64883. }
  64884. return size
  64885. }
  64886. };
  64887. function createTargets(targets) {
  64888. var i;
  64889. var ii = targets.length;
  64890. var collection = [];
  64891. var layout;
  64892. for (i = 0; i < ii; ++i) {
  64893. layout = targets[i].layoutOptions();
  64894. if (layout) {
  64895. layout = normalizeLayoutOptions(layout);
  64896. layout.element = targets[i];
  64897. collection.push(layout)
  64898. }
  64899. }
  64900. collection.sort(function(a, b) {
  64901. return b.side - a.side || a.priority - b.priority
  64902. });
  64903. collection = processWeakItems(collection);
  64904. return collection
  64905. }
  64906. function processWeakItems(collection) {
  64907. var weakItem = collection.filter(function(item) {
  64908. return true === item.weak
  64909. })[0];
  64910. var headerItem;
  64911. if (weakItem) {
  64912. headerItem = collection.filter(function(item) {
  64913. return weakItem.primary === item.primary && item.side === weakItem.side && item !== weakItem
  64914. })[0]
  64915. }
  64916. if (weakItem && headerItem) {
  64917. return [makeHeader(headerItem, weakItem)].concat(collection.filter(function(item) {
  64918. return !(item === headerItem || item === weakItem)
  64919. }))
  64920. }
  64921. return collection
  64922. }
  64923. function processBackwardHeaderRect(element, rect) {
  64924. var rectCopy = rect.slice();
  64925. var itemRect = processRectBackward(element, rectCopy, rectCopy);
  64926. itemRect[element.side] = rect[element.side];
  64927. itemRect[2 + element.side] = rect[2 + element.side];
  64928. return itemRect
  64929. }
  64930. function makeHeader(header, weakElement) {
  64931. var side = header.side;
  64932. var primary = header.primary;
  64933. var secondary = header.secondary;
  64934. return {
  64935. side: side,
  64936. primary: primary,
  64937. secondary: secondary,
  64938. priority: 0,
  64939. element: {
  64940. measure: function(targetSize) {
  64941. var result = targetSize.slice();
  64942. var weakSize = weakElement.element.measure(targetSize.slice());
  64943. targetSize[primary] -= weakSize[primary];
  64944. var headerSize = header.element.measure(targetSize.slice());
  64945. result[side] = weakSize[side] = headerSize[side] = Math.max(headerSize[side], weakSize[side]);
  64946. weakElement.size = weakSize;
  64947. header.size = headerSize;
  64948. return result
  64949. },
  64950. move: function(rect, fitRect) {
  64951. if (fitRect[2] - fitRect[0] < header.size[0] + weakElement.size[0] - BBOX_CEIL_CORRECTION) {
  64952. this.freeSpace();
  64953. return
  64954. }
  64955. var weakRect = processBackwardHeaderRect(weakElement, fitRect, fitRect);
  64956. fitRect[2 + weakElement.primary] = weakRect[weakElement.primary];
  64957. var headerFitReact = processBackwardHeaderRect(header, fitRect, fitRect);
  64958. if (fitRect[2 + weakElement.primary] < rect[2 + weakElement.primary] && header.size[header.primary] > rect[2 + header.primary] - rect[header.primary]) {
  64959. rect[2 + weakElement.primary] = fitRect[2 + weakElement.primary]
  64960. }
  64961. var headerRect = processBackwardHeaderRect(header, rect, rect);
  64962. if (headerRect[2 + weakElement.primary] > fitRect[2 + weakElement.primary]) {
  64963. rect[2 + weakElement.primary] = fitRect[2 + weakElement.primary];
  64964. headerRect = processBackwardHeaderRect(header, rect, rect)
  64965. }
  64966. weakElement.element.move(weakRect);
  64967. header.element.move(headerRect, headerFitReact)
  64968. },
  64969. freeSpace: function() {
  64970. header.element.freeSpace();
  64971. weakElement.element.freeSpace()
  64972. }
  64973. }
  64974. }
  64975. }
  64976. module.exports = Layout
  64977. },
  64978. /*!**************************************************************!*\
  64979. !*** ./artifacts/transpiled/viz/series/points/base_point.js ***!
  64980. \**************************************************************/
  64981. /*! dynamic exports provided */
  64982. /*! all exports used */
  64983. function(module, exports, __webpack_require__) {
  64984. var mixins = {};
  64985. var statesConsts = __webpack_require__( /*! ../../components/consts */ 117).states;
  64986. var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
  64987. var barPoint = __webpack_require__( /*! ./bar_point */ 202);
  64988. var bubblePoint = __webpack_require__( /*! ./bubble_point */ 768);
  64989. var piePoint = __webpack_require__( /*! ./pie_point */ 398);
  64990. var rangeSymbolPoint = __webpack_require__( /*! ./range_symbol_point */ 399);
  64991. var rangeBarPoint = __webpack_require__( /*! ./range_bar_point */ 769);
  64992. var candlestickPoint = __webpack_require__( /*! ./candlestick_point */ 400);
  64993. var stockPoint = __webpack_require__( /*! ./stock_point */ 770);
  64994. var polarPoints = __webpack_require__( /*! ./polar_point */ 771);
  64995. var _normalizeEnum = __webpack_require__( /*! ../../core/utils */ 10).normalizeEnum;
  64996. var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
  64997. var each = __webpack_require__( /*! ../../../core/utils/iterator */ 3).each;
  64998. var _each = each;
  64999. var _extend = extend;
  65000. var _isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
  65001. var _noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop;
  65002. var SYMBOL_POINT = "symbolPoint";
  65003. var POLAR_SYMBOL_POINT = "polarSymbolPoint";
  65004. var BAR_POINT = "barPoint";
  65005. var POLAR_BAR_POINT = "polarBarPoint";
  65006. var PIE_POINT = "piePoint";
  65007. var SELECTED_STATE = statesConsts.selectedMark;
  65008. var HOVER_STATE = statesConsts.hoverMark;
  65009. var NORMAL_STATE = statesConsts.normalMark;
  65010. var HOVER = statesConsts.hover;
  65011. var NORMAL = statesConsts.normal;
  65012. var SELECTION = statesConsts.selection;
  65013. var pointTypes = {
  65014. chart: {
  65015. scatter: SYMBOL_POINT,
  65016. line: SYMBOL_POINT,
  65017. spline: SYMBOL_POINT,
  65018. stepline: SYMBOL_POINT,
  65019. stackedline: SYMBOL_POINT,
  65020. fullstackedline: SYMBOL_POINT,
  65021. stackedspline: SYMBOL_POINT,
  65022. fullstackedspline: SYMBOL_POINT,
  65023. stackedsplinearea: SYMBOL_POINT,
  65024. fullstackedsplinearea: SYMBOL_POINT,
  65025. area: SYMBOL_POINT,
  65026. splinearea: SYMBOL_POINT,
  65027. steparea: SYMBOL_POINT,
  65028. stackedarea: SYMBOL_POINT,
  65029. fullstackedarea: SYMBOL_POINT,
  65030. rangearea: "rangeSymbolPoint",
  65031. bar: BAR_POINT,
  65032. stackedbar: BAR_POINT,
  65033. fullstackedbar: BAR_POINT,
  65034. rangebar: "rangeBarPoint",
  65035. bubble: "bubblePoint",
  65036. stock: "stockPoint",
  65037. candlestick: "candlestickPoint"
  65038. },
  65039. pie: {
  65040. pie: PIE_POINT,
  65041. doughnut: PIE_POINT,
  65042. donut: PIE_POINT
  65043. },
  65044. polar: {
  65045. scatter: POLAR_SYMBOL_POINT,
  65046. line: POLAR_SYMBOL_POINT,
  65047. area: POLAR_SYMBOL_POINT,
  65048. bar: POLAR_BAR_POINT,
  65049. stackedbar: POLAR_BAR_POINT
  65050. }
  65051. };
  65052. function isNoneMode(mode) {
  65053. return "none" === _normalizeEnum(mode)
  65054. }
  65055. function Point(series, dataItem, options) {
  65056. this.fullState = NORMAL_STATE;
  65057. this.series = series;
  65058. this.update(dataItem, options);
  65059. this._viewCounters = {
  65060. hover: 0,
  65061. selection: 0
  65062. };
  65063. this._emptySettings = {
  65064. fill: null,
  65065. stroke: null,
  65066. dashStyle: null
  65067. }
  65068. }
  65069. exports.Point = Point;
  65070. mixins.symbolPoint = symbolPoint;
  65071. mixins.barPoint = barPoint;
  65072. mixins.bubblePoint = bubblePoint;
  65073. mixins.piePoint = piePoint;
  65074. mixins.rangeSymbolPoint = rangeSymbolPoint;
  65075. mixins.rangeBarPoint = rangeBarPoint;
  65076. mixins.candlestickPoint = candlestickPoint;
  65077. mixins.stockPoint = stockPoint;
  65078. mixins.polarSymbolPoint = polarPoints.polarSymbolPoint;
  65079. mixins.polarBarPoint = polarPoints.polarBarPoint;
  65080. Point.prototype = {
  65081. constructor: Point,
  65082. getColor: function() {
  65083. if (!this.hasValue() && !this._styles.usePointCustomOptions) {
  65084. this.series.customizePoint(this, this._dataItem)
  65085. }
  65086. return this._styles.normal.fill || this.series.getColor()
  65087. },
  65088. _getStyle: function() {
  65089. return this._styles[this._currentStyle || "normal"]
  65090. },
  65091. update: function(dataItem, options) {
  65092. this.updateOptions(options);
  65093. this.updateData(dataItem)
  65094. },
  65095. updateData: function(dataItem) {
  65096. var that = this;
  65097. var argumentWasChanged = that.argument !== dataItem.argument;
  65098. that.argument = that.initialArgument = that.originalArgument = dataItem.argument;
  65099. that.tag = dataItem.tag;
  65100. that.index = dataItem.index;
  65101. that._dataItem = dataItem;
  65102. that.data = dataItem.data;
  65103. that.lowError = dataItem.lowError;
  65104. that.highError = dataItem.highError;
  65105. that.aggregationInfo = dataItem.aggregationInfo;
  65106. that._updateData(dataItem, argumentWasChanged);
  65107. !that.hasValue() && that.setInvisibility();
  65108. that._fillStyle();
  65109. that._updateLabelData()
  65110. },
  65111. deleteMarker: function() {
  65112. var that = this;
  65113. if (that.graphic) {
  65114. that.graphic.dispose()
  65115. }
  65116. that.graphic = null
  65117. },
  65118. draw: function(renderer, groups, animationEnabled, firstDrawing) {
  65119. var that = this;
  65120. if (that._needDeletingOnDraw || that.series.autoHidePointMarkers && !that.isSelected()) {
  65121. that.deleteMarker();
  65122. that._needDeletingOnDraw = false
  65123. }
  65124. if (that._needClearingOnDraw) {
  65125. that.clearMarker();
  65126. that._needClearingOnDraw = false
  65127. }
  65128. if (!that._hasGraphic()) {
  65129. that.getMarkerVisibility() && !that.series.autoHidePointMarkers && that._drawMarker(renderer, groups.markers, animationEnabled, firstDrawing)
  65130. } else {
  65131. that._updateMarker(animationEnabled, this._getStyle(), groups.markers)
  65132. }
  65133. that._drawLabel();
  65134. that._drawErrorBar(renderer, groups.errorBars, animationEnabled);
  65135. return that
  65136. },
  65137. _getViewStyle: function() {
  65138. var state = NORMAL_STATE;
  65139. var fullState = this.fullState;
  65140. var styles = [NORMAL, HOVER, SELECTION, SELECTION];
  65141. if (this._viewCounters.hover) {
  65142. state |= HOVER_STATE
  65143. }
  65144. if (this._viewCounters.selection) {
  65145. state |= SELECTED_STATE
  65146. }
  65147. if (isNoneMode(this.getOptions().selectionMode)) {
  65148. fullState &= ~SELECTED_STATE
  65149. }
  65150. if (isNoneMode(this.getOptions().hoverMode)) {
  65151. fullState &= ~HOVER_STATE
  65152. }
  65153. state |= fullState;
  65154. return styles[state]
  65155. },
  65156. applyView: function(legendCallback) {
  65157. var style = this._getViewStyle();
  65158. var that = this;
  65159. that._currentStyle = style;
  65160. if (!that.graphic && that.series.autoHidePointMarkers && (style === SELECTION || style === HOVER)) {
  65161. that._drawMarker(that.series.getRenderer(), that.series.getMarkersGroup())
  65162. }
  65163. if (that.graphic) {
  65164. if (that.series.autoHidePointMarkers && style !== SELECTION && style !== HOVER) {
  65165. that.deleteMarker()
  65166. } else {
  65167. if ("normal" === style) {
  65168. that.clearMarker()
  65169. } else {
  65170. that.graphic.toForeground()
  65171. }
  65172. that._updateMarker(true, that._styles[style], void 0, legendCallback)
  65173. }
  65174. }
  65175. },
  65176. setView: function(style) {
  65177. this._viewCounters[style]++;
  65178. this.applyView()
  65179. },
  65180. resetView: function(style) {
  65181. var viewCounters = this._viewCounters;
  65182. --viewCounters[style];
  65183. if (viewCounters[style] < 0) {
  65184. viewCounters[style] = 0
  65185. }
  65186. this.applyView()
  65187. },
  65188. releaseHoverState: function() {
  65189. var that = this;
  65190. if (that.graphic && !that.isSelected()) {
  65191. that.graphic.toBackground()
  65192. }
  65193. },
  65194. select: function() {
  65195. this.series.selectPoint(this)
  65196. },
  65197. clearSelection: function() {
  65198. this.series.deselectPoint(this)
  65199. },
  65200. hover: function() {
  65201. this.series.hoverPoint(this)
  65202. },
  65203. clearHover: function() {
  65204. this.series.clearPointHover()
  65205. },
  65206. showTooltip: function() {
  65207. this.series.showPointTooltip(this)
  65208. },
  65209. hideTooltip: function() {
  65210. this.series.hidePointTooltip(this)
  65211. },
  65212. _checkLabelsChanging: function(oldType, newType) {
  65213. var isNewRange = ~newType.indexOf("range");
  65214. var isOldRange = ~oldType.indexOf("range");
  65215. return isOldRange && !isNewRange || !isOldRange && isNewRange
  65216. },
  65217. updateOptions: function(newOptions) {
  65218. if (!newOptions) {
  65219. return
  65220. }
  65221. var that = this;
  65222. var oldOptions = that._options;
  65223. var widgetType = newOptions.widgetType;
  65224. var oldType = oldOptions && oldOptions.type;
  65225. var newType = newOptions.type;
  65226. var newPointTypeMixin = pointTypes[widgetType][newType];
  65227. if (oldType !== newType) {
  65228. that._needDeletingOnDraw = true;
  65229. that._needClearingOnDraw = false;
  65230. if (oldType) {
  65231. that._checkLabelsChanging(oldType, newType) && that.deleteLabel();
  65232. that._resetType(mixins[pointTypes[oldType]])
  65233. }
  65234. that._setType(mixins[newPointTypeMixin])
  65235. } else {
  65236. that._needDeletingOnDraw = that._checkSymbol(oldOptions, newOptions);
  65237. that._needClearingOnDraw = that._checkCustomize(oldOptions, newOptions)
  65238. }
  65239. that._options = newOptions;
  65240. that._fillStyle();
  65241. that._updateLabelOptions(newPointTypeMixin)
  65242. },
  65243. translate: function() {
  65244. if (this.hasValue()) {
  65245. this._translate();
  65246. this.translated = true
  65247. }
  65248. },
  65249. _checkCustomize: function(oldOptions, newOptions) {
  65250. return oldOptions.styles.usePointCustomOptions && !newOptions.styles.usePointCustomOptions
  65251. },
  65252. _getCustomLabelVisibility: function() {
  65253. return this._styles.useLabelCustomOptions ? !!this._options.label.visible : null
  65254. },
  65255. getBoundingRect: function() {
  65256. return this._getGraphicBBox()
  65257. },
  65258. _resetType: function(methods) {
  65259. for (var methodName in methods) {
  65260. delete this[methodName]
  65261. }
  65262. },
  65263. _setType: function(methods) {
  65264. for (var methodName in methods) {
  65265. this[methodName] = methods[methodName]
  65266. }
  65267. },
  65268. isInVisibleArea: function() {
  65269. return this.inVisibleArea
  65270. },
  65271. isSelected: function() {
  65272. return !!(this.fullState & SELECTED_STATE)
  65273. },
  65274. isHovered: function() {
  65275. return !!(this.fullState & HOVER_STATE)
  65276. },
  65277. getOptions: function() {
  65278. return this._options
  65279. },
  65280. animate: function(complete, settings, partitionDuration) {
  65281. if (!this.graphic) {
  65282. complete && complete();
  65283. return
  65284. }
  65285. this.graphic.animate(settings, {
  65286. partitionDuration: partitionDuration
  65287. }, complete)
  65288. },
  65289. getCoords: function(min) {
  65290. var that = this;
  65291. if (!min) {
  65292. return {
  65293. x: that.x,
  65294. y: that.y
  65295. }
  65296. }
  65297. if (!that._options.rotated) {
  65298. return {
  65299. x: that.x,
  65300. y: that.minY + (that.y - that.minY ? 0 : 1)
  65301. }
  65302. }
  65303. return {
  65304. x: that.minX - (that.x - that.minX ? 0 : 1),
  65305. y: that.y
  65306. }
  65307. },
  65308. getDefaultCoords: function() {
  65309. var that = this;
  65310. return !that._options.rotated ? {
  65311. x: that.x,
  65312. y: that.defaultY
  65313. } : {
  65314. x: that.defaultX,
  65315. y: that.y
  65316. }
  65317. },
  65318. setDefaultCoords: function() {
  65319. var coords = this.getDefaultCoords();
  65320. this.x = coords.x;
  65321. this.y = coords.y
  65322. },
  65323. _getVisibleArea: function() {
  65324. return this.series.getVisibleArea()
  65325. },
  65326. _getArgTranslator: function() {
  65327. return this.series.getArgumentAxis().getTranslator()
  65328. },
  65329. _getValTranslator: function() {
  65330. return this.series.getValueAxis().getTranslator()
  65331. },
  65332. _calculateVisibility: function(x, y, width, height) {
  65333. var that = this;
  65334. var visibleArea = that._getVisibleArea();
  65335. var rotated = that._options.rotated;
  65336. if (visibleArea.minX > x + (width || 0) || visibleArea.maxX < x || visibleArea.minY > y + (height || 0) || visibleArea.maxY < y || rotated && _isDefined(width) && 0 !== width && (visibleArea.minX === x + width || visibleArea.maxX === x) || !rotated && _isDefined(height) && 0 !== height && (visibleArea.minY === y + height || visibleArea.maxY === y)) {
  65337. that.inVisibleArea = false
  65338. } else {
  65339. that.inVisibleArea = true
  65340. }
  65341. },
  65342. hasValue: function() {
  65343. return null !== this.value && null !== this.minValue
  65344. },
  65345. hasCoords: _noop,
  65346. correctPosition: _noop,
  65347. correctRadius: _noop,
  65348. correctLabelRadius: _noop,
  65349. getCrosshairData: _noop,
  65350. getPointRadius: _noop,
  65351. _populatePointShape: _noop,
  65352. _checkSymbol: _noop,
  65353. getMarkerCoords: _noop,
  65354. hide: _noop,
  65355. show: _noop,
  65356. hideMarker: _noop,
  65357. setInvisibility: _noop,
  65358. clearVisibility: _noop,
  65359. isVisible: _noop,
  65360. resetCorrection: _noop,
  65361. correctValue: _noop,
  65362. resetValue: _noop,
  65363. setPercentValue: _noop,
  65364. correctCoordinates: _noop,
  65365. coordsIn: _noop,
  65366. getTooltipParams: _noop,
  65367. applyWordWrap: _noop,
  65368. setLabelTrackerData: _noop,
  65369. updateLabelCoord: _noop,
  65370. drawLabel: _noop,
  65371. correctLabelPosition: _noop,
  65372. getMinValue: _noop,
  65373. getMaxValue: _noop,
  65374. _drawErrorBar: _noop,
  65375. getMarkerVisibility: _noop,
  65376. dispose: function() {
  65377. var that = this;
  65378. that.deleteMarker();
  65379. that.deleteLabel();
  65380. that._errorBar && this._errorBar.dispose();
  65381. that._options = that._styles = that.series = that._errorBar = null
  65382. },
  65383. getTooltipFormatObject: function(tooltip) {
  65384. var that = this;
  65385. var tooltipFormatObject = that._getFormatObject(tooltip);
  65386. var sharedTooltipValuesArray = [];
  65387. var tooltipStackPointsFormatObject = [];
  65388. if (that.stackPoints) {
  65389. _each(that.stackPoints, function(_, point) {
  65390. if (!point.isVisible()) {
  65391. return
  65392. }
  65393. var formatObject = point._getFormatObject(tooltip);
  65394. tooltipStackPointsFormatObject.push(formatObject);
  65395. sharedTooltipValuesArray.push(formatObject.seriesName + ": " + formatObject.valueText)
  65396. });
  65397. _extend(tooltipFormatObject, {
  65398. points: tooltipStackPointsFormatObject,
  65399. valueText: sharedTooltipValuesArray.join("\n"),
  65400. stackName: that.stackPoints.stackName
  65401. })
  65402. }
  65403. var aggregationInfo = that.aggregationInfo;
  65404. if (aggregationInfo) {
  65405. var axis = that.series.getArgumentAxis();
  65406. var rangeText = axis.formatRange(aggregationInfo.intervalStart, aggregationInfo.intervalEnd, aggregationInfo.aggregationInterval);
  65407. if (rangeText) {
  65408. tooltipFormatObject.valueText += "\n".concat(rangeText)
  65409. }
  65410. }
  65411. return tooltipFormatObject
  65412. },
  65413. setHole: function(holeValue, position) {
  65414. var that = this;
  65415. var minValue = isFinite(that.minValue) ? that.minValue : 0;
  65416. if (_isDefined(holeValue)) {
  65417. if ("left" === position) {
  65418. that.leftHole = that.value - holeValue;
  65419. that.minLeftHole = minValue - holeValue
  65420. } else {
  65421. that.rightHole = that.value - holeValue;
  65422. that.minRightHole = minValue - holeValue
  65423. }
  65424. }
  65425. },
  65426. resetHoles: function() {
  65427. this.leftHole = null;
  65428. this.minLeftHole = null;
  65429. this.rightHole = null;
  65430. this.minRightHole = null
  65431. },
  65432. getLabel: function() {
  65433. return this._label
  65434. },
  65435. getLabels: function() {
  65436. return [this._label]
  65437. },
  65438. getCenterCoord: function() {
  65439. return {
  65440. x: this.x,
  65441. y: this.y
  65442. }
  65443. }
  65444. }
  65445. },
  65446. /*!****************************************************************!*\
  65447. !*** ./artifacts/transpiled/viz/series/points/bubble_point.js ***!
  65448. \****************************************************************/
  65449. /*! dynamic exports provided */
  65450. /*! all exports used */
  65451. function(module, exports, __webpack_require__) {
  65452. var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
  65453. var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
  65454. var _extend = extend;
  65455. var MIN_BUBBLE_HEIGHT = 20;
  65456. module.exports = _extend({}, symbolPoint, {
  65457. correctCoordinates: function(diameter) {
  65458. this.bubbleSize = diameter / 2
  65459. },
  65460. _drawMarker: function(renderer, group, animationEnabled) {
  65461. var that = this;
  65462. var attr = _extend({
  65463. translateX: that.x,
  65464. translateY: that.y
  65465. }, that._getStyle());
  65466. that.graphic = renderer.circle(0, 0, animationEnabled ? 0 : that.bubbleSize).smartAttr(attr).data({
  65467. "chart-data-point": that
  65468. }).append(group)
  65469. },
  65470. getTooltipParams: function(location) {
  65471. var that = this;
  65472. var graphic = that.graphic;
  65473. if (!graphic) {
  65474. return
  65475. }
  65476. var height = graphic.getBBox().height;
  65477. return {
  65478. x: that.x,
  65479. y: that.y,
  65480. offset: height < MIN_BUBBLE_HEIGHT || "edge" === location ? height / 2 : 0
  65481. }
  65482. },
  65483. _getLabelFormatObject: function() {
  65484. var formatObject = symbolPoint._getLabelFormatObject.call(this);
  65485. formatObject.size = this.initialSize;
  65486. return formatObject
  65487. },
  65488. _updateData: function(data) {
  65489. symbolPoint._updateData.call(this, data);
  65490. this.size = this.initialSize = data.size
  65491. },
  65492. _getGraphicBBox: function() {
  65493. var that = this;
  65494. return that._getSymbolBBox(that.x, that.y, that.bubbleSize)
  65495. },
  65496. _updateMarker: function(animationEnabled, style) {
  65497. var that = this;
  65498. if (!animationEnabled) {
  65499. style = _extend({
  65500. r: that.bubbleSize,
  65501. translateX: that.x,
  65502. translateY: that.y
  65503. }, style)
  65504. }
  65505. that.graphic.smartAttr(style)
  65506. },
  65507. _getFormatObject: function(tooltip) {
  65508. var formatObject = symbolPoint._getFormatObject.call(this, tooltip);
  65509. formatObject.sizeText = tooltip.formatValue(this.initialSize);
  65510. return formatObject
  65511. },
  65512. _storeTrackerR: function() {
  65513. return this.bubbleSize
  65514. },
  65515. _getLabelCoords: function(label) {
  65516. var coords;
  65517. if ("inside" === label.getLayoutOptions().position) {
  65518. coords = this._getLabelCoordOfPosition(label, "inside")
  65519. } else {
  65520. coords = symbolPoint._getLabelCoords.call(this, label)
  65521. }
  65522. return coords
  65523. }
  65524. })
  65525. },
  65526. /*!*******************************************************************!*\
  65527. !*** ./artifacts/transpiled/viz/series/points/range_bar_point.js ***!
  65528. \*******************************************************************/
  65529. /*! dynamic exports provided */
  65530. /*! all exports used */
  65531. function(module, exports, __webpack_require__) {
  65532. var noop = __webpack_require__( /*! ../../../core/utils/common */ 4).noop;
  65533. var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
  65534. var barPoint = __webpack_require__( /*! ./bar_point */ 202);
  65535. var rangeSymbolPointMethods = __webpack_require__( /*! ./range_symbol_point */ 399);
  65536. var _extend = extend;
  65537. module.exports = _extend({}, barPoint, {
  65538. deleteLabel: rangeSymbolPointMethods.deleteLabel,
  65539. _getFormatObject: rangeSymbolPointMethods._getFormatObject,
  65540. clearVisibility: function() {
  65541. var graphic = this.graphic;
  65542. if (graphic && graphic.attr("visibility")) {
  65543. graphic.attr({
  65544. visibility: null
  65545. })
  65546. }
  65547. },
  65548. setInvisibility: function() {
  65549. var graphic = this.graphic;
  65550. if (graphic && "hidden" !== graphic.attr("visibility")) {
  65551. graphic.attr({
  65552. visibility: "hidden"
  65553. })
  65554. }
  65555. this._topLabel.draw(false);
  65556. this._bottomLabel.draw(false)
  65557. },
  65558. getTooltipParams: function(location) {
  65559. var that = this;
  65560. var edgeLocation = "edge" === location;
  65561. var x;
  65562. var y;
  65563. if (that._options.rotated) {
  65564. x = edgeLocation ? that.x + that.width : that.x + that.width / 2;
  65565. y = that.y + that.height / 2
  65566. } else {
  65567. x = that.x + that.width / 2;
  65568. y = edgeLocation ? that.y : that.y + that.height / 2
  65569. }
  65570. return {
  65571. x: x,
  65572. y: y,
  65573. offset: 0
  65574. }
  65575. },
  65576. _translate: function() {
  65577. var that = this;
  65578. var barMethods = barPoint;
  65579. barMethods._translate.call(that);
  65580. if (that._options.rotated) {
  65581. that.width = that.width || 1
  65582. } else {
  65583. that.height = that.height || 1
  65584. }
  65585. },
  65586. hasCoords: rangeSymbolPointMethods.hasCoords,
  65587. _updateData: rangeSymbolPointMethods._updateData,
  65588. _getLabelPosition: rangeSymbolPointMethods._getLabelPosition,
  65589. _getLabelMinFormatObject: rangeSymbolPointMethods._getLabelMinFormatObject,
  65590. _updateLabelData: rangeSymbolPointMethods._updateLabelData,
  65591. _updateLabelOptions: rangeSymbolPointMethods._updateLabelOptions,
  65592. getCrosshairData: rangeSymbolPointMethods.getCrosshairData,
  65593. _createLabel: rangeSymbolPointMethods._createLabel,
  65594. _checkOverlay: rangeSymbolPointMethods._checkOverlay,
  65595. _checkLabelsOverlay: rangeSymbolPointMethods._checkLabelsOverlay,
  65596. _getOverlayCorrections: rangeSymbolPointMethods._getOverlayCorrections,
  65597. _drawLabel: rangeSymbolPointMethods._drawLabel,
  65598. _getLabelCoords: rangeSymbolPointMethods._getLabelCoords,
  65599. _getGraphicBBox: function(location) {
  65600. var isTop = "top" === location;
  65601. var bBox = barPoint._getGraphicBBox.call(this);
  65602. if (!this._options.rotated) {
  65603. bBox.y = isTop ? bBox.y : bBox.y + bBox.height;
  65604. bBox.height = 0
  65605. } else {
  65606. bBox.x = isTop ? bBox.x + bBox.width : bBox.x;
  65607. bBox.width = 0
  65608. }
  65609. return bBox
  65610. },
  65611. getLabel: rangeSymbolPointMethods.getLabel,
  65612. getLabels: rangeSymbolPointMethods.getLabels,
  65613. getBoundingRect: noop,
  65614. getMinValue: rangeSymbolPointMethods.getMinValue,
  65615. getMaxValue: rangeSymbolPointMethods.getMaxValue
  65616. })
  65617. },
  65618. /*!***************************************************************!*\
  65619. !*** ./artifacts/transpiled/viz/series/points/stock_point.js ***!
  65620. \***************************************************************/
  65621. /*! dynamic exports provided */
  65622. /*! all exports used */
  65623. function(module, exports, __webpack_require__) {
  65624. var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
  65625. var isNumeric = __webpack_require__( /*! ../../../core/utils/type */ 1).isNumeric;
  65626. var candlestickPoint = __webpack_require__( /*! ./candlestick_point */ 400);
  65627. var _extend = extend;
  65628. var _isNumeric = isNumeric;
  65629. module.exports = _extend({}, candlestickPoint, {
  65630. _getPoints: function() {
  65631. var that = this;
  65632. var createPoint = that._options.rotated ? function(x, y) {
  65633. return [y, x]
  65634. } : function(x, y) {
  65635. return [x, y]
  65636. };
  65637. var openYExist = _isNumeric(that.openY);
  65638. var closeYExist = _isNumeric(that.closeY);
  65639. var x = that.x;
  65640. var width = that.width;
  65641. var points;
  65642. points = [].concat(createPoint(x, that.highY));
  65643. openYExist && (points = points.concat(createPoint(x, that.openY)));
  65644. openYExist && (points = points.concat(createPoint(x - width / 2, that.openY)));
  65645. openYExist && (points = points.concat(createPoint(x, that.openY)));
  65646. closeYExist && (points = points.concat(createPoint(x, that.closeY)));
  65647. closeYExist && (points = points.concat(createPoint(x + width / 2, that.closeY)));
  65648. closeYExist && (points = points.concat(createPoint(x, that.closeY)));
  65649. points = points.concat(createPoint(x, that.lowY));
  65650. return points
  65651. },
  65652. _drawMarkerInGroup: function(group, attributes, renderer) {
  65653. this.graphic = renderer.path(this._getPoints(), "line").attr({
  65654. "stroke-linecap": "square"
  65655. }).attr(attributes).data({
  65656. "chart-data-point": this
  65657. }).sharp().append(group)
  65658. },
  65659. _getMinTrackerWidth: function() {
  65660. var width = 2 + this._styles.normal["stroke-width"];
  65661. return width + width % 2
  65662. }
  65663. })
  65664. },
  65665. /*!***************************************************************!*\
  65666. !*** ./artifacts/transpiled/viz/series/points/polar_point.js ***!
  65667. \***************************************************************/
  65668. /*! dynamic exports provided */
  65669. /*! all exports used */
  65670. function(module, exports, __webpack_require__) {
  65671. var extend = __webpack_require__( /*! ../../../core/utils/extend */ 0).extend;
  65672. var _extend = extend;
  65673. var symbolPoint = __webpack_require__( /*! ./symbol_point */ 118);
  65674. var barPoint = __webpack_require__( /*! ./bar_point */ 202);
  65675. var piePoint = __webpack_require__( /*! ./pie_point */ 398);
  65676. var isDefined = __webpack_require__( /*! ../../../core/utils/type */ 1).isDefined;
  65677. var vizUtils = __webpack_require__( /*! ../../core/utils */ 10);
  65678. var normalizeAngle = vizUtils.normalizeAngle;
  65679. var _math = Math;
  65680. var _max = _math.max;
  65681. var RADIAL_LABEL_INDENT = __webpack_require__( /*! ../../components/consts */ 117).radialLabelIndent;
  65682. var ERROR_BARS_ANGLE_OFFSET = 90;
  65683. var CANVAS_POSITION_END = "canvas_position_end";
  65684. var CANVAS_POSITION_DEFAULT = "canvas_position_default";
  65685. exports.polarSymbolPoint = _extend({}, symbolPoint, {
  65686. _getLabelCoords: piePoint._getLabelCoords,
  65687. _moveLabelOnCanvas: barPoint._moveLabelOnCanvas,
  65688. _getLabelPosition: function() {
  65689. return "outside"
  65690. },
  65691. _getCoords: function(argument, value) {
  65692. var axis = this.series.getValueAxis();
  65693. var startAngle = axis.getAngles()[0];
  65694. var angle = this._getArgTranslator().translate(argument);
  65695. var radius = this._getValTranslator().translate(value);
  65696. var coords = vizUtils.convertPolarToXY(axis.getCenter(), axis.getAngles()[0], angle, radius);
  65697. coords.angle = angle + startAngle - 90, coords.radius = radius;
  65698. return coords
  65699. },
  65700. _translate: function() {
  65701. var that = this;
  65702. var center = that.series.getValueAxis().getCenter();
  65703. var coord = that._getCoords(that.argument, that.value);
  65704. that.vx = normalizeAngle(coord.angle);
  65705. that.vy = that.radiusOuter = that.radiusLabels = coord.radius;
  65706. that.radiusLabels += RADIAL_LABEL_INDENT;
  65707. that.radius = coord.radius;
  65708. that.middleAngle = -coord.angle;
  65709. that.angle = -coord.angle;
  65710. that.x = coord.x;
  65711. that.y = coord.y;
  65712. that.defaultX = that.centerX = center.x;
  65713. that.defaultY = that.centerY = center.y;
  65714. that._translateErrorBars();
  65715. that.inVisibleArea = true
  65716. },
  65717. _translateErrorBars: function() {
  65718. var that = this;
  65719. var errorBars = that._options.errorBars;
  65720. var translator = that._getValTranslator();
  65721. if (!errorBars) {
  65722. return
  65723. }
  65724. isDefined(that.lowError) && (that._lowErrorCoord = that.centerY - translator.translate(that.lowError));
  65725. isDefined(that.highError) && (that._highErrorCoord = that.centerY - translator.translate(that.highError));
  65726. that._errorBarPos = that.centerX;
  65727. that._baseErrorBarPos = "stdDeviation" === errorBars.type ? that._lowErrorCoord + (that._highErrorCoord - that._lowErrorCoord) / 2 : that.centerY - that.radius
  65728. },
  65729. _getTranslates: function(animationEnabled) {
  65730. return animationEnabled ? this.getDefaultCoords() : {
  65731. x: this.x,
  65732. y: this.y
  65733. }
  65734. },
  65735. getDefaultCoords: function() {
  65736. var cosSin = vizUtils.getCosAndSin(-this.angle);
  65737. var radius = this._getValTranslator().translate(CANVAS_POSITION_DEFAULT);
  65738. var x = this.defaultX + radius * cosSin.cos;
  65739. var y = this.defaultY + radius * cosSin.sin;
  65740. return {
  65741. x: x,
  65742. y: y
  65743. }
  65744. },
  65745. _addLabelAlignmentAndOffset: function(label, coord) {
  65746. return coord
  65747. },
  65748. _checkLabelPosition: function(label, coord) {
  65749. var that = this;
  65750. var visibleArea = that._getVisibleArea();
  65751. var graphicBBox = that._getGraphicBBox();
  65752. if (that._isPointInVisibleArea(visibleArea, graphicBBox)) {
  65753. coord = that._moveLabelOnCanvas(coord, visibleArea, label.getBoundingRect())
  65754. }
  65755. return coord
  65756. },
  65757. _getErrorBarSettings: function(errorBarOptions, animationEnabled) {
  65758. var settings = symbolPoint._getErrorBarSettings.call(this, errorBarOptions, animationEnabled);
  65759. settings.rotate = ERROR_BARS_ANGLE_OFFSET - this.angle;
  65760. settings.rotateX = this.centerX;
  65761. settings.rotateY = this.centerY;
  65762. return settings
  65763. },
  65764. getCoords: function(min) {
  65765. return min ? this.getDefaultCoords() : {
  65766. x: this.x,
  65767. y: this.y
  65768. }
  65769. }
  65770. });
  65771. exports.polarBarPoint = _extend({}, barPoint, {
  65772. _translateErrorBars: exports.polarSymbolPoint._translateErrorBars,
  65773. _getErrorBarSettings: exports.polarSymbolPoint._getErrorBarSettings,
  65774. _moveLabelOnCanvas: barPoint._moveLabelOnCanvas,
  65775. _getLabelCoords: piePoint._getLabelCoords,
  65776. _getLabelConnector: piePoint._getLabelConnector,
  65777. getTooltipParams: piePoint.getTooltipParams,
  65778. _getLabelPosition: piePoint._getLabelPosition,
  65779. _getCoords: exports.polarSymbolPoint._getCoords,
  65780. _translate: function() {
  65781. var that = this;
  65782. var translator = that._getValTranslator();
  65783. var maxRadius = translator.translate(CANVAS_POSITION_END);
  65784. that.radiusInner = translator.translate(that.minValue);
  65785. exports.polarSymbolPoint._translate.call(that);
  65786. if (null === that.radiusInner) {
  65787. that.radiusInner = that.radius = maxRadius
  65788. } else {
  65789. if (null === that.radius) {
  65790. this.radius = this.value >= 0 ? maxRadius : 0
  65791. }
  65792. }
  65793. that.radiusOuter = that.radiusLabels = _max(that.radiusInner, that.radius);
  65794. that.radiusLabels += RADIAL_LABEL_INDENT;
  65795. that.radiusInner = that.defaultRadius = _math.min(that.radiusInner, that.radius);
  65796. that.middleAngle = that.angle = -normalizeAngle(that.middleAngleCorrection - that.angle)
  65797. },
  65798. _getErrorBarBaseEdgeLength: function() {
  65799. var coord = this.getMarkerCoords();
  65800. return _math.PI * coord.outerRadius * _math.abs(coord.startAngle - coord.endAngle) / 180
  65801. },
  65802. getMarkerCoords: function() {
  65803. return {
  65804. x: this.centerX,
  65805. y: this.centerY,
  65806. outerRadius: this.radiusOuter,
  65807. innerRadius: this.defaultRadius,
  65808. startAngle: this.middleAngle - this.interval / 2,
  65809. endAngle: this.middleAngle + this.interval / 2
  65810. }
  65811. },
  65812. _drawMarker: function(renderer, group, animationEnabled) {
  65813. var that = this;
  65814. var styles = that._getStyle();
  65815. var coords = that.getMarkerCoords();
  65816. var innerRadius = coords.innerRadius;
  65817. var outerRadius = coords.outerRadius;
  65818. var start = that._getCoords(that.argument, CANVAS_POSITION_DEFAULT);
  65819. var x = coords.x;
  65820. var y = coords.y;
  65821. if (animationEnabled) {
  65822. innerRadius = 0;
  65823. outerRadius = 0;
  65824. x = start.x;
  65825. y = start.y
  65826. }
  65827. that.graphic = renderer.arc(x, y, innerRadius, outerRadius, coords.startAngle, coords.endAngle).attr(styles).data({
  65828. "chart-data-point": that
  65829. }).append(group)
  65830. },
  65831. _checkLabelPosition: function(label, coord) {
  65832. var that = this;
  65833. var visibleArea = that._getVisibleArea();
  65834. var angleFunctions = vizUtils.getCosAndSin(that.middleAngle);
  65835. var x = that.centerX + that.defaultRadius * angleFunctions.cos;
  65836. var y = that.centerY - that.defaultRadius * angleFunctions.sin;
  65837. if (x > visibleArea.minX && x < visibleArea.maxX && y > visibleArea.minY && y < visibleArea.maxY) {
  65838. coord = that._moveLabelOnCanvas(coord, visibleArea, label.getBoundingRect())
  65839. }
  65840. return coord
  65841. },
  65842. _addLabelAlignmentAndOffset: function(label, coord) {
  65843. return coord
  65844. },
  65845. correctCoordinates: function(correctOptions) {
  65846. this.middleAngleCorrection = correctOptions.offset;
  65847. this.interval = correctOptions.width
  65848. },
  65849. coordsIn: function(x, y) {
  65850. var val = vizUtils.convertXYToPolar(this.series.getValueAxis().getCenter(), x, y);
  65851. var coords = this.getMarkerCoords();
  65852. var isBetweenAngles = coords.startAngle < coords.endAngle ? -val.phi >= coords.startAngle && -val.phi <= coords.endAngle : -val.phi <= coords.startAngle && -val.phi >= coords.endAngle;
  65853. return val.r >= coords.innerRadius && val.r <= coords.outerRadius && isBetweenAngles
  65854. }
  65855. })
  65856. },
  65857. /*!*********************************************************!*\
  65858. !*** ./artifacts/transpiled/viz/series/range_series.js ***!
  65859. \*********************************************************/
  65860. /*! dynamic exports provided */
  65861. /*! all exports used */
  65862. function(module, exports, __webpack_require__) {
  65863. function _defineProperty(obj, key, value) {
  65864. if (key in obj) {
  65865. Object.defineProperty(obj, key, {
  65866. value: value,
  65867. enumerable: true,
  65868. configurable: true,
  65869. writable: true
  65870. })
  65871. } else {
  65872. obj[key] = value
  65873. }
  65874. return obj
  65875. }
  65876. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  65877. var _extend = extend;
  65878. var _isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  65879. var _map = __webpack_require__( /*! ../core/utils */ 10).map;
  65880. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  65881. var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106).chart;
  65882. var barSeries = __webpack_require__( /*! ./bar_series */ 143).chart.bar;
  65883. var areaSeries = __webpack_require__( /*! ./area_series */ 165).chart.area;
  65884. exports.chart = {};
  65885. var baseRangeSeries = {
  65886. areErrorBarsVisible: _noop,
  65887. _createErrorBarGroup: _noop,
  65888. _checkData: function(data, skippedFields) {
  65889. var valueFields = this.getValueFields();
  65890. return scatterSeries._checkData.call(this, data, skippedFields, {
  65891. minValue: valueFields[0],
  65892. value: valueFields[1]
  65893. }) && data.minValue === data.minValue
  65894. },
  65895. getValueRangeInitialValue: scatterSeries.getValueRangeInitialValue,
  65896. _getPointDataSelector: function(data) {
  65897. var _this = this;
  65898. var valueFields = this.getValueFields();
  65899. var val1Field = valueFields[0];
  65900. var val2Field = valueFields[1];
  65901. var tagField = this.getTagField();
  65902. var argumentField = this.getArgumentField();
  65903. return function(data) {
  65904. return {
  65905. tag: data[tagField],
  65906. minValue: _this._processEmptyValue(data[val1Field]),
  65907. value: _this._processEmptyValue(data[val2Field]),
  65908. argument: data[argumentField],
  65909. data: data
  65910. }
  65911. }
  65912. },
  65913. _defaultAggregator: "range",
  65914. _aggregators: {
  65915. range: function(_ref, series) {
  65916. var _data$reduce;
  65917. var intervalStart = _ref.intervalStart,
  65918. data = _ref.data;
  65919. if (!data.length) {
  65920. return
  65921. }
  65922. var valueFields = series.getValueFields();
  65923. var val1Field = valueFields[0];
  65924. var val2Field = valueFields[1];
  65925. var result = data.reduce(function(result, item) {
  65926. var val1 = item[val1Field];
  65927. var val2 = item[val2Field];
  65928. if (!_isDefined(val1) || !_isDefined(val2)) {
  65929. return result
  65930. }
  65931. result[val1Field] = Math.min(result[val1Field], Math.min(val1, val2));
  65932. result[val2Field] = Math.max(result[val2Field], Math.max(val1, val2));
  65933. return result
  65934. }, (_data$reduce = {}, _defineProperty(_data$reduce, val1Field, 1 / 0), _defineProperty(_data$reduce, val2Field, -(1 / 0)), _defineProperty(_data$reduce, series.getArgumentField(), intervalStart), _data$reduce));
  65935. if (!isFinite(result[val1Field]) || !isFinite(result[val2Field])) {
  65936. if (data.filter(function(i) {
  65937. return null === i[val1Field] && null === i[val2Field]
  65938. }).length === data.length) {
  65939. result[val1Field] = result[val2Field] = null
  65940. } else {
  65941. return
  65942. }
  65943. }
  65944. return result
  65945. }
  65946. },
  65947. getValueFields: function() {
  65948. return [this._options.rangeValue1Field || "val1", this._options.rangeValue2Field || "val2"]
  65949. },
  65950. getSeriesPairCoord: function(coord, isArgument) {
  65951. var oppositeCoord = null;
  65952. var rotated = this._options.rotated;
  65953. var isOpposite = !isArgument && !rotated || isArgument && rotated;
  65954. var coordName = isOpposite ? "vy" : "vx";
  65955. var minCoordName = rotated ? "minX" : "minY";
  65956. var oppositeCoordName = isOpposite ? "vx" : "vy";
  65957. var points = this.getPoints();
  65958. for (var i = 0; i < points.length; i++) {
  65959. var p = points[i];
  65960. var tmpCoord = void 0;
  65961. if (isArgument) {
  65962. tmpCoord = p.getCenterCoord()[coordName[1]] === coord ? p[oppositeCoordName] : void 0
  65963. } else {
  65964. var coords = [Math.min(p[coordName], p[minCoordName]), Math.max(p[coordName], p[minCoordName])];
  65965. tmpCoord = coord >= coords[0] && coord <= coords[1] ? p[oppositeCoordName] : void 0
  65966. }
  65967. if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
  65968. oppositeCoord = tmpCoord;
  65969. break
  65970. }
  65971. }
  65972. return oppositeCoord
  65973. }
  65974. };
  65975. exports.chart.rangebar = _extend({}, barSeries, baseRangeSeries);
  65976. exports.chart.rangearea = _extend({}, areaSeries, {
  65977. _drawPoint: function(options) {
  65978. var point = options.point;
  65979. if (point.isInVisibleArea()) {
  65980. point.clearVisibility();
  65981. point.draw(this._renderer, options.groups);
  65982. this._drawnPoints.push(point);
  65983. if (!point.visibleTopMarker) {
  65984. point.hideMarker("top")
  65985. }
  65986. if (!point.visibleBottomMarker) {
  65987. point.hideMarker("bottom")
  65988. }
  65989. } else {
  65990. point.setInvisibility()
  65991. }
  65992. },
  65993. _prepareSegment: function(points, rotated) {
  65994. var processedPoints = this._processSinglePointsAreaSegment(points, rotated);
  65995. var processedMinPointsCoords = _map(processedPoints, function(pt) {
  65996. return pt.getCoords(true)
  65997. });
  65998. return {
  65999. line: processedPoints,
  66000. bottomLine: processedMinPointsCoords,
  66001. area: _map(processedPoints, function(pt) {
  66002. return pt.getCoords()
  66003. }).concat(processedMinPointsCoords.slice().reverse()),
  66004. singlePointSegment: processedPoints !== points
  66005. }
  66006. },
  66007. _getDefaultSegment: function(segment) {
  66008. var defaultSegment = areaSeries._getDefaultSegment.call(this, segment);
  66009. defaultSegment.bottomLine = defaultSegment.line;
  66010. return defaultSegment
  66011. },
  66012. _removeElement: function(element) {
  66013. areaSeries._removeElement.call(this, element);
  66014. element.bottomLine && element.bottomLine.remove()
  66015. },
  66016. _drawElement: function(segment, group) {
  66017. var that = this;
  66018. var drawnElement = areaSeries._drawElement.call(that, segment, group);
  66019. drawnElement.bottomLine = that._bordersGroup && that._createBorderElement(segment.bottomLine, {
  66020. "stroke-width": that._styles.normal.border["stroke-width"]
  66021. }).append(that._bordersGroup);
  66022. return drawnElement
  66023. },
  66024. _applyStyle: function(style) {
  66025. var that = this;
  66026. var elementsGroup = that._elementsGroup;
  66027. var bordersGroup = that._bordersGroup;
  66028. elementsGroup && elementsGroup.smartAttr(style.elements);
  66029. bordersGroup && bordersGroup.attr(style.border);
  66030. (that._graphics || []).forEach(function(graphic) {
  66031. graphic.line && graphic.line.attr({
  66032. "stroke-width": style.border["stroke-width"]
  66033. });
  66034. graphic.bottomLine && graphic.bottomLine.attr({
  66035. "stroke-width": style.border["stroke-width"]
  66036. })
  66037. })
  66038. },
  66039. _updateElement: function(element, segment, animate, complete) {
  66040. var bottomLineParams = {
  66041. points: segment.bottomLine
  66042. };
  66043. var bottomBorderElement = element.bottomLine;
  66044. areaSeries._updateElement.apply(this, arguments);
  66045. if (bottomBorderElement) {
  66046. animate ? bottomBorderElement.animate(bottomLineParams) : bottomBorderElement.attr(bottomLineParams)
  66047. }
  66048. }
  66049. }, baseRangeSeries)
  66050. },
  66051. /*!**********************************************************!*\
  66052. !*** ./artifacts/transpiled/viz/series/bubble_series.js ***!
  66053. \**********************************************************/
  66054. /*! dynamic exports provided */
  66055. /*! all exports used */
  66056. function(module, exports, __webpack_require__) {
  66057. function _defineProperty(obj, key, value) {
  66058. if (key in obj) {
  66059. Object.defineProperty(obj, key, {
  66060. value: value,
  66061. enumerable: true,
  66062. configurable: true,
  66063. writable: true
  66064. })
  66065. } else {
  66066. obj[key] = value
  66067. }
  66068. return obj
  66069. }
  66070. var lineSeries = __webpack_require__( /*! ./line_series */ 203).chart.line;
  66071. var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106).chart;
  66072. var areaSeries = __webpack_require__( /*! ./area_series */ 165).chart.area;
  66073. var barSeries = __webpack_require__( /*! ./bar_series */ 143);
  66074. var chartBarSeries = barSeries.chart.bar;
  66075. var polarBarSeries = barSeries.polar.bar;
  66076. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  66077. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  66078. var _extend = extend;
  66079. var _each = each;
  66080. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  66081. exports.chart = {};
  66082. exports.chart.bubble = _extend({}, scatterSeries, {
  66083. _calculateErrorBars: _noop,
  66084. _getMainColor: chartBarSeries._getMainColor,
  66085. _createPointStyles: chartBarSeries._createPointStyles,
  66086. _updatePointsVisibility: chartBarSeries._updatePointsVisibility,
  66087. _getOptionsForPoint: chartBarSeries._getOptionsForPoint,
  66088. _applyMarkerClipRect: lineSeries._applyElementsClipRect,
  66089. _parsePointStyle: polarBarSeries._parsePointStyle,
  66090. _createLegendState: areaSeries._createLegendState,
  66091. _setMarkerGroupSettings: polarBarSeries._setMarkerGroupSettings,
  66092. areErrorBarsVisible: _noop,
  66093. _createErrorBarGroup: _noop,
  66094. _checkData: function(data, skippedFields) {
  66095. return scatterSeries._checkData.call(this, data, skippedFields, {
  66096. value: this.getValueFields()[0],
  66097. size: this.getSizeField()
  66098. })
  66099. },
  66100. _getPointDataSelector: function(data, options) {
  66101. var sizeField = this.getSizeField();
  66102. var baseGetter = scatterSeries._getPointDataSelector.call(this);
  66103. return function(data) {
  66104. var pointData = baseGetter(data);
  66105. pointData.size = data[sizeField];
  66106. return pointData
  66107. }
  66108. },
  66109. _aggregators: {
  66110. avg: function(_ref, series) {
  66111. var _ref2;
  66112. var data = _ref.data,
  66113. intervalStart = _ref.intervalStart;
  66114. if (!data.length) {
  66115. return
  66116. }
  66117. var valueField = series.getValueFields()[0];
  66118. var sizeField = series.getSizeField();
  66119. var aggregate = data.reduce(function(result, item) {
  66120. result[0] += item[valueField];
  66121. result[1] += item[sizeField];
  66122. result[2]++;
  66123. return result
  66124. }, [0, 0, 0]);
  66125. return _ref2 = {}, _defineProperty(_ref2, valueField, aggregate[0] / aggregate[2]), _defineProperty(_ref2, sizeField, aggregate[1] / aggregate[2]), _defineProperty(_ref2, series.getArgumentField(), intervalStart), _ref2
  66126. }
  66127. },
  66128. getValueFields: function() {
  66129. return [this._options.valueField || "val"]
  66130. },
  66131. getSizeField: function() {
  66132. return this._options.sizeField || "size"
  66133. },
  66134. _animate: function() {
  66135. var that = this;
  66136. var lastPointIndex = that._drawnPoints.length - 1;
  66137. var labelsGroup = that._labelsGroup;
  66138. var labelAnimFunc = function() {
  66139. labelsGroup && labelsGroup.animate({
  66140. opacity: 1
  66141. }, {
  66142. duration: that._defaultDuration
  66143. })
  66144. };
  66145. _each(that._drawnPoints || [], function(i, p) {
  66146. p.animate(i === lastPointIndex ? labelAnimFunc : void 0, {
  66147. r: p.bubbleSize,
  66148. translateX: p.x,
  66149. translateY: p.y
  66150. })
  66151. })
  66152. },
  66153. _patchMarginOptions: function(options) {
  66154. options.processBubbleSize = true;
  66155. return options
  66156. }
  66157. })
  66158. },
  66159. /*!*******************************************************!*\
  66160. !*** ./artifacts/transpiled/viz/series/pie_series.js ***!
  66161. \*******************************************************/
  66162. /*! dynamic exports provided */
  66163. /*! all exports used */
  66164. function(module, exports, __webpack_require__) {
  66165. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  66166. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  66167. var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106);
  66168. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  66169. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  66170. var chartScatterSeries = scatterSeries.chart;
  66171. var barSeries = __webpack_require__( /*! ./bar_series */ 143).chart.bar;
  66172. var _extend = extend;
  66173. var _each = each;
  66174. var _noop = noop;
  66175. var _map = vizUtils.map;
  66176. var _isFinite = isFinite;
  66177. var _max = Math.max;
  66178. var ANIMATION_DURATION = .7;
  66179. var INSIDE = "inside";
  66180. exports.pie = _extend({}, barSeries, {
  66181. _setGroupsSettings: function() {
  66182. chartScatterSeries._setGroupsSettings.apply(this, arguments);
  66183. this._labelsGroup.attr({
  66184. "pointer-events": null
  66185. })
  66186. },
  66187. _createErrorBarGroup: _noop,
  66188. _drawPoint: function(options) {
  66189. var point = options.point;
  66190. var legendCallback = this._legendCallback;
  66191. chartScatterSeries._drawPoint.call(this, options);
  66192. !point.isVisible() && point.setInvisibility();
  66193. point.isSelected() && legendCallback()
  66194. },
  66195. _getOldPoint: function(data, oldPointsByArgument, index) {
  66196. var point = (this._points || [])[index];
  66197. if (point) {
  66198. oldPointsByArgument[point.argument.valueOf()] = oldPointsByArgument[point.argument.valueOf()].filter(function(p) {
  66199. return p !== point
  66200. })
  66201. }
  66202. return point
  66203. },
  66204. adjustLabels: function(moveLabelsFromCenter) {
  66205. return (this._points || []).reduce(function(r, p) {
  66206. if (p._label.isVisible()) {
  66207. p.setLabelTrackerData();
  66208. r = p.applyWordWrap(moveLabelsFromCenter) || r;
  66209. p.updateLabelCoord(moveLabelsFromCenter);
  66210. return r
  66211. }
  66212. }, false)
  66213. },
  66214. _applyElementsClipRect: _noop,
  66215. getColor: _noop,
  66216. areErrorBarsVisible: _noop,
  66217. drawLabelsWOPoints: function() {
  66218. var that = this;
  66219. if (that._options.label.position === INSIDE) {
  66220. return false
  66221. }
  66222. that._labelsGroup.append(that._extGroups.labelsGroup);
  66223. (that._points || []).forEach(function(point) {
  66224. point.drawLabel()
  66225. });
  66226. return true
  66227. },
  66228. getPointsCount: function() {
  66229. var _this = this;
  66230. return this._data.filter(function(d) {
  66231. return _this._checkData(d)
  66232. }).length
  66233. },
  66234. setMaxPointsCount: function(count) {
  66235. this._pointsCount = count
  66236. },
  66237. _getCreatingPointOptions: function(data, dataIndex) {
  66238. return this._getPointOptions(data, dataIndex)
  66239. },
  66240. _updateOptions: function(options) {
  66241. this.labelSpace = 0;
  66242. this.innerRadius = "pie" === this.type ? 0 : options.innerRadius
  66243. },
  66244. _checkData: function(data, skippedFields) {
  66245. var base = barSeries._checkData.call(this, data, skippedFields, {
  66246. value: this.getValueFields()[0]
  66247. });
  66248. return this._options.paintNullPoints ? base : base && null !== data.value
  66249. },
  66250. _createGroups: chartScatterSeries._createGroups,
  66251. _setMarkerGroupSettings: function() {
  66252. this._markersGroup.attr({
  66253. "class": "dxc-markers"
  66254. })
  66255. },
  66256. _getMainColor: function(data, point) {
  66257. var pointsByArg = this.getPointsByArg(data.argument);
  66258. var argumentIndex = point ? pointsByArg.indexOf(point) : pointsByArg.length;
  66259. return this._options.mainSeriesColor(data.argument, argumentIndex, this._pointsCount)
  66260. },
  66261. _getPointOptions: function(data) {
  66262. return this._parsePointOptions(this._preparePointOptions(), this._options.label, data)
  66263. },
  66264. _getRangeData: function() {
  66265. return this._rangeData
  66266. },
  66267. _createPointStyles: function(pointOptions, data, point) {
  66268. var that = this;
  66269. var mainColor = pointOptions.color || that._getMainColor(data, point);
  66270. return {
  66271. normal: that._parsePointStyle(pointOptions, mainColor, mainColor),
  66272. hover: that._parsePointStyle(pointOptions.hoverStyle, mainColor, mainColor),
  66273. selection: that._parsePointStyle(pointOptions.selectionStyle, mainColor, mainColor),
  66274. legendStyles: {
  66275. normal: that._createLegendState(pointOptions, mainColor),
  66276. hover: that._createLegendState(pointOptions.hoverStyle, mainColor),
  66277. selection: that._createLegendState(pointOptions.selectionStyle, mainColor)
  66278. }
  66279. }
  66280. },
  66281. _getArrangeMinShownValue: function(points, total) {
  66282. var minSegmentSize = this._options.minSegmentSize;
  66283. var totalMinSegmentSize = 0;
  66284. var totalNotMinValues = 0;
  66285. total = total || points.length;
  66286. _each(points, function(_, point) {
  66287. if (point.isVisible()) {
  66288. if (point.normalInitialValue < minSegmentSize * total / 360) {
  66289. totalMinSegmentSize += minSegmentSize
  66290. } else {
  66291. totalNotMinValues += point.normalInitialValue
  66292. }
  66293. }
  66294. });
  66295. return totalMinSegmentSize < 360 ? minSegmentSize * totalNotMinValues / (360 - totalMinSegmentSize) : 0
  66296. },
  66297. _applyArrangeCorrection: function(points, minShownValue, total) {
  66298. var options = this._options;
  66299. var isClockWise = "anticlockwise" !== options.segmentsDirection;
  66300. var shiftedAngle = _isFinite(options.startAngle) ? vizUtils.normalizeAngle(options.startAngle) : 0;
  66301. var minSegmentSize = options.minSegmentSize;
  66302. var percent;
  66303. var correction = 0;
  66304. var zeroTotalCorrection = 0;
  66305. if (0 === total) {
  66306. total = points.filter(function(el) {
  66307. return el.isVisible()
  66308. }).length;
  66309. zeroTotalCorrection = 1
  66310. }
  66311. _each(isClockWise ? points : points.concat([]).reverse(), function(_, point) {
  66312. var val = point.isVisible() ? zeroTotalCorrection || point.normalInitialValue : 0;
  66313. var updatedZeroValue;
  66314. if (minSegmentSize && point.isVisible() && val < minShownValue) {
  66315. updatedZeroValue = minShownValue
  66316. }
  66317. percent = val / total;
  66318. point.correctValue(correction, percent, zeroTotalCorrection + (updatedZeroValue || 0));
  66319. point.shiftedAngle = shiftedAngle;
  66320. correction += updatedZeroValue || val
  66321. });
  66322. this._rangeData = {
  66323. val: {
  66324. min: 0,
  66325. max: correction
  66326. }
  66327. }
  66328. },
  66329. _removePoint: function(point) {
  66330. var points = this.getPointsByArg(point.argument);
  66331. points.splice(points.indexOf(point), 1);
  66332. point.dispose()
  66333. },
  66334. arrangePoints: function() {
  66335. var that = this;
  66336. var originalPoints = that._points || [];
  66337. var minSegmentSize = that._options.minSegmentSize;
  66338. var minShownValue;
  66339. var isAllPointsNegative = true;
  66340. var i = 0;
  66341. var len = originalPoints.length;
  66342. while (i < len && isAllPointsNegative) {
  66343. isAllPointsNegative = originalPoints[i].value <= 0;
  66344. i++
  66345. }
  66346. var points = that._points = _map(originalPoints, function(point) {
  66347. if (null === point.value || !isAllPointsNegative && point.value < 0) {
  66348. that._removePoint(point);
  66349. return null
  66350. } else {
  66351. return point
  66352. }
  66353. });
  66354. var maxValue = points.reduce(function(max, p) {
  66355. return _max(max, Math.abs(p.initialValue))
  66356. }, 0);
  66357. points.forEach(function(p) {
  66358. p.normalInitialValue = p.initialValue / (0 !== maxValue ? maxValue : 1)
  66359. });
  66360. var total = points.reduce(function(total, point) {
  66361. return total + (point.isVisible() ? point.normalInitialValue : 0)
  66362. }, 0);
  66363. if (minSegmentSize) {
  66364. minShownValue = this._getArrangeMinShownValue(points, total)
  66365. }
  66366. that._applyArrangeCorrection(points, minShownValue, total)
  66367. },
  66368. correctPosition: function(correction, canvas) {
  66369. var debug = __webpack_require__( /*! ../../core/utils/console */ 73).debug;
  66370. debug.assert(correction, "correction was not passed");
  66371. debug.assertParam(correction.centerX, "correction.centerX was not passed");
  66372. debug.assertParam(correction.centerY, "correction.centerY was not passed");
  66373. debug.assertParam(correction.radiusInner, "correction.radiusInner was not passed");
  66374. debug.assertParam(correction.radiusOuter, "correction.radiusOuter was not passed");
  66375. debug.assertParam(canvas, "correction.canvas was not passed");
  66376. _each(this._points, function(_, point) {
  66377. point.correctPosition(correction)
  66378. });
  66379. this.setVisibleArea(canvas)
  66380. },
  66381. correctRadius: function(correction) {
  66382. this._points.forEach(function(point) {
  66383. point.correctRadius(correction)
  66384. })
  66385. },
  66386. correctLabelRadius: function(labelRadius) {
  66387. this._points.forEach(function(point) {
  66388. point.correctLabelRadius(labelRadius)
  66389. })
  66390. },
  66391. setVisibleArea: function(canvas) {
  66392. this._visibleArea = {
  66393. minX: canvas.left,
  66394. maxX: canvas.width - canvas.right,
  66395. minY: canvas.top,
  66396. maxY: canvas.height - canvas.bottom
  66397. }
  66398. },
  66399. _applyVisibleArea: _noop,
  66400. _animate: function(firstDrawing) {
  66401. var that = this;
  66402. var points = that._points;
  66403. var pointsCount = points && points.length;
  66404. var completeFunc = function() {
  66405. that._animateComplete()
  66406. };
  66407. var animatePoint;
  66408. if (firstDrawing) {
  66409. animatePoint = function(p, i) {
  66410. p.animate(i === pointsCount - 1 ? completeFunc : void 0, ANIMATION_DURATION, (1 - ANIMATION_DURATION) * i / (pointsCount - 1))
  66411. }
  66412. } else {
  66413. animatePoint = function(p, i) {
  66414. p.animate(i === pointsCount - 1 ? completeFunc : void 0)
  66415. }
  66416. }
  66417. points.forEach(animatePoint)
  66418. },
  66419. getVisiblePoints: function() {
  66420. return _map(this._points, function(p) {
  66421. return p.isVisible() ? p : null
  66422. })
  66423. },
  66424. getPointsByKeys: function(arg, argumentIndex) {
  66425. var pointsByArg = this.getPointsByArg(arg);
  66426. return pointsByArg[argumentIndex] && [pointsByArg[argumentIndex]] || []
  66427. }
  66428. });
  66429. exports.doughnut = exports.donut = exports.pie
  66430. },
  66431. /*!*************************************************************!*\
  66432. !*** ./artifacts/transpiled/viz/series/financial_series.js ***!
  66433. \*************************************************************/
  66434. /*! dynamic exports provided */
  66435. /*! all exports used */
  66436. function(module, exports, __webpack_require__) {
  66437. var scatterSeries = __webpack_require__( /*! ./scatter_series */ 106).chart;
  66438. var barSeries = __webpack_require__( /*! ./bar_series */ 143).chart.bar;
  66439. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  66440. var _isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  66441. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  66442. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  66443. var DEFAULT_FINANCIAL_POINT_SIZE = 10;
  66444. exports.stock = _extend({}, scatterSeries, {
  66445. _animate: _noop,
  66446. _applyMarkerClipRect: function(settings) {
  66447. settings["clip-path"] = this._forceClipping ? this._paneClipRectID : this._widePaneClipRectID
  66448. },
  66449. _updatePointsVisibility: barSeries._updatePointsVisibility,
  66450. _getOptionsForPoint: barSeries._getOptionsForPoint,
  66451. _createErrorBarGroup: _noop,
  66452. areErrorBarsVisible: _noop,
  66453. _createGroups: scatterSeries._createGroups,
  66454. _setMarkerGroupSettings: function() {
  66455. var that = this;
  66456. var markersGroup = that._markersGroup;
  66457. var styles = that._createPointStyles(that._getMarkerGroupOptions());
  66458. var defaultStyle = _extend(styles.normal, {
  66459. "class": "default-markers"
  66460. });
  66461. var defaultPositiveStyle = _extend(styles.positive.normal, {
  66462. "class": "default-positive-markers"
  66463. });
  66464. var reductionStyle = _extend(styles.reduction.normal, {
  66465. "class": "reduction-markers"
  66466. });
  66467. var reductionPositiveStyle = _extend(styles.reductionPositive.normal, {
  66468. "class": "reduction-positive-markers"
  66469. });
  66470. var markerSettings = {
  66471. "class": "dxc-markers"
  66472. };
  66473. that._applyMarkerClipRect(markerSettings);
  66474. markersGroup.attr(markerSettings);
  66475. that._createGroup("defaultMarkersGroup", markersGroup, markersGroup, defaultStyle);
  66476. that._createGroup("reductionMarkersGroup", markersGroup, markersGroup, reductionStyle);
  66477. that._createGroup("defaultPositiveMarkersGroup", markersGroup, markersGroup, defaultPositiveStyle);
  66478. that._createGroup("reductionPositiveMarkersGroup", markersGroup, markersGroup, reductionPositiveStyle)
  66479. },
  66480. _setGroupsSettings: function() {
  66481. scatterSeries._setGroupsSettings.call(this, false)
  66482. },
  66483. _getCreatingPointOptions: function() {
  66484. var that = this;
  66485. var defaultPointOptions;
  66486. var creatingPointOptions = that._predefinedPointOptions;
  66487. if (!creatingPointOptions) {
  66488. defaultPointOptions = this._getPointOptions();
  66489. that._predefinedPointOptions = creatingPointOptions = _extend(true, {
  66490. styles: {}
  66491. }, defaultPointOptions);
  66492. creatingPointOptions.styles.normal = creatingPointOptions.styles.positive.normal = creatingPointOptions.styles.reduction.normal = creatingPointOptions.styles.reductionPositive.normal = {
  66493. "stroke-width": defaultPointOptions.styles && defaultPointOptions.styles.normal && defaultPointOptions.styles.normal["stroke-width"]
  66494. }
  66495. }
  66496. return creatingPointOptions
  66497. },
  66498. _checkData: function(data, skippedFields) {
  66499. var valueFields = this.getValueFields();
  66500. return scatterSeries._checkData.call(this, data, skippedFields, {
  66501. openValue: valueFields[0],
  66502. highValue: valueFields[1],
  66503. lowValue: valueFields[2],
  66504. closeValue: valueFields[3]
  66505. }) && data.highValue === data.highValue && data.lowValue === data.lowValue
  66506. },
  66507. _getPointDataSelector: function(data, options) {
  66508. var _this = this;
  66509. var that = this;
  66510. var level;
  66511. var valueFields = that.getValueFields();
  66512. var argumentField = that.getArgumentField();
  66513. var openValueField = valueFields[0];
  66514. var highValueField = valueFields[1];
  66515. var lowValueField = valueFields[2];
  66516. var closeValueField = valueFields[3];
  66517. that.level = that._options.reduction.level;
  66518. switch (_normalizeEnum(that.level)) {
  66519. case "open":
  66520. level = openValueField;
  66521. break;
  66522. case "high":
  66523. level = highValueField;
  66524. break;
  66525. case "low":
  66526. level = lowValueField;
  66527. break;
  66528. default:
  66529. level = closeValueField;
  66530. that.level = "close"
  66531. }
  66532. var prevLevelValue;
  66533. return function(data) {
  66534. var reductionValue = data[level];
  66535. var isReduction = false;
  66536. if (_isDefined(reductionValue)) {
  66537. if (_isDefined(prevLevelValue)) {
  66538. isReduction = reductionValue < prevLevelValue
  66539. }
  66540. prevLevelValue = reductionValue
  66541. }
  66542. return {
  66543. argument: data[argumentField],
  66544. highValue: _this._processEmptyValue(data[highValueField]),
  66545. lowValue: _this._processEmptyValue(data[lowValueField]),
  66546. closeValue: _this._processEmptyValue(data[closeValueField]),
  66547. openValue: _this._processEmptyValue(data[openValueField]),
  66548. reductionValue: reductionValue,
  66549. tag: data[that.getTagField()],
  66550. isReduction: isReduction,
  66551. data: data
  66552. }
  66553. }
  66554. },
  66555. _parsePointStyle: function(style, defaultColor, innerColor) {
  66556. return {
  66557. stroke: style.color || defaultColor,
  66558. "stroke-width": style.width,
  66559. fill: style.color || innerColor
  66560. }
  66561. },
  66562. _getDefaultStyle: function(options) {
  66563. var that = this;
  66564. var mainPointColor = options.color || that._options.mainSeriesColor;
  66565. return {
  66566. normal: that._parsePointStyle(options, mainPointColor, mainPointColor),
  66567. hover: that._parsePointStyle(options.hoverStyle, mainPointColor, mainPointColor),
  66568. selection: that._parsePointStyle(options.selectionStyle, mainPointColor, mainPointColor)
  66569. }
  66570. },
  66571. _getReductionStyle: function(options) {
  66572. var that = this;
  66573. var reductionColor = options.reduction.color;
  66574. return {
  66575. normal: that._parsePointStyle({
  66576. color: reductionColor,
  66577. width: options.width,
  66578. hatching: options.hatching
  66579. }, reductionColor, reductionColor),
  66580. hover: that._parsePointStyle(options.hoverStyle, reductionColor, reductionColor),
  66581. selection: that._parsePointStyle(options.selectionStyle, reductionColor, reductionColor)
  66582. }
  66583. },
  66584. _createPointStyles: function(pointOptions) {
  66585. var that = this;
  66586. var innerColor = that._options.innerColor;
  66587. var styles = that._getDefaultStyle(pointOptions);
  66588. var positiveStyle = _extend(true, {}, styles);
  66589. var reductionStyle = that._getReductionStyle(pointOptions);
  66590. var reductionPositiveStyle = _extend(true, {}, reductionStyle);
  66591. positiveStyle.normal.fill = positiveStyle.hover.fill = positiveStyle.selection.fill = innerColor;
  66592. reductionPositiveStyle.normal.fill = reductionPositiveStyle.hover.fill = reductionPositiveStyle.selection.fill = innerColor;
  66593. styles.positive = positiveStyle;
  66594. styles.reduction = reductionStyle;
  66595. styles.reductionPositive = reductionPositiveStyle;
  66596. return styles
  66597. },
  66598. _endUpdateData: function() {
  66599. delete this._predefinedPointOptions
  66600. },
  66601. _defaultAggregator: "ohlc",
  66602. _aggregators: {
  66603. ohlc: function(_ref, series) {
  66604. var intervalStart = _ref.intervalStart,
  66605. data = _ref.data;
  66606. if (!data.length) {
  66607. return
  66608. }
  66609. var result = {};
  66610. var valueFields = series.getValueFields();
  66611. var highValueField = valueFields[1];
  66612. var lowValueField = valueFields[2];
  66613. result[highValueField] = -(1 / 0);
  66614. result[lowValueField] = 1 / 0;
  66615. result = data.reduce(function(result, item) {
  66616. if (null !== item[highValueField]) {
  66617. result[highValueField] = Math.max(result[highValueField], item[highValueField])
  66618. }
  66619. if (null !== item[lowValueField]) {
  66620. result[lowValueField] = Math.min(result[lowValueField], item[lowValueField])
  66621. }
  66622. return result
  66623. }, result);
  66624. result[valueFields[0]] = data[0][valueFields[0]];
  66625. result[valueFields[3]] = data[data.length - 1][valueFields[3]];
  66626. if (!isFinite(result[highValueField])) {
  66627. result[highValueField] = null
  66628. }
  66629. if (!isFinite(result[lowValueField])) {
  66630. result[lowValueField] = null
  66631. }
  66632. result[series.getArgumentField()] = intervalStart;
  66633. return result
  66634. }
  66635. },
  66636. getValueFields: function() {
  66637. var options = this._options;
  66638. return [options.openValueField || "open", options.highValueField || "high", options.lowValueField || "low", options.closeValueField || "close"]
  66639. },
  66640. getArgumentField: function() {
  66641. return this._options.argumentField || "date"
  66642. },
  66643. _patchMarginOptions: function(options) {
  66644. var pointOptions = this._getCreatingPointOptions();
  66645. var styles = pointOptions.styles;
  66646. var border = [styles.normal, styles.hover, styles.selection].reduce(function(max, style) {
  66647. return Math.max(max, style["stroke-width"])
  66648. }, 0);
  66649. options.size = DEFAULT_FINANCIAL_POINT_SIZE + border;
  66650. options.sizePointNormalState = DEFAULT_FINANCIAL_POINT_SIZE;
  66651. return options
  66652. },
  66653. getSeriesPairCoord: function(coord, isArgument) {
  66654. var oppositeCoord = null;
  66655. var points = this.getVisiblePoints();
  66656. for (var i = 0; i < points.length; i++) {
  66657. var p = points[i];
  66658. var tmpCoord = void 0;
  66659. if (isArgument) {
  66660. tmpCoord = p.vx === coord ? (p.openY + p.closeY) / 2 : void 0
  66661. } else {
  66662. var coords = [Math.min(p.lowY, p.highY), Math.max(p.lowY, p.highY)];
  66663. tmpCoord = coord >= coords[0] && coord <= coords[1] ? p.vx : void 0
  66664. }
  66665. if (this.checkAxisVisibleAreaCoord(!isArgument, tmpCoord)) {
  66666. oppositeCoord = tmpCoord;
  66667. break
  66668. }
  66669. }
  66670. return oppositeCoord
  66671. },
  66672. usePointsToDefineAutoHiding: function() {
  66673. return false
  66674. }
  66675. });
  66676. exports.candlestick = _extend({}, exports.stock, {
  66677. _parsePointStyle: function(style, defaultColor, innerColor) {
  66678. var color = style.color || innerColor;
  66679. var base = exports.stock._parsePointStyle.call(this, style, defaultColor, color);
  66680. base.fill = color;
  66681. base.hatching = style.hatching;
  66682. return base
  66683. }
  66684. })
  66685. },
  66686. /*!***********************************************************!*\
  66687. !*** ./artifacts/transpiled/viz/series/stacked_series.js ***!
  66688. \***********************************************************/
  66689. /*! dynamic exports provided */
  66690. /*! all exports used */
  66691. function(module, exports, __webpack_require__) {
  66692. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  66693. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  66694. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  66695. var areaSeries = __webpack_require__( /*! ./area_series */ 165).chart;
  66696. var chartAreaSeries = areaSeries.area;
  66697. var barSeries = __webpack_require__( /*! ./bar_series */ 143);
  66698. var chartBarSeries = barSeries.chart.bar;
  66699. var lineSeries = __webpack_require__( /*! ./line_series */ 203).chart;
  66700. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  66701. var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
  66702. var baseStackedSeries = {
  66703. _calculateErrorBars: _noop,
  66704. _updateOptions: function(options) {
  66705. this._stackName = "axis_" + (options.axis || "default")
  66706. }
  66707. };
  66708. exports.chart = {};
  66709. exports.polar = {};
  66710. exports.chart.stackedline = _extend({}, lineSeries.line, baseStackedSeries, {});
  66711. exports.chart.stackedspline = _extend({}, lineSeries.spline, baseStackedSeries, {});
  66712. exports.chart.fullstackedline = _extend({}, lineSeries.line, baseStackedSeries, {
  66713. getValueRangeInitialValue: areaSeries.area.getValueRangeInitialValue
  66714. });
  66715. exports.chart.fullstackedspline = _extend({}, lineSeries.spline, baseStackedSeries, {
  66716. getValueRangeInitialValue: areaSeries.area.getValueRangeInitialValue
  66717. });
  66718. var stackedBar = exports.chart.stackedbar = _extend({}, chartBarSeries, baseStackedSeries, {
  66719. _updateOptions: function(options) {
  66720. baseStackedSeries._updateOptions.call(this, options);
  66721. this._stackName = this._stackName + "_stack_" + (options.stack || "default")
  66722. }
  66723. });
  66724. exports.chart.fullstackedbar = _extend({}, chartBarSeries, baseStackedSeries, {
  66725. _updateOptions: stackedBar._updateOptions
  66726. });
  66727. function clonePoint(point, value, minValue, position) {
  66728. point = objectUtils.clone(point);
  66729. point.value = value;
  66730. point.minValue = minValue;
  66731. point.translate();
  66732. point.argument = point.argument + position;
  66733. return point
  66734. }
  66735. function preparePointsForStackedAreaSegment(points) {
  66736. var i = 0;
  66737. var p;
  66738. var result = [];
  66739. var array;
  66740. var len = points.length;
  66741. while (i < len) {
  66742. p = points[i];
  66743. array = [p];
  66744. if (p.leftHole) {
  66745. array = [clonePoint(p, p.leftHole, p.minLeftHole, "left"), p]
  66746. }
  66747. if (p.rightHole) {
  66748. array.push(clonePoint(p, p.rightHole, p.minRightHole, "right"))
  66749. }
  66750. result.push(array);
  66751. i++
  66752. }
  66753. return [].concat.apply([], result)
  66754. }
  66755. exports.chart.stackedarea = _extend({}, chartAreaSeries, baseStackedSeries, {
  66756. _prepareSegment: function(points, rotated) {
  66757. return chartAreaSeries._prepareSegment.call(this, preparePointsForStackedAreaSegment(points), rotated)
  66758. },
  66759. _appendInGroup: function() {
  66760. this._group.append(this._extGroups.seriesGroup).toBackground()
  66761. }
  66762. });
  66763. function getPointsByArgFromPrevSeries(prevSeries, argument) {
  66764. var result;
  66765. while (!result && prevSeries) {
  66766. result = prevSeries._segmentByArg && prevSeries._segmentByArg[argument];
  66767. prevSeries = prevSeries._prevSeries
  66768. }
  66769. return result
  66770. }
  66771. exports.chart.stackedsplinearea = _extend({}, areaSeries.splinearea, baseStackedSeries, {
  66772. _prepareSegment: function(points, rotated) {
  66773. var that = this;
  66774. var areaSegment;
  66775. points = preparePointsForStackedAreaSegment(points);
  66776. if (!this._prevSeries || 1 === points.length) {
  66777. areaSegment = areaSeries.splinearea._prepareSegment.call(this, points, rotated)
  66778. } else {
  66779. var forwardPoints = lineSeries.spline._calculateBezierPoints(points, rotated);
  66780. var backwardPoints = vizUtils.map(points, function(p) {
  66781. var point = p.getCoords(true);
  66782. point.argument = p.argument;
  66783. return point
  66784. });
  66785. var prevSeriesForwardPoints = [];
  66786. var pointByArg = {};
  66787. var i = 0;
  66788. var len = that._prevSeries._segments.length;
  66789. while (i < len) {
  66790. prevSeriesForwardPoints = prevSeriesForwardPoints.concat(that._prevSeries._segments[i].line);
  66791. i++
  66792. }
  66793. each(prevSeriesForwardPoints, function(_, p) {
  66794. if (null !== p.argument) {
  66795. var argument = p.argument.valueOf();
  66796. if (!pointByArg[argument]) {
  66797. pointByArg[argument] = [p]
  66798. } else {
  66799. pointByArg[argument].push(p)
  66800. }
  66801. }
  66802. });
  66803. that._prevSeries._segmentByArg = pointByArg;
  66804. backwardPoints = lineSeries.spline._calculateBezierPoints(backwardPoints, rotated);
  66805. each(backwardPoints, function(i, p) {
  66806. var argument = p.argument.valueOf();
  66807. var prevSeriesPoints;
  66808. if (i % 3 === 0) {
  66809. prevSeriesPoints = pointByArg[argument] || getPointsByArgFromPrevSeries(that._prevSeries, argument);
  66810. if (prevSeriesPoints) {
  66811. backwardPoints[i - 1] && prevSeriesPoints[0] && (backwardPoints[i - 1] = prevSeriesPoints[0]);
  66812. backwardPoints[i + 1] && (backwardPoints[i + 1] = prevSeriesPoints[2] || p)
  66813. }
  66814. }
  66815. });
  66816. areaSegment = {
  66817. line: forwardPoints,
  66818. area: forwardPoints.concat(backwardPoints.reverse())
  66819. };
  66820. that._areaPointsToSplineAreaPoints(areaSegment.area)
  66821. }
  66822. return areaSegment
  66823. },
  66824. _appendInGroup: exports.chart.stackedarea._appendInGroup
  66825. });
  66826. exports.chart.fullstackedarea = _extend({}, chartAreaSeries, baseStackedSeries, {
  66827. _prepareSegment: exports.chart.stackedarea._prepareSegment,
  66828. _appendInGroup: exports.chart.stackedarea._appendInGroup
  66829. });
  66830. exports.chart.fullstackedsplinearea = _extend({}, areaSeries.splinearea, baseStackedSeries, {
  66831. _prepareSegment: exports.chart.stackedsplinearea._prepareSegment,
  66832. _appendInGroup: exports.chart.stackedarea._appendInGroup
  66833. });
  66834. exports.polar.stackedbar = _extend({}, barSeries.polar.bar, baseStackedSeries, {})
  66835. },
  66836. /*!**************************************************************!*\
  66837. !*** ./artifacts/transpiled/viz/chart_components/tracker.js ***!
  66838. \**************************************************************/
  66839. /*! dynamic exports provided */
  66840. /*! all exports used */
  66841. function(module, exports, __webpack_require__) {
  66842. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  66843. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  66844. var clickEvent = __webpack_require__( /*! ../../events/click */ 19);
  66845. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  66846. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  66847. var consts = __webpack_require__( /*! ../components/consts */ 117);
  66848. var eventsConsts = consts.events;
  66849. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  66850. var pointerEvents = __webpack_require__( /*! ../../events/pointer */ 23);
  66851. var holdEvent = __webpack_require__( /*! ../../events/hold */ 88);
  66852. var addNamespace = __webpack_require__( /*! ../../events/utils */ 8).addNamespace;
  66853. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  66854. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  66855. var _floor = Math.floor;
  66856. var _each = each;
  66857. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  66858. var HOVER_STATE = consts.states.hoverMark;
  66859. var NORMAL_STATE = consts.states.normalMark;
  66860. var EVENT_NS = "dxChartTracker";
  66861. var DOT_EVENT_NS = "." + EVENT_NS;
  66862. var POINTER_ACTION = addNamespace([pointerEvents.down, pointerEvents.move], EVENT_NS);
  66863. var LEGEND_CLICK = "legendClick";
  66864. var SERIES_CLICK = "seriesClick";
  66865. var POINT_CLICK = "pointClick";
  66866. var POINT_DATA = "chart-data-point";
  66867. var SERIES_DATA = "chart-data-series";
  66868. var ARG_DATA = "chart-data-argument";
  66869. var DELAY = 100;
  66870. var NONE_MODE = "none";
  66871. var ALL_ARGUMENT_POINTS_MODE = "allargumentpoints";
  66872. var INCLUDE_POINTS_MODE = "includepoints";
  66873. var EXLUDE_POINTS_MODE = "excludepoints";
  66874. var LEGEND_HOVER_MODES = [INCLUDE_POINTS_MODE, EXLUDE_POINTS_MODE, NONE_MODE];
  66875. function getData(event, dataKey) {
  66876. var target = event.target;
  66877. return ("tspan" === target.tagName ? target.parentNode : target)[dataKey]
  66878. }
  66879. function eventCanceled(event, target) {
  66880. return event.cancel || !target.getOptions()
  66881. }
  66882. function inCanvas(canvas, x, y) {
  66883. return x >= canvas.left && x <= canvas.right && y >= canvas.top && y <= canvas.bottom
  66884. }
  66885. function correctLegendHoverMode(mode) {
  66886. if (LEGEND_HOVER_MODES.indexOf(mode) > -1) {
  66887. return mode
  66888. } else {
  66889. return INCLUDE_POINTS_MODE
  66890. }
  66891. }
  66892. function correctHoverMode(target) {
  66893. var mode = target.getOptions().hoverMode;
  66894. return mode === NONE_MODE ? mode : ALL_ARGUMENT_POINTS_MODE
  66895. }
  66896. var baseTrackerPrototype = {
  66897. ctor: function(options) {
  66898. var that = this;
  66899. var data = {
  66900. tracker: that
  66901. };
  66902. that._renderer = options.renderer;
  66903. that._legend = options.legend;
  66904. that._tooltip = options.tooltip;
  66905. that._eventTrigger = options.eventTrigger;
  66906. that._seriesGroup = options.seriesGroup;
  66907. options.seriesGroup.off(DOT_EVENT_NS).on(addNamespace(eventsConsts.showPointTooltip, EVENT_NS), data, that._showPointTooltip).on(addNamespace(eventsConsts.hidePointTooltip, EVENT_NS), data, that._hidePointTooltip);
  66908. that._renderer.root.off(DOT_EVENT_NS).on(POINTER_ACTION, data, that._pointerHandler).on(addNamespace(clickEvent.name, EVENT_NS), data, that._clickHandler).on(addNamespace(holdEvent.name, EVENT_NS), {
  66909. timeout: 300
  66910. }, _noop)
  66911. },
  66912. update: function() {},
  66913. updateSeries: function(series, resetDecorations) {
  66914. var that = this;
  66915. var noHoveredSeries = !(series && series.some(function(s) {
  66916. return s === that.hoveredSeries
  66917. }) || that._hoveredPoint && that._hoveredPoint.series);
  66918. if (that._storedSeries !== series) {
  66919. that._storedSeries = series || []
  66920. }
  66921. if (noHoveredSeries) {
  66922. that._clean();
  66923. that._renderer.initHatching()
  66924. }
  66925. if (resetDecorations) {
  66926. that.clearSelection();
  66927. if (!noHoveredSeries) {
  66928. that._hideTooltip(that.pointAtShownTooltip);
  66929. that.clearHover()
  66930. }
  66931. }
  66932. },
  66933. setCanvases: function(mainCanvas, paneCanvases) {
  66934. this._mainCanvas = mainCanvas;
  66935. this._canvases = paneCanvases
  66936. },
  66937. repairTooltip: function() {
  66938. var point = this.pointAtShownTooltip;
  66939. if (!point || !point.series || !point.isVisible()) {
  66940. this._hideTooltip(point, true)
  66941. } else {
  66942. this._showTooltip(point)
  66943. }
  66944. },
  66945. _setHoveredPoint: function(point) {
  66946. if (point === this._hoveredPoint) {
  66947. return
  66948. }
  66949. this._releaseHoveredPoint();
  66950. point.hover();
  66951. this._hoveredPoint = point
  66952. },
  66953. _releaseHoveredPoint: function() {
  66954. if (this._hoveredPoint && this._hoveredPoint.getOptions()) {
  66955. this._hoveredPoint.clearHover();
  66956. this._hoveredPoint = null;
  66957. if (this._tooltip.isEnabled()) {
  66958. this._hideTooltip(this._hoveredPoint)
  66959. }
  66960. }
  66961. },
  66962. _setHoveredSeries: function(series, mode) {
  66963. this._releaseHoveredSeries();
  66964. this._releaseHoveredPoint();
  66965. series.hover(mode);
  66966. this.hoveredSeries = series
  66967. },
  66968. _releaseHoveredSeries: function(needSetHoverView, hoveredPoint) {
  66969. if (this.hoveredSeries) {
  66970. this.hoveredSeries.clearHover();
  66971. this.hoveredSeries = null
  66972. }
  66973. },
  66974. clearSelection: function() {
  66975. this._storedSeries.forEach(function(series) {
  66976. if (series) {
  66977. series.clearSelection();
  66978. series.getPoints().forEach(function(point) {
  66979. point.clearSelection()
  66980. })
  66981. }
  66982. })
  66983. },
  66984. _clean: function() {
  66985. var that = this;
  66986. that.hoveredPoint = that.hoveredSeries = that._hoveredArgumentPoints = null;
  66987. that._hideTooltip(that.pointAtShownTooltip)
  66988. },
  66989. clearHover: function() {
  66990. this._resetHoveredArgument();
  66991. this._releaseHoveredSeries();
  66992. this._releaseHoveredPoint()
  66993. },
  66994. _hideTooltip: function(point, silent) {
  66995. var that = this;
  66996. if (!that._tooltip || point && that.pointAtShownTooltip !== point) {
  66997. return
  66998. }
  66999. if (!silent && that.pointAtShownTooltip) {
  67000. that.pointAtShownTooltip = null
  67001. }
  67002. that._tooltip.hide()
  67003. },
  67004. _showTooltip: function(point) {
  67005. var that = this;
  67006. var tooltipFormatObject;
  67007. var eventData;
  67008. if (point && point.getOptions()) {
  67009. tooltipFormatObject = point.getTooltipFormatObject(that._tooltip);
  67010. if (!isDefined(tooltipFormatObject.valueText) && !tooltipFormatObject.points || !point.isVisible()) {
  67011. return
  67012. }
  67013. if (!that.pointAtShownTooltip || that.pointAtShownTooltip !== point) {
  67014. eventData = {
  67015. target: point
  67016. }
  67017. }
  67018. var coords = point.getTooltipParams(that._tooltip.getLocation());
  67019. var rootOffset = that._renderer.getRootOffset();
  67020. coords.x += rootOffset.left;
  67021. coords.y += rootOffset.top;
  67022. if (!that._tooltip.show(tooltipFormatObject, coords, eventData)) {
  67023. return
  67024. }
  67025. that.pointAtShownTooltip = point
  67026. }
  67027. },
  67028. _showPointTooltip: function(event, point) {
  67029. var that = event.data.tracker;
  67030. var pointWithTooltip = that.pointAtShownTooltip;
  67031. if (pointWithTooltip && pointWithTooltip !== point) {
  67032. that._hideTooltip(pointWithTooltip)
  67033. }
  67034. that._showTooltip(point)
  67035. },
  67036. _hidePointTooltip: function(event, point) {
  67037. event.data.tracker._hideTooltip(point)
  67038. },
  67039. _enableOutHandler: function() {
  67040. if (this._outHandler) {
  67041. return
  67042. }
  67043. var that = this;
  67044. var handler = function(e) {
  67045. var rootOffset = that._renderer.getRootOffset();
  67046. var x = _floor(e.pageX - rootOffset.left);
  67047. var y = _floor(e.pageY - rootOffset.top);
  67048. if (!inCanvas(that._mainCanvas, x, y)) {
  67049. that._pointerOut();
  67050. that._disableOutHandler()
  67051. }
  67052. };
  67053. eventsEngine.on(domAdapter.getDocument(), POINTER_ACTION, handler);
  67054. this._outHandler = handler
  67055. },
  67056. _disableOutHandler: function() {
  67057. this._outHandler && eventsEngine.off(domAdapter.getDocument(), POINTER_ACTION, this._outHandler);
  67058. this._outHandler = null
  67059. },
  67060. stopCurrentHandling: function() {
  67061. this._pointerOut(true)
  67062. },
  67063. _pointerOut: function(force) {
  67064. this.clearHover();
  67065. (force || this._tooltip.isEnabled()) && this._hideTooltip(this.pointAtShownTooltip)
  67066. },
  67067. _triggerLegendClick: function(eventArgs, elementClick) {
  67068. var eventTrigger = this._eventTrigger;
  67069. eventTrigger(LEGEND_CLICK, eventArgs, function() {
  67070. !eventCanceled(eventArgs.event, eventArgs.target) && eventTrigger(elementClick, eventArgs)
  67071. })
  67072. },
  67073. _hoverLegendItem: function(x, y) {
  67074. var that = this;
  67075. var item = that._legend.getItemByCoord(x, y);
  67076. var series;
  67077. var legendHoverMode = correctLegendHoverMode(that._legend.getOptions().hoverMode);
  67078. if (item) {
  67079. series = that._storedSeries[item.id];
  67080. if (!series.isHovered() || series.lastHoverMode !== legendHoverMode) {
  67081. that._setHoveredSeries(series, legendHoverMode)
  67082. }
  67083. that._tooltip.isEnabled() && that._hideTooltip(that.pointAtShownTooltip)
  67084. } else {
  67085. that.clearHover()
  67086. }
  67087. },
  67088. _hoverArgument: function(argument, argumentIndex) {
  67089. var that = this;
  67090. var hoverMode = that._getArgumentHoverMode();
  67091. if (isDefined(argument)) {
  67092. that._releaseHoveredPoint();
  67093. that._hoveredArgument = argument;
  67094. that._argumentIndex = argumentIndex;
  67095. that._notifySeries({
  67096. action: "pointHover",
  67097. notifyLegend: that._notifyLegendOnHoverArgument,
  67098. target: {
  67099. argument: argument,
  67100. fullState: HOVER_STATE,
  67101. argumentIndex: argumentIndex,
  67102. getOptions: function() {
  67103. return {
  67104. hoverMode: hoverMode
  67105. }
  67106. }
  67107. }
  67108. })
  67109. }
  67110. },
  67111. _resetHoveredArgument: function() {
  67112. var that = this;
  67113. var hoverMode;
  67114. if (isDefined(that._hoveredArgument)) {
  67115. hoverMode = that._getArgumentHoverMode();
  67116. that._notifySeries({
  67117. action: "clearPointHover",
  67118. notifyLegend: that._notifyLegendOnHoverArgument,
  67119. target: {
  67120. fullState: NORMAL_STATE,
  67121. argumentIndex: that._argumentIndex,
  67122. argument: that._hoveredArgument,
  67123. getOptions: function() {
  67124. return {
  67125. hoverMode: hoverMode
  67126. }
  67127. }
  67128. }
  67129. });
  67130. that._hoveredArgument = null
  67131. }
  67132. },
  67133. _notifySeries: function(data) {
  67134. this._storedSeries.forEach(function(series) {
  67135. series.notify(data)
  67136. })
  67137. },
  67138. _pointerHandler: function(e) {
  67139. var that = e.data.tracker;
  67140. var rootOffset = that._renderer.getRootOffset();
  67141. var x = _floor(e.pageX - rootOffset.left);
  67142. var y = _floor(e.pageY - rootOffset.top);
  67143. var canvas = that._getCanvas(x, y);
  67144. var series = getData(e, SERIES_DATA);
  67145. var point = getData(e, POINT_DATA) || series && series.getPointByCoord(x, y);
  67146. if (point && !point.getMarkerVisibility()) {
  67147. point = void 0
  67148. }
  67149. that._enableOutHandler();
  67150. if (that._legend.coordsIn(x, y)) {
  67151. that._hoverLegendItem(x, y);
  67152. return
  67153. }
  67154. if (that.hoveredSeries && that.hoveredSeries !== that._stuckSeries) {
  67155. that._releaseHoveredSeries()
  67156. }
  67157. if (that._hoverArgumentAxis(x, y, e)) {
  67158. return
  67159. }
  67160. if (that._isPointerOut(canvas, point)) {
  67161. that._pointerOut()
  67162. }
  67163. if (!canvas && !point) {
  67164. return
  67165. }
  67166. if (series && !point) {
  67167. point = series.getNeighborPoint(x, y);
  67168. if (!that._stickyHovering && point && !point.coordsIn(x, y)) {
  67169. point = null
  67170. }
  67171. if (series !== that.hoveredSeries) {
  67172. that._setTimeout(function() {
  67173. that._setHoveredSeries(series);
  67174. that._setStuckSeries(e, series, x, y);
  67175. that._pointerComplete(point, x, y)
  67176. }, series);
  67177. return
  67178. }
  67179. } else {
  67180. if (point) {
  67181. if (e.type !== pointerEvents.move && "touch" !== e.pointerType) {
  67182. return
  67183. }
  67184. if (that.hoveredSeries) {
  67185. that._setTimeout(function() {
  67186. that._pointerOnPoint(point, x, y, e)
  67187. }, point)
  67188. } else {
  67189. that._pointerOnPoint(point, x, y, e)
  67190. }
  67191. return
  67192. } else {
  67193. if (that._setStuckSeries(e, void 0, x, y) && that._stickyHovering) {
  67194. series = that._stuckSeries;
  67195. point = series.getNeighborPoint(x, y);
  67196. that._releaseHoveredSeries();
  67197. point && point.getMarkerVisibility() && that._setHoveredPoint(point)
  67198. } else {
  67199. if (!that._stickyHovering) {
  67200. that._pointerOut()
  67201. }
  67202. }
  67203. }
  67204. }
  67205. that._pointerComplete(point, x, y)
  67206. },
  67207. _pointerOnPoint: function(point, x, y) {
  67208. this._resetHoveredArgument();
  67209. this._setHoveredPoint(point);
  67210. this._pointerComplete(point, x, y)
  67211. },
  67212. _pointerComplete: function(point) {
  67213. this.pointAtShownTooltip !== point && this._tooltip.isEnabled() && this._showTooltip(point)
  67214. },
  67215. _clickHandler: function(e) {
  67216. var that = e.data.tracker;
  67217. var rootOffset = that._renderer.getRootOffset();
  67218. var x = _floor(e.pageX - rootOffset.left);
  67219. var y = _floor(e.pageY - rootOffset.top);
  67220. var point = getData(e, POINT_DATA);
  67221. var series = that._stuckSeries || getData(e, SERIES_DATA) || point && point.series;
  67222. var axis = that._argumentAxis;
  67223. if (that._legend.coordsIn(x, y)) {
  67224. var item = that._legend.getItemByCoord(x, y);
  67225. if (item) {
  67226. that._legendClick(item, e)
  67227. }
  67228. } else {
  67229. if (axis && axis.coordsIn(x, y)) {
  67230. var argument = getData(e, ARG_DATA);
  67231. if (isDefined(argument)) {
  67232. that._eventTrigger("argumentAxisClick", {
  67233. argument: argument,
  67234. event: e
  67235. })
  67236. }
  67237. } else {
  67238. if (series) {
  67239. point = point || series.getPointByCoord(x, y);
  67240. if (point && point.getMarkerVisibility()) {
  67241. that._pointClick(point, e)
  67242. } else {
  67243. getData(e, SERIES_DATA) && that._eventTrigger(SERIES_CLICK, {
  67244. target: series,
  67245. event: e
  67246. })
  67247. }
  67248. }
  67249. }
  67250. }
  67251. },
  67252. dispose: function() {
  67253. var that = this;
  67254. that._disableOutHandler();
  67255. that._renderer.root.off(DOT_EVENT_NS);
  67256. that._seriesGroup.off(DOT_EVENT_NS)
  67257. }
  67258. };
  67259. var ChartTracker = function(options) {
  67260. this.ctor(options)
  67261. };
  67262. extend(ChartTracker.prototype, baseTrackerPrototype, {
  67263. _pointClick: function(point, event) {
  67264. var that = this;
  67265. var eventTrigger = that._eventTrigger;
  67266. var series = point.series;
  67267. eventTrigger(POINT_CLICK, {
  67268. target: point,
  67269. event: event
  67270. }, function() {
  67271. !eventCanceled(event, series) && eventTrigger(SERIES_CLICK, {
  67272. target: series,
  67273. event: event
  67274. })
  67275. })
  67276. },
  67277. __trackerDelay: DELAY,
  67278. update: function(options) {
  67279. var that = this;
  67280. baseTrackerPrototype.update.call(this, options);
  67281. that._argumentAxis = options.argumentAxis || {};
  67282. that._axisHoverEnabled = that._argumentAxis && _normalizeEnum(that._argumentAxis.getOptions().hoverMode) === ALL_ARGUMENT_POINTS_MODE;
  67283. that._chart = options.chart;
  67284. that._rotated = options.rotated;
  67285. that._crosshair = options.crosshair;
  67286. that._stickyHovering = options.stickyHovering
  67287. },
  67288. _getCanvas: function(x, y) {
  67289. var that = this;
  67290. var canvases = that._canvases || [];
  67291. for (var i = 0; i < canvases.length; i++) {
  67292. var c = canvases[i];
  67293. if (inCanvas(c, x, y)) {
  67294. return c
  67295. }
  67296. }
  67297. return null
  67298. },
  67299. _isPointerOut: function(canvas) {
  67300. return !canvas && this._stuckSeries
  67301. },
  67302. _hideCrosshair: function() {
  67303. this._crosshair && this._crosshair.hide()
  67304. },
  67305. _moveCrosshair: function(point, x, y) {
  67306. if (point && this._crosshair && point.isVisible()) {
  67307. this._crosshair.show({
  67308. point: point,
  67309. x: x,
  67310. y: y
  67311. })
  67312. }
  67313. },
  67314. _clean: function() {
  67315. var that = this;
  67316. baseTrackerPrototype._clean.call(that);
  67317. that._resetTimer();
  67318. that._stuckSeries = null
  67319. },
  67320. _getSeriesForShared: function(x, y) {
  67321. var that = this;
  67322. var points = [];
  67323. var point = null;
  67324. var distance = 1 / 0;
  67325. if (that._tooltip.isShared() && !that.hoveredSeries) {
  67326. _each(that._storedSeries, function(_, series) {
  67327. var point = series.getNeighborPoint(x, y);
  67328. point && points.push(point)
  67329. });
  67330. _each(points, function(_, p) {
  67331. var coords = p.getCrosshairData(x, y);
  67332. var d = vizUtils.getDistance(x, y, coords.x, coords.y);
  67333. if (d < distance) {
  67334. point = p;
  67335. distance = d
  67336. }
  67337. })
  67338. }
  67339. return point && point.series
  67340. },
  67341. _setTimeout: function(callback, keeper) {
  67342. var that = this;
  67343. if (that._timeoutKeeper !== keeper) {
  67344. that._resetTimer();
  67345. that._hoverTimeout = setTimeout(function() {
  67346. callback();
  67347. that._timeoutKeeper = null
  67348. }, DELAY);
  67349. that._timeoutKeeper = keeper
  67350. }
  67351. },
  67352. _resetTimer: function() {
  67353. clearTimeout(this._hoverTimeout);
  67354. this._timeoutKeeper = this._hoverTimeout = null
  67355. },
  67356. _stopEvent: function(e) {
  67357. if (!isDefined(e.cancelable) || e.cancelable) {
  67358. e.preventDefault();
  67359. e.stopPropagation()
  67360. }
  67361. },
  67362. _setStuckSeries: function(e, series, x, y) {
  67363. if ("mouse" !== e.pointerType) {
  67364. this._stuckSeries = null
  67365. } else {
  67366. this._stuckSeries = series || this._stuckSeries || this._getSeriesForShared(x, y)
  67367. }
  67368. return !!this._stuckSeries
  67369. },
  67370. _pointerOut: function() {
  67371. var that = this;
  67372. that._stuckSeries = null;
  67373. that._hideCrosshair();
  67374. that._resetTimer();
  67375. baseTrackerPrototype._pointerOut.apply(that, arguments)
  67376. },
  67377. _hoverArgumentAxis: function(x, y, e) {
  67378. var that = this;
  67379. that._resetHoveredArgument();
  67380. if (that._axisHoverEnabled && that._argumentAxis.coordsIn(x, y)) {
  67381. that._hoverArgument(getData(e, ARG_DATA));
  67382. return true
  67383. }
  67384. },
  67385. _pointerComplete: function(point, x, y) {
  67386. var that = this;
  67387. that.hoveredSeries && that.hoveredSeries.updateHover(x, y);
  67388. that._resetTimer();
  67389. that._moveCrosshair(point, x, y);
  67390. baseTrackerPrototype._pointerComplete.call(that, point)
  67391. },
  67392. _legendClick: function(item, e) {
  67393. var series = this._storedSeries[item.id];
  67394. this._triggerLegendClick({
  67395. target: series,
  67396. event: e
  67397. }, SERIES_CLICK)
  67398. },
  67399. _hoverLegendItem: function(x, y) {
  67400. this._stuckSeries = null;
  67401. this._hideCrosshair();
  67402. baseTrackerPrototype._hoverLegendItem.call(this, x, y)
  67403. },
  67404. _pointerOnPoint: function(point, x, y, e) {
  67405. this._setStuckSeries(e, point.series, x, y);
  67406. this._releaseHoveredSeries();
  67407. baseTrackerPrototype._pointerOnPoint.call(this, point, x, y, e)
  67408. },
  67409. _notifyLegendOnHoverArgument: false,
  67410. _getArgumentHoverMode: function() {
  67411. return correctHoverMode(this._argumentAxis)
  67412. },
  67413. dispose: function() {
  67414. this._resetTimer();
  67415. baseTrackerPrototype.dispose.call(this)
  67416. }
  67417. });
  67418. var PieTracker = function(options) {
  67419. this.ctor(options)
  67420. };
  67421. extend(PieTracker.prototype, baseTrackerPrototype, {
  67422. _isPointerOut: function(_, point) {
  67423. return !point
  67424. },
  67425. _legendClick: function(item, e) {
  67426. var that = this;
  67427. var points = [];
  67428. that._storedSeries.forEach(function(s) {
  67429. return points.push.apply(points, s.getPointsByKeys(item.argument, item.argumentIndex))
  67430. });
  67431. that._eventTrigger(LEGEND_CLICK, {
  67432. target: item.argument,
  67433. points: points,
  67434. event: e
  67435. })
  67436. },
  67437. _pointClick: function(point, e) {
  67438. this._eventTrigger(POINT_CLICK, {
  67439. target: point,
  67440. event: e
  67441. })
  67442. },
  67443. _hoverLegendItem: function(x, y) {
  67444. var that = this;
  67445. var item = that._legend.getItemByCoord(x, y);
  67446. that._resetHoveredArgument();
  67447. if (item) {
  67448. that._hoverArgument(item.argument, item.argumentIndex)
  67449. } else {
  67450. that.clearHover()
  67451. }
  67452. },
  67453. _getArgumentHoverMode: function() {
  67454. return correctHoverMode(this._legend)
  67455. },
  67456. _hoverArgumentAxis: _noop,
  67457. _setStuckSeries: _noop,
  67458. _getCanvas: _noop,
  67459. _notifyLegendOnHoverArgument: true
  67460. });
  67461. exports.ChartTracker = ChartTracker;
  67462. exports.PieTracker = PieTracker
  67463. },
  67464. /*!******************************************************************************!*\
  67465. !*** ./artifacts/transpiled/viz/chart_components/multi_axes_synchronizer.js ***!
  67466. \******************************************************************************/
  67467. /*! dynamic exports provided */
  67468. /*! all exports used */
  67469. function(module, exports, __webpack_require__) {
  67470. var _console = __webpack_require__( /*! ../../core/utils/console */ 73);
  67471. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  67472. var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  67473. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  67474. var _math2 = __webpack_require__( /*! ../../core/utils/math */ 28);
  67475. var _math = Math;
  67476. var _floor = _math.floor;
  67477. var _max = _math.max;
  67478. var _abs = _math.abs;
  67479. function getValueAxesPerPanes(valueAxes) {
  67480. var result = {};
  67481. valueAxes.forEach(function(axis) {
  67482. var pane = axis.pane;
  67483. if (!result[pane]) {
  67484. result[pane] = []
  67485. }
  67486. result[pane].push(axis)
  67487. });
  67488. return result
  67489. }
  67490. var linearConverter = {
  67491. transform: function(v, b) {
  67492. return (0, _math2.adjust)((0, _utils.getLog)(v, b))
  67493. },
  67494. addInterval: function(v, i) {
  67495. return (0, _math2.adjust)(v + i)
  67496. },
  67497. getInterval: function(base, tickInterval) {
  67498. return tickInterval
  67499. }
  67500. };
  67501. var logConverter = {
  67502. transform: function(v, b) {
  67503. return (0, _math2.adjust)((0, _utils.raiseTo)(v, b))
  67504. },
  67505. addInterval: function(v, i) {
  67506. return (0, _math2.adjust)(v * i)
  67507. },
  67508. getInterval: function(base, tickInterval) {
  67509. return _math.pow(base, tickInterval)
  67510. }
  67511. };
  67512. function convertAxisInfo(axisInfo, converter) {
  67513. if (!axisInfo.isLogarithmic) {
  67514. return
  67515. }
  67516. var base = axisInfo.logarithmicBase;
  67517. var tickValues = axisInfo.tickValues;
  67518. var tick;
  67519. var ticks = [];
  67520. axisInfo.minValue = converter.transform(axisInfo.minValue, base);
  67521. axisInfo.oldMinValue = converter.transform(axisInfo.oldMinValue, base);
  67522. axisInfo.maxValue = converter.transform(axisInfo.maxValue, base);
  67523. axisInfo.oldMaxValue = converter.transform(axisInfo.oldMaxValue, base);
  67524. axisInfo.tickInterval = _math.round(axisInfo.tickInterval);
  67525. if (axisInfo.tickInterval < 1) {
  67526. axisInfo.tickInterval = 1
  67527. }
  67528. var interval = converter.getInterval(base, axisInfo.tickInterval);
  67529. tick = converter.transform(tickValues[0], base);
  67530. while (ticks.length < tickValues.length) {
  67531. ticks.push(tick);
  67532. tick = converter.addInterval(tick, interval)
  67533. }
  67534. ticks.tickInterval = axisInfo.tickInterval;
  67535. axisInfo.tickValues = ticks
  67536. }
  67537. function populateAxesInfo(axes) {
  67538. return axes.reduce(function(result, axis) {
  67539. var ticksValues = axis.getTicksValues();
  67540. var majorTicks = ticksValues.majorTicksValues;
  67541. var options = axis.getOptions();
  67542. var businessRange = axis.getTranslator().getBusinessRange();
  67543. var visibleArea = axis.getVisibleArea();
  67544. var tickInterval = axis._tickInterval;
  67545. var synchronizedValue = options.synchronizedValue;
  67546. if (majorTicks && majorTicks.length > 0 && (0, _type.isNumeric)(majorTicks[0]) && "discrete" !== options.type && !businessRange.isEmpty() && !(businessRange.breaks && businessRange.breaks.length) && "zoom" !== axis.getViewport().action) {
  67547. axis.applyMargins();
  67548. var startValue = axis.getTranslator().from(visibleArea[0]);
  67549. var endValue = axis.getTranslator().from(visibleArea[1]);
  67550. var minValue = startValue < endValue ? startValue : endValue;
  67551. var maxValue = startValue < endValue ? endValue : startValue;
  67552. if (minValue === maxValue && (0, _type.isDefined)(synchronizedValue)) {
  67553. tickInterval = _abs(majorTicks[0] - synchronizedValue) || 1;
  67554. minValue = majorTicks[0] - tickInterval;
  67555. maxValue = majorTicks[0] + tickInterval
  67556. }
  67557. var axisInfo = {
  67558. axis: axis,
  67559. isLogarithmic: "logarithmic" === options.type,
  67560. logarithmicBase: businessRange.base,
  67561. tickValues: majorTicks,
  67562. minorValues: ticksValues.minorTicksValues,
  67563. minorTickInterval: axis._minorTickInterval,
  67564. minValue: minValue,
  67565. oldMinValue: minValue,
  67566. maxValue: maxValue,
  67567. oldMaxValue: maxValue,
  67568. inverted: businessRange.invert,
  67569. tickInterval: tickInterval,
  67570. synchronizedValue: synchronizedValue
  67571. };
  67572. convertAxisInfo(axisInfo, linearConverter);
  67573. result.push(axisInfo);
  67574. _console.debug.assert(axisInfo.minValue === axisInfo.maxValue && (!(0, _type.isDefined)(axisInfo.tickInterval) || (0, _type.isDefined)(options.tickInterval)) || (0, _type.isDefined)(axisInfo.tickInterval), "tickInterval was not provided")
  67575. }
  67576. return result
  67577. }, [])
  67578. }
  67579. function updateTickValues(axesInfo) {
  67580. var maxTicksCount = axesInfo.reduce(function(max, axisInfo) {
  67581. return _max(max, axisInfo.tickValues.length)
  67582. }, 0);
  67583. axesInfo.forEach(function(axisInfo) {
  67584. var additionalStartTicksCount = 0;
  67585. var synchronizedValue = axisInfo.synchronizedValue;
  67586. var tickValues = axisInfo.tickValues;
  67587. var tickInterval = axisInfo.tickInterval;
  67588. if ((0, _type.isDefined)(synchronizedValue)) {
  67589. axisInfo.baseTickValue = axisInfo.invertedBaseTickValue = synchronizedValue;
  67590. axisInfo.tickValues = [axisInfo.baseTickValue]
  67591. } else {
  67592. if (tickValues.length > 1 && tickInterval) {
  67593. var ticksMultiplier = _floor((maxTicksCount + 1) / tickValues.length);
  67594. var ticksCount = ticksMultiplier > 1 ? _floor((maxTicksCount + 1) / ticksMultiplier) : maxTicksCount;
  67595. additionalStartTicksCount = _floor((ticksCount - tickValues.length) / 2);
  67596. while (additionalStartTicksCount > 0 && 0 !== tickValues[0]) {
  67597. tickValues.unshift((0, _math2.adjust)(tickValues[0] - tickInterval));
  67598. additionalStartTicksCount--
  67599. }
  67600. while (tickValues.length < ticksCount) {
  67601. tickValues.push((0, _math2.adjust)(tickValues[tickValues.length - 1] + tickInterval))
  67602. }
  67603. axisInfo.tickInterval = tickInterval / ticksMultiplier
  67604. }
  67605. axisInfo.baseTickValue = tickValues[0];
  67606. axisInfo.invertedBaseTickValue = tickValues[tickValues.length - 1]
  67607. }
  67608. })
  67609. }
  67610. function getAxisRange(axisInfo) {
  67611. return axisInfo.maxValue - axisInfo.minValue || 1
  67612. }
  67613. function getMainAxisInfo(axesInfo) {
  67614. for (var i = 0; i < axesInfo.length; i++) {
  67615. if (!axesInfo[i].stubData) {
  67616. return axesInfo[i]
  67617. }
  67618. }
  67619. return null
  67620. }
  67621. function correctMinMaxValues(axesInfo) {
  67622. var mainAxisInfo = getMainAxisInfo(axesInfo);
  67623. var mainAxisInfoTickInterval = mainAxisInfo.tickInterval;
  67624. axesInfo.forEach(function(axisInfo) {
  67625. var mainAxisBaseValueOffset;
  67626. if (axisInfo !== mainAxisInfo) {
  67627. if (mainAxisInfoTickInterval && axisInfo.tickInterval) {
  67628. if (axisInfo.stubData && (0, _type.isDefined)(axisInfo.synchronizedValue)) {
  67629. axisInfo.oldMinValue = axisInfo.minValue = axisInfo.baseTickValue - (mainAxisInfo.baseTickValue - mainAxisInfo.minValue) / mainAxisInfoTickInterval * axisInfo.tickInterval;
  67630. axisInfo.oldMaxValue = axisInfo.maxValue = axisInfo.baseTickValue - (mainAxisInfo.baseTickValue - mainAxisInfo.maxValue) / mainAxisInfoTickInterval * axisInfo.tickInterval
  67631. }
  67632. var scale = mainAxisInfoTickInterval / getAxisRange(mainAxisInfo) / axisInfo.tickInterval * getAxisRange(axisInfo);
  67633. axisInfo.maxValue = axisInfo.minValue + getAxisRange(axisInfo) / scale
  67634. }
  67635. if (mainAxisInfo.inverted && !axisInfo.inverted || !mainAxisInfo.inverted && axisInfo.inverted) {
  67636. mainAxisBaseValueOffset = mainAxisInfo.maxValue - mainAxisInfo.invertedBaseTickValue
  67637. } else {
  67638. mainAxisBaseValueOffset = mainAxisInfo.baseTickValue - mainAxisInfo.minValue
  67639. }
  67640. var valueFromAxisInfo = getAxisRange(axisInfo);
  67641. var move = (mainAxisBaseValueOffset / getAxisRange(mainAxisInfo) - (axisInfo.baseTickValue - axisInfo.minValue) / valueFromAxisInfo) * valueFromAxisInfo;
  67642. axisInfo.minValue -= move;
  67643. axisInfo.maxValue -= move
  67644. }
  67645. })
  67646. }
  67647. function calculatePaddings(axesInfo) {
  67648. var startPadding = 0;
  67649. var endPadding = 0;
  67650. axesInfo.forEach(function(axisInfo) {
  67651. var inverted = axisInfo.inverted;
  67652. var minPadding = axisInfo.minValue > axisInfo.oldMinValue ? (axisInfo.minValue - axisInfo.oldMinValue) / getAxisRange(axisInfo) : 0;
  67653. var maxPadding = axisInfo.maxValue < axisInfo.oldMaxValue ? (axisInfo.oldMaxValue - axisInfo.maxValue) / getAxisRange(axisInfo) : 0;
  67654. startPadding = _max(startPadding, inverted ? maxPadding : minPadding);
  67655. endPadding = _max(endPadding, inverted ? minPadding : maxPadding)
  67656. });
  67657. return {
  67658. start: startPadding,
  67659. end: endPadding
  67660. }
  67661. }
  67662. function correctMinMaxValuesByPaddings(axesInfo, paddings) {
  67663. axesInfo.forEach(function(info) {
  67664. var range = getAxisRange(info);
  67665. var inverted = info.inverted;
  67666. info.minValue = (0, _math2.adjust)(info.minValue - paddings[inverted ? "end" : "start"] * range);
  67667. info.maxValue = (0, _math2.adjust)(info.maxValue + paddings[inverted ? "start" : "end"] * range)
  67668. })
  67669. }
  67670. function updateTickValuesIfSynchronizedValueUsed(axesInfo) {
  67671. var hasSynchronizedValue = false;
  67672. axesInfo.forEach(function(info) {
  67673. hasSynchronizedValue = hasSynchronizedValue || (0, _type.isDefined)(info.synchronizedValue)
  67674. });
  67675. axesInfo.forEach(function(info) {
  67676. var tickInterval = info.tickInterval;
  67677. var tickValues = info.tickValues;
  67678. var maxValue = info.maxValue;
  67679. var minValue = info.minValue;
  67680. var tick;
  67681. if (hasSynchronizedValue && tickInterval) {
  67682. while ((tick = (0, _math2.adjust)(tickValues[0] - tickInterval)) >= minValue) {
  67683. tickValues.unshift(tick)
  67684. }
  67685. tick = tickValues[tickValues.length - 1];
  67686. while ((tick = (0, _math2.adjust)(tick + tickInterval)) <= maxValue) {
  67687. tickValues.push(tick)
  67688. }
  67689. }
  67690. while (tickValues[0] + tickInterval / 10 < minValue) {
  67691. tickValues.shift()
  67692. }
  67693. while (tickValues[tickValues.length - 1] - tickInterval / 10 > maxValue) {
  67694. tickValues.pop()
  67695. }
  67696. })
  67697. }
  67698. function applyMinMaxValues(axesInfo) {
  67699. axesInfo.forEach(function(info) {
  67700. var axis = info.axis;
  67701. var range = axis.getTranslator().getBusinessRange();
  67702. if (range.min === range.minVisible) {
  67703. range.min = info.minValue
  67704. }
  67705. if (range.max === range.maxVisible) {
  67706. range.max = info.maxValue
  67707. }
  67708. range.minVisible = info.minValue;
  67709. range.maxVisible = info.maxValue;
  67710. if (range.min > range.minVisible) {
  67711. range.min = range.minVisible
  67712. }
  67713. if (range.max < range.maxVisible) {
  67714. range.max = range.maxVisible
  67715. }
  67716. axis.getTranslator().updateBusinessRange(range);
  67717. axis.setTicks({
  67718. majorTicks: info.tickValues,
  67719. minorTicks: info.minorValues
  67720. })
  67721. })
  67722. }
  67723. function correctAfterSynchronize(axesInfo) {
  67724. var invalidAxisInfo = [];
  67725. var correctValue;
  67726. axesInfo.forEach(function(info) {
  67727. if (info.oldMaxValue - info.oldMinValue === 0) {
  67728. invalidAxisInfo.push(info)
  67729. } else {
  67730. if (!(0, _type.isDefined)(correctValue) && !(0, _type.isDefined)(info.synchronizedValue)) {
  67731. correctValue = _abs((info.maxValue - info.minValue) / (info.tickValues[_floor(info.tickValues.length / 2)] - info.minValue || info.maxValue))
  67732. }
  67733. }
  67734. });
  67735. if (!(0, _type.isDefined)(correctValue)) {
  67736. return
  67737. }
  67738. invalidAxisInfo.forEach(function(info) {
  67739. var firstTick = info.tickValues[0];
  67740. var correctedTick = firstTick * correctValue;
  67741. if (firstTick > 0) {
  67742. info.maxValue = correctedTick;
  67743. info.minValue = 0
  67744. } else {
  67745. if (firstTick < 0) {
  67746. info.minValue = correctedTick;
  67747. info.maxValue = 0
  67748. }
  67749. }
  67750. })
  67751. }
  67752. function updateMinorTicks(axesInfo) {
  67753. axesInfo.forEach(function(axisInfo) {
  67754. if (!axisInfo.minorTickInterval) {
  67755. return
  67756. }
  67757. var ticks = [];
  67758. var interval = axisInfo.minorTickInterval;
  67759. var tickCount = axisInfo.tickInterval / interval - 1;
  67760. for (var i = 1; i < axisInfo.tickValues.length; i++) {
  67761. var tick = axisInfo.tickValues[i - 1];
  67762. for (var j = 0; j < tickCount; j++) {
  67763. tick += interval;
  67764. ticks.push(tick)
  67765. }
  67766. }
  67767. axisInfo.minorValues = ticks
  67768. })
  67769. }
  67770. var multiAxesSynchronizer = {
  67771. synchronize: function(valueAxes) {
  67772. (0, _iterator.each)(getValueAxesPerPanes(valueAxes), function(_, axes) {
  67773. if (axes.length > 1) {
  67774. var axesInfo = populateAxesInfo(axes);
  67775. if (axesInfo.length < 2 || !getMainAxisInfo(axesInfo)) {
  67776. return
  67777. }
  67778. updateTickValues(axesInfo);
  67779. correctMinMaxValues(axesInfo);
  67780. var paddings = calculatePaddings(axesInfo);
  67781. correctMinMaxValuesByPaddings(axesInfo, paddings);
  67782. correctAfterSynchronize(axesInfo);
  67783. updateTickValuesIfSynchronizedValueUsed(axesInfo);
  67784. updateMinorTicks(axesInfo);
  67785. axesInfo.forEach(function(info) {
  67786. convertAxisInfo(info, logConverter)
  67787. });
  67788. applyMinMaxValues(axesInfo)
  67789. }
  67790. })
  67791. }
  67792. };
  67793. module.exports = multiAxesSynchronizer
  67794. },
  67795. /*!*********************************************************************!*\
  67796. !*** ./artifacts/transpiled/viz/translators/category_translator.js ***!
  67797. \*********************************************************************/
  67798. /*! dynamic exports provided */
  67799. /*! all exports used */
  67800. function(module, exports, __webpack_require__) {
  67801. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  67802. var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust;
  67803. var round = Math.round;
  67804. function getValue(value) {
  67805. return value
  67806. }
  67807. module.exports = {
  67808. translate: function(category, directionOffset) {
  67809. var that = this;
  67810. var canvasOptions = that._canvasOptions;
  67811. var categoryIndex = that._categoriesToPoints[category.valueOf()];
  67812. var specialValue = that.translateSpecialCase(category);
  67813. var startPointIndex = canvasOptions.startPointIndex || 0;
  67814. var stickInterval = that._options.stick ? 0 : .5;
  67815. if (isDefined(specialValue)) {
  67816. return round(specialValue)
  67817. }
  67818. if (!categoryIndex && 0 !== categoryIndex) {
  67819. return null
  67820. }
  67821. directionOffset = directionOffset || 0;
  67822. var stickDelta = categoryIndex + stickInterval - startPointIndex + .5 * directionOffset;
  67823. return round(that._calculateProjection(canvasOptions.interval * stickDelta))
  67824. },
  67825. getInterval: function() {
  67826. return this._canvasOptions.interval
  67827. },
  67828. getEventScale: function(zoomEvent) {
  67829. var scale = zoomEvent.deltaScale || 1;
  67830. return 1 - (1 - scale) / (.75 + this.visibleCategories.length / this._categories.length)
  67831. },
  67832. zoom: function(translate, scale) {
  67833. var that = this;
  67834. var categories = that._categories;
  67835. var canvasOptions = that._canvasOptions;
  67836. var stick = that._options.stick;
  67837. var invert = canvasOptions.invert;
  67838. var interval = canvasOptions.interval * scale;
  67839. var translateCategories = translate / interval;
  67840. var visibleCount = (that.visibleCategories || []).length;
  67841. var startCategoryIndex = parseInt((canvasOptions.startPointIndex || 0) + translateCategories + .5);
  67842. var categoriesLength = parseInt(adjust(canvasOptions.canvasLength / interval) + (stick ? 1 : 0)) || 1;
  67843. var endCategoryIndex;
  67844. if (invert) {
  67845. startCategoryIndex = parseInt((canvasOptions.startPointIndex || 0) + visibleCount - translateCategories + .5) - categoriesLength
  67846. }
  67847. if (startCategoryIndex < 0) {
  67848. startCategoryIndex = 0
  67849. }
  67850. endCategoryIndex = startCategoryIndex + categoriesLength;
  67851. if (endCategoryIndex > categories.length) {
  67852. endCategoryIndex = categories.length;
  67853. startCategoryIndex = endCategoryIndex - categoriesLength;
  67854. if (startCategoryIndex < 0) {
  67855. startCategoryIndex = 0
  67856. }
  67857. }
  67858. var newVisibleCategories = categories.slice(parseInt(startCategoryIndex), parseInt(endCategoryIndex));
  67859. var newInterval = that._getDiscreteInterval(newVisibleCategories.length, canvasOptions);
  67860. scale = newInterval / canvasOptions.interval;
  67861. translate = that.translate(!invert ? newVisibleCategories[0] : newVisibleCategories[newVisibleCategories.length - 1]) * scale - (canvasOptions.startPoint + (stick ? 0 : newInterval / 2));
  67862. return {
  67863. min: newVisibleCategories[0],
  67864. max: newVisibleCategories[newVisibleCategories.length - 1],
  67865. translate: translate,
  67866. scale: scale
  67867. }
  67868. },
  67869. getMinScale: function(zoom) {
  67870. var that = this;
  67871. var canvasOptions = that._canvasOptions;
  67872. var categoriesLength = (that.visibleCategories || that._categories).length;
  67873. categoriesLength += (parseInt(.1 * categoriesLength) || 1) * (zoom ? -2 : 2);
  67874. return canvasOptions.canvasLength / (Math.max(categoriesLength, 1) * canvasOptions.interval)
  67875. },
  67876. getScale: function(min, max) {
  67877. var that = this;
  67878. var canvasOptions = that._canvasOptions;
  67879. var visibleArea = that.getCanvasVisibleArea();
  67880. var stickOffset = !that._options.stick && 1;
  67881. var minPoint = isDefined(min) ? that.translate(min, -stickOffset) : null;
  67882. var maxPoint = isDefined(max) ? that.translate(max, +stickOffset) : null;
  67883. if (null === minPoint) {
  67884. minPoint = canvasOptions.invert ? visibleArea.max : visibleArea.min
  67885. }
  67886. if (null === maxPoint) {
  67887. maxPoint = canvasOptions.invert ? visibleArea.min : visibleArea.max
  67888. }
  67889. return that.canvasLength / Math.abs(maxPoint - minPoint)
  67890. },
  67891. isValid: function(value) {
  67892. return isDefined(value) ? this._categoriesToPoints[value.valueOf()] >= 0 : false
  67893. },
  67894. getCorrectValue: getValue,
  67895. to: function(value, direction) {
  67896. var canvasOptions = this._canvasOptions;
  67897. var categoryIndex = this._categoriesToPoints[value.valueOf()];
  67898. var startPointIndex = canvasOptions.startPointIndex || 0;
  67899. var stickDelta = categoryIndex + (this._options.stick ? 0 : .5) - startPointIndex + (this._businessRange.invert ? -1 : 1) * direction * .5;
  67900. return round(this._calculateProjection(canvasOptions.interval * stickDelta))
  67901. },
  67902. from: function(position) {
  67903. var direction = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
  67904. var canvasOptions = this._canvasOptions;
  67905. var startPoint = canvasOptions.startPoint;
  67906. var categories = this.visibleCategories || this._categories;
  67907. var categoriesLength = categories.length;
  67908. var stickInterval = this._options.stick ? .5 : 0;
  67909. var result = round((position - startPoint) / canvasOptions.interval + stickInterval - .5 - .5 * direction);
  67910. if (result >= categoriesLength) {
  67911. result = categoriesLength - 1
  67912. }
  67913. if (result < 0) {
  67914. result = 0
  67915. }
  67916. if (canvasOptions.invert) {
  67917. result = categoriesLength - result - 1
  67918. }
  67919. return categories[result]
  67920. },
  67921. _add: function() {
  67922. return NaN
  67923. },
  67924. _toValue: getValue,
  67925. isValueProlonged: true
  67926. }
  67927. },
  67928. /*!*********************************************************************!*\
  67929. !*** ./artifacts/transpiled/viz/translators/interval_translator.js ***!
  67930. \*********************************************************************/
  67931. /*! dynamic exports provided */
  67932. /*! all exports used */
  67933. function(module, exports, __webpack_require__) {
  67934. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  67935. var isNumber = typeUtils.isNumeric;
  67936. var isDefined = typeUtils.isDefined;
  67937. var dateUtils = __webpack_require__( /*! ../../core/utils/date */ 22);
  67938. var addInterval = dateUtils.addInterval;
  67939. var dateToMilliseconds = dateUtils.dateToMilliseconds;
  67940. var floor = Math.floor;
  67941. var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust;
  67942. module.exports = {
  67943. _intervalize: function(value, interval) {
  67944. if (!isDefined(value)) {
  67945. return
  67946. }
  67947. if ("datetime" === this._businessRange.dataType) {
  67948. if (isNumber(value)) {
  67949. value = new Date(value)
  67950. } else {
  67951. value = new Date(value.getTime())
  67952. }
  67953. value = dateUtils.correctDateWithUnitBeginning(value, interval)
  67954. } else {
  67955. value = adjust(floor(adjust(value / interval)) * interval, interval)
  67956. }
  67957. return value
  67958. },
  67959. translate: function(bp, direction, interval) {
  67960. var that = this;
  67961. var specialValue = that.translateSpecialCase(bp);
  67962. if (isDefined(specialValue)) {
  67963. return Math.round(specialValue)
  67964. }
  67965. interval = interval || that._options.interval;
  67966. if (!that.isValid(bp, interval)) {
  67967. return null
  67968. }
  67969. return that.to(bp, direction, interval)
  67970. },
  67971. getInterval: function() {
  67972. return Math.round(this._canvasOptions.ratioOfCanvasRange * (this._businessRange.interval || Math.abs(this._canvasOptions.rangeMax - this._canvasOptions.rangeMin)))
  67973. },
  67974. zoom: function() {},
  67975. getMinScale: function() {},
  67976. getScale: function() {},
  67977. _parse: function(value) {
  67978. return "datetime" === this._businessRange.dataType ? new Date(value) : Number(value)
  67979. },
  67980. _fromValue: function(value) {
  67981. return this._parse(value)
  67982. },
  67983. _toValue: function(value) {
  67984. return this._parse(value)
  67985. },
  67986. isValid: function(value, interval) {
  67987. var that = this;
  67988. var co = that._canvasOptions;
  67989. var rangeMin = co.rangeMin;
  67990. var rangeMax = co.rangeMax;
  67991. interval = interval || that._options.interval;
  67992. if (null === value || isNaN(value)) {
  67993. return false
  67994. }
  67995. value = "datetime" === that._businessRange.dataType && isNumber(value) ? new Date(value) : value;
  67996. if (interval !== that._options.interval) {
  67997. rangeMin = that._intervalize(rangeMin, interval);
  67998. rangeMax = that._intervalize(rangeMax, interval)
  67999. }
  68000. if (value.valueOf() < rangeMin || value.valueOf() >= addInterval(rangeMax, interval)) {
  68001. return false
  68002. }
  68003. return true
  68004. },
  68005. to: function(bp, direction, interval) {
  68006. var that = this;
  68007. interval = interval || that._options.interval;
  68008. var v1 = that._intervalize(bp, interval);
  68009. var v2 = addInterval(v1, interval);
  68010. var res = that._to(v1);
  68011. var p2 = that._to(v2);
  68012. if (!direction) {
  68013. res = floor((res + p2) / 2)
  68014. } else {
  68015. if (direction > 0) {
  68016. res = p2
  68017. }
  68018. }
  68019. return res
  68020. },
  68021. _to: function(value) {
  68022. var co = this._canvasOptions;
  68023. var rMin = co.rangeMinVisible;
  68024. var rMax = co.rangeMaxVisible;
  68025. var offset = value - rMin;
  68026. if (value < rMin) {
  68027. offset = 0
  68028. } else {
  68029. if (value > rMax) {
  68030. offset = addInterval(rMax, this._options.interval) - rMin
  68031. }
  68032. }
  68033. return this._conversionValue(this._calculateProjection(offset * this._canvasOptions.ratioOfCanvasRange))
  68034. },
  68035. from: function(position, direction) {
  68036. var that = this;
  68037. var origInterval = that._options.interval;
  68038. var interval = origInterval;
  68039. var co = that._canvasOptions;
  68040. var rMin = co.rangeMinVisible;
  68041. var rMax = co.rangeMaxVisible;
  68042. var value;
  68043. if ("datetime" === that._businessRange.dataType) {
  68044. interval = dateToMilliseconds(origInterval)
  68045. }
  68046. value = that._calculateUnProjection((position - that._canvasOptions.startPoint) / that._canvasOptions.ratioOfCanvasRange);
  68047. value = that._intervalize(addInterval(value, interval / 2, direction > 0), origInterval);
  68048. if (value < rMin) {
  68049. value = rMin
  68050. } else {
  68051. if (value > rMax) {
  68052. value = rMax
  68053. }
  68054. }
  68055. return value
  68056. },
  68057. _add: function() {
  68058. return NaN
  68059. },
  68060. isValueProlonged: true
  68061. }
  68062. },
  68063. /*!*********************************************************************!*\
  68064. !*** ./artifacts/transpiled/viz/translators/datetime_translator.js ***!
  68065. \*********************************************************************/
  68066. /*! dynamic exports provided */
  68067. /*! all exports used */
  68068. function(module, exports, __webpack_require__) {
  68069. function parse(value) {
  68070. return null !== value ? new Date(value) : value
  68071. }
  68072. module.exports = {
  68073. _fromValue: parse,
  68074. _toValue: parse,
  68075. _add: __webpack_require__( /*! ../../core/utils/date */ 22).addDateInterval
  68076. }
  68077. },
  68078. /*!************************************************************************!*\
  68079. !*** ./artifacts/transpiled/viz/translators/logarithmic_translator.js ***!
  68080. \************************************************************************/
  68081. /*! dynamic exports provided */
  68082. /*! all exports used */
  68083. function(module, exports, __webpack_require__) {
  68084. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  68085. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  68086. var raiseTo = vizUtils.raiseTo;
  68087. var getLog = vizUtils.getLog;
  68088. module.exports = {
  68089. _fromValue: function(value) {
  68090. return null !== value ? getLog(value, this._canvasOptions.base) : value
  68091. },
  68092. _toValue: function(value) {
  68093. return null !== value ? raiseTo(value, this._canvasOptions.base) : value
  68094. },
  68095. getMinBarSize: function(minBarSize) {
  68096. var visibleArea = this.getCanvasVisibleArea();
  68097. var minValue = this.from(visibleArea.min + minBarSize);
  68098. var canvasOptions = this._canvasOptions;
  68099. return Math.pow(canvasOptions.base, canvasOptions.rangeMinVisible + this._fromValue(this.from(visibleArea.min)) - this._fromValue(!isDefined(minValue) ? this.from(visibleArea.max) : minValue))
  68100. },
  68101. checkMinBarSize: function(initialValue, minShownValue, stackValue) {
  68102. var canvasOptions = this._canvasOptions;
  68103. var prevValue = stackValue - initialValue;
  68104. var baseMethod = this.constructor.prototype.checkMinBarSize;
  68105. var minBarSize;
  68106. var updateValue;
  68107. if (isDefined(minShownValue) && prevValue > 0) {
  68108. minBarSize = baseMethod(this._fromValue(stackValue / prevValue), this._fromValue(minShownValue) - canvasOptions.rangeMinVisible);
  68109. updateValue = Math.pow(canvasOptions.base, this._fromValue(prevValue) + minBarSize) - prevValue
  68110. } else {
  68111. updateValue = baseMethod(initialValue, minShownValue)
  68112. }
  68113. return updateValue
  68114. }
  68115. }
  68116. },
  68117. /*!**********************************************************!*\
  68118. !*** ./artifacts/transpiled/viz/axes/datetime_breaks.js ***!
  68119. \**********************************************************/
  68120. /*! dynamic exports provided */
  68121. /*! all exports used */
  68122. function(module, exports, __webpack_require__) {
  68123. var dateUtils = __webpack_require__( /*! ../../core/utils/date */ 22);
  68124. var days = [0, 1, 2, 3, 4, 5, 6];
  68125. function getWeekendDays(workdays) {
  68126. return days.filter(function(day) {
  68127. return !workdays.some(function(workDay) {
  68128. return workDay === day
  68129. })
  68130. })
  68131. }
  68132. function getNextDayIndex(dayIndex) {
  68133. return (dayIndex + 1) % 7
  68134. }
  68135. function dayBetweenWeekend(weekend, day) {
  68136. var start = weekend.start;
  68137. var end = weekend.end;
  68138. while (start !== end) {
  68139. if (start === day) {
  68140. return true
  68141. }
  68142. start = getNextDayIndex(start)
  68143. }
  68144. return false
  68145. }
  68146. function getDaysDistance(day, end) {
  68147. var length = 0;
  68148. while (day !== end) {
  68149. day = getNextDayIndex(day);
  68150. length++
  68151. }
  68152. return length
  68153. }
  68154. function separateBreak(scaleBreak, day) {
  68155. var result = [];
  68156. var dayEnd = new Date(day);
  68157. dayEnd.setDate(day.getDate() + 1);
  68158. if (day > scaleBreak.from) {
  68159. result.push({
  68160. from: scaleBreak.from,
  68161. to: day
  68162. })
  68163. }
  68164. if (dayEnd < scaleBreak.to) {
  68165. result.push({
  68166. from: dayEnd,
  68167. to: scaleBreak.to
  68168. })
  68169. }
  68170. return result
  68171. }
  68172. function getWeekEndDayIndices(workDays) {
  68173. var indices = getWeekendDays(workDays);
  68174. if (indices.length < 7) {
  68175. while (getNextDayIndex(indices[indices.length - 1]) === indices[0]) {
  68176. indices.unshift(indices.pop())
  68177. }
  68178. }
  68179. return indices
  68180. }
  68181. function generateDateBreaksForWeekend(min, max, weekendDayIndices) {
  68182. var day = min.getDate();
  68183. var breaks = [];
  68184. var weekends = weekendDayIndices.reduce(function(obj, day) {
  68185. var currentWeekEnd = obj[1];
  68186. if (void 0 === currentWeekEnd.start) {
  68187. currentWeekEnd = {
  68188. start: day,
  68189. end: getNextDayIndex(day)
  68190. };
  68191. obj[0].push(currentWeekEnd);
  68192. return [obj[0], currentWeekEnd]
  68193. } else {
  68194. if (currentWeekEnd.end === day) {
  68195. currentWeekEnd.end = getNextDayIndex(day);
  68196. return obj
  68197. }
  68198. }
  68199. currentWeekEnd = {
  68200. start: day,
  68201. end: getNextDayIndex(day)
  68202. };
  68203. obj[0].push(currentWeekEnd);
  68204. return [obj[0], currentWeekEnd]
  68205. }, [
  68206. [], {}
  68207. ]);
  68208. weekends[0].forEach(function(weekend) {
  68209. var currentDate = new Date(min);
  68210. currentDate = dateUtils.trimTime(currentDate);
  68211. while (currentDate < max) {
  68212. day = currentDate.getDay();
  68213. var date = currentDate.getDate();
  68214. if (dayBetweenWeekend(weekend, day)) {
  68215. var from = new Date(currentDate);
  68216. var to;
  68217. currentDate.setDate(date + getDaysDistance(day, weekend.end));
  68218. to = new Date(currentDate);
  68219. breaks.push({
  68220. from: from,
  68221. to: to
  68222. })
  68223. }
  68224. currentDate.setDate(currentDate.getDate() + 1)
  68225. }
  68226. });
  68227. return breaks
  68228. }
  68229. function excludeWorkDaysFromWeekEndBreaks(breaks, exactWorkDays) {
  68230. var result = breaks.slice();
  68231. var i;
  68232. var processWorkDay = function(workday) {
  68233. workday = dateUtils.trimTime(new Date(workday));
  68234. if (result[i].from <= workday && result[i].to > workday) {
  68235. var separatedBreak = separateBreak(result[i], workday);
  68236. if (2 === separatedBreak.length) {
  68237. result.splice(i, 1, separatedBreak[0], separatedBreak[1])
  68238. } else {
  68239. if (1 === separatedBreak.length) {
  68240. result.splice(i, 1, separatedBreak[0])
  68241. } else {
  68242. result.splice(i, 1)
  68243. }
  68244. }
  68245. }
  68246. };
  68247. for (i = 0; i < result.length; i++) {
  68248. exactWorkDays.forEach(processWorkDay)
  68249. }
  68250. return result
  68251. }
  68252. function generateBreaksForHolidays(min, max, holidays, weekendDayIndices) {
  68253. var day;
  68254. var dayInWeekend = function(dayIndex) {
  68255. return dayIndex === day
  68256. };
  68257. var adjustedMin = dateUtils.trimTime(min);
  68258. var adjustedMax = dateUtils.trimTime(max);
  68259. adjustedMax.setDate(max.getDate() + 1);
  68260. return holidays.reduce(function(breaks, holiday) {
  68261. var holidayStart;
  68262. var holidayEnd;
  68263. holiday = new Date(holiday);
  68264. day = holiday.getDay();
  68265. if (!weekendDayIndices.some(dayInWeekend) && holiday >= adjustedMin && holiday <= adjustedMax) {
  68266. holidayStart = dateUtils.trimTime(holiday);
  68267. holidayEnd = new Date(holidayStart);
  68268. holidayEnd.setDate(holidayStart.getDate() + 1);
  68269. breaks.push({
  68270. from: holidayStart,
  68271. to: holidayEnd
  68272. })
  68273. }
  68274. return breaks
  68275. }, [])
  68276. }
  68277. function calculateGaps(breaks) {
  68278. return breaks.map(function(b) {
  68279. return {
  68280. from: b.from,
  68281. to: b.to,
  68282. gapSize: dateUtils.convertMillisecondsToDateUnits(b.to - b.from)
  68283. }
  68284. })
  68285. }
  68286. exports.generateDateBreaks = function(min, max, workWeek, singleWorkdays, holidays) {
  68287. var weekendDayIndices = getWeekEndDayIndices(workWeek);
  68288. var breaks = generateDateBreaksForWeekend(min, max, weekendDayIndices);
  68289. breaks.push.apply(breaks, generateBreaksForHolidays(min, max, holidays || [], weekendDayIndices));
  68290. return calculateGaps(excludeWorkDaysFromWeekEndBreaks(breaks, singleWorkdays || []))
  68291. }
  68292. },
  68293. /*!*****************************************************!*\
  68294. !*** ./artifacts/transpiled/viz/axes/polar_axes.js ***!
  68295. \*****************************************************/
  68296. /*! dynamic exports provided */
  68297. /*! all exports used */
  68298. function(module, exports, __webpack_require__) {
  68299. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  68300. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  68301. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  68302. var constants = __webpack_require__( /*! ./axes_constants */ 248);
  68303. var xyAxesLinear = __webpack_require__( /*! ./xy_axes */ 408).linear;
  68304. var tick = __webpack_require__( /*! ./tick */ 407).tick;
  68305. var _map = vizUtils.map;
  68306. var baseAxisModule = __webpack_require__( /*! ./base_axis */ 204);
  68307. var _math = Math;
  68308. var _abs = _math.abs;
  68309. var _round = _math.round;
  68310. var convertPolarToXY = vizUtils.convertPolarToXY;
  68311. var _extend = extend;
  68312. var _noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  68313. var HALF_PI_ANGLE = 90;
  68314. function getPolarQuarter(angle) {
  68315. var quarter;
  68316. angle = vizUtils.normalizeAngle(angle);
  68317. if (angle >= 315 && angle <= 360 || angle < 45 && angle >= 0) {
  68318. quarter = 1
  68319. } else {
  68320. if (angle >= 45 && angle < 135) {
  68321. quarter = 2
  68322. } else {
  68323. if (angle >= 135 && angle < 225) {
  68324. quarter = 3
  68325. } else {
  68326. if (angle >= 225 && angle < 315) {
  68327. quarter = 4
  68328. }
  68329. }
  68330. }
  68331. }
  68332. return quarter
  68333. }
  68334. var polarAxes = exports;
  68335. var circularAxes = polarAxes.circular = {
  68336. _calculateValueMargins: function(ticks) {
  68337. var _this$_getViewportRan = this._getViewportRange(),
  68338. minVisible = _this$_getViewportRan.minVisible,
  68339. maxVisible = _this$_getViewportRan.maxVisible;
  68340. if (ticks && ticks.length > 1) {
  68341. minVisible = minVisible < ticks[0].value ? minVisible : ticks[0].value;
  68342. maxVisible = minVisible > ticks[ticks.length - 1].value ? maxVisible : ticks[ticks.length - 1].value
  68343. }
  68344. return {
  68345. minValue: minVisible,
  68346. maxValue: maxVisible
  68347. }
  68348. },
  68349. applyMargins: function() {
  68350. var margins = this._calculateValueMargins(this._majorTicks);
  68351. var br = this._translator.getBusinessRange();
  68352. br.addRange({
  68353. minVisible: margins.minValue,
  68354. maxVisible: margins.maxValue,
  68355. interval: this._calculateRangeInterval(br.interval)
  68356. });
  68357. this._translator.updateBusinessRange(br)
  68358. },
  68359. _getTranslatorOptions: function() {
  68360. return {
  68361. isHorizontal: true,
  68362. conversionValue: true,
  68363. addSpiderCategory: this._getSpiderCategoryOption(),
  68364. stick: this._getStick()
  68365. }
  68366. },
  68367. getCenter: function() {
  68368. return this._center
  68369. },
  68370. getRadius: function() {
  68371. return this._radius
  68372. },
  68373. getAngles: function() {
  68374. var options = this._options;
  68375. return [options.startAngle, options.endAngle]
  68376. },
  68377. _updateRadius: function(canvas) {
  68378. var rad = Math.min(canvas.width - canvas.left - canvas.right, canvas.height - canvas.top - canvas.bottom) / 2;
  68379. this._radius = rad < 0 ? 0 : rad
  68380. },
  68381. _updateCenter: function(canvas) {
  68382. this._center = {
  68383. x: canvas.left + (canvas.width - canvas.right - canvas.left) / 2,
  68384. y: canvas.top + (canvas.height - canvas.top - canvas.bottom) / 2
  68385. }
  68386. },
  68387. _processCanvas: function(canvas) {
  68388. this._updateRadius(canvas);
  68389. this._updateCenter(canvas);
  68390. return {
  68391. left: 0,
  68392. right: 0,
  68393. width: this._getScreenDelta()
  68394. }
  68395. },
  68396. _createAxisElement: function() {
  68397. return this._renderer.circle()
  68398. },
  68399. _updateAxisElementPosition: function() {
  68400. var center = this.getCenter();
  68401. this._axisElement.attr({
  68402. cx: center.x,
  68403. cy: center.y,
  68404. r: this.getRadius()
  68405. })
  68406. },
  68407. _boundaryTicksVisibility: {
  68408. min: true
  68409. },
  68410. _getSpiderCategoryOption: function() {
  68411. return this._options.firstPointOnStartAngle
  68412. },
  68413. _validateOptions: function(options) {
  68414. var that = this;
  68415. var originValue = options.originValue;
  68416. var wholeRange = options.wholeRange = {};
  68417. var period = options.period;
  68418. if (isDefined(originValue)) {
  68419. originValue = that.validateUnit(originValue)
  68420. }
  68421. if (period > 0 && options.argumentType === constants.numeric) {
  68422. originValue = originValue || 0;
  68423. wholeRange.endValue = originValue + period;
  68424. that._viewport = vizUtils.getVizRangeObject([originValue, wholeRange.endValue])
  68425. }
  68426. if (isDefined(originValue)) {
  68427. wholeRange.startValue = originValue
  68428. }
  68429. },
  68430. getMargins: function() {
  68431. var tickOptions = this._options.tick;
  68432. var tickOuterLength = Math.max(tickOptions.visible ? tickOptions.length / 2 + tickOptions.shift : 0, 0);
  68433. var radius = this.getRadius();
  68434. var _this$_center = this._center,
  68435. x = _this$_center.x,
  68436. y = _this$_center.y;
  68437. var labelBoxes = this._majorTicks.map(function(t) {
  68438. return t.label && t.label.getBBox()
  68439. }).filter(function(b) {
  68440. return b
  68441. });
  68442. var canvas = extend({}, this._canvas, {
  68443. left: x - radius,
  68444. top: y - radius,
  68445. right: this._canvas.width - (x + radius),
  68446. bottom: this._canvas.height - (y + radius)
  68447. });
  68448. var margins = baseAxisModule.calculateCanvasMargins(labelBoxes, canvas);
  68449. Object.keys(margins).forEach(function(k) {
  68450. return margins[k] = margins[k] < tickOuterLength ? tickOuterLength : margins[k]
  68451. });
  68452. return margins
  68453. },
  68454. updateSize: function() {
  68455. var that = this;
  68456. baseAxisModule.Axis.prototype.updateSize.apply(that, arguments);
  68457. baseAxisModule.measureLabels(that._majorTicks);
  68458. that._adjustLabelsCoord(0, 0, true);
  68459. this._checkBoundedLabelsOverlapping(this._majorTicks, this._majorTicks.map(function(t) {
  68460. return t.labelBBox
  68461. }))
  68462. },
  68463. _setVisualRange: _noop,
  68464. allowToExtendVisualRange: function(isEnd) {
  68465. return true
  68466. },
  68467. _getStick: function() {
  68468. return this._options.firstPointOnStartAngle || this._options.type !== constants.discrete
  68469. },
  68470. _getTranslatedCoord: function(value, offset) {
  68471. return this._translator.translate(value, offset) - HALF_PI_ANGLE
  68472. },
  68473. _getCanvasStartEnd: function() {
  68474. return {
  68475. start: 0 - HALF_PI_ANGLE,
  68476. end: 360 - HALF_PI_ANGLE
  68477. }
  68478. },
  68479. _getStripGraphicAttributes: function(fromAngle, toAngle) {
  68480. var center = this.getCenter();
  68481. var angle = this.getAngles()[0];
  68482. var r = this.getRadius();
  68483. return {
  68484. x: center.x,
  68485. y: center.y,
  68486. innerRadius: 0,
  68487. outerRadius: r,
  68488. startAngle: -toAngle - angle,
  68489. endAngle: -fromAngle - angle
  68490. }
  68491. },
  68492. _createStrip: function(coords) {
  68493. return this._renderer.arc(coords.x, coords.y, coords.innerRadius, coords.outerRadius, coords.startAngle, coords.endAngle)
  68494. },
  68495. _getStripLabelCoords: function(from, to) {
  68496. var that = this;
  68497. var coords = that._getStripGraphicAttributes(from, to);
  68498. var angle = coords.startAngle + (coords.endAngle - coords.startAngle) / 2;
  68499. var cosSin = vizUtils.getCosAndSin(angle);
  68500. var halfRad = that.getRadius() / 2;
  68501. var center = that.getCenter();
  68502. var x = _round(center.x + halfRad * cosSin.cos);
  68503. var y = _round(center.y - halfRad * cosSin.sin);
  68504. return {
  68505. x: x,
  68506. y: y,
  68507. align: constants.center
  68508. }
  68509. },
  68510. _getConstantLineGraphicAttributes: function(value) {
  68511. var center = this.getCenter();
  68512. var r = this.getRadius();
  68513. return {
  68514. points: [center.x, center.y, center.x + r, center.y]
  68515. }
  68516. },
  68517. _createConstantLine: function(value, attr) {
  68518. return this._createPathElement(this._getConstantLineGraphicAttributes(value).points, attr)
  68519. },
  68520. _rotateConstantLine: function(line, value) {
  68521. var _this$getCenter = this.getCenter(),
  68522. x = _this$getCenter.x,
  68523. y = _this$getCenter.y;
  68524. line.rotate(value + this.getAngles()[0], x, y)
  68525. },
  68526. _getConstantLineLabelsCoords: function(value) {
  68527. var that = this;
  68528. var cosSin = vizUtils.getCosAndSin(-value - that.getAngles()[0]);
  68529. var halfRad = that.getRadius() / 2;
  68530. var center = that.getCenter();
  68531. var x = _round(center.x + halfRad * cosSin.cos);
  68532. var y = _round(center.y - halfRad * cosSin.sin);
  68533. return {
  68534. x: x,
  68535. y: y
  68536. }
  68537. },
  68538. _checkAlignmentConstantLineLabels: _noop,
  68539. _adjustDivisionFactor: function(val) {
  68540. return 180 * val / (this.getRadius() * Math.PI)
  68541. },
  68542. _getScreenDelta: function() {
  68543. var angles = this.getAngles();
  68544. return _math.abs(angles[0] - angles[1])
  68545. },
  68546. _getTickMarkPoints: function(coords, length, _ref) {
  68547. var _ref$shift = _ref.shift,
  68548. shift = void 0 === _ref$shift ? 0 : _ref$shift;
  68549. var center = this.getCenter();
  68550. var corrections = {
  68551. inside: -1,
  68552. center: -.5,
  68553. outside: 0
  68554. };
  68555. var radiusWithTicks = this.getRadius() + length * corrections[this._options.tickOrientation || "center"];
  68556. return [center.x + radiusWithTicks + shift, center.y, center.x + radiusWithTicks + length + shift, center.y]
  68557. },
  68558. _getLabelAdjustedCoord: function(tick, _offset, _maxWidth, checkCanvas) {
  68559. var that = this;
  68560. var labelCoords = tick.labelCoords;
  68561. var labelY = labelCoords.y;
  68562. var labelAngle = labelCoords.angle;
  68563. var cosSin = vizUtils.getCosAndSin(labelAngle);
  68564. var cos = cosSin.cos;
  68565. var sin = cosSin.sin;
  68566. var box = tick.labelBBox;
  68567. var halfWidth = box.width / 2;
  68568. var halfHeight = box.height / 2;
  68569. var indentFromAxis = that._options.label.indentFromAxis || 0;
  68570. var x = labelCoords.x + indentFromAxis * cos;
  68571. var y = labelY + (labelY - box.y - halfHeight) + indentFromAxis * sin;
  68572. var shiftX = 0;
  68573. var shiftY = 0;
  68574. switch (getPolarQuarter(labelAngle)) {
  68575. case 1:
  68576. shiftX = halfWidth;
  68577. shiftY = halfHeight * sin;
  68578. break;
  68579. case 2:
  68580. shiftX = halfWidth * cos;
  68581. shiftY = halfHeight;
  68582. break;
  68583. case 3:
  68584. shiftX = -halfWidth;
  68585. shiftY = halfHeight * sin;
  68586. break;
  68587. case 4:
  68588. shiftX = halfWidth * cos;
  68589. shiftY = -halfHeight
  68590. }
  68591. if (checkCanvas) {
  68592. var canvas = that._canvas;
  68593. var boxShiftX = x - labelCoords.x + shiftX;
  68594. var boxShiftY = y - labelCoords.y + shiftY;
  68595. if (box.x + boxShiftX < canvas.originalLeft) {
  68596. shiftX -= box.x + boxShiftX - canvas.originalLeft
  68597. }
  68598. if (box.x + box.width + boxShiftX > canvas.width - canvas.originalRight) {
  68599. shiftX -= box.x + box.width + boxShiftX - (canvas.width - canvas.originalRight)
  68600. }
  68601. if (box.y + boxShiftY < canvas.originalTop) {
  68602. shiftY -= box.y + boxShiftY - canvas.originalTop
  68603. }
  68604. if (box.y + box.height + boxShiftY > canvas.height - canvas.originalBottom) {
  68605. shiftY -= box.y + box.height + boxShiftY - (canvas.height - canvas.originalBottom)
  68606. }
  68607. }
  68608. return {
  68609. x: x + shiftX,
  68610. y: y + shiftY
  68611. }
  68612. },
  68613. _getGridLineDrawer: function() {
  68614. var that = this;
  68615. return function(tick, gridStyle) {
  68616. var center = that.getCenter();
  68617. return that._createPathElement(that._getGridPoints().points, gridStyle).rotate(tick.coords.angle, center.x, center.y)
  68618. }
  68619. },
  68620. _getGridPoints: function() {
  68621. var r = this.getRadius();
  68622. var center = this.getCenter();
  68623. return {
  68624. points: [center.x, center.y, center.x + r, center.y]
  68625. }
  68626. },
  68627. _getTranslatedValue: function(value, offset) {
  68628. var startAngle = this.getAngles()[0];
  68629. var angle = this._translator.translate(value, -offset);
  68630. var coords = convertPolarToXY(this.getCenter(), startAngle, angle, this.getRadius());
  68631. return {
  68632. x: coords.x,
  68633. y: coords.y,
  68634. angle: angle + startAngle - HALF_PI_ANGLE
  68635. }
  68636. },
  68637. _getAdjustedStripLabelCoords: function(strip) {
  68638. var box = strip.labelBBox;
  68639. return {
  68640. translateY: strip.label.attr("y") - box.y - box.height / 2
  68641. }
  68642. },
  68643. coordsIn: function(x, y) {
  68644. return vizUtils.convertXYToPolar(this.getCenter(), x, y).r > this.getRadius()
  68645. },
  68646. _rotateTick: function(element, coords) {
  68647. var center = this.getCenter();
  68648. element.rotate(coords.angle, center.x, center.y)
  68649. },
  68650. _validateOverlappingMode: function(mode) {
  68651. return constants.validateOverlappingMode(mode)
  68652. },
  68653. _validateDisplayMode: function() {
  68654. return "standard"
  68655. },
  68656. _getStep: function(boxes) {
  68657. var that = this;
  68658. var radius = that.getRadius() + (that._options.label.indentFromAxis || 0);
  68659. var maxLabelBox = boxes.reduce(function(prevValue, box) {
  68660. var curValue = prevValue;
  68661. if (prevValue.width < box.width) {
  68662. curValue.width = box.width
  68663. }
  68664. if (prevValue.height < box.height) {
  68665. curValue.height = box.height
  68666. }
  68667. return curValue
  68668. }, {
  68669. width: 0,
  68670. height: 0
  68671. });
  68672. var angle1 = _abs(2 * _math.atan(maxLabelBox.height / (2 * radius - maxLabelBox.width)) * 180 / _math.PI);
  68673. var angle2 = _abs(2 * _math.atan(maxLabelBox.width / (2 * radius - maxLabelBox.height)) * 180 / _math.PI);
  68674. return constants.getTicksCountInRange(that._majorTicks, "angle", _math.max(angle1, angle2))
  68675. },
  68676. _checkBoundedLabelsOverlapping: function(majorTicks, boxes, mode) {
  68677. var labelOpt = this._options.label;
  68678. mode = mode || this._validateOverlappingMode(labelOpt.overlappingBehavior);
  68679. if ("hide" !== mode) {
  68680. return
  68681. }
  68682. var lastVisibleLabelIndex = majorTicks.reduce(function(lastVisibleLabelIndex, tick, index) {
  68683. return tick.label ? index : lastVisibleLabelIndex
  68684. }, null);
  68685. if (!lastVisibleLabelIndex) {
  68686. return
  68687. }
  68688. if (constants.areLabelsOverlap(boxes[0], boxes[lastVisibleLabelIndex], labelOpt.minSpacing, constants.center)) {
  68689. "first" === labelOpt.hideFirstOrLast ? majorTicks[0].label.remove() : majorTicks[lastVisibleLabelIndex].label.remove()
  68690. }
  68691. },
  68692. shift: function(margins) {
  68693. this._axisGroup.attr({
  68694. translateX: margins.right,
  68695. translateY: margins.bottom
  68696. })
  68697. }
  68698. };
  68699. polarAxes.circularSpider = _extend({}, circularAxes, {
  68700. _createAxisElement: function() {
  68701. return this._renderer.path([], "area")
  68702. },
  68703. _updateAxisElementPosition: function() {
  68704. this._axisElement.attr({
  68705. points: _map(this.getSpiderTicks(), function(tick) {
  68706. return {
  68707. x: tick.coords.x,
  68708. y: tick.coords.y
  68709. }
  68710. })
  68711. })
  68712. },
  68713. _getStick: function() {
  68714. return true
  68715. },
  68716. _getSpiderCategoryOption: function() {
  68717. return true
  68718. },
  68719. getSpiderTicks: function() {
  68720. var that = this;
  68721. var ticks = that.getFullTicks();
  68722. that._spiderTicks = ticks.map(tick(that, that.renderer, {}, {}, that._getSkippedCategory(ticks), true));
  68723. that._spiderTicks.forEach(function(tick) {
  68724. tick.initCoords()
  68725. });
  68726. return that._spiderTicks
  68727. },
  68728. _getStripGraphicAttributes: function(fromAngle, toAngle) {
  68729. var center = this.getCenter();
  68730. var spiderTicks = this.getSpiderTicks();
  68731. var firstTick;
  68732. var lastTick;
  68733. var points = [];
  68734. var i = 0;
  68735. var len = spiderTicks.length;
  68736. while (i < len) {
  68737. var _tick = spiderTicks[i].coords;
  68738. if (_tick.angle >= fromAngle && _tick.angle <= toAngle) {
  68739. if (!firstTick) {
  68740. firstTick = (spiderTicks[i - 1] || spiderTicks[spiderTicks.length - 1]).coords;
  68741. points.push((_tick.x + firstTick.x) / 2, (_tick.y + firstTick.y) / 2)
  68742. }
  68743. points.push(_tick.x, _tick.y);
  68744. var nextTick = (spiderTicks[i + 1] || spiderTicks[0]).coords;
  68745. lastTick = {
  68746. x: (_tick.x + nextTick.x) / 2,
  68747. y: (_tick.y + nextTick.y) / 2
  68748. }
  68749. }
  68750. i++
  68751. }
  68752. points.push(lastTick.x, lastTick.y);
  68753. points.push(center.x, center.y);
  68754. return {
  68755. points: points
  68756. }
  68757. },
  68758. _createStrip: function(_ref2) {
  68759. var points = _ref2.points;
  68760. return this._renderer.path(points, "area")
  68761. },
  68762. _getTranslatedCoord: function(value, offset) {
  68763. return this._translator.translate(value, offset) - HALF_PI_ANGLE
  68764. },
  68765. _setTickOffset: function() {
  68766. this._tickOffset = false
  68767. }
  68768. });
  68769. polarAxes.linear = {
  68770. applyMargins: circularAxes.applyMargins,
  68771. _resetMargins: function() {
  68772. this._reinitTranslator(this._getViewportRange())
  68773. },
  68774. _setVisualRange: _noop,
  68775. _getStick: xyAxesLinear._getStick,
  68776. _getSpiderCategoryOption: _noop,
  68777. _getTranslatorOptions: function() {
  68778. return {
  68779. isHorizontal: true,
  68780. stick: this._getStick()
  68781. }
  68782. },
  68783. _updateRadius: circularAxes._updateRadius,
  68784. getRadius: circularAxes.getRadius,
  68785. getCenter: circularAxes.getCenter,
  68786. getAngles: circularAxes.getAngles,
  68787. _updateCenter: circularAxes._updateCenter,
  68788. _processCanvas: function(canvas) {
  68789. this._updateRadius(canvas);
  68790. this._updateCenter(canvas);
  68791. return {
  68792. left: 0,
  68793. right: 0,
  68794. width: this.getRadius()
  68795. }
  68796. },
  68797. _createAxisElement: xyAxesLinear._createAxisElement,
  68798. _updateAxisElementPosition: function() {
  68799. var centerCoord = this.getCenter();
  68800. this._axisElement.attr({
  68801. points: [centerCoord.x, centerCoord.y, centerCoord.x + this.getRadius(), centerCoord.y]
  68802. }).rotate(this.getAngles()[0] - HALF_PI_ANGLE, centerCoord.x, centerCoord.y)
  68803. },
  68804. _getScreenDelta: function() {
  68805. return this.getRadius()
  68806. },
  68807. _getTickMarkPoints: function(coords, length) {
  68808. return [coords.x - length / 2, coords.y, coords.x + length / 2, coords.y]
  68809. },
  68810. _getLabelAdjustedCoord: function(tick) {
  68811. var that = this;
  68812. var labelCoords = tick.labelCoords;
  68813. var labelY = labelCoords.y;
  68814. var cosSin = vizUtils.getCosAndSin(labelCoords.angle);
  68815. var indentFromAxis = that._options.label.indentFromAxis || 0;
  68816. var box = tick.labelBBox;
  68817. var x = labelCoords.x - _abs(indentFromAxis * cosSin.sin) + _abs(box.width / 2 * cosSin.cos) - box.width / 2;
  68818. var y = labelY + (labelY - box.y) - _abs(box.height / 2 * cosSin.sin) + _abs(indentFromAxis * cosSin.cos);
  68819. return {
  68820. x: x,
  68821. y: y
  68822. }
  68823. },
  68824. _getGridLineDrawer: function() {
  68825. var that = this;
  68826. return function(tick, gridStyle) {
  68827. var grid = that._getGridPoints(tick.coords);
  68828. return that._renderer.circle(grid.cx, grid.cy, grid.r).attr(gridStyle).sharp()
  68829. }
  68830. },
  68831. _getGridPoints: function(coords) {
  68832. var pos = this.getCenter();
  68833. var radius = vizUtils.getDistance(pos.x, pos.y, coords.x, coords.y);
  68834. if (radius > this.getRadius()) {
  68835. return {
  68836. cx: null,
  68837. cy: null,
  68838. r: null
  68839. }
  68840. }
  68841. return {
  68842. cx: pos.x,
  68843. cy: pos.y,
  68844. r: radius
  68845. }
  68846. },
  68847. _getTranslatedValue: function(value, offset) {
  68848. var startAngle = this.getAngles()[0];
  68849. var xy = convertPolarToXY(this.getCenter(), startAngle, 0, this._translator.translate(value, offset));
  68850. return {
  68851. x: xy.x,
  68852. y: xy.y,
  68853. angle: startAngle - HALF_PI_ANGLE
  68854. }
  68855. },
  68856. _getTranslatedCoord: function(value, offset) {
  68857. return this._translator.translate(value, offset)
  68858. },
  68859. _getCanvasStartEnd: function() {
  68860. return {
  68861. start: 0,
  68862. end: this.getRadius()
  68863. }
  68864. },
  68865. _getStripGraphicAttributes: function(fromPoint, toPoint) {
  68866. var center = this.getCenter();
  68867. return {
  68868. x: center.x,
  68869. y: center.y,
  68870. innerRadius: fromPoint,
  68871. outerRadius: toPoint
  68872. }
  68873. },
  68874. _createStrip: function(attrs) {
  68875. return this._renderer.arc(attrs.x, attrs.y, attrs.innerRadius, attrs.outerRadius, 0, 360)
  68876. },
  68877. _getAdjustedStripLabelCoords: circularAxes._getAdjustedStripLabelCoords,
  68878. _getStripLabelCoords: function(from, to) {
  68879. var that = this;
  68880. var labelPos = from + (to - from) / 2;
  68881. var center = that.getCenter();
  68882. var y = _round(center.y - labelPos);
  68883. return {
  68884. x: center.x,
  68885. y: y,
  68886. align: constants.center
  68887. }
  68888. },
  68889. _getConstantLineGraphicAttributes: function(value) {
  68890. var center = this.getCenter();
  68891. return {
  68892. cx: center.x,
  68893. cy: center.y,
  68894. r: value
  68895. }
  68896. },
  68897. _createConstantLine: function(value, attr) {
  68898. var attrs = this._getConstantLineGraphicAttributes(value);
  68899. return this._renderer.circle(attrs.cx, attrs.cy, attrs.r).attr(attr).sharp()
  68900. },
  68901. _getConstantLineLabelsCoords: function(value) {
  68902. var that = this;
  68903. var center = that.getCenter();
  68904. var y = _round(center.y - value);
  68905. return {
  68906. x: center.x,
  68907. y: y
  68908. }
  68909. },
  68910. _checkAlignmentConstantLineLabels: _noop,
  68911. _rotateTick: function(element, coords, isGridLine) {
  68912. !isGridLine && element.rotate(coords.angle + HALF_PI_ANGLE, coords.x, coords.y)
  68913. },
  68914. _validateOverlappingMode: circularAxes._validateOverlappingMode,
  68915. _validateDisplayMode: circularAxes._validateDisplayMode,
  68916. _getStep: function(boxes) {
  68917. var quarter = getPolarQuarter(this.getAngles()[0]);
  68918. var spacing = this._options.label.minSpacing;
  68919. var func = 2 === quarter || 4 === quarter ? function(box) {
  68920. return box.width + spacing
  68921. } : function(box) {
  68922. return box.height
  68923. };
  68924. var maxLabelLength = boxes.reduce(function(prevValue, box) {
  68925. return _math.max(prevValue, func(box))
  68926. }, 0);
  68927. return constants.getTicksCountInRange(this._majorTicks, 2 === quarter || 4 === quarter ? "x" : "y", maxLabelLength)
  68928. }
  68929. };
  68930. polarAxes.linearSpider = _extend({}, polarAxes.linear, {
  68931. _createPathElement: function(points, attr) {
  68932. return this._renderer.path(points, "area").attr(attr).sharp()
  68933. },
  68934. setSpiderTicks: function(ticks) {
  68935. this._spiderTicks = ticks
  68936. },
  68937. _getGridLineDrawer: function() {
  68938. var that = this;
  68939. return function(tick, gridStyle, element) {
  68940. return that._createPathElement(that._getGridPoints(tick.coords).points, gridStyle)
  68941. }
  68942. },
  68943. _getGridPoints: function(coords) {
  68944. var pos = this.getCenter();
  68945. var radius = vizUtils.getDistance(pos.x, pos.y, coords.x, coords.y);
  68946. return this._getGridPointsByRadius(radius)
  68947. },
  68948. _getGridPointsByRadius: function(radius) {
  68949. var pos = this.getCenter();
  68950. if (radius > this.getRadius()) {
  68951. return {
  68952. points: null
  68953. }
  68954. }
  68955. return {
  68956. points: _map(this._spiderTicks, function(tick) {
  68957. var cosSin = vizUtils.getCosAndSin(tick.coords.angle);
  68958. return {
  68959. x: _round(pos.x + radius * cosSin.cos),
  68960. y: _round(pos.y + radius * cosSin.sin)
  68961. }
  68962. })
  68963. }
  68964. },
  68965. _getStripGraphicAttributes: function(fromPoint, toPoint) {
  68966. var innerPoints = this._getGridPointsByRadius(toPoint).points;
  68967. var outerPoints = this._getGridPointsByRadius(fromPoint).points;
  68968. return {
  68969. points: [outerPoints, innerPoints.reverse()]
  68970. }
  68971. },
  68972. _createStrip: polarAxes.circularSpider._createStrip,
  68973. _getConstantLineGraphicAttributes: function(value) {
  68974. return this._getGridPointsByRadius(value)
  68975. },
  68976. _createConstantLine: function(value, attr) {
  68977. return this._createPathElement(this._getConstantLineGraphicAttributes(value).points, attr)
  68978. }
  68979. })
  68980. },
  68981. /*!********************************************************!*\
  68982. !*** ./artifacts/transpiled/viz/axes/constant_line.js ***!
  68983. \********************************************************/
  68984. /*! dynamic exports provided */
  68985. /*! all exports used */
  68986. function(module, exports, __webpack_require__) {
  68987. Object.defineProperty(exports, "__esModule", {
  68988. value: true
  68989. });
  68990. exports.default = createConstantLine;
  68991. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  68992. function createConstantLine(axis, options) {
  68993. var labelOptions = options.label || {};
  68994. var labelPosition = labelOptions.position || "inside";
  68995. var parsedValue;
  68996. var valueIsParsed = false;
  68997. axis._checkAlignmentConstantLineLabels(labelOptions);
  68998. var storedCoord;
  68999. return {
  69000. options: options,
  69001. labelOptions: labelOptions,
  69002. labelPosition: labelPosition,
  69003. label: null,
  69004. line: null,
  69005. getParsedValue: function() {
  69006. if (!valueIsParsed) {
  69007. parsedValue = axis.validateUnit(options.value, "E2105", "constantLine");
  69008. valueIsParsed = true;
  69009. return parsedValue
  69010. }
  69011. return parsedValue
  69012. },
  69013. draw: function() {
  69014. if (!(0, _type.isDefined)(options.value) || axis._translator.getBusinessRange().isEmpty()) {
  69015. return this
  69016. }
  69017. var canvas = axis._getCanvasStartEnd();
  69018. var parsedValue = this.getParsedValue();
  69019. this.coord = axis._getConstantLinePos(parsedValue, canvas.start, canvas.end);
  69020. var rootGroup = options.displayBehindSeries ? axis._axisConstantLineGroups.under : axis._axisConstantLineGroups.above;
  69021. var group = rootGroup[labelPosition];
  69022. if (!group) {
  69023. var side = axis._isHorizontal ? labelOptions.verticalAlignment : labelOptions.horizontalAlignment;
  69024. group = rootGroup[side]
  69025. }
  69026. if (!(0, _type.isDefined)(this.coord)) {
  69027. return this
  69028. }
  69029. var path = axis._createConstantLine(this.coord, {
  69030. stroke: options.color,
  69031. "stroke-width": options.width,
  69032. dashStyle: options.dashStyle
  69033. });
  69034. this.line = path.append(rootGroup.inside);
  69035. this.label = labelOptions.visible ? axis._drawConstantLineLabels(parsedValue, labelOptions, this.coord, group) : null;
  69036. this.updatePosition();
  69037. return this
  69038. },
  69039. removeLabel: function() {
  69040. this.label && this.label.remove()
  69041. },
  69042. updatePosition: function(animate) {
  69043. var canvas = axis._getCanvasStartEnd();
  69044. var coord = axis._getConstantLinePos(this.getParsedValue(), canvas.start, canvas.end);
  69045. if (!(0, _type.isDefined)(coord)) {
  69046. return
  69047. }
  69048. this.coord = coord;
  69049. if (animate && storedCoord) {
  69050. this.label && this.label.attr(axis._getConstantLineLabelsCoords(storedCoord, this.labelOptions));
  69051. this.line && this.line.attr(axis._getConstantLineGraphicAttributes(storedCoord));
  69052. this.label && this.label.animate(axis._getConstantLineLabelsCoords(this.coord, this.labelOptions));
  69053. this.line && this.line.animate(axis._getConstantLineGraphicAttributes(this.coord))
  69054. } else {
  69055. this.label && this.label.attr(axis._getConstantLineLabelsCoords(this.coord, this.labelOptions));
  69056. this.line && this.line.attr(axis._getConstantLineGraphicAttributes(this.coord));
  69057. axis._rotateConstantLine(this.line, this.coord)
  69058. }
  69059. },
  69060. saveCoords: function() {
  69061. storedCoord = this.coord
  69062. }
  69063. }
  69064. }
  69065. },
  69066. /*!************************************************!*\
  69067. !*** ./artifacts/transpiled/viz/axes/strip.js ***!
  69068. \************************************************/
  69069. /*! dynamic exports provided */
  69070. /*! all exports used */
  69071. function(module, exports, __webpack_require__) {
  69072. Object.defineProperty(exports, "__esModule", {
  69073. value: true
  69074. });
  69075. exports.default = createStrip;
  69076. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  69077. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  69078. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  69079. function createStrip(axis, options) {
  69080. var storedCoord;
  69081. var labelOptions = options.label || {};
  69082. return {
  69083. options: options,
  69084. label: null,
  69085. rect: null,
  69086. _getCoord: function() {
  69087. var canvas = axis._getCanvasStartEnd();
  69088. var range = axis._translator.getBusinessRange();
  69089. return axis._getStripPos(options.startValue, options.endValue, canvas.start, canvas.end, range)
  69090. },
  69091. _drawLabel: function(coords) {
  69092. return axis._renderer.text(labelOptions.text, coords.x, coords.y).css((0, _utils.patchFontOptions)((0, _extend.extend)({}, axis.getOptions().label.font, labelOptions.font))).attr({
  69093. align: "center",
  69094. "class": labelOptions.cssClass
  69095. }).append(axis._axisStripLabelGroup)
  69096. },
  69097. draw: function() {
  69098. if (axis._translator.getBusinessRange().isEmpty()) {
  69099. return
  69100. }
  69101. if (((0, _type.isDefined)(options.startValue) || (0, _type.isDefined)(options.endValue)) && (0, _type.isDefined)(options.color)) {
  69102. var stripPos = this._getCoord();
  69103. this.labelCoords = labelOptions.text ? axis._getStripLabelCoords(stripPos.from, stripPos.to, labelOptions) : null;
  69104. if (stripPos.outOfCanvas || !(0, _type.isDefined)(stripPos.to) || !(0, _type.isDefined)(stripPos.from)) {
  69105. return
  69106. }
  69107. this.rect = axis._createStrip(axis._getStripGraphicAttributes(stripPos.from, stripPos.to)).attr({
  69108. fill: options.color
  69109. }).append(axis._axisStripGroup);
  69110. this.label = labelOptions.text ? this._drawLabel(this.labelCoords) : null
  69111. }
  69112. },
  69113. removeLabel: function() {},
  69114. updatePosition: function(animate) {
  69115. var stripPos = this._getCoord();
  69116. if (animate && storedCoord) {
  69117. this.label && this.label.attr(axis._getStripLabelCoords(storedCoord.from, storedCoord.to, options.label));
  69118. this.rect && this.rect.attr(axis._getStripGraphicAttributes(storedCoord.from, storedCoord.to));
  69119. this.label && this.label.animate(axis._getStripLabelCoords(stripPos.from, stripPos.to, options.label));
  69120. this.rect && this.rect.animate(axis._getStripGraphicAttributes(stripPos.from, stripPos.to))
  69121. } else {
  69122. this.label && this.label.attr(axis._getStripLabelCoords(stripPos.from, stripPos.to, options.label));
  69123. this.rect && this.rect.attr(axis._getStripGraphicAttributes(stripPos.from, stripPos.to))
  69124. }
  69125. },
  69126. saveCoords: function() {
  69127. storedCoord = this._getCoord()
  69128. }
  69129. }
  69130. }
  69131. },
  69132. /*!*****************************************************************!*\
  69133. !*** ./artifacts/transpiled/viz/chart_components/scroll_bar.js ***!
  69134. \*****************************************************************/
  69135. /*! dynamic exports provided */
  69136. /*! all exports used */
  69137. function(module, exports, __webpack_require__) {
  69138. var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  69139. var _events_engine2 = _interopRequireDefault(_events_engine);
  69140. var _utils = __webpack_require__( /*! ../../events/utils */ 8);
  69141. var _utils2 = _interopRequireDefault(_utils);
  69142. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  69143. var _translator2d = __webpack_require__( /*! ../translators/translator2d */ 249);
  69144. var _translator2d2 = _interopRequireDefault(_translator2d);
  69145. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  69146. var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
  69147. var _drag = __webpack_require__( /*! ../../events/drag */ 56);
  69148. var _drag2 = _interopRequireDefault(_drag);
  69149. function _interopRequireDefault(obj) {
  69150. return obj && obj.__esModule ? obj : {
  69151. "default": obj
  69152. }
  69153. }
  69154. var _min = Math.min;
  69155. var _max = Math.max;
  69156. var MIN_SCROLL_BAR_SIZE = 2;
  69157. var ScrollBar = function(renderer, group) {
  69158. this._translator = new _translator2d2.default.Translator2D({}, {}, {});
  69159. this._scroll = renderer.rect().append(group);
  69160. this._addEvents()
  69161. };
  69162. function _getXCoord(canvas, pos, offset, width) {
  69163. var x = 0;
  69164. if ("right" === pos) {
  69165. x = canvas.width - canvas.right + offset
  69166. } else {
  69167. if ("left" === pos) {
  69168. x = canvas.left - offset - width
  69169. }
  69170. }
  69171. return x
  69172. }
  69173. function _getYCoord(canvas, pos, offset, width) {
  69174. var y = 0;
  69175. if ("top" === pos) {
  69176. y = canvas.top - offset
  69177. } else {
  69178. if ("bottom" === pos) {
  69179. y = canvas.height - canvas.bottom + width + offset
  69180. }
  69181. }
  69182. return y
  69183. }
  69184. ScrollBar.prototype = {
  69185. _addEvents: function() {
  69186. var _this = this;
  69187. var scrollElement = this._scroll.element;
  69188. _events_engine2.default.on(scrollElement, _drag2.default.start, function(e) {
  69189. _utils2.default.fireEvent({
  69190. type: "dxc-scroll-start",
  69191. originalEvent: e,
  69192. target: scrollElement
  69193. })
  69194. });
  69195. _events_engine2.default.on(scrollElement, _drag2.default.move, function(e) {
  69196. var dX = -e.offset.x * _this._scale;
  69197. var dY = -e.offset.y * _this._scale;
  69198. var lx = _this._offset - (_this._layoutOptions.vertical ? dY : dX) / _this._scale;
  69199. _this._applyPosition(lx, lx + _this._translator.canvasLength / _this._scale);
  69200. _utils2.default.fireEvent({
  69201. type: "dxc-scroll-move",
  69202. originalEvent: e,
  69203. target: scrollElement,
  69204. offset: {
  69205. x: dX,
  69206. y: dY
  69207. }
  69208. })
  69209. });
  69210. _events_engine2.default.on(scrollElement, _drag2.default.end, function(e) {
  69211. _utils2.default.fireEvent({
  69212. type: "dxc-scroll-end",
  69213. originalEvent: e,
  69214. target: scrollElement,
  69215. offset: {
  69216. x: -e.offset.x * _this._scale,
  69217. y: -e.offset.y * _this._scale
  69218. }
  69219. })
  69220. })
  69221. },
  69222. update: function(options) {
  69223. var that = this;
  69224. var position = options.position;
  69225. var isVertical = options.rotated;
  69226. var defaultPosition = isVertical ? "right" : "top";
  69227. var secondaryPosition = isVertical ? "left" : "bottom";
  69228. if (position !== defaultPosition && position !== secondaryPosition) {
  69229. position = defaultPosition
  69230. }
  69231. that._scroll.attr({
  69232. rotate: !options.rotated ? -90 : 0,
  69233. rotateX: 0,
  69234. rotateY: 0,
  69235. fill: options.color,
  69236. width: options.width,
  69237. opacity: options.opacity
  69238. });
  69239. that._layoutOptions = {
  69240. width: options.width,
  69241. offset: options.offset,
  69242. vertical: isVertical,
  69243. position: position
  69244. };
  69245. return that
  69246. },
  69247. init: function(range, stick) {
  69248. var that = this;
  69249. var isDiscrete = "discrete" === range.axisType;
  69250. that._translateWithOffset = isDiscrete && !stick && 1 || 0;
  69251. that._translator.update((0, _extend.extend)({}, range, {
  69252. minVisible: null,
  69253. maxVisible: null,
  69254. visibleCategories: null
  69255. }, isDiscrete && {
  69256. min: null,
  69257. max: null
  69258. } || {}), that._canvas, {
  69259. isHorizontal: !that._layoutOptions.vertical,
  69260. stick: stick
  69261. });
  69262. return that
  69263. },
  69264. getOptions: function() {
  69265. return this._layoutOptions
  69266. },
  69267. setPane: function(panes) {
  69268. var position = this._layoutOptions.position;
  69269. var pane;
  69270. if ("left" === position || "top" === position) {
  69271. pane = panes[0]
  69272. } else {
  69273. pane = panes[panes.length - 1]
  69274. }
  69275. this.pane = pane.name;
  69276. return this
  69277. },
  69278. updateSize: function(canvas) {
  69279. this._canvas = (0, _extend.extend)({}, canvas);
  69280. var options = this._layoutOptions;
  69281. var pos = options.position;
  69282. var offset = options.offset;
  69283. var width = options.width;
  69284. this._scroll.attr({
  69285. translateX: _getXCoord(canvas, pos, offset, width),
  69286. translateY: _getYCoord(canvas, pos, offset, width)
  69287. })
  69288. },
  69289. getMultipleAxesSpacing: function() {
  69290. return 0
  69291. },
  69292. estimateMargins: function() {
  69293. return this.getMargins()
  69294. },
  69295. getMargins: function() {
  69296. var options = this._layoutOptions;
  69297. var margins = {
  69298. left: 0,
  69299. top: 0,
  69300. right: 0,
  69301. bottom: 0
  69302. };
  69303. margins[options.position] = options.width + options.offset;
  69304. return margins
  69305. },
  69306. draw: _common.noop,
  69307. shift: _common.noop,
  69308. hideTitle: _common.noop,
  69309. hideOuterElements: _common.noop,
  69310. prepareAnimation: _common.noop,
  69311. setPosition: function(min, max) {
  69312. var that = this;
  69313. var translator = that._translator;
  69314. var minPoint = (0, _type.isDefined)(min) ? translator.translate(min, -that._translateWithOffset) : translator.translate("canvas_position_start");
  69315. var maxPoint = (0, _type.isDefined)(max) ? translator.translate(max, that._translateWithOffset) : translator.translate("canvas_position_end");
  69316. that._offset = _min(minPoint, maxPoint);
  69317. that._scale = translator.getScale(min, max);
  69318. that._applyPosition(_min(minPoint, maxPoint), _max(minPoint, maxPoint))
  69319. },
  69320. dispose: function() {
  69321. this._scroll.dispose();
  69322. this._scroll = this._translator = null
  69323. },
  69324. _applyPosition: function(x1, x2) {
  69325. var that = this;
  69326. var visibleArea = that._translator.getCanvasVisibleArea();
  69327. x1 = _max(x1, visibleArea.min);
  69328. x1 = _min(x1, visibleArea.max);
  69329. x2 = _min(x2, visibleArea.max);
  69330. x2 = _max(x2, visibleArea.min);
  69331. var height = Math.abs(x2 - x1);
  69332. that._scroll.attr({
  69333. y: x1,
  69334. height: height < MIN_SCROLL_BAR_SIZE ? MIN_SCROLL_BAR_SIZE : height
  69335. })
  69336. }
  69337. };
  69338. exports.ScrollBar = ScrollBar
  69339. },
  69340. /*!*******************************************************************!*\
  69341. !*** ./artifacts/transpiled/viz/chart_components/shutter_zoom.js ***!
  69342. \*******************************************************************/
  69343. /*! dynamic exports provided */
  69344. /*! all exports used */
  69345. function(module, exports, __webpack_require__) {
  69346. var dragEvents = __webpack_require__( /*! ../../events/drag */ 56);
  69347. var SHUTTER_EVENTS_NS = ".shutter-zoom";
  69348. var DRAG_START_EVENT_NAME = dragEvents.start + SHUTTER_EVENTS_NS;
  69349. var DRAG_UPDATE_EVENT_NAME = dragEvents.move + SHUTTER_EVENTS_NS;
  69350. var DRAG_END_EVENT_NAME = dragEvents.end + SHUTTER_EVENTS_NS;
  69351. function getPointerCoord(rootOffset, canvas, rotated, e) {
  69352. var coord = Math.floor(rotated ? e.pageY - rootOffset.top : e.pageX - rootOffset.left);
  69353. var min = rotated ? canvas.y1 : canvas.x1;
  69354. var max = rotated ? canvas.y2 : canvas.x2;
  69355. if (coord < min) {
  69356. coord = min
  69357. } else {
  69358. if (coord > max) {
  69359. coord = max
  69360. }
  69361. }
  69362. return coord
  69363. }
  69364. function checkCoords(rootOffset, canvas, e) {
  69365. var x = e.pageX - rootOffset.left;
  69366. var y = e.pageY - rootOffset.top;
  69367. return x >= canvas.x1 && x <= canvas.x2 && y >= canvas.y1 && y <= canvas.y2
  69368. }
  69369. function dragStartHandler(ctx) {
  69370. return function(e) {
  69371. var offset = ctx.getRootOffset();
  69372. var canvas = ctx.getCanvas();
  69373. if (!checkCoords(offset, canvas, e)) {
  69374. e.cancel = true;
  69375. return
  69376. }
  69377. ctx.rootOffset = offset;
  69378. ctx.canvas = canvas;
  69379. ctx.startCoord = getPointerCoord(offset, canvas, ctx.rotated, e);
  69380. ctx.triggerStart();
  69381. ctx.rect.attr({
  69382. x: canvas.x1,
  69383. y: canvas.y1,
  69384. width: canvas.width,
  69385. height: canvas.height
  69386. }).append(ctx.root)
  69387. }
  69388. }
  69389. function dragHandler(ctx) {
  69390. return function(e) {
  69391. var curCoord = getPointerCoord(ctx.rootOffset, ctx.canvas, ctx.rotated, e);
  69392. var attr = {};
  69393. ctx.curCoord = curCoord;
  69394. attr[ctx.rotated ? "y" : "x"] = Math.min(ctx.startCoord, curCoord);
  69395. attr[ctx.rotated ? "height" : "width"] = Math.abs(ctx.startCoord - curCoord);
  69396. ctx.rect.attr(attr)
  69397. }
  69398. }
  69399. function dragEndHandler(ctx) {
  69400. return function(e) {
  69401. ctx.triggerEnd();
  69402. ctx.rect.remove()
  69403. }
  69404. }
  69405. function shutterZoom(options) {
  69406. var chart = options.chart;
  69407. var renderer = options.renderer;
  69408. var rotated = options.rotated;
  69409. var rect = renderer.rect(0, 0, 0, 0).attr(options.shutterOptions);
  69410. var shutter = {
  69411. rect: rect,
  69412. root: renderer.root,
  69413. rotated: rotated,
  69414. triggerStart: function() {
  69415. chart._eventTrigger("zoomStart")
  69416. },
  69417. triggerEnd: function() {
  69418. var tr = chart._argumentAxes[0].getTranslator();
  69419. var rangeStart = Math.min(this.startCoord, this.curCoord);
  69420. var rangeEnd = Math.max(this.startCoord, this.curCoord);
  69421. chart._eventTrigger("zoomEnd", {
  69422. rangeStart: tr.from(rangeStart),
  69423. rangeEnd: tr.from(rangeEnd)
  69424. })
  69425. },
  69426. dispose: function() {
  69427. renderer.root.off(SHUTTER_EVENTS_NS);
  69428. rect.dispose()
  69429. },
  69430. getRootOffset: function() {
  69431. return renderer.getRootOffset()
  69432. },
  69433. getCanvas: function() {
  69434. var canvas = chart._canvas;
  69435. var panes = chart.panes;
  69436. var firstPane = panes[0].canvas;
  69437. var lastPane = panes[panes.length - 1].canvas;
  69438. return {
  69439. x1: firstPane.left,
  69440. y1: firstPane.top,
  69441. x2: canvas.width - lastPane.right,
  69442. y2: canvas.height - lastPane.bottom,
  69443. width: canvas.width - firstPane.left - lastPane.right,
  69444. height: canvas.height - firstPane.top - lastPane.bottom
  69445. }
  69446. }
  69447. };
  69448. renderer.root.off(SHUTTER_EVENTS_NS).on(DRAG_START_EVENT_NAME, {
  69449. direction: rotated ? "vertical" : "horizontal",
  69450. immediate: true
  69451. }, dragStartHandler(shutter)).on(DRAG_UPDATE_EVENT_NAME, dragHandler(shutter)).on(DRAG_END_EVENT_NAME, dragEndHandler(shutter));
  69452. return shutter
  69453. }
  69454. module.exports = {
  69455. name: "shutter_zoom",
  69456. init: function() {
  69457. var options = this.option("shutterZoom") || {};
  69458. if (!options.enabled) {
  69459. return
  69460. }
  69461. this._shutterZoom = shutterZoom({
  69462. chart: this,
  69463. renderer: this._renderer,
  69464. rotated: this.option("rotated"),
  69465. shutterOptions: options
  69466. })
  69467. },
  69468. dispose: function() {
  69469. this._shutterZoom && this._shutterZoom.dispose()
  69470. }
  69471. }
  69472. },
  69473. /*!*******************************************************************!*\
  69474. !*** ./artifacts/transpiled/viz/chart_components/zoom_and_pan.js ***!
  69475. \*******************************************************************/
  69476. /*! dynamic exports provided */
  69477. /*! all exports used */
  69478. function(module, exports, __webpack_require__) {
  69479. var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
  69480. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  69481. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  69482. var _wheel = __webpack_require__( /*! ../../events/core/wheel */ 124);
  69483. var _transform = __webpack_require__( /*! ../../events/transform */ 285);
  69484. var _transform2 = _interopRequireDefault(_transform);
  69485. var _drag = __webpack_require__( /*! ../../events/drag */ 56);
  69486. var _drag2 = _interopRequireDefault(_drag);
  69487. function _interopRequireDefault(obj) {
  69488. return obj && obj.__esModule ? obj : {
  69489. "default": obj
  69490. }
  69491. }
  69492. var EVENTS_NS = ".zoomAndPanNS";
  69493. var DRAG_START_EVENT_NAME = _drag2.default.start + EVENTS_NS;
  69494. var DRAG_EVENT_NAME = _drag2.default.move + EVENTS_NS;
  69495. var DRAG_END_EVENT_NAME = _drag2.default.end + EVENTS_NS;
  69496. var PINCH_START_EVENT_NAME = _transform2.default.pinchstart + EVENTS_NS;
  69497. var PINCH_EVENT_NAME = _transform2.default.pinch + EVENTS_NS;
  69498. var PINCH_END_EVENT_NAME = _transform2.default.pinchend + EVENTS_NS;
  69499. var SCROLL_BAR_START_EVENT_NAME = "dxc-scroll-start" + EVENTS_NS;
  69500. var SCROLL_BAR_MOVE_EVENT_NAME = "dxc-scroll-move" + EVENTS_NS;
  69501. var SCROLL_BAR_END_EVENT_NAME = "dxc-scroll-end" + EVENTS_NS;
  69502. var GESTURE_TIMEOUT = 300;
  69503. var MIN_DRAG_DELTA = 5;
  69504. var _min = Math.min;
  69505. var _max = Math.max;
  69506. var _abs = Math.abs;
  69507. function canvasToRect(canvas) {
  69508. return {
  69509. x: canvas.left,
  69510. y: canvas.top,
  69511. width: canvas.width - canvas.left - canvas.right,
  69512. height: canvas.height - canvas.top - canvas.bottom
  69513. }
  69514. }
  69515. function checkCoords(rect, coords) {
  69516. var x = coords.x;
  69517. var y = coords.y;
  69518. return x >= rect.x && x <= rect.width + rect.x && y >= rect.y && y <= rect.height + rect.y
  69519. }
  69520. function sortAxes(axes, onlyAxisToNotify) {
  69521. if (onlyAxisToNotify) {
  69522. axes = axes.sort(function(a, b) {
  69523. if (a === onlyAxisToNotify) {
  69524. return -1
  69525. }
  69526. if (b === onlyAxisToNotify) {
  69527. return 1
  69528. }
  69529. return 0
  69530. })
  69531. }
  69532. return axes
  69533. }
  69534. function isNotEmptyAxisBusinessRange(axis) {
  69535. return !axis.getTranslator().getBusinessRange().isEmpty()
  69536. }
  69537. module.exports = {
  69538. name: "zoom_and_pan",
  69539. init: function() {
  69540. var chart = this;
  69541. var renderer = this._renderer;
  69542. function cancelEvent(e) {
  69543. if (e.originalEvent) {
  69544. cancelEvent(e.originalEvent)
  69545. }
  69546. if (false !== e.cancelable) {
  69547. e.cancel = true
  69548. }
  69549. }
  69550. function startAxesViewportChanging(zoomAndPan, actionField, e) {
  69551. var options = zoomAndPan.options;
  69552. var actionData = zoomAndPan.actionData;
  69553. var axes = [];
  69554. if (options.argumentAxis[actionField]) {
  69555. axes.push(chart.getArgumentAxis())
  69556. }
  69557. if (options.valueAxis[actionField]) {
  69558. axes = axes.concat(actionData.valueAxes)
  69559. }
  69560. axes.reduce(function(isPrevented, axis) {
  69561. if (isPrevented) {
  69562. return isPrevented
  69563. }
  69564. if (isNotEmptyAxisBusinessRange(axis)) {
  69565. return axis.handleZooming(null, {
  69566. end: true
  69567. }, e, actionField).isPrevented
  69568. }
  69569. return isPrevented
  69570. }, false) && cancelEvent(e)
  69571. }
  69572. function axesViewportChanging(zoomAndPan, actionField, e, offsetCalc, centerCalc) {
  69573. function zoomAxes(axes, criteria, coordField, e, actionData) {
  69574. var zoom = {
  69575. zoomed: false
  69576. };
  69577. criteria && axes.filter(isNotEmptyAxisBusinessRange).forEach(function(axis) {
  69578. var options = axis.getOptions();
  69579. var viewport = axis.visualRange();
  69580. var scale = axis.getTranslator().getEventScale(e);
  69581. var translate = -offsetCalc(e, actionData, coordField, scale);
  69582. zoom = (0, _extend.extend)(true, zoom, axis.getTranslator().zoom(translate, scale, axis.getZoomBounds()));
  69583. var range = axis.adjustRange((0, _utils.getVizRangeObject)([zoom.min, zoom.max]));
  69584. var isMinZoom = axis.isZoomingLowerLimitOvercome(actionField, scale, range);
  69585. if (!(0, _type.isDefined)(viewport) || viewport.startValue.valueOf() !== range.startValue.valueOf() || viewport.endValue.valueOf() !== range.endValue.valueOf()) {
  69586. axis.handleZooming(isMinZoom ? null : range, {
  69587. start: true,
  69588. end: true
  69589. }, e, actionField);
  69590. if (!isMinZoom) {
  69591. zoom.zoomed = true;
  69592. zoom.deltaTranslate = translate - zoom.translate
  69593. }
  69594. } else {
  69595. if ("touch" === e.pointerType && "discrete" === options.type) {
  69596. var isMinPosition = axis.isExtremePosition(false);
  69597. var isMaxPosition = axis.isExtremePosition(true);
  69598. var zoomInEnabled = scale > 1 && !isMinZoom;
  69599. var zoomOutEnabled = scale < 1 && (!isMinPosition || !isMaxPosition);
  69600. var panningEnabled = 1 === scale && !(isMinPosition && (translate < 0 && !options.inverted || translate > 0 && options.inverted) || isMaxPosition && (translate > 0 && !options.inverted || translate < 0 && options.inverted));
  69601. zoom.enabled = zoomInEnabled || zoomOutEnabled || panningEnabled
  69602. }
  69603. }
  69604. });
  69605. return zoom
  69606. }
  69607. function storeOffset(e, actionData, zoom, coordField) {
  69608. if (zoom.zoomed) {
  69609. actionData.offset[coordField] = (e.offset ? e.offset[coordField] : actionData.offset[coordField]) + zoom.deltaTranslate
  69610. }
  69611. }
  69612. function storeCenter(center, actionData, zoom, coordField) {
  69613. if (zoom.zoomed) {
  69614. actionData.center[coordField] = center[coordField] + zoom.deltaTranslate
  69615. }
  69616. }
  69617. var rotated = chart.option("rotated");
  69618. var actionData = zoomAndPan.actionData;
  69619. var options = zoomAndPan.options;
  69620. var argZoom = {};
  69621. var valZoom = {};
  69622. if (!actionData.fallback) {
  69623. argZoom = zoomAxes(chart._argumentAxes, options.argumentAxis[actionField], rotated ? "y" : "x", e, actionData);
  69624. valZoom = zoomAxes(actionData.valueAxes, options.valueAxis[actionField], rotated ? "x" : "y", e, actionData);
  69625. chart._requestChange(["VISUAL_RANGE"]);
  69626. storeOffset(e, actionData, argZoom, rotated ? "y" : "x");
  69627. storeOffset(e, actionData, valZoom, rotated ? "x" : "y")
  69628. }
  69629. var center = centerCalc(e);
  69630. storeCenter(center, actionData, argZoom, rotated ? "y" : "x");
  69631. storeCenter(center, actionData, valZoom, rotated ? "x" : "y");
  69632. if (!argZoom.zoomed && !valZoom.zoomed) {
  69633. actionData.center = center
  69634. }
  69635. return argZoom.zoomed || valZoom.zoomed || actionData.fallback || argZoom.enabled || valZoom.enabled
  69636. }
  69637. function finishAxesViewportChanging(zoomAndPan, actionField, e, offsetCalc) {
  69638. function zoomAxes(axes, criteria, coordField, e, actionData, onlyAxisToNotify) {
  69639. var zoomStarted = false;
  69640. criteria && axes.forEach(function(axis) {
  69641. var silent = onlyAxisToNotify && axis !== onlyAxisToNotify;
  69642. var scale = e.scale || 1;
  69643. var zoom = axis.getTranslator().zoom(-offsetCalc(e, actionData, coordField, scale), scale, axis.getZoomBounds());
  69644. var range = {
  69645. startValue: zoom.min,
  69646. endValue: zoom.max
  69647. };
  69648. var isMinZoom = axis.isZoomingLowerLimitOvercome(actionField, scale, range);
  69649. axis.handleZooming(isMinZoom ? null : range, {
  69650. start: true,
  69651. end: silent
  69652. }, e, actionField);
  69653. isMinZoom ? axis.handleZoomEnd() : zoomStarted = true
  69654. });
  69655. return zoomStarted
  69656. }
  69657. var rotated = chart.option("rotated");
  69658. var actionData = zoomAndPan.actionData;
  69659. var options = zoomAndPan.options;
  69660. var zoomStarted = true;
  69661. if (actionData.fallback) {
  69662. zoomStarted &= zoomAxes(chart._argumentAxes, options.argumentAxis[actionField], rotated ? "y" : "x", e, actionData, chart.getArgumentAxis());
  69663. zoomStarted |= zoomAxes(actionData.valueAxes, options.valueAxis[actionField], rotated ? "x" : "y", e, actionData)
  69664. } else {
  69665. var axes = [];
  69666. if (options.argumentAxis[actionField]) {
  69667. axes.push(chart.getArgumentAxis())
  69668. }
  69669. if (options.valueAxis[actionField]) {
  69670. axes = axes.concat(actionData.valueAxes)
  69671. }
  69672. axes.filter(isNotEmptyAxisBusinessRange).forEach(function(axis) {
  69673. axis.handleZooming(null, {
  69674. start: true
  69675. }, e, actionField)
  69676. });
  69677. zoomStarted = zoomStarted && axes.length
  69678. }
  69679. zoomStarted && chart._requestChange(["VISUAL_RANGE"])
  69680. }
  69681. function prepareActionData(coords, action) {
  69682. var axes = chart._argumentAxes.filter(function(axis) {
  69683. return checkCoords(canvasToRect(axis.getCanvas()), coords)
  69684. });
  69685. return {
  69686. fallback: chart._lastRenderingTime > GESTURE_TIMEOUT,
  69687. cancel: !axes.length || !(0, _type.isDefined)(action),
  69688. action: action,
  69689. curAxisRect: axes.length && canvasToRect(axes[0].getCanvas()),
  69690. valueAxes: axes.length && chart._valueAxes.filter(function(axis) {
  69691. return checkCoords(canvasToRect(axis.getCanvas()), coords)
  69692. }),
  69693. offset: {
  69694. x: 0,
  69695. y: 0
  69696. },
  69697. center: coords,
  69698. startCenter: coords
  69699. }
  69700. }
  69701. function getPointerCoord(rect, e) {
  69702. var rootOffset = renderer.getRootOffset();
  69703. return {
  69704. x: _min(_max(e.pageX - rootOffset.left, rect.x), rect.width + rect.x),
  69705. y: _min(_max(e.pageY - rootOffset.top, rect.y), rect.height + rect.y)
  69706. }
  69707. }
  69708. function calcCenterForPinch(e) {
  69709. var rootOffset = renderer.getRootOffset();
  69710. var x1 = e.pointers[0].pageX;
  69711. var x2 = e.pointers[1].pageX;
  69712. var y1 = e.pointers[0].pageY;
  69713. var y2 = e.pointers[1].pageY;
  69714. return {
  69715. x: _min(x1, x2) + _abs(x2 - x1) / 2 - rootOffset.left,
  69716. y: _min(y1, y2) + _abs(y2 - y1) / 2 - rootOffset.top
  69717. }
  69718. }
  69719. function calcCenterForDrag(e) {
  69720. var rootOffset = renderer.getRootOffset();
  69721. return {
  69722. x: e.pageX - rootOffset.left,
  69723. y: e.pageY - rootOffset.top
  69724. }
  69725. }
  69726. function calcOffsetForDrag(e, actionData, coordField) {
  69727. return e.offset[coordField] - actionData.offset[coordField]
  69728. }
  69729. function preventDefaults(e) {
  69730. if (false !== e.cancelable) {
  69731. e.preventDefault();
  69732. e.stopPropagation()
  69733. }
  69734. chart._stopCurrentHandling()
  69735. }
  69736. var zoomAndPan = {
  69737. dragStartHandler: function(e) {
  69738. var options = zoomAndPan.options;
  69739. var isTouch = "touch" === e.pointerType;
  69740. var wantPan = options.argumentAxis.pan || options.valueAxis.pan;
  69741. var wantZoom = options.argumentAxis.zoom || options.valueAxis.zoom;
  69742. var panKeyPressed = (0, _type.isDefined)(options.panKey) && e[(0, _utils.normalizeEnum)(options.panKey) + "Key"];
  69743. var dragToZoom = options.dragToZoom;
  69744. var action;
  69745. e._cancelPreventDefault = true;
  69746. if (isTouch) {
  69747. if (options.allowTouchGestures && wantPan) {
  69748. var cancelPanning = !zoomAndPan.panningVisualRangeEnabled() || zoomAndPan.skipEvent;
  69749. action = cancelPanning ? null : "pan"
  69750. }
  69751. } else {
  69752. if (dragToZoom && wantPan && panKeyPressed) {
  69753. action = "pan"
  69754. } else {
  69755. if (!dragToZoom && wantPan) {
  69756. action = "pan"
  69757. } else {
  69758. if (dragToZoom && wantZoom) {
  69759. action = "zoom"
  69760. }
  69761. }
  69762. }
  69763. }
  69764. var actionData = prepareActionData(calcCenterForDrag(e), action);
  69765. if (actionData.cancel) {
  69766. zoomAndPan.skipEvent = false;
  69767. if (false !== e.cancelable) {
  69768. e.cancel = true
  69769. }
  69770. return
  69771. }
  69772. zoomAndPan.actionData = actionData;
  69773. if ("zoom" === action) {
  69774. actionData.startCoords = getPointerCoord(actionData.curAxisRect, e);
  69775. actionData.rect = renderer.rect(0, 0, 0, 0).attr(options.dragBoxStyle).append(renderer.root)
  69776. } else {
  69777. startAxesViewportChanging(zoomAndPan, "pan", e)
  69778. }
  69779. },
  69780. dragHandler: function(e) {
  69781. var rotated = chart.option("rotated");
  69782. var options = zoomAndPan.options;
  69783. var actionData = zoomAndPan.actionData;
  69784. var isTouch = "touch" === e.pointerType;
  69785. e._cancelPreventDefault = true;
  69786. if (!actionData || isTouch && !zoomAndPan.panningVisualRangeEnabled()) {
  69787. return
  69788. }
  69789. if ("zoom" === actionData.action) {
  69790. preventDefaults(e);
  69791. var curCanvas = actionData.curAxisRect;
  69792. var startCoords = actionData.startCoords;
  69793. var curCoords = getPointerCoord(curCanvas, e);
  69794. var zoomArg = options.argumentAxis.zoom;
  69795. var zoomVal = options.valueAxis.zoom;
  69796. var rect = {
  69797. x: _min(startCoords.x, curCoords.x),
  69798. y: _min(startCoords.y, curCoords.y),
  69799. width: _abs(startCoords.x - curCoords.x),
  69800. height: _abs(startCoords.y - curCoords.y)
  69801. };
  69802. if (!zoomArg || !zoomVal) {
  69803. if (!zoomArg && !rotated || !zoomVal && rotated) {
  69804. rect.x = curCanvas.x;
  69805. rect.width = curCanvas.width
  69806. } else {
  69807. rect.y = curCanvas.y;
  69808. rect.height = curCanvas.height
  69809. }
  69810. }
  69811. actionData.rect.attr(rect)
  69812. } else {
  69813. if ("pan" === actionData.action) {
  69814. axesViewportChanging(zoomAndPan, "pan", e, calcOffsetForDrag, function(e) {
  69815. return e.offset
  69816. });
  69817. var deltaOffsetY = Math.abs(e.offset.y - actionData.offset.y);
  69818. var deltaOffsetX = Math.abs(e.offset.x - actionData.offset.x);
  69819. if (isTouch && (deltaOffsetY > MIN_DRAG_DELTA && deltaOffsetY > Math.abs(actionData.offset.x) || deltaOffsetX > MIN_DRAG_DELTA && deltaOffsetX > Math.abs(actionData.offset.y))) {
  69820. return
  69821. }
  69822. preventDefaults(e)
  69823. }
  69824. }
  69825. },
  69826. dragEndHandler: function(e) {
  69827. var rotated = chart.option("rotated");
  69828. var options = zoomAndPan.options;
  69829. var actionData = zoomAndPan.actionData;
  69830. var isTouch = "touch" === e.pointerType;
  69831. var panIsEmpty = actionData && "pan" === actionData.action && !actionData.fallback && 0 === actionData.offset.x && 0 === actionData.offset.y;
  69832. if (!actionData || isTouch && !zoomAndPan.panningVisualRangeEnabled() || panIsEmpty) {
  69833. return
  69834. }(!isTouch || !zoomAndPan.actionData.isNative) && preventDefaults(e);
  69835. if ("zoom" === actionData.action) {
  69836. var zoomAxes = function(axes, criteria, coordField, startCoords, curCoords, onlyAxisToNotify) {
  69837. axes = sortAxes(axes, onlyAxisToNotify);
  69838. var curCoord = curCoords[coordField];
  69839. var startCoord = startCoords[coordField];
  69840. var zoomStarted = false;
  69841. if (criteria && _abs(curCoord - startCoord) > MIN_DRAG_DELTA) {
  69842. axes.some(function(axis) {
  69843. var tr = axis.getTranslator();
  69844. if (tr.getBusinessRange().isEmpty()) {
  69845. return
  69846. }
  69847. var silent = onlyAxisToNotify && axis !== onlyAxisToNotify;
  69848. var range = [tr.from(startCoord), tr.from(curCoord)];
  69849. var isMinZoom = axis.isZoomingLowerLimitOvercome(actionData.action, tr.getMinScale(true), range);
  69850. var result = axis.handleZooming(isMinZoom ? null : range, {
  69851. start: !!silent,
  69852. end: !!silent
  69853. }, e, actionData.action);
  69854. isMinZoom ? axis.handleZoomEnd() : zoomStarted = true;
  69855. return onlyAxisToNotify && result.isPrevented
  69856. })
  69857. }
  69858. return zoomStarted
  69859. };
  69860. var curCoords = getPointerCoord(actionData.curAxisRect, e);
  69861. var argumentAxesZoomed = zoomAxes(chart._argumentAxes, options.argumentAxis.zoom, rotated ? "y" : "x", actionData.startCoords, curCoords, chart.getArgumentAxis());
  69862. var valueAxesZoomed = zoomAxes(actionData.valueAxes, options.valueAxis.zoom, rotated ? "x" : "y", actionData.startCoords, curCoords);
  69863. if (valueAxesZoomed || argumentAxesZoomed) {
  69864. chart._requestChange(["VISUAL_RANGE"])
  69865. }
  69866. actionData.rect.dispose()
  69867. } else {
  69868. if ("pan" === actionData.action) {
  69869. finishAxesViewportChanging(zoomAndPan, "pan", e, calcOffsetForDrag)
  69870. }
  69871. }
  69872. zoomAndPan.actionData = null
  69873. },
  69874. pinchStartHandler: function(e) {
  69875. var actionData = prepareActionData(calcCenterForPinch(e), "zoom");
  69876. actionData.isNative = !zoomAndPan.panningVisualRangeEnabled();
  69877. if (actionData.cancel) {
  69878. cancelEvent(e);
  69879. return
  69880. }
  69881. zoomAndPan.actionData = actionData;
  69882. startAxesViewportChanging(zoomAndPan, "zoom", e)
  69883. },
  69884. pinchHandler: function(e) {
  69885. if (!zoomAndPan.actionData) {
  69886. return
  69887. }
  69888. var viewportChanged = axesViewportChanging(zoomAndPan, "zoom", e, function(e, actionData, coordField, scale) {
  69889. return calcCenterForPinch(e)[coordField] - actionData.center[coordField] + (actionData.center[coordField] - actionData.center[coordField] * scale)
  69890. }, calcCenterForPinch);
  69891. zoomAndPan.defineTouchBehavior(!viewportChanged, e);
  69892. !viewportChanged && (zoomAndPan.actionData = null)
  69893. },
  69894. pinchEndHandler: function(e) {
  69895. if (!zoomAndPan.actionData) {
  69896. return
  69897. }
  69898. finishAxesViewportChanging(zoomAndPan, "zoom", e, function(e, actionData, coordField, scale) {
  69899. return actionData.center[coordField] - actionData.startCenter[coordField] + (actionData.startCenter[coordField] - actionData.startCenter[coordField] * scale)
  69900. });
  69901. zoomAndPan.actionData = null
  69902. },
  69903. cleanup: function() {
  69904. renderer.root.off(EVENTS_NS);
  69905. zoomAndPan.actionData && zoomAndPan.actionData.rect && zoomAndPan.actionData.rect.dispose();
  69906. zoomAndPan.actionData = null;
  69907. renderer.root.css({
  69908. "touch-action": "",
  69909. "-ms-touch-action": ""
  69910. })
  69911. },
  69912. setup: function(options) {
  69913. zoomAndPan.cleanup();
  69914. if (!options.argumentAxis.pan) {
  69915. renderer.root.on(SCROLL_BAR_START_EVENT_NAME, cancelEvent)
  69916. }
  69917. if (options.argumentAxis.none && options.valueAxis.none) {
  69918. return
  69919. }
  69920. zoomAndPan.options = options;
  69921. var rotated = chart.option("rotated");
  69922. if ((options.argumentAxis.zoom || options.valueAxis.zoom) && options.allowMouseWheel) {
  69923. renderer.root.on(_wheel.name + EVENTS_NS, function(e) {
  69924. function zoomAxes(axes, coord, delta, onlyAxisToNotify) {
  69925. axes = sortAxes(axes, onlyAxisToNotify);
  69926. var zoomStarted = false;
  69927. axes.some(function(axis) {
  69928. var translator = axis.getTranslator();
  69929. if (translator.getBusinessRange().isEmpty()) {
  69930. return
  69931. }
  69932. var silent = onlyAxisToNotify && axis !== onlyAxisToNotify;
  69933. var scale = translator.getMinScale(delta > 0);
  69934. var zoom = translator.zoom(-(coord - coord * scale), scale, axis.getZoomBounds());
  69935. var range = {
  69936. startValue: zoom.min,
  69937. endValue: zoom.max
  69938. };
  69939. var isMinZoom = axis.isZoomingLowerLimitOvercome("zoom", scale, range);
  69940. var result = axis.handleZooming(isMinZoom ? null : range, {
  69941. start: !!silent,
  69942. end: !!silent
  69943. }, e, "zoom");
  69944. isMinZoom ? axis.handleZoomEnd() : zoomStarted = true;
  69945. return onlyAxisToNotify && result.isPrevented
  69946. });
  69947. return !!zoomStarted
  69948. }
  69949. var coords = calcCenterForDrag(e);
  69950. var axesZoomed = false;
  69951. var targetAxes;
  69952. if (options.valueAxis.zoom) {
  69953. targetAxes = chart._valueAxes.filter(function(axis) {
  69954. return checkCoords(canvasToRect(axis.getCanvas()), coords)
  69955. });
  69956. if (0 === targetAxes.length) {
  69957. var targetCanvas = chart._valueAxes.reduce(function(r, axis) {
  69958. if (!r && axis.coordsIn(coords.x, coords.y)) {
  69959. r = axis.getCanvas()
  69960. }
  69961. return r
  69962. }, null);
  69963. if (targetCanvas) {
  69964. targetAxes = chart._valueAxes.filter(function(axis) {
  69965. return checkCoords(canvasToRect(axis.getCanvas()), {
  69966. x: targetCanvas.left,
  69967. y: targetCanvas.top
  69968. })
  69969. })
  69970. }
  69971. }
  69972. axesZoomed |= zoomAxes(targetAxes, rotated ? coords.x : coords.y, e.delta)
  69973. }
  69974. if (options.argumentAxis.zoom) {
  69975. var canZoom = chart._argumentAxes.some(function(axis) {
  69976. if (checkCoords(canvasToRect(axis.getCanvas()), coords) || axis.coordsIn(coords.x, coords.y)) {
  69977. return true
  69978. }
  69979. return false
  69980. });
  69981. axesZoomed |= canZoom && zoomAxes(chart._argumentAxes, rotated ? coords.y : coords.x, e.delta, chart.getArgumentAxis())
  69982. }
  69983. if (axesZoomed) {
  69984. chart._requestChange(["VISUAL_RANGE"]);
  69985. zoomAndPan.panningVisualRangeEnabled(targetAxes) && preventDefaults(e)
  69986. }
  69987. })
  69988. }
  69989. if (options.allowTouchGestures) {
  69990. if (options.argumentAxis.zoom || options.valueAxis.zoom) {
  69991. renderer.root.on(PINCH_START_EVENT_NAME, {
  69992. passive: false
  69993. }, zoomAndPan.pinchStartHandler).on(PINCH_EVENT_NAME, {
  69994. passive: false
  69995. }, zoomAndPan.pinchHandler).on(PINCH_END_EVENT_NAME, zoomAndPan.pinchEndHandler)
  69996. }
  69997. }
  69998. renderer.root.on(DRAG_START_EVENT_NAME, {
  69999. immediate: true,
  70000. passive: false
  70001. }, zoomAndPan.dragStartHandler).on(DRAG_EVENT_NAME, {
  70002. immediate: true,
  70003. passive: false
  70004. }, zoomAndPan.dragHandler).on(DRAG_END_EVENT_NAME, zoomAndPan.dragEndHandler);
  70005. if (options.argumentAxis.pan) {
  70006. renderer.root.on(SCROLL_BAR_START_EVENT_NAME, function(e) {
  70007. zoomAndPan.actionData = {
  70008. valueAxes: [],
  70009. offset: {
  70010. x: 0,
  70011. y: 0
  70012. },
  70013. center: {
  70014. x: 0,
  70015. y: 0
  70016. }
  70017. };
  70018. preventDefaults(e);
  70019. startAxesViewportChanging(zoomAndPan, "pan", e)
  70020. }).on(SCROLL_BAR_MOVE_EVENT_NAME, function(e) {
  70021. preventDefaults(e);
  70022. axesViewportChanging(zoomAndPan, "pan", e, calcOffsetForDrag, function(e) {
  70023. return e.offset
  70024. })
  70025. }).on(SCROLL_BAR_END_EVENT_NAME, function(e) {
  70026. preventDefaults(e);
  70027. finishAxesViewportChanging(zoomAndPan, "pan", e, calcOffsetForDrag);
  70028. zoomAndPan.actionData = null
  70029. })
  70030. }
  70031. },
  70032. defineTouchBehavior: function(isDefault, e) {
  70033. zoomAndPan.actionData && (zoomAndPan.actionData.isNative = isDefault);
  70034. if (!isDefault) {
  70035. preventDefaults(e)
  70036. }
  70037. },
  70038. panningVisualRangeEnabled: function(targetAxes) {
  70039. if (targetAxes && targetAxes.length) {
  70040. return targetAxes.some(function(axis) {
  70041. return !axis.isExtremePosition(false) || !axis.isExtremePosition(true)
  70042. })
  70043. }
  70044. var enablePanByValueAxis = chart._valueAxes.some(function(axis) {
  70045. return !axis.isExtremePosition(false) || !axis.isExtremePosition(true)
  70046. });
  70047. var enablePanByArgumentAxis = chart._argumentAxes.some(function(axis) {
  70048. return !axis.isExtremePosition(false) || !axis.isExtremePosition(true)
  70049. });
  70050. return enablePanByValueAxis || enablePanByArgumentAxis
  70051. }
  70052. };
  70053. this._zoomAndPan = zoomAndPan
  70054. },
  70055. members: {
  70056. _setupZoomAndPan: function() {
  70057. this._zoomAndPan.setup(this._themeManager.getOptions("zoomAndPan"))
  70058. }
  70059. },
  70060. dispose: function() {
  70061. this._zoomAndPan.cleanup()
  70062. },
  70063. customize: function(constructor) {
  70064. constructor.addChange({
  70065. code: "ZOOM_AND_PAN",
  70066. handler: function() {
  70067. this._setupZoomAndPan()
  70068. },
  70069. isThemeDependent: true,
  70070. isOptionChange: true,
  70071. option: "zoomAndPan"
  70072. })
  70073. }
  70074. }
  70075. },
  70076. /*!***********************************************!*\
  70077. !*** ./artifacts/transpiled/viz/pie_chart.js ***!
  70078. \***********************************************/
  70079. /*! dynamic exports provided */
  70080. /*! all exports used */
  70081. function(module, exports, __webpack_require__) {
  70082. var _consts = __webpack_require__( /*! ./components/consts */ 117);
  70083. var _utils = __webpack_require__( /*! ./core/utils */ 10);
  70084. var _extend2 = __webpack_require__( /*! ../core/utils/extend */ 0);
  70085. var _type = __webpack_require__( /*! ../core/utils/type */ 1);
  70086. var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
  70087. var _range = __webpack_require__( /*! ./translators/range */ 108);
  70088. var _range2 = _interopRequireDefault(_range);
  70089. var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9);
  70090. var _component_registrator2 = _interopRequireDefault(_component_registrator);
  70091. var _base_chart = __webpack_require__( /*! ./chart_components/base_chart */ 240);
  70092. var _common = __webpack_require__( /*! ../core/utils/common */ 4);
  70093. var _translator1d = __webpack_require__( /*! ./translators/translator1d */ 412);
  70094. var _translator1d2 = _interopRequireDefault(_translator1d);
  70095. function _interopRequireDefault(obj) {
  70096. return obj && obj.__esModule ? obj : {
  70097. "default": obj
  70098. }
  70099. }
  70100. var OPTIONS_FOR_REFRESH_SERIES = ["startAngle", "innerRadius", "segmentsDirection", "type"];
  70101. var NORMAL_STATE = _consts.states.normalMark;
  70102. var MAX_RESOLVE_ITERATION_COUNT = 5;
  70103. var LEGEND_ACTIONS = [_consts.states.resetItem, _consts.states.applyHover, _consts.states.applySelected, _consts.states.applySelected];
  70104. function getLegendItemAction(points) {
  70105. var state = NORMAL_STATE;
  70106. points.forEach(function(point) {
  70107. state |= point.fullState
  70108. });
  70109. return LEGEND_ACTIONS[state]
  70110. }
  70111. function correctPercentValue(value) {
  70112. if ((0, _type.isNumeric)(value)) {
  70113. if (value > 1) {
  70114. value = 1
  70115. } else {
  70116. if (value < 0) {
  70117. value = 0
  70118. }
  70119. }
  70120. } else {
  70121. value = void 0
  70122. }
  70123. return value
  70124. }
  70125. var dxPieChart = _base_chart.BaseChart.inherit({
  70126. _themeSection: "pie",
  70127. _layoutManagerOptions: function() {
  70128. return (0, _extend2.extend)(true, {}, this.callBase(), {
  70129. piePercentage: correctPercentValue(this._themeManager.getOptions("diameter")),
  70130. minPiePercentage: correctPercentValue(this._themeManager.getOptions("minDiameter"))
  70131. })
  70132. },
  70133. _optionChangesMap: {
  70134. diameter: "REINIT",
  70135. minDiameter: "REINIT",
  70136. sizeGroup: "REINIT"
  70137. },
  70138. _disposeCore: function() {
  70139. pieSizeEqualizer.remove(this);
  70140. this.callBase()
  70141. },
  70142. _groupSeries: function() {
  70143. var series = this.series;
  70144. this._groupsData = {
  70145. groups: [{
  70146. series: series,
  70147. valueOptions: {
  70148. valueType: "numeric"
  70149. }
  70150. }],
  70151. argumentOptions: series[0] && series[0].getOptions()
  70152. }
  70153. },
  70154. getArgumentAxis: function() {
  70155. return null
  70156. },
  70157. _getValueAxis: function() {
  70158. var translator = (new _translator1d2.default.Translator1D).setCodomain(360, 0);
  70159. return {
  70160. getTranslator: function() {
  70161. return translator
  70162. },
  70163. setBusinessRange: function(range) {
  70164. translator.setDomain(range.min, range.max)
  70165. }
  70166. }
  70167. },
  70168. _populateBusinessRange: function() {
  70169. this.series.map(function(series) {
  70170. var range = new _range2.default.Range;
  70171. range.addRange(series.getRangeData().val);
  70172. series.getValueAxis().setBusinessRange(range);
  70173. return range
  70174. })
  70175. },
  70176. _specialProcessSeries: function() {
  70177. (0, _iterator.each)(this.series, function(_, singleSeries) {
  70178. singleSeries.arrangePoints()
  70179. })
  70180. },
  70181. _checkPaneName: function() {
  70182. return true
  70183. },
  70184. _processSingleSeries: function(singleSeries) {
  70185. this.callBase(singleSeries);
  70186. singleSeries.arrangePoints()
  70187. },
  70188. _handleSeriesDataUpdated: function() {
  70189. var maxPointCount = 0;
  70190. this.series.forEach(function(s) {
  70191. maxPointCount = Math.max(s.getPointsCount(), maxPointCount)
  70192. });
  70193. this.series.forEach(function(s) {
  70194. s.setMaxPointsCount(maxPointCount)
  70195. });
  70196. this.callBase()
  70197. },
  70198. _getLegendOptions: function(item) {
  70199. var legendItem = this.callBase(item);
  70200. var legendData = legendItem.legendData;
  70201. legendData.argument = item.argument;
  70202. legendData.argumentIndex = item.argumentIndex;
  70203. legendData.points = [item];
  70204. return legendItem
  70205. },
  70206. _getLegendTargets: function() {
  70207. var that = this;
  70208. var itemsByArgument = {};
  70209. (that.series || []).forEach(function(series) {
  70210. series.getPoints().forEach(function(point) {
  70211. var argument = point.argument.valueOf();
  70212. var index = series.getPointsByArg(argument).indexOf(point);
  70213. var key = argument.valueOf().toString() + index;
  70214. itemsByArgument[key] = itemsByArgument[key] || [];
  70215. var argumentCount = itemsByArgument[key].push(point);
  70216. point.index = itemsByArgument[key][argumentCount - 2] ? itemsByArgument[key][argumentCount - 2].index : Object.keys(itemsByArgument).length - 1;
  70217. point.argumentIndex = index
  70218. })
  70219. });
  70220. var items = [];
  70221. (0, _iterator.each)(itemsByArgument, function(_, points) {
  70222. points.forEach(function(point, index) {
  70223. if (0 === index) {
  70224. items.push(that._getLegendOptions(point));
  70225. return
  70226. }
  70227. var item = items[items.length - 1];
  70228. item.legendData.points.push(point);
  70229. if (!item.visible) {
  70230. item.visible = point.isVisible()
  70231. }
  70232. })
  70233. });
  70234. return items
  70235. },
  70236. _getLayoutTargets: function() {
  70237. return [{
  70238. canvas: this._canvas
  70239. }]
  70240. },
  70241. _getLayoutSeries: function(series, drawOptions) {
  70242. var that = this;
  70243. var layout;
  70244. var canvas = that._canvas;
  70245. var drawnLabels = false;
  70246. layout = that.layoutManager.applyPieChartSeriesLayout(canvas, series, true);
  70247. series.forEach(function(singleSeries) {
  70248. singleSeries.correctPosition(layout, canvas);
  70249. drawnLabels = singleSeries.drawLabelsWOPoints() || drawnLabels
  70250. });
  70251. if (drawnLabels) {
  70252. layout = that.layoutManager.applyPieChartSeriesLayout(canvas, series, drawOptions.hideLayoutLabels)
  70253. }
  70254. series.forEach(function(singleSeries) {
  70255. singleSeries.hideLabels()
  70256. });
  70257. that._sizeGroupLayout = {
  70258. x: layout.centerX,
  70259. y: layout.centerY,
  70260. radius: layout.radiusOuter,
  70261. drawOptions: drawOptions
  70262. };
  70263. return layout
  70264. },
  70265. _getLayoutSeriesForEqualPies: function(series, sizeGroupLayout) {
  70266. var canvas = this._canvas;
  70267. var layout = this.layoutManager.applyEqualPieChartLayout(series, sizeGroupLayout);
  70268. series.forEach(function(s) {
  70269. s.correctPosition(layout, canvas);
  70270. s.drawLabelsWOPoints()
  70271. });
  70272. this.layoutManager.correctPieLabelRadius(series, layout, canvas);
  70273. return layout
  70274. },
  70275. _updateSeriesDimensions: function(drawOptions) {
  70276. var that = this;
  70277. var visibleSeries = that._getVisibleSeries();
  70278. var lengthVisibleSeries = visibleSeries.length;
  70279. var innerRad;
  70280. var delta;
  70281. var layout;
  70282. var sizeGroupLayout = drawOptions.sizeGroupLayout;
  70283. if (lengthVisibleSeries) {
  70284. layout = sizeGroupLayout ? that._getLayoutSeriesForEqualPies(visibleSeries, sizeGroupLayout) : that._getLayoutSeries(visibleSeries, drawOptions);
  70285. delta = (layout.radiusOuter - layout.radiusInner - _consts.pieSeriesSpacing * (lengthVisibleSeries - 1)) / lengthVisibleSeries;
  70286. innerRad = layout.radiusInner;
  70287. that._setCenter({
  70288. x: layout.centerX,
  70289. y: layout.centerY
  70290. });
  70291. visibleSeries.forEach(function(singleSeries) {
  70292. singleSeries.correctRadius({
  70293. radiusInner: innerRad,
  70294. radiusOuter: innerRad + delta
  70295. });
  70296. innerRad += delta + _consts.pieSeriesSpacing
  70297. })
  70298. }
  70299. },
  70300. _renderSeries: function(drawOptions, isRotated, isLegendInside) {
  70301. this._calculateSeriesLayout(drawOptions, isRotated);
  70302. if (!drawOptions.sizeGroupLayout && this.getSizeGroup()) {
  70303. pieSizeEqualizer.queue(this);
  70304. this._clearCanvas();
  70305. return
  70306. }
  70307. this._renderSeriesElements(drawOptions, isRotated, isLegendInside)
  70308. },
  70309. _getLegendCallBack: function() {
  70310. var that = this;
  70311. var legend = this._legend;
  70312. var items = this._getLegendTargets().map(function(i) {
  70313. return i.legendData
  70314. });
  70315. return function(target) {
  70316. items.forEach(function(data) {
  70317. var points = [];
  70318. var callback = legend.getActionCallback({
  70319. index: data.id
  70320. });
  70321. that.series.forEach(function(series) {
  70322. var seriesPoints = series.getPointsByKeys(data.argument, data.argumentIndex);
  70323. points.push.apply(points, seriesPoints)
  70324. });
  70325. if (target && target.argument === data.argument && target.argumentIndex === data.argumentIndex) {
  70326. points.push(target)
  70327. }
  70328. callback(getLegendItemAction(points))
  70329. })
  70330. }
  70331. },
  70332. _locateLabels: function(resolveLabelOverlapping) {
  70333. var iterationCount = 0;
  70334. var labelsWereOverlapped;
  70335. var wordWrapApplied;
  70336. do {
  70337. labelsWereOverlapped = this._resolveLabelOverlapping(resolveLabelOverlapping);
  70338. wordWrapApplied = this._adjustSeriesLabels("shift" === resolveLabelOverlapping)
  70339. } while ((labelsWereOverlapped || wordWrapApplied) && ++iterationCount < MAX_RESOLVE_ITERATION_COUNT)
  70340. },
  70341. _adjustSeriesLabels: function(moveLabelsFromCenter) {
  70342. return this.series.reduce(function(r, s) {
  70343. return s.adjustLabels(moveLabelsFromCenter) || r
  70344. }, false)
  70345. },
  70346. _prepareStackPoints: _common.noop,
  70347. _resetStackPoints: _common.noop,
  70348. _applyExtraSettings: _common.noop,
  70349. _resolveLabelOverlappingShift: function() {
  70350. var that = this;
  70351. var inverseDirection = "anticlockwise" === that.option("segmentsDirection");
  70352. var seriesByPosition = that.series.reduce(function(r, s) {
  70353. (r[s.getOptions().label.position] || r.outside).push(s);
  70354. return r
  70355. }, {
  70356. inside: [],
  70357. columns: [],
  70358. outside: []
  70359. });
  70360. var labelsOverlapped = false;
  70361. if (seriesByPosition.inside.length > 0) {
  70362. labelsOverlapped = resolve(seriesByPosition.inside.reduce(function(r, singleSeries) {
  70363. return singleSeries.getVisiblePoints().reduce(function(r, point) {
  70364. r.left.push(point);
  70365. return r
  70366. }, r)
  70367. }, {
  70368. left: [],
  70369. right: []
  70370. }), shiftInColumnFunction) || labelsOverlapped
  70371. }
  70372. labelsOverlapped = seriesByPosition.columns.reduce(function(r, singleSeries) {
  70373. return resolve(dividePoints(singleSeries), shiftInColumnFunction) || r
  70374. }, labelsOverlapped);
  70375. if (seriesByPosition.outside.length > 0) {
  70376. labelsOverlapped = resolve(seriesByPosition.outside.reduce(function(r, singleSeries) {
  70377. return dividePoints(singleSeries, r)
  70378. }, null), shiftFunction) || labelsOverlapped
  70379. }
  70380. return labelsOverlapped;
  70381. function dividePoints(series, points) {
  70382. return series.getVisiblePoints().reduce(function(r, point) {
  70383. var angle = (0, _utils.normalizeAngle)(point.middleAngle);
  70384. (angle <= 90 || angle >= 270 ? r.right : r.left).push(point);
  70385. return r
  70386. }, points || {
  70387. left: [],
  70388. right: []
  70389. })
  70390. }
  70391. function resolve(points, shiftCallback) {
  70392. var overlapped = false;
  70393. if (inverseDirection) {
  70394. points.left.reverse();
  70395. points.right.reverse()
  70396. }
  70397. overlapped = _base_chart.overlapping.resolveLabelOverlappingInOneDirection(points.left, that._canvas, false, shiftCallback);
  70398. return _base_chart.overlapping.resolveLabelOverlappingInOneDirection(points.right, that._canvas, false, shiftCallback) || overlapped
  70399. }
  70400. function shiftFunction(box, length) {
  70401. return (0, _utils.getVerticallyShiftedAngularCoords)(box, -length, that._center)
  70402. }
  70403. function shiftInColumnFunction(box, length) {
  70404. return {
  70405. x: box.x,
  70406. y: box.y - length
  70407. }
  70408. }
  70409. },
  70410. _setCenter: function(center) {
  70411. this._center = center
  70412. },
  70413. _disposeSeries: function(seriesIndex) {
  70414. this.callBase.apply(this, arguments);
  70415. this._abstractSeries = null
  70416. },
  70417. _legendDataField: "point",
  70418. _legendItemTextField: "argument",
  70419. _applyPointMarkersAutoHiding: _common.noop,
  70420. _renderTrackers: _common.noop,
  70421. _trackerType: "PieTracker",
  70422. _createScrollBar: _common.noop,
  70423. _updateAxesLayout: _common.noop,
  70424. _applyClipRects: _common.noop,
  70425. _appendAdditionalSeriesGroups: _common.noop,
  70426. _prepareToRender: _common.noop,
  70427. _isLegendInside: _common.noop,
  70428. _renderAxes: _common.noop,
  70429. _shrinkAxes: _common.noop,
  70430. _isRotated: _common.noop,
  70431. _seriesPopulatedHandlerCore: _common.noop,
  70432. _reinitAxes: _common.noop,
  70433. _correctAxes: _common.noop,
  70434. _getExtraOptions: function() {
  70435. var that = this;
  70436. return {
  70437. startAngle: that.option("startAngle"),
  70438. innerRadius: that.option("innerRadius"),
  70439. segmentsDirection: that.option("segmentsDirection"),
  70440. type: that.option("type")
  70441. }
  70442. },
  70443. getSizeGroup: function() {
  70444. return this._themeManager.getOptions("sizeGroup")
  70445. },
  70446. getSizeGroupLayout: function() {
  70447. return this._sizeGroupLayout || {}
  70448. }
  70449. });
  70450. (0, _iterator.each)(OPTIONS_FOR_REFRESH_SERIES, function(_, name) {
  70451. dxPieChart.prototype._optionChangesMap[name] = "REFRESH_SERIES_DATA_INIT"
  70452. });
  70453. (0, _component_registrator2.default)("dxPieChart", dxPieChart);
  70454. module.exports = dxPieChart;
  70455. var pieSizeEqualizer = function() {
  70456. function equalize(group, allPies) {
  70457. var pies = allPies.filter(function(p) {
  70458. return p._isVisible() && p.getSizeGroup() === group
  70459. });
  70460. var minRadius = Math.min.apply(null, pies.map(function(p) {
  70461. return p.getSizeGroupLayout().radius
  70462. }));
  70463. var minPie = pies.filter(function(p) {
  70464. return p.getSizeGroupLayout().radius === minRadius
  70465. });
  70466. pies.forEach(function(p) {
  70467. return p.render({
  70468. force: true,
  70469. sizeGroupLayout: minPie.length ? minPie[0].getSizeGroupLayout() : {}
  70470. })
  70471. })
  70472. }
  70473. function removeFromList(list, item) {
  70474. return list.filter(function(li) {
  70475. return li !== item
  70476. })
  70477. }
  70478. function addToList(list, item) {
  70479. return removeFromList(list, item).concat(item)
  70480. }
  70481. var pies = [];
  70482. var timers = {};
  70483. return {
  70484. queue: function(pie) {
  70485. var group = pie.getSizeGroup();
  70486. pies = addToList(pies, pie);
  70487. clearTimeout(timers[group]);
  70488. timers[group] = setTimeout(function() {
  70489. equalize(group, pies)
  70490. })
  70491. },
  70492. remove: function(pie) {
  70493. pies = removeFromList(pies, pie);
  70494. if (!pies.length) {
  70495. timers = {}
  70496. }
  70497. }
  70498. }
  70499. }()
  70500. },
  70501. /*!*************************************************!*\
  70502. !*** ./artifacts/transpiled/viz/polar_chart.js ***!
  70503. \*************************************************/
  70504. /*! dynamic exports provided */
  70505. /*! all exports used */
  70506. function(module, exports, __webpack_require__) {
  70507. var _noop = __webpack_require__( /*! ../core/utils/common */ 4).noop;
  70508. var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
  70509. var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
  70510. var vizUtils = __webpack_require__( /*! ./core/utils */ 10);
  70511. var AdvancedChart = __webpack_require__( /*! ./chart_components/advanced_chart */ 404).AdvancedChart;
  70512. var DEFAULT_PANE_NAME = "default";
  70513. var dxPolarChart = AdvancedChart.inherit({
  70514. _themeSection: "polar",
  70515. _createPanes: function() {
  70516. return [{
  70517. name: DEFAULT_PANE_NAME
  70518. }]
  70519. },
  70520. _checkPaneName: function() {
  70521. return true
  70522. },
  70523. _getAxisRenderingOptions: function(typeSelector) {
  70524. var isArgumentAxis = "argumentAxis" === typeSelector;
  70525. var type = isArgumentAxis ? "circular" : "linear";
  70526. var useSpiderWeb = this.option("useSpiderWeb");
  70527. if (useSpiderWeb) {
  70528. type += "Spider"
  70529. }
  70530. return {
  70531. axisType: "polarAxes",
  70532. drawingType: type
  70533. }
  70534. },
  70535. _prepareAxisOptions: function(typeSelector, axisOptions) {
  70536. var isArgumentAxis = "argumentAxis" === typeSelector;
  70537. var themeManager = this._themeManager;
  70538. var axisUserOptions = this.option("argumentAxis");
  70539. var argumentAxisOptions = themeManager.getOptions("argumentAxis", axisUserOptions) || {};
  70540. var startAngle = isFinite(argumentAxisOptions.startAngle) ? vizUtils.normalizeAngle(argumentAxisOptions.startAngle) : 0;
  70541. return {
  70542. type: this.option("useSpiderWeb") && isArgumentAxis ? "discrete" : axisOptions.type,
  70543. isHorizontal: true,
  70544. showCustomBoundaryTicks: isArgumentAxis,
  70545. startAngle: startAngle,
  70546. endAngle: startAngle + 360
  70547. }
  70548. },
  70549. _optionChangesMap: {
  70550. useSpiderWeb: "AXES_AND_PANES"
  70551. },
  70552. _getExtraOptions: function() {
  70553. return {
  70554. spiderWidget: this.option("useSpiderWeb")
  70555. }
  70556. },
  70557. _prepareToRender: function() {
  70558. this._appendAxesGroups();
  70559. return {}
  70560. },
  70561. _calcCanvas: function() {
  70562. var canvas = extend({}, this._canvas);
  70563. var argumentAxis = this.getArgumentAxis();
  70564. var margins = argumentAxis.getMargins();
  70565. Object.keys(margins).forEach(function(margin) {
  70566. return canvas[margin] = canvas["original".concat(margin[0].toUpperCase()).concat(margin.slice(1))] + margins[margin]
  70567. });
  70568. return canvas
  70569. },
  70570. _renderAxes: function(drawOptions) {
  70571. var that = this;
  70572. var valueAxis = that._getValueAxis();
  70573. var argumentAxis = that.getArgumentAxis();
  70574. argumentAxis.draw(that._canvas);
  70575. valueAxis.setSpiderTicks(argumentAxis.getSpiderTicks());
  70576. var canvas = that._calcCanvas();
  70577. argumentAxis.updateSize(canvas);
  70578. valueAxis.draw(canvas);
  70579. return canvas
  70580. },
  70581. _getValueAxis: function() {
  70582. return this._valueAxes[0]
  70583. },
  70584. _shrinkAxes: function(sizeStorage) {
  70585. var valueAxis = this._getValueAxis();
  70586. var argumentAxis = this.getArgumentAxis();
  70587. if (sizeStorage && (sizeStorage.width || sizeStorage.height)) {
  70588. argumentAxis.hideOuterElements();
  70589. var canvas = this._calcCanvas();
  70590. argumentAxis.updateSize(canvas);
  70591. valueAxis.updateSize(canvas)
  70592. }
  70593. },
  70594. checkForMoreSpaceForPanesCanvas: function() {
  70595. return this.layoutManager.needMoreSpaceForPanesCanvas([{
  70596. canvas: this.getArgumentAxis().getCanvas()
  70597. }], this._isRotated())
  70598. },
  70599. _getLayoutTargets: function() {
  70600. return [{
  70601. canvas: this._canvas
  70602. }]
  70603. },
  70604. _getSeriesForPane: function() {
  70605. return this.series
  70606. },
  70607. _applyExtraSettings: _noop,
  70608. _applyPointMarkersAutoHiding: _noop,
  70609. _createScrollBar: _noop,
  70610. _applyClipRects: _noop,
  70611. _isRotated: _noop,
  70612. _getCrosshairOptions: _noop,
  70613. _isLegendInside: _noop
  70614. });
  70615. registerComponent("dxPolarChart", dxPolarChart);
  70616. module.exports = dxPolarChart
  70617. },
  70618. /*!**************************************************!*\
  70619. !*** ./artifacts/transpiled/viz/linear_gauge.js ***!
  70620. \**************************************************/
  70621. /*! dynamic exports provided */
  70622. /*! all exports used */
  70623. function(module, exports, __webpack_require__) {
  70624. module.exports = __webpack_require__( /*! ./gauges/linear_gauge */ 793)
  70625. },
  70626. /*!*********************************************************!*\
  70627. !*** ./artifacts/transpiled/viz/gauges/linear_gauge.js ***!
  70628. \*********************************************************/
  70629. /*! dynamic exports provided */
  70630. /*! all exports used */
  70631. function(module, exports, __webpack_require__) {
  70632. var _each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  70633. var _max = Math.max;
  70634. var _min = Math.min;
  70635. var _round = Math.round;
  70636. var registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9);
  70637. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  70638. var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
  70639. var dxBaseGauge = __webpack_require__( /*! ./base_gauge */ 145).dxBaseGauge;
  70640. var dxGauge = __webpack_require__( /*! ./common */ 205).dxGauge;
  70641. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  70642. var linearIndicatorsModule = __webpack_require__( /*! ./linear_indicators */ 796);
  70643. var createIndicatorCreator = __webpack_require__( /*! ./common */ 205).createIndicatorCreator;
  70644. var LinearRangeContainer = __webpack_require__( /*! ./linear_range_container */ 797);
  70645. var dxLinearGauge = dxGauge.inherit({
  70646. _rootClass: "dxg-linear-gauge",
  70647. _factoryMethods: {
  70648. rangeContainer: "createLinearRangeContainer",
  70649. indicator: "createLinearIndicator"
  70650. },
  70651. _gridSpacingFactor: 25,
  70652. _scaleTypes: {
  70653. type: "xyAxes",
  70654. drawingType: "linear"
  70655. },
  70656. _getTicksOrientation: function(scaleOptions) {
  70657. return scaleOptions.isHorizontal ? scaleOptions.verticalOrientation : scaleOptions.horizontalOrientation
  70658. },
  70659. _getThemeManagerOptions: function() {
  70660. var options = this.callBase.apply(this, arguments);
  70661. options.subTheme = "_linear";
  70662. return options
  70663. },
  70664. _updateScaleTickIndent: function(scaleOptions) {
  70665. var indentFromTick = scaleOptions.label.indentFromTick;
  70666. var length = scaleOptions.tick.length;
  70667. var textParams = this._scale.measureLabels(extend({}, this._canvas));
  70668. var verticalTextCorrection = scaleOptions.isHorizontal ? textParams.height + textParams.y : 0;
  70669. var isIndentPositive = indentFromTick > 0;
  70670. var orientation;
  70671. var textCorrection;
  70672. var tickCorrection;
  70673. if (scaleOptions.isHorizontal) {
  70674. orientation = isIndentPositive ? {
  70675. center: .5,
  70676. top: 0,
  70677. bottom: 1
  70678. } : {
  70679. center: .5,
  70680. top: 1,
  70681. bottom: 0
  70682. };
  70683. tickCorrection = length * orientation[scaleOptions.verticalOrientation];
  70684. textCorrection = textParams.y
  70685. } else {
  70686. orientation = isIndentPositive ? {
  70687. center: .5,
  70688. left: 0,
  70689. right: 1
  70690. } : {
  70691. center: .5,
  70692. left: 1,
  70693. right: 0
  70694. };
  70695. tickCorrection = length * orientation[scaleOptions.horizontalOrientation];
  70696. textCorrection = -textParams.width
  70697. }
  70698. scaleOptions.label.indentFromAxis = -indentFromTick + (isIndentPositive ? -tickCorrection + textCorrection : tickCorrection - verticalTextCorrection);
  70699. this._scale.updateOptions(scaleOptions)
  70700. },
  70701. _shiftScale: function(layout, scaleOptions) {
  70702. var that = this;
  70703. var canvas = extend({}, that._canvas);
  70704. var isHorizontal = scaleOptions.isHorizontal;
  70705. var scale = that._scale;
  70706. canvas[isHorizontal ? "left" : "top"] = that._area[isHorizontal ? "startCoord" : "endCoord"];
  70707. canvas[isHorizontal ? "right" : "bottom"] = canvas[isHorizontal ? "width" : "height"] - that._area[isHorizontal ? "endCoord" : "startCoord"];
  70708. scale.draw(canvas);
  70709. scale.shift({
  70710. left: -layout.x,
  70711. top: -layout.y
  70712. })
  70713. },
  70714. _setupCodomain: function() {
  70715. var that = this;
  70716. var geometry = that.option("geometry") || {};
  70717. var vertical = "vertical" === _normalizeEnum(geometry.orientation);
  70718. var initialStartCoord = -100;
  70719. var initialEndCoord = 100;
  70720. that._area = {
  70721. vertical: vertical,
  70722. x: 0,
  70723. y: 0,
  70724. startCoord: initialStartCoord,
  70725. endCoord: initialEndCoord
  70726. };
  70727. that._rangeContainer.vertical = vertical;
  70728. that._translator.setCodomain(initialStartCoord, initialEndCoord)
  70729. },
  70730. _getScaleLayoutValue: function() {
  70731. return this._area[this._area.vertical ? "x" : "y"]
  70732. },
  70733. _getTicksCoefficients: function(options) {
  70734. var coefs = {
  70735. inner: 0,
  70736. outer: 1
  70737. };
  70738. if (this._area.vertical) {
  70739. if ("left" === options.horizontalOrientation) {
  70740. coefs.inner = 1;
  70741. coefs.outer = 0
  70742. } else {
  70743. if ("center" === options.horizontalOrientation) {
  70744. coefs.inner = coefs.outer = .5
  70745. }
  70746. }
  70747. } else {
  70748. if ("top" === options.verticalOrientation) {
  70749. coefs.inner = 1;
  70750. coefs.outer = 0
  70751. } else {
  70752. if ("center" === options.verticalOrientation) {
  70753. coefs.inner = coefs.outer = .5
  70754. }
  70755. }
  70756. }
  70757. return coefs
  70758. },
  70759. _correctScaleIndents: function(result, indentFromTick, textParams) {
  70760. var vertical = this._area.vertical;
  70761. if (indentFromTick >= 0) {
  70762. result.max += indentFromTick + textParams[vertical ? "width" : "height"]
  70763. } else {
  70764. result.min -= -indentFromTick + textParams[vertical ? "width" : "height"]
  70765. }
  70766. result.indent = textParams[vertical ? "height" : "width"] / 2
  70767. },
  70768. _measureMainElements: function(elements, scaleMeasurement) {
  70769. var that = this;
  70770. var x = that._area.x;
  70771. var y = that._area.y;
  70772. var minBound = 1e3;
  70773. var maxBound = 0;
  70774. var indent = 0;
  70775. var scale = that._scale;
  70776. _each(elements.concat(scale), function(_, element) {
  70777. var bounds = element.measure ? element.measure({
  70778. x: x + element.getOffset(),
  70779. y: y + element.getOffset()
  70780. }) : scaleMeasurement;
  70781. void 0 !== bounds.max && (maxBound = _max(maxBound, bounds.max));
  70782. void 0 !== bounds.min && (minBound = _min(minBound, bounds.min));
  70783. bounds.indent > 0 && (indent = _max(indent, bounds.indent))
  70784. });
  70785. return {
  70786. minBound: minBound,
  70787. maxBound: maxBound,
  70788. indent: indent
  70789. }
  70790. },
  70791. _applyMainLayout: function(elements, scaleMeasurement) {
  70792. var that = this;
  70793. var measurements = that._measureMainElements(elements, scaleMeasurement);
  70794. var area = that._area;
  70795. var rect;
  70796. var offset;
  70797. if (area.vertical) {
  70798. rect = selectRectBySizes(that._innerRect, {
  70799. width: measurements.maxBound - measurements.minBound
  70800. });
  70801. offset = (rect.left + rect.right) / 2 - (measurements.minBound + measurements.maxBound) / 2;
  70802. area.startCoord = rect.bottom - measurements.indent;
  70803. area.endCoord = rect.top + measurements.indent;
  70804. area.x = _round(area.x + offset)
  70805. } else {
  70806. rect = selectRectBySizes(that._innerRect, {
  70807. height: measurements.maxBound - measurements.minBound
  70808. });
  70809. offset = (rect.top + rect.bottom) / 2 - (measurements.minBound + measurements.maxBound) / 2;
  70810. area.startCoord = rect.left + measurements.indent;
  70811. area.endCoord = rect.right - measurements.indent;
  70812. area.y = _round(area.y + offset)
  70813. }
  70814. that._translator.setCodomain(area.startCoord, area.endCoord);
  70815. that._innerRect = rect
  70816. },
  70817. _getElementLayout: function(offset) {
  70818. return {
  70819. x: _round(this._area.x + offset),
  70820. y: _round(this._area.y + offset)
  70821. }
  70822. },
  70823. _getApproximateScreenRange: function() {
  70824. var that = this;
  70825. var area = that._area;
  70826. var s = area.vertical ? that._canvas.height : that._canvas.width;
  70827. s > area.totalSize && (s = area.totalSize);
  70828. s = .8 * s;
  70829. return s
  70830. },
  70831. _getDefaultSize: function() {
  70832. var geometry = this.option("geometry") || {};
  70833. if ("vertical" === geometry.orientation) {
  70834. return {
  70835. width: 100,
  70836. height: 300
  70837. }
  70838. } else {
  70839. return {
  70840. width: 300,
  70841. height: 100
  70842. }
  70843. }
  70844. },
  70845. _factory: objectUtils.clone(dxBaseGauge.prototype._factory)
  70846. });
  70847. function selectRectBySizes(srcRect, sizes, margins) {
  70848. var rect = extend({}, srcRect);
  70849. var step;
  70850. margins = margins || {};
  70851. if (sizes) {
  70852. rect.left += margins.left || 0;
  70853. rect.right -= margins.right || 0;
  70854. rect.top += margins.top || 0;
  70855. rect.bottom -= margins.bottom || 0;
  70856. if (sizes.width > 0) {
  70857. step = (rect.right - rect.left - sizes.width) / 2;
  70858. if (step > 0) {
  70859. rect.left += step;
  70860. rect.right -= step
  70861. }
  70862. }
  70863. if (sizes.height > 0) {
  70864. step = (rect.bottom - rect.top - sizes.height) / 2;
  70865. if (step > 0) {
  70866. rect.top += step;
  70867. rect.bottom -= step
  70868. }
  70869. }
  70870. }
  70871. return rect
  70872. }
  70873. dxLinearGauge._TESTS_selectRectBySizes = selectRectBySizes;
  70874. var indicators = dxLinearGauge.prototype._factory.indicators = {};
  70875. dxLinearGauge.prototype._factory.createIndicator = createIndicatorCreator(indicators);
  70876. indicators._default = linearIndicatorsModule._default;
  70877. indicators.rectangle = linearIndicatorsModule.rectangle;
  70878. indicators.rhombus = linearIndicatorsModule.rhombus;
  70879. indicators.circle = linearIndicatorsModule.circle;
  70880. indicators.trianglemarker = linearIndicatorsModule.trianglemarker;
  70881. indicators.textcloud = linearIndicatorsModule.textcloud;
  70882. indicators.rangebar = linearIndicatorsModule.rangebar;
  70883. dxLinearGauge.prototype._factory.RangeContainer = LinearRangeContainer;
  70884. registerComponent("dxLinearGauge", dxLinearGauge);
  70885. module.exports = dxLinearGauge
  70886. },
  70887. /*!**********************************************************!*\
  70888. !*** ./artifacts/transpiled/viz/gauges/theme_manager.js ***!
  70889. \**********************************************************/
  70890. /*! dynamic exports provided */
  70891. /*! all exports used */
  70892. function(module, exports, __webpack_require__) {
  70893. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  70894. var _extend = extend;
  70895. var BaseThemeManager = __webpack_require__( /*! ../core/base_theme_manager */ 241).BaseThemeManager;
  70896. var ThemeManager = BaseThemeManager.inherit({
  70897. ctor: function(options) {
  70898. this.callBase.apply(this, arguments);
  70899. this._subTheme = options.subTheme
  70900. },
  70901. _initializeTheme: function() {
  70902. var that = this;
  70903. var subTheme;
  70904. if (that._subTheme) {
  70905. subTheme = _extend(true, {}, that._theme[that._subTheme], that._theme);
  70906. _extend(true, that._theme, subTheme)
  70907. }
  70908. that.callBase.apply(that, arguments)
  70909. }
  70910. });
  70911. module.exports = {
  70912. ThemeManager: ThemeManager
  70913. }
  70914. },
  70915. /*!****************************************************!*\
  70916. !*** ./artifacts/transpiled/viz/gauges/tracker.js ***!
  70917. \****************************************************/
  70918. /*! dynamic exports provided */
  70919. /*! all exports used */
  70920. function(module, exports, __webpack_require__) {
  70921. var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  70922. var Class = __webpack_require__( /*! ../../core/class */ 15);
  70923. var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  70924. var ready = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48).add;
  70925. var wheelEvent = __webpack_require__( /*! ../../events/core/wheel */ 124);
  70926. var TOOLTIP_HIDE_DELAY = 100;
  70927. var Tracker = Class.inherit({
  70928. ctor: function(parameters) {
  70929. var debug = __webpack_require__( /*! ../../core/utils/console */ 73).debug;
  70930. debug.assertParam(parameters, "parameters");
  70931. debug.assertParam(parameters.renderer, "parameters.renderer");
  70932. debug.assertParam(parameters.container, "parameters.container");
  70933. var that = this;
  70934. that._element = parameters.renderer.g().attr({
  70935. "class": "dxg-tracker",
  70936. stroke: "none",
  70937. "stroke-width": 0,
  70938. fill: "#000000",
  70939. opacity: 1e-4
  70940. }).linkOn(parameters.container, {
  70941. name: "tracker",
  70942. after: "peripheral"
  70943. });
  70944. that._showTooltipCallback = function() {
  70945. var target = that._tooltipEvent.target;
  70946. var data_target = target["gauge-data-target"];
  70947. var data_info = target["gauge-data-info"];
  70948. that._targetEvent = null;
  70949. if (that._tooltipTarget !== target && that._callbacks["tooltip-show"](data_target, data_info)) {
  70950. that._tooltipTarget = target
  70951. }
  70952. };
  70953. that._hideTooltipCallback = function() {
  70954. that._hideTooltipTimeout = null;
  70955. that._targetEvent = null;
  70956. if (that._tooltipTarget) {
  70957. that._callbacks["tooltip-hide"]();
  70958. that._tooltipTarget = null
  70959. }
  70960. };
  70961. that._dispose = function() {
  70962. clearTimeout(that._hideTooltipTimeout);
  70963. that._showTooltipCallback = that._hideTooltipCallback = that._dispose = null
  70964. };
  70965. that._DEBUG_hideTooltipTimeoutSet = that._DEBUG_hideTooltipTimeoutCleared = 0;
  70966. that.TOOLTIP_HIDE_DELAY = TOOLTIP_HIDE_DELAY
  70967. },
  70968. dispose: function() {
  70969. var that = this;
  70970. that._dispose();
  70971. that.deactivate();
  70972. that._element.linkOff();
  70973. that._element = that._context = that._callbacks = null;
  70974. return that
  70975. },
  70976. activate: function() {
  70977. this._element.linkAppend();
  70978. return this
  70979. },
  70980. deactivate: function() {
  70981. this._element.linkRemove().clear();
  70982. return this
  70983. },
  70984. attach: function(element, target, info) {
  70985. element.data({
  70986. "gauge-data-target": target,
  70987. "gauge-data-info": info
  70988. }).append(this._element);
  70989. return this
  70990. },
  70991. detach: function(element) {
  70992. element.remove();
  70993. return this
  70994. },
  70995. setTooltipState: function(state) {
  70996. var that = this;
  70997. var data;
  70998. that._element.off(tooltipMouseEvents).off(tooltipTouchEvents).off(tooltipMouseWheelEvents);
  70999. if (state) {
  71000. data = {
  71001. tracker: that
  71002. };
  71003. that._element.on(tooltipMouseEvents, data).on(tooltipTouchEvents, data).on(tooltipMouseWheelEvents, data)
  71004. }
  71005. return that
  71006. },
  71007. setCallbacks: function(callbacks) {
  71008. this._callbacks = callbacks;
  71009. return this
  71010. },
  71011. _showTooltip: function(event) {
  71012. var that = this;
  71013. that._hideTooltipTimeout && ++that._DEBUG_hideTooltipTimeoutCleared;
  71014. clearTimeout(that._hideTooltipTimeout);
  71015. that._hideTooltipTimeout = null;
  71016. if (that._tooltipTarget === event.target) {
  71017. return
  71018. }
  71019. that._tooltipEvent = event;
  71020. that._showTooltipCallback()
  71021. },
  71022. _hideTooltip: function(delay) {
  71023. var that = this;
  71024. clearTimeout(that._hideTooltipTimeout);
  71025. if (delay) {
  71026. ++that._DEBUG_hideTooltipTimeoutSet;
  71027. that._hideTooltipTimeout = setTimeout(that._hideTooltipCallback, delay)
  71028. } else {
  71029. that._hideTooltipCallback()
  71030. }
  71031. }
  71032. });
  71033. var tooltipMouseEvents = {
  71034. "mouseover.gauge-tooltip": handleTooltipMouseOver,
  71035. "mouseout.gauge-tooltip": handleTooltipMouseOut
  71036. };
  71037. var tooltipMouseMoveEvents = {
  71038. "mousemove.gauge-tooltip": handleTooltipMouseMove
  71039. };
  71040. var tooltipMouseWheelEvents = {};
  71041. tooltipMouseWheelEvents[wheelEvent.name + ".gauge-tooltip"] = handleTooltipMouseWheel;
  71042. var tooltipTouchEvents = {
  71043. "touchstart.gauge-tooltip": handleTooltipTouchStart
  71044. };
  71045. function handleTooltipMouseOver(event) {
  71046. var tracker = event.data.tracker;
  71047. tracker._x = event.pageX;
  71048. tracker._y = event.pageY;
  71049. tracker._element.off(tooltipMouseMoveEvents).on(tooltipMouseMoveEvents, event.data);
  71050. tracker._showTooltip(event)
  71051. }
  71052. function handleTooltipMouseMove(event) {
  71053. var tracker = event.data.tracker;
  71054. tracker._x = event.pageX;
  71055. tracker._y = event.pageY;
  71056. tracker._showTooltip(event)
  71057. }
  71058. function handleTooltipMouseOut(event) {
  71059. var tracker = event.data.tracker;
  71060. tracker._element.off(tooltipMouseMoveEvents);
  71061. tracker._hideTooltip(TOOLTIP_HIDE_DELAY)
  71062. }
  71063. function handleTooltipMouseWheel(event) {
  71064. event.data.tracker._hideTooltip()
  71065. }
  71066. var active_touch_tooltip_tracker = null;
  71067. Tracker._DEBUG_reset = function() {
  71068. active_touch_tooltip_tracker = null
  71069. };
  71070. function handleTooltipTouchStart(event) {
  71071. event.preventDefault();
  71072. var tracker = active_touch_tooltip_tracker;
  71073. if (tracker && tracker !== event.data.tracker) {
  71074. tracker._hideTooltip(TOOLTIP_HIDE_DELAY)
  71075. }
  71076. tracker = active_touch_tooltip_tracker = event.data.tracker;
  71077. tracker._showTooltip(event);
  71078. tracker._touch = true
  71079. }
  71080. function handleTooltipDocumentTouchStart() {
  71081. var tracker = active_touch_tooltip_tracker;
  71082. if (tracker) {
  71083. if (!tracker._touch) {
  71084. tracker._hideTooltip(TOOLTIP_HIDE_DELAY);
  71085. active_touch_tooltip_tracker = null
  71086. }
  71087. tracker._touch = null
  71088. }
  71089. }
  71090. function handleTooltipDocumentTouchEnd() {
  71091. var tracker = active_touch_tooltip_tracker;
  71092. if (tracker) {
  71093. tracker._hideTooltip(TOOLTIP_HIDE_DELAY);
  71094. active_touch_tooltip_tracker = null
  71095. }
  71096. }
  71097. ready(function() {
  71098. eventsEngine.subscribeGlobal(domAdapter.getDocument(), {
  71099. "touchstart.gauge-tooltip": handleTooltipDocumentTouchStart,
  71100. "touchend.gauge-tooltip": handleTooltipDocumentTouchEnd
  71101. })
  71102. });
  71103. module.exports = Tracker
  71104. },
  71105. /*!**************************************************************!*\
  71106. !*** ./artifacts/transpiled/viz/gauges/linear_indicators.js ***!
  71107. \**************************************************************/
  71108. /*! dynamic exports provided */
  71109. /*! all exports used */
  71110. function(module, exports, __webpack_require__) {
  71111. var baseIndicatorsModule = __webpack_require__( /*! ./base_indicators */ 250);
  71112. var BaseIndicator = baseIndicatorsModule.BaseIndicator;
  71113. var BaseTextCloudMarker = baseIndicatorsModule.BaseTextCloudMarker;
  71114. var BaseRangeBar = baseIndicatorsModule.BaseRangeBar;
  71115. var _Number = Number;
  71116. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  71117. var SimpleIndicator = BaseIndicator.inherit({
  71118. _move: function() {
  71119. var that = this;
  71120. var delta = that._actualPosition - that._zeroPosition;
  71121. that._rootElement.move(that.vertical ? 0 : delta, that.vertical ? delta : 0);
  71122. that._trackerElement && that._trackerElement.move(that.vertical ? 0 : delta, that.vertical ? delta : 0)
  71123. },
  71124. _isEnabled: function() {
  71125. this.vertical = this._options.vertical;
  71126. return this._options.length > 0 && this._options.width > 0
  71127. },
  71128. _isVisible: function() {
  71129. return true
  71130. },
  71131. _getTrackerSettings: function() {
  71132. var options = this._options;
  71133. var x1;
  71134. var x2;
  71135. var y1;
  71136. var y2;
  71137. var width = options.width / 2;
  71138. var length = options.length / 2;
  71139. var p = this._zeroPosition;
  71140. width > 10 || (width = 10);
  71141. length > 10 || (length = 10);
  71142. if (this.vertical) {
  71143. x1 = options.x - length;
  71144. x2 = options.x + length;
  71145. y1 = p + width;
  71146. y2 = p - width
  71147. } else {
  71148. x1 = p - width;
  71149. x2 = p + width;
  71150. y1 = options.y + length;
  71151. y2 = options.y - length
  71152. }
  71153. return {
  71154. points: [x1, y1, x1, y2, x2, y2, x2, y1]
  71155. }
  71156. },
  71157. _render: function() {
  71158. var that = this;
  71159. that._zeroPosition = that._translator.getCodomainStart()
  71160. },
  71161. _clear: function() {
  71162. delete this._element
  71163. },
  71164. measure: function(layout) {
  71165. var p = this.vertical ? layout.x : layout.y;
  71166. return {
  71167. min: p - this._options.length / 2,
  71168. max: p + this._options.length / 2
  71169. }
  71170. },
  71171. getTooltipParameters: function() {
  71172. var that = this;
  71173. var options = that._options;
  71174. var p = that._actualPosition;
  71175. var parameters = {
  71176. x: p,
  71177. y: p,
  71178. value: that._currentValue,
  71179. color: options.color,
  71180. offset: options.width / 2
  71181. };
  71182. that.vertical ? parameters.x = options.x : parameters.y = options.y;
  71183. return parameters
  71184. }
  71185. });
  71186. var rectangle = SimpleIndicator.inherit({
  71187. _render: function() {
  71188. var that = this;
  71189. var options = that._options;
  71190. var x1;
  71191. var x2;
  71192. var y1;
  71193. var y2;
  71194. that.callBase();
  71195. var p = that._zeroPosition;
  71196. if (that.vertical) {
  71197. x1 = options.x - options.length / 2;
  71198. x2 = options.x + options.length / 2;
  71199. y1 = p + options.width / 2;
  71200. y2 = p - options.width / 2
  71201. } else {
  71202. x1 = p - options.width / 2;
  71203. x2 = p + options.width / 2;
  71204. y1 = options.y + options.length / 2;
  71205. y2 = options.y - options.length / 2
  71206. }
  71207. that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
  71208. that._element.attr({
  71209. points: [x1, y1, x1, y2, x2, y2, x2, y1]
  71210. })
  71211. }
  71212. });
  71213. var rhombus = SimpleIndicator.inherit({
  71214. _render: function() {
  71215. var that = this;
  71216. var options = that._options;
  71217. var x;
  71218. var y;
  71219. var dx;
  71220. var dy;
  71221. that.callBase();
  71222. if (that.vertical) {
  71223. x = options.x;
  71224. y = that._zeroPosition;
  71225. dx = options.length / 2 || 0;
  71226. dy = options.width / 2 || 0
  71227. } else {
  71228. x = that._zeroPosition;
  71229. y = options.y;
  71230. dx = options.width / 2 || 0;
  71231. dy = options.length / 2 || 0
  71232. }
  71233. that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
  71234. that._element.attr({
  71235. points: [x - dx, y, x, y - dy, x + dx, y, x, y + dy]
  71236. })
  71237. }
  71238. });
  71239. var circle = SimpleIndicator.inherit({
  71240. _render: function() {
  71241. var that = this;
  71242. var options = that._options;
  71243. var x;
  71244. var y;
  71245. that.callBase();
  71246. if (that.vertical) {
  71247. x = options.x;
  71248. y = that._zeroPosition
  71249. } else {
  71250. x = that._zeroPosition;
  71251. y = options.y
  71252. }
  71253. var r = options.length / 2 || 0;
  71254. that._element = that._element || that._renderer.circle().append(that._rootElement);
  71255. that._element.attr({
  71256. cx: x,
  71257. cy: y,
  71258. r: r
  71259. })
  71260. }
  71261. });
  71262. var triangleMarker = SimpleIndicator.inherit({
  71263. _isEnabled: function() {
  71264. var that = this;
  71265. that.vertical = that._options.vertical;
  71266. that._inverted = that.vertical ? "right" === _normalizeEnum(that._options.horizontalOrientation) : "bottom" === _normalizeEnum(that._options.verticalOrientation);
  71267. return that._options.length > 0 && that._options.width > 0
  71268. },
  71269. _isVisible: function() {
  71270. return true
  71271. },
  71272. _render: function() {
  71273. var that = this;
  71274. var options = that._options;
  71275. var x1;
  71276. var x2;
  71277. var y1;
  71278. var y2;
  71279. var settings = {
  71280. stroke: "none",
  71281. "stroke-width": 0,
  71282. "stroke-linecap": "square"
  71283. };
  71284. that.callBase();
  71285. if (that.vertical) {
  71286. x1 = options.x;
  71287. y1 = that._zeroPosition;
  71288. x2 = x1 + _Number(that._inverted ? options.length : -options.length);
  71289. settings.points = [x1, y1, x2, y1 - options.width / 2, x2, y1 + options.width / 2]
  71290. } else {
  71291. y1 = options.y;
  71292. x1 = that._zeroPosition;
  71293. y2 = y1 + _Number(that._inverted ? options.length : -options.length);
  71294. settings.points = [x1, y1, x1 - options.width / 2, y2, x1 + options.width / 2, y2]
  71295. }
  71296. if (options.space > 0) {
  71297. settings["stroke-width"] = Math.min(options.space, options.width / 4) || 0;
  71298. settings.stroke = settings["stroke-width"] > 0 ? options.containerBackgroundColor || "none" : "none"
  71299. }
  71300. that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
  71301. that._element.attr(settings).sharp()
  71302. },
  71303. _getTrackerSettings: function() {
  71304. var that = this;
  71305. var options = that._options;
  71306. var width = options.width / 2;
  71307. var length = _Number(options.length);
  71308. var x1;
  71309. var x2;
  71310. var y1;
  71311. var y2;
  71312. var result;
  71313. width > 10 || (width = 10);
  71314. length > 20 || (length = 20);
  71315. if (that.vertical) {
  71316. x1 = x2 = options.x;
  71317. x2 = x1 + (that._inverted ? length : -length);
  71318. y1 = that._zeroPosition + width;
  71319. y2 = that._zeroPosition - width;
  71320. result = [x1, y1, x2, y1, x2, y2, x1, y2]
  71321. } else {
  71322. y1 = options.y;
  71323. y2 = y1 + (that._inverted ? length : -length);
  71324. x1 = that._zeroPosition - width;
  71325. x2 = that._zeroPosition + width;
  71326. result = [x1, y1, x1, y2, x2, y2, x2, y1]
  71327. }
  71328. return {
  71329. points: result
  71330. }
  71331. },
  71332. measure: function(layout) {
  71333. var that = this;
  71334. var length = _Number(that._options.length);
  71335. var minBound;
  71336. var maxBound;
  71337. if (that.vertical) {
  71338. minBound = maxBound = layout.x;
  71339. if (that._inverted) {
  71340. maxBound = minBound + length
  71341. } else {
  71342. minBound = maxBound - length
  71343. }
  71344. } else {
  71345. minBound = maxBound = layout.y;
  71346. if (that._inverted) {
  71347. maxBound = minBound + length
  71348. } else {
  71349. minBound = maxBound - length
  71350. }
  71351. }
  71352. return {
  71353. min: minBound,
  71354. max: maxBound,
  71355. indent: that._options.width / 2
  71356. }
  71357. },
  71358. getTooltipParameters: function() {
  71359. var that = this;
  71360. var options = that._options;
  71361. var s = (that._inverted ? options.length : -options.length) / 2;
  71362. var parameters = that.callBase();
  71363. that.vertical ? parameters.x += s : parameters.y += s;
  71364. parameters.offset = options.length / 2;
  71365. return parameters
  71366. }
  71367. });
  71368. var textCloud = BaseTextCloudMarker.inherit({
  71369. _isEnabled: function() {
  71370. var that = this;
  71371. that.vertical = that._options.vertical;
  71372. that._inverted = that.vertical ? "right" === _normalizeEnum(that._options.horizontalOrientation) : "bottom" === _normalizeEnum(that._options.verticalOrientation);
  71373. return true
  71374. },
  71375. _isVisible: function() {
  71376. return true
  71377. },
  71378. _getTextCloudOptions: function() {
  71379. var that = this;
  71380. var x = that._actualPosition;
  71381. var y = that._actualPosition;
  71382. var type;
  71383. if (that.vertical) {
  71384. x = that._options.x;
  71385. type = that._inverted ? "top-left" : "top-right"
  71386. } else {
  71387. y = that._options.y;
  71388. type = that._inverted ? "right-top" : "right-bottom"
  71389. }
  71390. return {
  71391. x: x,
  71392. y: y,
  71393. type: type
  71394. }
  71395. },
  71396. measure: function(layout) {
  71397. var that = this;
  71398. var minBound;
  71399. var maxBound;
  71400. var arrowLength = _Number(that._options.arrowLength) || 0;
  71401. var indent;
  71402. that._measureText();
  71403. if (that.vertical) {
  71404. indent = that._textFullHeight;
  71405. if (that._inverted) {
  71406. minBound = layout.x;
  71407. maxBound = layout.x + arrowLength + that._textFullWidth
  71408. } else {
  71409. minBound = layout.x - arrowLength - that._textFullWidth;
  71410. maxBound = layout.x
  71411. }
  71412. } else {
  71413. indent = that._textFullWidth;
  71414. if (that._inverted) {
  71415. minBound = layout.y;
  71416. maxBound = layout.y + arrowLength + that._textFullHeight
  71417. } else {
  71418. minBound = layout.y - arrowLength - that._textFullHeight;
  71419. maxBound = layout.y
  71420. }
  71421. }
  71422. return {
  71423. min: minBound,
  71424. max: maxBound,
  71425. indent: indent
  71426. }
  71427. }
  71428. });
  71429. var rangeBar = BaseRangeBar.inherit({
  71430. _isEnabled: function() {
  71431. var that = this;
  71432. that.vertical = that._options.vertical;
  71433. that._inverted = that.vertical ? "right" === _normalizeEnum(that._options.horizontalOrientation) : "bottom" === _normalizeEnum(that._options.verticalOrientation);
  71434. return that._options.size > 0
  71435. },
  71436. _isVisible: function() {
  71437. return true
  71438. },
  71439. _createBarItem: function() {
  71440. return this._renderer.path([], "area").append(this._rootElement)
  71441. },
  71442. _createTracker: function() {
  71443. return this._renderer.path([], "area")
  71444. },
  71445. _setBarSides: function() {
  71446. var that = this;
  71447. var options = that._options;
  71448. var size = _Number(options.size);
  71449. var minSide;
  71450. var maxSide;
  71451. if (that.vertical) {
  71452. if (that._inverted) {
  71453. minSide = options.x;
  71454. maxSide = options.x + size
  71455. } else {
  71456. minSide = options.x - size;
  71457. maxSide = options.x
  71458. }
  71459. } else {
  71460. if (that._inverted) {
  71461. minSide = options.y;
  71462. maxSide = options.y + size
  71463. } else {
  71464. minSide = options.y - size;
  71465. maxSide = options.y
  71466. }
  71467. }
  71468. that._minSide = minSide;
  71469. that._maxSide = maxSide;
  71470. that._minBound = minSide;
  71471. that._maxBound = maxSide
  71472. },
  71473. _getSpace: function() {
  71474. var options = this._options;
  71475. return options.space > 0 ? _Number(options.space) : 0
  71476. },
  71477. _isTextVisible: function() {
  71478. var textOptions = this._options.text || {};
  71479. return textOptions.indent > 0 || textOptions.indent < 0
  71480. },
  71481. _getTextAlign: function() {
  71482. return this.vertical ? this._options.text.indent > 0 ? "left" : "right" : "center"
  71483. },
  71484. _setTextItemsSides: function() {
  71485. var that = this;
  71486. var indent = _Number(that._options.text.indent);
  71487. if (indent > 0) {
  71488. that._lineStart = that._maxSide;
  71489. that._lineEnd = that._maxSide + indent;
  71490. that._textPosition = that._lineEnd + (that.vertical ? 2 : that._textHeight / 2);
  71491. that._maxBound = that._textPosition + (that.vertical ? that._textWidth : that._textHeight / 2)
  71492. } else {
  71493. if (indent < 0) {
  71494. that._lineStart = that._minSide;
  71495. that._lineEnd = that._minSide + indent;
  71496. that._textPosition = that._lineEnd - (that.vertical ? 2 : that._textHeight / 2);
  71497. that._minBound = that._textPosition - (that.vertical ? that._textWidth : that._textHeight / 2)
  71498. }
  71499. }
  71500. },
  71501. _getPositions: function() {
  71502. var that = this;
  71503. var startPosition = that._startPosition;
  71504. var endPosition = that._endPosition;
  71505. var space = that._space;
  71506. var basePosition = that._basePosition;
  71507. var actualPosition = that._actualPosition;
  71508. var mainPosition1;
  71509. var mainPosition2;
  71510. var backPosition1;
  71511. var backPosition2;
  71512. if (startPosition < endPosition) {
  71513. if (basePosition < actualPosition) {
  71514. mainPosition1 = basePosition;
  71515. mainPosition2 = actualPosition
  71516. } else {
  71517. mainPosition1 = actualPosition;
  71518. mainPosition2 = basePosition
  71519. }
  71520. backPosition1 = mainPosition1 - space;
  71521. backPosition2 = mainPosition2 + space
  71522. } else {
  71523. if (basePosition > actualPosition) {
  71524. mainPosition1 = basePosition;
  71525. mainPosition2 = actualPosition
  71526. } else {
  71527. mainPosition1 = actualPosition;
  71528. mainPosition2 = basePosition
  71529. }
  71530. backPosition1 = mainPosition1 + space;
  71531. backPosition2 = mainPosition2 - space
  71532. }
  71533. return {
  71534. start: startPosition,
  71535. end: endPosition,
  71536. main1: mainPosition1,
  71537. main2: mainPosition2,
  71538. back1: backPosition1,
  71539. back2: backPosition2
  71540. }
  71541. },
  71542. _buildItemSettings: function(from, to) {
  71543. var that = this;
  71544. var side1 = that._minSide;
  71545. var side2 = that._maxSide;
  71546. var points = that.vertical ? [side1, from, side1, to, side2, to, side2, from] : [from, side1, from, side2, to, side2, to, side1];
  71547. return {
  71548. points: points
  71549. }
  71550. },
  71551. _updateTextPosition: function() {
  71552. var that = this;
  71553. that._text.attr(that.vertical ? {
  71554. x: that._textPosition,
  71555. y: that._actualPosition + that._textVerticalOffset
  71556. } : {
  71557. x: that._actualPosition,
  71558. y: that._textPosition + that._textVerticalOffset
  71559. })
  71560. },
  71561. _updateLinePosition: function() {
  71562. var that = this;
  71563. var actualPosition = that._actualPosition;
  71564. var side1;
  71565. var side2;
  71566. var points;
  71567. if (that.vertical) {
  71568. if (that._basePosition >= actualPosition) {
  71569. side1 = actualPosition;
  71570. side2 = actualPosition + 2
  71571. } else {
  71572. side1 = actualPosition - 2;
  71573. side2 = actualPosition
  71574. }
  71575. points = [that._lineStart, side1, that._lineStart, side2, that._lineEnd, side2, that._lineEnd, side1]
  71576. } else {
  71577. if (that._basePosition <= actualPosition) {
  71578. side1 = actualPosition - 2;
  71579. side2 = actualPosition
  71580. } else {
  71581. side1 = actualPosition;
  71582. side2 = actualPosition + 2
  71583. }
  71584. points = [side1, that._lineStart, side1, that._lineEnd, side2, that._lineEnd, side2, that._lineStart]
  71585. }
  71586. that._line.attr({
  71587. points: points
  71588. }).sharp()
  71589. },
  71590. _getTooltipPosition: function() {
  71591. var that = this;
  71592. var crossCenter = (that._minSide + that._maxSide) / 2;
  71593. var alongCenter = (that._basePosition + that._actualPosition) / 2;
  71594. return that.vertical ? {
  71595. x: crossCenter,
  71596. y: alongCenter
  71597. } : {
  71598. x: alongCenter,
  71599. y: crossCenter
  71600. }
  71601. },
  71602. measure: function(layout) {
  71603. var that = this;
  71604. var size = _Number(that._options.size);
  71605. var textIndent = _Number(that._options.text.indent);
  71606. var minBound;
  71607. var maxBound;
  71608. var indent;
  71609. that._measureText();
  71610. if (that.vertical) {
  71611. minBound = maxBound = layout.x;
  71612. if (that._inverted) {
  71613. maxBound += size
  71614. } else {
  71615. minBound -= size
  71616. }
  71617. if (that._hasText) {
  71618. indent = that._textHeight / 2;
  71619. if (textIndent > 0) {
  71620. maxBound += textIndent + that._textWidth
  71621. }
  71622. if (textIndent < 0) {
  71623. minBound += textIndent - that._textWidth
  71624. }
  71625. }
  71626. } else {
  71627. minBound = maxBound = layout.y;
  71628. if (that._inverted) {
  71629. maxBound += size
  71630. } else {
  71631. minBound -= size
  71632. }
  71633. if (that._hasText) {
  71634. indent = that._textWidth / 2;
  71635. if (textIndent > 0) {
  71636. maxBound += textIndent + that._textHeight
  71637. }
  71638. if (textIndent < 0) {
  71639. minBound += textIndent - that._textHeight
  71640. }
  71641. }
  71642. }
  71643. return {
  71644. min: minBound,
  71645. max: maxBound,
  71646. indent: indent
  71647. }
  71648. }
  71649. });
  71650. exports._default = rangeBar;
  71651. exports.rectangle = rectangle;
  71652. exports.rhombus = rhombus;
  71653. exports.circle = circle;
  71654. exports.trianglemarker = triangleMarker;
  71655. exports.textcloud = textCloud;
  71656. exports.rangebar = rangeBar
  71657. },
  71658. /*!*******************************************************************!*\
  71659. !*** ./artifacts/transpiled/viz/gauges/linear_range_container.js ***!
  71660. \*******************************************************************/
  71661. /*! dynamic exports provided */
  71662. /*! all exports used */
  71663. function(module, exports, __webpack_require__) {
  71664. var BaseRangeContainer = __webpack_require__( /*! ./base_range_container */ 413);
  71665. var _Number = Number;
  71666. var _max = Math.max;
  71667. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  71668. var LinearRangeContainer = BaseRangeContainer.inherit({
  71669. _processOptions: function() {
  71670. var that = this;
  71671. that.vertical = that._options.vertical;
  71672. that._inner = that._outer = 0;
  71673. if (that.vertical) {
  71674. switch (_normalizeEnum(that._options.horizontalOrientation)) {
  71675. case "left":
  71676. that._inner = 1;
  71677. break;
  71678. case "center":
  71679. that._inner = that._outer = .5;
  71680. break;
  71681. default:
  71682. that._outer = 1
  71683. }
  71684. } else {
  71685. switch (_normalizeEnum(that._options.verticalOrientation)) {
  71686. case "top":
  71687. that._inner = 1;
  71688. break;
  71689. case "center":
  71690. that._inner = that._outer = .5;
  71691. break;
  71692. default:
  71693. that._outer = 1
  71694. }
  71695. }
  71696. },
  71697. _isVisible: function() {
  71698. return true
  71699. },
  71700. _createRange: function(range, layout) {
  71701. var that = this;
  71702. var inner = that._inner;
  71703. var outer = that._outer;
  71704. var startPosition = that._translator.translate(range.start);
  71705. var endPosition = that._translator.translate(range.end);
  71706. var points;
  71707. var x = layout.x;
  71708. var y = layout.y;
  71709. var startWidth = range.startWidth;
  71710. var endWidth = range.endWidth;
  71711. if (that.vertical) {
  71712. points = [x - startWidth * inner, startPosition, x - endWidth * inner, endPosition, x + endWidth * outer, endPosition, x + startWidth * outer, startPosition]
  71713. } else {
  71714. points = [startPosition, y + startWidth * outer, startPosition, y - startWidth * inner, endPosition, y - endWidth * inner, endPosition, y + endWidth * outer]
  71715. }
  71716. return that._renderer.path(points, "area")
  71717. },
  71718. measure: function(layout) {
  71719. var result = {};
  71720. var width;
  71721. result.min = result.max = layout[this.vertical ? "x" : "y"];
  71722. width = this._options.width;
  71723. width = _Number(width) || _max(_Number(width.start), _Number(width.end));
  71724. result.min -= this._inner * width;
  71725. result.max += this._outer * width;
  71726. return result
  71727. }
  71728. });
  71729. module.exports = LinearRangeContainer
  71730. },
  71731. /*!****************************************************!*\
  71732. !*** ./artifacts/transpiled/viz/circular_gauge.js ***!
  71733. \****************************************************/
  71734. /*! dynamic exports provided */
  71735. /*! all exports used */
  71736. function(module, exports, __webpack_require__) {
  71737. module.exports = __webpack_require__( /*! ./gauges/circular_gauge */ 414)
  71738. },
  71739. /*!****************************************************************!*\
  71740. !*** ./artifacts/transpiled/viz/gauges/circular_indicators.js ***!
  71741. \****************************************************************/
  71742. /*! dynamic exports provided */
  71743. /*! all exports used */
  71744. function(module, exports, __webpack_require__) {
  71745. var baseIndicatorsModule = __webpack_require__( /*! ./base_indicators */ 250);
  71746. var BaseIndicator = baseIndicatorsModule.BaseIndicator;
  71747. var BaseTextCloudMarker = baseIndicatorsModule.BaseTextCloudMarker;
  71748. var BaseRangeBar = baseIndicatorsModule.BaseRangeBar;
  71749. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  71750. var _Number = Number;
  71751. var _getCosAndSin = vizUtils.getCosAndSin;
  71752. var _convertAngleToRendererSpace = vizUtils.convertAngleToRendererSpace;
  71753. var SimpleIndicator = BaseIndicator.inherit({
  71754. _move: function() {
  71755. var that = this;
  71756. var options = that._options;
  71757. var angle = _convertAngleToRendererSpace(that._actualPosition);
  71758. that._rootElement.rotate(angle, options.x, options.y);
  71759. that._trackerElement && that._trackerElement.rotate(angle, options.x, options.y)
  71760. },
  71761. _isEnabled: function() {
  71762. return this._options.width > 0
  71763. },
  71764. _isVisible: function(layout) {
  71765. return layout.radius - _Number(this._options.indentFromCenter) > 0
  71766. },
  71767. _getTrackerSettings: function() {
  71768. var options = this._options;
  71769. var radius = this._getRadius();
  71770. var indentFromCenter = this._getIndentFromCenter();
  71771. var x = options.x;
  71772. var y = options.y - (radius + indentFromCenter) / 2;
  71773. var width = options.width / 2;
  71774. var length = (radius - indentFromCenter) / 2;
  71775. width > 10 || (width = 10);
  71776. length > 10 || (length = 10);
  71777. return {
  71778. points: [x - width, y - length, x - width, y + length, x + width, y + length, x + width, y - length]
  71779. }
  71780. },
  71781. _render: function() {
  71782. var that = this;
  71783. that._renderPointer()
  71784. },
  71785. _clearPointer: function() {
  71786. delete this._element
  71787. },
  71788. _clear: function() {
  71789. this._clearPointer()
  71790. },
  71791. _getIndentFromCenter: function(radius) {
  71792. return Number(this._options.indentFromCenter) || 0
  71793. },
  71794. _getRadius: function() {
  71795. return 0
  71796. },
  71797. measure: function(layout) {
  71798. var result = {
  71799. max: layout.radius
  71800. };
  71801. if (this._options.indentFromCenter < 0) {
  71802. result.inverseHorizontalOffset = result.inverseVerticalOffset = -_Number(this._options.indentFromCenter)
  71803. }
  71804. return result
  71805. },
  71806. getTooltipParameters: function() {
  71807. var options = this._options;
  71808. var cosSin = _getCosAndSin(this._actualPosition);
  71809. var r = (this._getRadius() + this._getIndentFromCenter()) / 2;
  71810. return {
  71811. x: options.x + cosSin.cos * r,
  71812. y: options.y - cosSin.sin * r,
  71813. value: this._currentValue,
  71814. color: options.color,
  71815. offset: options.width / 2
  71816. }
  71817. }
  71818. });
  71819. var NeedleIndicator = SimpleIndicator.inherit({
  71820. _isVisible: function(layout) {
  71821. var indentFromCenter = this._adjustOffset(Number(this._options.indentFromCenter), layout.radius);
  71822. var offset = this._adjustOffset(Number(this._options.offset), layout.radius);
  71823. return layout.radius - indentFromCenter - offset > 0
  71824. },
  71825. getOffset: function() {
  71826. return 0
  71827. },
  71828. _adjustOffset: function(value, radius) {
  71829. var minRadius = Number(this._options.beginAdaptingAtRadius);
  71830. var diff = radius / minRadius;
  71831. if (diff < 1) {
  71832. value = Math.floor(value * diff)
  71833. }
  71834. return value || 0
  71835. },
  71836. _getIndentFromCenter: function(radius) {
  71837. return this._adjustOffset(Number(this._options.indentFromCenter), this._options.radius)
  71838. },
  71839. _getRadius: function() {
  71840. var options = this._options;
  71841. return options.radius - this._adjustOffset(Number(options.offset), options.radius)
  71842. },
  71843. _renderSpindle: function() {
  71844. var that = this;
  71845. var options = that._options;
  71846. var radius = options.radius;
  71847. var spindleSize = 2 * this._adjustOffset(_Number(options.spindleSize) / 2, radius);
  71848. var gapSize;
  71849. gapSize = 2 * this._adjustOffset(_Number(options.spindleGapSize) / 2, radius) || 0;
  71850. if (gapSize > 0) {
  71851. gapSize = gapSize <= spindleSize ? gapSize : spindleSize
  71852. }
  71853. if (spindleSize > 0) {
  71854. that._spindleOuter = that._spindleOuter || that._renderer.circle().append(that._rootElement);
  71855. that._spindleInner = that._spindleInner || that._renderer.circle().append(that._rootElement);
  71856. that._spindleOuter.attr({
  71857. "class": "dxg-spindle-border",
  71858. cx: options.x,
  71859. cy: options.y,
  71860. r: spindleSize / 2
  71861. });
  71862. that._spindleInner.attr({
  71863. "class": "dxg-spindle-hole",
  71864. cx: options.x,
  71865. cy: options.y,
  71866. r: gapSize / 2,
  71867. fill: options.containerBackgroundColor
  71868. })
  71869. }
  71870. },
  71871. _render: function() {
  71872. var that = this;
  71873. that.callBase();
  71874. that._renderSpindle()
  71875. },
  71876. _clear: function() {
  71877. this.callBase();
  71878. delete this._spindleOuter;
  71879. delete this._spindleInner
  71880. }
  71881. });
  71882. var rectangleNeedle = NeedleIndicator.inherit({
  71883. _renderPointer: function() {
  71884. var that = this;
  71885. var options = that._options;
  71886. var y2 = options.y - this._getRadius();
  71887. var y1 = options.y - this._getIndentFromCenter();
  71888. var x1 = options.x - options.width / 2;
  71889. var x2 = x1 + _Number(options.width);
  71890. that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
  71891. that._element.attr({
  71892. points: [x1, y1, x1, y2, x2, y2, x2, y1]
  71893. })
  71894. }
  71895. });
  71896. var triangleNeedle = NeedleIndicator.inherit({
  71897. _renderPointer: function() {
  71898. var that = this;
  71899. var options = that._options;
  71900. var y2 = options.y - this._getRadius();
  71901. var y1 = options.y - this._getIndentFromCenter();
  71902. var x1 = options.x - options.width / 2;
  71903. var x2 = options.x + options.width / 2;
  71904. that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
  71905. that._element.attr({
  71906. points: [x1, y1, options.x, y2, x2, y1]
  71907. })
  71908. }
  71909. });
  71910. var twoColorNeedle = NeedleIndicator.inherit({
  71911. _renderPointer: function() {
  71912. var that = this;
  71913. var options = that._options;
  71914. var x1 = options.x - options.width / 2;
  71915. var x2 = options.x + options.width / 2;
  71916. var y4 = options.y - this._getRadius();
  71917. var y1 = options.y - this._getIndentFromCenter();
  71918. var fraction = _Number(options.secondFraction) || 0;
  71919. var y2;
  71920. var y3;
  71921. if (fraction >= 1) {
  71922. y2 = y3 = y1
  71923. } else {
  71924. if (fraction <= 0) {
  71925. y2 = y3 = y4
  71926. } else {
  71927. y3 = y4 + (y1 - y4) * fraction;
  71928. y2 = y3 + _Number(options.space)
  71929. }
  71930. }
  71931. that._firstElement = that._firstElement || that._renderer.path([], "area").append(that._rootElement);
  71932. that._spaceElement = that._spaceElement || that._renderer.path([], "area").append(that._rootElement);
  71933. that._secondElement = that._secondElement || that._renderer.path([], "area").append(that._rootElement);
  71934. that._firstElement.attr({
  71935. points: [x1, y1, x1, y2, x2, y2, x2, y1]
  71936. });
  71937. that._spaceElement.attr({
  71938. points: [x1, y2, x1, y3, x2, y3, x2, y2],
  71939. "class": "dxg-hole",
  71940. fill: options.containerBackgroundColor
  71941. });
  71942. that._secondElement.attr({
  71943. points: [x1, y3, x1, y4, x2, y4, x2, y3],
  71944. "class": "dxg-part",
  71945. fill: options.secondColor
  71946. })
  71947. },
  71948. _clearPointer: function() {
  71949. delete this._firstElement;
  71950. delete this._secondElement;
  71951. delete this._spaceElement
  71952. }
  71953. });
  71954. var triangleMarker = SimpleIndicator.inherit({
  71955. _isEnabled: function() {
  71956. return this._options.length > 0 && this._options.width > 0
  71957. },
  71958. _isVisible: function(layout) {
  71959. return layout.radius > 0
  71960. },
  71961. _render: function() {
  71962. var that = this;
  71963. var options = that._options;
  71964. var x = options.x;
  71965. var y1 = options.y - options.radius;
  71966. var dx = options.width / 2 || 0;
  71967. var y2 = y1 - _Number(options.length);
  71968. that._element = that._element || that._renderer.path([], "area").append(that._rootElement);
  71969. var settings = {
  71970. points: [x, y1, x - dx, y2, x + dx, y2],
  71971. stroke: "none",
  71972. "stroke-width": 0,
  71973. "stroke-linecap": "square"
  71974. };
  71975. if (options.space > 0) {
  71976. settings["stroke-width"] = Math.min(options.space, options.width / 4) || 0;
  71977. settings.stroke = settings["stroke-width"] > 0 ? options.containerBackgroundColor || "none" : "none"
  71978. }
  71979. that._element.attr(settings).sharp()
  71980. },
  71981. _clear: function() {
  71982. delete this._element
  71983. },
  71984. _getTrackerSettings: function() {
  71985. var options = this._options;
  71986. var x = options.x;
  71987. var y = options.y - options.radius - options.length / 2;
  71988. var width = options.width / 2;
  71989. var length = options.length / 2;
  71990. width > 10 || (width = 10);
  71991. length > 10 || (length = 10);
  71992. return {
  71993. points: [x - width, y - length, x - width, y + length, x + width, y + length, x + width, y - length]
  71994. }
  71995. },
  71996. measure: function(layout) {
  71997. return {
  71998. min: layout.radius,
  71999. max: layout.radius + _Number(this._options.length)
  72000. }
  72001. },
  72002. getTooltipParameters: function() {
  72003. var options = this._options;
  72004. var cosSin = _getCosAndSin(this._actualPosition);
  72005. var r = options.radius + options.length / 2;
  72006. var parameters = this.callBase();
  72007. parameters.x = options.x + cosSin.cos * r;
  72008. parameters.y = options.y - cosSin.sin * r;
  72009. parameters.offset = options.length / 2;
  72010. return parameters
  72011. }
  72012. });
  72013. var textCloud = BaseTextCloudMarker.inherit({
  72014. _isEnabled: function() {
  72015. return true
  72016. },
  72017. _isVisible: function(layout) {
  72018. return layout.radius > 0
  72019. },
  72020. _getTextCloudOptions: function() {
  72021. var that = this;
  72022. var cosSin = _getCosAndSin(that._actualPosition);
  72023. var nAngle = vizUtils.normalizeAngle(that._actualPosition);
  72024. return {
  72025. x: that._options.x + cosSin.cos * that._options.radius,
  72026. y: that._options.y - cosSin.sin * that._options.radius,
  72027. type: nAngle > 270 ? "left-top" : nAngle > 180 ? "top-right" : nAngle > 90 ? "right-bottom" : "bottom-left"
  72028. }
  72029. },
  72030. measure: function(layout) {
  72031. var that = this;
  72032. var arrowLength = _Number(that._options.arrowLength) || 0;
  72033. that._measureText();
  72034. var verticalOffset = that._textFullHeight + arrowLength;
  72035. var horizontalOffset = that._textFullWidth + arrowLength;
  72036. return {
  72037. min: layout.radius,
  72038. max: layout.radius,
  72039. horizontalOffset: horizontalOffset,
  72040. verticalOffset: verticalOffset,
  72041. inverseHorizontalOffset: horizontalOffset,
  72042. inverseVerticalOffset: verticalOffset
  72043. }
  72044. }
  72045. });
  72046. var rangeBar = BaseRangeBar.inherit({
  72047. _isEnabled: function() {
  72048. return this._options.size > 0
  72049. },
  72050. _isVisible: function(layout) {
  72051. return layout.radius - _Number(this._options.size) > 0
  72052. },
  72053. _createBarItem: function() {
  72054. return this._renderer.arc().attr({
  72055. "stroke-linejoin": "round"
  72056. }).append(this._rootElement)
  72057. },
  72058. _createTracker: function() {
  72059. return this._renderer.arc().attr({
  72060. "stroke-linejoin": "round"
  72061. })
  72062. },
  72063. _setBarSides: function() {
  72064. var that = this;
  72065. that._maxSide = that._options.radius;
  72066. that._minSide = that._maxSide - _Number(that._options.size)
  72067. },
  72068. _getSpace: function() {
  72069. var options = this._options;
  72070. return options.space > 0 ? 180 * options.space / options.radius / Math.PI : 0
  72071. },
  72072. _isTextVisible: function() {
  72073. var options = this._options.text || {};
  72074. return options.indent > 0
  72075. },
  72076. _setTextItemsSides: function() {
  72077. var that = this;
  72078. var options = that._options;
  72079. var indent = _Number(options.text.indent);
  72080. that._lineFrom = options.y - options.radius;
  72081. that._lineTo = that._lineFrom - indent;
  72082. that._textRadius = options.radius + indent
  72083. },
  72084. _getPositions: function() {
  72085. var that = this;
  72086. var basePosition = that._basePosition;
  72087. var actualPosition = that._actualPosition;
  72088. var mainPosition1;
  72089. var mainPosition2;
  72090. if (basePosition >= actualPosition) {
  72091. mainPosition1 = basePosition;
  72092. mainPosition2 = actualPosition
  72093. } else {
  72094. mainPosition1 = actualPosition;
  72095. mainPosition2 = basePosition
  72096. }
  72097. return {
  72098. start: that._startPosition,
  72099. end: that._endPosition,
  72100. main1: mainPosition1,
  72101. main2: mainPosition2,
  72102. back1: Math.min(mainPosition1 + that._space, that._startPosition),
  72103. back2: Math.max(mainPosition2 - that._space, that._endPosition)
  72104. }
  72105. },
  72106. _buildItemSettings: function(from, to) {
  72107. var that = this;
  72108. return {
  72109. x: that._options.x,
  72110. y: that._options.y,
  72111. innerRadius: that._minSide,
  72112. outerRadius: that._maxSide,
  72113. startAngle: to,
  72114. endAngle: from
  72115. }
  72116. },
  72117. _updateTextPosition: function() {
  72118. var that = this;
  72119. var cosSin = _getCosAndSin(that._actualPosition);
  72120. var x = that._options.x + that._textRadius * cosSin.cos;
  72121. var y = that._options.y - that._textRadius * cosSin.sin;
  72122. x += cosSin.cos * that._textWidth * .6;
  72123. y -= cosSin.sin * that._textHeight * .6;
  72124. that._text.attr({
  72125. x: x,
  72126. y: y + that._textVerticalOffset
  72127. })
  72128. },
  72129. _updateLinePosition: function() {
  72130. var that = this;
  72131. var x = that._options.x;
  72132. var x1;
  72133. var x2;
  72134. if (that._basePosition > that._actualPosition) {
  72135. x1 = x - 2;
  72136. x2 = x
  72137. } else {
  72138. if (that._basePosition < that._actualPosition) {
  72139. x1 = x;
  72140. x2 = x + 2
  72141. } else {
  72142. x1 = x - 1;
  72143. x2 = x + 1
  72144. }
  72145. }
  72146. that._line.attr({
  72147. points: [x1, that._lineFrom, x1, that._lineTo, x2, that._lineTo, x2, that._lineFrom]
  72148. }).rotate(_convertAngleToRendererSpace(that._actualPosition), x, that._options.y).sharp()
  72149. },
  72150. _getTooltipPosition: function() {
  72151. var that = this;
  72152. var cosSin = _getCosAndSin((that._basePosition + that._actualPosition) / 2);
  72153. var r = (that._minSide + that._maxSide) / 2;
  72154. return {
  72155. x: that._options.x + cosSin.cos * r,
  72156. y: that._options.y - cosSin.sin * r
  72157. }
  72158. },
  72159. measure: function(layout) {
  72160. var that = this;
  72161. var result = {
  72162. min: layout.radius - _Number(that._options.size),
  72163. max: layout.radius
  72164. };
  72165. that._measureText();
  72166. if (that._hasText) {
  72167. result.max += _Number(that._options.text.indent);
  72168. result.horizontalOffset = that._textWidth;
  72169. result.verticalOffset = that._textHeight
  72170. }
  72171. return result
  72172. }
  72173. });
  72174. exports._default = rectangleNeedle;
  72175. exports.rectangleneedle = rectangleNeedle;
  72176. exports.triangleneedle = triangleNeedle;
  72177. exports.twocolorneedle = twoColorNeedle;
  72178. exports.trianglemarker = triangleMarker;
  72179. exports.textcloud = textCloud;
  72180. exports.rangebar = rangeBar
  72181. },
  72182. /*!*********************************************************************!*\
  72183. !*** ./artifacts/transpiled/viz/gauges/circular_range_container.js ***!
  72184. \*********************************************************************/
  72185. /*! dynamic exports provided */
  72186. /*! all exports used */
  72187. function(module, exports, __webpack_require__) {
  72188. var BaseRangeContainer = __webpack_require__( /*! ./base_range_container */ 413);
  72189. var _Number = Number;
  72190. var _max = Math.max;
  72191. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  72192. var CircularRangeContainer = BaseRangeContainer.inherit({
  72193. _processOptions: function() {
  72194. var that = this;
  72195. that._inner = that._outer = 0;
  72196. switch (_normalizeEnum(that._options.orientation)) {
  72197. case "inside":
  72198. that._inner = 1;
  72199. break;
  72200. case "center":
  72201. that._inner = that._outer = .5;
  72202. break;
  72203. default:
  72204. that._outer = 1
  72205. }
  72206. },
  72207. _isVisible: function(layout) {
  72208. var width = this._options.width;
  72209. width = _Number(width) || _max(_Number(width.start), _Number(width.end));
  72210. return layout.radius - this._inner * width > 0
  72211. },
  72212. _createRange: function(range, layout) {
  72213. var that = this;
  72214. var width = (range.startWidth + range.endWidth) / 2;
  72215. return that._renderer.arc(layout.x, layout.y, layout.radius - that._inner * width, layout.radius + that._outer * width, that._translator.translate(range.end), that._translator.translate(range.start)).attr({
  72216. "stroke-linejoin": "round"
  72217. })
  72218. },
  72219. measure: function(layout) {
  72220. var width = this._options.width;
  72221. width = _Number(width) || _max(_Number(width.start), _Number(width.end));
  72222. return {
  72223. min: layout.radius - this._inner * width,
  72224. max: layout.radius + this._outer * width
  72225. }
  72226. }
  72227. });
  72228. module.exports = CircularRangeContainer
  72229. },
  72230. /*!***********************************************!*\
  72231. !*** ./artifacts/transpiled/viz/bar_gauge.js ***!
  72232. \***********************************************/
  72233. /*! dynamic exports provided */
  72234. /*! all exports used */
  72235. function(module, exports, __webpack_require__) {
  72236. module.exports = __webpack_require__( /*! ./gauges/bar_gauge */ 802).dxBarGauge
  72237. },
  72238. /*!******************************************************!*\
  72239. !*** ./artifacts/transpiled/viz/gauges/bar_gauge.js ***!
  72240. \******************************************************/
  72241. /*! dynamic exports provided */
  72242. /*! all exports used */
  72243. function(module, exports, __webpack_require__) {
  72244. var PI_DIV_180 = Math.PI / 180;
  72245. var _abs = Math.abs;
  72246. var _round = Math.round;
  72247. var _floor = Math.floor;
  72248. var _min = Math.min;
  72249. var _max = Math.max;
  72250. var registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9);
  72251. var objectUtils = __webpack_require__( /*! ../../core/utils/object */ 47);
  72252. var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
  72253. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  72254. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  72255. var baseGaugeModule = __webpack_require__( /*! ./base_gauge */ 145);
  72256. var dxBaseGauge = baseGaugeModule.dxBaseGauge;
  72257. var _getSampleText = baseGaugeModule.getSampleText;
  72258. var _formatValue = baseGaugeModule.formatValue;
  72259. var _compareArrays = baseGaugeModule.compareArrays;
  72260. var dxCircularGauge = __webpack_require__( /*! ./circular_gauge */ 414);
  72261. var _isArray = Array.isArray;
  72262. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  72263. var _convertAngleToRendererSpace = vizUtils.convertAngleToRendererSpace;
  72264. var _getCosAndSin = vizUtils.getCosAndSin;
  72265. var _patchFontOptions = vizUtils.patchFontOptions;
  72266. var _Number = Number;
  72267. var _isFinite = isFinite;
  72268. var _noop = commonUtils.noop;
  72269. var _extend = extend;
  72270. var OPTION_VALUES = "values";
  72271. var dxBarGauge = dxBaseGauge.inherit({
  72272. _rootClass: "dxbg-bar-gauge",
  72273. _themeSection: "barGauge",
  72274. _fontFields: ["label.font", "legend.font", "legend.title.font", "legend.title.subtitle.font"],
  72275. _initCore: function() {
  72276. var that = this;
  72277. that.callBase.apply(that, arguments);
  72278. that._barsGroup = that._renderer.g().attr({
  72279. "class": "dxbg-bars"
  72280. }).linkOn(that._renderer.root, "bars");
  72281. that._values = [];
  72282. that._context = {
  72283. renderer: that._renderer,
  72284. translator: that._translator,
  72285. tracker: that._tracker,
  72286. group: that._barsGroup
  72287. };
  72288. that._animateStep = function(pos) {
  72289. var bars = that._bars;
  72290. var i;
  72291. var ii;
  72292. for (i = 0, ii = bars.length; i < ii; ++i) {
  72293. bars[i].animate(pos)
  72294. }
  72295. };
  72296. that._animateComplete = function() {
  72297. that._bars.forEach(function(bar) {
  72298. return bar.endAnimation()
  72299. });
  72300. that._checkOverlap()
  72301. }
  72302. },
  72303. _disposeCore: function() {
  72304. var that = this;
  72305. that._barsGroup.linkOff();
  72306. that._barsGroup = that._values = that._context = that._animateStep = that._animateComplete = null;
  72307. that.callBase.apply(that, arguments)
  72308. },
  72309. _setupDomainCore: function() {
  72310. var that = this;
  72311. var startValue = that.option("startValue");
  72312. var endValue = that.option("endValue");
  72313. _isFinite(startValue) || (startValue = 0);
  72314. _isFinite(endValue) || (endValue = 100);
  72315. that._translator.setDomain(startValue, endValue);
  72316. that._baseValue = that._translator.adjust(that.option("baseValue"));
  72317. _isFinite(that._baseValue) || (that._baseValue = startValue < endValue ? startValue : endValue)
  72318. },
  72319. _getDefaultSize: function() {
  72320. return {
  72321. width: 300,
  72322. height: 300
  72323. }
  72324. },
  72325. _setupCodomain: dxCircularGauge.prototype._setupCodomain,
  72326. _getApproximateScreenRange: function() {
  72327. var that = this;
  72328. var sides = that._area.sides;
  72329. var width = that._canvas.width / (sides.right - sides.left);
  72330. var height = that._canvas.height / (sides.down - sides.up);
  72331. var r = width < height ? width : height;
  72332. return -that._translator.getCodomainRange() * r * PI_DIV_180
  72333. },
  72334. _setupAnimationSettings: function() {
  72335. var that = this;
  72336. that.callBase.apply(that, arguments);
  72337. if (that._animationSettings) {
  72338. that._animationSettings.step = that._animateStep;
  72339. that._animationSettings.complete = that._animateComplete
  72340. }
  72341. },
  72342. _cleanContent: function() {
  72343. var that = this;
  72344. that._barsGroup.linkRemove();
  72345. that._animationSettings && that._barsGroup.stopAnimation();
  72346. that._barsGroup.clear()
  72347. },
  72348. _renderContent: function() {
  72349. var that = this;
  72350. var labelOptions = that.option("label");
  72351. var text;
  72352. var bBox;
  72353. var context = that._context;
  72354. that._barsGroup.linkAppend();
  72355. context.textEnabled = void 0 === labelOptions || labelOptions && (!("visible" in labelOptions) || labelOptions.visible);
  72356. if (context.textEnabled) {
  72357. context.textColor = labelOptions && labelOptions.font && labelOptions.font.color || null;
  72358. labelOptions = _extend(true, {}, that._themeManager.theme().label, labelOptions);
  72359. context.formatOptions = {
  72360. format: void 0 !== labelOptions.format ? labelOptions.format : that._defaultFormatOptions,
  72361. customizeText: labelOptions.customizeText
  72362. };
  72363. context.textOptions = {
  72364. align: "center"
  72365. };
  72366. context.fontStyles = _patchFontOptions(_extend({}, that._themeManager.theme().label.font, labelOptions.font, {
  72367. color: null
  72368. }));
  72369. that._textIndent = labelOptions.indent > 0 ? _Number(labelOptions.indent) : 0;
  72370. context.lineWidth = labelOptions.connectorWidth > 0 ? _Number(labelOptions.connectorWidth) : 0;
  72371. context.lineColor = labelOptions.connectorColor || null;
  72372. text = that._renderer.text(_getSampleText(that._translator, context.formatOptions), 0, 0).attr(context.textOptions).css(context.fontStyles).append(that._barsGroup);
  72373. bBox = text.getBBox();
  72374. text.remove();
  72375. context.textY = bBox.y;
  72376. context.textWidth = bBox.width;
  72377. context.textHeight = bBox.height
  72378. }
  72379. dxCircularGauge.prototype._applyMainLayout.call(that);
  72380. that._renderBars()
  72381. },
  72382. _measureMainElements: function() {
  72383. var result = {
  72384. maxRadius: this._area.radius
  72385. };
  72386. if (this._context.textEnabled) {
  72387. result.horizontalMargin = this._context.textWidth;
  72388. result.verticalMargin = this._context.textHeight;
  72389. result.inverseHorizontalMargin = this._context.textWidth / 2;
  72390. result.inverseVerticalMargin = this._context.textHeight / 2
  72391. }
  72392. return result
  72393. },
  72394. _renderBars: function() {
  72395. var that = this;
  72396. var options = _extend({}, that._themeManager.theme(), that.option());
  72397. var radius;
  72398. var area = that._area;
  72399. var relativeInnerRadius = options.relativeInnerRadius > 0 && options.relativeInnerRadius < 1 ? _Number(options.relativeInnerRadius) : .1;
  72400. radius = area.radius;
  72401. if (that._context.textEnabled) {
  72402. that._textIndent = _round(_min(that._textIndent, radius / 2));
  72403. radius -= that._textIndent
  72404. }
  72405. that._outerRadius = _floor(radius);
  72406. that._innerRadius = _floor(radius * relativeInnerRadius);
  72407. that._barSpacing = options.barSpacing > 0 ? _Number(options.barSpacing) : 0;
  72408. _extend(that._context, {
  72409. backgroundColor: options.backgroundColor,
  72410. x: area.x,
  72411. y: area.y,
  72412. startAngle: area.startCoord,
  72413. endAngle: area.endCoord,
  72414. baseAngle: that._translator.translate(that._baseValue)
  72415. });
  72416. that._arrangeBars()
  72417. },
  72418. _arrangeBars: function() {
  72419. var that = this;
  72420. var radius = that._outerRadius - that._innerRadius;
  72421. var context = that._context;
  72422. var i;
  72423. var count = that._bars.length;
  72424. that._beginValueChanging();
  72425. context.barSize = count > 0 ? _max((radius - (count - 1) * that._barSpacing) / count, 1) : 0;
  72426. var spacing = count > 1 ? _max(_min((radius - count * context.barSize) / (count - 1), that._barSpacing), 0) : 0;
  72427. var _count = _min(_floor((radius + spacing) / context.barSize), count);
  72428. that._setBarsCount(count);
  72429. radius = that._outerRadius;
  72430. context.textRadius = radius;
  72431. context.textIndent = that._textIndent;
  72432. that._palette.reset();
  72433. var unitOffset = context.barSize + spacing;
  72434. var colors = that._palette.generateColors(_count);
  72435. for (i = 0; i < _count; ++i, radius -= unitOffset) {
  72436. that._bars[i].arrange({
  72437. radius: radius,
  72438. color: colors[i]
  72439. })
  72440. }
  72441. for (var _i = _count; _i < count; _i++) {
  72442. that._bars[_i].hide()
  72443. }
  72444. if (that._animationSettings && !that._noAnimation) {
  72445. that._animateBars()
  72446. } else {
  72447. that._updateBars()
  72448. }
  72449. that._endValueChanging()
  72450. },
  72451. _setBarsCount: function() {
  72452. var that = this;
  72453. if (that._bars.length > 0) {
  72454. if (that._dummyBackground) {
  72455. that._dummyBackground.dispose();
  72456. that._dummyBackground = null
  72457. }
  72458. } else {
  72459. if (!that._dummyBackground) {
  72460. that._dummyBackground = that._renderer.arc().attr({
  72461. "stroke-linejoin": "round"
  72462. })
  72463. }
  72464. that._dummyBackground.attr({
  72465. x: that._context.x,
  72466. y: that._context.y,
  72467. outerRadius: that._outerRadius,
  72468. innerRadius: that._innerRadius,
  72469. startAngle: that._context.endAngle,
  72470. endAngle: that._context.startAngle,
  72471. fill: that._context.backgroundColor
  72472. }).append(that._barsGroup)
  72473. }
  72474. },
  72475. _updateBars: function() {
  72476. this._bars.forEach(function(bar) {
  72477. return bar.applyValue()
  72478. });
  72479. this._checkOverlap()
  72480. },
  72481. _checkOverlap: function() {
  72482. var that = this;
  72483. var bars = that._bars;
  72484. var overlapStrategy = _normalizeEnum(that._getOption("resolveLabelOverlapping", true));
  72485. if ("none" === overlapStrategy) {
  72486. return
  72487. }
  72488. var sortedBars = bars.concat().sort(function(a, b) {
  72489. return a.getValue() - b.getValue()
  72490. });
  72491. var currentIndex = 0;
  72492. var nextIndex = 1;
  72493. while (currentIndex < sortedBars.length && nextIndex < sortedBars.length) {
  72494. var current = sortedBars[currentIndex];
  72495. var next = sortedBars[nextIndex];
  72496. if (current.checkIntersect(next)) {
  72497. next.hideLabel();
  72498. nextIndex++
  72499. } else {
  72500. currentIndex = nextIndex;
  72501. nextIndex = currentIndex + 1
  72502. }
  72503. }
  72504. },
  72505. _animateBars: function() {
  72506. var that = this;
  72507. var i;
  72508. var ii = that._bars.length;
  72509. if (ii > 0) {
  72510. for (i = 0; i < ii; ++i) {
  72511. that._bars[i].beginAnimation()
  72512. }
  72513. that._barsGroup.animate({
  72514. _: 0
  72515. }, that._animationSettings)
  72516. }
  72517. },
  72518. _buildNodes: function() {
  72519. var that = this;
  72520. var options = that._options;
  72521. that._palette = that._themeManager.createPalette(options.palette, {
  72522. useHighlight: true,
  72523. extensionMode: options.paletteExtensionMode
  72524. });
  72525. that._palette.reset();
  72526. that._bars = that._bars || [];
  72527. that._animationSettings && that._barsGroup.stopAnimation();
  72528. var barValues = that._values.filter(_isFinite);
  72529. var count = barValues.length;
  72530. if (that._bars.length > count) {
  72531. var ii = that._bars.length;
  72532. for (var i = count; i < ii; ++i) {
  72533. that._bars[i].dispose()
  72534. }
  72535. that._bars.splice(count, ii - count)
  72536. } else {
  72537. if (that._bars.length < count) {
  72538. for (var _i2 = that._bars.length; _i2 < count; ++_i2) {
  72539. that._bars.push(new BarWrapper(_i2, that._context))
  72540. }
  72541. }
  72542. }
  72543. that._bars.forEach(function(bar, index) {
  72544. bar.update({
  72545. color: that._palette.getNextColor(count),
  72546. value: barValues[index]
  72547. })
  72548. })
  72549. },
  72550. _updateValues: function(values) {
  72551. var that = this;
  72552. var list = _isArray(values) && values || _isFinite(values) && [values] || [];
  72553. var i;
  72554. var ii = list.length;
  72555. var value;
  72556. that._values.length = ii;
  72557. for (i = 0; i < ii; ++i) {
  72558. value = list[i];
  72559. that._values[i] = value = _Number(_isFinite(value) ? value : that._values[i])
  72560. }
  72561. if (!that._resizing) {
  72562. if (!_compareArrays(that._values, that.option(OPTION_VALUES))) {
  72563. that.option(OPTION_VALUES, that._values.slice())
  72564. }
  72565. }
  72566. this._change(["NODES"])
  72567. },
  72568. values: function(arg) {
  72569. if (void 0 !== arg) {
  72570. this._updateValues(arg);
  72571. return this
  72572. } else {
  72573. return this._values.slice(0)
  72574. }
  72575. },
  72576. _optionChangesMap: {
  72577. backgroundColor: "MOSTLY_TOTAL",
  72578. relativeInnerRadius: "MOSTLY_TOTAL",
  72579. barSpacing: "MOSTLY_TOTAL",
  72580. label: "MOSTLY_TOTAL",
  72581. resolveLabelOverlapping: "MOSTLY_TOTAL",
  72582. palette: "MOSTLY_TOTAL",
  72583. paletteExtensionMode: "MOSTLY_TOTAL",
  72584. values: "VALUES"
  72585. },
  72586. _change_VALUES: function() {
  72587. this._updateValues(this.option(OPTION_VALUES))
  72588. },
  72589. _factory: objectUtils.clone(dxBaseGauge.prototype._factory),
  72590. _optionChangesOrder: ["VALUES", "NODES"],
  72591. _initialChanges: ["VALUES"],
  72592. _change_NODES: function() {
  72593. this._buildNodes()
  72594. },
  72595. _change_MOSTLY_TOTAL: function() {
  72596. this._change(["NODES"]);
  72597. this.callBase()
  72598. },
  72599. _proxyData: [],
  72600. _getLegendData: function() {
  72601. var that = this;
  72602. var formatOptions = {};
  72603. var options = that._options;
  72604. var labelFormatOptions = (options.label || {}).format;
  72605. var legendFormatOptions = (options.legend || {}).itemTextFormat;
  72606. if (legendFormatOptions) {
  72607. formatOptions.format = legendFormatOptions
  72608. } else {
  72609. formatOptions.format = labelFormatOptions || that._defaultFormatOptions
  72610. }
  72611. return (this._bars || []).map(function(b) {
  72612. return {
  72613. id: b.index,
  72614. item: {
  72615. value: b.getValue(),
  72616. color: b.getColor(),
  72617. index: b.index
  72618. },
  72619. text: _formatValue(b.getValue(), formatOptions),
  72620. visible: true,
  72621. states: {
  72622. normal: {
  72623. fill: b.getColor()
  72624. }
  72625. }
  72626. }
  72627. })
  72628. }
  72629. });
  72630. var BarWrapper = function(index, context) {
  72631. var that = this;
  72632. that._context = context;
  72633. that._tracker = context.renderer.arc().attr({
  72634. "stroke-linejoin": "round"
  72635. });
  72636. that.index = index
  72637. };
  72638. _extend(BarWrapper.prototype, {
  72639. dispose: function() {
  72640. var that = this;
  72641. that._background.dispose();
  72642. that._bar.dispose();
  72643. if (that._context.textEnabled) {
  72644. that._line.dispose();
  72645. that._text.dispose()
  72646. }
  72647. that._context.tracker.detach(that._tracker);
  72648. that._context = that._settings = that._background = that._bar = that._line = that._text = that._tracker = null;
  72649. return that
  72650. },
  72651. arrange: function(options) {
  72652. var that = this;
  72653. var context = that._context;
  72654. this._visible = true;
  72655. context.tracker.attach(that._tracker, that, {
  72656. index: that.index
  72657. });
  72658. that._background = context.renderer.arc().attr({
  72659. "stroke-linejoin": "round",
  72660. fill: context.backgroundColor
  72661. }).append(context.group);
  72662. that._settings = that._settings || {
  72663. x: context.x,
  72664. y: context.y,
  72665. startAngle: context.baseAngle,
  72666. endAngle: context.baseAngle
  72667. };
  72668. that._bar = context.renderer.arc().attr(_extend({
  72669. "stroke-linejoin": "round"
  72670. }, that._settings)).append(context.group);
  72671. if (context.textEnabled) {
  72672. that._line = context.renderer.path([], "line").attr({
  72673. "stroke-width": context.lineWidth
  72674. }).append(context.group);
  72675. that._text = context.renderer.text().css(context.fontStyles).attr(context.textOptions).append(context.group)
  72676. }
  72677. that._angle = isFinite(that._angle) ? that._angle : context.baseAngle;
  72678. that._settings.outerRadius = options.radius;
  72679. that._settings.innerRadius = options.radius - context.barSize;
  72680. that._settings.x = context.x;
  72681. that._settings.y = context.y;
  72682. that._background.attr(_extend({}, that._settings, {
  72683. startAngle: context.endAngle,
  72684. endAngle: context.startAngle,
  72685. fill: that._context.backgroundColor
  72686. }));
  72687. that._bar.attr({
  72688. x: context.x,
  72689. y: context.y,
  72690. outerRadius: that._settings.outerRadius,
  72691. innerRadius: that._settings.innerRadius,
  72692. fill: that._color
  72693. });
  72694. that._tracker.attr(that._settings);
  72695. if (context.textEnabled) {
  72696. that._line.attr({
  72697. points: [context.x, context.y - that._settings.innerRadius, context.x, context.y - context.textRadius - context.textIndent],
  72698. stroke: context.lineColor || that._color
  72699. }).sharp();
  72700. that._text.css({
  72701. fill: context.textColor || that._color
  72702. })
  72703. }
  72704. return that
  72705. },
  72706. getTooltipParameters: function() {
  72707. var that = this;
  72708. var cosSin = _getCosAndSin((that._angle + that._context.baseAngle) / 2);
  72709. return {
  72710. x: _round(that._context.x + (that._settings.outerRadius + that._settings.innerRadius) / 2 * cosSin.cos),
  72711. y: _round(that._context.y - (that._settings.outerRadius + that._settings.innerRadius) / 2 * cosSin.sin),
  72712. offset: 0,
  72713. color: that._color,
  72714. value: that._value
  72715. }
  72716. },
  72717. setAngle: function(angle) {
  72718. var that = this;
  72719. var context = that._context;
  72720. var settings = that._settings;
  72721. var cosSin;
  72722. that._angle = angle;
  72723. setAngles(settings, context.baseAngle, angle);
  72724. that._bar.attr(settings);
  72725. that._tracker.attr(settings);
  72726. if (context.textEnabled) {
  72727. cosSin = _getCosAndSin(angle);
  72728. var indent = context.textIndent;
  72729. var radius = context.textRadius + indent;
  72730. var x = context.x + radius * cosSin.cos;
  72731. var y = context.y - radius * cosSin.sin;
  72732. var halfWidth = .5 * context.textWidth;
  72733. var textHeight = context.textHeight;
  72734. var textY = context.textY;
  72735. if (_abs(x - context.x) > indent) {
  72736. x += x < context.x ? -halfWidth : halfWidth
  72737. }
  72738. if (_abs(y - context.y) <= indent) {
  72739. y -= textY + .5 * textHeight
  72740. } else {
  72741. y -= y < context.y ? textY + textHeight : textY
  72742. }
  72743. var text = _formatValue(that._value, context.formatOptions, {
  72744. index: that.index
  72745. });
  72746. var visibility = "" === text ? "hidden" : null;
  72747. that._text.attr({
  72748. text: text,
  72749. x: x,
  72750. y: y,
  72751. visibility: visibility
  72752. });
  72753. that._line.attr({
  72754. visibility: visibility
  72755. });
  72756. that._line.rotate(_convertAngleToRendererSpace(angle), context.x, context.y)
  72757. }
  72758. return that
  72759. },
  72760. hideLabel: function() {
  72761. this._text.attr({
  72762. visibility: "hidden"
  72763. });
  72764. this._line.attr({
  72765. visibility: "hidden"
  72766. })
  72767. },
  72768. checkIntersect: function(anotherBar) {
  72769. var coords = this.calculateLabelCoords();
  72770. var anotherCoords = anotherBar.calculateLabelCoords();
  72771. if (!coords || !anotherCoords) {
  72772. return false
  72773. }
  72774. var width = Math.max(0, Math.min(coords.bottomRight.x, anotherCoords.bottomRight.x) - Math.max(coords.topLeft.x, anotherCoords.topLeft.x));
  72775. var height = Math.max(0, Math.min(coords.bottomRight.y, anotherCoords.bottomRight.y) - Math.max(coords.topLeft.y, anotherCoords.topLeft.y));
  72776. return width * height !== 0
  72777. },
  72778. calculateLabelCoords: function() {
  72779. if (!this._text) {
  72780. return
  72781. }
  72782. var box = this._text.getBBox();
  72783. return {
  72784. topLeft: {
  72785. x: box.x,
  72786. y: box.y
  72787. },
  72788. bottomRight: {
  72789. x: box.x + box.width,
  72790. y: box.y + box.height
  72791. }
  72792. }
  72793. },
  72794. _processValue: function(value) {
  72795. return this._context.translator.translate(this._context.translator.adjust(value))
  72796. },
  72797. applyValue: function() {
  72798. if (!this._visible) {
  72799. return this
  72800. }
  72801. return this.setAngle(this._processValue(this.getValue()))
  72802. },
  72803. update: function(_ref) {
  72804. var color = _ref.color,
  72805. value = _ref.value;
  72806. this._color = color;
  72807. this._value = value
  72808. },
  72809. hide: function() {
  72810. this._visible = false
  72811. },
  72812. getColor: function() {
  72813. return this._color
  72814. },
  72815. getValue: function() {
  72816. return this._value
  72817. },
  72818. beginAnimation: function() {
  72819. if (!this._visible) {
  72820. return this
  72821. }
  72822. var that = this;
  72823. var angle = this._processValue(this.getValue());
  72824. if (!compareFloats(that._angle, angle)) {
  72825. that._start = that._angle;
  72826. that._delta = angle - that._angle;
  72827. that._tracker.attr({
  72828. visibility: "hidden"
  72829. });
  72830. if (that._context.textEnabled) {
  72831. that._line.attr({
  72832. visibility: "hidden"
  72833. });
  72834. that._text.attr({
  72835. visibility: "hidden"
  72836. })
  72837. }
  72838. } else {
  72839. that.animate = _noop;
  72840. that.setAngle(that._angle)
  72841. }
  72842. },
  72843. animate: function(pos) {
  72844. if (!this._visible) {
  72845. return this
  72846. }
  72847. var that = this;
  72848. that._angle = that._start + that._delta * pos;
  72849. setAngles(that._settings, that._context.baseAngle, that._angle);
  72850. that._bar.attr(that._settings)
  72851. },
  72852. endAnimation: function() {
  72853. var that = this;
  72854. if (void 0 !== that._delta) {
  72855. if (compareFloats(that._angle, that._start + that._delta)) {
  72856. that._tracker.attr({
  72857. visibility: null
  72858. });
  72859. that.setAngle(that._angle)
  72860. }
  72861. } else {
  72862. delete that.animate
  72863. }
  72864. delete that._start;
  72865. delete that._delta
  72866. }
  72867. });
  72868. function setAngles(target, angle1, angle2) {
  72869. target.startAngle = angle1 < angle2 ? angle1 : angle2;
  72870. target.endAngle = angle1 < angle2 ? angle2 : angle1
  72871. }
  72872. function compareFloats(value1, value2) {
  72873. return _abs(value1 - value2) < 1e-4
  72874. }
  72875. registerComponent("dxBarGauge", dxBarGauge);
  72876. exports.dxBarGauge = dxBarGauge;
  72877. dxBarGauge.addPlugin(__webpack_require__( /*! ../components/legend */ 201).plugin);
  72878. var __BarWrapper = BarWrapper;
  72879. exports.BarWrapper = __BarWrapper;
  72880. exports.stubBarWrapper = function(barWrapperType) {
  72881. BarWrapper = barWrapperType
  72882. };
  72883. exports.restoreBarWrapper = function() {
  72884. BarWrapper = __BarWrapper
  72885. }
  72886. },
  72887. /*!****************************************************!*\
  72888. !*** ./artifacts/transpiled/viz/range_selector.js ***!
  72889. \****************************************************/
  72890. /*! dynamic exports provided */
  72891. /*! all exports used */
  72892. function(module, exports, __webpack_require__) {
  72893. module.exports = __webpack_require__( /*! ./range_selector/range_selector */ 804)
  72894. },
  72895. /*!*******************************************************************!*\
  72896. !*** ./artifacts/transpiled/viz/range_selector/range_selector.js ***!
  72897. \*******************************************************************/
  72898. /*! dynamic exports provided */
  72899. /*! all exports used */
  72900. function(module, exports, __webpack_require__) {
  72901. var _component_registrator = __webpack_require__( /*! ../../core/component_registrator */ 9);
  72902. var _component_registrator2 = _interopRequireDefault(_component_registrator);
  72903. var _type2 = __webpack_require__( /*! ../../core/utils/type */ 1);
  72904. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  72905. var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  72906. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  72907. var _date = __webpack_require__( /*! ../../core/utils/date */ 22);
  72908. var _math = __webpack_require__( /*! ../../core/utils/math */ 28);
  72909. var _range = __webpack_require__( /*! ../translators/range */ 108);
  72910. var _range2 = _interopRequireDefault(_range);
  72911. var _base_axis = __webpack_require__( /*! ../axes/base_axis */ 204);
  72912. var _base_axis2 = _interopRequireDefault(_base_axis);
  72913. var _parse_utils = __webpack_require__( /*! ../components/parse_utils */ 244);
  72914. var _parse_utils2 = _interopRequireDefault(_parse_utils);
  72915. var _format_helper = __webpack_require__( /*! ../../format_helper */ 64);
  72916. var _format_helper2 = _interopRequireDefault(_format_helper);
  72917. var _common = __webpack_require__( /*! ./common */ 206);
  72918. var _common2 = _interopRequireDefault(_common);
  72919. var _sliders_controller = __webpack_require__( /*! ./sliders_controller */ 805);
  72920. var _sliders_controller2 = _interopRequireDefault(_sliders_controller);
  72921. var _tracker = __webpack_require__( /*! ./tracker */ 808);
  72922. var _range_view = __webpack_require__( /*! ./range_view */ 809);
  72923. var _range_view2 = _interopRequireDefault(_range_view);
  72924. var _series_data_source = __webpack_require__( /*! ./series_data_source */ 810);
  72925. var _series_data_source2 = _interopRequireDefault(_series_data_source);
  72926. var _tick_generator = __webpack_require__( /*! ../axes/tick_generator */ 406);
  72927. var _tick_generator2 = _interopRequireDefault(_tick_generator);
  72928. var _base_widget = __webpack_require__( /*! ../core/base_widget */ 96);
  72929. var _base_widget2 = _interopRequireDefault(_base_widget);
  72930. var _export = __webpack_require__( /*! ../core/export */ 93);
  72931. var _title = __webpack_require__( /*! ../core/title */ 105);
  72932. var _loading_indicator = __webpack_require__( /*! ../core/loading_indicator */ 119);
  72933. var _data_source = __webpack_require__( /*! ../core/data_source */ 144);
  72934. function _interopRequireDefault(obj) {
  72935. return obj && obj.__esModule ? obj : {
  72936. "default": obj
  72937. }
  72938. }
  72939. var _max = Math.max;
  72940. var _ceil = Math.ceil;
  72941. var _floor = Math.floor;
  72942. var START_VALUE = "startValue";
  72943. var END_VALUE = "endValue";
  72944. var DATETIME = "datetime";
  72945. var VALUE = "value";
  72946. var DISCRETE = "discrete";
  72947. var SEMIDISCRETE = "semidiscrete";
  72948. var STRING = "string";
  72949. var VALUE_CHANGED = VALUE + "Changed";
  72950. var CONTAINER_BACKGROUND_COLOR = "containerBackgroundColor";
  72951. var SLIDER_MARKER = "sliderMarker";
  72952. var OPTION_BACKGROUND = "background";
  72953. var LOGARITHMIC = "logarithmic";
  72954. var KEEP = "keep";
  72955. var SHIFT = "shift";
  72956. var RESET = "reset";
  72957. var INVISIBLE_POS = -1e3;
  72958. var SEMIDISCRETE_GRID_SPACING_FACTOR = 50;
  72959. var DEFAULT_AXIS_DIVISION_FACTOR = 30;
  72960. var DEFAULT_MINOR_AXIS_DIVISION_FACTOR = 15;
  72961. var logarithmBase = 10;
  72962. function calculateMarkerHeight(renderer, value, sliderMarkerOptions) {
  72963. var formattedText = void 0 === value ? _common2.default.consts.emptySliderMarkerText : _common2.default.formatValue(value, sliderMarkerOptions);
  72964. var textBBox = getTextBBox(renderer, formattedText, sliderMarkerOptions.font);
  72965. return _ceil(textBBox.height) + 2 * sliderMarkerOptions.paddingTopBottom + _common2.default.consts.pointerSize
  72966. }
  72967. function calculateScaleLabelHalfWidth(renderer, value, scaleOptions, tickIntervalsInfo) {
  72968. var formattedText = _common2.default.formatValue(value, scaleOptions.label, tickIntervalsInfo, scaleOptions.valueType, scaleOptions.type, scaleOptions.logarithmBase);
  72969. var textBBox = getTextBBox(renderer, formattedText, scaleOptions.label.font);
  72970. return _ceil(textBBox.width / 2)
  72971. }
  72972. function calculateIndents(renderer, scale, sliderMarkerOptions, indentOptions, tickIntervalsInfo) {
  72973. var leftScaleLabelWidth = 0;
  72974. var rightScaleLabelWidth = 0;
  72975. var placeholderWidthLeft;
  72976. var placeholderWidthRight;
  72977. var placeholderHeight;
  72978. var ticks = "semidiscrete" === scale.type ? scale.customTicks : tickIntervalsInfo.ticks;
  72979. indentOptions = indentOptions || {};
  72980. placeholderWidthLeft = indentOptions.left;
  72981. placeholderWidthRight = indentOptions.right;
  72982. placeholderHeight = sliderMarkerOptions.placeholderHeight;
  72983. if (sliderMarkerOptions.visible) {
  72984. var leftMarkerHeight = calculateMarkerHeight(renderer, scale.startValue, sliderMarkerOptions);
  72985. var rightMarkerHeight = calculateMarkerHeight(renderer, scale.endValue, sliderMarkerOptions);
  72986. if (void 0 === placeholderHeight) {
  72987. placeholderHeight = _max(leftMarkerHeight, rightMarkerHeight)
  72988. }
  72989. }
  72990. if (scale.label.visible) {
  72991. var startTickValue = (0, _type2.isDefined)(scale.startValue) ? ticks[0] : void 0;
  72992. var endTickValue = (0, _type2.isDefined)(scale.endValue) ? ticks[ticks.length - 1] : void 0;
  72993. leftScaleLabelWidth = calculateScaleLabelHalfWidth(renderer, startTickValue, scale, tickIntervalsInfo);
  72994. rightScaleLabelWidth = calculateScaleLabelHalfWidth(renderer, endTickValue, scale, tickIntervalsInfo)
  72995. }
  72996. placeholderWidthLeft = void 0 !== placeholderWidthLeft ? placeholderWidthLeft : leftScaleLabelWidth;
  72997. placeholderWidthRight = (void 0 !== placeholderWidthRight ? placeholderWidthRight : rightScaleLabelWidth) || 1;
  72998. return {
  72999. left: placeholderWidthLeft,
  73000. right: placeholderWidthRight,
  73001. top: placeholderHeight || 0,
  73002. bottom: 0
  73003. }
  73004. }
  73005. function calculateValueType(firstValue, secondValue) {
  73006. var typeFirstValue = (0, _type2.type)(firstValue);
  73007. var typeSecondValue = (0, _type2.type)(secondValue);
  73008. var validType = function(type) {
  73009. return typeFirstValue === type || typeSecondValue === type
  73010. };
  73011. return validType("date") ? DATETIME : validType("number") ? "numeric" : validType(STRING) ? STRING : ""
  73012. }
  73013. function showScaleMarkers(scaleOptions) {
  73014. return scaleOptions.valueType === DATETIME && scaleOptions.marker.visible
  73015. }
  73016. function updateTranslatorRangeInterval(translatorRange, scaleOptions) {
  73017. var intervalX = scaleOptions.minorTickInterval || scaleOptions.tickInterval;
  73018. if ("datetime" === scaleOptions.valueType) {
  73019. intervalX = (0, _date.dateToMilliseconds)(intervalX)
  73020. }
  73021. translatorRange.addRange({
  73022. interval: intervalX
  73023. })
  73024. }
  73025. function checkLogarithmicOptions(options, defaultLogarithmBase, incidentOccurred) {
  73026. if (!options) {
  73027. return
  73028. }
  73029. var logarithmBase = options.logarithmBase;
  73030. if (options.type === LOGARITHMIC && logarithmBase <= 0 || logarithmBase && !(0, _type2.isNumeric)(logarithmBase)) {
  73031. options.logarithmBase = defaultLogarithmBase;
  73032. incidentOccurred("E2104")
  73033. } else {
  73034. if (options.type !== LOGARITHMIC) {
  73035. options.logarithmBase = void 0
  73036. }
  73037. }
  73038. }
  73039. function calculateScaleAreaHeight(renderer, scaleOptions, visibleMarkers, tickIntervalsInfo) {
  73040. var labelScaleOptions = scaleOptions.label;
  73041. var markerScaleOptions = scaleOptions.marker;
  73042. var placeholderHeight = scaleOptions.placeholderHeight;
  73043. var ticks = "semidiscrete" === scaleOptions.type ? scaleOptions.customTicks : tickIntervalsInfo.ticks;
  73044. var text = _common2.default.formatValue(ticks[0], labelScaleOptions);
  73045. if (placeholderHeight) {
  73046. return placeholderHeight
  73047. } else {
  73048. return (labelScaleOptions.visible ? labelScaleOptions.topIndent + getTextBBox(renderer, text, labelScaleOptions.font).height : 0) + (visibleMarkers ? markerScaleOptions.topIndent + markerScaleOptions.separatorHeight : 0)
  73049. }
  73050. }
  73051. function getMinorTickIntervalUnit(tickInterval, minorTickInterval, withCorrection) {
  73052. var interval = (0, _date.getDateUnitInterval)(minorTickInterval);
  73053. var majorUnit = (0, _date.getDateUnitInterval)(tickInterval);
  73054. var idx = _date.dateUnitIntervals.indexOf(interval);
  73055. if (withCorrection && interval === majorUnit && idx > 0) {
  73056. interval = _date.dateUnitIntervals[idx - 1]
  73057. }
  73058. return interval
  73059. }
  73060. function getNextTickInterval(tickInterval, minorTickInterval, isDateType) {
  73061. if (!tickInterval) {
  73062. tickInterval = minorTickInterval
  73063. } else {
  73064. if (isDateType) {
  73065. tickInterval = (0, _date.getNextDateUnit)(tickInterval)
  73066. } else {
  73067. tickInterval += minorTickInterval
  73068. }
  73069. }
  73070. return tickInterval
  73071. }
  73072. function calculateTickIntervalsForSemidiscreteScale(scaleOptions, min, max, screenDelta) {
  73073. var minorTickInterval = scaleOptions.minorTickInterval;
  73074. var tickInterval = scaleOptions.tickInterval;
  73075. var interval;
  73076. var isDateType = "datetime" === scaleOptions.valueType;
  73077. var gridSpacingFactor = scaleOptions.axisDivisionFactor || {};
  73078. var tickCountByInterval;
  73079. var tickCountByScreen;
  73080. if (!tickInterval) {
  73081. do {
  73082. interval = getNextTickInterval(tickInterval, minorTickInterval, isDateType);
  73083. if (tickInterval !== interval) {
  73084. tickInterval = interval
  73085. } else {
  73086. break
  73087. }
  73088. if (isDateType) {
  73089. interval = (0, _date.dateToMilliseconds)(tickInterval)
  73090. }
  73091. tickCountByInterval = _ceil((max - min) / interval);
  73092. tickCountByScreen = _floor(screenDelta / (gridSpacingFactor[tickInterval] || SEMIDISCRETE_GRID_SPACING_FACTOR)) || 1
  73093. } while (interval && tickCountByInterval > tickCountByScreen)
  73094. }
  73095. return {
  73096. tickInterval: tickInterval,
  73097. minorTickInterval: minorTickInterval,
  73098. bounds: {
  73099. minVisible: min,
  73100. maxVisible: max
  73101. },
  73102. ticks: []
  73103. }
  73104. }
  73105. function updateTickIntervals(scaleOptions, screenDelta, incidentOccurred, range) {
  73106. var result;
  73107. var min = (0, _type2.isDefined)(range.minVisible) ? range.minVisible : range.min;
  73108. var max = (0, _type2.isDefined)(range.maxVisible) ? range.maxVisible : range.max;
  73109. var categoriesInfo = scaleOptions._categoriesInfo;
  73110. var bounds = {};
  73111. if (scaleOptions.type === SEMIDISCRETE) {
  73112. result = calculateTickIntervalsForSemidiscreteScale(scaleOptions, min, max, screenDelta)
  73113. } else {
  73114. var ticksInfo = _tick_generator2.default.tickGenerator({
  73115. axisType: scaleOptions.type,
  73116. dataType: scaleOptions.valueType,
  73117. logBase: scaleOptions.logarithmBase,
  73118. axisDivisionFactor: scaleOptions.axisDivisionFactor,
  73119. minorAxisDivisionFactor: scaleOptions.minorAxisDivisionFactor,
  73120. calculateMinors: true,
  73121. allowDecimals: scaleOptions.allowDecimals,
  73122. endOnTick: scaleOptions.endOnTick,
  73123. incidentOccurred: incidentOccurred,
  73124. rangeIsEmpty: range.isEmpty()
  73125. })({
  73126. min: min,
  73127. max: max,
  73128. categories: (0, _type2.isDefined)(categoriesInfo) ? categoriesInfo.categories : []
  73129. }, screenDelta, scaleOptions.tickInterval, scaleOptions.forceUserTickInterval, void 0, scaleOptions.minorTickInterval, scaleOptions.minorTickCount);
  73130. var length = ticksInfo.ticks.length;
  73131. bounds.minVisible = ticksInfo.ticks[0] < min ? ticksInfo.ticks[0] : min;
  73132. bounds.maxVisible = ticksInfo.ticks[length - 1] > max ? ticksInfo.ticks[length - 1] : max;
  73133. result = {
  73134. tickInterval: ticksInfo.tickInterval,
  73135. minorTickInterval: 0 === scaleOptions.minorTickInterval ? 0 : ticksInfo.minorTickInterval,
  73136. bounds: bounds,
  73137. ticks: ticksInfo.ticks
  73138. }
  73139. }
  73140. return result
  73141. }
  73142. function calculateTranslatorRange(seriesDataSource, scaleOptions) {
  73143. var minValue;
  73144. var maxValue;
  73145. var inverted = false;
  73146. var startValue = scaleOptions.startValue;
  73147. var endValue = scaleOptions.endValue;
  73148. var categories;
  73149. var categoriesInfo;
  73150. var translatorRange = seriesDataSource ? seriesDataSource.getBoundRange().arg : new _range2.default.Range;
  73151. var isDate = "datetime" === scaleOptions.valueType;
  73152. var minRange = scaleOptions.minRange;
  73153. if (scaleOptions.type === DISCRETE) {
  73154. var rangeForCategories = new _range2.default.Range({
  73155. minVisible: startValue,
  73156. maxVisible: endValue
  73157. });
  73158. rangeForCategories.addRange(translatorRange);
  73159. translatorRange = rangeForCategories;
  73160. categories = seriesDataSource ? seriesDataSource.argCategories : scaleOptions.categories || !seriesDataSource && startValue && endValue && [startValue, endValue];
  73161. categories = categories || [];
  73162. scaleOptions._categoriesInfo = categoriesInfo = (0, _utils.getCategoriesInfo)(categories, startValue, endValue)
  73163. }
  73164. if (scaleOptions.type === SEMIDISCRETE) {
  73165. startValue = scaleOptions.startValue = correctValueByInterval(scaleOptions.startValue, isDate, minRange);
  73166. endValue = scaleOptions.endValue = correctValueByInterval(scaleOptions.endValue, isDate, minRange);
  73167. translatorRange.minVisible = correctValueByInterval(translatorRange.minVisible, isDate, minRange);
  73168. translatorRange.maxVisible = correctValueByInterval(translatorRange.maxVisible, isDate, minRange);
  73169. translatorRange.min = correctValueByInterval(translatorRange.min, isDate, minRange);
  73170. translatorRange.max = correctValueByInterval(translatorRange.max, isDate, minRange)
  73171. }
  73172. if ((0, _type2.isDefined)(startValue) && (0, _type2.isDefined)(endValue)) {
  73173. inverted = categoriesInfo ? categoriesInfo.inverted : startValue > endValue;
  73174. minValue = categoriesInfo ? categoriesInfo.start : inverted ? endValue : startValue;
  73175. maxValue = categoriesInfo ? categoriesInfo.end : inverted ? startValue : endValue
  73176. } else {
  73177. if ((0, _type2.isDefined)(startValue) || (0, _type2.isDefined)(endValue)) {
  73178. minValue = startValue;
  73179. maxValue = endValue
  73180. } else {
  73181. if (categoriesInfo) {
  73182. minValue = categoriesInfo.start;
  73183. maxValue = categoriesInfo.end
  73184. }
  73185. }
  73186. }
  73187. translatorRange.addRange({
  73188. invert: inverted,
  73189. min: minValue,
  73190. max: maxValue,
  73191. minVisible: minValue,
  73192. maxVisible: maxValue,
  73193. dataType: scaleOptions.valueType
  73194. });
  73195. translatorRange.addRange({
  73196. categories: !seriesDataSource ? categories : void 0,
  73197. base: scaleOptions.logarithmBase,
  73198. axisType: scaleOptions.type,
  73199. dataType: scaleOptions.valueType
  73200. });
  73201. seriesDataSource && translatorRange.sortCategories(categories);
  73202. return translatorRange
  73203. }
  73204. function startEndNotDefined(start, end) {
  73205. return !(0, _type2.isDefined)(start) || !(0, _type2.isDefined)(end)
  73206. }
  73207. function getTextBBox(renderer, text, fontOptions) {
  73208. var textElement = renderer.text(text, INVISIBLE_POS, INVISIBLE_POS).css((0, _utils.patchFontOptions)(fontOptions)).append(renderer.root);
  73209. var textBBox = textElement.getBBox();
  73210. textElement.remove();
  73211. return textBBox
  73212. }
  73213. function getDateMarkerVisibilityChecker(screenDelta) {
  73214. return function(isDateScale, isMarkerVisible, min, max, tickInterval) {
  73215. if (isMarkerVisible && isDateScale) {
  73216. if (!(0, _type2.isDefined)(tickInterval) || tickInterval.years || tickInterval.months >= 6 || screenDelta / SEMIDISCRETE_GRID_SPACING_FACTOR < _ceil((max - min) / (0, _date.dateToMilliseconds)("year")) + 1) {
  73217. isMarkerVisible = false
  73218. }
  73219. }
  73220. return isMarkerVisible
  73221. }
  73222. }
  73223. function updateScaleOptions(scaleOptions, seriesDataSource, translatorRange, tickIntervalsInfo, checkDateMarkerVisibility) {
  73224. var isEmptyInterval;
  73225. var categoriesInfo = scaleOptions._categoriesInfo;
  73226. var isDateTime = scaleOptions.valueType === DATETIME;
  73227. if (seriesDataSource && !seriesDataSource.isEmpty() && !translatorRange.isEmpty()) {
  73228. var bounds = tickIntervalsInfo.bounds;
  73229. translatorRange.addRange(bounds);
  73230. scaleOptions.startValue = translatorRange.invert ? bounds.maxVisible : bounds.minVisible;
  73231. scaleOptions.endValue = translatorRange.invert ? bounds.minVisible : bounds.maxVisible
  73232. }
  73233. scaleOptions.marker.visible = checkDateMarkerVisibility(isDateTime && scaleOptions.type.indexOf(DISCRETE) === -1, scaleOptions.marker.visible, scaleOptions.startValue, scaleOptions.endValue, tickIntervalsInfo.tickInterval);
  73234. if (categoriesInfo) {
  73235. scaleOptions.startValue = categoriesInfo.start;
  73236. scaleOptions.endValue = categoriesInfo.end
  73237. }
  73238. if (scaleOptions.type.indexOf(DISCRETE) === -1) {
  73239. isEmptyInterval = (0, _type2.isDate)(scaleOptions.startValue) && (0, _type2.isDate)(scaleOptions.endValue) && scaleOptions.startValue.getTime() === scaleOptions.endValue.getTime() || scaleOptions.startValue === scaleOptions.endValue
  73240. }
  73241. scaleOptions.isEmpty = startEndNotDefined(scaleOptions.startValue, scaleOptions.endValue) || isEmptyInterval;
  73242. if (scaleOptions.isEmpty) {
  73243. scaleOptions.startValue = scaleOptions.endValue = void 0
  73244. } else {
  73245. scaleOptions.minorTickInterval = tickIntervalsInfo.minorTickInterval;
  73246. scaleOptions.tickInterval = tickIntervalsInfo.tickInterval;
  73247. if (isDateTime && (!(0, _type2.isDefined)(scaleOptions.label.format) || scaleOptions.type === SEMIDISCRETE && scaleOptions.minorTickInterval !== scaleOptions.tickInterval)) {
  73248. if (scaleOptions.type === DISCRETE) {
  73249. scaleOptions.label.format = _format_helper2.default.getDateFormatByTicks(tickIntervalsInfo.ticks)
  73250. } else {
  73251. if (!scaleOptions.marker.visible) {
  73252. scaleOptions.label.format = _format_helper2.default.getDateFormatByTickInterval(scaleOptions.startValue, scaleOptions.endValue, scaleOptions.tickInterval)
  73253. } else {
  73254. scaleOptions.label.format = (0, _date.getDateFormatByTickInterval)(scaleOptions.tickInterval)
  73255. }
  73256. }
  73257. }
  73258. }
  73259. if (scaleOptions.type === SEMIDISCRETE) {
  73260. var intervals = getIntervalCustomTicks(scaleOptions);
  73261. scaleOptions.customMinorTicks = intervals.altIntervals;
  73262. scaleOptions.customTicks = intervals.intervals;
  73263. scaleOptions.customBoundTicks = [scaleOptions.customTicks[0]]
  73264. }
  73265. }
  73266. function prepareScaleOptions(scaleOption, calculatedValueType, incidentOccurred, containerColor) {
  73267. var parsedValue = 0;
  73268. var valueType = _parse_utils2.default.correctValueType((0, _utils.normalizeEnum)(scaleOption.valueType));
  73269. var validateStartEndValues = function(field, parser) {
  73270. var messageToIncidentOccurred = field === START_VALUE ? "start" : "end";
  73271. if ((0, _type2.isDefined)(scaleOption[field])) {
  73272. parsedValue = parser(scaleOption[field]);
  73273. if ((0, _type2.isDefined)(parsedValue)) {
  73274. scaleOption[field] = parsedValue
  73275. } else {
  73276. scaleOption[field] = void 0;
  73277. incidentOccurred("E2202", [messageToIncidentOccurred])
  73278. }
  73279. }
  73280. };
  73281. valueType = calculatedValueType || valueType;
  73282. if (!valueType) {
  73283. valueType = calculateValueType(scaleOption.startValue, scaleOption.endValue) || "numeric"
  73284. }
  73285. if (valueType === STRING || scaleOption.categories) {
  73286. scaleOption.type = DISCRETE;
  73287. valueType = STRING
  73288. }
  73289. scaleOption.containerColor = containerColor;
  73290. scaleOption.valueType = valueType;
  73291. scaleOption.dataType = valueType;
  73292. var parser = _parse_utils2.default.getParser(valueType);
  73293. validateStartEndValues(START_VALUE, parser);
  73294. validateStartEndValues(END_VALUE, parser);
  73295. checkLogarithmicOptions(scaleOption, logarithmBase, incidentOccurred);
  73296. if (!scaleOption.type) {
  73297. scaleOption.type = "continuous"
  73298. }
  73299. scaleOption.parser = parser;
  73300. if (scaleOption.type === SEMIDISCRETE) {
  73301. scaleOption.minorTick.visible = false;
  73302. scaleOption.minorTickInterval = scaleOption.minRange;
  73303. scaleOption.marker.visible = false;
  73304. scaleOption.maxRange = void 0
  73305. }
  73306. scaleOption.forceUserTickInterval |= (0, _type2.isDefined)(scaleOption.tickInterval) && !(0, _type2.isDefined)(scaleOption.axisDivisionFactor);
  73307. scaleOption.axisDivisionFactor = (0, _type2.isDefined)(scaleOption.axisDivisionFactor) ? scaleOption.axisDivisionFactor : DEFAULT_AXIS_DIVISION_FACTOR;
  73308. scaleOption.minorAxisDivisionFactor = (0, _type2.isDefined)(scaleOption.minorAxisDivisionFactor) ? scaleOption.minorAxisDivisionFactor : DEFAULT_MINOR_AXIS_DIVISION_FACTOR;
  73309. return scaleOption
  73310. }
  73311. function correctValueByInterval(value, isDate, interval) {
  73312. if ((0, _type2.isDefined)(value)) {
  73313. value = isDate ? (0, _date.correctDateWithUnitBeginning)(new Date(value), interval) : (0, _math.adjust)(_floor((0, _math.adjust)(value / interval)) * interval)
  73314. }
  73315. return value
  73316. }
  73317. function getIntervalCustomTicks(options) {
  73318. var min = options.startValue;
  73319. var max = options.endValue;
  73320. var isDate = "datetime" === options.valueType;
  73321. var tickInterval = options.tickInterval;
  73322. var res = {
  73323. intervals: []
  73324. };
  73325. if (!(0, _type2.isDefined)(min) || !(0, _type2.isDefined)(max)) {
  73326. return res
  73327. }
  73328. res.intervals = (0, _date.getSequenceByInterval)(min, max, options.minorTickInterval);
  73329. if (tickInterval !== options.minorTickInterval) {
  73330. res.altIntervals = res.intervals;
  73331. min = correctValueByInterval(min, isDate, tickInterval);
  73332. max = correctValueByInterval(max, isDate, tickInterval);
  73333. res.intervals = (0, _date.getSequenceByInterval)(min, max, tickInterval);
  73334. res.intervals[0] = res.altIntervals[0]
  73335. }
  73336. return res
  73337. }
  73338. function getPrecisionForSlider(startValue, endValue, screenDelta) {
  73339. var d = Math.abs(endValue - startValue) / screenDelta;
  73340. var tail = d - _floor(d);
  73341. return tail > 0 ? _ceil(Math.abs((0, _math.adjust)((0, _utils.getLog)(tail, 10)))) : 0
  73342. }
  73343. var dxRangeSelector = _base_widget2.default.inherit({
  73344. _toggleParentsScrollSubscription: function() {},
  73345. _eventsMap: {
  73346. onValueChanged: {
  73347. name: VALUE_CHANGED
  73348. }
  73349. },
  73350. _setDeprecatedOptions: function() {
  73351. this.callBase.apply(this, arguments);
  73352. (0, _extend.extend)(this._deprecatedOptions, {
  73353. "chart.barWidth": {
  73354. since: "18.1",
  73355. message: "Use the 'chart.commonSeriesSettings.barPadding' or 'chart.series.barPadding' option instead"
  73356. },
  73357. "chart.equalBarWidth": {
  73358. since: "18.1",
  73359. message: "Use the 'chart.commonSeriesSettings.ignoreEmptyPoints' or 'chart.series.ignoreEmptyPoints' option instead"
  73360. },
  73361. "chart.useAggregation": {
  73362. since: "18.1",
  73363. message: "Use the 'chart.commonSeriesSettings.aggregation.enabled' or 'chart.series.aggregation.enabled' option instead"
  73364. }
  73365. })
  73366. },
  73367. _rootClassPrefix: "dxrs",
  73368. _rootClass: "dxrs-range-selector",
  73369. _dataIsReady: function() {
  73370. return this._dataIsLoaded()
  73371. },
  73372. _initialChanges: ["DATA_SOURCE", "VALUE"],
  73373. _themeDependentChanges: ["MOSTLY_TOTAL"],
  73374. _themeSection: "rangeSelector",
  73375. _fontFields: ["scale.label.font", "sliderMarker.font"],
  73376. _initCore: function() {
  73377. var that = this;
  73378. var renderer = that._renderer;
  73379. var root = renderer.root;
  73380. root.css({
  73381. "touch-action": "pan-y"
  73382. });
  73383. that._clipRect = renderer.clipRect();
  73384. var rangeViewGroup = renderer.g().attr({
  73385. "class": "dxrs-view"
  73386. }).append(root);
  73387. var slidersGroup = renderer.g().attr({
  73388. "class": "dxrs-slidersContainer",
  73389. "clip-path": that._clipRect.id
  73390. }).append(root);
  73391. var scaleGroup = renderer.g().attr({
  73392. "class": "dxrs-scale",
  73393. "clip-path": that._clipRect.id
  73394. }).append(root);
  73395. var scaleBreaksGroup = renderer.g().attr({
  73396. "class": "dxrs-scale-breaks"
  73397. }).append(root);
  73398. var trackersGroup = renderer.g().attr({
  73399. "class": "dxrs-trackers"
  73400. }).append(root);
  73401. that._axis = new AxisWrapper({
  73402. renderer: renderer,
  73403. root: scaleGroup,
  73404. scaleBreaksGroup: scaleBreaksGroup,
  73405. updateSelectedRange: function(range, e) {
  73406. that.setValue((0, _utils.convertVisualRangeObject)(range), e)
  73407. },
  73408. incidentOccurred: that._incidentOccurred
  73409. });
  73410. that._rangeView = new _range_view2.default.RangeView({
  73411. renderer: renderer,
  73412. root: rangeViewGroup,
  73413. translator: that._axis.getTranslator()
  73414. });
  73415. that._slidersController = new _sliders_controller2.default.SlidersController({
  73416. renderer: renderer,
  73417. root: slidersGroup,
  73418. trackersGroup: trackersGroup,
  73419. updateSelectedRange: function(range, lastSelectedRange, e) {
  73420. if (!that._rangeOption) {
  73421. that.option(VALUE, (0, _utils.convertVisualRangeObject)(range, (0, _type2.isPlainObject)(that._options[VALUE])))
  73422. }
  73423. that._eventTrigger(VALUE_CHANGED, {
  73424. value: (0, _utils.convertVisualRangeObject)(range),
  73425. previousValue: (0, _utils.convertVisualRangeObject)(lastSelectedRange),
  73426. event: e
  73427. })
  73428. },
  73429. axis: that._axis,
  73430. translator: that._axis.getTranslator()
  73431. });
  73432. that._tracker = new _tracker.Tracker({
  73433. renderer: renderer,
  73434. controller: that._slidersController
  73435. })
  73436. },
  73437. _getDefaultSize: function() {
  73438. return {
  73439. width: 400,
  73440. height: 160
  73441. }
  73442. },
  73443. _disposeCore: function() {
  73444. this._axis.dispose();
  73445. this._slidersController.dispose();
  73446. this._tracker.dispose()
  73447. },
  73448. _applySize: function(rect) {
  73449. this._clientRect = rect.slice();
  73450. this._change(["MOSTLY_TOTAL"])
  73451. },
  73452. _optionChangesMap: {
  73453. scale: "SCALE",
  73454. value: "VALUE",
  73455. dataSource: "DATA_SOURCE"
  73456. },
  73457. _optionChangesOrder: ["SCALE", "DATA_SOURCE"],
  73458. _change_SCALE: function() {
  73459. this._change(["MOSTLY_TOTAL"])
  73460. },
  73461. _setValueByDataSource: function() {
  73462. var that = this;
  73463. var options = that._options;
  73464. var axis = that._axis;
  73465. if (options.dataSource) {
  73466. var selectedRangeUpdateMode = that.option("selectedRangeUpdateMode");
  73467. var value = that.getValue();
  73468. var valueIsReady = (0, _type2.isDefined)(value[0]) && (0, _type2.isDefined)(value[1]);
  73469. if ((0, _type2.isDefined)(selectedRangeUpdateMode)) {
  73470. selectedRangeUpdateMode = (0, _utils.normalizeEnum)(selectedRangeUpdateMode);
  73471. that.__skipAnimation = true
  73472. } else {
  73473. if (valueIsReady) {
  73474. selectedRangeUpdateMode = RESET
  73475. }
  73476. }
  73477. if ("auto" === selectedRangeUpdateMode && valueIsReady) {
  73478. var rangesInfo = axis.allScaleSelected(value);
  73479. if (rangesInfo.startValue && rangesInfo.endValue) {
  73480. selectedRangeUpdateMode = RESET
  73481. } else {
  73482. if (rangesInfo.endValue) {
  73483. selectedRangeUpdateMode = SHIFT
  73484. } else {
  73485. selectedRangeUpdateMode = KEEP
  73486. }
  73487. }
  73488. }
  73489. if (selectedRangeUpdateMode === RESET) {
  73490. options[VALUE] = null
  73491. } else {
  73492. if (selectedRangeUpdateMode === SHIFT && valueIsReady) {
  73493. var _value = that.getValue();
  73494. that.__skipAnimation = true;
  73495. options[VALUE] = {
  73496. length: axis.getVisualRangeLength({
  73497. minVisible: _value[0],
  73498. maxVisible: _value[1]
  73499. })
  73500. }
  73501. } else {
  73502. if (selectedRangeUpdateMode === KEEP) {
  73503. that.__skipAnimation = true
  73504. }
  73505. }
  73506. }
  73507. }
  73508. },
  73509. _change_DATA_SOURCE: function() {
  73510. if (this._options.dataSource) {
  73511. this._updateDataSource()
  73512. }
  73513. },
  73514. _customChangesOrder: ["MOSTLY_TOTAL", "VALUE", "SLIDER_SELECTION"],
  73515. _change_MOSTLY_TOTAL: function() {
  73516. this._applyMostlyTotalChange()
  73517. },
  73518. _change_SLIDER_SELECTION: function() {
  73519. var that = this;
  73520. var value = that._options[VALUE];
  73521. that._slidersController.setSelectedRange(value && (0, _utils.getVizRangeObject)(value))
  73522. },
  73523. _change_VALUE: function() {
  73524. var that = this;
  73525. var option = that._rangeOption;
  73526. if (option) {
  73527. that._options[VALUE] = option;
  73528. that.setValue(option)
  73529. }
  73530. },
  73531. _validateRange: function(start, end) {
  73532. var that = this;
  73533. var translator = that._axis.getTranslator();
  73534. if ((0, _type2.isDefined)(start) && !translator.isValid(start) || (0, _type2.isDefined)(end) && !translator.isValid(end)) {
  73535. that._incidentOccurred("E2203")
  73536. }
  73537. },
  73538. _applyChanges: function() {
  73539. var that = this;
  73540. var value = that._options[VALUE];
  73541. if (that._changes.has("VALUE") && value) {
  73542. that._rangeOption = value
  73543. }
  73544. that.callBase.apply(that, arguments);
  73545. that._rangeOption = null;
  73546. that.__isResizing = that.__skipAnimation = false
  73547. },
  73548. _applyMostlyTotalChange: function() {
  73549. var that = this;
  73550. var renderer = that._renderer;
  73551. var rect = that._clientRect;
  73552. var currentAnimationEnabled;
  73553. var canvas = {
  73554. left: rect[0],
  73555. top: rect[1],
  73556. width: rect[2] - rect[0],
  73557. height: rect[3] - rect[1]
  73558. };
  73559. if (that.__isResizing || that.__skipAnimation) {
  73560. currentAnimationEnabled = renderer.animationEnabled();
  73561. renderer.updateAnimationOptions({
  73562. enabled: false
  73563. })
  73564. }
  73565. that._clipRect.attr({
  73566. x: rect[0],
  73567. y: rect[1],
  73568. width: rect[2] - rect[0],
  73569. height: rect[3] - rect[1]
  73570. });
  73571. that._axis.getTranslator().update(new _range2.default.Range, canvas, {
  73572. isHorizontal: true
  73573. });
  73574. that._updateContent({
  73575. left: rect[0],
  73576. top: rect[1],
  73577. width: rect[2] - rect[0],
  73578. height: rect[3] - rect[1]
  73579. });
  73580. if (that.__isResizing || that.__skipAnimation) {
  73581. renderer.updateAnimationOptions({
  73582. enabled: currentAnimationEnabled
  73583. })
  73584. }
  73585. that._drawn()
  73586. },
  73587. _dataSourceChangedHandler: function() {
  73588. this._setValueByDataSource();
  73589. this._requestChange(["MOSTLY_TOTAL"])
  73590. },
  73591. _completeSeriesDataSourceCreation: function(scaleOptions, seriesDataSource) {
  73592. var rect = this._clientRect;
  73593. var canvas = {
  73594. left: rect[0],
  73595. top: rect[1],
  73596. width: rect[2] - rect[0],
  73597. height: rect[3] - rect[1]
  73598. };
  73599. this._axis.updateOptions((0, _extend.extend)({}, scaleOptions, {
  73600. isHorizontal: true,
  73601. label: {}
  73602. }));
  73603. seriesDataSource.isShowChart() && this._axis.setMarginOptions(seriesDataSource.getMarginOptions(canvas));
  73604. this._axis.updateCanvas(canvas);
  73605. seriesDataSource.createPoints()
  73606. },
  73607. _updateContent: function(canvas) {
  73608. var that = this;
  73609. var chartOptions = that.option("chart");
  73610. var seriesDataSource = that._createSeriesDataSource(chartOptions);
  73611. var isCompactMode = !(seriesDataSource && seriesDataSource.isShowChart() || that.option("background.image.url"));
  73612. var scaleOptions = prepareScaleOptions(that._getOption("scale"), seriesDataSource && seriesDataSource.getCalculatedValueType(), that._incidentOccurred, this._getOption("containerBackgroundColor", true));
  73613. seriesDataSource && that._completeSeriesDataSourceCreation(scaleOptions, seriesDataSource);
  73614. var argTranslatorRange = calculateTranslatorRange(seriesDataSource, scaleOptions);
  73615. var tickIntervalsInfo = updateTickIntervals(scaleOptions, canvas.width, that._incidentOccurred, argTranslatorRange);
  73616. var chartThemeManager = seriesDataSource && seriesDataSource.isShowChart() && seriesDataSource.getThemeManager();
  73617. if (chartThemeManager) {
  73618. checkLogarithmicOptions(chartOptions && chartOptions.valueAxis, chartThemeManager.getOptions("valueAxis").logarithmBase, that._incidentOccurred)
  73619. }
  73620. updateScaleOptions(scaleOptions, seriesDataSource, argTranslatorRange, tickIntervalsInfo, getDateMarkerVisibilityChecker(canvas.width));
  73621. updateTranslatorRangeInterval(argTranslatorRange, scaleOptions);
  73622. var sliderMarkerOptions = that._prepareSliderMarkersOptions(scaleOptions, canvas.width, tickIntervalsInfo, argTranslatorRange);
  73623. var indents = calculateIndents(that._renderer, scaleOptions, sliderMarkerOptions, that.option("indent"), tickIntervalsInfo);
  73624. var rangeContainerCanvas = {
  73625. left: canvas.left + indents.left,
  73626. top: canvas.top + indents.top,
  73627. width: canvas.left + indents.left + _max(canvas.width - indents.left - indents.right, 1),
  73628. height: _max(!isCompactMode ? canvas.height - indents.top - indents.bottom - calculateScaleAreaHeight(that._renderer, scaleOptions, showScaleMarkers(scaleOptions), tickIntervalsInfo) : _common2.default.HEIGHT_COMPACT_MODE, 0),
  73629. right: 0,
  73630. bottom: 0
  73631. };
  73632. that._axis.update(scaleOptions, isCompactMode, rangeContainerCanvas, argTranslatorRange, seriesDataSource);
  73633. scaleOptions.minorTickInterval = scaleOptions.isEmpty ? 0 : scaleOptions.minorTickInterval;
  73634. that._updateElements(scaleOptions, sliderMarkerOptions, isCompactMode, rangeContainerCanvas, seriesDataSource);
  73635. if (chartThemeManager) {
  73636. chartThemeManager.dispose()
  73637. }
  73638. },
  73639. _updateElements: function(scaleOptions, sliderMarkerOptions, isCompactMode, canvas, seriesDataSource) {
  73640. var that = this;
  73641. var behavior = that._getOption("behavior");
  73642. var shutterOptions = that._getOption("shutter");
  73643. var isNotSemiDiscrete = scaleOptions.type !== SEMIDISCRETE;
  73644. shutterOptions.color = shutterOptions.color || that._getOption(CONTAINER_BACKGROUND_COLOR, true);
  73645. that._rangeView.update(that.option("background"), that._themeManager.theme("background"), canvas, isCompactMode, behavior.animationEnabled && that._renderer.animationEnabled(), seriesDataSource);
  73646. that._isUpdating = true;
  73647. that._slidersController.update([canvas.top, canvas.top + canvas.height], behavior, isCompactMode, that._getOption("sliderHandle"), sliderMarkerOptions, shutterOptions, {
  73648. minRange: isNotSemiDiscrete ? that.option("scale.minRange") : void 0,
  73649. maxRange: isNotSemiDiscrete ? that.option("scale.maxRange") : void 0
  73650. }, that._axis.getFullTicks(), that._getOption("selectedRangeColor", true));
  73651. that._requestChange(["SLIDER_SELECTION"]);
  73652. that._isUpdating = false;
  73653. that._tracker.update(!that._axis.getTranslator().getBusinessRange().isEmpty(), behavior)
  73654. },
  73655. _createSeriesDataSource: function(chartOptions) {
  73656. var that = this;
  73657. var seriesDataSource;
  73658. var dataSource = that._dataSourceItems();
  73659. var scaleOptions = that._getOption("scale");
  73660. var valueType = scaleOptions.valueType || calculateValueType(scaleOptions.startValue, scaleOptions.endValue);
  73661. var valueAxis = new _base_axis2.default.Axis({
  73662. renderer: that._renderer,
  73663. axisType: "xyAxes",
  73664. drawingType: "linear"
  73665. });
  73666. valueAxis.updateOptions({
  73667. isHorizontal: false,
  73668. label: {},
  73669. categoriesSortingMethod: that._getOption("chart").valueAxis.categoriesSortingMethod
  73670. });
  73671. if (dataSource || chartOptions && chartOptions.series) {
  73672. chartOptions = (0, _extend.extend)({}, chartOptions, {
  73673. theme: that.option("theme")
  73674. });
  73675. seriesDataSource = new _series_data_source2.default.SeriesDataSource({
  73676. renderer: that._renderer,
  73677. dataSource: dataSource,
  73678. valueType: (0, _utils.normalizeEnum)(valueType),
  73679. axisType: scaleOptions.type,
  73680. chart: chartOptions,
  73681. dataSourceField: that.option("dataSourceField"),
  73682. incidentOccurred: that._incidentOccurred,
  73683. categories: scaleOptions.categories,
  73684. argumentAxis: that._axis,
  73685. valueAxis: valueAxis
  73686. })
  73687. }
  73688. return seriesDataSource
  73689. },
  73690. _prepareSliderMarkersOptions: function(scaleOptions, screenDelta, tickIntervalsInfo, argRange) {
  73691. var that = this;
  73692. var minorTickInterval = tickIntervalsInfo.minorTickInterval;
  73693. var tickInterval = tickIntervalsInfo.tickInterval;
  73694. var interval = tickInterval;
  73695. var endValue = scaleOptions.endValue;
  73696. var startValue = scaleOptions.startValue;
  73697. var sliderMarkerOptions = that._getOption(SLIDER_MARKER);
  73698. var doNotSnap = !that._getOption("behavior").snapToTicks;
  73699. var isTypeDiscrete = scaleOptions.type === DISCRETE;
  73700. var isValueTypeDatetime = scaleOptions.valueType === DATETIME;
  73701. sliderMarkerOptions.borderColor = that._getOption(CONTAINER_BACKGROUND_COLOR, true);
  73702. if (!sliderMarkerOptions.format && !argRange.isEmpty()) {
  73703. if (doNotSnap && (0, _type2.isNumeric)(scaleOptions.startValue)) {
  73704. sliderMarkerOptions.format = {
  73705. type: "fixedPoint",
  73706. precision: getPrecisionForSlider(startValue, endValue, screenDelta)
  73707. }
  73708. }
  73709. if (isValueTypeDatetime && !isTypeDiscrete) {
  73710. if ((0, _type2.isDefined)(minorTickInterval) && 0 !== minorTickInterval) {
  73711. interval = getMinorTickIntervalUnit(tickInterval, minorTickInterval, doNotSnap)
  73712. }
  73713. if (!scaleOptions.marker.visible) {
  73714. if ((0, _type2.isDefined)(startValue) && (0, _type2.isDefined)(endValue)) {
  73715. sliderMarkerOptions.format = _format_helper2.default.getDateFormatByTickInterval(startValue, endValue, interval)
  73716. }
  73717. } else {
  73718. sliderMarkerOptions.format = (0, _date.getDateFormatByTickInterval)(interval)
  73719. }
  73720. }
  73721. if (isValueTypeDatetime && isTypeDiscrete && tickIntervalsInfo.ticks.length) {
  73722. sliderMarkerOptions.format = _format_helper2.default.getDateFormatByTicks(tickIntervalsInfo.ticks)
  73723. }
  73724. }
  73725. return sliderMarkerOptions
  73726. },
  73727. getValue: function() {
  73728. return (0, _utils.convertVisualRangeObject)(this._slidersController.getSelectedRange())
  73729. },
  73730. setValue: function(value, e) {
  73731. var visualRange = (0, _utils.getVizRangeObject)(value);
  73732. if (!this._isUpdating && value) {
  73733. this._validateRange(visualRange.startValue, visualRange.endValue);
  73734. var current = this._slidersController.getSelectedRange();
  73735. if (!current || current.startValue !== visualRange.startValue || current.endValue !== visualRange.endValue) {
  73736. this._slidersController.setSelectedRange((0, _utils.getVizRangeObject)(value), e)
  73737. }
  73738. }
  73739. },
  73740. _setContentSize: function() {
  73741. this.__isResizing = 2 === this._changes.count();
  73742. this.callBase.apply(this, arguments)
  73743. }
  73744. });
  73745. (0, _iterator.each)(["selectedRangeColor", "containerBackgroundColor", "sliderMarker", "sliderHandle", "shutter", OPTION_BACKGROUND, "behavior", "chart", "indent"], function(_, name) {
  73746. dxRangeSelector.prototype._optionChangesMap[name] = "MOSTLY_TOTAL"
  73747. });
  73748. function prepareAxisOptions(scaleOptions, isCompactMode, height, axisPosition) {
  73749. scaleOptions.marker.label.font = scaleOptions.label.font;
  73750. scaleOptions.color = scaleOptions.marker.color = scaleOptions.tick.color;
  73751. scaleOptions.opacity = scaleOptions.marker.opacity = scaleOptions.tick.opacity;
  73752. scaleOptions.width = scaleOptions.marker.width = scaleOptions.tick.width;
  73753. scaleOptions.placeholderSize = (scaleOptions.placeholderHeight || 0) + axisPosition;
  73754. scaleOptions.argumentType = scaleOptions.valueType;
  73755. scaleOptions.visible = isCompactMode;
  73756. scaleOptions.isHorizontal = true;
  73757. scaleOptions.calculateMinors = true;
  73758. scaleOptions.semiDiscreteInterval = scaleOptions.minRange;
  73759. if (!isCompactMode) {
  73760. scaleOptions.minorTick.length = scaleOptions.tick.length = height
  73761. }
  73762. scaleOptions.label.indentFromAxis = scaleOptions.label.topIndent + axisPosition;
  73763. return scaleOptions
  73764. }
  73765. function createDateMarkersEvent(scaleOptions, markerTrackers, setSelectedRange) {
  73766. (0, _iterator.each)(markerTrackers, function(_, value) {
  73767. value.on("dxpointerdown", onPointerDown)
  73768. });
  73769. function onPointerDown(e) {
  73770. var range = e.target.range;
  73771. var minRange = scaleOptions.minRange ? (0, _date.addInterval)(range.startValue, scaleOptions.minRange) : void 0;
  73772. var maxRange = scaleOptions.maxRange ? (0, _date.addInterval)(range.startValue, scaleOptions.maxRange) : void 0;
  73773. if (!(minRange && minRange > range.endValue || maxRange && maxRange < range.endValue)) {
  73774. setSelectedRange(range, e)
  73775. }
  73776. }
  73777. }
  73778. function getShiftDirection() {
  73779. return 1
  73780. }
  73781. function getTickStartPositionShift(length) {
  73782. return length % 2 === 1 ? -_floor(length / 2) : -length / 2
  73783. }
  73784. function AxisWrapper(params) {
  73785. var that = this;
  73786. that._axis = new _base_axis2.default.Axis({
  73787. renderer: params.renderer,
  73788. axesContainerGroup: params.root,
  73789. scaleBreaksGroup: params.scaleBreaksGroup,
  73790. incidentOccurred: params.incidentOccurred,
  73791. axisType: "xyAxes",
  73792. drawingType: "linear",
  73793. widgetClass: "dxrs",
  73794. axisClass: "range-selector",
  73795. isArgumentAxis: true
  73796. });
  73797. that._updateSelectedRangeCallback = params.updateSelectedRange;
  73798. that._axis.getAxisSharpDirection = that._axis.getSharpDirectionByCoords = getShiftDirection;
  73799. that._axis.getTickStartPositionShift = getTickStartPositionShift
  73800. }
  73801. AxisWrapper.prototype = {
  73802. constructor: AxisWrapper,
  73803. dispose: function() {
  73804. this._axis.dispose()
  73805. },
  73806. calculateInterval: function(value, prevValue) {
  73807. return this._axis.calculateInterval(value, prevValue)
  73808. },
  73809. update: function(options, isCompactMode, canvas, businessRange, seriesDataSource) {
  73810. var axis = this._axis;
  73811. axis.updateOptions(prepareAxisOptions(options, isCompactMode, canvas.height, canvas.height / 2 - _ceil(options.width / 2)));
  73812. axis.validate();
  73813. axis.setBusinessRange(businessRange, true);
  73814. if (void 0 !== seriesDataSource && seriesDataSource.isShowChart()) {
  73815. axis.setMarginOptions(seriesDataSource.getMarginOptions(canvas))
  73816. }
  73817. axis.draw(canvas);
  73818. axis.shift({
  73819. left: 0,
  73820. bottom: -canvas.height / 2 + canvas.top
  73821. });
  73822. if (axis.getMarkerTrackers()) {
  73823. createDateMarkersEvent(options, axis.getMarkerTrackers(), this._updateSelectedRangeCallback)
  73824. }
  73825. axis.drawScaleBreaks({
  73826. start: canvas.top,
  73827. end: canvas.top + canvas.height
  73828. })
  73829. },
  73830. visualRange: function() {},
  73831. getViewport: function() {
  73832. return {}
  73833. },
  73834. allScaleSelected: function(value) {
  73835. var _this$_axis$visualRan = this._axis.visualRange(),
  73836. startValue = _this$_axis$visualRan.startValue,
  73837. endValue = _this$_axis$visualRan.endValue;
  73838. return {
  73839. startValue: value[0].valueOf() === startValue.valueOf(),
  73840. endValue: value[1].valueOf() === endValue.valueOf()
  73841. }
  73842. }
  73843. };
  73844. ["setMarginOptions", "getFullTicks", "updateCanvas", "updateOptions", "getAggregationInfo", "getTranslator", "getVisualRangeLength", "getVisibleArea", "getMarginOptions"].forEach(function(methodName) {
  73845. AxisWrapper.prototype[methodName] = function() {
  73846. var axis = this._axis;
  73847. return axis[methodName].apply(axis, arguments)
  73848. }
  73849. });
  73850. (0, _component_registrator2.default)("dxRangeSelector", dxRangeSelector);
  73851. module.exports = dxRangeSelector;
  73852. dxRangeSelector.addPlugin(_export.plugin);
  73853. dxRangeSelector.addPlugin(_title.plugin);
  73854. dxRangeSelector.addPlugin(_loading_indicator.plugin);
  73855. dxRangeSelector.addPlugin(_data_source.plugin)
  73856. },
  73857. /*!***********************************************************************!*\
  73858. !*** ./artifacts/transpiled/viz/range_selector/sliders_controller.js ***!
  73859. \***********************************************************************/
  73860. /*! dynamic exports provided */
  73861. /*! all exports used */
  73862. function(module, exports, __webpack_require__) {
  73863. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  73864. var commonModule = __webpack_require__( /*! ./common */ 206);
  73865. var animationSettings = commonModule.utils.animationSettings;
  73866. var emptySliderMarkerText = commonModule.consts.emptySliderMarkerText;
  73867. var Slider = __webpack_require__( /*! ./slider */ 806);
  73868. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  73869. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  73870. var isNumeric = typeUtils.isNumeric;
  73871. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  73872. var adjust = __webpack_require__( /*! ../../core/utils/math */ 28).adjust;
  73873. function buildRectPoints(left, top, right, bottom) {
  73874. return [left, top, right, top, right, bottom, left, bottom]
  73875. }
  73876. function valueOf(value) {
  73877. return value && value.valueOf()
  73878. }
  73879. function isLess(a, b) {
  73880. return a < b
  73881. }
  73882. function isGreater(a, b) {
  73883. return a > b
  73884. }
  73885. function selectClosestValue(target, values) {
  73886. var start = 0;
  73887. var end = values ? values.length - 1 : 0;
  73888. var val = target;
  73889. while (end - start > 1) {
  73890. var middle = start + end >> 1;
  73891. val = values[middle];
  73892. if (val === target) {
  73893. return target
  73894. } else {
  73895. if (target < val) {
  73896. end = middle
  73897. } else {
  73898. start = middle
  73899. }
  73900. }
  73901. }
  73902. if (values) {
  73903. val = values[target - values[start] <= values[end] - target ? start : end]
  73904. }
  73905. return val
  73906. }
  73907. function dummyProcessSelectionChanged() {
  73908. this._lastSelectedRange = this.getSelectedRange();
  73909. delete this._processSelectionChanged
  73910. }
  73911. function suppressSetSelectedRange(controller) {
  73912. controller.setSelectedRange = noop;
  73913. if (controller._processSelectionChanged === dummyProcessSelectionChanged) {
  73914. controller._processSelectionChanged()
  73915. }
  73916. }
  73917. function restoreSetSelectedRange(controller) {
  73918. delete controller.setSelectedRange
  73919. }
  73920. function SlidersController(params) {
  73921. var that = this;
  73922. var sliderParams = {
  73923. renderer: params.renderer,
  73924. root: params.root,
  73925. trackersGroup: params.trackersGroup,
  73926. translator: params.translator
  73927. };
  73928. that._params = params;
  73929. that._areaTracker = params.renderer.path(null, "area").attr({
  73930. "class": "area-tracker",
  73931. fill: "#000000",
  73932. opacity: 1e-4
  73933. }).append(params.trackersGroup);
  73934. that._selectedAreaTracker = params.renderer.path(null, "area").attr({
  73935. "class": "selected-area-tracker",
  73936. fill: "#000000",
  73937. opacity: 1e-4
  73938. }).append(params.trackersGroup);
  73939. that._shutter = params.renderer.path(null, "area").append(params.root);
  73940. that._sliders = [new Slider(sliderParams, 0), new Slider(sliderParams, 1)];
  73941. that._processSelectionChanged = dummyProcessSelectionChanged
  73942. }
  73943. SlidersController.prototype = {
  73944. constructor: SlidersController,
  73945. dispose: function() {
  73946. this._sliders[0].dispose();
  73947. this._sliders[1].dispose()
  73948. },
  73949. getTrackerTargets: function() {
  73950. return {
  73951. area: this._areaTracker,
  73952. selectedArea: this._selectedAreaTracker,
  73953. sliders: this._sliders
  73954. }
  73955. },
  73956. _processSelectionChanged: function(e) {
  73957. var that = this;
  73958. var selectedRange = that.getSelectedRange();
  73959. if (valueOf(selectedRange.startValue) !== valueOf(that._lastSelectedRange.startValue) || valueOf(selectedRange.endValue) !== valueOf(that._lastSelectedRange.endValue)) {
  73960. that._params.updateSelectedRange(selectedRange, that._lastSelectedRange, e);
  73961. that._lastSelectedRange = selectedRange
  73962. }
  73963. },
  73964. update: function(verticalRange, behavior, isCompactMode, sliderHandleOptions, sliderMarkerOptions, shutterOptions, rangeBounds, fullTicks, selectedRangeColor) {
  73965. var that = this;
  73966. var screenRange = that._params.translator.getScreenRange();
  73967. that._verticalRange = verticalRange;
  73968. that._minRange = rangeBounds.minRange;
  73969. that._maxRange = rangeBounds.maxRange;
  73970. that._animationEnabled = behavior.animationEnabled && that._params.renderer.animationEnabled();
  73971. that._allowSlidersSwap = behavior.allowSlidersSwap;
  73972. that._sliders[0].update(verticalRange, sliderHandleOptions, sliderMarkerOptions);
  73973. that._sliders[1].update(verticalRange, sliderHandleOptions, sliderMarkerOptions);
  73974. that._sliders[0]._position = that._sliders[1]._position = screenRange[0];
  73975. that._values = !that._params.translator.isValueProlonged && behavior.snapToTicks ? fullTicks : null;
  73976. that._areaTracker.attr({
  73977. points: buildRectPoints(screenRange[0], verticalRange[0], screenRange[1], verticalRange[1])
  73978. });
  73979. that._isCompactMode = isCompactMode;
  73980. that._shutterOffset = sliderHandleOptions.width / 2;
  73981. that._updateSelectedView(shutterOptions, selectedRangeColor);
  73982. that._isOnMoving = "onmoving" === _normalizeEnum(behavior.callValueChanged);
  73983. that._updateSelectedRange();
  73984. that._applyTotalPosition(false)
  73985. },
  73986. _updateSelectedView: function(shutterOptions, selectedRangeColor) {
  73987. var settings = {
  73988. fill: null,
  73989. "fill-opacity": null,
  73990. stroke: null,
  73991. "stroke-width": null
  73992. };
  73993. if (this._isCompactMode) {
  73994. settings.stroke = selectedRangeColor;
  73995. settings["stroke-width"] = 3;
  73996. settings.sharp = "v"
  73997. } else {
  73998. settings.fill = shutterOptions.color;
  73999. settings["fill-opacity"] = shutterOptions.opacity
  74000. }
  74001. this._shutter.attr(settings)
  74002. },
  74003. _updateSelectedRange: function() {
  74004. var that = this;
  74005. var sliders = that._sliders;
  74006. sliders[0].cancelAnimation();
  74007. sliders[1].cancelAnimation();
  74008. that._shutter.stopAnimation();
  74009. if (that._params.translator.getBusinessRange().isEmpty()) {
  74010. sliders[0]._setText(emptySliderMarkerText);
  74011. sliders[1]._setText(emptySliderMarkerText);
  74012. sliders[0]._value = sliders[1]._value = void 0;
  74013. sliders[0]._position = that._params.translator.getScreenRange()[0];
  74014. sliders[1]._position = that._params.translator.getScreenRange()[1];
  74015. that._applyTotalPosition(false);
  74016. suppressSetSelectedRange(that)
  74017. } else {
  74018. restoreSetSelectedRange(that)
  74019. }
  74020. },
  74021. _applyTotalPosition: function(isAnimated) {
  74022. var sliders = this._sliders;
  74023. isAnimated = this._animationEnabled && isAnimated;
  74024. sliders[0].applyPosition(isAnimated);
  74025. sliders[1].applyPosition(isAnimated);
  74026. var areOverlapped = sliders[0].getCloudBorder() > sliders[1].getCloudBorder();
  74027. sliders[0].setOverlapped(areOverlapped);
  74028. sliders[1].setOverlapped(areOverlapped);
  74029. this._applyAreaTrackersPosition();
  74030. this._applySelectedRangePosition(isAnimated)
  74031. },
  74032. _applyAreaTrackersPosition: function() {
  74033. var that = this;
  74034. var position1 = that._sliders[0].getPosition();
  74035. var position2 = that._sliders[1].getPosition();
  74036. that._selectedAreaTracker.attr({
  74037. points: buildRectPoints(position1, that._verticalRange[0], position2, that._verticalRange[1])
  74038. }).css({
  74039. cursor: Math.abs(that._params.translator.getScreenRange()[1] - that._params.translator.getScreenRange()[0] - position2 + position1) < .001 ? "default" : "pointer"
  74040. })
  74041. },
  74042. _applySelectedRangePosition: function(isAnimated) {
  74043. var that = this;
  74044. var verticalRange = that._verticalRange;
  74045. var pos1 = that._sliders[0].getPosition();
  74046. var pos2 = that._sliders[1].getPosition();
  74047. var points;
  74048. if (that._isCompactMode) {
  74049. points = [pos1 + Math.ceil(that._shutterOffset), (verticalRange[0] + verticalRange[1]) / 2, pos2 - Math.floor(that._shutterOffset), (verticalRange[0] + verticalRange[1]) / 2]
  74050. } else {
  74051. var screenRange = that._params.axis.getVisibleArea();
  74052. points = [buildRectPoints(screenRange[0], verticalRange[0], Math.max(pos1 - Math.floor(that._shutterOffset), screenRange[0]), verticalRange[1]), buildRectPoints(screenRange[1], verticalRange[0], Math.min(pos2 + Math.ceil(that._shutterOffset), screenRange[1]), verticalRange[1])]
  74053. }
  74054. if (isAnimated) {
  74055. that._shutter.animate({
  74056. points: points
  74057. }, animationSettings)
  74058. } else {
  74059. that._shutter.attr({
  74060. points: points
  74061. })
  74062. }
  74063. },
  74064. getSelectedRange: function() {
  74065. return {
  74066. startValue: this._sliders[0].getValue(),
  74067. endValue: this._sliders[1].getValue()
  74068. }
  74069. },
  74070. setSelectedRange: function(visualRange, e) {
  74071. visualRange = visualRange || {};
  74072. var that = this;
  74073. var translator = that._params.translator;
  74074. var businessRange = translator.getBusinessRange();
  74075. var compare = "discrete" === businessRange.axisType ? function(a, b) {
  74076. return a < b
  74077. } : function(a, b) {
  74078. return a <= b
  74079. };
  74080. var _vizUtils$adjustVisua = vizUtils.adjustVisualRange({
  74081. dataType: businessRange.dataType,
  74082. axisType: businessRange.axisType,
  74083. base: businessRange.base
  74084. }, {
  74085. startValue: translator.isValid(visualRange.startValue) ? translator.getCorrectValue(visualRange.startValue, 1) : void 0,
  74086. endValue: translator.isValid(visualRange.endValue) ? translator.getCorrectValue(visualRange.endValue, -1) : void 0,
  74087. length: visualRange.length
  74088. }, {
  74089. min: businessRange.minVisible,
  74090. max: businessRange.maxVisible,
  74091. categories: businessRange.categories
  74092. }),
  74093. startValue = _vizUtils$adjustVisua.startValue,
  74094. endValue = _vizUtils$adjustVisua.endValue;
  74095. startValue = isNumeric(startValue) ? adjust(startValue) : startValue;
  74096. endValue = isNumeric(endValue) ? adjust(endValue) : endValue;
  74097. var values = compare(translator.to(startValue, -1), translator.to(endValue, 1)) ? [startValue, endValue] : [endValue, startValue];
  74098. that._sliders[0].setDisplayValue(values[0]);
  74099. that._sliders[1].setDisplayValue(values[1]);
  74100. that._sliders[0]._position = translator.to(values[0], -1);
  74101. that._sliders[1]._position = translator.to(values[1], 1);
  74102. that._applyTotalPosition(true);
  74103. that._processSelectionChanged(e)
  74104. },
  74105. beginSelectedAreaMoving: function(initialPosition) {
  74106. var that = this;
  74107. var sliders = that._sliders;
  74108. var offset = (sliders[0].getPosition() + sliders[1].getPosition()) / 2 - initialPosition;
  74109. var currentPosition = initialPosition;
  74110. move.complete = function(e) {
  74111. that._dockSelectedArea(e)
  74112. };
  74113. return move;
  74114. function move(position, e) {
  74115. if (position !== currentPosition && position > currentPosition === position > (sliders[0].getPosition() + sliders[1].getPosition()) / 2 - offset) {
  74116. that._moveSelectedArea(position + offset, false, e)
  74117. }
  74118. currentPosition = position
  74119. }
  74120. },
  74121. _dockSelectedArea: function(e) {
  74122. var translator = this._params.translator;
  74123. var sliders = this._sliders;
  74124. sliders[0]._position = translator.to(sliders[0].getValue(), -1);
  74125. sliders[1]._position = translator.to(sliders[1].getValue(), 1);
  74126. this._applyTotalPosition(true);
  74127. this._processSelectionChanged(e)
  74128. },
  74129. moveSelectedArea: function(screenPosition, e) {
  74130. this._moveSelectedArea(screenPosition, true, e);
  74131. this._dockSelectedArea(e)
  74132. },
  74133. _moveSelectedArea: function(screenPosition, isAnimated, e) {
  74134. var that = this;
  74135. var translator = that._params.translator;
  74136. var sliders = that._sliders;
  74137. var interval = sliders[1].getPosition() - sliders[0].getPosition();
  74138. var startPosition = screenPosition - interval / 2;
  74139. var endPosition = screenPosition + interval / 2;
  74140. if (startPosition < translator.getScreenRange()[0]) {
  74141. startPosition = translator.getScreenRange()[0];
  74142. endPosition = startPosition + interval
  74143. }
  74144. if (endPosition > translator.getScreenRange()[1]) {
  74145. endPosition = translator.getScreenRange()[1];
  74146. startPosition = endPosition - interval
  74147. }
  74148. var startValue = selectClosestValue(translator.from(startPosition, -1), that._values);
  74149. sliders[0].setDisplayValue(startValue);
  74150. sliders[1].setDisplayValue(selectClosestValue(translator.from(translator.to(startValue, -1) + interval, 1), that._values));
  74151. sliders[0]._position = startPosition;
  74152. sliders[1]._position = endPosition;
  74153. that._applyTotalPosition(isAnimated);
  74154. if (that._isOnMoving) {
  74155. that._processSelectionChanged(e)
  74156. }
  74157. },
  74158. placeSliderAndBeginMoving: function(firstPosition, secondPosition, e) {
  74159. var that = this;
  74160. var translator = that._params.translator;
  74161. var sliders = that._sliders;
  74162. var index = firstPosition < secondPosition ? 0 : 1;
  74163. var dir = index > 0 ? 1 : -1;
  74164. var compare = index > 0 ? isGreater : isLess;
  74165. var antiCompare = index > 0 ? isLess : isGreater;
  74166. var thresholdPosition;
  74167. var positions = [];
  74168. var values = [];
  74169. values[index] = translator.from(firstPosition, dir);
  74170. values[1 - index] = translator.from(secondPosition, -dir);
  74171. positions[1 - index] = secondPosition;
  74172. if (translator.isValueProlonged) {
  74173. if (compare(firstPosition, translator.to(values[index], dir))) {
  74174. values[index] = translator.from(firstPosition, -dir)
  74175. }
  74176. if (compare(secondPosition, translator.to(values[index], -dir))) {
  74177. values[1 - index] = values[index]
  74178. }
  74179. }
  74180. if (that._minRange) {
  74181. thresholdPosition = translator.to(translator.add(selectClosestValue(values[index], that._values), that._minRange, -dir), -dir);
  74182. if (compare(secondPosition, thresholdPosition)) {
  74183. values[1 - index] = translator.add(values[index], that._minRange, -dir)
  74184. }
  74185. thresholdPosition = translator.to(translator.add(translator.getRange()[1 - index], that._minRange, dir), -dir);
  74186. if (antiCompare(firstPosition, thresholdPosition)) {
  74187. values[1 - index] = translator.getRange()[1 - index];
  74188. values[index] = translator.add(values[1 - index], that._minRange, dir);
  74189. positions[1 - index] = firstPosition
  74190. }
  74191. }
  74192. values[0] = selectClosestValue(values[0], that._values);
  74193. values[1] = selectClosestValue(values[1], that._values);
  74194. positions[index] = translator.to(values[index], dir);
  74195. sliders[0].setDisplayValue(values[0]);
  74196. sliders[1].setDisplayValue(values[1]);
  74197. sliders[0]._position = positions[0];
  74198. sliders[1]._position = positions[1];
  74199. that._applyTotalPosition(true);
  74200. if (that._isOnMoving) {
  74201. that._processSelectionChanged(e)
  74202. }
  74203. var handler = that.beginSliderMoving(1 - index, secondPosition);
  74204. sliders[1 - index]._sliderGroup.stopAnimation();
  74205. that._shutter.stopAnimation();
  74206. handler(secondPosition);
  74207. return handler
  74208. },
  74209. beginSliderMoving: function(initialIndex, initialPosition) {
  74210. var that = this;
  74211. var translator = that._params.translator;
  74212. var sliders = that._sliders;
  74213. var minPosition = translator.getScreenRange()[0];
  74214. var maxPosition = translator.getScreenRange()[1];
  74215. var index = initialIndex;
  74216. var staticPosition = sliders[1 - index].getPosition();
  74217. var currentPosition = initialPosition;
  74218. var dir = index > 0 ? 1 : -1;
  74219. var compareMin = index > 0 ? isLess : isGreater;
  74220. var compareMax = index > 0 ? isGreater : isLess;
  74221. var moveOffset = sliders[index].getPosition() - initialPosition;
  74222. var swapOffset = compareMin(sliders[index].getPosition(), initialPosition) ? -moveOffset : moveOffset;
  74223. move.complete = function(e) {
  74224. sliders[index]._setValid(true);
  74225. that._dockSelectedArea(e)
  74226. };
  74227. return move;
  74228. function move(position, e) {
  74229. var isValid;
  74230. if (position !== currentPosition) {
  74231. if (compareMin(position + swapOffset, staticPosition)) {
  74232. isValid = that._allowSlidersSwap;
  74233. if (isValid && !translator.isValueProlonged && that._minRange) {
  74234. isValid = translator.isValid(translator.add(sliders[1 - index].getValue(), that._minRange, -dir))
  74235. }
  74236. if (isValid) {
  74237. that._changeMovingSlider(index);
  74238. index = 1 - index;
  74239. dir = -dir;
  74240. var temp = compareMin;
  74241. compareMin = compareMax;
  74242. compareMax = temp;
  74243. moveOffset = -dir * Math.abs(moveOffset);
  74244. swapOffset = -moveOffset
  74245. }
  74246. }
  74247. if (compareMax(position + moveOffset, staticPosition)) {
  74248. isValid = true;
  74249. var slider = sliders[index];
  74250. var value = sliders[1 - index].getValue();
  74251. var pos = Math.max(Math.min(position + moveOffset, maxPosition), minPosition);
  74252. if (isValid && translator.isValueProlonged) {
  74253. isValid = !compareMin(pos, translator.to(value, dir))
  74254. }
  74255. if (isValid && that._minRange) {
  74256. isValid = !compareMin(pos, translator.to(translator.add(value, that._minRange, dir), dir))
  74257. }
  74258. if (isValid && that._maxRange) {
  74259. isValid = !compareMax(pos, translator.to(translator.add(value, that._maxRange, dir), dir))
  74260. }
  74261. slider._setValid(isValid);
  74262. slider.setDisplayValue(isValid ? selectClosestValue(translator.from(pos, dir), that._values) : slider.getValue());
  74263. slider._position = pos;
  74264. that._applyTotalPosition(false);
  74265. slider.toForeground();
  74266. if (that._isOnMoving) {
  74267. that._processSelectionChanged(e)
  74268. }
  74269. }
  74270. }
  74271. currentPosition = position
  74272. }
  74273. },
  74274. _changeMovingSlider: function(index) {
  74275. var that = this;
  74276. var translator = that._params.translator;
  74277. var sliders = that._sliders;
  74278. var position = sliders[1 - index].getPosition();
  74279. var dir = index > 0 ? 1 : -1;
  74280. var newValue;
  74281. sliders[index].setDisplayValue(selectClosestValue(translator.from(position, dir), that._values));
  74282. newValue = translator.from(position, -dir);
  74283. if (translator.isValueProlonged) {
  74284. newValue = translator.from(position, dir)
  74285. } else {
  74286. if (that._minRange) {
  74287. newValue = translator.add(newValue, that._minRange, -dir)
  74288. }
  74289. }
  74290. sliders[1 - index].setDisplayValue(selectClosestValue(newValue, that._values));
  74291. sliders[index]._setValid(true);
  74292. sliders[index]._marker._update();
  74293. sliders[0]._position = sliders[1]._position = position
  74294. },
  74295. foregroundSlider: function(index) {
  74296. this._sliders[index].toForeground()
  74297. }
  74298. };
  74299. exports.SlidersController = SlidersController
  74300. },
  74301. /*!***********************************************************!*\
  74302. !*** ./artifacts/transpiled/viz/range_selector/slider.js ***!
  74303. \***********************************************************/
  74304. /*! dynamic exports provided */
  74305. /*! all exports used */
  74306. function(module, exports, __webpack_require__) {
  74307. var commonModule = __webpack_require__( /*! ./common */ 206);
  74308. var animationSettings = commonModule.utils.animationSettings;
  74309. var formatValue = commonModule.formatValue;
  74310. var SliderMarker = __webpack_require__( /*! ./slider_marker */ 807);
  74311. var support = __webpack_require__( /*! ../../core/utils/support */ 43);
  74312. var SPLITTER_WIDTH = 8;
  74313. var TOUCH_SPLITTER_WIDTH = 20;
  74314. function getSliderTrackerWidth(sliderHandleWidth) {
  74315. return support.touchEvents || support.pointer ? TOUCH_SPLITTER_WIDTH : SPLITTER_WIDTH < sliderHandleWidth ? sliderHandleWidth : SPLITTER_WIDTH
  74316. }
  74317. function Slider(params, index) {
  74318. var that = this;
  74319. that._translator = params.translator;
  74320. that._sliderGroup = params.renderer.g().attr({
  74321. "class": "slider"
  74322. }).append(params.root);
  74323. that._line = params.renderer.path(null, "line").append(that._sliderGroup);
  74324. that._marker = new SliderMarker(params.renderer, that._sliderGroup, 1 === index);
  74325. that._tracker = params.renderer.rect().attr({
  74326. "class": "slider-tracker",
  74327. fill: "#000000",
  74328. opacity: 1e-4
  74329. }).css({
  74330. cursor: "w-resize"
  74331. }).append(params.trackersGroup)
  74332. }
  74333. Slider.prototype = {
  74334. constructor: Slider,
  74335. cancelAnimation: function() {
  74336. this._sliderGroup.stopAnimation();
  74337. this._tracker.stopAnimation()
  74338. },
  74339. applyPosition: function(isAnimated) {
  74340. var that = this;
  74341. var slider = that._sliderGroup;
  74342. var tracker = that._tracker;
  74343. var attrs = {
  74344. translateX: that._position
  74345. };
  74346. that._marker.setPosition(that._position);
  74347. if (isAnimated) {
  74348. slider.animate(attrs, animationSettings);
  74349. tracker.animate(attrs, animationSettings)
  74350. } else {
  74351. slider.attr(attrs);
  74352. tracker.attr(attrs)
  74353. }
  74354. },
  74355. _setValid: function(isValid) {
  74356. this._marker.setValid(isValid);
  74357. this._line.attr({
  74358. stroke: this._colors[Number(isValid)]
  74359. })
  74360. },
  74361. _setText: function(text) {
  74362. this._marker.setText(text)
  74363. },
  74364. update: function(verticalRange, sliderHandleOptions, sliderMarkerOptions) {
  74365. var that = this;
  74366. that._formatOptions = {
  74367. format: sliderMarkerOptions.format,
  74368. customizeText: sliderMarkerOptions.customizeText
  74369. };
  74370. that._marker.applyOptions(sliderMarkerOptions, that._translator.getScreenRange());
  74371. that._colors = [sliderMarkerOptions.invalidRangeColor, sliderHandleOptions.color];
  74372. that._sliderGroup.attr({
  74373. translateY: verticalRange[0]
  74374. });
  74375. that._line.attr({
  74376. "stroke-width": sliderHandleOptions.width,
  74377. stroke: sliderHandleOptions.color,
  74378. "stroke-opacity": sliderHandleOptions.opacity,
  74379. sharp: "h",
  74380. points: [0, 0, 0, verticalRange[1] - verticalRange[0]]
  74381. });
  74382. var trackerWidth = getSliderTrackerWidth(sliderHandleOptions.width);
  74383. that._tracker.attr({
  74384. x: -trackerWidth / 2,
  74385. y: 0,
  74386. width: trackerWidth,
  74387. height: verticalRange[1] - verticalRange[0],
  74388. translateY: verticalRange[0]
  74389. })
  74390. },
  74391. toForeground: function() {
  74392. this._sliderGroup.toForeground()
  74393. },
  74394. getSliderTracker: function() {
  74395. return this._tracker
  74396. },
  74397. getPosition: function() {
  74398. return this._position
  74399. },
  74400. setDisplayValue: function(value) {
  74401. this._value = value;
  74402. this._setText(formatValue(value, this._formatOptions))
  74403. },
  74404. setOverlapped: function(isOverlapped) {
  74405. this._marker.setOverlapped(isOverlapped)
  74406. },
  74407. getValue: function() {
  74408. return this._value
  74409. },
  74410. on: function(event, handler) {
  74411. this._tracker.on(event, handler);
  74412. this._marker.getTracker().on(event, handler)
  74413. },
  74414. getCloudBorder: function() {
  74415. return this._marker.getBorderPosition()
  74416. },
  74417. dispose: function() {
  74418. this._marker.dispose()
  74419. }
  74420. };
  74421. module.exports = Slider
  74422. },
  74423. /*!******************************************************************!*\
  74424. !*** ./artifacts/transpiled/viz/range_selector/slider_marker.js ***!
  74425. \******************************************************************/
  74426. /*! dynamic exports provided */
  74427. /*! all exports used */
  74428. function(module, exports, __webpack_require__) {
  74429. var patchFontOptions = __webpack_require__( /*! ../core/utils */ 10).patchFontOptions;
  74430. var SLIDER_MARKER_UPDATE_DELAY = 75;
  74431. var POINTER_SIZE = __webpack_require__( /*! ./common */ 206).consts.pointerSize;
  74432. function SliderMarker(renderer, root, isLeftPointer) {
  74433. var that = this;
  74434. that._isLeftPointer = isLeftPointer;
  74435. that._isOverlapped = false;
  74436. that._group = renderer.g().attr({
  74437. "class": "slider-marker"
  74438. }).append(root);
  74439. that._area = renderer.path(null, "area").append(that._group);
  74440. that._label = renderer.text().attr({
  74441. align: "left"
  74442. }).append(that._group);
  74443. that._tracker = renderer.rect().attr({
  74444. "class": "slider-marker-tracker",
  74445. fill: "#000000",
  74446. opacity: 1e-4
  74447. }).css({
  74448. cursor: "pointer"
  74449. }).append(that._group);
  74450. that._border = renderer.rect(0, 0, 1, 0)
  74451. }
  74452. SliderMarker.prototype = {
  74453. constructor: SliderMarker,
  74454. _getRectSize: function(textSize) {
  74455. return {
  74456. width: Math.round(2 * this._paddingLeftRight + textSize.width),
  74457. height: Math.round(2 * this._paddingTopBottom + textSize.height)
  74458. }
  74459. },
  74460. _getTextSize: function() {
  74461. var textSize = this._label.getBBox();
  74462. if (!this._textHeight && isFinite(textSize.height)) {
  74463. this._textHeight = textSize.height
  74464. }
  74465. return {
  74466. width: textSize.width,
  74467. height: this._textHeight,
  74468. y: textSize.y
  74469. }
  74470. },
  74471. _getAreaPointsInfo: function(textSize) {
  74472. var that = this;
  74473. var rectSize = that._getRectSize(textSize);
  74474. var rectWidth = rectSize.width;
  74475. var rectHeight = rectSize.height;
  74476. var rectLeftBorder = -rectWidth;
  74477. var rectRightBorder = 0;
  74478. var pointerRightPoint = POINTER_SIZE;
  74479. var pointerCenterPoint = 0;
  74480. var pointerLeftPoint = -POINTER_SIZE;
  74481. var position = that._position;
  74482. var isLeft = that._isLeftPointer;
  74483. var correctCloudBorders = function() {
  74484. rectLeftBorder++;
  74485. rectRightBorder++;
  74486. pointerRightPoint++;
  74487. pointerCenterPoint++;
  74488. pointerLeftPoint++
  74489. };
  74490. var checkPointerBorders = function() {
  74491. if (pointerRightPoint > rectRightBorder) {
  74492. pointerRightPoint = rectRightBorder
  74493. } else {
  74494. if (pointerLeftPoint < rectLeftBorder) {
  74495. pointerLeftPoint = rectLeftBorder
  74496. }
  74497. }
  74498. isLeft && correctCloudBorders()
  74499. };
  74500. var borderPosition = position;
  74501. if (isLeft) {
  74502. if (position > that._range[1] - rectWidth) {
  74503. rectRightBorder = -position + that._range[1];
  74504. rectLeftBorder = rectRightBorder - rectWidth;
  74505. checkPointerBorders();
  74506. borderPosition += rectLeftBorder
  74507. } else {
  74508. rectLeftBorder = pointerLeftPoint = 0;
  74509. rectRightBorder = rectWidth
  74510. }
  74511. } else {
  74512. if (position - that._range[0] < rectWidth) {
  74513. rectLeftBorder = -(position - that._range[0]);
  74514. rectRightBorder = rectLeftBorder + rectWidth;
  74515. checkPointerBorders();
  74516. borderPosition += rectRightBorder
  74517. } else {
  74518. pointerRightPoint = 0;
  74519. correctCloudBorders()
  74520. }
  74521. }
  74522. that._borderPosition = borderPosition;
  74523. return {
  74524. offset: rectLeftBorder,
  74525. isCut: (!isLeft || pointerCenterPoint !== pointerLeftPoint) && (isLeft || pointerCenterPoint !== pointerRightPoint),
  74526. points: [rectLeftBorder, 0, rectRightBorder, 0, rectRightBorder, rectHeight, pointerRightPoint, rectHeight, pointerCenterPoint, rectHeight + POINTER_SIZE, pointerLeftPoint, rectHeight, rectLeftBorder, rectHeight]
  74527. }
  74528. },
  74529. _update: function() {
  74530. var that = this;
  74531. var textSize;
  74532. clearTimeout(that._timeout);
  74533. that._label.attr({
  74534. text: that._text || ""
  74535. });
  74536. var currentTextSize = that._getTextSize();
  74537. var rectSize = that._getRectSize(currentTextSize);
  74538. textSize = that._textSize || currentTextSize;
  74539. textSize = that._textSize = currentTextSize.width > textSize.width || currentTextSize.height > textSize.height ? currentTextSize : textSize;
  74540. that._timeout = setTimeout(function() {
  74541. updateSliderMarker(currentTextSize, rectSize);
  74542. that._textSize = currentTextSize
  74543. }, SLIDER_MARKER_UPDATE_DELAY);
  74544. function updateSliderMarker(size, rectSize) {
  74545. rectSize = rectSize || that._getRectSize(size);
  74546. that._group.attr({
  74547. translateY: -(rectSize.height + POINTER_SIZE)
  74548. });
  74549. var pointsData = that._getAreaPointsInfo(size);
  74550. var points = pointsData.points;
  74551. var offset = pointsData.offset;
  74552. that._area.attr({
  74553. points: points
  74554. });
  74555. that._border.attr({
  74556. x: that._isLeftPointer ? points[0] - 1 : points[2],
  74557. height: pointsData.isCut ? rectSize.height : rectSize.height + POINTER_SIZE
  74558. });
  74559. that._tracker.attr({
  74560. translateX: offset,
  74561. width: rectSize.width,
  74562. height: rectSize.height + POINTER_SIZE
  74563. });
  74564. that._label.attr({
  74565. translateX: that._paddingLeftRight + offset,
  74566. translateY: rectSize.height / 2 - (size.y + size.height / 2)
  74567. })
  74568. }
  74569. updateSliderMarker(textSize)
  74570. },
  74571. setText: function(value) {
  74572. this._text = value
  74573. },
  74574. setPosition: function(position) {
  74575. this._position = position;
  74576. this._update()
  74577. },
  74578. applyOptions: function(options, screenRange) {
  74579. var that = this;
  74580. that._range = screenRange;
  74581. that._paddingLeftRight = options.paddingLeftRight;
  74582. that._paddingTopBottom = options.paddingTopBottom;
  74583. that._textHeight = null;
  74584. that._colors = [options.invalidRangeColor, options.color];
  74585. that._area.attr({
  74586. fill: options.color
  74587. });
  74588. that._border.attr({
  74589. fill: options.borderColor
  74590. });
  74591. that._label.css(patchFontOptions(options.font));
  74592. that._update()
  74593. },
  74594. getTracker: function() {
  74595. return this._tracker
  74596. },
  74597. setValid: function(isValid) {
  74598. this._area.attr({
  74599. fill: this._colors[Number(isValid)]
  74600. })
  74601. },
  74602. setColor: function(color) {
  74603. this._area.attr({
  74604. fill: color
  74605. })
  74606. },
  74607. dispose: function() {
  74608. clearTimeout(this._timeout)
  74609. },
  74610. setOverlapped: function(isOverlapped) {
  74611. var that = this;
  74612. if (that._isOverlapped !== isOverlapped) {
  74613. if (isOverlapped) {
  74614. that._border.append(that._group)
  74615. } else {
  74616. that._isOverlapped && that._border.remove()
  74617. }
  74618. that._isOverlapped = isOverlapped
  74619. }
  74620. },
  74621. getBorderPosition: function() {
  74622. return this._borderPosition
  74623. }
  74624. };
  74625. module.exports = SliderMarker
  74626. },
  74627. /*!************************************************************!*\
  74628. !*** ./artifacts/transpiled/viz/range_selector/tracker.js ***!
  74629. \************************************************************/
  74630. /*! dynamic exports provided */
  74631. /*! all exports used */
  74632. function(module, exports, __webpack_require__) {
  74633. Object.defineProperty(exports, "__esModule", {
  74634. value: true
  74635. });
  74636. exports.Tracker = Tracker;
  74637. var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  74638. var _events_engine2 = _interopRequireDefault(_events_engine);
  74639. var _pointer = __webpack_require__( /*! ../../events/pointer */ 23);
  74640. var _pointer2 = _interopRequireDefault(_pointer);
  74641. var _window = __webpack_require__( /*! ../../core/utils/window */ 7);
  74642. var _window2 = _interopRequireDefault(_window);
  74643. var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  74644. var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
  74645. var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
  74646. var _support = __webpack_require__( /*! ../../core/utils/support */ 43);
  74647. function _interopRequireDefault(obj) {
  74648. return obj && obj.__esModule ? obj : {
  74649. "default": obj
  74650. }
  74651. }
  74652. function _defineProperty(obj, key, value) {
  74653. if (key in obj) {
  74654. Object.defineProperty(obj, key, {
  74655. value: value,
  74656. enumerable: true,
  74657. configurable: true,
  74658. writable: true
  74659. })
  74660. } else {
  74661. obj[key] = value
  74662. }
  74663. return obj
  74664. }
  74665. var MIN_MANUAL_SELECTING_WIDTH = 10;
  74666. var window = _window2.default.getWindow();
  74667. function isLeftButtonPressed(event) {
  74668. var e = event || window.event;
  74669. var originalEvent = e.originalEvent;
  74670. var touches = e.touches;
  74671. var pointerType = originalEvent ? originalEvent.pointerType : false;
  74672. var eventTouches = originalEvent ? originalEvent.touches : false;
  74673. var isMSPointerLeftClick = originalEvent && void 0 !== pointerType && (pointerType === (originalEvent.MSPOINTER_TYPE_TOUCH || "touch") || pointerType === (originalEvent.MSPOINTER_TYPE_MOUSE || "mouse") && 1 === originalEvent.buttons);
  74674. var isTouches = touches && touches.length > 0 || eventTouches && eventTouches.length > 0;
  74675. return 1 === e.which || isMSPointerLeftClick || isTouches
  74676. }
  74677. function isMultiTouches(event) {
  74678. var originalEvent = event.originalEvent;
  74679. var touches = event.touches;
  74680. var eventTouches = originalEvent && originalEvent.touches;
  74681. return touches && touches.length > 1 || eventTouches && eventTouches.length > 1 || null
  74682. }
  74683. function preventDefault(e) {
  74684. if (!isMultiTouches(e)) {
  74685. e.preventDefault()
  74686. }
  74687. }
  74688. function stopPropagationAndPreventDefault(e) {
  74689. if (!isMultiTouches(e)) {
  74690. e.stopPropagation();
  74691. e.preventDefault()
  74692. }
  74693. }
  74694. function isTouchEventArgs(e) {
  74695. return e && e.type && 0 === e.type.indexOf("touch")
  74696. }
  74697. function getEventPageX(event) {
  74698. var originalEvent = event.originalEvent;
  74699. var result = 0;
  74700. if (event.pageX) {
  74701. result = event.pageX
  74702. } else {
  74703. if (originalEvent && originalEvent.pageX) {
  74704. result = originalEvent.pageX
  74705. }
  74706. }
  74707. if (originalEvent && originalEvent.touches) {
  74708. if (originalEvent.touches.length > 0) {
  74709. result = originalEvent.touches[0].pageX
  74710. } else {
  74711. if (originalEvent.changedTouches.length > 0) {
  74712. result = originalEvent.changedTouches[0].pageX
  74713. }
  74714. }
  74715. }
  74716. return result
  74717. }
  74718. function initializeAreaEvents(controller, area, state, getRootOffsetLeft) {
  74719. var _docEvents;
  74720. var isTouchEvent;
  74721. var isActive = false;
  74722. var initialPosition;
  74723. var movingHandler = null;
  74724. var docEvents = (_docEvents = {}, _defineProperty(_docEvents, _pointer2.default.move, function(e) {
  74725. var position;
  74726. var offset;
  74727. if (isTouchEvent !== isTouchEventArgs(e)) {
  74728. return
  74729. }
  74730. if (!isLeftButtonPressed(e)) {
  74731. cancel(e)
  74732. }
  74733. if (isActive) {
  74734. position = getEventPageX(e);
  74735. offset = getRootOffsetLeft();
  74736. if (movingHandler) {
  74737. movingHandler(position - offset, e)
  74738. } else {
  74739. if (state.manualRangeSelectionEnabled && Math.abs(initialPosition - position) >= MIN_MANUAL_SELECTING_WIDTH) {
  74740. movingHandler = controller.placeSliderAndBeginMoving(initialPosition - offset, position - offset, e)
  74741. }
  74742. }
  74743. }
  74744. }), _defineProperty(_docEvents, _pointer2.default.up, function(e) {
  74745. var position;
  74746. if (isActive) {
  74747. position = getEventPageX(e);
  74748. if (!movingHandler && state.moveSelectedRangeByClick && Math.abs(initialPosition - position) < MIN_MANUAL_SELECTING_WIDTH) {
  74749. controller.moveSelectedArea(position - getRootOffsetLeft(), e)
  74750. }
  74751. cancel(e)
  74752. }
  74753. }), _docEvents);
  74754. function cancel(e) {
  74755. if (isActive) {
  74756. isActive = false;
  74757. if (movingHandler) {
  74758. movingHandler.complete(e);
  74759. movingHandler = null
  74760. }
  74761. }
  74762. }
  74763. area.on(_pointer2.default.down, function(e) {
  74764. if (!state.enabled || !isLeftButtonPressed(e) || isActive) {
  74765. return
  74766. }
  74767. isActive = true;
  74768. isTouchEvent = isTouchEventArgs(e);
  74769. initialPosition = getEventPageX(e)
  74770. });
  74771. return docEvents
  74772. }
  74773. function initializeSelectedAreaEvents(controller, area, state, getRootOffsetLeft) {
  74774. var _docEvents2;
  74775. var isTouchEvent;
  74776. var isActive = false;
  74777. var movingHandler = null;
  74778. var docEvents = (_docEvents2 = {}, _defineProperty(_docEvents2, _pointer2.default.move, function(e) {
  74779. if (isTouchEvent !== isTouchEventArgs(e)) {
  74780. return
  74781. }
  74782. if (!isLeftButtonPressed(e)) {
  74783. cancel(e)
  74784. }
  74785. if (isActive) {
  74786. preventDefault(e);
  74787. movingHandler(getEventPageX(e) - getRootOffsetLeft(), e)
  74788. }
  74789. }), _defineProperty(_docEvents2, _pointer2.default.up, cancel), _docEvents2);
  74790. function cancel(e) {
  74791. if (isActive) {
  74792. isActive = false;
  74793. movingHandler.complete(e);
  74794. movingHandler = null
  74795. }
  74796. }
  74797. area.on(_pointer2.default.down, function(e) {
  74798. if (!state.enabled || !isLeftButtonPressed(e) || isActive) {
  74799. return
  74800. }
  74801. isActive = true;
  74802. isTouchEvent = isTouchEventArgs(e);
  74803. movingHandler = controller.beginSelectedAreaMoving(getEventPageX(e) - getRootOffsetLeft());
  74804. stopPropagationAndPreventDefault(e)
  74805. });
  74806. return docEvents
  74807. }
  74808. function initializeSliderEvents(controller, sliders, state, getRootOffsetLeft) {
  74809. var _docEvents3;
  74810. var isTouchEvent;
  74811. var isActive = false;
  74812. var movingHandler = null;
  74813. var docEvents = (_docEvents3 = {}, _defineProperty(_docEvents3, _pointer2.default.move, function(e) {
  74814. if (isTouchEvent !== isTouchEventArgs(e)) {
  74815. return
  74816. }
  74817. if (!isLeftButtonPressed(e)) {
  74818. cancel(e)
  74819. }
  74820. if (isActive) {
  74821. preventDefault(e);
  74822. movingHandler(getEventPageX(e) - getRootOffsetLeft(), e)
  74823. }
  74824. }), _defineProperty(_docEvents3, _pointer2.default.up, cancel), _docEvents3);
  74825. (0, _iterator.each)(sliders, function(i, slider) {
  74826. var _slider$on;
  74827. slider.on((_slider$on = {}, _defineProperty(_slider$on, _pointer2.default.down, function(e) {
  74828. if (!state.enabled || !isLeftButtonPressed(e) || isActive) {
  74829. return
  74830. }
  74831. isActive = true;
  74832. isTouchEvent = isTouchEventArgs(e);
  74833. movingHandler = controller.beginSliderMoving(i, getEventPageX(e) - getRootOffsetLeft());
  74834. stopPropagationAndPreventDefault(e)
  74835. }), _defineProperty(_slider$on, _pointer2.default.move, function() {
  74836. if (!movingHandler) {
  74837. controller.foregroundSlider(i)
  74838. }
  74839. }), _slider$on))
  74840. });
  74841. function cancel(e) {
  74842. if (isActive) {
  74843. isActive = false;
  74844. movingHandler.complete(e);
  74845. movingHandler = null
  74846. }
  74847. }
  74848. return docEvents
  74849. }
  74850. function Tracker(params) {
  74851. var state = this._state = {};
  74852. var targets = params.controller.getTrackerTargets();
  74853. if (_support.pointer) {
  74854. params.renderer.root.css({
  74855. msTouchAction: "pinch-zoom"
  74856. })
  74857. }
  74858. this._docEvents = [initializeSelectedAreaEvents(params.controller, targets.selectedArea, state, getRootOffsetLeft), initializeAreaEvents(params.controller, targets.area, state, getRootOffsetLeft), initializeSliderEvents(params.controller, targets.sliders, state, getRootOffsetLeft)];
  74859. (0, _iterator.each)(this._docEvents, function(_, events) {
  74860. _events_engine2.default.on(_dom_adapter2.default.getDocument(), events)
  74861. });
  74862. function getRootOffsetLeft() {
  74863. return params.renderer.getRootOffset().left
  74864. }
  74865. }
  74866. Tracker.prototype = {
  74867. constructor: Tracker,
  74868. dispose: function() {
  74869. (0, _iterator.each)(this._docEvents, function(_, events) {
  74870. _events_engine2.default.off(_dom_adapter2.default.getDocument(), events)
  74871. })
  74872. },
  74873. update: function(enabled, behavior) {
  74874. var state = this._state;
  74875. state.enabled = enabled;
  74876. state.moveSelectedRangeByClick = behavior.moveSelectedRangeByClick;
  74877. state.manualRangeSelectionEnabled = behavior.manualRangeSelectionEnabled
  74878. }
  74879. }
  74880. },
  74881. /*!***************************************************************!*\
  74882. !*** ./artifacts/transpiled/viz/range_selector/range_view.js ***!
  74883. \***************************************************************/
  74884. /*! dynamic exports provided */
  74885. /*! all exports used */
  74886. function(module, exports, __webpack_require__) {
  74887. function drawSeriesView(root, seriesDataSource, canvas, isAnimationEnabled) {
  74888. var seriesList = seriesDataSource.getSeries();
  74889. if (!seriesList.length) {
  74890. return
  74891. }
  74892. var valueAxis = seriesList[0].getValueAxis();
  74893. valueAxis.updateCanvas({
  74894. top: canvas.top,
  74895. bottom: 0,
  74896. height: canvas.height + canvas.top
  74897. });
  74898. seriesDataSource.adjustSeriesDimensions();
  74899. var valueRange = seriesDataSource.getBoundRange().val;
  74900. valueRange.sortCategories(valueAxis.getCategoriesSorter());
  74901. valueAxis.setBusinessRange(valueRange);
  74902. seriesList.forEach(function(series) {
  74903. series._extGroups.seriesGroup = series._extGroups.labelsGroup = root;
  74904. series.draw(isAnimationEnabled)
  74905. })
  74906. }
  74907. function merge(a, b) {
  74908. return void 0 !== a ? a : b
  74909. }
  74910. function RangeView(params) {
  74911. this._params = params;
  74912. this._clipRect = params.renderer.clipRect();
  74913. params.root.attr({
  74914. "clip-path": this._clipRect.id
  74915. })
  74916. }
  74917. RangeView.prototype = {
  74918. constructor: RangeView,
  74919. update: function(backgroundOption, backgroundTheme, canvas, isCompactMode, isAnimationEnabled, seriesDataSource) {
  74920. var renderer = this._params.renderer;
  74921. var root = this._params.root;
  74922. var canvasWidth = canvas.width - canvas.left;
  74923. var seriesGroup;
  74924. backgroundOption = backgroundOption || {};
  74925. root.clear();
  74926. this._clipRect.attr({
  74927. x: canvas.left,
  74928. y: canvas.top,
  74929. width: canvasWidth,
  74930. height: canvas.height
  74931. });
  74932. if (!isCompactMode) {
  74933. if (merge(backgroundOption.visible, backgroundTheme.visible)) {
  74934. if (backgroundOption.color) {
  74935. renderer.rect(canvas.left, canvas.top, canvasWidth + 1, canvas.height).attr({
  74936. fill: merge(backgroundOption.color, backgroundTheme.color),
  74937. "class": "dx-range-selector-background"
  74938. }).append(root)
  74939. }
  74940. if (backgroundOption.image && backgroundOption.image.url) {
  74941. renderer.image(canvas.left, canvas.top, canvasWidth + 1, canvas.height, backgroundOption.image.url, merge(backgroundOption.image.location, backgroundTheme.image.location)).append(root)
  74942. }
  74943. }
  74944. if (seriesDataSource && seriesDataSource.isShowChart()) {
  74945. seriesGroup = renderer.g().attr({
  74946. "class": "dxrs-series-group"
  74947. }).append(root);
  74948. drawSeriesView(seriesGroup, seriesDataSource, canvas, isAnimationEnabled)
  74949. }
  74950. }
  74951. }
  74952. };
  74953. exports.RangeView = RangeView
  74954. },
  74955. /*!***********************************************************************!*\
  74956. !*** ./artifacts/transpiled/viz/range_selector/series_data_source.js ***!
  74957. \***********************************************************************/
  74958. /*! dynamic exports provided */
  74959. /*! all exports used */
  74960. function(module, exports, __webpack_require__) {
  74961. var seriesModule = __webpack_require__( /*! ../series/base_series */ 245);
  74962. var seriesFamilyModule = __webpack_require__( /*! ../core/series_family */ 409);
  74963. var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
  74964. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  74965. var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  74966. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  74967. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  74968. var rangeModule = __webpack_require__( /*! ../translators/range */ 108);
  74969. var dataValidatorModule = __webpack_require__( /*! ../components/data_validator */ 243);
  74970. var ChartThemeManager = __webpack_require__( /*! ../components/chart_theme_manager */ 401).ThemeManager;
  74971. var createThemeManager = function(chartOptions) {
  74972. return new ChartThemeManager({
  74973. options: chartOptions,
  74974. themeSection: "rangeSelector.chart",
  74975. fontFields: ["commonSeriesSettings.label.font"]
  74976. })
  74977. };
  74978. var processSeriesFamilies = function(series, equalBarWidth, minBubbleSize, maxBubbleSize, barOptions, negativesAsZeroes) {
  74979. var families = [];
  74980. var types = [];
  74981. each(series, function(i, item) {
  74982. if (inArray(item.type, types) === -1) {
  74983. types.push(item.type)
  74984. }
  74985. });
  74986. each(types, function(_, type) {
  74987. var family = new seriesFamilyModule.SeriesFamily({
  74988. type: type,
  74989. equalBarWidth: equalBarWidth,
  74990. minBubbleSize: minBubbleSize,
  74991. maxBubbleSize: maxBubbleSize,
  74992. barWidth: barOptions.barWidth,
  74993. barGroupPadding: barOptions.barGroupPadding,
  74994. barGroupWidth: barOptions.barGroupWidth,
  74995. negativesAsZeroes: negativesAsZeroes
  74996. });
  74997. family.add(series);
  74998. family.adjustSeriesValues();
  74999. families.push(family)
  75000. });
  75001. return families
  75002. };
  75003. var SeriesDataSource = function(options) {
  75004. var that = this;
  75005. var themeManager = that._themeManager = createThemeManager(options.chart);
  75006. themeManager.setTheme(options.chart.theme);
  75007. var topIndent = themeManager.getOptions("topIndent");
  75008. var bottomIndent = themeManager.getOptions("bottomIndent");
  75009. that._indent = {
  75010. top: topIndent >= 0 && topIndent < 1 ? topIndent : 0,
  75011. bottom: bottomIndent >= 0 && bottomIndent < 1 ? bottomIndent : 0
  75012. };
  75013. that._valueAxis = themeManager.getOptions("valueAxisRangeSelector") || {};
  75014. that._hideChart = false;
  75015. that._series = that._calculateSeries(options);
  75016. that._seriesFamilies = []
  75017. };
  75018. SeriesDataSource.prototype = {
  75019. constructor: SeriesDataSource,
  75020. _calculateSeries: function(options) {
  75021. var that = this;
  75022. var series = [];
  75023. var data = options.dataSource || [];
  75024. var chartThemeManager = that._themeManager;
  75025. var seriesTemplate = chartThemeManager.getOptions("seriesTemplate");
  75026. var allSeriesOptions = seriesTemplate ? vizUtils.processSeriesTemplate(seriesTemplate, data) : options.chart.series;
  75027. var dataSourceField;
  75028. var valueAxis = that._valueAxis;
  75029. var i;
  75030. if (options.dataSource && !allSeriesOptions) {
  75031. dataSourceField = options.dataSourceField || "arg";
  75032. allSeriesOptions = {
  75033. argumentField: dataSourceField,
  75034. valueField: dataSourceField
  75035. };
  75036. that._hideChart = true
  75037. }
  75038. allSeriesOptions = Array.isArray(allSeriesOptions) ? allSeriesOptions : allSeriesOptions ? [allSeriesOptions] : [];
  75039. for (i = 0; i < allSeriesOptions.length; i++) {
  75040. var particularSeriesOptions = extend(true, {}, allSeriesOptions[i]);
  75041. particularSeriesOptions.rotated = false;
  75042. var seriesTheme = chartThemeManager.getOptions("series", particularSeriesOptions, allSeriesOptions.length);
  75043. seriesTheme.argumentField = seriesTheme.argumentField || options.dataSourceField;
  75044. if (!seriesTheme.name) {
  75045. seriesTheme.name = "Series " + (i + 1).toString()
  75046. }
  75047. if (data && data.length > 0) {
  75048. var newSeries = new seriesModule.Series({
  75049. renderer: options.renderer,
  75050. argumentAxis: options.argumentAxis,
  75051. valueAxis: options.valueAxis,
  75052. incidentOccurred: options.incidentOccurred
  75053. }, seriesTheme);
  75054. series.push(newSeries)
  75055. }
  75056. }
  75057. if (series.length) {
  75058. var groupsData = {
  75059. groups: [{
  75060. series: series,
  75061. valueAxis: options.valueAxis,
  75062. valueOptions: {
  75063. type: valueAxis.type,
  75064. valueType: dataSourceField ? options.valueType : valueAxis.valueType
  75065. }
  75066. }],
  75067. argumentOptions: {
  75068. categories: options.categories,
  75069. argumentType: options.valueType,
  75070. type: options.axisType
  75071. }
  75072. };
  75073. var parsedData = dataValidatorModule.validateData(data, groupsData, options.incidentOccurred, chartThemeManager.getOptions("dataPrepareSettings"));
  75074. that.argCategories = groupsData.categories;
  75075. for (i = 0; i < series.length; i++) {
  75076. series[i].updateData(parsedData[series[i].getArgumentField()])
  75077. }
  75078. }
  75079. return series
  75080. },
  75081. createPoints: function() {
  75082. if (0 === this._series.length) {
  75083. return
  75084. }
  75085. var series = this._series;
  75086. var viewport = new rangeModule.Range;
  75087. var axis = series[0].getArgumentAxis();
  75088. var themeManager = this._themeManager;
  75089. var negativesAsZeroes = themeManager.getOptions("negativesAsZeroes");
  75090. var negativesAsZeros = themeManager.getOptions("negativesAsZeros");
  75091. series.forEach(function(s) {
  75092. viewport.addRange(s.getArgumentRange())
  75093. });
  75094. axis.getTranslator().updateBusinessRange(viewport);
  75095. series.forEach(function(s) {
  75096. s.createPoints()
  75097. });
  75098. this._seriesFamilies = processSeriesFamilies(series, themeManager.getOptions("equalBarWidth"), themeManager.getOptions("minBubbleSize"), themeManager.getOptions("maxBubbleSize"), {
  75099. barWidth: themeManager.getOptions("barWidth"),
  75100. barGroupPadding: themeManager.getOptions("barGroupPadding"),
  75101. barGroupWidth: themeManager.getOptions("barGroupWidth")
  75102. }, typeUtils.isDefined(negativesAsZeroes) ? negativesAsZeroes : negativesAsZeros)
  75103. },
  75104. adjustSeriesDimensions: function() {
  75105. each(this._seriesFamilies, function(_, family) {
  75106. family.adjustSeriesDimensions()
  75107. })
  75108. },
  75109. getBoundRange: function() {
  75110. var that = this;
  75111. var valueAxis = that._valueAxis;
  75112. var valRange = new rangeModule.Range({
  75113. min: valueAxis.min,
  75114. minVisible: valueAxis.min,
  75115. max: valueAxis.max,
  75116. maxVisible: valueAxis.max,
  75117. axisType: valueAxis.type,
  75118. base: valueAxis.logarithmBase
  75119. });
  75120. var argRange = new rangeModule.Range({});
  75121. each(that._series, function(_, series) {
  75122. var rangeData = series.getRangeData();
  75123. valRange.addRange(rangeData.val);
  75124. argRange.addRange(rangeData.arg)
  75125. });
  75126. if (!valRange.isEmpty() && !argRange.isEmpty()) {
  75127. var minIndent = valueAxis.inverted ? that._indent.top : that._indent.bottom;
  75128. var maxIndent = valueAxis.inverted ? that._indent.bottom : that._indent.top;
  75129. var rangeYSize = valRange.max - valRange.min;
  75130. var rangeVisibleSizeY = (typeUtils.isNumeric(valRange.maxVisible) ? valRange.maxVisible : valRange.max) - (typeUtils.isNumeric(valRange.minVisible) ? valRange.minVisible : valRange.min);
  75131. if (typeUtils.isDate(valRange.min)) {
  75132. valRange.min = new Date(valRange.min.valueOf() - rangeYSize * minIndent)
  75133. } else {
  75134. valRange.min -= rangeYSize * minIndent
  75135. }
  75136. if (typeUtils.isDate(valRange.max)) {
  75137. valRange.max = new Date(valRange.max.valueOf() + rangeYSize * maxIndent)
  75138. } else {
  75139. valRange.max += rangeYSize * maxIndent
  75140. }
  75141. if (typeUtils.isNumeric(rangeVisibleSizeY)) {
  75142. valRange.maxVisible = valRange.maxVisible ? valRange.maxVisible + rangeVisibleSizeY * maxIndent : void 0;
  75143. valRange.minVisible = valRange.minVisible ? valRange.minVisible - rangeVisibleSizeY * minIndent : void 0
  75144. }
  75145. valRange.invert = valueAxis.inverted
  75146. }
  75147. return {
  75148. arg: argRange,
  75149. val: valRange
  75150. }
  75151. },
  75152. getMarginOptions: function(canvas) {
  75153. var bubbleSize = Math.min(canvas.width, canvas.height) * this._themeManager.getOptions("maxBubbleSize");
  75154. return this._series.reduce(function(marginOptions, series) {
  75155. var seriesOptions = series.getMarginOptions();
  75156. if (true === seriesOptions.processBubbleSize) {
  75157. seriesOptions.size = bubbleSize
  75158. }
  75159. return vizUtils.mergeMarginOptions(marginOptions, seriesOptions)
  75160. }, {})
  75161. },
  75162. getSeries: function() {
  75163. return this._series
  75164. },
  75165. isEmpty: function() {
  75166. return 0 === this.getSeries().length
  75167. },
  75168. isShowChart: function() {
  75169. return !this._hideChart
  75170. },
  75171. getCalculatedValueType: function() {
  75172. var series = this._series[0];
  75173. return series && series.argumentType
  75174. },
  75175. getThemeManager: function() {
  75176. return this._themeManager
  75177. }
  75178. };
  75179. exports.SeriesDataSource = SeriesDataSource
  75180. },
  75181. /*!************************************************!*\
  75182. !*** ./artifacts/transpiled/viz/vector_map.js ***!
  75183. \************************************************/
  75184. /*! dynamic exports provided */
  75185. /*! all exports used */
  75186. function(module, exports, __webpack_require__) {
  75187. module.exports = __webpack_require__( /*! ./vector_map/vector_map */ 812)
  75188. },
  75189. /*!***********************************************************!*\
  75190. !*** ./artifacts/transpiled/viz/vector_map/vector_map.js ***!
  75191. \***********************************************************/
  75192. /*! dynamic exports provided */
  75193. /*! all exports used */
  75194. function(module, exports, __webpack_require__) {
  75195. var _parseScalar = __webpack_require__( /*! ../core/utils */ 10).parseScalar;
  75196. var projectionModule = __webpack_require__( /*! ./projection.main */ 415);
  75197. var controlBarModule = __webpack_require__( /*! ./control_bar */ 813);
  75198. var gestureHandlerModule = __webpack_require__( /*! ./gesture_handler */ 814);
  75199. var trackerModule = __webpack_require__( /*! ./tracker */ 815);
  75200. var dataExchangerModule = __webpack_require__( /*! ./data_exchanger */ 816);
  75201. var legendModule = __webpack_require__( /*! ./legend */ 817);
  75202. var layoutModule = __webpack_require__( /*! ./layout */ 818);
  75203. var mapLayerModule = __webpack_require__( /*! ./map_layer */ 819);
  75204. var tooltipViewerModule = __webpack_require__( /*! ./tooltip_viewer */ 820);
  75205. var DEFAULT_WIDTH = 800;
  75206. var DEFAULT_HEIGHT = 400;
  75207. var nextDataKey = 1;
  75208. var RE_STARTS_LAYERS = /^layers/;
  75209. var RE_ENDS_DATA_SOURCE = /\.dataSource$/;
  75210. __webpack_require__( /*! ./projection */ 417);
  75211. function generateDataKey() {
  75212. return "vectormap-data-" + nextDataKey++
  75213. }
  75214. var dxVectorMap = __webpack_require__( /*! ../core/base_widget */ 96).inherit({
  75215. _eventsMap: {
  75216. onClick: {
  75217. name: "click"
  75218. },
  75219. onCenterChanged: {
  75220. name: "centerChanged"
  75221. },
  75222. onZoomFactorChanged: {
  75223. name: "zoomFactorChanged"
  75224. },
  75225. onHoverChanged: {
  75226. name: "hoverChanged"
  75227. },
  75228. onSelectionChanged: {
  75229. name: "selectionChanged"
  75230. }
  75231. },
  75232. _rootClassPrefix: "dxm",
  75233. _rootClass: "dxm-vector-map",
  75234. _themeSection: "map",
  75235. _fontFields: ["layer:area.label.font", "layer:marker:dot.label.font", "layer:marker:bubble.label.font", "layer:marker:pie.label.font", "layer:marker:image.label.font", "legend.font", "legend.title.font", "legend.title.subtitle.font"],
  75236. _initLayerCollection: function(dataKey) {
  75237. var that = this;
  75238. that._layerCollection = new mapLayerModule.MapLayerCollection({
  75239. renderer: that._renderer,
  75240. projection: that._projection,
  75241. themeManager: that._themeManager,
  75242. tracker: that._tracker,
  75243. dataKey: dataKey,
  75244. eventTrigger: that._eventTrigger,
  75245. dataExchanger: that._dataExchanger,
  75246. tooltip: that._tooltip,
  75247. notifyDirty: that._notifyDirty,
  75248. notifyReady: that._notifyReady
  75249. })
  75250. },
  75251. _initLegendsControl: function() {
  75252. var that = this;
  75253. that._legendsControl = new legendModule.LegendsControl({
  75254. renderer: that._renderer,
  75255. container: that._root,
  75256. layoutControl: that._layoutControl,
  75257. themeManager: that._themeManager,
  75258. dataExchanger: that._dataExchanger,
  75259. notifyDirty: that._notifyDirty,
  75260. notifyReady: that._notifyReady
  75261. })
  75262. },
  75263. _initControlBar: function(dataKey) {
  75264. var that = this;
  75265. that._controlBar = new controlBarModule.ControlBar({
  75266. renderer: that._renderer,
  75267. container: that._root,
  75268. layoutControl: that._layoutControl,
  75269. projection: that._projection,
  75270. tracker: that._tracker,
  75271. dataKey: dataKey
  75272. })
  75273. },
  75274. _initElements: function() {
  75275. var that = this;
  75276. var dataKey = generateDataKey();
  75277. var notifyCounter = 0;
  75278. var preventProjectionEvents = true;
  75279. that._notifyDirty = function() {
  75280. that._resetIsReady();
  75281. ++notifyCounter
  75282. };
  75283. that._notifyReady = function() {
  75284. preventProjectionEvents = false;
  75285. if (0 === --notifyCounter) {
  75286. that._drawn()
  75287. }
  75288. };
  75289. that._dataExchanger = new dataExchangerModule.DataExchanger;
  75290. that._projection = new projectionModule.Projection({
  75291. centerChanged: function(value) {
  75292. if (!preventProjectionEvents) {
  75293. that._eventTrigger("centerChanged", {
  75294. center: value
  75295. })
  75296. }
  75297. },
  75298. zoomChanged: function(value) {
  75299. if (!preventProjectionEvents) {
  75300. that._eventTrigger("zoomFactorChanged", {
  75301. zoomFactor: value
  75302. })
  75303. }
  75304. }
  75305. });
  75306. that._tracker = new trackerModule.Tracker({
  75307. root: that._root,
  75308. projection: that._projection,
  75309. dataKey: dataKey
  75310. });
  75311. that._gestureHandler = new gestureHandlerModule.GestureHandler({
  75312. projection: that._projection,
  75313. renderer: that._renderer,
  75314. tracker: that._tracker
  75315. });
  75316. that._layoutControl = new layoutModule.LayoutControl;
  75317. that._layoutControl.suspend();
  75318. that._initLayerCollection(dataKey);
  75319. that._initControlBar(dataKey);
  75320. that._initLegendsControl();
  75321. that._tooltipViewer = new tooltipViewerModule.TooltipViewer({
  75322. tracker: that._tracker,
  75323. tooltip: that._tooltip,
  75324. layerCollection: that._layerCollection
  75325. })
  75326. },
  75327. _change_RESUME_LAYOUT: function() {
  75328. this._layoutControl.resume()
  75329. },
  75330. _initialChanges: ["PROJECTION", "RESUME_LAYOUT", "LAYOUT_INIT", "BOUNDS", "MAX_ZOOM_FACTOR", "ZOOM_FACTOR", "CENTER"],
  75331. _layoutChangesOrder: ["RESUME_LAYOUT", "LAYERS"],
  75332. _initCore: function() {
  75333. this._root = this._renderer.root.attr({
  75334. align: "center",
  75335. cursor: "default"
  75336. });
  75337. this._initElements()
  75338. },
  75339. _disposeCore: function() {
  75340. var that = this;
  75341. that._controlBar.dispose();
  75342. that._gestureHandler.dispose();
  75343. that._tracker.dispose();
  75344. that._legendsControl.dispose();
  75345. that._layerCollection.dispose();
  75346. that._layoutControl.dispose();
  75347. that._tooltipViewer.dispose();
  75348. that._dataExchanger.dispose();
  75349. that._projection.dispose();
  75350. that._dataExchanger = that._gestureHandler = that._projection = that._tracker = that._layoutControl = that._root = that._layerCollection = that._controlBar = that._legendsControl = null
  75351. },
  75352. _setupInteraction: function() {
  75353. var options = {
  75354. centeringEnabled: !!_parseScalar(this._getOption("panningEnabled", true), true),
  75355. zoomingEnabled: !!_parseScalar(this._getOption("zoomingEnabled", true), true)
  75356. };
  75357. this._gestureHandler.setInteraction(options);
  75358. this._controlBar.setInteraction(options)
  75359. },
  75360. _getDefaultSize: function() {
  75361. return {
  75362. width: DEFAULT_WIDTH,
  75363. height: DEFAULT_HEIGHT
  75364. }
  75365. },
  75366. _applySize: function(rect) {
  75367. var layout = {
  75368. left: rect[0],
  75369. top: rect[1],
  75370. width: rect[2] - rect[0],
  75371. height: rect[3] - rect[1],
  75372. right: 0,
  75373. bottom: 0
  75374. };
  75375. this._projection.setSize(layout);
  75376. this._layoutControl.setSize(layout);
  75377. this._layerCollection.setRect([layout.left, layout.top, layout.width, layout.height])
  75378. },
  75379. _optionChanging: function(name, currentValue, nextValue) {
  75380. if (currentValue && nextValue) {
  75381. if (RE_STARTS_LAYERS.test(name)) {
  75382. if (currentValue.dataSource && nextValue.dataSource && currentValue !== nextValue) {
  75383. currentValue.dataSource = null
  75384. } else {
  75385. if (RE_ENDS_DATA_SOURCE.test(name)) {
  75386. this.option(name, null)
  75387. }
  75388. }
  75389. }
  75390. }
  75391. },
  75392. _applyChanges: function() {
  75393. this._notifyDirty();
  75394. this.callBase.apply(this, arguments);
  75395. this._notifyReady()
  75396. },
  75397. _optionChangesMap: {
  75398. background: "BACKGROUND",
  75399. layers: "LAYERS",
  75400. controlBar: "CONTROL_BAR",
  75401. legends: "LEGENDS",
  75402. touchEnabled: "TRACKER",
  75403. wheelEnabled: "TRACKER",
  75404. panningEnabled: "INTERACTION",
  75405. zoomingEnabled: "INTERACTION",
  75406. projection: "PROJECTION",
  75407. bounds: "BOUNDS",
  75408. maxZoomFactor: "MAX_ZOOM_FACTOR",
  75409. zoomFactor: "ZOOM_FACTOR",
  75410. center: "CENTER"
  75411. },
  75412. _optionChangesOrder: ["PROJECTION", "BOUNDS", "MAX_ZOOM_FACTOR", "ZOOM_FACTOR", "CENTER", "BACKGROUND", "CONTROL_BAR", "LEGENDS", "TRACKER", "INTERACTION"],
  75413. _change_PROJECTION: function() {
  75414. this._setProjection()
  75415. },
  75416. _change_BOUNDS: function() {
  75417. this._setBounds()
  75418. },
  75419. _change_MAX_ZOOM_FACTOR: function() {
  75420. this._setMaxZoom()
  75421. },
  75422. _change_ZOOM_FACTOR: function() {
  75423. this._setZoom()
  75424. },
  75425. _change_CENTER: function() {
  75426. this._setCenter()
  75427. },
  75428. _change_BACKGROUND: function() {
  75429. this._setBackgroundOptions()
  75430. },
  75431. _change_LAYERS: function() {
  75432. this._setLayerCollectionOptions()
  75433. },
  75434. _change_CONTROL_BAR: function() {
  75435. this._setControlBarOptions()
  75436. },
  75437. _change_LEGENDS: function() {
  75438. this._setLegendsOptions()
  75439. },
  75440. _change_TRACKER: function() {
  75441. this._setTrackerOptions()
  75442. },
  75443. _change_INTERACTION: function() {
  75444. this._setupInteraction()
  75445. },
  75446. _themeDependentChanges: ["BACKGROUND", "LAYERS", "CONTROL_BAR", "LEGENDS", "TRACKER", "INTERACTION"],
  75447. _setProjection: function() {
  75448. this._projection.setEngine(this.option("projection"))
  75449. },
  75450. _setBounds: function() {
  75451. this._projection.setBounds(this.option("bounds"))
  75452. },
  75453. _setMaxZoom: function() {
  75454. this._projection.setMaxZoom(this.option("maxZoomFactor"))
  75455. },
  75456. _setZoom: function() {
  75457. this._projection.setZoom(this.option("zoomFactor"))
  75458. },
  75459. _setCenter: function() {
  75460. this._projection.setCenter(this.option("center"))
  75461. },
  75462. _setBackgroundOptions: function() {
  75463. this._layerCollection.setBackgroundOptions(this._getOption("background"))
  75464. },
  75465. _setLayerCollectionOptions: function() {
  75466. this._layerCollection.setOptions(this.option("layers"))
  75467. },
  75468. _setControlBarOptions: function() {
  75469. this._controlBar.setOptions(this._getOption("controlBar"))
  75470. },
  75471. _setLegendsOptions: function() {
  75472. this._legendsControl.setOptions(this.option("legends"))
  75473. },
  75474. _setTrackerOptions: function() {
  75475. this._tracker.setOptions({
  75476. touchEnabled: this._getOption("touchEnabled", true),
  75477. wheelEnabled: this._getOption("wheelEnabled", true)
  75478. })
  75479. },
  75480. getLayers: function() {
  75481. var layers = this._layerCollection.items();
  75482. var list = [];
  75483. var i;
  75484. var ii = list.length = layers.length;
  75485. for (i = 0; i < ii; ++i) {
  75486. list[i] = layers[i].proxy
  75487. }
  75488. return list
  75489. },
  75490. getLayerByIndex: function(index) {
  75491. var layer = this._layerCollection.byIndex(index);
  75492. return layer ? layer.proxy : null
  75493. },
  75494. getLayerByName: function(name) {
  75495. var layer = this._layerCollection.byName(name);
  75496. return layer ? layer.proxy : null
  75497. },
  75498. clearSelection: function(_noEvent) {
  75499. var layers = this._layerCollection.items();
  75500. var i;
  75501. var ii = layers.length;
  75502. for (i = 0; i < ii; ++i) {
  75503. layers[i].clearSelection(_noEvent)
  75504. }
  75505. return this
  75506. },
  75507. center: function(value) {
  75508. var that = this;
  75509. if (void 0 === value) {
  75510. return that._projection.getCenter()
  75511. } else {
  75512. that._projection.setCenter(value);
  75513. return that
  75514. }
  75515. },
  75516. zoomFactor: function(value) {
  75517. var that = this;
  75518. if (void 0 === value) {
  75519. return that._projection.getZoom()
  75520. } else {
  75521. that._projection.setZoom(value);
  75522. return that
  75523. }
  75524. },
  75525. viewport: function(value) {
  75526. var that = this;
  75527. if (void 0 === value) {
  75528. return that._projection.getViewport()
  75529. } else {
  75530. that._projection.setViewport(value);
  75531. return that
  75532. }
  75533. },
  75534. convertCoordinates: function(coordinates) {
  75535. coordinates = coordinates && coordinates.length ? coordinates : [arguments[0], arguments[1]];
  75536. return this._projection.fromScreenPoint(coordinates)
  75537. }
  75538. });
  75539. __webpack_require__( /*! ../../core/component_registrator */ 9)("dxVectorMap", dxVectorMap);
  75540. module.exports = dxVectorMap;
  75541. module.exports._TESTS_resetDataKey = function() {
  75542. nextDataKey = 1
  75543. };
  75544. dxVectorMap.addPlugin(__webpack_require__( /*! ../core/export */ 93).plugin);
  75545. dxVectorMap.addPlugin(__webpack_require__( /*! ../core/title */ 105).plugin);
  75546. dxVectorMap.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin);
  75547. dxVectorMap.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 119).plugin)
  75548. },
  75549. /*!************************************************************!*\
  75550. !*** ./artifacts/transpiled/viz/vector_map/control_bar.js ***!
  75551. \************************************************************/
  75552. /*! dynamic exports provided */
  75553. /*! all exports used */
  75554. function(module, exports, __webpack_require__) {
  75555. var _math = Math;
  75556. var _min = _math.min;
  75557. var _max = _math.max;
  75558. var _round = _math.round;
  75559. var _floor = _math.floor;
  75560. var _sqrt = _math.sqrt;
  75561. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  75562. var _parseScalar = vizUtils.parseScalar;
  75563. var parseHorizontalAlignment = vizUtils.enumParser(["left", "center", "right"]);
  75564. var parseVerticalAlignment = vizUtils.enumParser(["top", "bottom"]);
  75565. var COMMAND_RESET = "command-reset";
  75566. var COMMAND_MOVE_UP = "command-move-up";
  75567. var COMMAND_MOVE_RIGHT = "command-move-right";
  75568. var COMMAND_MOVE_DOWN = "command-move-down";
  75569. var COMMAND_MOVE_LEFT = "command-move-left";
  75570. var COMMAND_ZOOM_IN = "command-zoom-in";
  75571. var COMMAND_ZOOM_OUT = "command-zoom-out";
  75572. var COMMAND_ZOOM_DRAG_LINE = "command-zoom-drag-line";
  75573. var COMMAND_ZOOM_DRAG = "command-zoom-drag";
  75574. var EVENT_TARGET_TYPE = "control-bar";
  75575. var FLAG_CENTERING = 1;
  75576. var FLAG_ZOOMING = 2;
  75577. var SIZE_OPTIONS = {
  75578. bigCircleSize: 58,
  75579. smallCircleSize: 28,
  75580. buttonSize: 10,
  75581. arrowButtonOffset: 20,
  75582. incDecButtonSize: 11,
  75583. incButtonOffset: 66,
  75584. decButtonOffset: 227,
  75585. sliderLineStartOffset: 88.5,
  75586. sliderLineEndOffset: 205.5,
  75587. sliderLength: 20,
  75588. sliderWidth: 8,
  75589. trackerGap: 4
  75590. };
  75591. var OFFSET_X = 30.5;
  75592. var OFFSET_Y = 30.5;
  75593. var TOTAL_WIDTH = 61;
  75594. var TOTAL_HEIGHT = 274;
  75595. var COMMAND_TO_TYPE_MAP = {};
  75596. COMMAND_TO_TYPE_MAP[COMMAND_RESET] = ResetCommand;
  75597. COMMAND_TO_TYPE_MAP[COMMAND_MOVE_UP] = COMMAND_TO_TYPE_MAP[COMMAND_MOVE_RIGHT] = COMMAND_TO_TYPE_MAP[COMMAND_MOVE_DOWN] = COMMAND_TO_TYPE_MAP[COMMAND_MOVE_LEFT] = MoveCommand;
  75598. COMMAND_TO_TYPE_MAP[COMMAND_ZOOM_IN] = COMMAND_TO_TYPE_MAP[COMMAND_ZOOM_OUT] = ZoomCommand;
  75599. COMMAND_TO_TYPE_MAP[COMMAND_ZOOM_DRAG] = ZoomDragCommand;
  75600. function ControlBar(parameters) {
  75601. var that = this;
  75602. that._params = parameters;
  75603. that._createElements(parameters.renderer, parameters.container, parameters.dataKey);
  75604. parameters.layoutControl.addItem(that);
  75605. that._subscribeToProjection(parameters.projection);
  75606. that._subscribeToTracker(parameters.tracker);
  75607. that._createCallbacks(parameters.projection)
  75608. }
  75609. ControlBar.prototype = {
  75610. constructor: ControlBar,
  75611. _flags: 0,
  75612. dispose: function() {
  75613. var that = this;
  75614. that._params.layoutControl.removeItem(that);
  75615. that._root.linkRemove().linkOff();
  75616. that._offProjection();
  75617. that._offTracker();
  75618. that._params = that._root = that._offProjection = that._offTracker = that._callbacks = null
  75619. },
  75620. _subscribeToProjection: function(projection) {
  75621. var that = this;
  75622. that._offProjection = projection.on({
  75623. engine: function() {
  75624. that._update()
  75625. },
  75626. zoom: updateZoom,
  75627. "max-zoom": function() {
  75628. that._zoomPartition = projection.getZoomScalePartition();
  75629. that._sliderUnitLength = that._sliderLineLength / that._zoomPartition;
  75630. updateZoom()
  75631. }
  75632. });
  75633. function updateZoom() {
  75634. that._adjustZoom(projection.getScaledZoom())
  75635. }
  75636. },
  75637. _subscribeToTracker: function(tracker) {
  75638. var that = this;
  75639. var isActive = false;
  75640. that._offTracker = tracker.on({
  75641. start: function(arg) {
  75642. isActive = arg.data.name === EVENT_TARGET_TYPE;
  75643. if (isActive) {
  75644. that._processStart(arg.data.index, arg)
  75645. }
  75646. },
  75647. move: function(arg) {
  75648. if (isActive) {
  75649. that._processMove(arg.data.index, arg)
  75650. }
  75651. },
  75652. end: function() {
  75653. if (isActive) {
  75654. that._processEnd();
  75655. isActive = false
  75656. }
  75657. }
  75658. })
  75659. },
  75660. _createCallbacks: function(projection) {
  75661. var that = this;
  75662. that._callbacks = {
  75663. reset: function(isCenter, isZoom) {
  75664. if (isCenter) {
  75665. projection.setCenter(null)
  75666. }
  75667. if (isZoom) {
  75668. projection.setZoom(null)
  75669. }
  75670. },
  75671. beginMove: function() {
  75672. projection.beginMoveCenter()
  75673. },
  75674. endMove: function() {
  75675. projection.endMoveCenter()
  75676. },
  75677. move: function(shift) {
  75678. projection.moveCenter(shift)
  75679. },
  75680. zoom: function(_zoom) {
  75681. projection.setScaledZoom(_zoom)
  75682. }
  75683. }
  75684. },
  75685. _createElements: function(renderer, container, dataKey) {
  75686. var that = this;
  75687. that._root = renderer.g().attr({
  75688. "class": "dxm-control-bar"
  75689. }).linkOn(container, "control-bar");
  75690. var buttonsGroups = that._buttonsGroup = renderer.g().attr({
  75691. "class": "dxm-control-buttons"
  75692. }).append(that._root);
  75693. var trackersGroup = renderer.g().attr({
  75694. stroke: "none",
  75695. "stroke-width": 0,
  75696. fill: "#000000",
  75697. opacity: 1e-4
  75698. }).css({
  75699. cursor: "pointer"
  75700. }).append(that._root);
  75701. that._createButtons(renderer, dataKey, buttonsGroups);
  75702. that._createTrackers(renderer, dataKey, trackersGroup)
  75703. },
  75704. _createButtons: function(renderer, dataKey, group) {
  75705. var that = this;
  75706. var options = SIZE_OPTIONS;
  75707. var size = options.buttonSize / 2;
  75708. var offset1 = options.arrowButtonOffset - size;
  75709. var offset2 = options.arrowButtonOffset;
  75710. var incDecButtonSize = options.incDecButtonSize / 2;
  75711. var directionOptions = {
  75712. "stroke-linecap": "square",
  75713. fill: "none"
  75714. };
  75715. var line = "line";
  75716. renderer.circle(0, 0, options.bigCircleSize / 2).append(group);
  75717. renderer.circle(0, 0, size).attr({
  75718. fill: "none"
  75719. }).append(group);
  75720. renderer.path([-size, -offset1, 0, -offset2, size, -offset1], line).attr(directionOptions).append(group);
  75721. renderer.path([offset1, -size, offset2, 0, offset1, size], line).attr(directionOptions).append(group);
  75722. renderer.path([size, offset1, 0, offset2, -size, offset1], line).attr(directionOptions).append(group);
  75723. renderer.path([-offset1, size, -offset2, 0, -offset1, -size], line).attr(directionOptions).append(group);
  75724. renderer.circle(0, options.incButtonOffset, options.smallCircleSize / 2).append(group);
  75725. renderer.path([
  75726. [-incDecButtonSize, options.incButtonOffset, incDecButtonSize, options.incButtonOffset],
  75727. [0, options.incButtonOffset - incDecButtonSize, 0, options.incButtonOffset + incDecButtonSize]
  75728. ], "area").append(group);
  75729. renderer.circle(0, options.decButtonOffset, options.smallCircleSize / 2).append(group);
  75730. renderer.path([-incDecButtonSize, options.decButtonOffset, incDecButtonSize, options.decButtonOffset], "area").append(group);
  75731. that._zoomLine = renderer.path([], "line").append(group);
  75732. that._zoomDrag = renderer.rect(_floor(-options.sliderLength / 2), _floor(options.sliderLineEndOffset - options.sliderWidth / 2), options.sliderLength, options.sliderWidth).append(group);
  75733. that._sliderLineLength = options.sliderLineEndOffset - options.sliderLineStartOffset
  75734. },
  75735. _createTrackers: function(renderer, dataKey, group) {
  75736. var options = SIZE_OPTIONS;
  75737. var size = _round((options.arrowButtonOffset - options.trackerGap) / 2);
  75738. var offset1 = options.arrowButtonOffset - size;
  75739. var offset2 = _round(_sqrt(options.bigCircleSize * options.bigCircleSize / 4 - size * size));
  75740. var size2 = offset2 - offset1;
  75741. renderer.rect(-size, -size, 2 * size, 2 * size).data(dataKey, {
  75742. index: COMMAND_RESET,
  75743. name: EVENT_TARGET_TYPE
  75744. }).append(group);
  75745. renderer.rect(-size, -offset2, 2 * size, size2).data(dataKey, {
  75746. index: COMMAND_MOVE_UP,
  75747. name: EVENT_TARGET_TYPE
  75748. }).append(group);
  75749. renderer.rect(offset1, -size, size2, 2 * size).data(dataKey, {
  75750. index: COMMAND_MOVE_RIGHT,
  75751. name: EVENT_TARGET_TYPE
  75752. }).append(group);
  75753. renderer.rect(-size, offset1, 2 * size, size2).data(dataKey, {
  75754. index: COMMAND_MOVE_DOWN,
  75755. name: EVENT_TARGET_TYPE
  75756. }).append(group);
  75757. renderer.rect(-offset2, -size, size2, 2 * size).data(dataKey, {
  75758. index: COMMAND_MOVE_LEFT,
  75759. name: EVENT_TARGET_TYPE
  75760. }).append(group);
  75761. renderer.circle(0, options.incButtonOffset, options.smallCircleSize / 2).data(dataKey, {
  75762. index: COMMAND_ZOOM_IN,
  75763. name: EVENT_TARGET_TYPE
  75764. }).append(group);
  75765. renderer.circle(0, options.decButtonOffset, options.smallCircleSize / 2).data(dataKey, {
  75766. index: COMMAND_ZOOM_OUT,
  75767. name: EVENT_TARGET_TYPE
  75768. }).append(group);
  75769. renderer.rect(-2, options.sliderLineStartOffset - 2, 4, options.sliderLineEndOffset - options.sliderLineStartOffset + 4).css({
  75770. cursor: "default"
  75771. }).data(dataKey, {
  75772. index: COMMAND_ZOOM_DRAG_LINE,
  75773. name: EVENT_TARGET_TYPE
  75774. }).append(group);
  75775. this._zoomDragTracker = renderer.rect(-options.sliderLength / 2, options.sliderLineEndOffset - options.sliderWidth / 2, options.sliderLength, options.sliderWidth).data(dataKey, {
  75776. index: COMMAND_ZOOM_DRAG,
  75777. name: EVENT_TARGET_TYPE
  75778. }).append(group)
  75779. },
  75780. resize: function(size) {
  75781. if (this._isActive) {
  75782. this._root.attr({
  75783. visibility: null !== size ? null : "hidden"
  75784. })
  75785. }
  75786. },
  75787. getLayoutOptions: function() {
  75788. return this._isActive ? this._layoutOptions : null
  75789. },
  75790. locate: function(x, y) {
  75791. this._root.attr({
  75792. translateX: x + this._margin + OFFSET_X,
  75793. translateY: y + this._margin + OFFSET_Y
  75794. })
  75795. },
  75796. _update: function() {
  75797. var that = this;
  75798. that._isActive = that._isEnabled && that._flags && that._params.projection.isInvertible();
  75799. if (that._isActive) {
  75800. that._root.linkAppend()
  75801. } else {
  75802. that._root.linkRemove()
  75803. }
  75804. that._processEnd();
  75805. that.updateLayout()
  75806. },
  75807. setInteraction: function(interaction) {
  75808. var that = this;
  75809. if (_parseScalar(interaction.centeringEnabled, true)) {
  75810. that._flags |= FLAG_CENTERING
  75811. } else {
  75812. that._flags &= ~FLAG_CENTERING
  75813. }
  75814. if (_parseScalar(interaction.zoomingEnabled, true)) {
  75815. that._flags |= FLAG_ZOOMING
  75816. } else {
  75817. that._flags &= ~FLAG_ZOOMING
  75818. }
  75819. that._update()
  75820. },
  75821. setOptions: function(options) {
  75822. var that = this;
  75823. that._isEnabled = !!_parseScalar(options.enabled, true);
  75824. that._margin = options.margin || 0;
  75825. that._layoutOptions = {
  75826. width: 2 * that._margin + TOTAL_WIDTH,
  75827. height: 2 * that._margin + TOTAL_HEIGHT,
  75828. horizontalAlignment: parseHorizontalAlignment(options.horizontalAlignment, "left"),
  75829. verticalAlignment: parseVerticalAlignment(options.verticalAlignment, "top")
  75830. };
  75831. that._buttonsGroup.attr({
  75832. "stroke-width": options.borderWidth,
  75833. stroke: options.borderColor,
  75834. fill: options.color,
  75835. "fill-opacity": options.opacity
  75836. });
  75837. that._update()
  75838. },
  75839. _adjustZoom: function(zoom) {
  75840. var that = this;
  75841. var start = SIZE_OPTIONS.sliderLineStartOffset;
  75842. var end = SIZE_OPTIONS.sliderLineEndOffset;
  75843. var h = SIZE_OPTIONS.sliderWidth;
  75844. that._zoomFactor = _max(_min(_round(zoom), that._zoomPartition), 0);
  75845. var transform = {
  75846. translateY: -_round(that._zoomFactor * that._sliderUnitLength)
  75847. };
  75848. var y = end - h / 2 + transform.translateY;
  75849. that._zoomLine.attr({
  75850. points: [
  75851. [0, start, 0, _max(start, y)],
  75852. [0, _min(end, y + h), 0, end]
  75853. ]
  75854. });
  75855. that._zoomDrag.attr(transform);
  75856. that._zoomDragTracker.attr(transform)
  75857. },
  75858. _applyZoom: function() {
  75859. this._callbacks.zoom(this._zoomFactor)
  75860. },
  75861. _processStart: function(command, arg) {
  75862. var commandType;
  75863. if (this._isActive) {
  75864. commandType = COMMAND_TO_TYPE_MAP[command];
  75865. this._command = commandType && commandType.flags & this._flags ? new commandType(this, command, arg) : null
  75866. }
  75867. },
  75868. _processMove: function(command, arg) {
  75869. this._command && this._command.update(command, arg)
  75870. },
  75871. _processEnd: function() {
  75872. this._command && this._command.finish();
  75873. this._command = null
  75874. }
  75875. };
  75876. function disposeCommand(command) {
  75877. delete command._owner;
  75878. command.update = function() {};
  75879. command.finish = function() {}
  75880. }
  75881. function ResetCommand(owner, command) {
  75882. this._owner = owner;
  75883. this._command = command
  75884. }
  75885. ResetCommand.flags = FLAG_CENTERING | FLAG_ZOOMING;
  75886. ResetCommand.prototype.update = function(command) {
  75887. command !== this._command && disposeCommand(this)
  75888. };
  75889. ResetCommand.prototype.finish = function() {
  75890. var flags = this._owner._flags;
  75891. this._owner._callbacks.reset(!!(flags & FLAG_CENTERING), !!(flags & FLAG_ZOOMING));
  75892. disposeCommand(this)
  75893. };
  75894. function MoveCommand(owner, command, arg) {
  75895. this._command = command;
  75896. var timeout = null;
  75897. var interval = 100;
  75898. var dx = 0;
  75899. var dy = 0;
  75900. switch (this._command) {
  75901. case COMMAND_MOVE_UP:
  75902. dy = -10;
  75903. break;
  75904. case COMMAND_MOVE_RIGHT:
  75905. dx = 10;
  75906. break;
  75907. case COMMAND_MOVE_DOWN:
  75908. dy = 10;
  75909. break;
  75910. case COMMAND_MOVE_LEFT:
  75911. dx = -10
  75912. }
  75913. function callback() {
  75914. owner._callbacks.move([dx, dy]);
  75915. timeout = setTimeout(callback, interval)
  75916. }
  75917. this._stop = function() {
  75918. clearTimeout(timeout);
  75919. owner._callbacks.endMove();
  75920. this._stop = owner = null;
  75921. return this
  75922. };
  75923. arg = null;
  75924. owner._callbacks.beginMove();
  75925. callback()
  75926. }
  75927. MoveCommand.flags = FLAG_CENTERING;
  75928. MoveCommand.prototype.update = function(command) {
  75929. this._command !== command && this.finish()
  75930. };
  75931. MoveCommand.prototype.finish = function() {
  75932. disposeCommand(this._stop())
  75933. };
  75934. function ZoomCommand(owner, command) {
  75935. this._owner = owner;
  75936. this._command = command;
  75937. var timeout = null;
  75938. var interval = 150;
  75939. var dZoom = this._command === COMMAND_ZOOM_IN ? 1 : -1;
  75940. function callback() {
  75941. owner._adjustZoom(owner._zoomFactor + dZoom);
  75942. timeout = setTimeout(callback, interval)
  75943. }
  75944. this._stop = function() {
  75945. clearTimeout(timeout);
  75946. this._stop = owner = null;
  75947. return this
  75948. };
  75949. callback()
  75950. }
  75951. ZoomCommand.flags = FLAG_ZOOMING;
  75952. ZoomCommand.prototype.update = function(command) {
  75953. this._command !== command && this.finish()
  75954. };
  75955. ZoomCommand.prototype.finish = function() {
  75956. this._owner._applyZoom();
  75957. disposeCommand(this._stop())
  75958. };
  75959. function ZoomDragCommand(owner, command, arg) {
  75960. this._owner = owner;
  75961. this._zoomFactor = owner._zoomFactor;
  75962. this._pos = arg.y
  75963. }
  75964. ZoomDragCommand.flags = FLAG_ZOOMING;
  75965. ZoomDragCommand.prototype.update = function(command, arg) {
  75966. var owner = this._owner;
  75967. owner._adjustZoom(this._zoomFactor + owner._zoomPartition * (this._pos - arg.y) / owner._sliderLineLength)
  75968. };
  75969. ZoomDragCommand.prototype.finish = function() {
  75970. this._owner._applyZoom();
  75971. disposeCommand(this)
  75972. };
  75973. exports.ControlBar = ControlBar;
  75974. var COMMAND_TO_TYPE_MAP__ORIGINAL = COMMAND_TO_TYPE_MAP;
  75975. exports._TESTS_stubCommandToTypeMap = function(map) {
  75976. COMMAND_TO_TYPE_MAP = map
  75977. };
  75978. exports._TESTS_restoreCommandToTypeMap = function() {
  75979. COMMAND_TO_TYPE_MAP = COMMAND_TO_TYPE_MAP__ORIGINAL
  75980. }
  75981. },
  75982. /*!****************************************************************!*\
  75983. !*** ./artifacts/transpiled/viz/vector_map/gesture_handler.js ***!
  75984. \****************************************************************/
  75985. /*! dynamic exports provided */
  75986. /*! all exports used */
  75987. function(module, exports, __webpack_require__) {
  75988. var _ln = Math.log;
  75989. var _LN2 = Math.LN2;
  75990. function GestureHandler(params) {
  75991. var that = this;
  75992. that._projection = params.projection;
  75993. that._renderer = params.renderer;
  75994. that._x = that._y = 0;
  75995. that._subscribeToTracker(params.tracker)
  75996. }
  75997. GestureHandler.prototype = {
  75998. constructor: GestureHandler,
  75999. dispose: function() {
  76000. this._offTracker();
  76001. this._offTracker = null
  76002. },
  76003. _subscribeToTracker: function(tracker) {
  76004. var that = this;
  76005. var isActive = false;
  76006. that._offTracker = tracker.on({
  76007. start: function(arg) {
  76008. isActive = "control-bar" !== arg.data.name;
  76009. if (isActive) {
  76010. that._processStart(arg)
  76011. }
  76012. },
  76013. move: function(arg) {
  76014. if (isActive) {
  76015. that._processMove(arg)
  76016. }
  76017. },
  76018. end: function() {
  76019. if (isActive) {
  76020. that._processEnd()
  76021. }
  76022. },
  76023. zoom: function(arg) {
  76024. that._processZoom(arg)
  76025. }
  76026. })
  76027. },
  76028. setInteraction: function(options) {
  76029. this._processEnd();
  76030. this._centeringEnabled = options.centeringEnabled;
  76031. this._zoomingEnabled = options.zoomingEnabled
  76032. },
  76033. _processStart: function(arg) {
  76034. if (this._centeringEnabled) {
  76035. this._x = arg.x;
  76036. this._y = arg.y;
  76037. this._projection.beginMoveCenter()
  76038. }
  76039. },
  76040. _processMove: function(arg) {
  76041. var that = this;
  76042. if (that._centeringEnabled) {
  76043. that._renderer.root.attr({
  76044. cursor: "move"
  76045. });
  76046. that._projection.moveCenter([that._x - arg.x, that._y - arg.y]);
  76047. that._x = arg.x;
  76048. that._y = arg.y
  76049. }
  76050. },
  76051. _processEnd: function() {
  76052. if (this._centeringEnabled) {
  76053. this._renderer.root.attr({
  76054. cursor: "default"
  76055. });
  76056. this._projection.endMoveCenter()
  76057. }
  76058. },
  76059. _processZoom: function(arg) {
  76060. var that = this;
  76061. var delta;
  76062. var screenPosition;
  76063. var coords;
  76064. if (that._zoomingEnabled) {
  76065. if (arg.delta) {
  76066. delta = arg.delta
  76067. } else {
  76068. if (arg.ratio) {
  76069. delta = _ln(arg.ratio) / _LN2
  76070. }
  76071. }
  76072. if (that._centeringEnabled) {
  76073. screenPosition = that._renderer.getRootOffset();
  76074. screenPosition = [arg.x - screenPosition.left, arg.y - screenPosition.top];
  76075. coords = that._projection.fromScreenPoint(screenPosition)
  76076. }
  76077. that._projection.changeScaledZoom(delta);
  76078. if (that._centeringEnabled) {
  76079. that._projection.setCenterByPoint(coords, screenPosition)
  76080. }
  76081. }
  76082. }
  76083. };
  76084. exports.GestureHandler = GestureHandler
  76085. },
  76086. /*!********************************************************!*\
  76087. !*** ./artifacts/transpiled/viz/vector_map/tracker.js ***!
  76088. \********************************************************/
  76089. /*! dynamic exports provided */
  76090. /*! all exports used */
  76091. function(module, exports, __webpack_require__) {
  76092. var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
  76093. var _events_engine2 = _interopRequireDefault(_events_engine);
  76094. var _window = __webpack_require__( /*! ../../core/utils/window */ 7);
  76095. var _window2 = _interopRequireDefault(_window);
  76096. var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
  76097. var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
  76098. var _event_emitter = __webpack_require__( /*! ./event_emitter */ 416);
  76099. var _event_emitter2 = _interopRequireDefault(_event_emitter);
  76100. var _utils = __webpack_require__( /*! ../../events/utils */ 8);
  76101. var _utils2 = _interopRequireDefault(_utils);
  76102. var _wheel = __webpack_require__( /*! ../../events/core/wheel */ 124);
  76103. var _utils3 = __webpack_require__( /*! ../core/utils */ 10);
  76104. function _interopRequireDefault(obj) {
  76105. return obj && obj.__esModule ? obj : {
  76106. "default": obj
  76107. }
  76108. }
  76109. var navigator = _window2.default.getNavigator();
  76110. var _math = Math;
  76111. var _abs = _math.abs;
  76112. var _sqrt = _math.sqrt;
  76113. var _round = _math.round;
  76114. var _addNamespace = _utils2.default.addNamespace;
  76115. var _now = Date.now;
  76116. var _NAME = "dxVectorMap";
  76117. var EVENT_START = "start";
  76118. var EVENT_MOVE = "move";
  76119. var EVENT_END = "end";
  76120. var EVENT_ZOOM = "zoom";
  76121. var EVENT_HOVER_ON = "hover-on";
  76122. var EVENT_HOVER_OFF = "hover-off";
  76123. var EVENT_CLICK = "click";
  76124. var EVENT_FOCUS_ON = "focus-on";
  76125. var EVENT_FOCUS_MOVE = "focus-move";
  76126. var EVENT_FOCUS_OFF = "focus-off";
  76127. var CLICK_TIME_THRESHOLD = 500;
  76128. var CLICK_COORD_THRESHOLD_MOUSE = 5;
  76129. var CLICK_COORD_THRESHOLD_TOUCH = 20;
  76130. var DRAG_COORD_THRESHOLD_MOUSE = 5;
  76131. var DRAG_COORD_THRESHOLD_TOUCH = 10;
  76132. var FOCUS_OFF_DELAY = 100;
  76133. var WHEEL_COOLDOWN = 50;
  76134. var WHEEL_DIRECTION_COOLDOWN = 300;
  76135. var EVENTS;
  76136. setupEvents();
  76137. function Tracker(parameters) {
  76138. var that = this;
  76139. that._root = parameters.root;
  76140. that._createEventHandlers(parameters.dataKey);
  76141. that._createProjectionHandlers(parameters.projection);
  76142. that._initEvents();
  76143. that._focus = new Focus(function(name, arg) {
  76144. that._fire(name, arg)
  76145. });
  76146. that._attachHandlers()
  76147. }
  76148. Tracker.prototype = {
  76149. constructor: Tracker,
  76150. dispose: function() {
  76151. var that = this;
  76152. that._detachHandlers();
  76153. that._disposeEvents();
  76154. that._focus.dispose();
  76155. that._root = that._focus = that._docHandlers = that._rootHandlers = null
  76156. },
  76157. _eventNames: [EVENT_START, EVENT_MOVE, EVENT_END, EVENT_ZOOM, EVENT_CLICK, EVENT_HOVER_ON, EVENT_HOVER_OFF, EVENT_FOCUS_ON, EVENT_FOCUS_OFF, EVENT_FOCUS_MOVE],
  76158. _startClick: function(event, data) {
  76159. if (!data) {
  76160. return
  76161. }
  76162. var coords = getEventCoords(event);
  76163. this._clickState = {
  76164. x: coords.x,
  76165. y: coords.y,
  76166. threshold: isTouchEvent(event) ? CLICK_COORD_THRESHOLD_TOUCH : CLICK_COORD_THRESHOLD_MOUSE,
  76167. time: _now()
  76168. }
  76169. },
  76170. _endClick: function(event, data) {
  76171. var state = this._clickState;
  76172. if (!state) {
  76173. return
  76174. }
  76175. if (data && _now() - state.time <= CLICK_TIME_THRESHOLD) {
  76176. var threshold = state.threshold;
  76177. var coords = getEventCoords(event);
  76178. if (_abs(coords.x - state.x) <= threshold && _abs(coords.y - state.y) <= threshold) {
  76179. this._fire(EVENT_CLICK, {
  76180. data: data,
  76181. x: coords.x,
  76182. y: coords.y,
  76183. $event: event
  76184. })
  76185. }
  76186. }
  76187. this._clickState = null
  76188. },
  76189. _startDrag: function(event, data) {
  76190. if (!data) {
  76191. return
  76192. }
  76193. var coords = getEventCoords(event);
  76194. var state = this._dragState = {
  76195. x: coords.x,
  76196. y: coords.y,
  76197. data: data
  76198. };
  76199. this._fire(EVENT_START, {
  76200. x: state.x,
  76201. y: state.y,
  76202. data: state.data
  76203. })
  76204. },
  76205. _moveDrag: function(event, data) {
  76206. var state = this._dragState;
  76207. if (!state) {
  76208. return
  76209. }
  76210. var coords = getEventCoords(event);
  76211. var threshold = isTouchEvent(event) ? DRAG_COORD_THRESHOLD_TOUCH : DRAG_COORD_THRESHOLD_MOUSE;
  76212. if (state.active || _abs(coords.x - state.x) > threshold || _abs(coords.y - state.y) > threshold) {
  76213. state.x = coords.x;
  76214. state.y = coords.y;
  76215. state.active = true;
  76216. state.data = data || {};
  76217. this._fire(EVENT_MOVE, {
  76218. x: state.x,
  76219. y: state.y,
  76220. data: state.data
  76221. })
  76222. }
  76223. },
  76224. _endDrag: function() {
  76225. var state = this._dragState;
  76226. if (!state) {
  76227. return
  76228. }
  76229. this._dragState = null;
  76230. this._fire(EVENT_END, {
  76231. x: state.x,
  76232. y: state.y,
  76233. data: state.data
  76234. })
  76235. },
  76236. _wheelZoom: function(event, data) {
  76237. if (!data) {
  76238. return
  76239. }
  76240. var that = this;
  76241. var lock = that._wheelLock;
  76242. var time = _now();
  76243. if (time - lock.time <= WHEEL_COOLDOWN) {
  76244. return
  76245. }
  76246. if (time - lock.dirTime > WHEEL_DIRECTION_COOLDOWN) {
  76247. lock.dir = 0
  76248. }
  76249. var delta = adjustWheelDelta(event.delta / 120 || 0, lock);
  76250. if (0 === delta) {
  76251. return
  76252. }
  76253. var coords = getEventCoords(event);
  76254. that._fire(EVENT_ZOOM, {
  76255. delta: delta,
  76256. x: coords.x,
  76257. y: coords.y
  76258. });
  76259. lock.time = lock.dirTime = time
  76260. },
  76261. _startZoom: function(event, data) {
  76262. if (!isTouchEvent(event) || !data) {
  76263. return
  76264. }
  76265. var state = this._zoomState = this._zoomState || {};
  76266. var coords;
  76267. var pointer2;
  76268. if (state.pointer1 && state.pointer2) {
  76269. return
  76270. }
  76271. if (void 0 === state.pointer1) {
  76272. state.pointer1 = getPointerId(event) || 0;
  76273. coords = getMultitouchEventCoords(event, state.pointer1);
  76274. state.x1 = state.x1_0 = coords.x;
  76275. state.y1 = state.y1_0 = coords.y
  76276. }
  76277. if (void 0 === state.pointer2) {
  76278. pointer2 = getPointerId(event) || 1;
  76279. if (pointer2 !== state.pointer1) {
  76280. coords = getMultitouchEventCoords(event, pointer2);
  76281. if (coords) {
  76282. state.x2 = state.x2_0 = coords.x;
  76283. state.y2 = state.y2_0 = coords.y;
  76284. state.pointer2 = pointer2;
  76285. state.ready = true;
  76286. this._endDrag()
  76287. }
  76288. }
  76289. }
  76290. },
  76291. _moveZoom: function(event) {
  76292. var state = this._zoomState;
  76293. var coords;
  76294. if (!state || !isTouchEvent(event)) {
  76295. return
  76296. }
  76297. if (void 0 !== state.pointer1) {
  76298. coords = getMultitouchEventCoords(event, state.pointer1);
  76299. if (coords) {
  76300. state.x1 = coords.x;
  76301. state.y1 = coords.y
  76302. }
  76303. }
  76304. if (void 0 !== state.pointer2) {
  76305. coords = getMultitouchEventCoords(event, state.pointer2);
  76306. if (coords) {
  76307. state.x2 = coords.x;
  76308. state.y2 = coords.y
  76309. }
  76310. }
  76311. },
  76312. _endZoom: function(event) {
  76313. var state = this._zoomState;
  76314. if (!state || !isTouchEvent(event)) {
  76315. return
  76316. }
  76317. if (state.ready) {
  76318. var startDistance = getDistance(state.x1_0, state.y1_0, state.x2_0, state.y2_0);
  76319. var currentDistance = getDistance(state.x1, state.y1, state.x2, state.y2);
  76320. this._fire(EVENT_ZOOM, {
  76321. ratio: currentDistance / startDistance,
  76322. x: (state.x1_0 + state.x2_0) / 2,
  76323. y: (state.y1_0 + state.y2_0) / 2
  76324. })
  76325. }
  76326. this._zoomState = null
  76327. },
  76328. _startHover: function(event, data) {
  76329. this._doHover(event, data, true)
  76330. },
  76331. _moveHover: function(event, data) {
  76332. this._doHover(event, data, false)
  76333. },
  76334. _doHover: function(event, data, isTouch) {
  76335. var that = this;
  76336. if (that._dragState && that._dragState.active || that._zoomState && that._zoomState.ready) {
  76337. that._cancelHover();
  76338. return
  76339. }
  76340. if (isTouchEvent(event) !== isTouch || that._hoverTarget === event.target || that._hoverState && that._hoverState.data === data) {
  76341. return
  76342. }
  76343. that._cancelHover();
  76344. if (data) {
  76345. that._hoverState = {
  76346. data: data
  76347. };
  76348. that._fire(EVENT_HOVER_ON, {
  76349. data: data
  76350. })
  76351. }
  76352. that._hoverTarget = event.target
  76353. },
  76354. _cancelHover: function() {
  76355. var state = this._hoverState;
  76356. this._hoverState = this._hoverTarget = null;
  76357. if (state) {
  76358. this._fire(EVENT_HOVER_OFF, {
  76359. data: state.data
  76360. })
  76361. }
  76362. },
  76363. _startFocus: function(event, data) {
  76364. this._doFocus(event, data, true)
  76365. },
  76366. _moveFocus: function(event, data) {
  76367. this._doFocus(event, data, false)
  76368. },
  76369. _doFocus: function(event, data, isTouch) {
  76370. var that = this;
  76371. if (that._dragState && that._dragState.active || that._zoomState && that._zoomState.ready) {
  76372. that._cancelFocus();
  76373. return
  76374. }
  76375. if (isTouchEvent(event) !== isTouch) {
  76376. return
  76377. }
  76378. that._focus.turnOff();
  76379. data && that._focus.turnOn(data, getEventCoords(event))
  76380. },
  76381. _cancelFocus: function() {
  76382. this._focus.cancel()
  76383. },
  76384. _createEventHandlers: function(DATA_KEY) {
  76385. var that = this;
  76386. that._docHandlers = {};
  76387. that._rootHandlers = {};
  76388. that._rootHandlers[EVENTS.start] = that._docHandlers[EVENTS.start] = function(event) {
  76389. var isTouch = isTouchEvent(event);
  76390. var data = getData(event);
  76391. if (isTouch && !that._isTouchEnabled) {
  76392. return
  76393. }
  76394. if (data) {
  76395. event.preventDefault();
  76396. event.stopPropagation()
  76397. }
  76398. that._startClick(event, data);
  76399. that._startDrag(event, data);
  76400. that._startZoom(event, data);
  76401. that._startHover(event, data);
  76402. that._startFocus(event, data)
  76403. };
  76404. that._docHandlers[EVENTS.move] = function(event) {
  76405. var isTouch = isTouchEvent(event);
  76406. var data = getData(event);
  76407. if (isTouch && !that._isTouchEnabled) {
  76408. return
  76409. }
  76410. that._moveDrag(event, data);
  76411. that._moveZoom(event, data);
  76412. that._moveHover(event, data);
  76413. that._moveFocus(event, data)
  76414. };
  76415. that._docHandlers[EVENTS.end] = function(event) {
  76416. var isTouch = isTouchEvent(event);
  76417. var data = getData(event);
  76418. if (isTouch && !that._isTouchEnabled) {
  76419. return
  76420. }
  76421. that._endClick(event, data);
  76422. that._endDrag(event, data);
  76423. that._endZoom(event, data)
  76424. };
  76425. that._rootHandlers[EVENTS.wheel] = function(event) {
  76426. that._cancelFocus();
  76427. if (!that._isWheelEnabled) {
  76428. return
  76429. }
  76430. var data = getData(event);
  76431. if (data) {
  76432. event.preventDefault();
  76433. event.stopPropagation();
  76434. that._wheelZoom(event, data)
  76435. }
  76436. };
  76437. that._wheelLock = {
  76438. dir: 0
  76439. };
  76440. function getData(event) {
  76441. var target = event.target;
  76442. return ("tspan" === target.tagName ? target.parentNode : target)[DATA_KEY]
  76443. }
  76444. },
  76445. _createProjectionHandlers: function(projection) {
  76446. var that = this;
  76447. projection.on({
  76448. center: handler,
  76449. zoom: handler
  76450. });
  76451. function handler() {
  76452. that._cancelFocus()
  76453. }
  76454. },
  76455. reset: function() {
  76456. var that = this;
  76457. that._clickState = null;
  76458. that._endDrag();
  76459. that._cancelHover();
  76460. that._cancelFocus()
  76461. },
  76462. setOptions: function(options) {
  76463. var that = this;
  76464. that.reset();
  76465. that._detachHandlers();
  76466. that._isTouchEnabled = !!(0, _utils3.parseScalar)(options.touchEnabled, true);
  76467. that._isWheelEnabled = !!(0, _utils3.parseScalar)(options.wheelEnabled, true);
  76468. that._attachHandlers()
  76469. },
  76470. _detachHandlers: function() {
  76471. var that = this;
  76472. if (that._isTouchEnabled) {
  76473. that._root.css({
  76474. "touch-action": "",
  76475. "-webkit-user-select": ""
  76476. }).off(_addNamespace("MSHoldVisual", _NAME)).off(_addNamespace("contextmenu", _NAME))
  76477. }
  76478. _events_engine2.default.off(_dom_adapter2.default.getDocument(), that._docHandlers);
  76479. that._root.off(that._rootHandlers)
  76480. },
  76481. _attachHandlers: function() {
  76482. var that = this;
  76483. if (that._isTouchEnabled) {
  76484. that._root.css({
  76485. "touch-action": "none",
  76486. "-webkit-user-select": "none"
  76487. }).on(_addNamespace("MSHoldVisual", _NAME), function(event) {
  76488. event.preventDefault()
  76489. }).on(_addNamespace("contextmenu", _NAME), function(event) {
  76490. isTouchEvent(event) && event.preventDefault()
  76491. })
  76492. }
  76493. _events_engine2.default.on(_dom_adapter2.default.getDocument(), that._docHandlers);
  76494. that._root.on(that._rootHandlers)
  76495. }
  76496. };
  76497. var Focus = function(fire) {
  76498. var that = this;
  76499. var _activeData = null;
  76500. var _data = null;
  76501. var _disabled = false;
  76502. var _offTimer = null;
  76503. var _x;
  76504. var _y;
  76505. that.dispose = function() {
  76506. clearTimeout(_offTimer);
  76507. that.turnOn = that.turnOff = that.cancel = that.dispose = that = fire = _activeData = _data = _offTimer = null
  76508. };
  76509. that.turnOn = function(data, coords) {
  76510. if (data === _data && _disabled) {
  76511. return
  76512. }
  76513. _disabled = false;
  76514. _data = data;
  76515. if (_activeData) {
  76516. _x = coords.x;
  76517. _y = coords.y;
  76518. if (_data === _activeData) {
  76519. fire(EVENT_FOCUS_MOVE, {
  76520. data: _data,
  76521. x: _x,
  76522. y: _y
  76523. });
  76524. onCheck(true)
  76525. } else {
  76526. fire(EVENT_FOCUS_ON, {
  76527. data: _data,
  76528. x: _x,
  76529. y: _y,
  76530. done: onCheck
  76531. })
  76532. }
  76533. } else {
  76534. _x = coords.x;
  76535. _y = coords.y;
  76536. fire(EVENT_FOCUS_ON, {
  76537. data: _data,
  76538. x: _x,
  76539. y: _y,
  76540. done: onCheck
  76541. })
  76542. }
  76543. function onCheck(result) {
  76544. _disabled = !result;
  76545. if (result) {
  76546. _activeData = _data;
  76547. clearTimeout(_offTimer);
  76548. _offTimer = null
  76549. }
  76550. }
  76551. };
  76552. that.turnOff = function() {
  76553. _data = null;
  76554. if (_activeData && !_disabled) {
  76555. _offTimer = _offTimer || setTimeout(function() {
  76556. _offTimer = null;
  76557. fire(EVENT_FOCUS_OFF, {
  76558. data: _activeData
  76559. });
  76560. _activeData = null
  76561. }, FOCUS_OFF_DELAY)
  76562. }
  76563. };
  76564. that.cancel = function() {
  76565. clearTimeout(_offTimer);
  76566. if (_activeData) {
  76567. fire(EVENT_FOCUS_OFF, {
  76568. data: _activeData
  76569. })
  76570. }
  76571. _activeData = _data = _offTimer = null
  76572. }
  76573. };
  76574. _event_emitter2.default.makeEventEmitter(Tracker);
  76575. exports.Tracker = Tracker;
  76576. var originFocus = Focus;
  76577. exports._DEBUG_forceEventMode = function(mode) {
  76578. setupEvents(mode)
  76579. };
  76580. exports.Focus = Focus;
  76581. exports._DEBUG_stubFocusType = function(focusType) {
  76582. Focus = focusType
  76583. };
  76584. exports._DEBUG_restoreFocusType = function() {
  76585. Focus = originFocus
  76586. };
  76587. function getDistance(x1, y1, x2, y2) {
  76588. return _sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
  76589. }
  76590. function isTouchEvent(event) {
  76591. var type = event.originalEvent.type;
  76592. var pointerType = event.originalEvent.pointerType;
  76593. return /^touch/.test(type) || /^MSPointer/.test(type) && 4 !== pointerType || /^pointer/.test(type) && "mouse" !== pointerType
  76594. }
  76595. function selectItem(flags, items) {
  76596. var i = 0;
  76597. var ii = flags.length;
  76598. var item;
  76599. for (; i < ii; ++i) {
  76600. if (flags[i]) {
  76601. item = items[i];
  76602. break
  76603. }
  76604. }
  76605. return _addNamespace(item || items[i], _NAME)
  76606. }
  76607. function setupEvents() {
  76608. var flags = [navigator.pointerEnabled, navigator.msPointerEnabled, _window2.default.hasProperty("ontouchstart")];
  76609. if (arguments.length) {
  76610. flags = ["pointer" === arguments[0], "MSPointer" === arguments[0], "touch" === arguments[0]]
  76611. }
  76612. EVENTS = {
  76613. start: selectItem(flags, ["pointerdown", "MSPointerDown", "touchstart mousedown", "mousedown"]),
  76614. move: selectItem(flags, ["pointermove", "MSPointerMove", "touchmove mousemove", "mousemove"]),
  76615. end: selectItem(flags, ["pointerup", "MSPointerUp", "touchend mouseup", "mouseup"]),
  76616. wheel: _addNamespace(_wheel.name, _NAME)
  76617. }
  76618. }
  76619. function getEventCoords(event) {
  76620. var originalEvent = event.originalEvent;
  76621. var touch = originalEvent.touches && originalEvent.touches[0] || {};
  76622. return {
  76623. x: touch.pageX || originalEvent.pageX || event.pageX,
  76624. y: touch.pageY || originalEvent.pageY || event.pageY
  76625. }
  76626. }
  76627. function getPointerId(event) {
  76628. return event.originalEvent.pointerId
  76629. }
  76630. function getMultitouchEventCoords(event, pointerId) {
  76631. var originalEvent = event.originalEvent;
  76632. if (void 0 !== originalEvent.pointerId) {
  76633. originalEvent = originalEvent.pointerId === pointerId ? originalEvent : null
  76634. } else {
  76635. originalEvent = originalEvent.touches[pointerId]
  76636. }
  76637. return originalEvent ? {
  76638. x: originalEvent.pageX || event.pageX,
  76639. y: originalEvent.pageY || event.pageY
  76640. } : null
  76641. }
  76642. function adjustWheelDelta(delta, lock) {
  76643. if (0 === delta) {
  76644. return 0
  76645. }
  76646. var _delta = _abs(delta);
  76647. var sign = _round(delta / _delta);
  76648. if (lock.dir && sign !== lock.dir) {
  76649. return 0
  76650. }
  76651. lock.dir = sign;
  76652. if (_delta < .1) {
  76653. _delta = 0
  76654. } else {
  76655. if (_delta < 1) {
  76656. _delta = 1
  76657. } else {
  76658. if (_delta > 4) {
  76659. _delta = 4
  76660. } else {
  76661. _delta = _round(_delta)
  76662. }
  76663. }
  76664. }
  76665. return sign * _delta
  76666. }
  76667. },
  76668. /*!***************************************************************!*\
  76669. !*** ./artifacts/transpiled/viz/vector_map/data_exchanger.js ***!
  76670. \***************************************************************/
  76671. /*! dynamic exports provided */
  76672. /*! all exports used */
  76673. function(module, exports, __webpack_require__) {
  76674. var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
  76675. function DataExchanger() {
  76676. this._store = {}
  76677. }
  76678. DataExchanger.prototype = {
  76679. constructor: DataExchanger,
  76680. dispose: function() {
  76681. this._store = null;
  76682. return this
  76683. },
  76684. _get: function(category, name) {
  76685. var store = this._store[category] || (this._store[category] = {});
  76686. return store[name] || (store[name] = {
  76687. callbacks: Callbacks()
  76688. })
  76689. },
  76690. set: function(category, name, data) {
  76691. var item = this._get(category, name);
  76692. item.data = data;
  76693. item.callbacks.fire(data);
  76694. return this
  76695. },
  76696. bind: function(category, name, callback) {
  76697. var item = this._get(category, name);
  76698. item.callbacks.add(callback);
  76699. item.data && callback(item.data);
  76700. return this
  76701. },
  76702. unbind: function(category, name, callback) {
  76703. var item = this._get(category, name);
  76704. item.callbacks.remove(callback);
  76705. return this
  76706. }
  76707. };
  76708. exports.DataExchanger = DataExchanger
  76709. },
  76710. /*!*******************************************************!*\
  76711. !*** ./artifacts/transpiled/viz/vector_map/legend.js ***!
  76712. \*******************************************************/
  76713. /*! dynamic exports provided */
  76714. /*! all exports used */
  76715. function(module, exports, __webpack_require__) {
  76716. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  76717. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  76718. var _extend = extend;
  76719. var _each = each;
  76720. var legendModule = __webpack_require__( /*! ../components/legend */ 201);
  76721. var _BaseLegend = legendModule.Legend;
  76722. var unknownSource = {
  76723. category: "UNKNOWN",
  76724. name: "UNKNOWN"
  76725. };
  76726. function buildData(partition, values, field) {
  76727. var i;
  76728. var ii = values.length;
  76729. var list = [];
  76730. var item;
  76731. for (i = 0; i < ii; ++i) {
  76732. list[i] = item = {
  76733. start: partition[i],
  76734. end: partition[i + 1],
  76735. index: i
  76736. };
  76737. item[field] = values[i];
  76738. item.states = {
  76739. normal: {
  76740. fill: item.color
  76741. }
  76742. };
  76743. item.visible = true
  76744. }
  76745. return list
  76746. }
  76747. var Legend = function(parameters) {
  76748. var that = this;
  76749. that._params = parameters;
  76750. that._root = parameters.renderer.g().attr({
  76751. "class": "dxm-legend"
  76752. }).linkOn(parameters.container, {
  76753. name: "legend",
  76754. after: "legend-base"
  76755. }).enableLinks().linkAppend();
  76756. parameters.layoutControl.addItem(that);
  76757. _BaseLegend.call(that, {
  76758. renderer: parameters.renderer,
  76759. group: that._root,
  76760. backgroundClass: null,
  76761. itemsGroupClass: null,
  76762. textField: "text",
  76763. getFormatObject: function(data) {
  76764. return data
  76765. }
  76766. });
  76767. that._onDataChanged = function(data) {
  76768. that._updateData(data)
  76769. }
  76770. };
  76771. Legend.prototype = _extend(__webpack_require__( /*! ../../core/utils/object */ 47).clone(_BaseLegend.prototype), {
  76772. constructor: Legend,
  76773. dispose: function() {
  76774. var that = this;
  76775. that._params.layoutControl.removeItem(that);
  76776. that._unbindData();
  76777. that._root.linkRemove().linkOff();
  76778. that._params = that._root = that._onDataChanged = null;
  76779. return _BaseLegend.prototype.dispose.apply(that, arguments)
  76780. },
  76781. resize: function(size) {
  76782. this._params.notifyDirty();
  76783. if (null === size) {
  76784. this.erase()
  76785. } else {
  76786. this.draw(size.width, size.height)
  76787. }
  76788. this._params.notifyReady()
  76789. },
  76790. locate: _BaseLegend.prototype.shift,
  76791. _updateData: function(data) {
  76792. this._options.defaultColor = data && data.defaultColor;
  76793. this.update(data ? buildData(data.partition, data.values, this._dataName) : [], this._options, this._params.themeManager.theme("legend").title);
  76794. this.updateLayout()
  76795. },
  76796. _unbindData: function() {
  76797. if (this._dataCategory) {
  76798. this._params.dataExchanger.unbind(this._dataCategory, this._dataName, this._onDataChanged)
  76799. }
  76800. },
  76801. _bindData: function(arg) {
  76802. this._params.dataExchanger.bind(this._dataCategory = arg.category, this._dataName = arg.name, this._onDataChanged)
  76803. },
  76804. setOptions: function(options) {
  76805. var that = this;
  76806. that.update(that._data, options, this._params.themeManager.theme("legend").title);
  76807. that._unbindData();
  76808. var source = options.source;
  76809. that._bindData(source ? {
  76810. category: source.layer,
  76811. name: source.grouping
  76812. } : unknownSource);
  76813. that.updateLayout();
  76814. return that
  76815. }
  76816. });
  76817. function LegendsControl(parameters) {
  76818. this._params = parameters;
  76819. this._items = [];
  76820. parameters.container.virtualLink("legend-base")
  76821. }
  76822. LegendsControl.prototype = {
  76823. constructor: LegendsControl,
  76824. dispose: function() {
  76825. _each(this._items, function(_, item) {
  76826. item.dispose()
  76827. });
  76828. this._params = this._items = null
  76829. },
  76830. setOptions: function(options) {
  76831. var optionList = options && options.length ? options : [];
  76832. var items = this._items;
  76833. var i;
  76834. var ii = optionList.length;
  76835. var params = this._params;
  76836. var theme = params.themeManager.theme("legend");
  76837. for (i = items.length; i < ii; ++i) {
  76838. items[i] = new Legend(params)
  76839. }
  76840. for (i = items.length - 1; i >= ii; --i) {
  76841. items[i].dispose();
  76842. items.splice(i, 1)
  76843. }
  76844. params.layoutControl.suspend();
  76845. for (i = 0; i < ii; ++i) {
  76846. items[i].setOptions(_extend(true, {}, theme, optionList[i]))
  76847. }
  76848. params.layoutControl.resume()
  76849. }
  76850. };
  76851. exports.LegendsControl = LegendsControl;
  76852. var originalLegend = Legend;
  76853. exports._TESTS_Legend = Legend;
  76854. exports._TESTS_stubLegendType = function(stub) {
  76855. Legend = stub
  76856. };
  76857. exports._TESTS_restoreLegendType = function() {
  76858. Legend = originalLegend
  76859. }
  76860. },
  76861. /*!*******************************************************!*\
  76862. !*** ./artifacts/transpiled/viz/vector_map/layout.js ***!
  76863. \*******************************************************/
  76864. /*! dynamic exports provided */
  76865. /*! all exports used */
  76866. function(module, exports, __webpack_require__) {
  76867. var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  76868. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  76869. var _round = Math.round;
  76870. var _min = Math.min;
  76871. var _max = Math.max;
  76872. var _each = each;
  76873. var _inArray = inArray;
  76874. var horizontalAlignmentMap = {
  76875. left: 0,
  76876. center: 1,
  76877. right: 2
  76878. };
  76879. var verticalAlignmentMap = {
  76880. top: 0,
  76881. bottom: 1
  76882. };
  76883. function getCellIndex(options) {
  76884. return 3 * verticalAlignmentMap[options.verticalAlignment] + horizontalAlignmentMap[options.horizontalAlignment]
  76885. }
  76886. function createCells(canvas, items) {
  76887. var hStep = (canvas.right - canvas.left) / 3;
  76888. var vStep = (canvas.bottom - canvas.top) / 2;
  76889. var h1 = canvas.left;
  76890. var h2 = _round(h1 + hStep);
  76891. var h3 = _round(h1 + hStep + hStep);
  76892. var h4 = canvas.right;
  76893. var v1 = canvas.top;
  76894. var v2 = _round(v1 + vStep);
  76895. var v3 = canvas.bottom;
  76896. var cells = [{
  76897. rect: [h1, v1, h2, v2]
  76898. }, {
  76899. rect: [h2, v1, h3, v2],
  76900. center: true
  76901. }, {
  76902. rect: [h3, v1, h4, v2],
  76903. horInversion: true
  76904. }, {
  76905. rect: [h1, v2, h2, v3],
  76906. verInversion: true
  76907. }, {
  76908. rect: [h2, v2, h3, v3],
  76909. center: true,
  76910. verInversion: true
  76911. }, {
  76912. rect: [h3, v2, h4, v3],
  76913. horInversion: true,
  76914. verInversion: true
  76915. }];
  76916. var itemsList = [
  76917. [],
  76918. [],
  76919. [],
  76920. [],
  76921. [],
  76922. []
  76923. ];
  76924. _each(items, function(_, item) {
  76925. var options = item.getLayoutOptions();
  76926. if (options) {
  76927. itemsList[getCellIndex(options)].push({
  76928. item: item,
  76929. width: options.width,
  76930. height: options.height
  76931. })
  76932. }
  76933. });
  76934. _each(cells, function(i, cell) {
  76935. if (itemsList[i].length) {
  76936. cell.items = itemsList[i]
  76937. } else {
  76938. if (cell.center) {
  76939. cell.rect[0] = cell.rect[2] = (cell.rect[0] + cell.rect[2]) / 2
  76940. } else {
  76941. cell.rect[cell.horInversion ? 0 : 2] = cell.rect[cell.horInversion ? 2 : 0]
  76942. }
  76943. cell.rect[cell.verInversion ? 1 : 3] = cell.rect[cell.verInversion ? 3 : 1]
  76944. }
  76945. });
  76946. return cells
  76947. }
  76948. function adjustCellSizes(cells) {
  76949. _each([0, 1, 2, 3, 4, 5], function(_, index) {
  76950. var cell = cells[index];
  76951. var otherCell = cells[(index + 3) % 6];
  76952. if (cell.items) {
  76953. if (!otherCell.items) {
  76954. cell.rect[1] = _min(cell.rect[1], otherCell.rect[3]);
  76955. cell.rect[3] = _max(cell.rect[3], otherCell.rect[1])
  76956. }
  76957. }
  76958. });
  76959. _each([1, 4], function(_, index) {
  76960. var cell = cells[index];
  76961. var otherCell1 = cells[index - 1];
  76962. var otherCell2 = cells[index + 1];
  76963. var size1;
  76964. var size2;
  76965. if (cell.items) {
  76966. if (!otherCell1.items && !otherCell2.items) {
  76967. size1 = cell.rect[0] - otherCell1.rect[2];
  76968. size2 = otherCell2.rect[0] - cell.rect[2];
  76969. if (size1 > size2) {
  76970. if (size1 / size2 >= 2) {
  76971. cell.rect[0] -= size1;
  76972. cell.right = true
  76973. } else {
  76974. cell.rect[0] -= size2;
  76975. cell.rect[2] += size2
  76976. }
  76977. } else {
  76978. if (size2 / size1 >= 2) {
  76979. cell.rect[2] += size2;
  76980. cell.center = null
  76981. } else {
  76982. cell.rect[0] -= size1;
  76983. cell.rect[2] += size1
  76984. }
  76985. }
  76986. }
  76987. } else {
  76988. if (otherCell1.items) {
  76989. otherCell1.rect[2] = (cell.rect[0] + cell.rect[2]) / 2
  76990. }
  76991. if (otherCell2.items) {
  76992. otherCell2.rect[0] = (cell.rect[0] + cell.rect[2]) / 2
  76993. }
  76994. }
  76995. })
  76996. }
  76997. function adjustCellsAndApplyLayout(cells, forceMode) {
  76998. var hasHiddenItems = false;
  76999. adjustCellSizes(cells);
  77000. _each(cells, function(_, cell) {
  77001. if (cell.items) {
  77002. hasHiddenItems = applyCellLayout(cell, forceMode) || hasHiddenItems
  77003. }
  77004. });
  77005. return hasHiddenItems
  77006. }
  77007. function applyCellLayout(cell, forceMode) {
  77008. var cellRect = cell.rect;
  77009. var cellWidth = cellRect[2] - cellRect[0];
  77010. var cellHeight = cellRect[3] - cellRect[1];
  77011. var xOffset = 0;
  77012. var yOffset = 0;
  77013. var currentHeight = 0;
  77014. var totalL = cellRect[2];
  77015. var totalT = cellRect[3];
  77016. var totalR = cellRect[0];
  77017. var totalB = cellRect[1];
  77018. var moves = [];
  77019. var hasHiddenItems = false;
  77020. _each(cell.items, function(_, item) {
  77021. if (item.width > cellWidth || item.height > cellHeight) {
  77022. moves.push(null);
  77023. hasHiddenItems = true;
  77024. return forceMode || false
  77025. }
  77026. if (xOffset + item.width > cellWidth) {
  77027. yOffset += currentHeight;
  77028. xOffset = currentHeight = 0
  77029. }
  77030. if (yOffset + item.height > cellHeight) {
  77031. moves.push(null);
  77032. hasHiddenItems = true;
  77033. return forceMode || false
  77034. }
  77035. currentHeight = _max(currentHeight, item.height);
  77036. var dx = cell.horInversion ? cellRect[2] - item.width - xOffset : cellRect[0] + xOffset;
  77037. var dy = cell.verInversion ? cellRect[3] - item.height - yOffset : cellRect[1] + yOffset;
  77038. xOffset += item.width;
  77039. totalL = _min(totalL, dx);
  77040. totalT = _min(totalT, dy);
  77041. totalR = _max(totalR, dx + item.width);
  77042. totalB = _max(totalB, dy + item.height);
  77043. moves.push([dx, dy])
  77044. });
  77045. if (forceMode || !hasHiddenItems) {
  77046. xOffset = 0;
  77047. if (cell.right) {
  77048. xOffset = cellRect[2] - cellRect[0] - totalR + totalL
  77049. } else {
  77050. if (cell.center) {
  77051. xOffset = _round((cellRect[2] - cellRect[0] - totalR + totalL) / 2)
  77052. }
  77053. }
  77054. _each(cell.items, function(i, item) {
  77055. var move = moves[i];
  77056. if (move) {
  77057. item.item.locate(move[0] + xOffset, move[1])
  77058. } else {
  77059. item.item.resize(null)
  77060. }
  77061. });
  77062. cell.rect = [totalL, totalT, totalR, totalB];
  77063. cell.items = null
  77064. }
  77065. return hasHiddenItems
  77066. }
  77067. function applyLayout(canvas, items) {
  77068. var cells = createCells(canvas, items);
  77069. if (adjustCellsAndApplyLayout(cells)) {
  77070. adjustCellsAndApplyLayout(cells, true)
  77071. }
  77072. }
  77073. function LayoutControl() {
  77074. var that = this;
  77075. that._items = [];
  77076. that._suspended = 0;
  77077. that._updateLayout = function() {
  77078. that._update()
  77079. }
  77080. }
  77081. LayoutControl.prototype = {
  77082. constructor: LayoutControl,
  77083. dispose: function() {
  77084. this._items = this._updateLayout = null
  77085. },
  77086. setSize: function(canvas) {
  77087. this._canvas = canvas;
  77088. this._update()
  77089. },
  77090. suspend: function() {
  77091. ++this._suspended
  77092. },
  77093. resume: function() {
  77094. if (0 === --this._suspended) {
  77095. this._update()
  77096. }
  77097. },
  77098. addItem: function(item) {
  77099. this._items.push(item);
  77100. item.updateLayout = this._updateLayout
  77101. },
  77102. removeItem: function(item) {
  77103. this._items.splice(_inArray(item, this._items), 1);
  77104. item.updateLayout = null
  77105. },
  77106. _update: function() {
  77107. var canvas;
  77108. if (0 === this._suspended) {
  77109. canvas = this._canvas;
  77110. _each(this._items, function(_, item) {
  77111. item.resize(canvas)
  77112. });
  77113. applyLayout({
  77114. left: canvas.left,
  77115. top: canvas.top,
  77116. right: canvas.width + canvas.left,
  77117. bottom: canvas.height + canvas.top
  77118. }, this._items)
  77119. }
  77120. }
  77121. };
  77122. exports.LayoutControl = LayoutControl
  77123. },
  77124. /*!**********************************************************!*\
  77125. !*** ./artifacts/transpiled/viz/vector_map/map_layer.js ***!
  77126. \**********************************************************/
  77127. /*! dynamic exports provided */
  77128. /*! all exports used */
  77129. function(module, exports, __webpack_require__) {
  77130. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  77131. var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  77132. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  77133. var _Number = Number;
  77134. var _String = String;
  77135. var _abs = Math.abs;
  77136. var _round = Math.round;
  77137. var _min = Math.min;
  77138. var _max = Math.max;
  77139. var _sqrt = Math.sqrt;
  77140. var DataHelperMixin = __webpack_require__( /*! ../../data_helper */ 84);
  77141. var _isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
  77142. var _isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  77143. var _isArray = Array.isArray;
  77144. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  77145. var _parseScalar = vizUtils.parseScalar;
  77146. var _patchFontOptions = vizUtils.patchFontOptions;
  77147. var _normalizeEnum = vizUtils.normalizeEnum;
  77148. var _noop = noop;
  77149. var _extend = extend;
  77150. var _each = each;
  77151. var _concat = Array.prototype.concat;
  77152. var TYPE_AREA = "area";
  77153. var TYPE_LINE = "line";
  77154. var TYPE_MARKER = "marker";
  77155. var STATE_DEFAULT = 0;
  77156. var STATE_HOVERED = 1;
  77157. var STATE_SELECTED = 2;
  77158. var STATE_TO_INDEX = [0, 1, 2, 2];
  77159. var TOLERANCE = 1;
  77160. var SELECTIONS = {
  77161. none: null,
  77162. single: -1,
  77163. multiple: NaN
  77164. };
  77165. function getSelection(selectionMode) {
  77166. var selection = _normalizeEnum(selectionMode);
  77167. selection = selection in SELECTIONS ? SELECTIONS[selection] : SELECTIONS.single;
  77168. if (null !== selection) {
  77169. selection = {
  77170. state: {},
  77171. single: selection
  77172. }
  77173. }
  77174. return selection
  77175. }
  77176. function getName(opt, index) {
  77177. return (opt[index] || {}).name
  77178. }
  77179. function EmptySource() {}
  77180. EmptySource.prototype.count = function() {
  77181. return 0
  77182. };
  77183. function ArraySource(raw) {
  77184. this.raw = raw
  77185. }
  77186. ArraySource.prototype = {
  77187. constructor: ArraySource,
  77188. count: function() {
  77189. return this.raw.length
  77190. },
  77191. item: function(index) {
  77192. return this.raw[index]
  77193. },
  77194. geometry: function(item) {
  77195. return {
  77196. coordinates: item.coordinates
  77197. }
  77198. },
  77199. attributes: function(item) {
  77200. return item.attributes
  77201. }
  77202. };
  77203. function GeoJsonSource(raw) {
  77204. this.raw = raw
  77205. }
  77206. GeoJsonSource.prototype = {
  77207. constructor: GeoJsonSource,
  77208. count: function() {
  77209. return this.raw.features.length
  77210. },
  77211. item: function(index) {
  77212. return this.raw.features[index]
  77213. },
  77214. geometry: function(item) {
  77215. return item.geometry
  77216. },
  77217. attributes: function(item) {
  77218. return item.properties
  77219. }
  77220. };
  77221. function isGeoJsonObject(obj) {
  77222. return _isArray(obj.features)
  77223. }
  77224. function unwrapFromDataSource(source) {
  77225. var sourceType;
  77226. if (source) {
  77227. if (isGeoJsonObject(source)) {
  77228. sourceType = GeoJsonSource
  77229. } else {
  77230. if (1 === source.length && source[0] && isGeoJsonObject(source[0])) {
  77231. sourceType = GeoJsonSource;
  77232. source = source[0]
  77233. } else {
  77234. if (_isArray(source)) {
  77235. sourceType = ArraySource
  77236. }
  77237. }
  77238. }
  77239. }
  77240. sourceType = sourceType || EmptySource;
  77241. return new sourceType(source)
  77242. }
  77243. function wrapToDataSource(option) {
  77244. return option ? isGeoJsonObject(option) ? [option] : option : []
  77245. }
  77246. function customizeHandles(proxies, callback, widget) {
  77247. callback.call(widget, proxies)
  77248. }
  77249. function setAreaLabelVisibility(label) {
  77250. label.text.attr({
  77251. visibility: label.size[0] / label.spaceSize[0] < TOLERANCE && label.size[1] / label.spaceSize[1] < TOLERANCE ? null : "hidden"
  77252. })
  77253. }
  77254. function setLineLabelVisibility(label) {
  77255. label.text.attr({
  77256. visibility: label.size[0] / label.spaceSize[0] < TOLERANCE || label.size[1] / label.spaceSize[1] < TOLERANCE ? null : "hidden"
  77257. })
  77258. }
  77259. function getDataValue(proxy, dataField) {
  77260. return proxy.attribute(dataField)
  77261. }
  77262. var TYPE_TO_TYPE_MAP = {
  77263. Point: TYPE_MARKER,
  77264. MultiPoint: TYPE_LINE,
  77265. LineString: TYPE_LINE,
  77266. MultiLineString: TYPE_LINE,
  77267. Polygon: TYPE_AREA,
  77268. MultiPolygon: TYPE_AREA
  77269. };
  77270. function pick(a, b) {
  77271. return void 0 !== a ? a : b
  77272. }
  77273. function guessTypeByData(sample) {
  77274. var type = TYPE_TO_TYPE_MAP[sample.type];
  77275. var coordinates = sample.coordinates;
  77276. if (!type) {
  77277. if ("number" === typeof coordinates[0]) {
  77278. type = TYPE_MARKER
  77279. } else {
  77280. if ("number" === typeof coordinates[0][0]) {
  77281. type = TYPE_LINE
  77282. } else {
  77283. type = TYPE_AREA
  77284. }
  77285. }
  77286. }
  77287. return type
  77288. }
  77289. var selectStrategy = function(options, data) {
  77290. var type = _normalizeEnum(options.type);
  77291. var elementType = _normalizeEnum(options.elementType);
  77292. var strategy = _extend({}, emptyStrategy);
  77293. if (data.count() > 0) {
  77294. var sample = data.geometry(data.item(0));
  77295. type = strategiesByType[type] ? type : guessTypeByData(sample);
  77296. _extend(strategy, strategiesByType[type]);
  77297. strategy.fullType = strategy.type = type;
  77298. if (strategiesByGeometry[type]) {
  77299. _extend(strategy, strategiesByGeometry[type](sample))
  77300. }
  77301. if (strategiesByElementType[type]) {
  77302. elementType = strategiesByElementType[type][elementType] ? elementType : strategiesByElementType[type]._default;
  77303. _extend(strategy, strategiesByElementType[type][elementType]);
  77304. strategy.elementType = elementType;
  77305. strategy.fullType += ":" + elementType
  77306. }
  77307. }
  77308. return strategy
  77309. };
  77310. function applyElementState(figure, styles, state, field) {
  77311. figure[field].attr(styles[field][state])
  77312. }
  77313. var emptyStrategy = {
  77314. setup: _noop,
  77315. reset: _noop,
  77316. arrange: _noop,
  77317. updateGrouping: _noop,
  77318. getDefaultColor: _noop
  77319. };
  77320. var strategiesByType = {};
  77321. strategiesByType[TYPE_AREA] = {
  77322. projectLabel: projectAreaLabel,
  77323. transform: transformPointList,
  77324. transformLabel: transformAreaLabel,
  77325. draw: function(context, figure, data) {
  77326. figure.root = context.renderer.path([], "area").data(context.dataKey, data)
  77327. },
  77328. refresh: _noop,
  77329. getLabelOffset: function(label) {
  77330. setAreaLabelVisibility(label);
  77331. return [0, 0]
  77332. },
  77333. getStyles: function(settings) {
  77334. var color = settings.color || null;
  77335. var borderColor = settings.borderColor || null;
  77336. var borderWidth = pick(settings.borderWidth, null);
  77337. var opacity = pick(settings.opacity, null);
  77338. return {
  77339. root: [{
  77340. "class": "dxm-area",
  77341. stroke: borderColor,
  77342. "stroke-width": borderWidth,
  77343. fill: color,
  77344. opacity: opacity
  77345. }, {
  77346. "class": "dxm-area dxm-area-hovered",
  77347. stroke: settings.hoveredBorderColor || borderColor,
  77348. "stroke-width": pick(settings.hoveredBorderWidth, borderWidth),
  77349. fill: settings.hoveredColor || color,
  77350. opacity: pick(settings.hoveredOpacity, opacity)
  77351. }, {
  77352. "class": "dxm-area dxm-area-selected",
  77353. stroke: settings.selectedBorderColor || borderColor,
  77354. "stroke-width": pick(settings.selectedBorderWidth, borderWidth),
  77355. fill: settings.selectedColor || color,
  77356. opacity: pick(settings.selectedOpacity, opacity)
  77357. }]
  77358. }
  77359. },
  77360. setState: function(figure, styles, state) {
  77361. applyElementState(figure, styles, state, "root")
  77362. },
  77363. hasLabelsGroup: true,
  77364. updateGrouping: function(context) {
  77365. groupByColor(context)
  77366. },
  77367. getDefaultColor: _noop
  77368. };
  77369. strategiesByType[TYPE_LINE] = {
  77370. projectLabel: projectLineLabel,
  77371. transform: transformPointList,
  77372. transformLabel: transformLineLabel,
  77373. draw: function(context, figure, data) {
  77374. figure.root = context.renderer.path([], "line").data(context.dataKey, data)
  77375. },
  77376. refresh: _noop,
  77377. getLabelOffset: function(label) {
  77378. setLineLabelVisibility(label);
  77379. return [0, 0]
  77380. },
  77381. getStyles: function(settings) {
  77382. var color = settings.color || settings.borderColor || null;
  77383. var width = pick(settings.borderWidth, null);
  77384. var opacity = pick(settings.opacity, null);
  77385. return {
  77386. root: [{
  77387. "class": "dxm-line",
  77388. stroke: color,
  77389. "stroke-width": width,
  77390. opacity: opacity
  77391. }, {
  77392. "class": "dxm-line dxm-line-hovered",
  77393. stroke: settings.hoveredColor || settings.hoveredBorderColor || color,
  77394. "stroke-width": pick(settings.hoveredBorderWidth, width),
  77395. opacity: pick(settings.hoveredOpacity, opacity)
  77396. }, {
  77397. "class": "dxm-line dxm-line-selected",
  77398. stroke: settings.selectedColor || settings.selectedBorderColor || color,
  77399. "stroke-width": pick(settings.selectedBorderWidth, width),
  77400. opacity: pick(settings.selectedOpacity, opacity)
  77401. }]
  77402. }
  77403. },
  77404. setState: function(figure, styles, state) {
  77405. applyElementState(figure, styles, state, "root")
  77406. },
  77407. hasLabelsGroup: true,
  77408. updateGrouping: function(context) {
  77409. groupByColor(context)
  77410. },
  77411. getDefaultColor: _noop
  77412. };
  77413. strategiesByType[TYPE_MARKER] = {
  77414. project: projectPoint,
  77415. transform: transformPoint,
  77416. draw: function(context, figure, data) {
  77417. figure.root = context.renderer.g();
  77418. this._draw(context, figure, data)
  77419. },
  77420. refresh: _noop,
  77421. hasLabelsGroup: false,
  77422. getLabelOffset: function(label, settings) {
  77423. return [_round((label.size[0] + _max(settings.size || 0, 0)) / 2) + 2, 0]
  77424. },
  77425. getStyles: function(settings) {
  77426. var styles = {
  77427. root: [{
  77428. "class": "dxm-marker"
  77429. }, {
  77430. "class": "dxm-marker dxm-marker-hovered"
  77431. }, {
  77432. "class": "dxm-marker dxm-marker-selected"
  77433. }]
  77434. };
  77435. this._getStyles(styles, settings);
  77436. return styles
  77437. },
  77438. setState: function(figure, styles, state) {
  77439. applyElementState(figure, styles, state, "root");
  77440. this._setState(figure, styles, state)
  77441. },
  77442. updateGrouping: function(context) {
  77443. groupByColor(context);
  77444. groupBySize(context)
  77445. },
  77446. getDefaultColor: function(ctx, palette) {
  77447. return ctx.params.themeManager.getAccentColor(palette)
  77448. }
  77449. };
  77450. var strategiesByGeometry = {};
  77451. strategiesByGeometry[TYPE_AREA] = function(sample) {
  77452. var coordinates = sample.coordinates;
  77453. return {
  77454. project: coordinates[0] && coordinates[0][0] && coordinates[0][0][0] && "number" === typeof coordinates[0][0][0][0] ? projectMultiPolygon : projectPolygon
  77455. }
  77456. };
  77457. strategiesByGeometry[TYPE_LINE] = function(sample) {
  77458. var coordinates = sample.coordinates;
  77459. return {
  77460. project: coordinates[0] && coordinates[0][0] && "number" === typeof coordinates[0][0][0] ? projectPolygon : projectLineString
  77461. }
  77462. };
  77463. var strategiesByElementType = {};
  77464. strategiesByElementType[TYPE_MARKER] = {
  77465. _default: "dot",
  77466. dot: {
  77467. setup: function(context) {
  77468. context.filter = context.renderer.shadowFilter("-40%", "-40%", "180%", "200%", 0, 1, 1, "#000000", .2)
  77469. },
  77470. reset: function(context) {
  77471. context.filter.dispose();
  77472. context.filter = null
  77473. },
  77474. _draw: function(ctx, figure, data) {
  77475. figure.back = ctx.renderer.circle().sharp().data(ctx.dataKey, data).append(figure.root);
  77476. figure.dot = ctx.renderer.circle().sharp().data(ctx.dataKey, data).append(figure.root)
  77477. },
  77478. refresh: function(ctx, figure, data, proxy, settings) {
  77479. figure.dot.attr({
  77480. filter: settings.shadow ? ctx.filter.id : null
  77481. })
  77482. },
  77483. _getStyles: function(styles, style) {
  77484. var size = style.size > 0 ? _Number(style.size) : 0;
  77485. var hoveredSize = size;
  77486. var selectedSize = size + (style.selectedStep > 0 ? _Number(style.selectedStep) : 0);
  77487. var hoveredBackSize = hoveredSize + (style.backStep > 0 ? _Number(style.backStep) : 0);
  77488. var selectedBackSize = selectedSize + (style.backStep > 0 ? _Number(style.backStep) : 0);
  77489. var color = style.color || null;
  77490. var borderColor = style.borderColor || null;
  77491. var borderWidth = pick(style.borderWidth, null);
  77492. var opacity = pick(style.opacity, null);
  77493. var backColor = style.backColor || null;
  77494. var backOpacity = pick(style.backOpacity, null);
  77495. styles.dot = [{
  77496. r: size / 2,
  77497. stroke: borderColor,
  77498. "stroke-width": borderWidth,
  77499. fill: color,
  77500. opacity: opacity
  77501. }, {
  77502. r: hoveredSize / 2,
  77503. stroke: style.hoveredBorderColor || borderColor,
  77504. "stroke-width": pick(style.hoveredBorderWidth, borderWidth),
  77505. fill: style.hoveredColor || color,
  77506. opacity: pick(style.hoveredOpacity, opacity)
  77507. }, {
  77508. r: selectedSize / 2,
  77509. stroke: style.selectedBorderColor || borderColor,
  77510. "stroke-width": pick(style.selectedBorderWidth, borderWidth),
  77511. fill: style.selectedColor || color,
  77512. opacity: pick(style.selectedOpacity, opacity)
  77513. }];
  77514. styles.back = [{
  77515. r: size / 2,
  77516. stroke: "none",
  77517. "stroke-width": 0,
  77518. fill: backColor,
  77519. opacity: backOpacity
  77520. }, {
  77521. r: hoveredBackSize / 2,
  77522. stroke: "none",
  77523. "stroke-width": 0,
  77524. fill: backColor,
  77525. opacity: backOpacity
  77526. }, {
  77527. r: selectedBackSize / 2,
  77528. stroke: "none",
  77529. "stroke-width": 0,
  77530. fill: backColor,
  77531. opacity: backOpacity
  77532. }]
  77533. },
  77534. _setState: function(figure, styles, state) {
  77535. applyElementState(figure, styles, state, "dot");
  77536. applyElementState(figure, styles, state, "back")
  77537. }
  77538. },
  77539. bubble: {
  77540. _draw: function(ctx, figure, data) {
  77541. figure.bubble = ctx.renderer.circle().sharp().data(ctx.dataKey, data).append(figure.root)
  77542. },
  77543. refresh: function(ctx, figure, data, proxy, settings) {
  77544. figure.bubble.attr({
  77545. r: settings.size / 2
  77546. })
  77547. },
  77548. _getStyles: function(styles, style) {
  77549. var color = style.color || null;
  77550. var borderColor = style.borderColor || null;
  77551. var borderWidth = pick(style.borderWidth, null);
  77552. var opacity = pick(style.opacity, null);
  77553. styles.bubble = [{
  77554. stroke: borderColor,
  77555. "stroke-width": borderWidth,
  77556. fill: color,
  77557. opacity: opacity
  77558. }, {
  77559. stroke: style.hoveredBorderColor || borderColor,
  77560. "stroke-width": pick(style.hoveredBorderWidth, borderWidth),
  77561. fill: style.hoveredColor || style.color,
  77562. opacity: pick(style.hoveredOpacity, opacity)
  77563. }, {
  77564. stroke: style.selectedBorderColor || borderColor,
  77565. "stroke-width": pick(style.selectedBorderWidth, borderWidth),
  77566. fill: style.selectedColor || style.color,
  77567. opacity: pick(style.selectedOpacity, opacity)
  77568. }]
  77569. },
  77570. _setState: function(figure, styles, state) {
  77571. applyElementState(figure, styles, state, "bubble")
  77572. },
  77573. arrange: function(context, handles) {
  77574. var values = [];
  77575. var i;
  77576. var ii = values.length = handles.length;
  77577. var settings = context.settings;
  77578. var dataField = settings.dataField;
  77579. var minSize = settings.minSize > 0 ? _Number(settings.minSize) : 0;
  77580. var maxSize = settings.maxSize > minSize ? _Number(settings.maxSize) : minSize;
  77581. if (settings.sizeGroups) {
  77582. return
  77583. }
  77584. for (i = 0; i < ii; ++i) {
  77585. values[i] = _max(getDataValue(handles[i].proxy, dataField) || 0, 0)
  77586. }
  77587. var minValue = _min.apply(null, values);
  77588. var maxValue = _max.apply(null, values);
  77589. var deltaValue = maxValue - minValue || 1;
  77590. var deltaSize = maxSize - minSize;
  77591. for (i = 0; i < ii; ++i) {
  77592. handles[i]._settings.size = minSize + deltaSize * (values[i] - minValue) / deltaValue
  77593. }
  77594. },
  77595. updateGrouping: function(context) {
  77596. var dataField = context.settings.dataField;
  77597. strategiesByType[TYPE_MARKER].updateGrouping(context);
  77598. groupBySize(context, function(proxy) {
  77599. return getDataValue(proxy, dataField)
  77600. })
  77601. }
  77602. },
  77603. pie: {
  77604. _draw: function(ctx, figure, data) {
  77605. figure.pie = ctx.renderer.g().append(figure.root);
  77606. figure.border = ctx.renderer.circle().sharp().data(ctx.dataKey, data).append(figure.root)
  77607. },
  77608. refresh: function(ctx, figure, data, proxy, settings) {
  77609. var values = getDataValue(proxy, ctx.settings.dataField) || [];
  77610. var colors = settings._colors;
  77611. var sum = 0;
  77612. var pie = figure.pie;
  77613. var renderer = ctx.renderer;
  77614. var dataKey = ctx.dataKey;
  77615. var r = (settings.size > 0 ? _Number(settings.size) : 0) / 2;
  77616. var start = 90;
  77617. var end = start;
  77618. var zeroSum = false;
  77619. sum = values.reduce(function(total, item) {
  77620. return total + (item || 0)
  77621. }, 0);
  77622. if (0 === sum) {
  77623. zeroSum = true;
  77624. sum = 360 / values.length
  77625. }
  77626. values.forEach(function(item, i) {
  77627. start = end;
  77628. end += zeroSum ? sum : (item || 0) / sum * 360;
  77629. renderer.arc(0, 0, 0, r, start, end).attr({
  77630. "stroke-linejoin": "round",
  77631. fill: colors[i]
  77632. }).data(dataKey, data).append(pie)
  77633. });
  77634. figure.border.attr({
  77635. r: r
  77636. })
  77637. },
  77638. _getStyles: function(styles, style) {
  77639. var opacity = pick(style.opacity, null);
  77640. var borderColor = style.borderColor || null;
  77641. var borderWidth = pick(style.borderWidth, null);
  77642. styles.pie = [{
  77643. opacity: opacity
  77644. }, {
  77645. opacity: pick(style.hoveredOpacity, opacity)
  77646. }, {
  77647. opacity: pick(style.selectedOpacity, opacity)
  77648. }];
  77649. styles.border = [{
  77650. stroke: borderColor,
  77651. "stroke-width": borderWidth
  77652. }, {
  77653. stroke: style.hoveredBorderColor || borderColor,
  77654. "stroke-width": pick(style.hoveredBorderWidth, borderWidth)
  77655. }, {
  77656. stroke: style.selectedBorderColor || borderColor,
  77657. "stroke-width": pick(style.selectedBorderWidth, borderWidth)
  77658. }]
  77659. },
  77660. _setState: function(figure, styles, state) {
  77661. applyElementState(figure, styles, state, "pie");
  77662. applyElementState(figure, styles, state, "border")
  77663. },
  77664. arrange: function(context, handles) {
  77665. var i;
  77666. var ii = handles.length;
  77667. var dataField = context.settings.dataField;
  77668. var values;
  77669. var count = 0;
  77670. for (i = 0; i < ii; ++i) {
  77671. values = getDataValue(handles[i].proxy, dataField);
  77672. if (values && values.length > count) {
  77673. count = values.length
  77674. }
  77675. }
  77676. if (count > 0) {
  77677. var palette = context.params.themeManager.createPalette(context.settings.palette, {
  77678. useHighlight: true,
  77679. extensionMode: "alternate"
  77680. });
  77681. values = palette.generateColors(count);
  77682. context.settings._colors = values;
  77683. context.grouping.color = {
  77684. callback: _noop,
  77685. field: "",
  77686. partition: [],
  77687. values: []
  77688. };
  77689. context.params.dataExchanger.set(context.name, "color", {
  77690. partition: [],
  77691. values: values
  77692. })
  77693. }
  77694. }
  77695. },
  77696. image: {
  77697. _draw: function(ctx, figure, data) {
  77698. figure.image = ctx.renderer.image(null, null, null, null, null, "center").attr({
  77699. "pointer-events": "visible"
  77700. }).data(ctx.dataKey, data).append(figure.root)
  77701. },
  77702. refresh: function(ctx, figure, data, proxy) {
  77703. figure.image.attr({
  77704. href: getDataValue(proxy, ctx.settings.dataField)
  77705. })
  77706. },
  77707. _getStyles: function(styles, style) {
  77708. var size = style.size > 0 ? _Number(style.size) : 0;
  77709. var hoveredSize = size + (style.hoveredStep > 0 ? _Number(style.hoveredStep) : 0);
  77710. var selectedSize = size + (style.selectedStep > 0 ? _Number(style.selectedStep) : 0);
  77711. var opacity = pick(style.opacity, null);
  77712. styles.image = [{
  77713. x: -size / 2,
  77714. y: -size / 2,
  77715. width: size,
  77716. height: size,
  77717. opacity: opacity
  77718. }, {
  77719. x: -hoveredSize / 2,
  77720. y: -hoveredSize / 2,
  77721. width: hoveredSize,
  77722. height: hoveredSize,
  77723. opacity: pick(style.hoveredOpacity, opacity)
  77724. }, {
  77725. x: -selectedSize / 2,
  77726. y: -selectedSize / 2,
  77727. width: selectedSize,
  77728. height: selectedSize,
  77729. opacity: pick(style.selectedOpacity, opacity)
  77730. }]
  77731. },
  77732. _setState: function(figure, styles, state) {
  77733. applyElementState(figure, styles, state, "image")
  77734. }
  77735. }
  77736. };
  77737. function projectPoint(projection, coordinates) {
  77738. return projection.project(coordinates)
  77739. }
  77740. function projectPointList(projection, coordinates) {
  77741. var output = [];
  77742. var i;
  77743. var ii = output.length = coordinates.length;
  77744. for (i = 0; i < ii; ++i) {
  77745. output[i] = projection.project(coordinates[i])
  77746. }
  77747. return output
  77748. }
  77749. function projectLineString(projection, coordinates) {
  77750. return [projectPointList(projection, coordinates)]
  77751. }
  77752. function projectPolygon(projection, coordinates) {
  77753. var output = [];
  77754. var i;
  77755. var ii = output.length = coordinates.length;
  77756. for (i = 0; i < ii; ++i) {
  77757. output[i] = projectPointList(projection, coordinates[i])
  77758. }
  77759. return output
  77760. }
  77761. function projectMultiPolygon(projection, coordinates) {
  77762. var output = [];
  77763. var i;
  77764. var ii = output.length = coordinates.length;
  77765. for (i = 0; i < ii; ++i) {
  77766. output[i] = projectPolygon(projection, coordinates[i])
  77767. }
  77768. return _concat.apply([], output)
  77769. }
  77770. function transformPoint(content, projection, coordinates) {
  77771. var data = projection.transform(coordinates);
  77772. content.root.attr({
  77773. translateX: data[0],
  77774. translateY: data[1]
  77775. })
  77776. }
  77777. function transformList(projection, coordinates) {
  77778. var output = [];
  77779. var i;
  77780. var ii = coordinates.length;
  77781. var k = 0;
  77782. output.length = 2 * ii;
  77783. for (i = 0; i < ii; ++i) {
  77784. var item = projection.transform(coordinates[i]);
  77785. output[k++] = item[0];
  77786. output[k++] = item[1]
  77787. }
  77788. return output
  77789. }
  77790. function transformPointList(content, projection, coordinates) {
  77791. var output = [];
  77792. var i;
  77793. var ii = output.length = coordinates.length;
  77794. for (i = 0; i < ii; ++i) {
  77795. output[i] = transformList(projection, coordinates[i])
  77796. }
  77797. content.root.attr({
  77798. points: output
  77799. })
  77800. }
  77801. function transformAreaLabel(label, projection, coordinates) {
  77802. var data = projection.transform(coordinates[0]);
  77803. label.spaceSize = projection.getSquareSize(coordinates[1]);
  77804. label.text.attr({
  77805. translateX: data[0],
  77806. translateY: data[1]
  77807. });
  77808. setAreaLabelVisibility(label)
  77809. }
  77810. function transformLineLabel(label, projection, coordinates) {
  77811. var data = projection.transform(coordinates[0]);
  77812. label.spaceSize = projection.getSquareSize(coordinates[1]);
  77813. label.text.attr({
  77814. translateX: data[0],
  77815. translateY: data[1]
  77816. });
  77817. setLineLabelVisibility(label)
  77818. }
  77819. function getItemSettings(context, proxy, settings) {
  77820. var result = combineSettings(context.settings, settings);
  77821. applyGrouping(context.grouping, proxy, result);
  77822. if (void 0 === settings.color && settings.paletteIndex >= 0) {
  77823. result.color = result._colors[settings.paletteIndex]
  77824. }
  77825. return result
  77826. }
  77827. function applyGrouping(grouping, proxy, settings) {
  77828. _each(grouping, function(name, data) {
  77829. var index = findGroupingIndex(data.callback(proxy, data.field), data.partition);
  77830. if (index >= 0) {
  77831. settings[name] = data.values[index]
  77832. }
  77833. })
  77834. }
  77835. function findGroupingIndex(value, partition) {
  77836. var start = 0;
  77837. var end = partition.length - 1;
  77838. var index = -1;
  77839. if (partition[start] <= value && value <= partition[end]) {
  77840. if (value === partition[end]) {
  77841. index = end - 1
  77842. } else {
  77843. while (end - start > 1) {
  77844. var middle = start + end >> 1;
  77845. if (value < partition[middle]) {
  77846. end = middle
  77847. } else {
  77848. start = middle
  77849. }
  77850. }
  77851. index = start
  77852. }
  77853. }
  77854. return index
  77855. }
  77856. function raiseChanged(context, handle, state, name) {
  77857. context.params.eventTrigger(name, {
  77858. target: handle.proxy,
  77859. state: state
  77860. })
  77861. }
  77862. function combineSettings(common, partial) {
  77863. var obj = _extend({}, common, partial);
  77864. obj.label = _extend({}, common.label, obj.label);
  77865. obj.label.font = _extend({}, common.label.font, obj.label.font);
  77866. return obj
  77867. }
  77868. function processCommonSettings(context, options) {
  77869. var themeManager = context.params.themeManager;
  77870. var strategy = context.str;
  77871. var settings = combineSettings(_extend({
  77872. label: {},
  77873. color: strategy.getDefaultColor(context, options.palette)
  77874. }, themeManager.theme("layer:" + strategy.fullType)), options);
  77875. var colors;
  77876. var i;
  77877. if (settings.paletteSize > 0) {
  77878. var palette = themeManager.createDiscretePalette(settings.palette, settings.paletteSize);
  77879. for (i = 0, colors = []; i < settings.paletteSize; ++i) {
  77880. colors.push(palette.getColor(i))
  77881. }
  77882. settings._colors = colors
  77883. }
  77884. return settings
  77885. }
  77886. function valueCallback(proxy, dataField) {
  77887. return proxy.attribute(dataField)
  77888. }
  77889. var performGrouping = function(context, partition, settingField, dataField, valuesCallback) {
  77890. if (dataField && partition && partition.length > 1) {
  77891. var values = valuesCallback(partition.length - 1);
  77892. context.grouping[settingField] = {
  77893. callback: _isFunction(dataField) ? dataField : valueCallback,
  77894. field: dataField,
  77895. partition: partition,
  77896. values: values
  77897. };
  77898. context.params.dataExchanger.set(context.name, settingField, {
  77899. partition: partition,
  77900. values: values,
  77901. defaultColor: context.settings.color
  77902. })
  77903. }
  77904. };
  77905. function dropGrouping(context) {
  77906. var name = context.name;
  77907. var dataExchanger = context.params.dataExchanger;
  77908. _each(context.grouping, function(field) {
  77909. dataExchanger.set(name, field, null)
  77910. });
  77911. context.grouping = {}
  77912. }
  77913. var groupByColor = function(context) {
  77914. performGrouping(context, context.settings.colorGroups, "color", context.settings.colorGroupingField, function(count) {
  77915. var _palette = context.params.themeManager.createDiscretePalette(context.settings.palette, count);
  77916. var list = [];
  77917. for (var i = 0; i < count; ++i) {
  77918. list.push(_palette.getColor(i))
  77919. }
  77920. return list
  77921. })
  77922. };
  77923. var groupBySize = function(context, valueCallback) {
  77924. var settings = context.settings;
  77925. performGrouping(context, settings.sizeGroups, "size", valueCallback || settings.sizeGroupingField, function(count) {
  77926. var minSize = settings.minSize > 0 ? _Number(settings.minSize) : 0;
  77927. var maxSize = settings.maxSize >= minSize ? _Number(settings.maxSize) : 0;
  77928. var i = 0;
  77929. var sizes = [];
  77930. if (count > 1) {
  77931. for (i = 0; i < count; ++i) {
  77932. sizes.push((minSize * (count - i - 1) + maxSize * i) / (count - 1))
  77933. }
  77934. } else {
  77935. if (1 === count) {
  77936. sizes.push((minSize + maxSize) / 2)
  77937. }
  77938. }
  77939. return sizes
  77940. })
  77941. };
  77942. function setFlag(flags, flag, state) {
  77943. if (state) {
  77944. flags |= flag
  77945. } else {
  77946. flags &= ~flag
  77947. }
  77948. return flags
  77949. }
  77950. function hasFlag(flags, flag) {
  77951. return !!(flags & flag)
  77952. }
  77953. function createLayerProxy(layer, name, index) {
  77954. var proxy = {
  77955. index: index,
  77956. name: name,
  77957. getElements: function() {
  77958. return layer.getProxies()
  77959. },
  77960. clearSelection: function(_noEvent) {
  77961. layer.clearSelection(_noEvent);
  77962. return proxy
  77963. },
  77964. getDataSource: function() {
  77965. return layer.getDataSource()
  77966. }
  77967. };
  77968. return proxy
  77969. }
  77970. var MapLayer = function(params, container, name, index) {
  77971. var that = this;
  77972. that._params = params;
  77973. that._onProjection();
  77974. that.proxy = createLayerProxy(that, name, index);
  77975. that._context = {
  77976. name: name,
  77977. layer: that.proxy,
  77978. renderer: params.renderer,
  77979. projection: params.projection,
  77980. params: params,
  77981. dataKey: params.dataKey,
  77982. str: emptyStrategy,
  77983. hover: false,
  77984. selection: null,
  77985. grouping: {},
  77986. root: params.renderer.g().attr({
  77987. "class": "dxm-layer"
  77988. }).linkOn(container, name).linkAppend()
  77989. };
  77990. that._container = container;
  77991. that._options = {};
  77992. that._handles = [];
  77993. that._data = new EmptySource
  77994. };
  77995. MapLayer.prototype = _extend({
  77996. constructor: MapLayer,
  77997. _onProjection: function() {
  77998. var that = this;
  77999. that._removeHandlers = that._params.projection.on({
  78000. engine: function() {
  78001. that._project()
  78002. },
  78003. screen: function() {
  78004. that._transform()
  78005. },
  78006. center: function() {
  78007. that._transformCore()
  78008. },
  78009. zoom: function() {
  78010. that._transform()
  78011. }
  78012. })
  78013. },
  78014. _dataSourceLoadErrorHandler: function() {
  78015. this._dataSourceChangedHandler()
  78016. },
  78017. _dataSourceChangedHandler: function() {
  78018. var that = this;
  78019. that._data = unwrapFromDataSource(that._dataSource && that._dataSource.items());
  78020. that._update(true)
  78021. },
  78022. _dataSourceOptions: function() {
  78023. return {
  78024. paginate: false
  78025. }
  78026. },
  78027. _getSpecificDataSourceOption: function() {
  78028. return this._specificDataSourceOption
  78029. },
  78030. _offProjection: function() {
  78031. this._removeHandlers();
  78032. this._removeHandlers = null
  78033. },
  78034. dispose: function() {
  78035. var that = this;
  78036. that._disposeDataSource();
  78037. that._destroyHandles();
  78038. dropGrouping(that._context);
  78039. that._context.root.linkRemove().linkOff();
  78040. that._context.labelRoot && that._context.labelRoot.linkRemove().linkOff();
  78041. that._context.str.reset(that._context);
  78042. that._offProjection();
  78043. that._params = that._container = that._context = that.proxy = null;
  78044. return that
  78045. },
  78046. TESTS_getContext: function() {
  78047. return this._context
  78048. },
  78049. setOptions: function(options) {
  78050. var that = this;
  78051. options = that._options = options || {};
  78052. if ("dataSource" in options && options.dataSource !== that._options_dataSource) {
  78053. that._options_dataSource = options.dataSource;
  78054. that._params.notifyDirty();
  78055. that._specificDataSourceOption = wrapToDataSource(options.dataSource);
  78056. that._refreshDataSource()
  78057. } else {
  78058. if (that._data.count() > 0) {
  78059. that._params.notifyDirty();
  78060. that._update(void 0 !== options.type && options.type !== that._context.str.type || void 0 !== options.elementType && options.elementType !== that._context.str.elementType)
  78061. }
  78062. }
  78063. that._transformCore()
  78064. },
  78065. _update: function(isContextChanged) {
  78066. var that = this;
  78067. var context = that._context;
  78068. if (isContextChanged) {
  78069. context.str.reset(context);
  78070. context.root.clear();
  78071. context.labelRoot && context.labelRoot.clear();
  78072. that._params.tracker.reset();
  78073. that._destroyHandles();
  78074. context.str = selectStrategy(that._options, that._data);
  78075. context.str.setup(context);
  78076. that.proxy.type = context.str.type;
  78077. that.proxy.elementType = context.str.elementType
  78078. }
  78079. context.settings = processCommonSettings(context, that._options);
  78080. context.hasSeparateLabel = !!(context.settings.label.enabled && context.str.hasLabelsGroup);
  78081. context.hover = !!_parseScalar(context.settings.hoverEnabled, true);
  78082. if (context.selection) {
  78083. _each(context.selection.state, function(_, handle) {
  78084. handle && handle.resetSelected()
  78085. })
  78086. }
  78087. context.selection = getSelection(context.settings.selectionMode);
  78088. if (context.hasSeparateLabel) {
  78089. if (!context.labelRoot) {
  78090. context.labelRoot = context.renderer.g().attr({
  78091. "class": "dxm-layer-labels"
  78092. }).linkOn(that._container, {
  78093. name: context.name + "-labels",
  78094. after: context.name
  78095. }).linkAppend();
  78096. that._transformCore()
  78097. }
  78098. } else {
  78099. if (context.labelRoot) {
  78100. context.labelRoot.linkRemove().linkOff();
  78101. context.labelRoot = null
  78102. }
  78103. }
  78104. if (isContextChanged) {
  78105. that._createHandles()
  78106. }
  78107. dropGrouping(context);
  78108. context.str.arrange(context, that._handles);
  78109. context.str.updateGrouping(context);
  78110. that._updateHandles();
  78111. that._params.notifyReady()
  78112. },
  78113. _destroyHandles: function() {
  78114. var handles = this._handles;
  78115. var i;
  78116. var ii = handles.length;
  78117. for (i = 0; i < ii; ++i) {
  78118. handles[i].dispose()
  78119. }
  78120. if (this._context.selection) {
  78121. this._context.selection.state = {}
  78122. }
  78123. this._handles = []
  78124. },
  78125. _createHandles: function() {
  78126. var that = this;
  78127. var handles = that._handles = [];
  78128. var data = that._data;
  78129. var i;
  78130. var ii = handles.length = data.count();
  78131. var context = that._context;
  78132. var geometry = data.geometry;
  78133. var attributes = data.attributes;
  78134. var handle;
  78135. for (i = 0; i < ii; ++i) {
  78136. var dataItem = data.item(i);
  78137. handles[i] = new MapLayerElement(context, i, geometry(dataItem), attributes(dataItem))
  78138. }
  78139. _isFunction(that._options.customize) && customizeHandles(that.getProxies(), that._options.customize, that._params.widget);
  78140. for (i = 0; i < ii; ++i) {
  78141. handle = handles[i];
  78142. handle.project();
  78143. handle.draw();
  78144. handle.transform()
  78145. }
  78146. if (context.selection) {
  78147. _each(context.selection.state, function(_, handle) {
  78148. handle && handle.restoreSelected()
  78149. })
  78150. }
  78151. },
  78152. _updateHandles: function() {
  78153. var handles = this._handles;
  78154. var i;
  78155. var ii = handles.length;
  78156. for (i = 0; i < ii; ++i) {
  78157. handles[i].refresh()
  78158. }
  78159. if (this._context.settings.label.enabled) {
  78160. for (i = 0; i < ii; ++i) {
  78161. handles[i].measureLabel()
  78162. }
  78163. for (i = 0; i < ii; ++i) {
  78164. handles[i].adjustLabel()
  78165. }
  78166. }
  78167. },
  78168. _transformCore: function() {
  78169. var transform = this._params.projection.getTransform();
  78170. this._context.root.attr(transform);
  78171. this._context.labelRoot && this._context.labelRoot.attr(transform)
  78172. },
  78173. _project: function() {
  78174. var handles = this._handles;
  78175. var i;
  78176. var ii = handles.length;
  78177. for (i = 0; i < ii; ++i) {
  78178. handles[i].project()
  78179. }
  78180. },
  78181. _transform: function() {
  78182. var handles = this._handles;
  78183. var i;
  78184. var ii = handles.length;
  78185. this._transformCore();
  78186. for (i = 0; i < ii; ++i) {
  78187. handles[i].transform()
  78188. }
  78189. },
  78190. getProxies: function() {
  78191. var handles = this._handles;
  78192. var proxies = [];
  78193. var i;
  78194. var ii = proxies.length = handles.length;
  78195. for (i = 0; i < ii; ++i) {
  78196. proxies[i] = handles[i].proxy
  78197. }
  78198. return proxies
  78199. },
  78200. getProxy: function(index) {
  78201. return this._handles[index].proxy
  78202. },
  78203. raiseClick: function(i, dxEvent) {
  78204. this._params.eventTrigger("click", {
  78205. target: this._handles[i].proxy,
  78206. event: dxEvent
  78207. })
  78208. },
  78209. hoverItem: function(i, state) {
  78210. this._handles[i].setHovered(state)
  78211. },
  78212. selectItem: function(i, state, _noEvent) {
  78213. this._handles[i].setSelected(state, _noEvent)
  78214. },
  78215. clearSelection: function() {
  78216. var selection = this._context.selection;
  78217. if (selection) {
  78218. _each(selection.state, function(_, handle) {
  78219. handle && handle.setSelected(false)
  78220. });
  78221. selection.state = {}
  78222. }
  78223. }
  78224. }, DataHelperMixin);
  78225. function createProxy(handle, coords, attrs) {
  78226. var proxy = {
  78227. coordinates: function() {
  78228. return coords
  78229. },
  78230. attribute: function(name, value) {
  78231. if (arguments.length > 1) {
  78232. attrs[name] = value;
  78233. return proxy
  78234. } else {
  78235. return arguments.length > 0 ? attrs[name] : attrs
  78236. }
  78237. },
  78238. selected: function(state, _noEvent) {
  78239. if (arguments.length > 0) {
  78240. handle.setSelected(state, _noEvent);
  78241. return proxy
  78242. } else {
  78243. return handle.isSelected()
  78244. }
  78245. },
  78246. applySettings: function(settings) {
  78247. handle.update(settings);
  78248. return proxy
  78249. }
  78250. };
  78251. return proxy
  78252. }
  78253. var MapLayerElement = function(context, index, geometry, attributes) {
  78254. var that = this;
  78255. var proxy = that.proxy = createProxy(that, geometry.coordinates, _extend({}, attributes));
  78256. that._ctx = context;
  78257. that._index = index;
  78258. that._fig = that._label = null;
  78259. that._state = STATE_DEFAULT;
  78260. that._coordinates = geometry.coordinates;
  78261. that._settings = {
  78262. label: {}
  78263. };
  78264. proxy.index = index;
  78265. proxy.layer = context.layer;
  78266. that._data = {
  78267. name: context.name,
  78268. index: index
  78269. }
  78270. };
  78271. MapLayerElement.prototype = {
  78272. constructor: MapLayerElement,
  78273. dispose: function() {
  78274. var that = this;
  78275. that._ctx = that.proxy = that._settings = that._fig = that._label = that.data = null;
  78276. return that
  78277. },
  78278. project: function() {
  78279. var context = this._ctx;
  78280. this._projection = context.str.project(context.projection, this._coordinates);
  78281. if (context.hasSeparateLabel && this._label) {
  78282. this._projectLabel()
  78283. }
  78284. },
  78285. _projectLabel: function() {
  78286. this._labelProjection = this._ctx.str.projectLabel(this._projection)
  78287. },
  78288. draw: function() {
  78289. var that = this;
  78290. var context = this._ctx;
  78291. context.str.draw(context, that._fig = {}, that._data);
  78292. that._fig.root.append(context.root)
  78293. },
  78294. transform: function() {
  78295. var that = this;
  78296. var context = that._ctx;
  78297. context.str.transform(that._fig, context.projection, that._projection);
  78298. if (context.hasSeparateLabel && that._label) {
  78299. that._transformLabel()
  78300. }
  78301. },
  78302. _transformLabel: function() {
  78303. this._ctx.str.transformLabel(this._label, this._ctx.projection, this._labelProjection)
  78304. },
  78305. refresh: function() {
  78306. var that = this;
  78307. var strategy = that._ctx.str;
  78308. var settings = getItemSettings(that._ctx, that.proxy, that._settings);
  78309. that._styles = strategy.getStyles(settings);
  78310. strategy.refresh(that._ctx, that._fig, that._data, that.proxy, settings);
  78311. that._refreshLabel(settings);
  78312. that._setState()
  78313. },
  78314. _refreshLabel: function(settings) {
  78315. var that = this;
  78316. var context = that._ctx;
  78317. var labelSettings = settings.label;
  78318. var label = that._label;
  78319. if (context.settings.label.enabled) {
  78320. if (!label) {
  78321. label = that._label = {
  78322. root: context.labelRoot || that._fig.root,
  78323. text: context.renderer.text().attr({
  78324. "class": "dxm-label"
  78325. }),
  78326. size: [0, 0]
  78327. };
  78328. if (context.hasSeparateLabel) {
  78329. that._projectLabel();
  78330. that._transformLabel()
  78331. }
  78332. }
  78333. label.value = _String(that.proxy.text || that.proxy.attribute(labelSettings.dataField) || "");
  78334. if (label.value) {
  78335. label.text.attr({
  78336. text: label.value,
  78337. x: 0,
  78338. y: 0
  78339. }).css(_patchFontOptions(labelSettings.font)).attr({
  78340. align: "center",
  78341. stroke: labelSettings.stroke,
  78342. "stroke-width": labelSettings["stroke-width"],
  78343. "stroke-opacity": labelSettings["stroke-opacity"]
  78344. }).data(context.dataKey, that._data).append(label.root);
  78345. label.settings = settings
  78346. }
  78347. } else {
  78348. if (label) {
  78349. label.text.remove();
  78350. that._label = null
  78351. }
  78352. }
  78353. },
  78354. measureLabel: function() {
  78355. var label = this._label;
  78356. if (label.value) {
  78357. var bBox = label.text.getBBox();
  78358. label.size = [bBox.width, bBox.height, -bBox.y - bBox.height / 2]
  78359. }
  78360. },
  78361. adjustLabel: function() {
  78362. var label = this._label;
  78363. if (label.value) {
  78364. var offset = this._ctx.str.getLabelOffset(label, label.settings);
  78365. label.settings = null;
  78366. label.text.attr({
  78367. x: offset[0],
  78368. y: offset[1] + label.size[2]
  78369. })
  78370. }
  78371. },
  78372. update: function(settings) {
  78373. var that = this;
  78374. that._settings = combineSettings(that._settings, settings);
  78375. if (that._fig) {
  78376. that.refresh();
  78377. if (that._label && that._label.value) {
  78378. that.measureLabel();
  78379. that.adjustLabel()
  78380. }
  78381. }
  78382. },
  78383. _setState: function() {
  78384. this._ctx.str.setState(this._fig, this._styles, STATE_TO_INDEX[this._state])
  78385. },
  78386. _setForeground: function() {
  78387. var root = this._fig.root;
  78388. this._state ? root.toForeground() : root.toBackground()
  78389. },
  78390. setHovered: function(state) {
  78391. var that = this;
  78392. var currentState = hasFlag(that._state, STATE_HOVERED);
  78393. var newState = !!state;
  78394. if (that._ctx.hover && currentState !== newState) {
  78395. that._state = setFlag(that._state, STATE_HOVERED, newState);
  78396. that._setState();
  78397. that._setForeground();
  78398. raiseChanged(that._ctx, that, newState, "hoverChanged")
  78399. }
  78400. return that
  78401. },
  78402. setSelected: function(state, _noEvent) {
  78403. var that = this;
  78404. var currentState = hasFlag(that._state, STATE_SELECTED);
  78405. var newState = !!state;
  78406. var selection = that._ctx.selection;
  78407. if (selection && currentState !== newState) {
  78408. that._state = setFlag(that._state, STATE_SELECTED, newState);
  78409. var tmp = selection.state[selection.single];
  78410. selection.state[selection.single] = null;
  78411. if (tmp) {
  78412. tmp.setSelected(false)
  78413. }
  78414. selection.state[selection.single || that._index] = state ? that : null;
  78415. if (that._fig) {
  78416. that._setState();
  78417. that._setForeground();
  78418. if (!_noEvent) {
  78419. raiseChanged(that._ctx, that, newState, "selectionChanged")
  78420. }
  78421. }
  78422. }
  78423. },
  78424. isSelected: function() {
  78425. return hasFlag(this._state, STATE_SELECTED)
  78426. },
  78427. resetSelected: function() {
  78428. this._state = setFlag(this._state, STATE_SELECTED, false)
  78429. },
  78430. restoreSelected: function() {
  78431. this._fig.root.toForeground()
  78432. }
  78433. };
  78434. function calculatePolygonCentroid(coordinates) {
  78435. var length = coordinates.length;
  78436. var v2 = coordinates[length - 1];
  78437. var cx = 0;
  78438. var cy = 0;
  78439. var area = 0;
  78440. var minX = 1 / 0;
  78441. var maxX = -(1 / 0);
  78442. var minY = 1 / 0;
  78443. var maxY = -(1 / 0);
  78444. for (var i = 0; i < length; ++i) {
  78445. var v1 = v2;
  78446. v2 = coordinates[i];
  78447. var cross = v1[0] * v2[1] - v2[0] * v1[1];
  78448. area += cross;
  78449. cx += (v1[0] + v2[0]) * cross;
  78450. cy += (v1[1] + v2[1]) * cross;
  78451. minX = _min(minX, v2[0]);
  78452. maxX = _max(maxX, v2[0]);
  78453. minY = _min(minY, v2[1]);
  78454. maxY = _max(maxY, v2[1])
  78455. }
  78456. return {
  78457. area: _abs(area) / 2,
  78458. center: [2 * cx / 3 / area - (minX + maxX) / 2, 2 * cy / 3 / area - (minY + maxY) / 2]
  78459. }
  78460. }
  78461. function calculateLineStringData(coordinates) {
  78462. var i;
  78463. var ii = coordinates.length;
  78464. var v1;
  78465. var v2 = coordinates[0] || [];
  78466. var totalLength = 0;
  78467. var items = [0];
  78468. var min0 = v2[0];
  78469. var max0 = v2[0];
  78470. var min1 = v2[1];
  78471. var max1 = v2[1];
  78472. for (i = 1; i < ii; ++i) {
  78473. v1 = v2;
  78474. v2 = coordinates[i];
  78475. totalLength += _sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));
  78476. items[i] = totalLength;
  78477. min0 = _min(min0, v2[0]);
  78478. max0 = _max(max0, v2[0]);
  78479. min1 = _min(min1, v2[1]);
  78480. max1 = _max(max1, v2[1])
  78481. }
  78482. i = findGroupingIndex(totalLength / 2, items);
  78483. v1 = coordinates[i];
  78484. v2 = coordinates[i + 1];
  78485. var t = (totalLength / 2 - items[i]) / (items[i + 1] - items[i]);
  78486. return ii ? [
  78487. [v1[0] * (1 - t) + v2[0] * t, v1[1] * (1 - t) + v2[1] * t],
  78488. [max0 - min0, max1 - min1], totalLength
  78489. ] : []
  78490. }
  78491. function projectAreaLabel(coordinates) {
  78492. var i;
  78493. var ii = coordinates.length;
  78494. var resultCentroid;
  78495. var maxArea = 0;
  78496. for (i = 0; i < ii; ++i) {
  78497. var centroid = calculatePolygonCentroid(coordinates[i]);
  78498. if (centroid.area > maxArea) {
  78499. maxArea = centroid.area;
  78500. resultCentroid = centroid
  78501. }
  78502. }
  78503. return resultCentroid ? [resultCentroid.center, [_sqrt(resultCentroid.area), _sqrt(resultCentroid.area)]] : [
  78504. [],
  78505. []
  78506. ]
  78507. }
  78508. function projectLineLabel(coordinates) {
  78509. var i;
  78510. var ii = coordinates.length;
  78511. var maxLength = 0;
  78512. var resultData;
  78513. for (i = 0; i < ii; ++i) {
  78514. var data = calculateLineStringData(coordinates[i]);
  78515. if (data[2] > maxLength) {
  78516. maxLength = data[2];
  78517. resultData = data
  78518. }
  78519. }
  78520. return resultData || [
  78521. [],
  78522. []
  78523. ]
  78524. }
  78525. function MapLayerCollection(params) {
  78526. var that = this;
  78527. var renderer = params.renderer;
  78528. that._params = params;
  78529. that._layers = [];
  78530. that._layerByName = {};
  78531. that._rect = [0, 0, 0, 0];
  78532. that._clip = renderer.clipRect();
  78533. that._background = renderer.rect().attr({
  78534. "class": "dxm-background"
  78535. }).data(params.dataKey, {
  78536. name: "background"
  78537. }).append(renderer.root);
  78538. that._container = renderer.g().attr({
  78539. "class": "dxm-layers",
  78540. "clip-path": that._clip.id
  78541. }).append(renderer.root).enableLinks();
  78542. that._subscribeToTracker(params.tracker, renderer, params.eventTrigger)
  78543. }
  78544. MapLayerCollection.prototype = {
  78545. constructor: MapLayerCollection,
  78546. dispose: function() {
  78547. var that = this;
  78548. that._clip.dispose();
  78549. that._layers.forEach(function(l) {
  78550. return l.dispose()
  78551. });
  78552. that._offTracker();
  78553. that._params = that._offTracker = that._layers = that._layerByName = that._clip = that._background = that._container = null
  78554. },
  78555. _subscribeToTracker: function(tracker, renderer, eventTrigger) {
  78556. var that = this;
  78557. that._offTracker = tracker.on({
  78558. click: function(arg) {
  78559. var offset = renderer.getRootOffset();
  78560. var layer = that.byName(arg.data.name);
  78561. arg.$event.x = arg.x - offset.left;
  78562. arg.$event.y = arg.y - offset.top;
  78563. if (layer) {
  78564. layer.raiseClick(arg.data.index, arg.$event)
  78565. } else {
  78566. if ("background" === arg.data.name) {
  78567. eventTrigger("click", {
  78568. event: arg.$event
  78569. })
  78570. }
  78571. }
  78572. },
  78573. "hover-on": function(arg) {
  78574. var layer = that.byName(arg.data.name);
  78575. if (layer) {
  78576. layer.hoverItem(arg.data.index, true)
  78577. }
  78578. },
  78579. "hover-off": function(arg) {
  78580. var layer = that.byName(arg.data.name);
  78581. if (layer) {
  78582. layer.hoverItem(arg.data.index, false)
  78583. }
  78584. }
  78585. })
  78586. },
  78587. setOptions: function(options) {
  78588. var that = this;
  78589. var optionList = options ? _isArray(options) ? options : [options] : [];
  78590. var layerByName = that._layerByName;
  78591. var layers = that._layers;
  78592. var needToCreateLayers = optionList.length !== layers.length || layers.some(function(l, i) {
  78593. var name = getName(optionList, i);
  78594. return _isDefined(name) && name !== l.proxy.name
  78595. });
  78596. if (needToCreateLayers) {
  78597. that._params.tracker.reset();
  78598. that._layers.forEach(function(l) {
  78599. return l.dispose()
  78600. });
  78601. that._layerByName = layerByName = {};
  78602. that._layers = layers = [];
  78603. for (var i = 0, ii = optionList.length; i < ii; ++i) {
  78604. var name = getName(optionList, i) || "map-layer-" + i;
  78605. var layer = layers[i] = new MapLayer(that._params, that._container, name, i);
  78606. layerByName[name] = layer
  78607. }
  78608. }
  78609. layers.forEach(function(l, i) {
  78610. l.setOptions(optionList[i])
  78611. })
  78612. },
  78613. _updateClip: function() {
  78614. var rect = this._rect;
  78615. var bw = this._borderWidth;
  78616. this._clip.attr({
  78617. x: rect[0] + bw,
  78618. y: rect[1] + bw,
  78619. width: _max(rect[2] - 2 * bw, 0),
  78620. height: _max(rect[3] - 2 * bw, 0)
  78621. })
  78622. },
  78623. setBackgroundOptions: function(options) {
  78624. this._background.attr({
  78625. stroke: options.borderColor,
  78626. "stroke-width": options.borderWidth,
  78627. fill: options.color
  78628. });
  78629. this._borderWidth = _max(options.borderWidth, 0);
  78630. this._updateClip()
  78631. },
  78632. setRect: function(rect) {
  78633. this._rect = rect;
  78634. this._background.attr({
  78635. x: rect[0],
  78636. y: rect[1],
  78637. width: rect[2],
  78638. height: rect[3]
  78639. });
  78640. this._updateClip()
  78641. },
  78642. byIndex: function(index) {
  78643. return this._layers[index]
  78644. },
  78645. byName: function(name) {
  78646. return this._layerByName[name]
  78647. },
  78648. items: function() {
  78649. return this._layers
  78650. }
  78651. };
  78652. exports.MapLayerCollection = MapLayerCollection;
  78653. exports._TESTS_MapLayer = MapLayer;
  78654. exports._TESTS_stub_MapLayer = function(stub) {
  78655. MapLayer = stub
  78656. };
  78657. exports._TESTS_selectStrategy = selectStrategy;
  78658. exports._TESTS_stub_selectStrategy = function(stub) {
  78659. selectStrategy = stub
  78660. };
  78661. exports._TESTS_MapLayerElement = MapLayerElement;
  78662. exports._TESTS_stub_MapLayerElement = function(stub) {
  78663. MapLayerElement = stub
  78664. };
  78665. exports._TESTS_createProxy = createProxy;
  78666. exports._TESTS_stub_performGrouping = function(stub) {
  78667. performGrouping = stub
  78668. };
  78669. exports._TESTS_performGrouping = performGrouping;
  78670. exports._TESTS_stub_groupByColor = function(stub) {
  78671. groupByColor = stub
  78672. };
  78673. exports._TESTS_groupByColor = groupByColor;
  78674. exports._TESTS_stub_groupBySize = function(stub) {
  78675. groupBySize = stub
  78676. };
  78677. exports._TESTS_groupBySize = groupBySize;
  78678. exports._TESTS_findGroupingIndex = findGroupingIndex
  78679. },
  78680. /*!***************************************************************!*\
  78681. !*** ./artifacts/transpiled/viz/vector_map/tooltip_viewer.js ***!
  78682. \***************************************************************/
  78683. /*! dynamic exports provided */
  78684. /*! all exports used */
  78685. function(module, exports, __webpack_require__) {
  78686. var TOOLTIP_OFFSET = 12;
  78687. function TooltipViewer(params) {
  78688. this._subscribeToTracker(params.tracker, params.tooltip, params.layerCollection)
  78689. }
  78690. TooltipViewer.prototype = {
  78691. constructor: TooltipViewer,
  78692. dispose: function() {
  78693. this._offTracker();
  78694. this._offTracker = null
  78695. },
  78696. _subscribeToTracker: function(tracker, tooltip, layerCollection) {
  78697. this._offTracker = tracker.on({
  78698. "focus-on": function(arg) {
  78699. var result = false;
  78700. var layer;
  78701. var proxy;
  78702. if (tooltip.isEnabled()) {
  78703. layer = layerCollection.byName(arg.data.name);
  78704. proxy = layer && layer.getProxy(arg.data.index);
  78705. if (proxy && tooltip.show(proxy, {
  78706. x: 0,
  78707. y: 0,
  78708. offset: 0
  78709. }, {
  78710. target: proxy
  78711. })) {
  78712. tooltip.move(arg.x, arg.y, TOOLTIP_OFFSET);
  78713. result = true
  78714. }
  78715. }
  78716. arg.done(result)
  78717. },
  78718. "focus-move": function(arg) {
  78719. tooltip.move(arg.x, arg.y, TOOLTIP_OFFSET)
  78720. },
  78721. "focus-off": function() {
  78722. tooltip.hide()
  78723. }
  78724. })
  78725. }
  78726. };
  78727. exports.TooltipViewer = TooltipViewer
  78728. },
  78729. /*!***********************************************!*\
  78730. !*** ./artifacts/transpiled/viz/sparkline.js ***!
  78731. \***********************************************/
  78732. /*! dynamic exports provided */
  78733. /*! all exports used */
  78734. function(module, exports, __webpack_require__) {
  78735. module.exports = __webpack_require__( /*! ./sparklines/sparkline */ 822)
  78736. },
  78737. /*!**********************************************************!*\
  78738. !*** ./artifacts/transpiled/viz/sparklines/sparkline.js ***!
  78739. \**********************************************************/
  78740. /*! dynamic exports provided */
  78741. /*! all exports used */
  78742. function(module, exports, __webpack_require__) {
  78743. var BaseSparkline = __webpack_require__( /*! ./base_sparkline */ 418);
  78744. var dataValidatorModule = __webpack_require__( /*! ../components/data_validator */ 243);
  78745. var seriesModule = __webpack_require__( /*! ../series/base_series */ 245);
  78746. var MIN_BAR_WIDTH = 1;
  78747. var MAX_BAR_WIDTH = 50;
  78748. var DEFAULT_BAR_INTERVAL = 4;
  78749. var DEFAULT_CANVAS_WIDTH = 250;
  78750. var DEFAULT_CANVAS_HEIGHT = 30;
  78751. var DEFAULT_POINT_BORDER = 2;
  78752. var ALLOWED_TYPES = {
  78753. line: true,
  78754. spline: true,
  78755. stepline: true,
  78756. area: true,
  78757. steparea: true,
  78758. splinearea: true,
  78759. bar: true,
  78760. winloss: true
  78761. };
  78762. var _math = Math;
  78763. var _abs = _math.abs;
  78764. var _round = _math.round;
  78765. var _max = _math.max;
  78766. var _min = _math.min;
  78767. var _isFinite = isFinite;
  78768. var vizUtils = __webpack_require__( /*! ../core/utils */ 10);
  78769. var _map = vizUtils.map;
  78770. var _normalizeEnum = vizUtils.normalizeEnum;
  78771. var _isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  78772. var _Number = Number;
  78773. var _String = String;
  78774. function findMinMax(data, valField) {
  78775. var firstItem = data[0] || {};
  78776. var firstValue = firstItem[valField] || 0;
  78777. var min = firstValue;
  78778. var max = firstValue;
  78779. var minIndexes = [0];
  78780. var maxIndexes = [0];
  78781. var dataLength = data.length;
  78782. var value;
  78783. var i;
  78784. for (i = 1; i < dataLength; i++) {
  78785. value = data[i][valField];
  78786. if (value < min) {
  78787. min = value;
  78788. minIndexes = [i]
  78789. } else {
  78790. if (value === min) {
  78791. minIndexes.push(i)
  78792. }
  78793. }
  78794. if (value > max) {
  78795. max = value;
  78796. maxIndexes = [i]
  78797. } else {
  78798. if (value === max) {
  78799. maxIndexes.push(i)
  78800. }
  78801. }
  78802. }
  78803. if (max === min) {
  78804. minIndexes = maxIndexes = []
  78805. }
  78806. return {
  78807. minIndexes: minIndexes,
  78808. maxIndexes: maxIndexes
  78809. }
  78810. }
  78811. function parseNumericDataSource(data, argField, valField, ignoreEmptyPoints) {
  78812. return _map(data, function(dataItem, index) {
  78813. var item = null;
  78814. var isDataNumber;
  78815. var value;
  78816. if (void 0 !== dataItem) {
  78817. item = {};
  78818. isDataNumber = _isFinite(dataItem);
  78819. item[argField] = isDataNumber ? _String(index) : dataItem[argField];
  78820. value = isDataNumber ? dataItem : dataItem[valField];
  78821. item[valField] = null === value ? ignoreEmptyPoints ? void 0 : value : _Number(value);
  78822. item = void 0 !== item[argField] && void 0 !== item[valField] ? item : null
  78823. }
  78824. return item
  78825. })
  78826. }
  78827. function parseWinlossDataSource(data, argField, valField, target) {
  78828. var lowBarValue = -1;
  78829. var zeroBarValue = 0;
  78830. var highBarValue = 1;
  78831. var delta = 1e-4;
  78832. return _map(data, function(dataItem) {
  78833. var item = {};
  78834. item[argField] = dataItem[argField];
  78835. if (_abs(dataItem[valField] - target) < delta) {
  78836. item[valField] = zeroBarValue
  78837. } else {
  78838. if (dataItem[valField] > target) {
  78839. item[valField] = highBarValue
  78840. } else {
  78841. item[valField] = lowBarValue
  78842. }
  78843. }
  78844. return item
  78845. })
  78846. }
  78847. function selectPointColor(color, options, index, pointIndexes) {
  78848. if (index === pointIndexes.first || index === pointIndexes.last) {
  78849. color = options.firstLastColor
  78850. }
  78851. if ((pointIndexes.min || []).indexOf(index) >= 0) {
  78852. color = options.minColor
  78853. }
  78854. if ((pointIndexes.max || []).indexOf(index) >= 0) {
  78855. color = options.maxColor
  78856. }
  78857. return color
  78858. }
  78859. function createLineCustomizeFunction(pointIndexes, options) {
  78860. return function() {
  78861. var color = selectPointColor(void 0, options, this.index, pointIndexes);
  78862. return color ? {
  78863. visible: true,
  78864. border: {
  78865. color: color
  78866. }
  78867. } : {}
  78868. }
  78869. }
  78870. function createBarCustomizeFunction(pointIndexes, options, winlossData) {
  78871. return function() {
  78872. var index = this.index;
  78873. var isWinloss = "winloss" === options.type;
  78874. var target = isWinloss ? options.winlossThreshold : 0;
  78875. var value = isWinloss ? winlossData[index][options.valueField] : this.value;
  78876. var positiveColor = isWinloss ? options.winColor : options.barPositiveColor;
  78877. var negativeColor = isWinloss ? options.lossColor : options.barNegativeColor;
  78878. return {
  78879. color: selectPointColor(value >= target ? positiveColor : negativeColor, options, index, pointIndexes)
  78880. }
  78881. }
  78882. }
  78883. var dxSparkline = BaseSparkline.inherit({
  78884. _rootClassPrefix: "dxsl",
  78885. _rootClass: "dxsl-sparkline",
  78886. _themeSection: "sparkline",
  78887. _defaultSize: {
  78888. width: DEFAULT_CANVAS_WIDTH,
  78889. height: DEFAULT_CANVAS_HEIGHT
  78890. },
  78891. _initCore: function() {
  78892. this.callBase();
  78893. this._createSeries()
  78894. },
  78895. _initialChanges: ["DATA_SOURCE"],
  78896. _dataSourceChangedHandler: function() {
  78897. this._requestChange(["UPDATE"])
  78898. },
  78899. _updateWidgetElements: function() {
  78900. this._updateSeries();
  78901. this.callBase()
  78902. },
  78903. _disposeWidgetElements: function() {
  78904. var that = this;
  78905. that._series && that._series.dispose();
  78906. that._series = that._seriesGroup = that._seriesLabelGroup = null
  78907. },
  78908. _cleanWidgetElements: function() {
  78909. this._seriesGroup.remove();
  78910. this._seriesLabelGroup.remove();
  78911. this._seriesGroup.clear();
  78912. this._seriesLabelGroup.clear()
  78913. },
  78914. _drawWidgetElements: function() {
  78915. if (this._dataIsLoaded()) {
  78916. this._drawSeries();
  78917. this._drawn()
  78918. }
  78919. },
  78920. _getCorrectCanvas: function() {
  78921. var options = this._allOptions;
  78922. var canvas = this._canvas;
  78923. var halfPointSize = options.pointSize && Math.ceil(options.pointSize / 2) + DEFAULT_POINT_BORDER;
  78924. var type = options.type;
  78925. if ("bar" !== type && "winloss" !== type && (options.showFirstLast || options.showMinMax)) {
  78926. return {
  78927. width: canvas.width,
  78928. height: canvas.height,
  78929. left: canvas.left + halfPointSize,
  78930. right: canvas.right + halfPointSize,
  78931. top: canvas.top + halfPointSize,
  78932. bottom: canvas.bottom + halfPointSize
  78933. }
  78934. }
  78935. return canvas
  78936. },
  78937. _prepareOptions: function() {
  78938. var that = this;
  78939. that._allOptions = that.callBase();
  78940. that._allOptions.type = _normalizeEnum(that._allOptions.type);
  78941. if (!ALLOWED_TYPES[that._allOptions.type]) {
  78942. that._allOptions.type = "line"
  78943. }
  78944. },
  78945. _createHtmlElements: function() {
  78946. this._seriesGroup = this._renderer.g().attr({
  78947. "class": "dxsl-series"
  78948. });
  78949. this._seriesLabelGroup = this._renderer.g().attr({
  78950. "class": "dxsl-series-labels"
  78951. })
  78952. },
  78953. _createSeries: function() {
  78954. this._series = new seriesModule.Series({
  78955. renderer: this._renderer,
  78956. seriesGroup: this._seriesGroup,
  78957. labelsGroup: this._seriesLabelGroup,
  78958. argumentAxis: this._argumentAxis,
  78959. valueAxis: this._valueAxis
  78960. }, {
  78961. widgetType: "chart",
  78962. type: "line"
  78963. })
  78964. },
  78965. getSeriesOptions: function() {
  78966. return this._series.getOptions()
  78967. },
  78968. _updateSeries: function() {
  78969. var that = this;
  78970. var singleSeries = that._series;
  78971. that._prepareDataSource();
  78972. var seriesOptions = that._prepareSeriesOptions();
  78973. singleSeries.updateOptions(seriesOptions);
  78974. var groupsData = {
  78975. groups: [{
  78976. series: [singleSeries]
  78977. }]
  78978. };
  78979. groupsData.argumentOptions = {
  78980. type: "bar" === seriesOptions.type ? "discrete" : void 0
  78981. };
  78982. that._simpleDataSource = dataValidatorModule.validateData(that._simpleDataSource, groupsData, that._incidentOccurred, {
  78983. checkTypeForAllData: false,
  78984. convertToAxisDataType: true,
  78985. sortingMethod: true
  78986. })[singleSeries.getArgumentField()];
  78987. seriesOptions.customizePoint = that._getCustomizeFunction();
  78988. singleSeries.updateData(that._simpleDataSource);
  78989. singleSeries.createPoints();
  78990. that._groupsDataCategories = groupsData.categories
  78991. },
  78992. _optionChangesMap: {
  78993. dataSource: "DATA_SOURCE"
  78994. },
  78995. _optionChangesOrder: ["DATA_SOURCE"],
  78996. _change_DATA_SOURCE: function() {
  78997. this._updateDataSource()
  78998. },
  78999. _prepareDataSource: function() {
  79000. var that = this;
  79001. var options = that._allOptions;
  79002. var argField = options.argumentField;
  79003. var valField = options.valueField;
  79004. var dataSource = that._dataSourceItems() || [];
  79005. var data = parseNumericDataSource(dataSource, argField, valField, that.option("ignoreEmptyPoints"));
  79006. if ("winloss" === options.type) {
  79007. that._winlossDataSource = data;
  79008. that._simpleDataSource = parseWinlossDataSource(data, argField, valField, options.winlossThreshold)
  79009. } else {
  79010. that._simpleDataSource = data
  79011. }
  79012. },
  79013. _prepareSeriesOptions: function() {
  79014. var that = this;
  79015. var options = that._allOptions;
  79016. var type = "winloss" === options.type ? "bar" : options.type;
  79017. return {
  79018. visible: true,
  79019. argumentField: options.argumentField,
  79020. valueField: options.valueField,
  79021. color: options.lineColor,
  79022. width: options.lineWidth,
  79023. widgetType: "chart",
  79024. type: type,
  79025. opacity: type.indexOf("area") !== -1 ? that._allOptions.areaOpacity : void 0,
  79026. point: {
  79027. size: options.pointSize,
  79028. symbol: options.pointSymbol,
  79029. border: {
  79030. visible: true,
  79031. width: DEFAULT_POINT_BORDER
  79032. },
  79033. color: options.pointColor,
  79034. visible: false,
  79035. hoverStyle: {
  79036. border: {}
  79037. },
  79038. selectionStyle: {
  79039. border: {}
  79040. }
  79041. },
  79042. border: {
  79043. color: options.lineColor,
  79044. width: options.lineWidth,
  79045. visible: "bar" !== type
  79046. }
  79047. }
  79048. },
  79049. _getCustomizeFunction: function() {
  79050. var that = this;
  79051. var options = that._allOptions;
  79052. var dataSource = that._winlossDataSource || that._simpleDataSource;
  79053. var drawnPointIndexes = that._getExtremumPointsIndexes(dataSource);
  79054. var customizeFunction;
  79055. if ("winloss" === options.type || "bar" === options.type) {
  79056. customizeFunction = createBarCustomizeFunction(drawnPointIndexes, options, that._winlossDataSource)
  79057. } else {
  79058. customizeFunction = createLineCustomizeFunction(drawnPointIndexes, options)
  79059. }
  79060. return customizeFunction
  79061. },
  79062. _getExtremumPointsIndexes: function(data) {
  79063. var that = this;
  79064. var options = that._allOptions;
  79065. var lastIndex = data.length - 1;
  79066. var indexes = {};
  79067. that._minMaxIndexes = findMinMax(data, options.valueField);
  79068. if (options.showFirstLast) {
  79069. indexes.first = 0;
  79070. indexes.last = lastIndex
  79071. }
  79072. if (options.showMinMax) {
  79073. indexes.min = that._minMaxIndexes.minIndexes;
  79074. indexes.max = that._minMaxIndexes.maxIndexes
  79075. }
  79076. return indexes
  79077. },
  79078. _getStick: function() {
  79079. return {
  79080. stick: "bar" !== this._series.type
  79081. }
  79082. },
  79083. _updateRange: function() {
  79084. var that = this;
  79085. var series = that._series;
  79086. var type = series.type;
  79087. var isBarType = "bar" === type;
  79088. var isWinlossType = "winloss" === type;
  79089. var DEFAULT_VALUE_RANGE_MARGIN = .15;
  79090. var DEFAULT_ARGUMENT_RANGE_MARGIN = .1;
  79091. var WINLOSS_MAX_RANGE = 1;
  79092. var WINLOSS_MIN_RANGE = -1;
  79093. var rangeData = series.getRangeData();
  79094. var minValue = that._allOptions.minValue;
  79095. var hasMinY = _isDefined(minValue) && _isFinite(minValue);
  79096. var maxValue = that._allOptions.maxValue;
  79097. var hasMaxY = _isDefined(maxValue) && _isFinite(maxValue);
  79098. var argCoef;
  79099. var valCoef = (rangeData.val.max - rangeData.val.min) * DEFAULT_VALUE_RANGE_MARGIN;
  79100. if (isBarType || isWinlossType || "area" === type) {
  79101. if (0 !== rangeData.val.min) {
  79102. rangeData.val.min -= valCoef
  79103. }
  79104. if (0 !== rangeData.val.max) {
  79105. rangeData.val.max += valCoef
  79106. }
  79107. } else {
  79108. rangeData.val.min -= valCoef;
  79109. rangeData.val.max += valCoef
  79110. }
  79111. if (hasMinY || hasMaxY) {
  79112. if (hasMinY && hasMaxY) {
  79113. rangeData.val.minVisible = _min(minValue, maxValue);
  79114. rangeData.val.maxVisible = _max(minValue, maxValue)
  79115. } else {
  79116. rangeData.val.minVisible = hasMinY ? _Number(minValue) : void 0;
  79117. rangeData.val.maxVisible = hasMaxY ? _Number(maxValue) : void 0
  79118. }
  79119. if (isWinlossType) {
  79120. rangeData.val.minVisible = hasMinY ? _max(rangeData.val.minVisible, WINLOSS_MIN_RANGE) : void 0;
  79121. rangeData.val.maxVisible = hasMaxY ? _min(rangeData.val.maxVisible, WINLOSS_MAX_RANGE) : void 0
  79122. }
  79123. }
  79124. if (series.getPoints().length > 1) {
  79125. if (isBarType) {
  79126. argCoef = (rangeData.arg.max - rangeData.arg.min) * DEFAULT_ARGUMENT_RANGE_MARGIN;
  79127. rangeData.arg.min = rangeData.arg.min - argCoef;
  79128. rangeData.arg.max = rangeData.arg.max + argCoef
  79129. }
  79130. }
  79131. rangeData.arg.categories = that._groupsDataCategories;
  79132. that._ranges = rangeData
  79133. },
  79134. _getBarWidth: function(pointsCount) {
  79135. var that = this;
  79136. var canvas = that._canvas;
  79137. var intervalWidth = pointsCount * DEFAULT_BAR_INTERVAL;
  79138. var rangeWidth = canvas.width - canvas.left - canvas.right - intervalWidth;
  79139. var width = _round(rangeWidth / pointsCount);
  79140. if (width < MIN_BAR_WIDTH) {
  79141. width = MIN_BAR_WIDTH
  79142. }
  79143. if (width > MAX_BAR_WIDTH) {
  79144. width = MAX_BAR_WIDTH
  79145. }
  79146. return width
  79147. },
  79148. _correctPoints: function() {
  79149. var that = this;
  79150. var seriesType = that._allOptions.type;
  79151. var seriesPoints = that._series.getPoints();
  79152. var pointsLength = seriesPoints.length;
  79153. var barWidth;
  79154. var i;
  79155. if ("bar" === seriesType || "winloss" === seriesType) {
  79156. barWidth = that._getBarWidth(pointsLength);
  79157. for (i = 0; i < pointsLength; i++) {
  79158. seriesPoints[i].correctCoordinates({
  79159. width: barWidth,
  79160. offset: 0
  79161. })
  79162. }
  79163. }
  79164. },
  79165. _drawSeries: function() {
  79166. var that = this;
  79167. if (that._simpleDataSource.length > 0) {
  79168. that._correctPoints();
  79169. that._series.draw();
  79170. that._seriesGroup.append(that._renderer.root)
  79171. }
  79172. },
  79173. _isTooltipEnabled: function() {
  79174. return !!this._simpleDataSource.length
  79175. },
  79176. _getTooltipData: function() {
  79177. var that = this;
  79178. var options = that._allOptions;
  79179. var dataSource = that._winlossDataSource || that._simpleDataSource;
  79180. var tooltip = that._tooltip;
  79181. if (0 === dataSource.length) {
  79182. return {}
  79183. }
  79184. var minMax = that._minMaxIndexes;
  79185. var valueField = options.valueField;
  79186. var first = dataSource[0][valueField];
  79187. var last = dataSource[dataSource.length - 1][valueField];
  79188. var min = _isDefined(minMax.minIndexes[0]) ? dataSource[minMax.minIndexes[0]][valueField] : first;
  79189. var max = _isDefined(minMax.maxIndexes[0]) ? dataSource[minMax.maxIndexes[0]][valueField] : first;
  79190. var formattedFirst = tooltip.formatValue(first);
  79191. var formattedLast = tooltip.formatValue(last);
  79192. var formattedMin = tooltip.formatValue(min);
  79193. var formattedMax = tooltip.formatValue(max);
  79194. var customizeObject = {
  79195. firstValue: formattedFirst,
  79196. lastValue: formattedLast,
  79197. minValue: formattedMin,
  79198. maxValue: formattedMax,
  79199. originalFirstValue: first,
  79200. originalLastValue: last,
  79201. originalMinValue: min,
  79202. originalMaxValue: max,
  79203. valueText: ["Start:", formattedFirst, "End:", formattedLast, "Min:", formattedMin, "Max:", formattedMax]
  79204. };
  79205. if ("winloss" === options.type) {
  79206. customizeObject.originalThresholdValue = options.winlossThreshold;
  79207. customizeObject.thresholdValue = tooltip.formatValue(options.winlossThreshold)
  79208. }
  79209. return customizeObject
  79210. }
  79211. });
  79212. _map(["lineColor", "lineWidth", "areaOpacity", "minColor", "maxColor", "barPositiveColor", "barNegativeColor", "winColor", "lessColor", "firstLastColor", "pointSymbol", "pointColor", "pointSize", "type", "argumentField", "valueField", "winlossThreshold", "showFirstLast", "showMinMax", "ignoreEmptyPoints", "minValue", "maxValue"], function(name) {
  79213. dxSparkline.prototype._optionChangesMap[name] = "OPTIONS"
  79214. });
  79215. __webpack_require__( /*! ../../core/component_registrator */ 9)("dxSparkline", dxSparkline);
  79216. module.exports = dxSparkline;
  79217. dxSparkline.addPlugin(__webpack_require__( /*! ../core/data_source */ 144).plugin)
  79218. },
  79219. /*!********************************************!*\
  79220. !*** ./artifacts/transpiled/viz/bullet.js ***!
  79221. \********************************************/
  79222. /*! dynamic exports provided */
  79223. /*! all exports used */
  79224. function(module, exports, __webpack_require__) {
  79225. module.exports = __webpack_require__( /*! ./sparklines/bullet */ 824)
  79226. },
  79227. /*!*******************************************************!*\
  79228. !*** ./artifacts/transpiled/viz/sparklines/bullet.js ***!
  79229. \*******************************************************/
  79230. /*! dynamic exports provided */
  79231. /*! all exports used */
  79232. function(module, exports, __webpack_require__) {
  79233. var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
  79234. var BaseSparkline = __webpack_require__( /*! ./base_sparkline */ 418);
  79235. var TARGET_MIN_Y = .02;
  79236. var TARGET_MAX_Y = .98;
  79237. var BAR_VALUE_MIN_Y = .1;
  79238. var BAR_VALUE_MAX_Y = .9;
  79239. var DEFAULT_CANVAS_WIDTH = 300;
  79240. var DEFAULT_CANVAS_HEIGHT = 30;
  79241. var DEFAULT_HORIZONTAL_MARGIN = 1;
  79242. var DEFAULT_VERTICAL_MARGIN = 2;
  79243. var _Number = Number;
  79244. var _isFinite = isFinite;
  79245. var dxBullet = BaseSparkline.inherit({
  79246. _rootClassPrefix: "dxb",
  79247. _rootClass: "dxb-bullet",
  79248. _themeSection: "bullet",
  79249. _defaultSize: {
  79250. width: DEFAULT_CANVAS_WIDTH,
  79251. height: DEFAULT_CANVAS_HEIGHT,
  79252. left: DEFAULT_HORIZONTAL_MARGIN,
  79253. right: DEFAULT_HORIZONTAL_MARGIN,
  79254. top: DEFAULT_VERTICAL_MARGIN,
  79255. bottom: DEFAULT_VERTICAL_MARGIN
  79256. },
  79257. _disposeWidgetElements: function() {
  79258. delete this._zeroLevelPath;
  79259. delete this._targetPath;
  79260. delete this._barValuePath
  79261. },
  79262. _cleanWidgetElements: function() {
  79263. this._zeroLevelPath.remove();
  79264. this._targetPath.remove();
  79265. this._barValuePath.remove()
  79266. },
  79267. _drawWidgetElements: function() {
  79268. this._drawBullet();
  79269. this._drawn()
  79270. },
  79271. _createHtmlElements: function() {
  79272. var renderer = this._renderer;
  79273. this._zeroLevelPath = renderer.path(void 0, "line").attr({
  79274. "class": "dxb-zero-level",
  79275. "stroke-linecap": "square"
  79276. });
  79277. this._targetPath = renderer.path(void 0, "line").attr({
  79278. "class": "dxb-target",
  79279. "stroke-linecap": "square"
  79280. });
  79281. this._barValuePath = renderer.path(void 0, "line").attr({
  79282. "class": "dxb-bar-value",
  79283. "stroke-linecap": "square"
  79284. })
  79285. },
  79286. _prepareOptions: function() {
  79287. var that = this;
  79288. var options;
  79289. var startScaleValue;
  79290. var endScaleValue;
  79291. var level;
  79292. var value;
  79293. var target;
  79294. that._allOptions = options = that.callBase();
  79295. var isValueUndefined = void 0 === that._allOptions.value;
  79296. var isTargetUndefined = void 0 === that._allOptions.target;
  79297. that._tooltipEnabled = !(isValueUndefined && isTargetUndefined);
  79298. if (isValueUndefined) {
  79299. that._allOptions.value = 0
  79300. }
  79301. if (isTargetUndefined) {
  79302. that._allOptions.target = 0
  79303. }
  79304. options.value = value = _Number(options.value);
  79305. options.target = target = _Number(options.target);
  79306. if (void 0 === that._allOptions.startScaleValue) {
  79307. that._allOptions.startScaleValue = target < value ? target : value;
  79308. that._allOptions.startScaleValue = that._allOptions.startScaleValue < 0 ? that._allOptions.startScaleValue : 0
  79309. }
  79310. if (void 0 === that._allOptions.endScaleValue) {
  79311. that._allOptions.endScaleValue = target > value ? target : value
  79312. }
  79313. options.startScaleValue = startScaleValue = _Number(options.startScaleValue);
  79314. options.endScaleValue = endScaleValue = _Number(options.endScaleValue);
  79315. if (endScaleValue < startScaleValue) {
  79316. level = endScaleValue;
  79317. that._allOptions.endScaleValue = startScaleValue;
  79318. that._allOptions.startScaleValue = level;
  79319. that._allOptions.inverted = true
  79320. }
  79321. },
  79322. _updateRange: function() {
  79323. var that = this;
  79324. var options = that._allOptions;
  79325. that._ranges = {
  79326. arg: {
  79327. invert: options.inverted,
  79328. min: options.startScaleValue,
  79329. max: options.endScaleValue,
  79330. axisType: "continuous",
  79331. dataType: "numeric"
  79332. },
  79333. val: {
  79334. min: 0,
  79335. max: 1,
  79336. axisType: "continuous",
  79337. dataType: "numeric"
  79338. }
  79339. }
  79340. },
  79341. _drawBullet: function() {
  79342. var that = this;
  79343. var options = that._allOptions;
  79344. var isValidBounds = options.startScaleValue !== options.endScaleValue;
  79345. var isValidMin = _isFinite(options.startScaleValue);
  79346. var isValidMax = _isFinite(options.endScaleValue);
  79347. var isValidValue = _isFinite(options.value);
  79348. var isValidTarget = _isFinite(options.target);
  79349. if (isValidBounds && isValidMax && isValidMin && isValidTarget && isValidValue) {
  79350. this._drawBarValue();
  79351. this._drawTarget();
  79352. this._drawZeroLevel()
  79353. }
  79354. },
  79355. _getTargetParams: function() {
  79356. var that = this;
  79357. var options = that._allOptions;
  79358. var translatorY = that._valueAxis.getTranslator();
  79359. var x = that._argumentAxis.getTranslator().translate(options.target);
  79360. return {
  79361. points: [x, translatorY.translate(TARGET_MIN_Y), x, translatorY.translate(TARGET_MAX_Y)],
  79362. stroke: options.targetColor,
  79363. "stroke-width": options.targetWidth
  79364. }
  79365. },
  79366. _getBarValueParams: function() {
  79367. var that = this;
  79368. var options = that._allOptions;
  79369. var translatorX = that._argumentAxis.getTranslator();
  79370. var translatorY = that._valueAxis.getTranslator();
  79371. var startLevel = options.startScaleValue;
  79372. var endLevel = options.endScaleValue;
  79373. var value = options.value;
  79374. var y2 = translatorY.translate(BAR_VALUE_MIN_Y);
  79375. var y1 = translatorY.translate(BAR_VALUE_MAX_Y);
  79376. var x1;
  79377. var x2;
  79378. if (value > 0) {
  79379. x1 = startLevel <= 0 ? 0 : startLevel;
  79380. x2 = value >= endLevel ? endLevel : value < x1 ? x1 : value
  79381. } else {
  79382. x1 = endLevel >= 0 ? 0 : endLevel;
  79383. x2 = value < startLevel ? startLevel : value > x1 ? x1 : value
  79384. }
  79385. x1 = translatorX.translate(x1);
  79386. x2 = translatorX.translate(x2);
  79387. return {
  79388. points: [x1, y1, x2, y1, x2, y2, x1, y2],
  79389. fill: options.color
  79390. }
  79391. },
  79392. _getCorrectCanvas: function() {
  79393. return this._canvas
  79394. },
  79395. _getZeroLevelParams: function() {
  79396. var that = this;
  79397. var translatorY = that._valueAxis.getTranslator();
  79398. var x = that._argumentAxis.getTranslator().translate(0);
  79399. return {
  79400. points: [x, translatorY.translate(TARGET_MIN_Y), x, translatorY.translate(TARGET_MAX_Y)],
  79401. stroke: that._allOptions.targetColor,
  79402. "stroke-width": 1
  79403. }
  79404. },
  79405. _drawZeroLevel: function() {
  79406. var that = this;
  79407. var options = that._allOptions;
  79408. if (0 > options.endScaleValue || 0 < options.startScaleValue || !options.showZeroLevel) {
  79409. return
  79410. }
  79411. that._zeroLevelPath.attr(that._getZeroLevelParams()).sharp().append(that._renderer.root)
  79412. },
  79413. _drawTarget: function() {
  79414. var that = this;
  79415. var options = that._allOptions;
  79416. var target = options.target;
  79417. if (target > options.endScaleValue || target < options.startScaleValue || !options.showTarget) {
  79418. return
  79419. }
  79420. that._targetPath.attr(that._getTargetParams()).sharp().append(that._renderer.root)
  79421. },
  79422. _drawBarValue: function() {
  79423. this._barValuePath.attr(this._getBarValueParams()).append(this._renderer.root)
  79424. },
  79425. _getTooltipCoords: function() {
  79426. var canvas = this._canvas;
  79427. var rootOffset = this._renderer.getRootOffset();
  79428. var bBox = this._barValuePath.getBBox();
  79429. return {
  79430. x: bBox.x + bBox.width / 2 + rootOffset.left,
  79431. y: canvas.height / 2 + rootOffset.top
  79432. }
  79433. },
  79434. _getTooltipData: function() {
  79435. var that = this;
  79436. var tooltip = that._tooltip;
  79437. var options = that._allOptions;
  79438. var value = options.value;
  79439. var target = options.target;
  79440. var valueText = tooltip.formatValue(value);
  79441. var targetText = tooltip.formatValue(target);
  79442. return {
  79443. originalValue: value,
  79444. originalTarget: target,
  79445. value: valueText,
  79446. target: targetText,
  79447. valueText: ["Actual Value:", valueText, "Target Value:", targetText]
  79448. }
  79449. },
  79450. _isTooltipEnabled: function() {
  79451. return this._tooltipEnabled
  79452. }
  79453. });
  79454. each(["color", "targetColor", "targetWidth", "showTarget", "showZeroLevel", "value", "target", "startScaleValue", "endScaleValue"], function(_, name) {
  79455. dxBullet.prototype._optionChangesMap[name] = "OPTIONS"
  79456. });
  79457. __webpack_require__( /*! ../../core/component_registrator */ 9)("dxBullet", dxBullet);
  79458. module.exports = dxBullet
  79459. },
  79460. /*!**********************************************!*\
  79461. !*** ./artifacts/transpiled/viz/tree_map.js ***!
  79462. \**********************************************/
  79463. /*! dynamic exports provided */
  79464. /*! all exports used */
  79465. function(module, exports, __webpack_require__) {
  79466. module.exports = __webpack_require__( /*! ./tree_map/tree_map */ 826)
  79467. },
  79468. /*!*******************************************************!*\
  79469. !*** ./artifacts/transpiled/viz/tree_map/tree_map.js ***!
  79470. \*******************************************************/
  79471. /*! dynamic exports provided */
  79472. /*! all exports used */
  79473. function(module, exports, __webpack_require__) {
  79474. var dxTreeMap = module.exports = __webpack_require__( /*! ./tree_map.base */ 70);
  79475. __webpack_require__( /*! ./tiling.squarified */ 419);
  79476. __webpack_require__( /*! ./tiling.strip */ 827);
  79477. __webpack_require__( /*! ./tiling.slice_and_dice */ 828);
  79478. __webpack_require__( /*! ./tiling.rotated_slice_and_dice */ 829);
  79479. __webpack_require__( /*! ./colorizing.discrete */ 421);
  79480. __webpack_require__( /*! ./colorizing.gradient */ 830);
  79481. __webpack_require__( /*! ./colorizing.range */ 831);
  79482. __webpack_require__( /*! ./api */ 146);
  79483. __webpack_require__( /*! ./hover */ 422);
  79484. __webpack_require__( /*! ./selection */ 832);
  79485. __webpack_require__( /*! ./tooltip */ 424);
  79486. __webpack_require__( /*! ./tracker */ 833);
  79487. __webpack_require__( /*! ./drilldown */ 834);
  79488. __webpack_require__( /*! ./plain_data_source */ 835);
  79489. dxTreeMap.addPlugin(__webpack_require__( /*! ../core/export */ 93).plugin);
  79490. dxTreeMap.addPlugin(__webpack_require__( /*! ../core/title */ 105).plugin);
  79491. dxTreeMap.addPlugin(__webpack_require__( /*! ../core/loading_indicator */ 119).plugin)
  79492. },
  79493. /*!***********************************************************!*\
  79494. !*** ./artifacts/transpiled/viz/tree_map/tiling.strip.js ***!
  79495. \***********************************************************/
  79496. /*! dynamic exports provided */
  79497. /*! all exports used */
  79498. function(module, exports, __webpack_require__) {
  79499. var _squarify = __webpack_require__( /*! ./tiling.squarified.base */ 420);
  79500. function accumulate(total, current, count) {
  79501. return ((count - 1) * total + current) / count
  79502. }
  79503. function strip(data) {
  79504. return _squarify(data, accumulate, true)
  79505. }
  79506. __webpack_require__( /*! ./tiling */ 120).addAlgorithm("strip", strip);
  79507. module.exports = strip
  79508. },
  79509. /*!********************************************************************!*\
  79510. !*** ./artifacts/transpiled/viz/tree_map/tiling.slice_and_dice.js ***!
  79511. \********************************************************************/
  79512. /*! dynamic exports provided */
  79513. /*! all exports used */
  79514. function(module, exports, __webpack_require__) {
  79515. var tiling = __webpack_require__( /*! ./tiling */ 120);
  79516. function sliceAndDice(data) {
  79517. var items = data.items;
  79518. var sidesData = tiling.buildSidesData(data.rect, data.directions, data.isRotated ? 1 : 0);
  79519. tiling.calculateRectangles(items, 0, data.rect, sidesData, {
  79520. sum: data.sum,
  79521. count: items.length,
  79522. side: sidesData.variedSide
  79523. })
  79524. }
  79525. tiling.addAlgorithm("sliceanddice", sliceAndDice);
  79526. module.exports = sliceAndDice
  79527. },
  79528. /*!****************************************************************************!*\
  79529. !*** ./artifacts/transpiled/viz/tree_map/tiling.rotated_slice_and_dice.js ***!
  79530. \****************************************************************************/
  79531. /*! dynamic exports provided */
  79532. /*! all exports used */
  79533. function(module, exports, __webpack_require__) {
  79534. var tiling = __webpack_require__( /*! ./tiling */ 120);
  79535. var sliceAndDiceAlgorithm = tiling.getAlgorithm("sliceanddice");
  79536. function rotatedSliceAndDice(data) {
  79537. data.isRotated = !data.isRotated;
  79538. return sliceAndDiceAlgorithm.call(this, data)
  79539. }
  79540. tiling.addAlgorithm("rotatedsliceanddice", rotatedSliceAndDice)
  79541. },
  79542. /*!******************************************************************!*\
  79543. !*** ./artifacts/transpiled/viz/tree_map/colorizing.gradient.js ***!
  79544. \******************************************************************/
  79545. /*! dynamic exports provided */
  79546. /*! all exports used */
  79547. function(module, exports, __webpack_require__) {
  79548. var _createColorCodeGetter = __webpack_require__( /*! ./colorizing */ 121).createColorCodeGetter;
  79549. var _min = Math.min;
  79550. var _max = Math.max;
  79551. function createSimpleColorizer(getColor, range) {
  79552. return function(node) {
  79553. return getColor(node, range)
  79554. }
  79555. }
  79556. function getRangeData(range) {
  79557. return [Number(range[0]) || 0, range[1] - range[0] || 1]
  79558. }
  79559. function calculateRange(nodes, getValue) {
  79560. var i;
  79561. var ii = nodes.length;
  79562. var codes = [];
  79563. var code;
  79564. for (i = 0; i < ii; ++i) {
  79565. code = getValue(nodes[i]);
  79566. if (isFinite(code)) {
  79567. codes.push(code)
  79568. }
  79569. }
  79570. return getRangeData([_min.apply(null, codes), _max.apply(null, codes)])
  79571. }
  79572. function createGuessingColorizer(getColor, getValue) {
  79573. var ranges = {};
  79574. return function(node) {
  79575. var parent = node.parent;
  79576. return getColor(node, ranges[parent._id] || (ranges[parent._id] = calculateRange(parent.nodes, getValue)))
  79577. }
  79578. }
  79579. function gradientColorizer(options, themeManager) {
  79580. var palette = themeManager.createGradientPalette(options.palette);
  79581. var getValue = _createColorCodeGetter(options);
  79582. return "range" in options ? createSimpleColorizer(getColor, getRangeData(options.range || [])) : createGuessingColorizer(getColor, getValue);
  79583. function getColor(node, arg) {
  79584. return palette.getColor((getValue(node) - arg[0]) / arg[1])
  79585. }
  79586. }
  79587. __webpack_require__( /*! ./colorizing */ 121).addColorizer("gradient", gradientColorizer);
  79588. module.exports = gradientColorizer
  79589. },
  79590. /*!***************************************************************!*\
  79591. !*** ./artifacts/transpiled/viz/tree_map/colorizing.range.js ***!
  79592. \***************************************************************/
  79593. /*! dynamic exports provided */
  79594. /*! all exports used */
  79595. function(module, exports, __webpack_require__) {
  79596. var _createColorCodeGetter = __webpack_require__( /*! ./colorizing */ 121).createColorCodeGetter;
  79597. function getPaletteIndex(value, items) {
  79598. var start = 0;
  79599. var end = items.length - 1;
  79600. var index = -1;
  79601. var middle;
  79602. if (items[start] <= value && value <= items[end]) {
  79603. if (value === items[end]) {
  79604. index = end - 1
  79605. } else {
  79606. while (end - start > 1) {
  79607. middle = start + end >> 1;
  79608. if (value < items[middle]) {
  79609. end = middle
  79610. } else {
  79611. start = middle
  79612. }
  79613. }
  79614. index = start
  79615. }
  79616. }
  79617. return index
  79618. }
  79619. function rangeColorizer(options, themeManager) {
  79620. var range = options.range || [];
  79621. var palette = themeManager.createDiscretePalette(options.palette, range.length - 1);
  79622. var getValue = _createColorCodeGetter(options);
  79623. return function(node) {
  79624. return palette.getColor(getPaletteIndex(getValue(node), range))
  79625. }
  79626. }
  79627. __webpack_require__( /*! ./colorizing */ 121).addColorizer("range", rangeColorizer);
  79628. module.exports = rangeColorizer
  79629. },
  79630. /*!********************************************************!*\
  79631. !*** ./artifacts/transpiled/viz/tree_map/selection.js ***!
  79632. \********************************************************/
  79633. /*! dynamic exports provided */
  79634. /*! all exports used */
  79635. function(module, exports, __webpack_require__) {
  79636. var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
  79637. var nodeProto = __webpack_require__( /*! ./node */ 166).prototype;
  79638. var expand = __webpack_require__( /*! ../core/helpers */ 142).expand;
  79639. var common = __webpack_require__( /*! ./common */ 251);
  79640. var _buildRectAppearance = common.buildRectAppearance;
  79641. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  79642. var _inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
  79643. var MODE_NONE = 0;
  79644. var MODE_SINGLE = 1;
  79645. var MODE_MULTIPLE = 2;
  79646. var STATE_CODE = 2;
  79647. __webpack_require__( /*! ./api */ 146);
  79648. __webpack_require__( /*! ./states */ 423);
  79649. proto._eventsMap.onSelectionChanged = {
  79650. name: "selectionChanged"
  79651. };
  79652. expand(proto._handlers, "calculateAdditionalStates", function(states, options) {
  79653. states[2] = options.selectionStyle ? _buildRectAppearance(options.selectionStyle) : {}
  79654. });
  79655. nodeProto.statesMap[2] = nodeProto.statesMap[3] = STATE_CODE;
  79656. nodeProto.additionalStates.push(2);
  79657. expand(proto, "_onNodesCreated", function() {
  79658. this._selectionList.length = 0
  79659. });
  79660. expand(proto, "_extendProxyType", function(proto) {
  79661. var that = this;
  79662. proto.select = function(state) {
  79663. that._selectNode(this._id, !!state)
  79664. };
  79665. proto.isSelected = function() {
  79666. return _inArray(this._id, that._selectionList) >= 0
  79667. };
  79668. that._selectionList = []
  79669. });
  79670. __webpack_require__( /*! ./tree_map.base */ 70).addChange({
  79671. code: "SELECTION_MODE",
  79672. handler: function() {
  79673. var that = this;
  79674. var option = _normalizeEnum(that._getOption("selectionMode", true));
  79675. var selectionList = that._selectionList;
  79676. var mode = "none" === option ? MODE_NONE : "multiple" === option ? MODE_MULTIPLE : MODE_SINGLE;
  79677. if (mode === MODE_SINGLE && selectionList.length > 1) {
  79678. var tmp = selectionList.pop();
  79679. that.clearSelection();
  79680. selectionList.push(tmp)
  79681. } else {
  79682. if (mode === MODE_NONE) {
  79683. that.clearSelection()
  79684. }
  79685. }
  79686. that._selectionMode = mode
  79687. },
  79688. isThemeDependent: true,
  79689. isOptionChange: true,
  79690. option: "selectionMode"
  79691. });
  79692. expand(proto, "_applyTilesAppearance", function() {
  79693. if (this._selectionList.length) {
  79694. bringSelectedTilesToForeground(this._nodes, this._selectionList)
  79695. }
  79696. });
  79697. function bringSelectedTilesToForeground(nodes, selectionList) {
  79698. var i;
  79699. var ii = selectionList.length;
  79700. for (i = 0; i < ii; ++i) {
  79701. var node = nodes[selectionList[i]];
  79702. tileToFront[Number(node.isNode())](node.tile)
  79703. }
  79704. }
  79705. var tileToFront = [leafToFront, groupToFront];
  79706. function leafToFront(content) {
  79707. content.toForeground()
  79708. }
  79709. function groupToFront(content) {
  79710. content.outer.toForeground();
  79711. content.inner.toForeground()
  79712. }
  79713. proto._applySelectionState = function(index, state) {
  79714. var node = this._nodes[index];
  79715. node.setState(STATE_CODE, state);
  79716. this._eventTrigger("selectionChanged", {
  79717. node: node.proxy
  79718. })
  79719. };
  79720. proto._selectNode = function(index, state) {
  79721. var that = this;
  79722. if (that._selectionMode !== MODE_NONE) {
  79723. that._context.suspend();
  79724. var selectionList = that._selectionList;
  79725. var k = _inArray(index, selectionList);
  79726. if (state && k === -1) {
  79727. if (that._selectionMode === MODE_SINGLE) {
  79728. if (selectionList.length) {
  79729. var tmp = selectionList.pop();
  79730. that._applySelectionState(tmp, false)
  79731. }
  79732. }
  79733. selectionList.push(index);
  79734. that._applySelectionState(index, true)
  79735. } else {
  79736. if (!state && k >= 0) {
  79737. selectionList.splice(k, 1);
  79738. that._applySelectionState(index, false)
  79739. }
  79740. }
  79741. that._context.resume()
  79742. }
  79743. };
  79744. proto.clearSelection = function() {
  79745. var that = this;
  79746. var selectionList = that._selectionList;
  79747. var i;
  79748. var ii = selectionList.length;
  79749. if (that._selectionMode !== MODE_NONE) {
  79750. that._context.suspend();
  79751. for (i = 0; i < ii; ++i) {
  79752. that._applySelectionState(selectionList[i], false)
  79753. }
  79754. selectionList.length = 0;
  79755. that._context.resume()
  79756. }
  79757. }
  79758. },
  79759. /*!******************************************************!*\
  79760. !*** ./artifacts/transpiled/viz/tree_map/tracker.js ***!
  79761. \******************************************************/
  79762. /*! dynamic exports provided */
  79763. /*! all exports used */
  79764. function(module, exports, __webpack_require__) {
  79765. var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
  79766. var Tracker = __webpack_require__( /*! ../components/tracker */ 252).Tracker;
  79767. var expand = __webpack_require__( /*! ../core/helpers */ 142).expand;
  79768. var _parseScalar = __webpack_require__( /*! ../core/utils */ 10).parseScalar;
  79769. var DATA_KEY_BASE = "__treemap_data_";
  79770. var dataKeyModifier = 0;
  79771. __webpack_require__( /*! ./api */ 146);
  79772. __webpack_require__( /*! ./hover */ 422);
  79773. __webpack_require__( /*! ./tooltip */ 424);
  79774. proto._eventsMap.onClick = {
  79775. name: "click"
  79776. };
  79777. expand(proto, "_initCore", function() {
  79778. var that = this;
  79779. var dataKey = DATA_KEY_BASE + dataKeyModifier++;
  79780. var getProxy = function(index) {
  79781. return that._nodes[index].proxy
  79782. };
  79783. that._tracker = new Tracker({
  79784. widget: that,
  79785. root: that._renderer.root,
  79786. getNode: function(id) {
  79787. var proxy = getProxy(id);
  79788. var interactWithGroup = _parseScalar(that._getOption("interactWithGroup", true));
  79789. return interactWithGroup && proxy.isLeaf() && proxy.getParent().isActive() ? proxy.getParent() : proxy
  79790. },
  79791. getData: function(e) {
  79792. var target = e.target;
  79793. return ("tspan" === target.tagName ? target.parentNode : target)[dataKey]
  79794. },
  79795. getProxy: getProxy,
  79796. click: function(e) {
  79797. that._eventTrigger("click", e)
  79798. }
  79799. });
  79800. that._handlers.setTrackerData = function(node, element) {
  79801. element.data(dataKey, node._id)
  79802. };
  79803. exports._TESTS_dataKey = dataKey
  79804. });
  79805. expand(proto, "_disposeCore", function() {
  79806. this._tracker.dispose()
  79807. })
  79808. },
  79809. /*!********************************************************!*\
  79810. !*** ./artifacts/transpiled/viz/tree_map/drilldown.js ***!
  79811. \********************************************************/
  79812. /*! dynamic exports provided */
  79813. /*! all exports used */
  79814. function(module, exports, __webpack_require__) {
  79815. var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
  79816. var _expand = __webpack_require__( /*! ../core/helpers */ 142).expand;
  79817. __webpack_require__( /*! ./api */ 146);
  79818. proto._eventsMap.onDrill = {
  79819. name: "drill"
  79820. };
  79821. _expand(proto, "_extendProxyType", function(proto) {
  79822. var that = this;
  79823. proto.drillDown = function() {
  79824. that._drillToNode(this._id)
  79825. }
  79826. });
  79827. _expand(proto, "_onNodesCreated", function() {
  79828. this._drilldownIndex = -1
  79829. });
  79830. proto._drillToNode = function(index) {
  79831. var that = this;
  79832. var node;
  79833. if (that._drilldownIndex !== index) {
  79834. node = that._nodes[index] || that._root;
  79835. if (node.nodes) {
  79836. that._drilldownIndex = index;
  79837. that._topNode = node;
  79838. that._context.suspend();
  79839. that._context.change(["MAX_DEPTH", "NODES_RESET"]);
  79840. that._context.resume();
  79841. that._eventTrigger("drill", {
  79842. node: node.proxy
  79843. })
  79844. }
  79845. }
  79846. };
  79847. proto.resetDrillDown = function() {
  79848. this._drillToNode(-1);
  79849. return this
  79850. };
  79851. proto.drillUp = function() {
  79852. this._drillToNode(this._topNode.parent._id || -1);
  79853. return this
  79854. };
  79855. proto.getCurrentNode = function() {
  79856. return this._topNode.proxy
  79857. }
  79858. },
  79859. /*!****************************************************************!*\
  79860. !*** ./artifacts/transpiled/viz/tree_map/plain_data_source.js ***!
  79861. \****************************************************************/
  79862. /*! dynamic exports provided */
  79863. /*! all exports used */
  79864. function(module, exports, __webpack_require__) {
  79865. var proto = __webpack_require__( /*! ./tree_map.base */ 70).prototype;
  79866. proto._optionChangesMap.idField = proto._optionChangesMap.parentField = "NODES_CREATE";
  79867. proto._processDataSourceItems = function(items) {
  79868. var i;
  79869. var struct = {};
  79870. var currentItem;
  79871. var idField = this._getOption("idField", true);
  79872. var parentField = this._getOption("parentField", true);
  79873. var parentId;
  79874. var rootNodes = [];
  79875. var tmpItems;
  79876. var item;
  79877. if (!idField || !parentField || 0 === items.length) {
  79878. return {
  79879. items: items,
  79880. isPlain: true
  79881. }
  79882. }
  79883. for (i = 0; i < items.length; i++) {
  79884. currentItem = items[i];
  79885. parentId = currentItem[parentField];
  79886. if (parentId) {
  79887. struct[parentId] = struct[parentId] || {
  79888. items: []
  79889. };
  79890. tmpItems = struct[parentId].items
  79891. } else {
  79892. tmpItems = rootNodes
  79893. }
  79894. tmpItems.push(currentItem)
  79895. }
  79896. treeFiller({
  79897. struct: struct,
  79898. idField: idField
  79899. }, rootNodes);
  79900. for (item in struct) {
  79901. struct[item] && rootNodes.push(struct[item])
  79902. }
  79903. return {
  79904. items: rootNodes,
  79905. isPlain: true
  79906. }
  79907. };
  79908. function treeFiller(context, items) {
  79909. var currentItem;
  79910. var i;
  79911. var struct = context.struct;
  79912. var id;
  79913. for (i = 0; i < items.length; i++) {
  79914. currentItem = items[i];
  79915. id = currentItem[context.idField];
  79916. if (struct[id]) {
  79917. currentItem.items = struct[id].items;
  79918. struct[id] = null;
  79919. treeFiller(context, currentItem.items)
  79920. }
  79921. }
  79922. }
  79923. },
  79924. /*!********************************************!*\
  79925. !*** ./artifacts/transpiled/viz/funnel.js ***!
  79926. \********************************************/
  79927. /*! dynamic exports provided */
  79928. /*! all exports used */
  79929. function(module, exports, __webpack_require__) {
  79930. var dxFunnel = __webpack_require__( /*! ./funnel/funnel */ 425);
  79931. dxFunnel.addPlugin(__webpack_require__( /*! ./funnel/label */ 841).plugin);
  79932. dxFunnel.addPlugin(__webpack_require__( /*! ./core/export */ 93).plugin);
  79933. dxFunnel.addPlugin(__webpack_require__( /*! ./core/title */ 105).plugin);
  79934. dxFunnel.addPlugin(__webpack_require__( /*! ./components/legend */ 201).plugin);
  79935. dxFunnel.addPlugin(__webpack_require__( /*! ./funnel/tracker */ 842).plugin);
  79936. dxFunnel.addPlugin(__webpack_require__( /*! ./funnel/tooltip */ 843).plugin);
  79937. dxFunnel.addPlugin(__webpack_require__( /*! ./core/loading_indicator */ 119).plugin);
  79938. module.exports = dxFunnel
  79939. },
  79940. /*!***************************************************!*\
  79941. !*** ./artifacts/transpiled/viz/funnel/tiling.js ***!
  79942. \***************************************************/
  79943. /*! dynamic exports provided */
  79944. /*! all exports used */
  79945. function(module, exports, __webpack_require__) {
  79946. var _normalizeEnum = __webpack_require__( /*! ../core/utils */ 10).normalizeEnum;
  79947. var algorithms = {};
  79948. var defaultAlgorithm;
  79949. exports.getAlgorithm = function(name) {
  79950. return algorithms[_normalizeEnum(name)] || defaultAlgorithm
  79951. };
  79952. exports.addAlgorithm = function(name, callback, setDefault) {
  79953. algorithms[name] = callback;
  79954. if (setDefault) {
  79955. defaultAlgorithm = algorithms[name]
  79956. }
  79957. }
  79958. },
  79959. /*!**********************************************************!*\
  79960. !*** ./artifacts/transpiled/viz/funnel/tiling.funnel.js ***!
  79961. \**********************************************************/
  79962. /*! dynamic exports provided */
  79963. /*! all exports used */
  79964. function(module, exports, __webpack_require__) {
  79965. var CENTER = .5;
  79966. module.exports = {
  79967. getFigures: function(data) {
  79968. var height = 1 / data.length;
  79969. return data.map(function(value, index, array) {
  79970. var nextValue = array[index + 1] ? array[index + 1] : array[index];
  79971. return [CENTER - value / 2, height * index, CENTER + value / 2, height * index, CENTER + nextValue / 2, height * (index + 1), CENTER - nextValue / 2, height * (index + 1)]
  79972. })
  79973. },
  79974. normalizeValues: function(items) {
  79975. var max = items.reduce(function(max, item) {
  79976. return Math.max(item.value, max)
  79977. }, items[0] && items[0].value || 0);
  79978. return items.map(function(item) {
  79979. return item.value / max
  79980. })
  79981. }
  79982. }
  79983. },
  79984. /*!***********************************************************!*\
  79985. !*** ./artifacts/transpiled/viz/funnel/tiling.pyramid.js ***!
  79986. \***********************************************************/
  79987. /*! dynamic exports provided */
  79988. /*! all exports used */
  79989. function(module, exports, __webpack_require__) {
  79990. var CENTER = .5;
  79991. var LEFTCORNER = 0;
  79992. var RIGHTCORNER = 1;
  79993. module.exports = {
  79994. getFigures: function(data, neckWidth, neckHeight) {
  79995. var height = 0;
  79996. var y = 0;
  79997. var x = 0;
  79998. var offsetX = 0;
  79999. var halfNeckWidth = neckWidth / 2;
  80000. var offsetFromCorner = CENTER - halfNeckWidth;
  80001. var funnelHeight = 1 - neckHeight;
  80002. var neckLeftCorner = CENTER - halfNeckWidth;
  80003. var neckRightCorner = CENTER + halfNeckWidth;
  80004. return data.map(function(value) {
  80005. x = offsetX;
  80006. y = height;
  80007. height += value;
  80008. offsetX = offsetFromCorner * height / funnelHeight;
  80009. if (y <= funnelHeight && height <= funnelHeight) {
  80010. return [x, y, RIGHTCORNER - x, y, RIGHTCORNER - offsetX, height, LEFTCORNER + offsetX, height]
  80011. } else {
  80012. if (y <= funnelHeight && height > funnelHeight) {
  80013. return [x, y, RIGHTCORNER - x, y, neckRightCorner, funnelHeight, neckRightCorner, height, neckLeftCorner, height, neckLeftCorner, funnelHeight]
  80014. } else {
  80015. return [neckLeftCorner, y, neckRightCorner, y, neckRightCorner, height, neckLeftCorner, height]
  80016. }
  80017. }
  80018. })
  80019. },
  80020. normalizeValues: function(items) {
  80021. var sum = items.reduce(function(sum, item) {
  80022. return sum + item.value
  80023. }, 0);
  80024. return items.map(function(item) {
  80025. return item.value / sum
  80026. })
  80027. }
  80028. }
  80029. },
  80030. /*!*************************************************!*\
  80031. !*** ./artifacts/transpiled/viz/funnel/item.js ***!
  80032. \*************************************************/
  80033. /*! dynamic exports provided */
  80034. /*! all exports used */
  80035. function(module, exports, __webpack_require__) {
  80036. var states = ["normal", "hover", "selection", "selection"];
  80037. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  80038. function parseStyles(color, style, baseStyle) {
  80039. var border = style.border;
  80040. var baseBorder = baseStyle.border;
  80041. var borderVisible = isDefined(border.visible) ? border.visible : baseBorder.visible;
  80042. var borderWidth = isDefined(border.width) ? border.width : baseBorder.width;
  80043. return {
  80044. fill: color,
  80045. hatching: style.hatching,
  80046. stroke: border.color || baseBorder.color,
  80047. "stroke-width": borderVisible ? borderWidth : 0
  80048. }
  80049. }
  80050. function Item(widget, options) {
  80051. var that = this;
  80052. var data = options.data;
  80053. that.code = 0;
  80054. that.widget = widget;
  80055. that.figure = options.figure;
  80056. that.argument = data.argument;
  80057. that.value = data.value;
  80058. that.data = data.dataItem;
  80059. that.percent = options.percent;
  80060. that.id = options.id;
  80061. that.color = options.color;
  80062. that.states = {
  80063. normal: parseStyles(options.color, options.itemOptions, options.itemOptions),
  80064. hover: parseStyles(options.color, options.itemOptions.hoverStyle, options.itemOptions),
  80065. selection: parseStyles(options.color, options.itemOptions.selectionStyle, options.itemOptions)
  80066. }
  80067. }
  80068. Item.prototype = {
  80069. getState: function() {
  80070. return states[this.code]
  80071. },
  80072. getNormalStyle: function() {
  80073. return this.states.normal
  80074. },
  80075. setHover: function() {
  80076. this.hover(true)
  80077. },
  80078. hover: function(state) {
  80079. if (!this.widget._getOption("hoverEnabled", true) || state === this.isHovered()) {
  80080. return
  80081. }
  80082. this.widget._suspend();
  80083. state && this.widget.clearHover();
  80084. this.setState(1, state);
  80085. this.widget._eventTrigger("hoverChanged", {
  80086. item: this
  80087. });
  80088. this.widget._resume()
  80089. },
  80090. setState: function(code, state) {
  80091. if (state) {
  80092. this.code |= code
  80093. } else {
  80094. this.code &= ~code
  80095. }
  80096. this.widget._applyTilesAppearance()
  80097. },
  80098. select: function(state) {
  80099. var mode = this.widget._getOption("selectionMode", true);
  80100. if ("none" === mode || state === this.isSelected()) {
  80101. return
  80102. }
  80103. this.widget._suspend();
  80104. if (state && "multiple" !== mode) {
  80105. this.widget.clearSelection()
  80106. }
  80107. this.setState(2, state);
  80108. this.widget._eventTrigger("selectionChanged", {
  80109. item: this
  80110. });
  80111. this.widget._resume()
  80112. },
  80113. showTooltip: function(coords) {
  80114. this.widget._showTooltip(this.id, coords)
  80115. },
  80116. getColor: function() {
  80117. return this.color
  80118. },
  80119. isHovered: function() {
  80120. return !!(1 & this.code)
  80121. },
  80122. isSelected: function() {
  80123. return !!(2 & this.code)
  80124. }
  80125. };
  80126. module.exports = Item
  80127. },
  80128. /*!**************************************************!*\
  80129. !*** ./artifacts/transpiled/viz/funnel/label.js ***!
  80130. \**************************************************/
  80131. /*! dynamic exports provided */
  80132. /*! all exports used */
  80133. function(module, exports, __webpack_require__) {
  80134. var _label = __webpack_require__( /*! ../series/points/label */ 246);
  80135. var _label2 = _interopRequireDefault(_label);
  80136. var _utils = __webpack_require__( /*! ../core/utils */ 10);
  80137. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
  80138. var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
  80139. function _interopRequireDefault(obj) {
  80140. return obj && obj.__esModule ? obj : {
  80141. "default": obj
  80142. }
  80143. }
  80144. function _slicedToArray(arr, i) {
  80145. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest()
  80146. }
  80147. function _nonIterableRest() {
  80148. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  80149. }
  80150. function _iterableToArrayLimit(arr, i) {
  80151. var _i = null == arr ? null : "undefined" !== typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  80152. if (null == _i) {
  80153. return
  80154. }
  80155. var _arr = [];
  80156. var _n = true;
  80157. var _d = false;
  80158. var _s, _e;
  80159. try {
  80160. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  80161. _arr.push(_s.value);
  80162. if (i && _arr.length === i) {
  80163. break
  80164. }
  80165. }
  80166. } catch (err) {
  80167. _d = true;
  80168. _e = err
  80169. } finally {
  80170. try {
  80171. if (!_n && null != _i.return) {
  80172. _i.return()
  80173. }
  80174. } finally {
  80175. if (_d) {
  80176. throw _e
  80177. }
  80178. }
  80179. }
  80180. return _arr
  80181. }
  80182. function _arrayWithHoles(arr) {
  80183. if (Array.isArray(arr)) {
  80184. return arr
  80185. }
  80186. }
  80187. function _toConsumableArray(arr) {
  80188. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread()
  80189. }
  80190. function _nonIterableSpread() {
  80191. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  80192. }
  80193. function _unsupportedIterableToArray(o, minLen) {
  80194. if (!o) {
  80195. return
  80196. }
  80197. if ("string" === typeof o) {
  80198. return _arrayLikeToArray(o, minLen)
  80199. }
  80200. var n = Object.prototype.toString.call(o).slice(8, -1);
  80201. if ("Object" === n && o.constructor) {
  80202. n = o.constructor.name
  80203. }
  80204. if ("Map" === n || "Set" === n) {
  80205. return Array.from(o)
  80206. }
  80207. if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
  80208. return _arrayLikeToArray(o, minLen)
  80209. }
  80210. }
  80211. function _iterableToArray(iter) {
  80212. if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) {
  80213. return Array.from(iter)
  80214. }
  80215. }
  80216. function _arrayWithoutHoles(arr) {
  80217. if (Array.isArray(arr)) {
  80218. return _arrayLikeToArray(arr)
  80219. }
  80220. }
  80221. function _arrayLikeToArray(arr, len) {
  80222. if (null == len || len > arr.length) {
  80223. len = arr.length
  80224. }
  80225. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  80226. arr2[i] = arr[i]
  80227. }
  80228. return arr2
  80229. }
  80230. var OUTSIDE_POSITION = "outside";
  80231. var INSIDE_POSITION = "inside";
  80232. var OUTSIDE_LABEL_INDENT = 5;
  80233. var COLUMNS_LABEL_INDENT = 20;
  80234. var CONNECTOR_INDENT = 4;
  80235. var PREVENT_EMPTY_PIXEL_OFFSET = 1;
  80236. function getLabelIndent(pos) {
  80237. pos = (0, _utils.normalizeEnum)(pos);
  80238. if (pos === OUTSIDE_POSITION) {
  80239. return OUTSIDE_LABEL_INDENT
  80240. } else {
  80241. if (pos === INSIDE_POSITION) {
  80242. return 0
  80243. }
  80244. }
  80245. return COLUMNS_LABEL_INDENT
  80246. }
  80247. function isOutsidePosition(pos) {
  80248. pos = (0, _utils.normalizeEnum)(pos);
  80249. return pos === OUTSIDE_POSITION || pos !== INSIDE_POSITION
  80250. }
  80251. function correctYForInverted(y, bBox, inverted) {
  80252. return inverted ? y - bBox.height : y
  80253. }
  80254. function getOutsideRightLabelPosition(coords, bBox, options, inverted) {
  80255. return {
  80256. x: coords[2] + options.horizontalOffset + OUTSIDE_LABEL_INDENT,
  80257. y: correctYForInverted(coords[3] + options.verticalOffset, bBox, inverted)
  80258. }
  80259. }
  80260. function getOutsideLeftLabelPosition(coords, bBox, options, inverted) {
  80261. return {
  80262. x: coords[0] - bBox.width - options.horizontalOffset - OUTSIDE_LABEL_INDENT,
  80263. y: correctYForInverted(coords[1] + options.verticalOffset, bBox, inverted)
  80264. }
  80265. }
  80266. function getInsideLabelPosition(coords, bBox, options) {
  80267. var width = coords[2] - coords[0];
  80268. var height = coords[7] - coords[1];
  80269. return {
  80270. x: coords[0] + width / 2 + options.horizontalOffset - bBox.width / 2,
  80271. y: coords[1] + options.verticalOffset + height / 2 - bBox.height / 2
  80272. }
  80273. }
  80274. function getColumnLabelRightPosition(labelRect, rect, textAlignment) {
  80275. return function(coords, bBox, options, inverted) {
  80276. return {
  80277. x: "left" === textAlignment ? rect[2] + options.horizontalOffset + COLUMNS_LABEL_INDENT : labelRect[2] - bBox.width,
  80278. y: correctYForInverted(coords[3] + options.verticalOffset, bBox, inverted)
  80279. }
  80280. }
  80281. }
  80282. function getColumnLabelLeftPosition(labelRect, rect, textAlignment) {
  80283. return function(coords, bBox, options, inverted) {
  80284. return {
  80285. x: "left" === textAlignment ? labelRect[0] : rect[0] - bBox.width - options.horizontalOffset - COLUMNS_LABEL_INDENT,
  80286. y: correctYForInverted(coords[3] + options.verticalOffset, bBox, inverted)
  80287. }
  80288. }
  80289. }
  80290. function getConnectorStrategy(options, inverted) {
  80291. var isLeftPos = "left" === options.horizontalAlignment;
  80292. var connectorIndent = isLeftPos ? CONNECTOR_INDENT : -CONNECTOR_INDENT;
  80293. var verticalCorrection = inverted ? -PREVENT_EMPTY_PIXEL_OFFSET : 0;
  80294. function getFigureCenter(figure) {
  80295. return isLeftPos ? [figure[0] + PREVENT_EMPTY_PIXEL_OFFSET, figure[1] + verticalCorrection] : [figure[2] - PREVENT_EMPTY_PIXEL_OFFSET, figure[3] + verticalCorrection]
  80296. }
  80297. return {
  80298. isLabelInside: function() {
  80299. return !isOutsidePosition(options.position)
  80300. },
  80301. getFigureCenter: getFigureCenter,
  80302. prepareLabelPoints: function(bBox) {
  80303. var x = bBox.x + connectorIndent;
  80304. var y = bBox.y;
  80305. var x1 = x + bBox.width;
  80306. return _toConsumableArray(Array(bBox.height + 1)).map(function(_, i) {
  80307. return [x, y + i]
  80308. }).concat(_toConsumableArray(Array(bBox.height + 1)).map(function(_, i) {
  80309. return [x1, y + i]
  80310. }))
  80311. },
  80312. isHorizontal: function() {
  80313. return true
  80314. },
  80315. findFigurePoint: function(figure) {
  80316. return getFigureCenter(figure)
  80317. },
  80318. adjustPoints: function(points) {
  80319. return points.map(Math.round)
  80320. }
  80321. }
  80322. }
  80323. function getLabelOptions(labelOptions, defaultColor, defaultTextAlignment) {
  80324. var opt = labelOptions || {};
  80325. var labelFont = (0, _extend.extend)({}, opt.font) || {};
  80326. var labelBorder = opt.border || {};
  80327. var labelConnector = opt.connector || {};
  80328. var backgroundAttr = {
  80329. fill: opt.backgroundColor || defaultColor,
  80330. "stroke-width": labelBorder.visible ? labelBorder.width || 0 : 0,
  80331. stroke: labelBorder.visible && labelBorder.width ? labelBorder.color : "none",
  80332. dashStyle: labelBorder.dashStyle
  80333. };
  80334. var connectorAttr = {
  80335. stroke: labelConnector.visible && labelConnector.width ? labelConnector.color || defaultColor : "none",
  80336. "stroke-width": labelConnector.visible ? labelConnector.width || 0 : 0,
  80337. opacity: labelConnector.opacity
  80338. };
  80339. labelFont.color = "none" === opt.backgroundColor && "#ffffff" === (0, _utils.normalizeEnum)(labelFont.color) && "inside" !== opt.position ? defaultColor : labelFont.color;
  80340. return {
  80341. format: opt.format,
  80342. textAlignment: opt.textAlignment || (isOutsidePosition(opt.position) ? defaultTextAlignment : "center"),
  80343. customizeText: opt.customizeText,
  80344. attributes: {
  80345. font: labelFont
  80346. },
  80347. visible: 0 !== labelFont.size ? opt.visible : false,
  80348. showForZeroValues: opt.showForZeroValues,
  80349. horizontalOffset: opt.horizontalOffset,
  80350. verticalOffset: opt.verticalOffset,
  80351. background: backgroundAttr,
  80352. connector: connectorAttr,
  80353. wordWrap: labelOptions.wordWrap,
  80354. textOverflow: labelOptions.textOverflow
  80355. }
  80356. }
  80357. function correctLabelPosition(pos, bBox, rect) {
  80358. if (pos.x < rect[0]) {
  80359. pos.x = rect[0]
  80360. }
  80361. if (pos.x + bBox.width > rect[2]) {
  80362. pos.x = rect[2] - bBox.width
  80363. }
  80364. if (pos.y < rect[1]) {
  80365. pos.y = rect[1]
  80366. }
  80367. if (pos.y + bBox.height > rect[3]) {
  80368. pos.y = rect[3] - bBox.height
  80369. }
  80370. return pos
  80371. }
  80372. function removeEmptySpace(labels, requiredSpace, startPoint) {
  80373. labels.reduce(function(requiredSpace, label, index, labels) {
  80374. var prevLabel = labels[index + 1];
  80375. if (requiredSpace > 0) {
  80376. var bBox = label.getBoundingRect();
  80377. var point = prevLabel ? prevLabel.getBoundingRect().y + prevLabel.getBoundingRect().height : startPoint;
  80378. var emptySpace = bBox.y - point;
  80379. var shift = Math.min(emptySpace, requiredSpace);
  80380. labels.slice(0, index + 1).forEach(function(label) {
  80381. var bBox = label.getBoundingRect();
  80382. label.shift(bBox.x, bBox.y - shift)
  80383. });
  80384. requiredSpace -= shift
  80385. }
  80386. return requiredSpace
  80387. }, requiredSpace)
  80388. }
  80389. exports.plugin = {
  80390. name: "lables",
  80391. init: _common.noop,
  80392. dispose: _common.noop,
  80393. extenders: {
  80394. _initCore: function() {
  80395. this._labelsGroup = this._renderer.g().attr({
  80396. "class": this._rootClassPrefix + "-labels"
  80397. }).append(this._renderer.root);
  80398. this._labels = []
  80399. },
  80400. _applySize: function() {
  80401. var options = this._getOption("label");
  80402. var adaptiveLayout = this._getOption("adaptiveLayout");
  80403. var rect = this._rect;
  80404. var labelWidth = 0;
  80405. var width = rect[2] - rect[0];
  80406. this._labelRect = rect.slice();
  80407. if (!this._labels.length || !isOutsidePosition(options.position)) {
  80408. if ((0, _utils.normalizeEnum)("none" !== this._getOption("resolveLabelOverlapping", true))) {
  80409. this._labels.forEach(function(l) {
  80410. return !l.isVisible() && l.draw(true)
  80411. })
  80412. }
  80413. return
  80414. }
  80415. var groupWidth = this._labels.map(function(label) {
  80416. label.resetEllipsis();
  80417. return label.getBoundingRect().width
  80418. }).reduce(function(max, width) {
  80419. return Math.max(max, width)
  80420. }, 0);
  80421. labelWidth = groupWidth + options.horizontalOffset + getLabelIndent(options.position);
  80422. if (!adaptiveLayout.keepLabels && width - labelWidth < adaptiveLayout.width) {
  80423. this._labels.forEach(function(label) {
  80424. label.draw(false)
  80425. });
  80426. return
  80427. } else {
  80428. if (width - labelWidth < adaptiveLayout.width) {
  80429. labelWidth = width - adaptiveLayout.width;
  80430. labelWidth = labelWidth > 0 ? labelWidth : 0
  80431. }
  80432. this._labels.forEach(function(label) {
  80433. label.draw(true)
  80434. })
  80435. }
  80436. if ("left" === options.horizontalAlignment) {
  80437. rect[0] += labelWidth
  80438. } else {
  80439. rect[2] -= labelWidth
  80440. }
  80441. },
  80442. _buildNodes: function() {
  80443. this._createLabels()
  80444. },
  80445. _change_TILING: function() {
  80446. var that = this;
  80447. var options = that._getOption("label");
  80448. var getCoords = getInsideLabelPosition;
  80449. var inverted = that._getOption("inverted", true);
  80450. var textAlignment;
  80451. if (isOutsidePosition(options.position)) {
  80452. if ((0, _utils.normalizeEnum)(options.position) === OUTSIDE_POSITION) {
  80453. getCoords = "left" === options.horizontalAlignment ? getOutsideLeftLabelPosition : getOutsideRightLabelPosition
  80454. } else {
  80455. textAlignment = this._defaultLabelTextAlignment();
  80456. getCoords = "left" === options.horizontalAlignment ? getColumnLabelLeftPosition(this._labelRect, this._rect, textAlignment) : getColumnLabelRightPosition(this._labelRect, this._rect, textAlignment)
  80457. }
  80458. }
  80459. that._labels.forEach(function(label, index) {
  80460. var item = that._items[index];
  80461. var borderWidth = item.getNormalStyle()["stroke-width"];
  80462. var halfBorderWidth = inverted ? borderWidth / 2 : -borderWidth / 2;
  80463. var coords = halfBorderWidth ? item.coords.map(function(coord, index) {
  80464. if (1 === index || 3 === index) {
  80465. return coord - halfBorderWidth
  80466. } else {
  80467. if (2 === index) {
  80468. return coord - borderWidth
  80469. } else {
  80470. if (0 === index) {
  80471. return coord + borderWidth
  80472. }
  80473. }
  80474. }
  80475. return coord
  80476. }) : item.coords;
  80477. if (!options.showForZeroValues && 0 === item.value) {
  80478. label.draw(false);
  80479. return
  80480. }
  80481. if (isOutsidePosition(options.position)) {
  80482. that._correctLabelWidth(label, item.coords, options)
  80483. }
  80484. var bBox = label.getBoundingRect();
  80485. var pos = correctLabelPosition(getCoords(coords, bBox, options, inverted), bBox, that._labelRect);
  80486. label.setFigureToDrawConnector(coords);
  80487. label.shift(pos.x, pos.y)
  80488. });
  80489. that._resolveLabelOverlapping()
  80490. }
  80491. },
  80492. members: {
  80493. _resolveLabelOverlapping: function() {
  80494. var that = this;
  80495. var resolveLabelOverlapping = (0, _utils.normalizeEnum)(that._getOption("resolveLabelOverlapping", true));
  80496. var labels = this._getOption("inverted", true) ? that._labels.slice().reverse() : that._labels;
  80497. if ("hide" === resolveLabelOverlapping) {
  80498. labels.reduce(function(height, label) {
  80499. if (label.getBoundingRect().y < height) {
  80500. label.hide()
  80501. } else {
  80502. height = label.getBoundingRect().y + label.getBoundingRect().height
  80503. }
  80504. return height
  80505. }, 0)
  80506. } else {
  80507. if ("shift" === resolveLabelOverlapping) {
  80508. var maxHeight = this._labelRect[3];
  80509. labels.reduce(function(_ref, label, index, labels) {
  80510. var _ref2 = _slicedToArray(_ref, 2),
  80511. height = _ref2[0],
  80512. emptySpace = _ref2[1];
  80513. var bBox = label.getBoundingRect();
  80514. var y = bBox.y;
  80515. if (bBox.y < height) {
  80516. label.shift(bBox.x, height);
  80517. y = height
  80518. }
  80519. if (y - height > 0) {
  80520. emptySpace += y - height
  80521. }
  80522. if (y + bBox.height > maxHeight) {
  80523. if (emptySpace && emptySpace > y + bBox.height - maxHeight) {
  80524. removeEmptySpace(labels.slice(0, index).reverse(), y + bBox.height - maxHeight, that._labelRect[1]);
  80525. emptySpace -= y + bBox.height - maxHeight;
  80526. label.shift(bBox.x, y - (y + bBox.height - maxHeight));
  80527. height = y - (y + bBox.height - maxHeight) + bBox.height
  80528. } else {
  80529. label.hide()
  80530. }
  80531. } else {
  80532. height = y + bBox.height
  80533. }
  80534. return [height, emptySpace]
  80535. }, [this._labelRect[1], 0])
  80536. }
  80537. }
  80538. },
  80539. _defaultLabelTextAlignment: function() {
  80540. return this._getOption("rtlEnabled", true) ? "right" : "left"
  80541. },
  80542. _correctLabelWidth: function(label, item, options) {
  80543. var isLeftPos = "left" === options.horizontalAlignment;
  80544. var minX = isLeftPos ? this._labelRect[0] : item[2];
  80545. var maxX = isLeftPos ? item[0] : this._labelRect[2];
  80546. var maxWidth = maxX - minX;
  80547. if (label.getBoundingRect().width > maxWidth) {
  80548. label.fit(maxWidth)
  80549. }
  80550. },
  80551. _createLabels: function() {
  80552. var that = this;
  80553. var labelOptions = that._getOption("label");
  80554. var connectorStrategy = getConnectorStrategy(labelOptions, that._getOption("inverted", true));
  80555. this._labelsGroup.clear();
  80556. if (!labelOptions.visible) {
  80557. return
  80558. }
  80559. this._labels = that._items.map(function(item) {
  80560. var label = new _label2.default.Label({
  80561. renderer: that._renderer,
  80562. labelsGroup: that._labelsGroup,
  80563. strategy: connectorStrategy
  80564. });
  80565. label.setOptions(getLabelOptions(labelOptions, item.color, that._defaultLabelTextAlignment()));
  80566. label.setData({
  80567. item: item,
  80568. value: item.value,
  80569. percent: item.percent
  80570. });
  80571. label.draw(true);
  80572. return label
  80573. });
  80574. if (this._labels.length && isOutsidePosition(labelOptions.position)) {
  80575. this._requestChange(["LAYOUT"])
  80576. }
  80577. }
  80578. },
  80579. customize: function(constructor) {
  80580. constructor.prototype._proxyData.push(function(x, y) {
  80581. var that = this;
  80582. var data;
  80583. that._labels.forEach(function(label, index) {
  80584. var rect = label.getBoundingRect();
  80585. if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) {
  80586. var pos = isOutsidePosition(that._getOption("label").position) ? "outside" : "inside";
  80587. data = {
  80588. id: index,
  80589. type: pos + "-label"
  80590. };
  80591. return true
  80592. }
  80593. });
  80594. return data
  80595. });
  80596. ["label", "resolveLabelOverlapping"].forEach(function(optionName) {
  80597. constructor.addChange({
  80598. code: optionName.toUpperCase(),
  80599. handler: function() {
  80600. this._createLabels();
  80601. this._requestChange(["LAYOUT"])
  80602. },
  80603. isThemeDependent: true,
  80604. isOptionChange: true,
  80605. option: optionName
  80606. })
  80607. })
  80608. },
  80609. fontFields: ["label.font"]
  80610. }
  80611. },
  80612. /*!****************************************************!*\
  80613. !*** ./artifacts/transpiled/viz/funnel/tracker.js ***!
  80614. \****************************************************/
  80615. /*! dynamic exports provided */
  80616. /*! all exports used */
  80617. function(module, exports, __webpack_require__) {
  80618. var proto = __webpack_require__( /*! ./funnel */ 425).prototype;
  80619. var Tracker = __webpack_require__( /*! ../components/tracker */ 252).Tracker;
  80620. var DATA_KEY_BASE = "__funnel_data_";
  80621. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  80622. var dataKeyModifier = 0;
  80623. proto._eventsMap.onItemClick = {
  80624. name: "itemClick"
  80625. };
  80626. proto._eventsMap.onLegendClick = {
  80627. name: "legendClick"
  80628. };
  80629. exports.plugin = {
  80630. name: "tracker",
  80631. init: function() {
  80632. var that = this;
  80633. var dataKey = DATA_KEY_BASE + dataKeyModifier++;
  80634. var getProxyData = function(e) {
  80635. var rootOffset = that._renderer.getRootOffset();
  80636. var x = Math.floor(e.pageX - rootOffset.left);
  80637. var y = Math.floor(e.pageY - rootOffset.top);
  80638. return that._hitTestTargets(x, y)
  80639. };
  80640. that._tracker = new Tracker({
  80641. widget: that,
  80642. root: that._renderer.root,
  80643. getData: function(e, tooltipData) {
  80644. var target = e.target;
  80645. var data = target[dataKey];
  80646. if (isDefined(data)) {
  80647. return data
  80648. }
  80649. var proxyData = getProxyData(e);
  80650. if (tooltipData && proxyData && "inside-label" !== proxyData.type) {
  80651. return
  80652. }
  80653. return proxyData && proxyData.id
  80654. },
  80655. getNode: function(index) {
  80656. return that._items[index]
  80657. },
  80658. click: function(e) {
  80659. var proxyData = getProxyData(e.event);
  80660. var dataType = proxyData && proxyData.type;
  80661. var event = "legend" === dataType ? "legendClick" : "itemClick";
  80662. that._eventTrigger(event, {
  80663. item: e.node,
  80664. event: e.event
  80665. })
  80666. }
  80667. });
  80668. exports._TESTS_dataKey = dataKey;
  80669. this._dataKey = dataKey
  80670. },
  80671. dispose: function() {
  80672. this._tracker.dispose()
  80673. },
  80674. extenders: {
  80675. _change_TILING: function() {
  80676. var dataKey = this._dataKey;
  80677. this._items.forEach(function(item, index) {
  80678. item.element.data(dataKey, index)
  80679. })
  80680. }
  80681. }
  80682. }
  80683. },
  80684. /*!****************************************************!*\
  80685. !*** ./artifacts/transpiled/viz/funnel/tooltip.js ***!
  80686. \****************************************************/
  80687. /*! dynamic exports provided */
  80688. /*! all exports used */
  80689. function(module, exports, __webpack_require__) {
  80690. var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
  80691. function getCoords(figureCoords, renderer) {
  80692. var offset = renderer.getRootOffset();
  80693. return [(figureCoords[0] + figureCoords[2]) / 2 + offset.left, (figureCoords[1] + figureCoords[5]) / 2 + offset.top]
  80694. }
  80695. exports.plugin = {
  80696. name: "funnel-tooltip",
  80697. init: noop,
  80698. dispose: noop,
  80699. extenders: {
  80700. _buildNodes: function() {
  80701. this.hideTooltip()
  80702. },
  80703. _change_TILING: function() {
  80704. if (this._tooltipIndex >= 0) {
  80705. this._moveTooltip(this._items[this._tooltipIndex])
  80706. }
  80707. }
  80708. },
  80709. members: {
  80710. hideTooltip: function() {
  80711. if (this._tooltipIndex >= 0) {
  80712. this._tooltipIndex = -1;
  80713. this._tooltip.hide()
  80714. }
  80715. },
  80716. _moveTooltip: function(item, coords) {
  80717. var xy = coords || item.coords && getCoords(item.coords, this._renderer) || [-1e3, -1e3];
  80718. this._tooltip.move(xy[0], xy[1], 0)
  80719. },
  80720. _showTooltip: function(index, coords) {
  80721. var that = this;
  80722. var tooltip = that._tooltip;
  80723. var item = that._items[index];
  80724. var state = that._tooltipIndex === index || tooltip.show({
  80725. value: item.value,
  80726. valueText: tooltip.formatValue(item.value),
  80727. percentText: tooltip.formatValue(item.percent, "percent"),
  80728. percent: item.percent,
  80729. item: item
  80730. }, {
  80731. x: 0,
  80732. y: 0,
  80733. offset: 0
  80734. }, {
  80735. item: item
  80736. });
  80737. if (state) {
  80738. that._moveTooltip(item, coords)
  80739. } else {
  80740. tooltip.hide()
  80741. }
  80742. that._tooltipIndex = state ? index : -1
  80743. }
  80744. },
  80745. customize: function(constructor) {
  80746. constructor.addPlugin(__webpack_require__( /*! ../core/tooltip */ 107).plugin)
  80747. }
  80748. }
  80749. },
  80750. /*!********************************************!*\
  80751. !*** ./artifacts/transpiled/viz/sankey.js ***!
  80752. \********************************************/
  80753. /*! dynamic exports provided */
  80754. /*! all exports used */
  80755. function(module, exports, __webpack_require__) {
  80756. var dxSankey = __webpack_require__( /*! ./sankey/sankey */ 426);
  80757. var setTooltipCustomOptions = __webpack_require__( /*! ./sankey/tooltip */ 849).setTooltipCustomOptions;
  80758. dxSankey.addPlugin(__webpack_require__( /*! ./core/export */ 93).plugin);
  80759. dxSankey.addPlugin(__webpack_require__( /*! ./core/title */ 105).plugin);
  80760. dxSankey.addPlugin(__webpack_require__( /*! ./sankey/tracker */ 850).plugin);
  80761. dxSankey.addPlugin(__webpack_require__( /*! ./core/loading_indicator */ 119).plugin);
  80762. dxSankey.addPlugin(__webpack_require__( /*! ./core/tooltip */ 107).plugin);
  80763. setTooltipCustomOptions(dxSankey);
  80764. module.exports = dxSankey
  80765. },
  80766. /*!******************************************************!*\
  80767. !*** ./artifacts/transpiled/viz/sankey/node_item.js ***!
  80768. \******************************************************/
  80769. /*! dynamic exports provided */
  80770. /*! all exports used */
  80771. function(module, exports, __webpack_require__) {
  80772. var states = ["normal", "hover"];
  80773. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  80774. function _compileAttrs(color, itemOptions, itemBaseOptions) {
  80775. var border = itemOptions.border;
  80776. var baseBorder = itemBaseOptions.border;
  80777. var borderVisible = isDefined(border.visible) ? border.visible : baseBorder.visible;
  80778. var borderWidth = isDefined(border.width) ? border.width : baseBorder.width;
  80779. var borderOpacity = isDefined(border.opacity) ? border.opacity : isDefined(baseBorder.opacity) ? baseBorder.opacity : 1;
  80780. var opacity = isDefined(itemOptions.opacity) ? itemOptions.opacity : isDefined(itemBaseOptions.opacity) ? itemBaseOptions.opacity : 1;
  80781. return {
  80782. fill: itemOptions.color || color,
  80783. "stroke-width": borderVisible ? borderWidth : 0,
  80784. stroke: itemOptions.border.color || itemBaseOptions.border.color,
  80785. "stroke-opacity": borderOpacity,
  80786. opacity: opacity,
  80787. hatching: itemOptions.hatching
  80788. }
  80789. }
  80790. function compileLabelAttrs(labelOptions, filter, node) {
  80791. var _patchFontOptions = __webpack_require__( /*! ../core/utils */ 10).patchFontOptions;
  80792. if (labelOptions.useNodeColors) {
  80793. labelOptions.font.color = node.color
  80794. }
  80795. var borderVisible = isDefined(labelOptions.border.visible) ? labelOptions.border.visible : false;
  80796. var borderWidth = isDefined(labelOptions.border.width) ? labelOptions.border.width : 0;
  80797. var borderColor = isDefined(labelOptions.border.color) ? labelOptions.border.color : labelOptions.font.color;
  80798. var borderOpacity = isDefined(labelOptions.border.opacity) ? labelOptions.border.opacity : 1;
  80799. var attr = {
  80800. filter: filter
  80801. };
  80802. if (borderVisible && borderWidth) {
  80803. attr.stroke = borderColor;
  80804. attr["stroke-width"] = borderVisible ? borderWidth : 0;
  80805. attr["stroke-opacity"] = borderOpacity
  80806. }
  80807. return {
  80808. attr: attr,
  80809. css: _patchFontOptions(labelOptions.font)
  80810. }
  80811. }
  80812. function Node(widget, params) {
  80813. var that = this;
  80814. var widgetOffset = widget._renderer.getRootOffset();
  80815. that.code = 0;
  80816. that.widget = widget;
  80817. that.color = params.color;
  80818. that.options = params.options;
  80819. that.rect = params.rect;
  80820. that.title = params.rect._name;
  80821. that.coords = {
  80822. x: params.rect.x + params.rect.width / 2 + widgetOffset.left,
  80823. y: params.rect.y + params.rect.height / 2 + widgetOffset.top
  80824. };
  80825. that.id = params.id;
  80826. that.linksIn = params.linksIn;
  80827. that.linksOut = params.linksOut;
  80828. this.states = {
  80829. normal: _compileAttrs(this.color, that.options, that.options),
  80830. hover: _compileAttrs(this.color, that.options.hoverStyle, that.options)
  80831. }
  80832. }
  80833. Node.prototype = {
  80834. compileAttrs: function() {
  80835. return _compileAttrs(this.color, this.options)
  80836. },
  80837. getState: function() {
  80838. return states[this.code]
  80839. },
  80840. isHovered: function() {
  80841. return !!(1 & this.code)
  80842. },
  80843. setState: function(code, state) {
  80844. var _this = this;
  80845. if (state) {
  80846. this.code |= code
  80847. } else {
  80848. this.code &= ~code
  80849. }
  80850. if (state) {
  80851. this.linksIn.concat(this.linksOut).forEach(function(adjacentLink) {
  80852. _this.widget._links[adjacentLink.index].setAdjacentNodeHover(true)
  80853. })
  80854. } else {
  80855. this.widget._links.forEach(function(link) {
  80856. link.isAdjacentNodeHovered() && link.adjacentNodeHover(false)
  80857. });
  80858. this.hideTooltip()
  80859. }
  80860. this.widget._applyNodesAppearance();
  80861. this.widget._applyLinksAppearance()
  80862. },
  80863. hover: function(state) {
  80864. if (!this.widget._getOption("hoverEnabled", true) || state === this.isHovered()) {
  80865. return
  80866. }
  80867. this.widget._suspend();
  80868. state && this.widget.clearHover();
  80869. this.setState(1, state);
  80870. this.widget._eventTrigger("nodeHoverChanged", {
  80871. target: this
  80872. });
  80873. this.widget._resume()
  80874. },
  80875. setHover: function() {
  80876. this.hover(true)
  80877. },
  80878. showTooltip: function(coords) {
  80879. this.widget._getOption("hoverEnabled", true) && this.widget._tooltip && this.widget._tooltip.show({
  80880. type: "node",
  80881. info: {
  80882. title: this.title,
  80883. weightIn: this.linksIn.reduce(function(previousValue, currentValue) {
  80884. return previousValue + currentValue.weight
  80885. }, 0),
  80886. weightOut: this.linksOut.reduce(function(previousValue, currentValue) {
  80887. return previousValue + currentValue.weight
  80888. }, 0)
  80889. }
  80890. }, "undefined" !== typeof coords ? {
  80891. x: coords[0],
  80892. y: coords[1]
  80893. } : this.coords)
  80894. },
  80895. hideTooltip: function() {
  80896. this.widget._tooltip && this.widget._tooltip.hide()
  80897. },
  80898. getLabelAttributes: function(labelSettings, filter) {
  80899. return compileLabelAttrs(labelSettings, filter, this)
  80900. }
  80901. };
  80902. module.exports = Node
  80903. },
  80904. /*!******************************************************!*\
  80905. !*** ./artifacts/transpiled/viz/sankey/link_item.js ***!
  80906. \******************************************************/
  80907. /*! dynamic exports provided */
  80908. /*! all exports used */
  80909. function(module, exports, __webpack_require__) {
  80910. var _constants = __webpack_require__( /*! ./constants */ 427);
  80911. var states = ["normal", "adjacentNodeHover", "hover"];
  80912. var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
  80913. function compileAttrs(color, itemOptions, itemBaseOptions, gradient) {
  80914. var border = itemOptions.border;
  80915. var baseBorder = itemBaseOptions.border;
  80916. var borderVisible = isDefined(border.visible) ? border.visible : baseBorder.visible;
  80917. var borderWidth = isDefined(border.width) ? border.width : baseBorder.width;
  80918. var borderOpacity = isDefined(border.opacity) ? border.opacity : isDefined(baseBorder.opacity) ? baseBorder.opacity : 1;
  80919. var opacity = isDefined(itemOptions.opacity) ? itemOptions.opacity : isDefined(itemBaseOptions.opacity) ? itemBaseOptions.opacity : 1;
  80920. var fill = itemOptions.color || color;
  80921. if (itemBaseOptions.colorMode === _constants.COLOR_MODE_TARGET || itemBaseOptions.colorMode === _constants.COLOR_MODE_SOURCE) {
  80922. fill = color
  80923. } else {
  80924. if (itemBaseOptions.colorMode === _constants.COLOR_MODE_GRADIENT && gradient && isDefined(gradient.id)) {
  80925. fill = gradient.id
  80926. }
  80927. }
  80928. return {
  80929. fill: fill,
  80930. "stroke-width": borderVisible ? borderWidth : 0,
  80931. stroke: itemOptions.border.color || itemBaseOptions.border.color,
  80932. "stroke-opacity": borderOpacity,
  80933. opacity: opacity,
  80934. hatching: itemOptions.hatching
  80935. }
  80936. }
  80937. function Link(widget, params) {
  80938. var that = this;
  80939. var widgetOffset = widget._renderer.getRootOffset();
  80940. that.code = 0;
  80941. that.widget = widget;
  80942. that.color = params.color;
  80943. that.connection = params.connection;
  80944. that.d = params.d;
  80945. that.options = params.options;
  80946. that.boundingRect = params.boundingRect, that.coords = {
  80947. x: params.boundingRect.x + params.boundingRect.width / 2 + widgetOffset.left,
  80948. y: params.boundingRect.y + params.boundingRect.height / 2 + widgetOffset.top
  80949. };
  80950. that.states = {
  80951. normal: compileAttrs(that.color, that.options, that.options, params.gradient),
  80952. adjacentNodeHover: compileAttrs(that.color, {
  80953. opacity: 0,
  80954. border: {}
  80955. }, that.options, params.gradient),
  80956. hover: compileAttrs(that.color, {
  80957. opacity: 0,
  80958. border: {}
  80959. }, that.options, params.gradient)
  80960. };
  80961. that.overlayStates = {
  80962. normal: compileAttrs(that.color, {
  80963. opacity: 0,
  80964. border: {}
  80965. }, that.options),
  80966. adjacentNodeHover: compileAttrs(that.color, that.options.hoverStyle, that.options),
  80967. hover: compileAttrs(that.color, that.options.hoverStyle, that.options)
  80968. }
  80969. }
  80970. Link.prototype = {
  80971. getState: function() {
  80972. return states[this.code]
  80973. },
  80974. isHovered: function() {
  80975. return 2 === this.code
  80976. },
  80977. isAdjacentNodeHovered: function() {
  80978. return 1 === this.code
  80979. },
  80980. setState: function(code, state) {
  80981. if (state) {
  80982. this.code = code
  80983. } else {
  80984. this.code = 0;
  80985. this.hideTooltip()
  80986. }
  80987. this.widget._applyLinksAppearance()
  80988. },
  80989. setHover: function() {
  80990. this.hover(true)
  80991. },
  80992. hover: function(state) {
  80993. if (!this.widget._getOption("hoverEnabled", true) || state === this.isHovered()) {
  80994. return
  80995. }
  80996. this.widget._suspend();
  80997. state && this.widget.clearHover();
  80998. this.setState(2, state);
  80999. this.widget._eventTrigger("linkHoverChanged", {
  81000. target: this
  81001. });
  81002. this.widget._resume()
  81003. },
  81004. adjacentNodeHover: function(state) {
  81005. if (!this.widget._getOption("hoverEnabled", true) || state === this.isAdjacentNodeHovered()) {
  81006. return
  81007. }
  81008. this.widget._suspend();
  81009. this.setState(1, state);
  81010. this.widget._resume()
  81011. },
  81012. setAdjacentNodeHover: function() {
  81013. this.adjacentNodeHover(true)
  81014. },
  81015. showTooltip: function(coords) {
  81016. this.widget._getOption("hoverEnabled", true) && this.widget._tooltip && this.widget._tooltip.show({
  81017. type: "link",
  81018. info: {
  81019. source: this.connection.source,
  81020. target: this.connection.target,
  81021. weight: this.connection.weight
  81022. }
  81023. }, "undefined" !== typeof coords ? {
  81024. x: coords[0],
  81025. y: coords[1]
  81026. } : this.coords)
  81027. },
  81028. hideTooltip: function() {
  81029. this.widget._tooltip && this.widget._tooltip.hide()
  81030. }
  81031. };
  81032. module.exports = Link
  81033. },
  81034. /*!***************************************************!*\
  81035. !*** ./artifacts/transpiled/viz/sankey/layout.js ***!
  81036. \***************************************************/
  81037. /*! dynamic exports provided */
  81038. /*! all exports used */
  81039. function(module, exports, __webpack_require__) {
  81040. var _SPLINE_TENSION = .3;
  81041. var _ALIGNMENT_CENTER = "center";
  81042. var _ALIGNMENT_BOTTOM = "bottom";
  81043. var _ALIGNMENT_DEFAULT = _ALIGNMENT_CENTER;
  81044. var graphModule = __webpack_require__( /*! ./graph */ 428);
  81045. var validatorModule = __webpack_require__( /*! ./data_validator */ 848);
  81046. var layout = {
  81047. _weightPerPixel: null,
  81048. _getCascadeIdx: function(nodeTitle, cascadesConfig) {
  81049. var nodeInfo = cascadesConfig.filter(function(c) {
  81050. return c.name === nodeTitle
  81051. })[0];
  81052. if (nodeInfo.outgoing.length > 0) {
  81053. return nodeInfo.lp
  81054. } else {
  81055. return graphModule.routines.maxOfArray(cascadesConfig.map(function(c) {
  81056. return c.lp
  81057. }))
  81058. }
  81059. },
  81060. _getInWeightForNode: function(nodeTitle, links) {
  81061. var w = 0;
  81062. links.forEach(function(link) {
  81063. if (link[1] === nodeTitle) {
  81064. w += link[2]
  81065. }
  81066. });
  81067. return w
  81068. },
  81069. _getOutWeightForNode: function(nodeTitle, links) {
  81070. var w = 0;
  81071. links.forEach(function(link) {
  81072. if (link[0] === nodeTitle) {
  81073. w += link[2]
  81074. }
  81075. });
  81076. return w
  81077. },
  81078. _computeCascades: function(links) {
  81079. var _this = this;
  81080. var cascadesConfig = graphModule.struct.computeLongestPaths(links);
  81081. var maxCascade = graphModule.routines.maxOfArray(cascadesConfig.map(function(c) {
  81082. return c.lp
  81083. }));
  81084. var cascades = [];
  81085. for (var i = 0; i < maxCascade + 1; i++) {
  81086. cascades.push({})
  81087. }
  81088. links.forEach(function(link) {
  81089. var cascade = cascades[_this._getCascadeIdx(link[0], cascadesConfig)];
  81090. if (!cascade[link[0]]) {
  81091. cascade[link[0]] = {
  81092. nodeTitle: link[0]
  81093. }
  81094. }
  81095. cascade = cascades[_this._getCascadeIdx(link[1], cascadesConfig)];
  81096. if (!cascade[link[1]]) {
  81097. cascade[link[1]] = {
  81098. nodeTitle: link[1]
  81099. }
  81100. }
  81101. });
  81102. cascades.forEach(function(cascade) {
  81103. Object.keys(cascade).forEach(function(nodeTitle) {
  81104. var node = cascade[nodeTitle];
  81105. node.inWeight = _this._getInWeightForNode(node.nodeTitle, links);
  81106. node.outWeight = _this._getOutWeightForNode(node.nodeTitle, links);
  81107. node.maxWeight = Math.max(node.inWeight, node.outWeight)
  81108. })
  81109. });
  81110. return cascades
  81111. },
  81112. _getWeightForCascade: function(cascades, cascadeIdx) {
  81113. var wMax = 0;
  81114. var cascade = cascades[cascadeIdx];
  81115. Object.keys(cascade).forEach(function(nodeTitle) {
  81116. wMax += Math.max(cascade[nodeTitle].inWeight, cascade[nodeTitle].outWeight)
  81117. });
  81118. return wMax
  81119. },
  81120. _getMaxWeightThroughCascades: function(cascades) {
  81121. var max = [];
  81122. cascades.forEach(function(cascade) {
  81123. var mW = 0;
  81124. Object.keys(cascade).forEach(function(nodeTitle) {
  81125. var node = cascade[nodeTitle];
  81126. mW += Math.max(node.inWeight, node.outWeight)
  81127. });
  81128. max.push(mW)
  81129. });
  81130. return graphModule.routines.maxOfArray(max)
  81131. },
  81132. _computeNodes: function(cascades, options) {
  81133. var _this2 = this;
  81134. var rects = [];
  81135. var maxWeight = this._getMaxWeightThroughCascades(cascades);
  81136. var maxNodeNum = graphModule.routines.maxOfArray(cascades.map(function(nodesInCascade) {
  81137. return Object.keys(nodesInCascade).length
  81138. }));
  81139. var nodePadding = options.nodePadding;
  81140. var heightAvailable = options.height - nodePadding * (maxNodeNum - 1);
  81141. if (heightAvailable < 0) {
  81142. nodePadding = 0;
  81143. heightAvailable = options.height - nodePadding * (maxNodeNum - 1)
  81144. }
  81145. this._weightPerPixel = maxWeight / heightAvailable;
  81146. var cascadeIdx = 0;
  81147. cascades.forEach(function(cascade) {
  81148. var cascadeRects = [];
  81149. var y = 0;
  81150. var nodesInCascade = Object.keys(cascade).length;
  81151. var cascadeHeight = _this2._getWeightForCascade(cascades, cascadeIdx) / _this2._weightPerPixel + nodePadding * (nodesInCascade - 1);
  81152. var cascadeAlign = _ALIGNMENT_DEFAULT;
  81153. if (Array.isArray(options.nodeAlign)) {
  81154. cascadeAlign = cascadeIdx < options.nodeAlign.length ? options.nodeAlign[cascadeIdx] : _ALIGNMENT_DEFAULT
  81155. } else {
  81156. cascadeAlign = options.nodeAlign
  81157. }
  81158. if (cascadeAlign === _ALIGNMENT_BOTTOM) {
  81159. y = options.height - cascadeHeight
  81160. } else {
  81161. if (cascadeAlign === _ALIGNMENT_CENTER) {
  81162. y = .5 * (options.height - cascadeHeight)
  81163. }
  81164. }
  81165. y = Math.round(y);
  81166. Object.keys(cascade).forEach(function(nodeTitle) {
  81167. cascade[nodeTitle].sort = _this2._sort && Object.prototype.hasOwnProperty.call(_this2._sort, nodeTitle) ? _this2._sort[nodeTitle] : 1
  81168. });
  81169. Object.keys(cascade).sort(function(a, b) {
  81170. return cascade[a].sort - cascade[b].sort
  81171. }).forEach(function(nodeTitle) {
  81172. var node = cascade[nodeTitle];
  81173. var height = Math.floor(heightAvailable * node.maxWeight / maxWeight);
  81174. var x = Math.round(cascadeIdx * options.width / (cascades.length - 1)) - (0 === cascadeIdx ? 0 : options.nodeWidth);
  81175. var rect = {};
  81176. rect._name = nodeTitle;
  81177. rect.width = options.nodeWidth;
  81178. rect.height = height;
  81179. rect.x = x + options.x;
  81180. rect.y = y + options.y;
  81181. y += height + nodePadding;
  81182. cascadeRects.push(rect)
  81183. });
  81184. cascadeIdx++;
  81185. rects.push(cascadeRects)
  81186. });
  81187. return rects
  81188. },
  81189. _findRectByName: function(rects, name) {
  81190. for (var c = 0; c < rects.length; c++) {
  81191. for (var r = 0; r < rects[c].length; r++) {
  81192. if (name === rects[c][r]._name) {
  81193. return rects[c][r]
  81194. }
  81195. }
  81196. }
  81197. return null
  81198. },
  81199. _findIndexByName: function(rects, nodeTitle) {
  81200. var index = 0;
  81201. for (var c = 0; c < rects.length; c++) {
  81202. for (var r = 0; r < rects[c].length; r++) {
  81203. if (nodeTitle === rects[c][r]._name) {
  81204. return index
  81205. }
  81206. index++
  81207. }
  81208. }
  81209. return null
  81210. },
  81211. _computeLinks: function(links, rects, cascades) {
  81212. var _this3 = this;
  81213. var yOffsets = {};
  81214. var paths = [];
  81215. var result = [];
  81216. cascades.forEach(function(cascade) {
  81217. Object.keys(cascade).forEach(function(nodeTitle) {
  81218. yOffsets[nodeTitle] = {
  81219. "in": 0,
  81220. out: 0
  81221. }
  81222. })
  81223. });
  81224. rects.forEach(function(rectsOfCascade) {
  81225. rectsOfCascade.forEach(function(nodeRect) {
  81226. var nodeTitle = nodeRect._name;
  81227. var rectFrom = _this3._findRectByName(rects, nodeTitle);
  81228. var linksFromNode = links.filter(function(link) {
  81229. return link[0] === nodeTitle
  81230. });
  81231. linksFromNode.forEach(function(link) {
  81232. link.sort = _this3._findIndexByName(rects, link[1])
  81233. });
  81234. linksFromNode.sort(function(a, b) {
  81235. return a.sort - b.sort
  81236. }).forEach(function(link) {
  81237. var rectTo = _this3._findRectByName(rects, link[1]);
  81238. var height = Math.round(link[2] / _this3._weightPerPixel);
  81239. var yOffsetFrom = yOffsets[link[0]].out;
  81240. var yOffsetTo = yOffsets[link[1]].in;
  81241. var heightFrom = yOffsets[link[0]].out + height > rectFrom.height ? rectFrom.height - yOffsets[link[0]].out : height;
  81242. var heightTo = yOffsets[link[1]].in + height > rectTo.height ? rectTo.height - yOffsets[link[1]].in : height;
  81243. paths.push({
  81244. from: {
  81245. x: rectFrom.x,
  81246. y: rectFrom.y + yOffsetFrom,
  81247. width: rectFrom.width,
  81248. height: heightFrom,
  81249. node: rectFrom,
  81250. weight: link[2]
  81251. },
  81252. to: {
  81253. x: rectTo.x,
  81254. y: rectTo.y + yOffsetTo,
  81255. width: rectTo.width,
  81256. height: heightTo,
  81257. node: rectTo
  81258. }
  81259. });
  81260. yOffsets[link[0]].out += height;
  81261. yOffsets[link[1]].in += height
  81262. })
  81263. })
  81264. });
  81265. paths.forEach(function(link) {
  81266. var path = {
  81267. d: _this3._spline(link.from, link.to),
  81268. _boundingRect: {
  81269. x: link.from.x + link.from.width,
  81270. y: Math.min(link.from.y, link.to.y),
  81271. width: link.to.x - (link.from.x + link.from.width),
  81272. height: Math.max(link.from.x + link.from.height, link.to.y + link.to.height) - Math.min(link.from.y, link.to.y)
  81273. },
  81274. _weight: link.from.weight,
  81275. _from: link.from.node,
  81276. _to: link.to.node
  81277. };
  81278. result.push(path)
  81279. });
  81280. this._fitAllNodesHeight(rects, paths);
  81281. return result
  81282. },
  81283. _fitNodeHeight: function(nodeName, nodeRects, paths) {
  81284. var targetRect = this._findRectByName(nodeRects, nodeName);
  81285. var heightOfLinksSummaryIn = 0;
  81286. var heightOfLinksSummaryOut = 0;
  81287. paths.forEach(function(path) {
  81288. if (path.from.node._name === nodeName) {
  81289. heightOfLinksSummaryOut += path.from.height
  81290. }
  81291. if (path.to.node._name === nodeName) {
  81292. heightOfLinksSummaryIn += path.to.height
  81293. }
  81294. });
  81295. targetRect.height = Math.max(heightOfLinksSummaryIn, heightOfLinksSummaryOut)
  81296. },
  81297. _fitAllNodesHeight: function(nodeRects, paths) {
  81298. for (var c = 0; c < nodeRects.length; c++) {
  81299. for (var r = 0; r < nodeRects[c].length; r++) {
  81300. this._fitNodeHeight(nodeRects[c][r]._name, nodeRects, paths)
  81301. }
  81302. }
  81303. },
  81304. _spline: function(rectLeft, rectRight) {
  81305. var p_UpLeft = {
  81306. x: rectLeft.x + rectLeft.width,
  81307. y: rectLeft.y
  81308. };
  81309. var p_DownLeft = {
  81310. x: rectLeft.x + rectLeft.width,
  81311. y: rectLeft.y + rectLeft.height
  81312. };
  81313. var p_UpRight = {
  81314. x: rectRight.x,
  81315. y: rectRight.y
  81316. };
  81317. var p_DownRight = {
  81318. x: rectRight.x,
  81319. y: rectRight.y + rectRight.height
  81320. };
  81321. var curve_width = _SPLINE_TENSION * (p_UpRight.x - p_UpLeft.x);
  81322. var result = "M ".concat(p_UpLeft.x, " ").concat(p_UpLeft.y, " C ").concat(p_UpLeft.x + curve_width, " ").concat(p_UpLeft.y, " ").concat(p_UpRight.x - curve_width, " ").concat(p_UpRight.y, " ").concat(p_UpRight.x, " ").concat(p_UpRight.y, " L ").concat(p_DownRight.x, " ").concat(p_DownRight.y, " C ").concat(p_DownRight.x - curve_width, " ").concat(p_DownRight.y, " ").concat(p_DownLeft.x + curve_width, " ").concat(p_DownLeft.y, " ").concat(p_DownLeft.x, " ").concat(p_DownLeft.y, " Z");
  81323. return result
  81324. },
  81325. computeLayout: function(linksData, sortData, options, incidentOccurred) {
  81326. this._sort = sortData;
  81327. var result = {};
  81328. var validateResult = validatorModule.validate(linksData, incidentOccurred);
  81329. if (!validateResult) {
  81330. result.cascades = this._computeCascades(linksData);
  81331. result.nodes = this._computeNodes(result.cascades, {
  81332. width: options.availableRect.width,
  81333. height: options.availableRect.height,
  81334. x: options.availableRect.x,
  81335. y: options.availableRect.y,
  81336. nodePadding: options.nodePadding,
  81337. nodeWidth: options.nodeWidth,
  81338. nodeAlign: options.nodeAlign
  81339. });
  81340. result.links = this._computeLinks(linksData, result.nodes, result.cascades)
  81341. } else {
  81342. result.error = validateResult
  81343. }
  81344. return result
  81345. },
  81346. overlap: function(box1, box2) {
  81347. return !(box2.x > box1.x + box1.width || box2.x + box2.width < box1.x || box2.y >= box1.y + box1.height || box2.y + box2.height <= box1.y)
  81348. }
  81349. };
  81350. module.exports = layout
  81351. },
  81352. /*!***********************************************************!*\
  81353. !*** ./artifacts/transpiled/viz/sankey/data_validator.js ***!
  81354. \***********************************************************/
  81355. /*! dynamic exports provided */
  81356. /*! all exports used */
  81357. function(module, exports, __webpack_require__) {
  81358. var graphModule = __webpack_require__( /*! ./graph */ 428);
  81359. var validator = {
  81360. validate: function(data, incidentOccurred) {
  81361. var result = null;
  81362. if (this._hasCycle(data)) {
  81363. result = "E2006";
  81364. incidentOccurred("E2006")
  81365. }
  81366. return result
  81367. },
  81368. _hasCycle: function(data) {
  81369. return graphModule.struct.hasCycle(data)
  81370. }
  81371. };
  81372. module.exports = validator
  81373. },
  81374. /*!****************************************************!*\
  81375. !*** ./artifacts/transpiled/viz/sankey/tooltip.js ***!
  81376. \****************************************************/
  81377. /*! dynamic exports provided */
  81378. /*! all exports used */
  81379. function(module, exports, __webpack_require__) {
  81380. Object.defineProperty(exports, "__esModule", {
  81381. value: true
  81382. });
  81383. exports.setTooltipCustomOptions = setTooltipCustomOptions;
  81384. var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
  81385. var isFunction = __webpack_require__( /*! ../../core/utils/type */ 1).isFunction;
  81386. var defaultCustomizeLinkTooltip = function(info) {
  81387. return {
  81388. html: "<strong>".concat(info.source, " > ").concat(info.target, "</strong><br/>Weight: ").concat(info.weight)
  81389. }
  81390. };
  81391. var defaultCustomizeNodeTooltip = function(info) {
  81392. return {
  81393. html: "<strong>".concat(info.title, "</strong><br/>Incoming weight: ").concat(info.weightIn, "<br/>Outgoing weight: ").concat(info.weightOut)
  81394. }
  81395. };
  81396. var generateCustomCallback = function(customCallback, defaultCallback) {
  81397. return function(objectInfo) {
  81398. var res = isFunction(customCallback) ? customCallback.call(objectInfo, objectInfo) : {};
  81399. var hasOwnProperty = Object.prototype.hasOwnProperty.bind(res);
  81400. if (!hasOwnProperty("html") && !hasOwnProperty("text")) {
  81401. res = _extend(res, defaultCallback.call(objectInfo, objectInfo))
  81402. }
  81403. return res
  81404. }
  81405. };
  81406. function setTooltipCustomOptions(sankey) {
  81407. sankey.prototype._setTooltipOptions = function() {
  81408. var tooltip = this._tooltip;
  81409. var options = tooltip && this._getOption("tooltip");
  81410. tooltip && tooltip.update(_extend({}, options, {
  81411. customizeTooltip: function(args) {
  81412. if ("node" === args.type) {
  81413. return generateCustomCallback(options.customizeNodeTooltip, defaultCustomizeNodeTooltip)(args.info)
  81414. } else {
  81415. if ("link" === args.type) {
  81416. return generateCustomCallback(options.customizeLinkTooltip, defaultCustomizeLinkTooltip)(args.info)
  81417. }
  81418. }
  81419. return {}
  81420. },
  81421. enabled: options.enabled
  81422. }))
  81423. };
  81424. sankey.prototype.hideTooltip = function() {
  81425. this._tooltip && this._tooltip.hide()
  81426. }
  81427. }
  81428. },
  81429. /*!****************************************************!*\
  81430. !*** ./artifacts/transpiled/viz/sankey/tracker.js ***!
  81431. \****************************************************/
  81432. /*! dynamic exports provided */
  81433. /*! all exports used */
  81434. function(module, exports, __webpack_require__) {
  81435. var proto = __webpack_require__( /*! ./sankey */ 426).prototype;
  81436. var Tracker = __webpack_require__( /*! ../components/tracker */ 252).Tracker;
  81437. var DATA_KEY_BASE = "__sankey_data_";
  81438. var dataKeyModifier = 0;
  81439. proto._eventsMap.onNodeClick = {
  81440. name: "nodeClick"
  81441. };
  81442. proto._eventsMap.onLinkClick = {
  81443. name: "linkClick"
  81444. };
  81445. exports.plugin = {
  81446. name: "tracker",
  81447. init: function() {
  81448. var that = this;
  81449. var dataKey = DATA_KEY_BASE + dataKeyModifier++;
  81450. that._tracker = new Tracker({
  81451. widget: that,
  81452. root: that._renderer.root,
  81453. getData: function(e) {
  81454. var target = e.target;
  81455. return target[dataKey]
  81456. },
  81457. getNode: function(index) {
  81458. if (index < that._nodes.length) {
  81459. return that._nodes[index]
  81460. } else {
  81461. return that._links[index - that._nodes.length]
  81462. }
  81463. },
  81464. click: function(e) {
  81465. var eventName = this.getData(e.event) < that._nodes.length ? "nodeClick" : "linkClick";
  81466. that._eventTrigger(eventName, {
  81467. target: e.node,
  81468. event: e.event
  81469. })
  81470. }
  81471. });
  81472. exports._TESTS_dataKey = dataKey;
  81473. this._dataKey = dataKey
  81474. },
  81475. dispose: function() {
  81476. this._tracker.dispose()
  81477. },
  81478. extenders: {
  81479. _change_LINKS_DRAW: function() {
  81480. var dataKey = this._dataKey;
  81481. this._nodes.concat(this._links).forEach(function(item, index) {
  81482. item.element.data(dataKey, index)
  81483. })
  81484. }
  81485. }
  81486. }
  81487. }, , , , , ,
  81488. /*!***********************************************************!*\
  81489. !*** ./artifacts/transpiled/bundles/modules/parts/viz.js ***!
  81490. \***********************************************************/
  81491. /*! dynamic exports provided */
  81492. /*! all exports used */
  81493. function(module, exports, __webpack_require__) {
  81494. var DevExpress = __webpack_require__( /*! ./core */ 212);
  81495. __webpack_require__( /*! ./data */ 288);
  81496. var viz = DevExpress.viz = __webpack_require__( /*! ../../../bundles/modules/viz */ 752);
  81497. viz.currentTheme = __webpack_require__( /*! ../../../viz/themes */ 50).currentTheme;
  81498. viz.registerTheme = __webpack_require__( /*! ../../../viz/themes */ 50).registerTheme;
  81499. viz.exportFromMarkup = __webpack_require__( /*! ../../../viz/export */ 239).exportFromMarkup;
  81500. viz.getMarkup = __webpack_require__( /*! ../../../viz/export */ 239).getMarkup;
  81501. viz.exportWidgets = __webpack_require__( /*! ../../../viz/export */ 239).exportWidgets;
  81502. viz.currentPalette = __webpack_require__( /*! ../../../viz/palette */ 164).currentPalette;
  81503. viz.getPalette = __webpack_require__( /*! ../../../viz/palette */ 164).getPalette;
  81504. viz.generateColors = __webpack_require__( /*! ../../../viz/palette */ 164).generateColors;
  81505. viz.registerPalette = __webpack_require__( /*! ../../../viz/palette */ 164).registerPalette;
  81506. viz.refreshTheme = __webpack_require__( /*! ../../../viz/themes */ 50).refreshTheme;
  81507. viz.dxChart = __webpack_require__( /*! ../../../viz/chart */ 753);
  81508. viz.dxPieChart = __webpack_require__( /*! ../../../viz/pie_chart */ 790);
  81509. viz.dxPolarChart = __webpack_require__( /*! ../../../viz/polar_chart */ 791);
  81510. viz.dxLinearGauge = __webpack_require__( /*! ../../../viz/linear_gauge */ 792);
  81511. viz.dxCircularGauge = __webpack_require__( /*! ../../../viz/circular_gauge */ 798);
  81512. viz.dxBarGauge = __webpack_require__( /*! ../../../viz/bar_gauge */ 801);
  81513. viz.dxRangeSelector = __webpack_require__( /*! ../../../viz/range_selector */ 803);
  81514. viz.dxVectorMap = __webpack_require__( /*! ../../../viz/vector_map */ 811);
  81515. viz.map = {};
  81516. viz.map.sources = {};
  81517. viz.map.projection = __webpack_require__( /*! ../../../viz/vector_map/projection */ 417).projection;
  81518. viz.dxSparkline = __webpack_require__( /*! ../../../viz/sparkline */ 821);
  81519. viz.dxBullet = __webpack_require__( /*! ../../../viz/bullet */ 823);
  81520. viz.dxTreeMap = __webpack_require__( /*! ../../../viz/tree_map */ 825);
  81521. viz.dxFunnel = __webpack_require__( /*! ../../../viz/funnel */ 836);
  81522. viz.dxSankey = __webpack_require__( /*! ../../../viz/sankey */ 844);
  81523. viz.BaseWidget = __webpack_require__( /*! ../../../viz/core/base_widget */ 96);
  81524. viz.getTheme = __webpack_require__( /*! ../../../viz/themes */ 50).getTheme;
  81525. viz.findTheme = __webpack_require__( /*! ../../../viz/themes */ 50).getTheme;
  81526. viz.refreshAll = __webpack_require__( /*! ../../../viz/themes */ 50).refreshTheme;
  81527. viz.refreshPaths = __webpack_require__( /*! ../../../viz/utils */ 857).refreshPaths;
  81528. viz.gauges = {
  81529. __internals: {}
  81530. };
  81531. viz._dashboard = {};
  81532. viz._dashboard.Renderer = __webpack_require__( /*! ../../../viz/core/renderers/renderer */ 175).Renderer;
  81533. viz._dashboard.SvgElement = __webpack_require__( /*! ../../../viz/core/renderers/renderer */ 175).SvgElement;
  81534. viz._dashboard.patchFontOptions = __webpack_require__( /*! ../../../viz/core/utils */ 10).patchFontOptions;
  81535. module.exports = viz
  81536. },
  81537. /*!*******************************************!*\
  81538. !*** ./artifacts/transpiled/viz/utils.js ***!
  81539. \*******************************************/
  81540. /*! dynamic exports provided */
  81541. /*! all exports used */
  81542. function(module, exports, __webpack_require__) {
  81543. exports.refreshPaths = __webpack_require__( /*! ./core/renderers/renderer */ 175).refreshPaths
  81544. }, , , , , , , ,
  81545. /*!******************************************************!*\
  81546. !*** multi ./artifacts/transpiled/bundles/dx.viz.js ***!
  81547. \******************************************************/
  81548. /*! dynamic exports provided */
  81549. /*! all exports used */
  81550. function(module, exports, __webpack_require__) {
  81551. module.exports = __webpack_require__( /*! c:\Projects\DevExtreme\19.1\BuildLabel\Temp\DevExtreme.v19.1\repo\GitHub\artifacts\transpiled\bundles\dx.viz.js */ 866)
  81552. },
  81553. /*!************************************************!*\
  81554. !*** ./artifacts/transpiled/bundles/dx.viz.js ***!
  81555. \************************************************/
  81556. /*! dynamic exports provided */
  81557. /*! all exports used */
  81558. function(module, exports, __webpack_require__) {
  81559. __webpack_require__( /*! ./modules/parts/viz */ 856)
  81560. }
  81561. ]);