t.js 189 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461
  1. /*! LeaderLine v1.0.7 (c) anseki https://anseki.github.io/leader-line/ */
  2. export const LeaderLine = (function () {
  3. 'use strict';
  4. var Z,
  5. w,
  6. O,
  7. M,
  8. I,
  9. o,
  10. t,
  11. s,
  12. h,
  13. u,
  14. n,
  15. a,
  16. e,
  17. _,
  18. v,
  19. l,
  20. r,
  21. i,
  22. E,
  23. x,
  24. p,
  25. c,
  26. d,
  27. C = 'leader-line',
  28. b = 1,
  29. k = 2,
  30. L = 3,
  31. A = 4,
  32. V = { top: b, right: k, bottom: L, left: A },
  33. P = 1,
  34. N = 2,
  35. T = 3,
  36. W = 4,
  37. B = 5,
  38. R = { straight: P, arc: N, fluid: T, magnet: W, grid: B },
  39. Y = 'behind',
  40. f = C + '-defs',
  41. y =
  42. '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="leader-line-defs"><style><![CDATA[.leader-line{position:absolute;overflow:visible!important;pointer-events:none!important;font-size:16px}#leader-line-defs{width:0;height:0;position:absolute;left:0;top:0}.leader-line-line-path{fill:none}.leader-line-mask-bg-rect{fill:white}.leader-line-caps-mask-anchor,.leader-line-caps-mask-marker-shape{fill:black}.leader-line-caps-mask-anchor{stroke:black}.leader-line-caps-mask-line,.leader-line-plugs-face{stroke:rgba(0,0,0,0)}.leader-line-line-mask-shape{stroke:white}.leader-line-line-outline-mask-shape{stroke:black}.leader-line-plug-mask-shape{fill:white;stroke:black}.leader-line-plug-outline-mask-shape{fill:black;stroke:white}.leader-line-areaAnchor{position:absolute;overflow:visible!important}]]></style><defs><circle id="leader-line-disc" cx="0" cy="0" r="5"/><rect id="leader-line-square" x="-5" y="-5" width="10" height="10"/><polygon id="leader-line-arrow1" points="-8,-8 8,0 -8,8 -5,0"/><polygon id="leader-line-arrow2" points="-4,-8 4,0 -4,8 -7,5 -2,0 -7,-5"/><polygon id="leader-line-arrow3" points="-4,-5 8,0 -4,5"/><g id="leader-line-hand"><path style="fill: #fcfcfc" d="M9.19 11.14h4.75c1.38 0 2.49-1.11 2.49-2.49 0-.51-.15-.98-.41-1.37h1.3c1.38 0 2.49-1.11 2.49-2.49s-1.11-2.53-2.49-2.53h1.02c1.38 0 2.49-1.11 2.49-2.49s-1.11-2.49-2.49-2.49h14.96c1.37 0 2.49-1.11 2.49-2.49s-1.11-2.49-2.49-2.49H16.58C16-9.86 14.28-11.14 9.7-11.14c-4.79 0-6.55 3.42-7.87 4.73H-2.14v13.23h3.68C3.29 9.97 5.47 11.14 9.19 11.14L9.19 11.14Z"/><path style="fill: black" d="M13.95 12c1.85 0 3.35-1.5 3.35-3.35 0-.17-.02-.34-.04-.51h.07c1.85 0 3.35-1.5 3.35-3.35 0-.79-.27-1.51-.72-2.08 1.03-.57 1.74-1.67 1.74-2.93 0-.59-.16-1.15-.43-1.63h12.04c1.85 0 3.35-1.5 3.35-3.35 0-1.85-1.5-3.35-3.35-3.35H17.2C16.26-10.93 13.91-12 9.7-12 5.36-12 3.22-9.4 1.94-7.84c0 0-.29.33-.5.57-.63 0-3.58 0-3.58 0C-2.61-7.27-3-6.88-3-6.41v13.23c0 .47.39.86.86.86 0 0 2.48 0 3.2 0C2.9 10.73 5.29 12 9.19 12L13.95 12ZM9.19 10.28c-3.46 0-5.33-1.05-6.9-3.87-.15-.27-.44-.44-.75-.44 0 0-1.81 0-2.82 0V-5.55c1.06 0 3.11 0 3.11 0 .25 0 .44-.06.61-.25l.83-.95c1.23-1.49 2.91-3.53 6.43-3.53 3.45 0 4.9.74 5.57 1.72h-4.3c-.48 0-.86.38-.86.86s.39.86.86.86h22.34c.9 0 1.63.73 1.63 1.63 0 .9-.73 1.63-1.63 1.63H15.83c-.48 0-.86.38-.86.86 0 .47.39.86.86.86h2.52c.9 0 1.63.73 1.63 1.63s-.73 1.63-1.63 1.63h-3.12c-.48 0-.86.38-.86.86 0 .47.39.86.86.86h2.11c.88 0 1.63.76 1.63 1.67 0 .9-.73 1.63-1.63 1.63h-3.2c-.48 0-.86.39-.86.86 0 .47.39.86.86.86h1.36c.05.16.09.34.09.51 0 .9-.73 1.63-1.63 1.63C13.95 10.28 9.19 10.28 9.19 10.28Z"/></g><g id="leader-line-crosshair"><path d="M0-78.97c-43.54 0-78.97 35.43-78.97 78.97 0 43.54 35.43 78.97 78.97 78.97s78.97-35.43 78.97-78.97C78.97-43.54 43.55-78.97 0-78.97ZM76.51-1.21h-9.91v-9.11h-2.43v9.11h-11.45c-.64-28.12-23.38-50.86-51.5-51.5V-64.17h9.11V-66.6h-9.11v-9.91C42.46-75.86 75.86-42.45 76.51-1.21ZM-1.21-30.76h-9.11v2.43h9.11V-4.2c-1.44.42-2.57 1.54-2.98 2.98H-28.33v-9.11h-2.43v9.11H-50.29C-49.65-28-27.99-49.65-1.21-50.29V-30.76ZM-30.76 1.21v9.11h2.43v-9.11H-4.2c.42 1.44 1.54 2.57 2.98 2.98v24.13h-9.11v2.43h9.11v19.53C-27.99 49.65-49.65 28-50.29 1.21H-30.76ZM1.22 30.75h9.11v-2.43h-9.11V4.2c1.44-.42 2.56-1.54 2.98-2.98h24.13v9.11h2.43v-9.11h19.53C49.65 28 28 49.65 1.22 50.29V30.75ZM30.76-1.21v-9.11h-2.43v9.11H4.2c-.42-1.44-1.54-2.56-2.98-2.98V-28.33h9.11v-2.43h-9.11V-50.29C28-49.65 49.65-28 50.29-1.21H30.76ZM-1.21-76.51v9.91h-9.11v2.43h9.11v11.45c-28.12.64-50.86 23.38-51.5 51.5H-64.17v-9.11H-66.6v9.11h-9.91C-75.86-42.45-42.45-75.86-1.21-76.51ZM-76.51 1.21h9.91v9.11h2.43v-9.11h11.45c.64 28.12 23.38 50.86 51.5 51.5v11.45h-9.11v2.43h9.11v9.91C-42.45 75.86-75.86 42.45-76.51 1.21ZM1.22 76.51v-9.91h9.11v-2.43h-9.11v-11.45c28.12-.64 50.86-23.38 51.5-51.5h11.45v9.11h2.43v-9.11h9.91C75.86 42.45 42.45 75.86 1.22 76.51Z"/><path d="M0 83.58-7.1 96 7.1 96Z"/><path d="M0-83.58 7.1-96-7.1-96"/><path d="M83.58 0 96 7.1 96-7.1Z"/><path d="M-83.58 0-96-7.1-96 7.1Z"/></g></defs></svg>',
  43. X = {
  44. disc: {
  45. elmId: 'leader-line-disc',
  46. noRotate: !0,
  47. bBox: { left: -5, top: -5, width: 10, height: 10, right: 5, bottom: 5 },
  48. widthR: 2.5,
  49. heightR: 2.5,
  50. bCircle: 5,
  51. sideLen: 5,
  52. backLen: 5,
  53. overhead: 0,
  54. outlineBase: 1,
  55. outlineMax: 4,
  56. },
  57. square: {
  58. elmId: 'leader-line-square',
  59. noRotate: !0,
  60. bBox: { left: -5, top: -5, width: 10, height: 10, right: 5, bottom: 5 },
  61. widthR: 2.5,
  62. heightR: 2.5,
  63. bCircle: 5,
  64. sideLen: 5,
  65. backLen: 5,
  66. overhead: 0,
  67. outlineBase: 1,
  68. outlineMax: 4,
  69. },
  70. arrow1: {
  71. elmId: 'leader-line-arrow1',
  72. bBox: { left: -8, top: -8, width: 16, height: 16, right: 8, bottom: 8 },
  73. widthR: 4,
  74. heightR: 4,
  75. bCircle: 8,
  76. sideLen: 8,
  77. backLen: 8,
  78. overhead: 8,
  79. outlineBase: 2,
  80. outlineMax: 1.5,
  81. },
  82. arrow2: {
  83. elmId: 'leader-line-arrow2',
  84. bBox: { left: -7, top: -8, width: 11, height: 16, right: 4, bottom: 8 },
  85. widthR: 2.75,
  86. heightR: 4,
  87. bCircle: 8,
  88. sideLen: 8,
  89. backLen: 7,
  90. overhead: 4,
  91. outlineBase: 1,
  92. outlineMax: 1.75,
  93. },
  94. arrow3: {
  95. elmId: 'leader-line-arrow3',
  96. bBox: { left: -4, top: -5, width: 12, height: 10, right: 8, bottom: 5 },
  97. widthR: 3,
  98. heightR: 2.5,
  99. bCircle: 8,
  100. sideLen: 5,
  101. backLen: 4,
  102. overhead: 8,
  103. outlineBase: 1,
  104. outlineMax: 2.5,
  105. },
  106. hand: {
  107. elmId: 'leader-line-hand',
  108. bBox: {
  109. left: -3,
  110. top: -12,
  111. width: 40,
  112. height: 24,
  113. right: 37,
  114. bottom: 12,
  115. },
  116. widthR: 10,
  117. heightR: 6,
  118. bCircle: 37,
  119. sideLen: 12,
  120. backLen: 3,
  121. overhead: 37,
  122. },
  123. crosshair: {
  124. elmId: 'leader-line-crosshair',
  125. noRotate: !0,
  126. bBox: {
  127. left: -96,
  128. top: -96,
  129. width: 192,
  130. height: 192,
  131. right: 96,
  132. bottom: 96,
  133. },
  134. widthR: 48,
  135. heightR: 48,
  136. bCircle: 96,
  137. sideLen: 96,
  138. backLen: 96,
  139. overhead: 0,
  140. },
  141. },
  142. F = {
  143. behind: Y,
  144. disc: 'disc',
  145. square: 'square',
  146. arrow1: 'arrow1',
  147. arrow2: 'arrow2',
  148. arrow3: 'arrow3',
  149. hand: 'hand',
  150. crosshair: 'crosshair',
  151. },
  152. q = {
  153. disc: 'disc',
  154. square: 'square',
  155. arrow1: 'arrow1',
  156. arrow2: 'arrow2',
  157. arrow3: 'arrow3',
  158. hand: 'hand',
  159. crosshair: 'crosshair',
  160. },
  161. G = [b, k, L, A],
  162. D = 'auto',
  163. Q = { x: 'left', y: 'top', width: 'width', height: 'height' },
  164. z = 80,
  165. j = 4,
  166. H = 5,
  167. U = 120,
  168. K = 8,
  169. J = 3.75,
  170. $ = 10,
  171. ee = 30,
  172. te = 0.5522847,
  173. ne = 0.25 * Math.PI,
  174. m = /^\s*(\-?[\d\.]+)\s*(\%)?\s*$/,
  175. ae = 'http://www.w3.org/2000/svg',
  176. S =
  177. '-ms-scroll-limit' in document.documentElement.style &&
  178. '-ms-ime-align' in document.documentElement.style &&
  179. !window.navigator.msPointerEnabled,
  180. ie = !S && !!document.uniqueID,
  181. oe = 'MozAppearance' in document.documentElement.style,
  182. le = !(S || oe || !window.chrome || !window.CSS),
  183. re =
  184. !S &&
  185. !ie &&
  186. !oe &&
  187. !le &&
  188. !window.chrome &&
  189. 'WebkitAppearance' in document.documentElement.style,
  190. se = ie || S ? 0.2 : 0.1,
  191. ue = {
  192. path: T,
  193. lineColor: 'coral',
  194. lineSize: 4,
  195. plugSE: [Y, 'arrow1'],
  196. plugSizeSE: [1, 1],
  197. lineOutlineEnabled: !1,
  198. lineOutlineColor: 'indianred',
  199. lineOutlineSize: 0.25,
  200. plugOutlineEnabledSE: [!1, !1],
  201. plugOutlineSizeSE: [1, 1],
  202. },
  203. he =
  204. ((p = {}.toString),
  205. (c = {}.hasOwnProperty.toString),
  206. (d = c.call(Object)),
  207. function (e) {
  208. return (
  209. e &&
  210. '[object Object]' === p.call(e) &&
  211. (!(e = Object.getPrototypeOf(e)) ||
  212. ((e = e.hasOwnProperty('constructor') && e.constructor) &&
  213. 'function' == typeof e &&
  214. c.call(e) === d))
  215. );
  216. }),
  217. pe =
  218. Number.isFinite ||
  219. function (e) {
  220. return 'number' == typeof e && window.isFinite(e);
  221. },
  222. g =
  223. ((_ = {
  224. ease: [0.25, 0.1, 0.25, 1],
  225. linear: [0, 0, 1, 1],
  226. 'ease-in': [0.42, 0, 1, 1],
  227. 'ease-out': [0, 0, 0.58, 1],
  228. 'ease-in-out': [0.42, 0, 0.58, 1],
  229. }),
  230. (v = 1e3 / 60 / 2),
  231. (l =
  232. window.requestAnimationFrame ||
  233. window.mozRequestAnimationFrame ||
  234. window.webkitRequestAnimationFrame ||
  235. window.msRequestAnimationFrame ||
  236. function (e) {
  237. setTimeout(e, v);
  238. }),
  239. (r =
  240. window.cancelAnimationFrame ||
  241. window.mozCancelAnimationFrame ||
  242. window.webkitCancelAnimationFrame ||
  243. window.msCancelAnimationFrame ||
  244. function (e) {
  245. clearTimeout(e);
  246. }),
  247. (i =
  248. Number.isFinite ||
  249. function (e) {
  250. return 'number' == typeof e && window.isFinite(e);
  251. }),
  252. (E = []),
  253. (x = 0),
  254. {
  255. add: function (n, e, t, a, i, o, l) {
  256. var r,
  257. s,
  258. u,
  259. h,
  260. p,
  261. c,
  262. d,
  263. f,
  264. y,
  265. m,
  266. S = ++x;
  267. function g(e, t) {
  268. return { value: n(t), timeRatio: e, outputRatio: t };
  269. }
  270. if (
  271. ('string' == typeof i && (i = _[i]),
  272. (n = n || function () {}),
  273. t < v)
  274. )
  275. r = [g(0, 0), g(1, 1)];
  276. else {
  277. if (
  278. ((s = v / t),
  279. (r = [g(0, 0)]),
  280. 0 === i[0] && 0 === i[1] && 1 === i[2] && 1 === i[3])
  281. )
  282. for (h = s; h <= 1; h += s) r.push(g(h, h));
  283. else
  284. for (p = u = (h = s) / 10; p <= 1; p += u)
  285. (d = p),
  286. (m = y = f = void 0),
  287. (f = (m = p * p) * p),
  288. (m *= 3 * (y = 1 - p)),
  289. h <=
  290. (c = {
  291. x: (d = 3 * (y * y) * p) * i[0] + m * i[2] + f,
  292. y: d * i[1] + m * i[3] + f,
  293. }).x && (r.push(g(c.x, c.y)), (h += s));
  294. r.push(g(1, 1));
  295. }
  296. return (
  297. E.push(
  298. (o = {
  299. animId: S,
  300. frameCallback: e,
  301. duration: t,
  302. count: a,
  303. frames: r,
  304. reverse: !!o,
  305. })
  306. ),
  307. !1 !== l && be(o, l),
  308. S
  309. );
  310. },
  311. remove: function (n) {
  312. var a;
  313. E.some(function (e, t) {
  314. return e.animId === n && ((a = t), !(e.framesStart = null));
  315. }) && E.splice(a, 1);
  316. },
  317. start: function (t, n, a) {
  318. E.some(function (e) {
  319. return e.animId === t && ((e.reverse = !!n), be(e, a), !0);
  320. });
  321. },
  322. stop: function (t, n) {
  323. var a;
  324. return (
  325. E.some(function (e) {
  326. return (
  327. e.animId === t &&
  328. (n
  329. ? null != e.lastFrame && (a = e.frames[e.lastFrame].timeRatio)
  330. : ((a = (Date.now() - e.framesStart) / e.duration),
  331. (a = e.reverse ? 1 - a : a) < 0
  332. ? (a = 0)
  333. : 1 < a && (a = 1)),
  334. !(e.framesStart = null))
  335. );
  336. }),
  337. a
  338. );
  339. },
  340. validTiming: function (t) {
  341. return 'string' == typeof t
  342. ? _[t]
  343. : Array.isArray(t) &&
  344. [0, 1, 2, 3].every(function (e) {
  345. return i(t[e]) && 0 <= t[e] && t[e] <= 1;
  346. })
  347. ? [t[0], t[1], t[2], t[3]]
  348. : null;
  349. },
  350. }),
  351. ce = function (e) {
  352. (e.SVGPathElement.prototype.getPathData &&
  353. e.SVGPathElement.prototype.setPathData) ||
  354. (function () {
  355. function i(e) {
  356. (this._string = e),
  357. (this._currentIndex = 0),
  358. (this._endIndex = this._string.length),
  359. (this._prevCommand = null),
  360. this._skipOptionalSpaces();
  361. }
  362. var a = {
  363. Z: 'Z',
  364. M: 'M',
  365. L: 'L',
  366. C: 'C',
  367. Q: 'Q',
  368. A: 'A',
  369. H: 'H',
  370. V: 'V',
  371. S: 'S',
  372. T: 'T',
  373. z: 'Z',
  374. m: 'm',
  375. l: 'l',
  376. c: 'c',
  377. q: 'q',
  378. a: 'a',
  379. h: 'h',
  380. v: 'v',
  381. s: 's',
  382. t: 't',
  383. },
  384. o = -1 !== e.navigator.userAgent.indexOf('MSIE ');
  385. i.prototype = {
  386. parseSegment: function () {
  387. var e = this._string[this._currentIndex],
  388. t = a[e] || null;
  389. if (null === t) {
  390. if (null === this._prevCommand) return null;
  391. if (
  392. null ===
  393. (t =
  394. ('+' === e ||
  395. '-' === e ||
  396. '.' === e ||
  397. ('0' <= e && e <= '9')) &&
  398. 'Z' !== this._prevCommand
  399. ? 'M' === this._prevCommand
  400. ? 'L'
  401. : 'm' === this._prevCommand
  402. ? 'l'
  403. : this._prevCommand
  404. : null)
  405. )
  406. return null;
  407. } else this._currentIndex += 1;
  408. var n = null,
  409. e = (this._prevCommand = t).toUpperCase();
  410. return (
  411. 'H' === e || 'V' === e
  412. ? (n = [this._parseNumber()])
  413. : 'M' === e || 'L' === e || 'T' === e
  414. ? (n = [this._parseNumber(), this._parseNumber()])
  415. : 'S' === e || 'Q' === e
  416. ? (n = [
  417. this._parseNumber(),
  418. this._parseNumber(),
  419. this._parseNumber(),
  420. this._parseNumber(),
  421. ])
  422. : 'C' === e
  423. ? (n = [
  424. this._parseNumber(),
  425. this._parseNumber(),
  426. this._parseNumber(),
  427. this._parseNumber(),
  428. this._parseNumber(),
  429. this._parseNumber(),
  430. ])
  431. : 'A' === e
  432. ? (n = [
  433. this._parseNumber(),
  434. this._parseNumber(),
  435. this._parseNumber(),
  436. this._parseArcFlag(),
  437. this._parseArcFlag(),
  438. this._parseNumber(),
  439. this._parseNumber(),
  440. ])
  441. : 'Z' === e && (this._skipOptionalSpaces(), (n = [])),
  442. null === n || 0 <= n.indexOf(null)
  443. ? null
  444. : { type: t, values: n }
  445. );
  446. },
  447. hasMoreData: function () {
  448. return this._currentIndex < this._endIndex;
  449. },
  450. peekSegmentType: function () {
  451. var e = this._string[this._currentIndex];
  452. return a[e] || null;
  453. },
  454. initialCommandIsMoveTo: function () {
  455. if (!this.hasMoreData()) return !0;
  456. var e = this.peekSegmentType();
  457. return 'M' === e || 'm' === e;
  458. },
  459. _isCurrentSpace: function () {
  460. var e = this._string[this._currentIndex];
  461. return (
  462. e <= ' ' &&
  463. (' ' === e ||
  464. '\n' === e ||
  465. '\t' === e ||
  466. '\r' === e ||
  467. '\f' === e)
  468. );
  469. },
  470. _skipOptionalSpaces: function () {
  471. for (
  472. ;
  473. this._currentIndex < this._endIndex && this._isCurrentSpace();
  474. )
  475. this._currentIndex += 1;
  476. return this._currentIndex < this._endIndex;
  477. },
  478. _skipOptionalSpacesOrDelimiter: function () {
  479. return (
  480. !(
  481. this._currentIndex < this._endIndex &&
  482. !this._isCurrentSpace() &&
  483. ',' !== this._string[this._currentIndex]
  484. ) &&
  485. (this._skipOptionalSpaces() &&
  486. this._currentIndex < this._endIndex &&
  487. ',' === this._string[this._currentIndex] &&
  488. ((this._currentIndex += 1), this._skipOptionalSpaces()),
  489. this._currentIndex < this._endIndex)
  490. );
  491. },
  492. _parseNumber: function () {
  493. var e = 0,
  494. t = 0,
  495. n = 1,
  496. a = 0,
  497. i = 1,
  498. o = 1,
  499. l = this._currentIndex;
  500. if (
  501. (this._skipOptionalSpaces(),
  502. this._currentIndex < this._endIndex &&
  503. '+' === this._string[this._currentIndex]
  504. ? (this._currentIndex += 1)
  505. : this._currentIndex < this._endIndex &&
  506. '-' === this._string[this._currentIndex] &&
  507. ((this._currentIndex += 1), (i = -1)),
  508. this._currentIndex === this._endIndex ||
  509. ((this._string[this._currentIndex] < '0' ||
  510. '9' < this._string[this._currentIndex]) &&
  511. '.' !== this._string[this._currentIndex]))
  512. )
  513. return null;
  514. for (
  515. var r = this._currentIndex;
  516. this._currentIndex < this._endIndex &&
  517. '0' <= this._string[this._currentIndex] &&
  518. this._string[this._currentIndex] <= '9';
  519. )
  520. this._currentIndex += 1;
  521. if (this._currentIndex !== r)
  522. for (var s = this._currentIndex - 1, u = 1; r <= s; )
  523. (t += u * (this._string[s] - '0')), --s, (u *= 10);
  524. if (
  525. this._currentIndex < this._endIndex &&
  526. '.' === this._string[this._currentIndex]
  527. ) {
  528. if (
  529. ((this._currentIndex += 1),
  530. this._currentIndex >= this._endIndex ||
  531. this._string[this._currentIndex] < '0' ||
  532. '9' < this._string[this._currentIndex])
  533. )
  534. return null;
  535. for (
  536. ;
  537. this._currentIndex < this._endIndex &&
  538. '0' <= this._string[this._currentIndex] &&
  539. this._string[this._currentIndex] <= '9';
  540. )
  541. (n *= 10),
  542. (a += (this._string.charAt(this._currentIndex) - '0') / n),
  543. (this._currentIndex += 1);
  544. }
  545. if (
  546. this._currentIndex !== l &&
  547. this._currentIndex + 1 < this._endIndex &&
  548. ('e' === this._string[this._currentIndex] ||
  549. 'E' === this._string[this._currentIndex]) &&
  550. 'x' !== this._string[this._currentIndex + 1] &&
  551. 'm' !== this._string[this._currentIndex + 1]
  552. ) {
  553. if (
  554. ((this._currentIndex += 1),
  555. '+' === this._string[this._currentIndex]
  556. ? (this._currentIndex += 1)
  557. : '-' === this._string[this._currentIndex] &&
  558. ((this._currentIndex += 1), (o = -1)),
  559. this._currentIndex >= this._endIndex ||
  560. this._string[this._currentIndex] < '0' ||
  561. '9' < this._string[this._currentIndex])
  562. )
  563. return null;
  564. for (
  565. ;
  566. this._currentIndex < this._endIndex &&
  567. '0' <= this._string[this._currentIndex] &&
  568. this._string[this._currentIndex] <= '9';
  569. )
  570. (e *= 10),
  571. (e += this._string[this._currentIndex] - '0'),
  572. (this._currentIndex += 1);
  573. }
  574. var h = t + a;
  575. return (
  576. (h *= i),
  577. e && (h *= Math.pow(10, o * e)),
  578. l === this._currentIndex
  579. ? null
  580. : (this._skipOptionalSpacesOrDelimiter(), h)
  581. );
  582. },
  583. _parseArcFlag: function () {
  584. if (this._currentIndex >= this._endIndex) return null;
  585. var e = null,
  586. t = this._string[this._currentIndex];
  587. if (((this._currentIndex += 1), '0' === t)) e = 0;
  588. else {
  589. if ('1' !== t) return null;
  590. e = 1;
  591. }
  592. return this._skipOptionalSpacesOrDelimiter(), e;
  593. },
  594. };
  595. function n(e) {
  596. if (!e || 0 === e.length) return [];
  597. var t = new i(e),
  598. n = [];
  599. if (t.initialCommandIsMoveTo())
  600. for (; t.hasMoreData(); ) {
  601. var a = t.parseSegment();
  602. if (null === a) break;
  603. n.push(a);
  604. }
  605. return n;
  606. }
  607. function l(e) {
  608. return e.map(function (e) {
  609. return {
  610. type: e.type,
  611. values: Array.prototype.slice.call(e.values),
  612. };
  613. });
  614. }
  615. function r(e) {
  616. var u = [],
  617. h = null,
  618. p = null,
  619. c = null,
  620. d = null,
  621. f = null,
  622. y = null,
  623. m = null;
  624. return (
  625. e.forEach(function (e) {
  626. var t, n, a, i, o, l, r, s;
  627. 'M' === e.type
  628. ? ((r = e.values[0]),
  629. (s = e.values[1]),
  630. u.push({ type: 'M', values: [r, s] }),
  631. (d = y = r),
  632. (f = m = s))
  633. : 'C' === e.type
  634. ? ((o = e.values[0]),
  635. (l = e.values[1]),
  636. (t = e.values[2]),
  637. (n = e.values[3]),
  638. (r = e.values[4]),
  639. (s = e.values[5]),
  640. u.push({ type: 'C', values: [o, l, t, n, r, s] }),
  641. (p = t),
  642. (c = n),
  643. (d = r),
  644. (f = s))
  645. : 'L' === e.type
  646. ? ((r = e.values[0]),
  647. (s = e.values[1]),
  648. u.push({ type: 'L', values: [r, s] }),
  649. (d = r),
  650. (f = s))
  651. : 'H' === e.type
  652. ? ((r = e.values[0]),
  653. u.push({ type: 'L', values: [r, f] }),
  654. (d = r))
  655. : 'V' === e.type
  656. ? ((s = e.values[0]),
  657. u.push({ type: 'L', values: [d, s] }),
  658. (f = s))
  659. : 'S' === e.type
  660. ? ((t = e.values[0]),
  661. (n = e.values[1]),
  662. (r = e.values[2]),
  663. (s = e.values[3]),
  664. (i =
  665. 'C' === h || 'S' === h
  666. ? ((a = d + (d - p)), f + (f - c))
  667. : ((a = d), f)),
  668. u.push({ type: 'C', values: [a, i, t, n, r, s] }),
  669. (p = t),
  670. (c = n),
  671. (d = r),
  672. (f = s))
  673. : 'T' === e.type
  674. ? ((r = e.values[0]),
  675. (s = e.values[1]),
  676. (l =
  677. 'Q' === h || 'T' === h
  678. ? ((o = d + (d - p)), f + (f - c))
  679. : ((o = d), f)),
  680. u.push({
  681. type: 'C',
  682. values: [
  683. (a = d + (2 * (o - d)) / 3),
  684. (i = f + (2 * (l - f)) / 3),
  685. r + (2 * (o - r)) / 3,
  686. s + (2 * (l - s)) / 3,
  687. r,
  688. s,
  689. ],
  690. }),
  691. (p = o),
  692. (c = l),
  693. (d = r),
  694. (f = s))
  695. : 'Q' === e.type
  696. ? ((o = e.values[0]),
  697. (l = e.values[1]),
  698. (r = e.values[2]),
  699. (s = e.values[3]),
  700. u.push({
  701. type: 'C',
  702. values: [
  703. (a = d + (2 * (o - d)) / 3),
  704. (i = f + (2 * (l - f)) / 3),
  705. r + (2 * (o - r)) / 3,
  706. s + (2 * (l - s)) / 3,
  707. r,
  708. s,
  709. ],
  710. }),
  711. (p = o),
  712. (c = l),
  713. (d = r),
  714. (f = s))
  715. : 'A' === e.type
  716. ? ((n = e.values[0]),
  717. (a = e.values[1]),
  718. (i = e.values[2]),
  719. (o = e.values[3]),
  720. (l = e.values[4]),
  721. (r = e.values[5]),
  722. (s = e.values[6]),
  723. 0 === n || 0 === a
  724. ? (u.push({ type: 'C', values: [d, f, r, s, r, s] }),
  725. (d = r),
  726. (f = s))
  727. : (d === r && f === s) ||
  728. b(d, f, r, s, n, a, i, o, l).forEach(function (e) {
  729. u.push({ type: 'C', values: e }), (d = r), (f = s);
  730. }))
  731. : 'Z' === e.type && (u.push(e), (d = y), (f = m)),
  732. (h = e.type);
  733. }),
  734. u
  735. );
  736. }
  737. var s = e.SVGPathElement.prototype.setAttribute,
  738. u = e.SVGPathElement.prototype.removeAttribute,
  739. d = e.Symbol ? e.Symbol() : '__cachedPathData',
  740. f = e.Symbol ? e.Symbol() : '__cachedNormalizedPathData',
  741. b = function (e, t, n, a, i, o, l, r, s, u) {
  742. function h(e, t, n) {
  743. return {
  744. x: e * Math.cos(n) - t * Math.sin(n),
  745. y: e * Math.sin(n) + t * Math.cos(n),
  746. };
  747. }
  748. var p = (Math.PI * l) / 180,
  749. c = [];
  750. u
  751. ? ((_ = u[0]), (v = u[1]), (S = u[2]), (g = u[3]))
  752. : ((e = (m = h(e, t, -p)).x),
  753. (t = m.y),
  754. 1 <
  755. (m =
  756. ((y = (e - (n = (f = h(n, a, -p)).x)) / 2) * y) /
  757. (i * i) +
  758. ((d = (t - (a = f.y)) / 2) * d) / (o * o)) &&
  759. ((i *= m = Math.sqrt(m)), (o *= m)),
  760. (f = i * i),
  761. (m = o * o),
  762. (S =
  763. ((f =
  764. (r === s ? -1 : 1) *
  765. Math.sqrt(
  766. Math.abs(
  767. (f * m - f * d * d - m * y * y) /
  768. (f * d * d + m * y * y)
  769. )
  770. )) *
  771. i *
  772. d) /
  773. o +
  774. (e + n) / 2),
  775. (g = (f * -o * y) / i + (t + a) / 2),
  776. (_ = Math.asin(parseFloat(((t - g) / o).toFixed(9)))),
  777. (v = Math.asin(parseFloat(((a - g) / o).toFixed(9)))),
  778. e < S && (_ = Math.PI - _),
  779. n < S && (v = Math.PI - v),
  780. _ < 0 && (_ = 2 * Math.PI + _),
  781. v < 0 && (v = 2 * Math.PI + v),
  782. s && v < _ && (_ -= 2 * Math.PI),
  783. !s && _ < v && (v -= 2 * Math.PI));
  784. var d,
  785. f,
  786. y,
  787. m = v - _;
  788. Math.abs(m) > (120 * Math.PI) / 180 &&
  789. ((d = v),
  790. (f = n),
  791. (y = a),
  792. (v =
  793. s && _ < v
  794. ? _ + ((120 * Math.PI) / 180) * 1
  795. : _ + ((120 * Math.PI) / 180) * -1),
  796. (n = S + i * Math.cos(v)),
  797. (a = g + o * Math.sin(v)),
  798. (c = b(n, a, f, y, i, o, l, 0, s, [v, d, S, g])));
  799. var m = v - _,
  800. S = Math.cos(_),
  801. g = Math.sin(_),
  802. _ = Math.cos(v),
  803. v = Math.sin(v),
  804. m = Math.tan(m / 4),
  805. i = (4 / 3) * i * m,
  806. o = (4 / 3) * o * m,
  807. m = [e, t],
  808. S = [e + i * g, t - o * S],
  809. _ = [n + i * v, a - o * _],
  810. a = [n, a];
  811. if (((S[0] = 2 * m[0] - S[0]), (S[1] = 2 * m[1] - S[1]), u))
  812. return [S, _, a].concat(c);
  813. var c = [S, _, a].concat(c).join().split(','),
  814. E = [],
  815. x = [];
  816. return (
  817. c.forEach(function (e, t) {
  818. t % 2
  819. ? x.push(h(c[t - 1], c[t], p).y)
  820. : x.push(h(c[t], c[t + 1], p).x),
  821. 6 === x.length && (E.push(x), (x = []));
  822. }),
  823. E
  824. );
  825. };
  826. (e.SVGPathElement.prototype.setAttribute = function (e, t) {
  827. 'd' === e && ((this[d] = null), (this[f] = null)),
  828. s.call(this, e, t);
  829. }),
  830. (e.SVGPathElement.prototype.removeAttribute = function (e, t) {
  831. 'd' === e && ((this[d] = null), (this[f] = null)),
  832. u.call(this, e);
  833. }),
  834. (e.SVGPathElement.prototype.getPathData = function (e) {
  835. if (e && e.normalize) {
  836. if (this[f]) return l(this[f]);
  837. this[d]
  838. ? (t = l(this[d]))
  839. : ((t = n(this.getAttribute('d') || '')), (this[d] = l(t)));
  840. e = r(
  841. ((s = []),
  842. (c = p = h = u = null),
  843. t.forEach(function (e) {
  844. var t,
  845. n,
  846. a,
  847. i,
  848. o,
  849. l,
  850. r = e.type;
  851. 'M' === r
  852. ? ((o = e.values[0]),
  853. (l = e.values[1]),
  854. s.push({ type: 'M', values: [o, l] }),
  855. (u = p = o),
  856. (h = c = l))
  857. : 'm' === r
  858. ? ((o = u + e.values[0]),
  859. (l = h + e.values[1]),
  860. s.push({ type: 'M', values: [o, l] }),
  861. (u = p = o),
  862. (h = c = l))
  863. : 'L' === r
  864. ? ((o = e.values[0]),
  865. (l = e.values[1]),
  866. s.push({ type: 'L', values: [o, l] }),
  867. (u = o),
  868. (h = l))
  869. : 'l' === r
  870. ? ((o = u + e.values[0]),
  871. (l = h + e.values[1]),
  872. s.push({ type: 'L', values: [o, l] }),
  873. (u = o),
  874. (h = l))
  875. : 'C' === r
  876. ? ((t = e.values[0]),
  877. (n = e.values[1]),
  878. (a = e.values[2]),
  879. (i = e.values[3]),
  880. (o = e.values[4]),
  881. (l = e.values[5]),
  882. s.push({ type: 'C', values: [t, n, a, i, o, l] }),
  883. (u = o),
  884. (h = l))
  885. : 'c' === r
  886. ? ((t = u + e.values[0]),
  887. (n = h + e.values[1]),
  888. (a = u + e.values[2]),
  889. (i = h + e.values[3]),
  890. (o = u + e.values[4]),
  891. (l = h + e.values[5]),
  892. s.push({ type: 'C', values: [t, n, a, i, o, l] }),
  893. (u = o),
  894. (h = l))
  895. : 'Q' === r
  896. ? ((t = e.values[0]),
  897. (n = e.values[1]),
  898. (o = e.values[2]),
  899. (l = e.values[3]),
  900. s.push({ type: 'Q', values: [t, n, o, l] }),
  901. (u = o),
  902. (h = l))
  903. : 'q' === r
  904. ? ((t = u + e.values[0]),
  905. (n = h + e.values[1]),
  906. (o = u + e.values[2]),
  907. (l = h + e.values[3]),
  908. s.push({ type: 'Q', values: [t, n, o, l] }),
  909. (u = o),
  910. (h = l))
  911. : 'A' === r
  912. ? ((o = e.values[5]),
  913. (l = e.values[6]),
  914. s.push({
  915. type: 'A',
  916. values: [
  917. e.values[0],
  918. e.values[1],
  919. e.values[2],
  920. e.values[3],
  921. e.values[4],
  922. o,
  923. l,
  924. ],
  925. }),
  926. (u = o),
  927. (h = l))
  928. : 'a' === r
  929. ? ((o = u + e.values[5]),
  930. (l = h + e.values[6]),
  931. s.push({
  932. type: 'A',
  933. values: [
  934. e.values[0],
  935. e.values[1],
  936. e.values[2],
  937. e.values[3],
  938. e.values[4],
  939. o,
  940. l,
  941. ],
  942. }),
  943. (u = o),
  944. (h = l))
  945. : 'H' === r
  946. ? ((o = e.values[0]),
  947. s.push({ type: 'H', values: [o] }),
  948. (u = o))
  949. : 'h' === r
  950. ? ((o = u + e.values[0]),
  951. s.push({ type: 'H', values: [o] }),
  952. (u = o))
  953. : 'V' === r
  954. ? ((l = e.values[0]),
  955. s.push({ type: 'V', values: [l] }),
  956. (h = l))
  957. : 'v' === r
  958. ? ((l = h + e.values[0]),
  959. s.push({ type: 'V', values: [l] }),
  960. (h = l))
  961. : 'S' === r
  962. ? ((a = e.values[0]),
  963. (i = e.values[1]),
  964. (o = e.values[2]),
  965. (l = e.values[3]),
  966. s.push({ type: 'S', values: [a, i, o, l] }),
  967. (u = o),
  968. (h = l))
  969. : 's' === r
  970. ? ((a = u + e.values[0]),
  971. (i = h + e.values[1]),
  972. (o = u + e.values[2]),
  973. (l = h + e.values[3]),
  974. s.push({ type: 'S', values: [a, i, o, l] }),
  975. (u = o),
  976. (h = l))
  977. : 'T' === r
  978. ? ((o = e.values[0]),
  979. (l = e.values[1]),
  980. s.push({ type: 'T', values: [o, l] }),
  981. (u = o),
  982. (h = l))
  983. : 't' === r
  984. ? ((o = u + e.values[0]),
  985. (l = h + e.values[1]),
  986. s.push({ type: 'T', values: [o, l] }),
  987. (u = o),
  988. (h = l))
  989. : ('Z' !== r && 'z' !== r) ||
  990. (s.push({ type: 'Z', values: [] }), (u = p), (h = c));
  991. }),
  992. s)
  993. );
  994. return (this[f] = l(e)), e;
  995. }
  996. if (this[d]) return l(this[d]);
  997. var s,
  998. u,
  999. h,
  1000. p,
  1001. c,
  1002. t = n(this.getAttribute('d') || '');
  1003. return (this[d] = l(t)), t;
  1004. }),
  1005. (e.SVGPathElement.prototype.setPathData = function (e) {
  1006. if (0 === e.length)
  1007. o ? this.setAttribute('d', '') : this.removeAttribute('d');
  1008. else {
  1009. for (var t = '', n = 0, a = e.length; n < a; n += 1) {
  1010. var i = e[n];
  1011. 0 < n && (t += ' '),
  1012. (t += i.type),
  1013. i.values &&
  1014. 0 < i.values.length &&
  1015. (t += ' ' + i.values.join(' '));
  1016. }
  1017. this.setAttribute('d', t);
  1018. }
  1019. }),
  1020. (e.SVGRectElement.prototype.getPathData = function (e) {
  1021. var t = this.x.baseVal.value,
  1022. n = this.y.baseVal.value,
  1023. a = this.width.baseVal.value,
  1024. i = this.height.baseVal.value,
  1025. o = (this.hasAttribute('rx') ? this.rx : this.ry).baseVal.value,
  1026. l = (this.hasAttribute('ry') ? this.ry : this.rx).baseVal.value,
  1027. n = (n = [
  1028. { type: 'M', values: [t + (o = a / 2 < o ? a / 2 : o), n] },
  1029. { type: 'H', values: [t + a - o] },
  1030. {
  1031. type: 'A',
  1032. values: [
  1033. o,
  1034. (l = i / 2 < l ? i / 2 : l),
  1035. 0,
  1036. 0,
  1037. 1,
  1038. t + a,
  1039. n + l,
  1040. ],
  1041. },
  1042. { type: 'V', values: [n + i - l] },
  1043. { type: 'A', values: [o, l, 0, 0, 1, t + a - o, n + i] },
  1044. { type: 'H', values: [t + o] },
  1045. { type: 'A', values: [o, l, 0, 0, 1, t, n + i - l] },
  1046. { type: 'V', values: [n + l] },
  1047. { type: 'A', values: [o, l, 0, 0, 1, t + o, n] },
  1048. { type: 'Z', values: [] },
  1049. ]).filter(function (e) {
  1050. return (
  1051. 'A' !== e.type || (0 !== e.values[0] && 0 !== e.values[1])
  1052. );
  1053. });
  1054. return (n = e && !0 === e.normalize ? r(n) : n);
  1055. }),
  1056. (e.SVGCircleElement.prototype.getPathData = function (e) {
  1057. var t = this.cx.baseVal.value,
  1058. n = this.cy.baseVal.value,
  1059. a = this.r.baseVal.value,
  1060. n = [
  1061. { type: 'M', values: [t + a, n] },
  1062. { type: 'A', values: [a, a, 0, 0, 1, t, n + a] },
  1063. { type: 'A', values: [a, a, 0, 0, 1, t - a, n] },
  1064. { type: 'A', values: [a, a, 0, 0, 1, t, n - a] },
  1065. { type: 'A', values: [a, a, 0, 0, 1, t + a, n] },
  1066. { type: 'Z', values: [] },
  1067. ];
  1068. return (n = e && !0 === e.normalize ? r(n) : n);
  1069. }),
  1070. (e.SVGEllipseElement.prototype.getPathData = function (e) {
  1071. var t = this.cx.baseVal.value,
  1072. n = this.cy.baseVal.value,
  1073. a = this.rx.baseVal.value,
  1074. i = this.ry.baseVal.value,
  1075. n = [
  1076. { type: 'M', values: [t + a, n] },
  1077. { type: 'A', values: [a, i, 0, 0, 1, t, n + i] },
  1078. { type: 'A', values: [a, i, 0, 0, 1, t - a, n] },
  1079. { type: 'A', values: [a, i, 0, 0, 1, t, n - i] },
  1080. { type: 'A', values: [a, i, 0, 0, 1, t + a, n] },
  1081. { type: 'Z', values: [] },
  1082. ];
  1083. return (n = e && !0 === e.normalize ? r(n) : n);
  1084. }),
  1085. (e.SVGLineElement.prototype.getPathData = function () {
  1086. return [
  1087. {
  1088. type: 'M',
  1089. values: [this.x1.baseVal.value, this.y1.baseVal.value],
  1090. },
  1091. {
  1092. type: 'L',
  1093. values: [this.x2.baseVal.value, this.y2.baseVal.value],
  1094. },
  1095. ];
  1096. }),
  1097. (e.SVGPolylineElement.prototype.getPathData = function () {
  1098. for (var e = [], t = 0; t < this.points.numberOfItems; t += 1) {
  1099. var n = this.points.getItem(t);
  1100. e.push({ type: 0 === t ? 'M' : 'L', values: [n.x, n.y] });
  1101. }
  1102. return e;
  1103. }),
  1104. (e.SVGPolygonElement.prototype.getPathData = function () {
  1105. for (var e = [], t = 0; t < this.points.numberOfItems; t += 1) {
  1106. var n = this.points.getItem(t);
  1107. e.push({ type: 0 === t ? 'M' : 'L', values: [n.x, n.y] });
  1108. }
  1109. return e.push({ type: 'Z', values: [] }), e;
  1110. });
  1111. })();
  1112. },
  1113. S =
  1114. ((a = {}),
  1115. (Ee.m = n =
  1116. [
  1117. function (e, t, n) {
  1118. n.r(t);
  1119. var a = 500,
  1120. i = [],
  1121. o =
  1122. window.requestAnimationFrame ||
  1123. window.mozRequestAnimationFrame ||
  1124. window.webkitRequestAnimationFrame ||
  1125. window.msRequestAnimationFrame ||
  1126. function (e) {
  1127. return setTimeout(e, 1e3 / 60);
  1128. },
  1129. l =
  1130. window.cancelAnimationFrame ||
  1131. window.mozCancelAnimationFrame ||
  1132. window.webkitCancelAnimationFrame ||
  1133. window.msCancelAnimationFrame ||
  1134. function (e) {
  1135. return clearTimeout(e);
  1136. },
  1137. r = Date.now(),
  1138. s = void 0;
  1139. function u() {
  1140. var n = void 0,
  1141. e = void 0;
  1142. s && (l.call(window, s), (s = null)),
  1143. i.forEach(function (e) {
  1144. var t;
  1145. (t = e.event) && ((e.event = null), e.listener(t), (n = !0));
  1146. }),
  1147. n
  1148. ? ((r = Date.now()), (e = !0))
  1149. : Date.now() - r < a && (e = !0),
  1150. e && (s = o.call(window, u));
  1151. }
  1152. function h(n) {
  1153. var a = -1;
  1154. return (
  1155. i.some(function (e, t) {
  1156. return e.listener === n && ((a = t), !0);
  1157. }),
  1158. a
  1159. );
  1160. }
  1161. t.default = {
  1162. add: function (e) {
  1163. var t = void 0;
  1164. return -1 === h(e)
  1165. ? (i.push((t = { listener: e })),
  1166. function (e) {
  1167. (t.event = e), s || u();
  1168. })
  1169. : null;
  1170. },
  1171. remove: function (e) {
  1172. -1 < (e = h(e)) &&
  1173. (i.splice(e, 1),
  1174. !i.length && s && (l.call(window, s), (s = null)));
  1175. },
  1176. };
  1177. },
  1178. ]),
  1179. (Ee.c = a),
  1180. (Ee.d = function (e, t, n) {
  1181. Ee.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: n });
  1182. }),
  1183. (Ee.r = function (e) {
  1184. 'undefined' != typeof Symbol &&
  1185. Symbol.toStringTag &&
  1186. Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }),
  1187. Object.defineProperty(e, '__esModule', { value: !0 });
  1188. }),
  1189. (Ee.t = function (t, e) {
  1190. if ((1 & e && (t = Ee(t)), 8 & e)) return t;
  1191. if (4 & e && 'object' == typeof t && t && t.__esModule) return t;
  1192. var n = Object.create(null);
  1193. if (
  1194. (Ee.r(n),
  1195. Object.defineProperty(n, 'default', { enumerable: !0, value: t }),
  1196. 2 & e && 'string' != typeof t)
  1197. )
  1198. for (var a in t)
  1199. Ee.d(
  1200. n,
  1201. a,
  1202. function (e) {
  1203. return t[e];
  1204. }.bind(null, a)
  1205. );
  1206. return n;
  1207. }),
  1208. (Ee.n = function (e) {
  1209. var t =
  1210. e && e.__esModule
  1211. ? function () {
  1212. return e.default;
  1213. }
  1214. : function () {
  1215. return e;
  1216. };
  1217. return Ee.d(t, 'a', t), t;
  1218. }),
  1219. (Ee.o = function (e, t) {
  1220. return Object.prototype.hasOwnProperty.call(e, t);
  1221. }),
  1222. (Ee.p = ''),
  1223. Ee((Ee.s = 0)).default),
  1224. de = {
  1225. line_altColor: { iniValue: !1 },
  1226. line_color: {},
  1227. line_colorTra: { iniValue: !1 },
  1228. line_strokeWidth: {},
  1229. plug_enabled: { iniValue: !1 },
  1230. plug_enabledSE: { hasSE: !0, iniValue: !1 },
  1231. plug_plugSE: { hasSE: !0, iniValue: Y },
  1232. plug_colorSE: { hasSE: !0 },
  1233. plug_colorTraSE: { hasSE: !0, iniValue: !1 },
  1234. plug_markerWidthSE: { hasSE: !0 },
  1235. plug_markerHeightSE: { hasSE: !0 },
  1236. lineOutline_enabled: { iniValue: !1 },
  1237. lineOutline_color: {},
  1238. lineOutline_colorTra: { iniValue: !1 },
  1239. lineOutline_strokeWidth: {},
  1240. lineOutline_inStrokeWidth: {},
  1241. plugOutline_enabledSE: { hasSE: !0, iniValue: !1 },
  1242. plugOutline_plugSE: { hasSE: !0, iniValue: Y },
  1243. plugOutline_colorSE: { hasSE: !0 },
  1244. plugOutline_colorTraSE: { hasSE: !0, iniValue: !1 },
  1245. plugOutline_strokeWidthSE: { hasSE: !0 },
  1246. plugOutline_inStrokeWidthSE: { hasSE: !0 },
  1247. position_socketXYSE: { hasSE: !0, hasProps: !0 },
  1248. position_plugOverheadSE: { hasSE: !0 },
  1249. position_path: {},
  1250. position_lineStrokeWidth: {},
  1251. position_socketGravitySE: { hasSE: !0 },
  1252. path_pathData: {},
  1253. path_edge: { hasProps: !0 },
  1254. viewBox_bBox: { hasProps: !0 },
  1255. viewBox_plugBCircleSE: { hasSE: !0 },
  1256. lineMask_enabled: { iniValue: !1 },
  1257. lineMask_outlineMode: { iniValue: !1 },
  1258. lineMask_x: {},
  1259. lineMask_y: {},
  1260. lineOutlineMask_x: {},
  1261. lineOutlineMask_y: {},
  1262. maskBGRect_x: {},
  1263. maskBGRect_y: {},
  1264. capsMaskAnchor_enabledSE: { hasSE: !0, iniValue: !1 },
  1265. capsMaskAnchor_pathDataSE: { hasSE: !0 },
  1266. capsMaskAnchor_strokeWidthSE: { hasSE: !0 },
  1267. capsMaskMarker_enabled: { iniValue: !1 },
  1268. capsMaskMarker_enabledSE: { hasSE: !0, iniValue: !1 },
  1269. capsMaskMarker_plugSE: { hasSE: !0, iniValue: Y },
  1270. capsMaskMarker_markerWidthSE: { hasSE: !0 },
  1271. capsMaskMarker_markerHeightSE: { hasSE: !0 },
  1272. caps_enabled: { iniValue: !1 },
  1273. attach_plugSideLenSE: { hasSE: !0 },
  1274. attach_plugBackLenSE: { hasSE: !0 },
  1275. },
  1276. fe = {
  1277. show_on: {},
  1278. show_effect: {},
  1279. show_animOptions: {},
  1280. show_animId: {},
  1281. show_inAnim: {},
  1282. },
  1283. ye = 'fade',
  1284. me = [],
  1285. Se = {},
  1286. ge = 0,
  1287. _e = {},
  1288. ve = 0;
  1289. function Ee(e) {
  1290. if (a[e]) return a[e].exports;
  1291. var t = (a[e] = { i: e, l: !1, exports: {} });
  1292. return n[e].call(t.exports, t, t.exports, Ee), (t.l = !0), t.exports;
  1293. }
  1294. function xe() {
  1295. var i = Date.now(),
  1296. o = !1;
  1297. e && (r.call(window, e), (e = null)),
  1298. E.forEach(function (e) {
  1299. var t, n, a;
  1300. if (e.framesStart) {
  1301. if (
  1302. (t = i - e.framesStart) >= e.duration &&
  1303. e.count &&
  1304. e.loopsLeft <= 1
  1305. )
  1306. return (
  1307. (a =
  1308. e.frames[(e.lastFrame = e.reverse ? 0 : e.frames.length - 1)]),
  1309. e.frameCallback(a.value, !0, a.timeRatio, a.outputRatio),
  1310. void (e.framesStart = null)
  1311. );
  1312. if (t > e.duration) {
  1313. if (((n = Math.floor(t / e.duration)), e.count)) {
  1314. if (n >= e.loopsLeft)
  1315. return (
  1316. (a =
  1317. e.frames[
  1318. (e.lastFrame = e.reverse ? 0 : e.frames.length - 1)
  1319. ]),
  1320. e.frameCallback(a.value, !0, a.timeRatio, a.outputRatio),
  1321. void (e.framesStart = null)
  1322. );
  1323. e.loopsLeft -= n;
  1324. }
  1325. (e.framesStart += e.duration * n), (t = i - e.framesStart);
  1326. }
  1327. e.reverse && (t = e.duration - t),
  1328. (a = e.frames[(e.lastFrame = Math.round(t / v))]),
  1329. !1 !== e.frameCallback(a.value, !1, a.timeRatio, a.outputRatio)
  1330. ? (o = !0)
  1331. : (e.framesStart = null);
  1332. }
  1333. }),
  1334. o && (e = l.call(window, xe));
  1335. }
  1336. function be(e, t) {
  1337. (e.framesStart = Date.now()),
  1338. null != t && (e.framesStart -= e.duration * (e.reverse ? 1 - t : t)),
  1339. (e.loopsLeft = e.count),
  1340. (e.lastFrame = null),
  1341. xe();
  1342. }
  1343. function ke(t, n) {
  1344. var e, a;
  1345. return (
  1346. typeof t != typeof n ||
  1347. (e = he(t) ? 'obj' : Array.isArray(t) ? 'array' : '') !=
  1348. (he(n) ? 'obj' : Array.isArray(n) ? 'array' : '') ||
  1349. ('obj' === e
  1350. ? ke((a = Object.keys(t).sort()), Object.keys(n).sort()) ||
  1351. a.some(function (e) {
  1352. return ke(t[e], n[e]);
  1353. })
  1354. : 'array' === e
  1355. ? t.length !== n.length ||
  1356. t.some(function (e, t) {
  1357. return ke(e, n[t]);
  1358. })
  1359. : t !== n)
  1360. );
  1361. }
  1362. function we(n) {
  1363. return (
  1364. n &&
  1365. (he(n)
  1366. ? Object.keys(n).reduce(function (e, t) {
  1367. return (e[t] = we(n[t])), e;
  1368. }, {})
  1369. : Array.isArray(n)
  1370. ? n.map(we)
  1371. : n)
  1372. );
  1373. }
  1374. function Oe(e) {
  1375. var t,
  1376. n,
  1377. a,
  1378. i = 1,
  1379. o = (e = (e + '').trim());
  1380. function l(e) {
  1381. var t = 1,
  1382. e = m.exec(e);
  1383. return (
  1384. e &&
  1385. ((t = parseFloat(e[1])),
  1386. e[2]
  1387. ? (t = 0 <= t && t <= 100 ? t / 100 : 1)
  1388. : (t < 0 || 1 < t) && (t = 1)),
  1389. t
  1390. );
  1391. }
  1392. return (
  1393. (t = /^(rgba|hsla|hwb|gray|device\-cmyk)\s*\(([\s\S]+)\)$/i.exec(e))
  1394. ? ((n = t[1].toLowerCase()),
  1395. (a = t[2].trim().split(/\s*,\s*/)),
  1396. 'rgba' === n && 4 === a.length
  1397. ? ((i = l(a[3])), (o = 'rgb(' + a.slice(0, 3).join(', ') + ')'))
  1398. : 'hsla' === n && 4 === a.length
  1399. ? ((i = l(a[3])), (o = 'hsl(' + a.slice(0, 3).join(', ') + ')'))
  1400. : 'hwb' === n && 4 === a.length
  1401. ? ((i = l(a[3])), (o = 'hwb(' + a.slice(0, 3).join(', ') + ')'))
  1402. : 'gray' === n && 2 === a.length
  1403. ? ((i = l(a[1])), (o = 'gray(' + a[0] + ')'))
  1404. : 'device-cmyk' === n &&
  1405. 5 <= a.length &&
  1406. ((i = l(a[4])),
  1407. (o = 'device-cmyk(' + a.slice(0, 4).join(', ') + ')')))
  1408. : (t = /^\#(?:([\da-f]{6})([\da-f]{2})|([\da-f]{3})([\da-f]))$/i.exec(
  1409. e
  1410. ))
  1411. ? (o = t[1]
  1412. ? ((i = parseInt(t[2], 16) / 255), '#' + t[1])
  1413. : ((i = parseInt(t[4] + t[4], 16) / 255), '#' + t[3]))
  1414. : 'transparent' === e.toLocaleLowerCase() && (i = 0),
  1415. [i, o]
  1416. );
  1417. }
  1418. function Me(e) {
  1419. return !(
  1420. !e ||
  1421. e.nodeType !== Node.ELEMENT_NODE ||
  1422. 'function' != typeof e.getBoundingClientRect
  1423. );
  1424. }
  1425. function Ie(e, t) {
  1426. var n,
  1427. a,
  1428. i,
  1429. o = {};
  1430. if (!(i = e.ownerDocument))
  1431. return (
  1432. console.error('Cannot get document that contains the element.'), null
  1433. );
  1434. if (e.compareDocumentPosition(i) & Node.DOCUMENT_POSITION_DISCONNECTED)
  1435. return console.error('A disconnected element was passed.'), null;
  1436. for (a in (n = e.getBoundingClientRect())) o[a] = n[a];
  1437. if (!t) {
  1438. if (!(i = i.defaultView))
  1439. return (
  1440. console.error('Cannot get window that contains the element.'), null
  1441. );
  1442. (o.left += i.pageXOffset),
  1443. (o.right += i.pageXOffset),
  1444. (o.top += i.pageYOffset),
  1445. (o.bottom += i.pageYOffset);
  1446. }
  1447. return o;
  1448. }
  1449. function Ce(e, t) {
  1450. var n,
  1451. a = [],
  1452. i = e;
  1453. for (t = t || window; ; ) {
  1454. if (!(n = i.ownerDocument))
  1455. return (
  1456. console.error('Cannot get document that contains the element.'), null
  1457. );
  1458. if (!(n = n.defaultView))
  1459. return (
  1460. console.error('Cannot get window that contains the element.'), null
  1461. );
  1462. if (n === t) break;
  1463. if (!(i = n.frameElement))
  1464. return console.error('`baseWindow` was not found.'), null;
  1465. a.unshift(i);
  1466. }
  1467. return a;
  1468. }
  1469. function Le(e, t) {
  1470. var a = 0,
  1471. i = 0;
  1472. return (t = Ce(e, (t = t || window)))
  1473. ? t.length
  1474. ? (t.forEach(function (e, t) {
  1475. var n = Ie(e, 0 < t);
  1476. (a += n.left),
  1477. (i += n.top),
  1478. (e = (t = e).ownerDocument.defaultView.getComputedStyle(t, '')),
  1479. (n = {
  1480. left: t.clientLeft + parseFloat(e.paddingLeft),
  1481. top: t.clientTop + parseFloat(e.paddingTop),
  1482. }),
  1483. (a += n.left),
  1484. (i += n.top);
  1485. }),
  1486. ((t = Ie(e, !0)).left += a),
  1487. (t.right += a),
  1488. (t.top += i),
  1489. (t.bottom += i),
  1490. t)
  1491. : Ie(e)
  1492. : null;
  1493. }
  1494. function Ae(e, t) {
  1495. var n = e.x - t.x,
  1496. t = e.y - t.y;
  1497. return Math.sqrt(n * n + t * t);
  1498. }
  1499. function Ve(e, t, n) {
  1500. var a = t.x - e.x,
  1501. t = t.y - e.y;
  1502. return {
  1503. x: e.x + a * n,
  1504. y: e.y + t * n,
  1505. angle: Math.atan2(t, a) / (Math.PI / 180),
  1506. };
  1507. }
  1508. function Pe(e, t, n) {
  1509. e = Math.atan2(e.y - t.y, t.x - e.x);
  1510. return { x: t.x + Math.cos(e) * n, y: t.y + Math.sin(e) * n * -1 };
  1511. }
  1512. function Ne(e, t, n, a, i) {
  1513. var o = i * i,
  1514. l = o * i,
  1515. r = 1 - i,
  1516. s = r * r,
  1517. u = s * r,
  1518. h = u * e.x + 3 * s * i * t.x + 3 * r * o * n.x + l * a.x,
  1519. p = u * e.y + 3 * s * i * t.y + 3 * r * o * n.y + l * a.y,
  1520. c = e.x + 2 * i * (t.x - e.x) + o * (n.x - 2 * t.x + e.x),
  1521. u = e.y + 2 * i * (t.y - e.y) + o * (n.y - 2 * t.y + e.y),
  1522. s = t.x + 2 * i * (n.x - t.x) + o * (a.x - 2 * n.x + t.x),
  1523. l = t.y + 2 * i * (n.y - t.y) + o * (a.y - 2 * n.y + t.y),
  1524. o = r * e.x + i * t.x,
  1525. e = r * e.y + i * t.y,
  1526. t = r * n.x + i * a.x,
  1527. i = r * n.y + i * a.y,
  1528. a = 90 - (180 * Math.atan2(c - s, u - l)) / Math.PI;
  1529. return {
  1530. x: h,
  1531. y: p,
  1532. fromP2: { x: c, y: u },
  1533. toP1: { x: s, y: l },
  1534. fromP1: { x: o, y: e },
  1535. toP2: { x: t, y: i },
  1536. angle: (a += 180 < a ? -180 : 180),
  1537. };
  1538. }
  1539. function Te(n, a, i, o, e) {
  1540. function l(e, t, n, a, i) {
  1541. return (
  1542. e * (e * (-3 * t + 9 * n - 9 * a + 3 * i) + 6 * t - 12 * n + 6 * a) -
  1543. 3 * t +
  1544. 3 * n
  1545. );
  1546. }
  1547. var r,
  1548. s,
  1549. u = [
  1550. 0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069,
  1551. 0.1069, 0.0472, 0.0472,
  1552. ],
  1553. h = 0,
  1554. p = (e = null == e || 1 < e ? 1 : e < 0 ? 0 : e) / 2;
  1555. return (
  1556. [
  1557. -0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, 0.7699,
  1558. -0.9041, 0.9041, -0.9816, 0.9816,
  1559. ].forEach(function (e, t) {
  1560. (r = l((s = p * e + p), n.x, a.x, i.x, o.x)),
  1561. (s = l(s, n.y, a.y, i.y, o.y)),
  1562. (s = r * r + s * s),
  1563. (h += u[t] * Math.sqrt(s));
  1564. }),
  1565. p * h
  1566. );
  1567. }
  1568. function We(e, t, n, a, i) {
  1569. for (
  1570. var o, l = 0.5, r = 1 - l;
  1571. (o = Te(e, t, n, a, r)), !(Math.abs(o - i) <= 0.01);
  1572. )
  1573. r += (o < i ? 1 : -1) * (l /= 2);
  1574. return r;
  1575. }
  1576. function Be(e, t) {
  1577. var n;
  1578. return (
  1579. e.forEach(function (e) {
  1580. e = t
  1581. ? e.map(function (e) {
  1582. e = { x: e.x, y: e.y };
  1583. return t(e), e;
  1584. })
  1585. : e;
  1586. (n = n || [{ type: 'M', values: [e[0].x, e[0].y] }]).push(
  1587. e.length
  1588. ? 2 === e.length
  1589. ? { type: 'L', values: [e[1].x, e[1].y] }
  1590. : {
  1591. type: 'C',
  1592. values: [e[1].x, e[1].y, e[2].x, e[2].y, e[3].x, e[3].y],
  1593. }
  1594. : { type: 'Z', values: [] }
  1595. );
  1596. }),
  1597. n
  1598. );
  1599. }
  1600. function Re(e) {
  1601. var t = [],
  1602. n = 0;
  1603. return (
  1604. e.forEach(function (e) {
  1605. e = (2 === e.length ? Ae : Te).apply(null, e);
  1606. t.push(e), (n += e);
  1607. }),
  1608. { segsLen: t, lenAll: n }
  1609. );
  1610. }
  1611. function Fe(e, a) {
  1612. return (
  1613. null == e ||
  1614. null == a ||
  1615. e.length !== a.length ||
  1616. e.some(function (e, t) {
  1617. var n = a[t];
  1618. return (
  1619. e.type !== n.type ||
  1620. e.values.some(function (e, t) {
  1621. return e !== n.values[t];
  1622. })
  1623. );
  1624. })
  1625. );
  1626. }
  1627. function Ge(e, t, n) {
  1628. e.events[t]
  1629. ? e.events[t].indexOf(n) < 0 && e.events[t].push(n)
  1630. : (e.events[t] = [n]);
  1631. }
  1632. function De(e, t, n) {
  1633. var a;
  1634. e.events[t] &&
  1635. -1 < (a = e.events[t].indexOf(n)) &&
  1636. e.events[t].splice(a, 1);
  1637. }
  1638. function ze(e) {
  1639. t && clearTimeout(t),
  1640. me.push(e),
  1641. (t = setTimeout(function () {
  1642. me.forEach(function (e) {
  1643. e();
  1644. }),
  1645. (me = []);
  1646. }, 0));
  1647. }
  1648. function je(e, t) {
  1649. e.reflowTargets.indexOf(t) < 0 && e.reflowTargets.push(t);
  1650. }
  1651. function He(e) {
  1652. e.reflowTargets.forEach(function (e) {
  1653. var n;
  1654. (n = e),
  1655. setTimeout(function () {
  1656. var e = n.parentNode,
  1657. t = n.nextSibling;
  1658. e.insertBefore(e.removeChild(n), t);
  1659. }, 0);
  1660. }),
  1661. (e.reflowTargets = []);
  1662. }
  1663. function Ue(e, t, n, a, i, o, l) {
  1664. var r;
  1665. 'auto-start-reverse' === n
  1666. ? ('boolean' != typeof s &&
  1667. (t.setAttribute('orient', 'auto-start-reverse'),
  1668. (s =
  1669. t.orientType.baseVal ===
  1670. SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN)),
  1671. s
  1672. ? t.setAttribute('orient', n)
  1673. : ((r = i.createSVGTransform()).setRotate(180, 0, 0),
  1674. o.transform.baseVal.appendItem(r),
  1675. t.setAttribute('orient', 'auto'),
  1676. (r = !0)))
  1677. : (t.setAttribute('orient', n), !1 === s && o.transform.baseVal.clear()),
  1678. (t = t.viewBox.baseVal),
  1679. r
  1680. ? ((t.x = -a.right), (t.y = -a.bottom))
  1681. : ((t.x = a.left), (t.y = a.top)),
  1682. (t.width = a.width),
  1683. (t.height = a.height),
  1684. ie && je(e, l);
  1685. }
  1686. function Ze(e, t) {
  1687. return {
  1688. prop: e ? 'markerEnd' : 'markerStart',
  1689. orient: t ? (t.noRotate ? '0' : e ? 'auto' : 'auto-start-reverse') : null,
  1690. };
  1691. }
  1692. function Ye(n, a) {
  1693. Object.keys(a).forEach(function (e) {
  1694. var t = a[e];
  1695. n[e] =
  1696. null != t.iniValue
  1697. ? t.hasSE
  1698. ? [t.iniValue, t.iniValue]
  1699. : t.iniValue
  1700. : t.hasSE
  1701. ? t.hasProps
  1702. ? [{}, {}]
  1703. : []
  1704. : t.hasProps
  1705. ? {}
  1706. : null;
  1707. });
  1708. }
  1709. function Xe(t, e, n, a, i) {
  1710. return (
  1711. a !== e[n] &&
  1712. ((e[n] = a),
  1713. i &&
  1714. i.forEach(function (e) {
  1715. e(t, a, n);
  1716. }),
  1717. !0)
  1718. );
  1719. }
  1720. function qe(e) {
  1721. function t(e, t) {
  1722. return e + parseFloat(t);
  1723. }
  1724. var n = e.document,
  1725. a = e.getComputedStyle(n.documentElement, ''),
  1726. e = e.getComputedStyle(n.body, ''),
  1727. n = { x: 0, y: 0 };
  1728. return (
  1729. 'static' !== e.position
  1730. ? ((n.x -= [
  1731. a.marginLeft,
  1732. a.borderLeftWidth,
  1733. a.paddingLeft,
  1734. e.marginLeft,
  1735. e.borderLeftWidth,
  1736. ].reduce(t, 0)),
  1737. (n.y -= [
  1738. a.marginTop,
  1739. a.borderTopWidth,
  1740. a.paddingTop,
  1741. e.marginTop,
  1742. e.borderTopWidth,
  1743. ].reduce(t, 0)))
  1744. : 'static' !== a.position &&
  1745. ((n.x -= [a.marginLeft, a.borderLeftWidth].reduce(t, 0)),
  1746. (n.y -= [a.marginTop, a.borderTopWidth].reduce(t, 0))),
  1747. n
  1748. );
  1749. }
  1750. function Qe(e) {
  1751. var t,
  1752. n = e.document;
  1753. n.getElementById(f) ||
  1754. ((t = new e.DOMParser().parseFromString(y, 'image/svg+xml')),
  1755. n.body.appendChild(t.documentElement),
  1756. ce(e));
  1757. }
  1758. function Ke(l) {
  1759. var g,
  1760. c,
  1761. _,
  1762. e,
  1763. n,
  1764. a,
  1765. i,
  1766. d,
  1767. o,
  1768. r,
  1769. s,
  1770. t,
  1771. u,
  1772. h,
  1773. p = l.options,
  1774. f = l.curStats,
  1775. y = l.aplStats,
  1776. v = f.position_socketXYSE,
  1777. m = !1;
  1778. function S(e, t) {
  1779. e =
  1780. t === b
  1781. ? { x: e.left + e.width / 2, y: e.top }
  1782. : t === k
  1783. ? { x: e.right, y: e.top + e.height / 2 }
  1784. : t === L
  1785. ? { x: e.left + e.width / 2, y: e.bottom }
  1786. : { x: e.left, y: e.top + e.height / 2 };
  1787. return (e.socketId = t), e;
  1788. }
  1789. function E(e) {
  1790. return { x: e.x, y: e.y };
  1791. }
  1792. if (
  1793. ((f.position_path = p.path),
  1794. (f.position_lineStrokeWidth = f.line_strokeWidth),
  1795. (f.position_socketGravitySE = g = we(p.socketGravitySE)),
  1796. (c = [0, 1].map(function (e) {
  1797. var t = p.anchorSE[e],
  1798. n = l.optionIsAttach.anchorSE[e],
  1799. a = !1 !== n ? _e[t._id] : null,
  1800. i =
  1801. !1 !== n && a.conf.getStrokeWidth ? a.conf.getStrokeWidth(a, l) : 0,
  1802. o =
  1803. !1 !== n && a.conf.getBBoxNest
  1804. ? a.conf.getBBoxNest(a, l, i)
  1805. : Le(t, l.baseWindow);
  1806. return (
  1807. (f.capsMaskAnchor_pathDataSE[e] =
  1808. !1 !== n && a.conf.getPathData
  1809. ? a.conf.getPathData(a, l, i)
  1810. : ((n = null != (t = o).right ? t.right : t.left + t.width),
  1811. (a = null != t.bottom ? t.bottom : t.top + t.height),
  1812. [
  1813. { type: 'M', values: [t.left, t.top] },
  1814. { type: 'L', values: [n, t.top] },
  1815. { type: 'L', values: [n, a] },
  1816. { type: 'L', values: [t.left, a] },
  1817. { type: 'Z', values: [] },
  1818. ])),
  1819. (f.capsMaskAnchor_strokeWidthSE[e] = i),
  1820. o
  1821. );
  1822. })),
  1823. (i = -1),
  1824. p.socketSE[0] && p.socketSE[1]
  1825. ? ((v[0] = S(c[0], p.socketSE[0])), (v[1] = S(c[1], p.socketSE[1])))
  1826. : (p.socketSE[0] || p.socketSE[1]
  1827. ? ((a = p.socketSE[0] ? ((n = 0), 1) : ((n = 1), 0)),
  1828. (v[n] = S(c[n], p.socketSE[n])),
  1829. (e = G.map(function (e) {
  1830. return S(c[a], e);
  1831. })).forEach(function (e) {
  1832. var t = Ae(e, v[n]);
  1833. (t < i || -1 === i) && ((v[a] = e), (i = t));
  1834. }))
  1835. : ((e = G.map(function (e) {
  1836. return S(c[1], e);
  1837. })),
  1838. G.map(function (e) {
  1839. return S(c[0], e);
  1840. }).forEach(function (n) {
  1841. e.forEach(function (e) {
  1842. var t = Ae(n, e);
  1843. (t < i || -1 === i) && ((v[0] = n), (v[1] = e), (i = t));
  1844. });
  1845. })),
  1846. [0, 1].forEach(function (e) {
  1847. var t, n;
  1848. p.socketSE[e] ||
  1849. (c[e].width || c[e].height
  1850. ? c[e].width || (v[e].socketId !== A && v[e].socketId !== k)
  1851. ? c[e].height ||
  1852. (v[e].socketId !== b && v[e].socketId !== L) ||
  1853. (v[e].socketId = 0 <= v[e ? 0 : 1].y - c[e].top ? L : b)
  1854. : (v[e].socketId = 0 <= v[e ? 0 : 1].x - c[e].left ? k : A)
  1855. : ((t = v[e ? 0 : 1].x - c[e].left),
  1856. (n = v[e ? 0 : 1].y - c[e].top),
  1857. (v[e].socketId =
  1858. Math.abs(t) >= Math.abs(n)
  1859. ? 0 <= t
  1860. ? k
  1861. : A
  1862. : 0 <= n
  1863. ? L
  1864. : b)));
  1865. })),
  1866. f.position_path !== y.position_path ||
  1867. f.position_lineStrokeWidth !== y.position_lineStrokeWidth ||
  1868. [0, 1].some(function (e) {
  1869. return (
  1870. f.position_plugOverheadSE[e] !== y.position_plugOverheadSE[e] ||
  1871. ((t = v[e]),
  1872. (n = y.position_socketXYSE[e]),
  1873. t.x !== n.x || t.y !== n.y || t.socketId !== n.socketId) ||
  1874. ((t = g[e]),
  1875. (n = y.position_socketGravitySE[e]),
  1876. (e = null == t ? 'auto' : Array.isArray(t) ? 'array' : 'number') !=
  1877. (null == n ? 'auto' : Array.isArray(n) ? 'array' : 'number') ||
  1878. ('array' == e ? t[0] !== n[0] || t[1] !== n[1] : t !== n))
  1879. );
  1880. var t, n;
  1881. }))
  1882. ) {
  1883. switch (
  1884. ((l.pathList.baseVal = _ = []),
  1885. (l.pathList.animVal = null),
  1886. f.position_path)
  1887. ) {
  1888. case P:
  1889. _.push([E(v[0]), E(v[1])]);
  1890. break;
  1891. case N:
  1892. (t =
  1893. ('number' == typeof g[0] && 0 < g[0]) ||
  1894. ('number' == typeof g[1] && 0 < g[1])),
  1895. (u = ne * (t ? -1 : 1)),
  1896. (h = Math.atan2(v[1].y - v[0].y, v[1].x - v[0].x)),
  1897. (t = u - h),
  1898. (h = Math.PI - h - u),
  1899. (u = (Ae(v[0], v[1]) / Math.sqrt(2)) * te),
  1900. (t = {
  1901. x: v[0].x + Math.cos(t) * u,
  1902. y: v[0].y + Math.sin(t) * u * -1,
  1903. }),
  1904. (u = {
  1905. x: v[1].x + Math.cos(h) * u,
  1906. y: v[1].y + Math.sin(h) * u * -1,
  1907. }),
  1908. _.push([E(v[0]), t, u, E(v[1])]);
  1909. break;
  1910. case T:
  1911. case W:
  1912. (o = [g[0], f.position_path === W ? 0 : g[1]]),
  1913. (r = []),
  1914. (s = []),
  1915. v.forEach(function (e, t) {
  1916. var n,
  1917. a = o[t],
  1918. i = Array.isArray(a)
  1919. ? { x: a[0], y: a[1] }
  1920. : 'number' == typeof a
  1921. ? e.socketId === b
  1922. ? { x: 0, y: -a }
  1923. : e.socketId === k
  1924. ? { x: a, y: 0 }
  1925. : e.socketId === L
  1926. ? { x: 0, y: a }
  1927. : { x: -a, y: 0 }
  1928. : ((n = v[t ? 0 : 1]),
  1929. (a =
  1930. 0 < (a = f.position_plugOverheadSE[t])
  1931. ? U + (K < a ? (a - K) * J : 0)
  1932. : z +
  1933. (f.position_lineStrokeWidth > j
  1934. ? (f.position_lineStrokeWidth - j) * H
  1935. : 0)),
  1936. e.socketId === b
  1937. ? { x: 0, y: -(i = (i = (e.y - n.y) / 2) < a ? a : i) }
  1938. : e.socketId === k
  1939. ? { x: (i = (i = (n.x - e.x) / 2) < a ? a : i), y: 0 }
  1940. : e.socketId === L
  1941. ? { x: 0, y: (i = (i = (n.y - e.y) / 2) < a ? a : i) }
  1942. : { x: -(i = (i = (e.x - n.x) / 2) < a ? a : i), y: 0 });
  1943. (r[t] = e.x + i.x), (s[t] = e.y + i.y);
  1944. }),
  1945. _.push([
  1946. E(v[0]),
  1947. { x: r[0], y: s[0] },
  1948. { x: r[1], y: s[1] },
  1949. E(v[1]),
  1950. ]);
  1951. break;
  1952. case B:
  1953. !(function () {
  1954. var n,
  1955. i = 1,
  1956. l = 2,
  1957. r = 3,
  1958. o = 4,
  1959. s = [[], []],
  1960. u = [];
  1961. function h(e) {
  1962. return e === i ? r : e === l ? o : e === r ? i : l;
  1963. }
  1964. function p(e) {
  1965. return e === l || e === o ? 'x' : 'y';
  1966. }
  1967. function c(e, t, n) {
  1968. var a = { x: e.x, y: e.y };
  1969. if (n) {
  1970. if (n === h(e.dirId)) throw new Error('Invalid dirId: ' + n);
  1971. a.dirId = n;
  1972. } else a.dirId = e.dirId;
  1973. return (
  1974. a.dirId === i
  1975. ? (a.y -= t)
  1976. : a.dirId === l
  1977. ? (a.x += t)
  1978. : a.dirId === r
  1979. ? (a.y += t)
  1980. : (a.x -= t),
  1981. a
  1982. );
  1983. }
  1984. function d(e, t) {
  1985. return t.dirId === i
  1986. ? e.y <= t.y
  1987. : t.dirId === l
  1988. ? e.x >= t.x
  1989. : t.dirId === r
  1990. ? e.y >= t.y
  1991. : e.x <= t.x;
  1992. }
  1993. function f(e, t) {
  1994. return t.dirId === i || t.dirId === r ? e.x === t.x : e.y === t.y;
  1995. }
  1996. function y(e) {
  1997. return e[0]
  1998. ? { contain: 0, notContain: 1 }
  1999. : { contain: 1, notContain: 0 };
  2000. }
  2001. function m(e, t, n) {
  2002. return Math.abs(t[n] - e[n]);
  2003. }
  2004. function S(e, t, n) {
  2005. return 'x' === n ? (e.x < t.x ? l : o) : e.y < t.y ? r : i;
  2006. }
  2007. for (
  2008. v.forEach(function (e, t) {
  2009. var n = E(e),
  2010. a = g[t];
  2011. (e = Array.isArray(a)
  2012. ? a[0] < 0
  2013. ? [o, -a[0]]
  2014. : 0 < a[0]
  2015. ? [l, a[0]]
  2016. : a[1] < 0
  2017. ? [i, -a[1]]
  2018. : 0 < a[1]
  2019. ? [r, a[1]]
  2020. : [e.socketId, 0]
  2021. : 'number' != typeof a
  2022. ? [e.socketId, ee]
  2023. : 0 <= a
  2024. ? [e.socketId, a]
  2025. : [h(e.socketId), -a]),
  2026. (n.dirId = e[0]),
  2027. (a = e[1]),
  2028. s[t].push(n),
  2029. (u[t] = c(n, a));
  2030. });
  2031. (function () {
  2032. var e,
  2033. t,
  2034. a,
  2035. i,
  2036. n = [d(u[1], u[0]), d(u[0], u[1])],
  2037. o = [p(u[0].dirId), p(u[1].dirId)];
  2038. if (o[0] === o[1]) {
  2039. if (n[0] && n[1])
  2040. return void (
  2041. f(u[1], u[0]) ||
  2042. (u[0][o[0]] === u[1][o[1]]
  2043. ? (s[0].push(u[0]), s[1].push(u[1]))
  2044. : ((e = u[0][o[0]] + (u[1][o[1]] - u[0][o[0]]) / 2),
  2045. s[0].push(c(u[0], Math.abs(e - u[0][o[0]]))),
  2046. s[1].push(c(u[1], Math.abs(e - u[1][o[1]])))))
  2047. );
  2048. n[0] !== n[1]
  2049. ? ((t = y(n)),
  2050. (a = m(u[t.notContain], u[t.contain], o[t.notContain])) <
  2051. ee && (u[t.notContain] = c(u[t.notContain], ee - a)),
  2052. s[t.notContain].push(u[t.notContain]),
  2053. (u[t.notContain] = c(
  2054. u[t.notContain],
  2055. ee,
  2056. f(u[t.contain], u[t.notContain])
  2057. ? 'x' === o[t.notContain]
  2058. ? r
  2059. : l
  2060. : S(
  2061. u[t.notContain],
  2062. u[t.contain],
  2063. 'x' === o[t.notContain] ? 'y' : 'x'
  2064. )
  2065. )))
  2066. : ((a = m(u[0], u[1], 'x' === o[0] ? 'y' : 'x')),
  2067. s.forEach(function (e, t) {
  2068. var n = 0 === t ? 1 : 0;
  2069. e.push(u[t]),
  2070. (u[t] = c(
  2071. u[t],
  2072. ee,
  2073. 2 * ee <= a
  2074. ? S(u[t], u[n], 'x' === o[t] ? 'y' : 'x')
  2075. : 'x' === o[t]
  2076. ? r
  2077. : l
  2078. ));
  2079. }));
  2080. } else {
  2081. if (n[0] && n[1])
  2082. return void (f(u[1], u[0])
  2083. ? s[1].push(u[1])
  2084. : f(u[0], u[1])
  2085. ? s[0].push(u[0])
  2086. : s[0].push(
  2087. 'x' === o[0]
  2088. ? { x: u[1].x, y: u[0].y }
  2089. : { x: u[0].x, y: u[1].y }
  2090. ));
  2091. n[0] !== n[1]
  2092. ? ((t = y(n)),
  2093. s[t.notContain].push(u[t.notContain]),
  2094. (u[t.notContain] = c(
  2095. u[t.notContain],
  2096. ee,
  2097. m(u[t.notContain], u[t.contain], o[t.contain]) >= ee
  2098. ? S(u[t.notContain], u[t.contain], o[t.contain])
  2099. : u[t.contain].dirId
  2100. )))
  2101. : ((i = [
  2102. { x: u[0].x, y: u[0].y },
  2103. { x: u[1].x, y: u[1].y },
  2104. ]),
  2105. s.forEach(function (e, t) {
  2106. var n = 0 === t ? 1 : 0,
  2107. a = m(i[t], i[n], o[t]);
  2108. a < ee && (u[t] = c(u[t], ee - a)),
  2109. e.push(u[t]),
  2110. (u[t] = c(u[t], ee, S(u[t], u[n], o[n])));
  2111. }));
  2112. }
  2113. return 1;
  2114. })();
  2115. );
  2116. s[1].reverse(),
  2117. s[0].concat(s[1]).forEach(function (e, t) {
  2118. e = { x: e.x, y: e.y };
  2119. 0 < t && _.push([n, e]), (n = e);
  2120. });
  2121. })();
  2122. }
  2123. (d = []),
  2124. f.position_plugOverheadSE.forEach(function (e, t) {
  2125. var n,
  2126. a,
  2127. i,
  2128. o,
  2129. l,
  2130. r,
  2131. s,
  2132. u,
  2133. h,
  2134. p = !t;
  2135. 0 < e
  2136. ? 2 === (n = _[(a = p ? 0 : _.length - 1)]).length
  2137. ? ((d[a] = d[a] || Ae.apply(null, n)),
  2138. d[a] > $ &&
  2139. (d[a] - e < $ && (e = d[a] - $),
  2140. (s = Ve(n[0], n[1], (p ? e : d[a] - e) / d[a])),
  2141. (_[a] = p ? [s, n[1]] : [n[0], s]),
  2142. (d[a] -= e)))
  2143. : ((d[a] = d[a] || Te.apply(null, n)),
  2144. d[a] > $ &&
  2145. (d[a] - e < $ && (e = d[a] - $),
  2146. (s = Ne(
  2147. n[0],
  2148. n[1],
  2149. n[2],
  2150. n[3],
  2151. We(n[0], n[1], n[2], n[3], p ? e : d[a] - e)
  2152. )),
  2153. (o = p ? ((i = n[0]), s.toP1) : ((i = n[3]), s.fromP2)),
  2154. (l = Math.atan2(i.y - s.y, s.x - i.x)),
  2155. (r = Ae(s, o)),
  2156. (s.x = i.x + Math.cos(l) * e),
  2157. (s.y = i.y + Math.sin(l) * e * -1),
  2158. (o.x = s.x + Math.cos(l) * r),
  2159. (o.y = s.y + Math.sin(l) * r * -1),
  2160. (_[a] = p
  2161. ? [s, s.toP1, s.toP2, n[3]]
  2162. : [n[0], s.fromP1, s.fromP2, s]),
  2163. (d[a] = null)))
  2164. : e < 0 &&
  2165. ((n = _[(a = p ? 0 : _.length - 1)]),
  2166. (s = v[t].socketId),
  2167. (t =
  2168. -c[t][
  2169. 'x' == (u = s === A || s === k ? 'x' : 'y')
  2170. ? 'width'
  2171. : 'height'
  2172. ]),
  2173. (h = (e = e < t ? t : e) * (s === A || s === b ? -1 : 1)),
  2174. 2 === n.length
  2175. ? (n[p ? 0 : n.length - 1][u] += h)
  2176. : (p ? [0, 1] : [n.length - 2, n.length - 1]).forEach(function (
  2177. e
  2178. ) {
  2179. n[e][u] += h;
  2180. }),
  2181. (d[a] = null));
  2182. }),
  2183. (y.position_socketXYSE = we(v)),
  2184. (y.position_plugOverheadSE = we(f.position_plugOverheadSE)),
  2185. (y.position_path = f.position_path),
  2186. (y.position_lineStrokeWidth = f.position_lineStrokeWidth),
  2187. (y.position_socketGravitySE = we(g)),
  2188. (m = !0),
  2189. l.events.apl_position &&
  2190. l.events.apl_position.forEach(function (e) {
  2191. e(l, _);
  2192. });
  2193. }
  2194. return m;
  2195. }
  2196. function Je(t, n) {
  2197. n !== t.isShown &&
  2198. (!!n != !!t.isShown && (t.svg.style.visibility = n ? '' : 'hidden'),
  2199. (t.isShown = n),
  2200. t.events &&
  2201. t.events.svgShow &&
  2202. t.events.svgShow.forEach(function (e) {
  2203. e(t, n);
  2204. }));
  2205. }
  2206. function $e(e, t) {
  2207. var n,
  2208. a,
  2209. h,
  2210. p,
  2211. c,
  2212. d,
  2213. f,
  2214. i,
  2215. o,
  2216. l,
  2217. r,
  2218. s,
  2219. u,
  2220. y,
  2221. m,
  2222. S,
  2223. g,
  2224. _,
  2225. v,
  2226. E,
  2227. x,
  2228. b,
  2229. k,
  2230. w,
  2231. O,
  2232. M,
  2233. I,
  2234. C,
  2235. L,
  2236. A,
  2237. V,
  2238. P,
  2239. N,
  2240. T,
  2241. W,
  2242. B,
  2243. R,
  2244. F,
  2245. G,
  2246. D,
  2247. z,
  2248. j,
  2249. H,
  2250. U = {};
  2251. t.line &&
  2252. (U.line =
  2253. ((i = (n = e).options),
  2254. (a = n.curStats),
  2255. (o = n.events),
  2256. (l = !1),
  2257. (l = Xe(n, a, 'line_color', i.lineColor, o.cur_line_color) || l),
  2258. (l = Xe(n, a, 'line_colorTra', Oe(a.line_color)[0] < 1) || l),
  2259. (l =
  2260. Xe(n, a, 'line_strokeWidth', i.lineSize, o.cur_line_strokeWidth) ||
  2261. l))),
  2262. (t.plug || U.line) &&
  2263. (U.plug =
  2264. ((p = (h = e).options),
  2265. (c = h.curStats),
  2266. (d = h.events),
  2267. (f = !1),
  2268. [0, 1].forEach(function (e) {
  2269. var t,
  2270. n,
  2271. a,
  2272. i,
  2273. o,
  2274. l,
  2275. r,
  2276. s,
  2277. u = p.plugSE[e];
  2278. (f = Xe(h, c.plug_enabledSE, e, u !== Y) || f),
  2279. (f = Xe(h, c.plug_plugSE, e, u) || f),
  2280. (f =
  2281. Xe(
  2282. h,
  2283. c.plug_colorSE,
  2284. e,
  2285. (s = p.plugColorSE[e] || c.line_color),
  2286. d.cur_plug_colorSE
  2287. ) || f),
  2288. (f = Xe(h, c.plug_colorTraSE, e, Oe(s)[0] < 1) || f),
  2289. u !== Y &&
  2290. ((i = n = (t = X[q[u]]).widthR * p.plugSizeSE[e]),
  2291. (o = a = t.heightR * p.plugSizeSE[e]),
  2292. re && ((i *= c.line_strokeWidth), (o *= c.line_strokeWidth)),
  2293. (f = Xe(h, c.plug_markerWidthSE, e, i) || f),
  2294. (f = Xe(h, c.plug_markerHeightSE, e, o) || f),
  2295. (c.capsMaskMarker_markerWidthSE[e] = n),
  2296. (c.capsMaskMarker_markerHeightSE[e] = a)),
  2297. (c.plugOutline_plugSE[e] = c.capsMaskMarker_plugSE[e] = u),
  2298. c.plug_enabledSE[e]
  2299. ? ((s = (c.line_strokeWidth / ue.lineSize) * p.plugSizeSE[e]),
  2300. (c.position_plugOverheadSE[e] = t.overhead * s),
  2301. (c.viewBox_plugBCircleSE[e] = t.bCircle * s),
  2302. (l = t.sideLen * s),
  2303. (r = t.backLen * s))
  2304. : ((c.position_plugOverheadSE[e] = -c.line_strokeWidth / 2),
  2305. (c.viewBox_plugBCircleSE[e] = l = r = 0)),
  2306. Xe(h, c.attach_plugSideLenSE, e, l, d.cur_attach_plugSideLenSE),
  2307. Xe(h, c.attach_plugBackLenSE, e, r, d.cur_attach_plugBackLenSE),
  2308. (c.capsMaskAnchor_enabledSE[e] = !c.plug_enabledSE[e]);
  2309. }),
  2310. (f =
  2311. Xe(
  2312. h,
  2313. c,
  2314. 'plug_enabled',
  2315. c.plug_enabledSE[0] || c.plug_enabledSE[1]
  2316. ) || f))),
  2317. (t.lineOutline || U.line) &&
  2318. (U.lineOutline =
  2319. ((o = (i = e).options),
  2320. (l = i.curStats),
  2321. (k = !1),
  2322. (k = Xe(i, l, 'lineOutline_enabled', o.lineOutlineEnabled) || k),
  2323. (k = Xe(i, l, 'lineOutline_color', o.lineOutlineColor) || k),
  2324. (k =
  2325. Xe(i, l, 'lineOutline_colorTra', Oe(l.lineOutline_color)[0] < 1) ||
  2326. k),
  2327. (o = l.line_strokeWidth * o.lineOutlineSize),
  2328. (k =
  2329. Xe(i, l, 'lineOutline_strokeWidth', l.line_strokeWidth - 2 * o) ||
  2330. k),
  2331. (k =
  2332. Xe(
  2333. i,
  2334. l,
  2335. 'lineOutline_inStrokeWidth',
  2336. l.lineOutline_colorTra
  2337. ? l.lineOutline_strokeWidth + 2 * se
  2338. : l.line_strokeWidth - o
  2339. ) || k))),
  2340. (t.plugOutline || U.line || U.plug || U.lineOutline) &&
  2341. (U.plugOutline =
  2342. ((s = (r = e).options),
  2343. (u = r.curStats),
  2344. (y = !1),
  2345. [0, 1].forEach(function (e) {
  2346. var t = u.plugOutline_plugSE[e],
  2347. n = t !== Y ? X[q[t]] : null;
  2348. (y =
  2349. Xe(
  2350. r,
  2351. u.plugOutline_enabledSE,
  2352. e,
  2353. s.plugOutlineEnabledSE[e] &&
  2354. u.plug_enabled &&
  2355. u.plug_enabledSE[e] &&
  2356. !!n &&
  2357. !!n.outlineBase
  2358. ) || y),
  2359. (y =
  2360. Xe(
  2361. r,
  2362. u.plugOutline_colorSE,
  2363. e,
  2364. (t = s.plugOutlineColorSE[e] || u.lineOutline_color)
  2365. ) || y),
  2366. (y = Xe(r, u.plugOutline_colorTraSE, e, Oe(t)[0] < 1) || y),
  2367. n &&
  2368. n.outlineBase &&
  2369. ((t = s.plugOutlineSizeSE[e]) > n.outlineMax &&
  2370. (t = n.outlineMax),
  2371. (t *= 2 * n.outlineBase),
  2372. (y = Xe(r, u.plugOutline_strokeWidthSE, e, t) || y),
  2373. (y =
  2374. Xe(
  2375. r,
  2376. u.plugOutline_inStrokeWidthSE,
  2377. e,
  2378. u.plugOutline_colorTraSE[e]
  2379. ? t -
  2380. (se /
  2381. (u.line_strokeWidth / ue.lineSize) /
  2382. s.plugSizeSE[e]) *
  2383. 2
  2384. : t / 2
  2385. ) || y));
  2386. }),
  2387. y)),
  2388. (t.faces || U.line || U.plug || U.lineOutline || U.plugOutline) &&
  2389. (U.faces =
  2390. ((g = (m = e).curStats),
  2391. (_ = m.aplStats),
  2392. (v = m.events),
  2393. (E = !1),
  2394. !g.line_altColor &&
  2395. Xe(m, _, 'line_color', (S = g.line_color), v.apl_line_color) &&
  2396. ((m.lineFace.style.stroke = S), (E = !0)),
  2397. Xe(
  2398. m,
  2399. _,
  2400. 'line_strokeWidth',
  2401. (S = g.line_strokeWidth),
  2402. v.apl_line_strokeWidth
  2403. ) &&
  2404. ((m.lineShape.style.strokeWidth = S + 'px'),
  2405. (E = !0),
  2406. (oe || ie) &&
  2407. (je(m, m.lineShape),
  2408. ie && (je(m, m.lineFace), je(m, m.lineMaskCaps)))),
  2409. Xe(
  2410. m,
  2411. _,
  2412. 'lineOutline_enabled',
  2413. (S = g.lineOutline_enabled),
  2414. v.apl_lineOutline_enabled
  2415. ) &&
  2416. ((m.lineOutlineFace.style.display = S ? 'inline' : 'none'),
  2417. (E = !0)),
  2418. g.lineOutline_enabled &&
  2419. (Xe(
  2420. m,
  2421. _,
  2422. 'lineOutline_color',
  2423. (S = g.lineOutline_color),
  2424. v.apl_lineOutline_color
  2425. ) && ((m.lineOutlineFace.style.stroke = S), (E = !0)),
  2426. Xe(
  2427. m,
  2428. _,
  2429. 'lineOutline_strokeWidth',
  2430. (S = g.lineOutline_strokeWidth),
  2431. v.apl_lineOutline_strokeWidth
  2432. ) &&
  2433. ((m.lineOutlineMaskShape.style.strokeWidth = S + 'px'),
  2434. (E = !0),
  2435. ie && (je(m, m.lineOutlineMaskCaps), je(m, m.lineOutlineFace))),
  2436. Xe(
  2437. m,
  2438. _,
  2439. 'lineOutline_inStrokeWidth',
  2440. (S = g.lineOutline_inStrokeWidth),
  2441. v.apl_lineOutline_inStrokeWidth
  2442. ) &&
  2443. ((m.lineMaskShape.style.strokeWidth = S + 'px'),
  2444. (E = !0),
  2445. ie && (je(m, m.lineOutlineMaskCaps), je(m, m.lineOutlineFace)))),
  2446. Xe(m, _, 'plug_enabled', (S = g.plug_enabled), v.apl_plug_enabled) &&
  2447. ((m.plugsFace.style.display = S ? 'inline' : 'none'), (E = !0)),
  2448. g.plug_enabled &&
  2449. [0, 1].forEach(function (n) {
  2450. var e = g.plug_plugSE[n],
  2451. t = e !== Y ? X[q[e]] : null,
  2452. a = Ze(n, t);
  2453. Xe(
  2454. m,
  2455. _.plug_enabledSE,
  2456. n,
  2457. (S = g.plug_enabledSE[n]),
  2458. v.apl_plug_enabledSE
  2459. ) &&
  2460. ((m.plugsFace.style[a.prop] = S
  2461. ? 'url(#' + m.plugMarkerIdSE[n] + ')'
  2462. : 'none'),
  2463. (E = !0)),
  2464. g.plug_enabledSE[n] &&
  2465. (Xe(m, _.plug_plugSE, n, e, v.apl_plug_plugSE) &&
  2466. ((m.plugFaceSE[n].href.baseVal = '#' + t.elmId),
  2467. Ue(
  2468. m,
  2469. m.plugMarkerSE[n],
  2470. a.orient,
  2471. t.bBox,
  2472. m.svg,
  2473. m.plugMarkerShapeSE[n],
  2474. m.plugsFace
  2475. ),
  2476. (E = !0),
  2477. oe && je(m, m.plugsFace)),
  2478. Xe(
  2479. m,
  2480. _.plug_colorSE,
  2481. n,
  2482. (S = g.plug_colorSE[n]),
  2483. v.apl_plug_colorSE
  2484. ) &&
  2485. ((m.plugFaceSE[n].style.fill = S),
  2486. (E = !0),
  2487. (le || re || ie) &&
  2488. !g.line_colorTra &&
  2489. je(m, ie ? m.lineMaskCaps : m.capsMaskLine)),
  2490. ['markerWidth', 'markerHeight'].forEach(function (e) {
  2491. var t = 'plug_' + e + 'SE';
  2492. Xe(m, _[t], n, (S = g[t][n]), v['apl_' + t]) &&
  2493. ((m.plugMarkerSE[n][e].baseVal.value = S), (E = !0));
  2494. }),
  2495. Xe(
  2496. m,
  2497. _.plugOutline_enabledSE,
  2498. n,
  2499. (S = g.plugOutline_enabledSE[n]),
  2500. v.apl_plugOutline_enabledSE
  2501. ) &&
  2502. (S
  2503. ? ((m.plugFaceSE[n].style.mask =
  2504. 'url(#' + m.plugMaskIdSE[n] + ')'),
  2505. (m.plugOutlineFaceSE[n].style.display = 'inline'))
  2506. : ((m.plugFaceSE[n].style.mask = 'none'),
  2507. (m.plugOutlineFaceSE[n].style.display = 'none')),
  2508. (E = !0)),
  2509. g.plugOutline_enabledSE[n] &&
  2510. (Xe(
  2511. m,
  2512. _.plugOutline_plugSE,
  2513. n,
  2514. e,
  2515. v.apl_plugOutline_plugSE
  2516. ) &&
  2517. ((m.plugOutlineFaceSE[n].href.baseVal =
  2518. m.plugMaskShapeSE[n].href.baseVal =
  2519. m.plugOutlineMaskShapeSE[n].href.baseVal =
  2520. '#' + t.elmId),
  2521. [m.plugMaskSE[n], m.plugOutlineMaskSE[n]].forEach(
  2522. function (e) {
  2523. (e.x.baseVal.value = t.bBox.left),
  2524. (e.y.baseVal.value = t.bBox.top),
  2525. (e.width.baseVal.value = t.bBox.width),
  2526. (e.height.baseVal.value = t.bBox.height);
  2527. }
  2528. ),
  2529. (E = !0)),
  2530. Xe(
  2531. m,
  2532. _.plugOutline_colorSE,
  2533. n,
  2534. (S = g.plugOutline_colorSE[n]),
  2535. v.apl_plugOutline_colorSE
  2536. ) &&
  2537. ((m.plugOutlineFaceSE[n].style.fill = S),
  2538. (E = !0),
  2539. ie &&
  2540. (je(m, m.lineMaskCaps), je(m, m.lineOutlineMaskCaps))),
  2541. Xe(
  2542. m,
  2543. _.plugOutline_strokeWidthSE,
  2544. n,
  2545. (S = g.plugOutline_strokeWidthSE[n]),
  2546. v.apl_plugOutline_strokeWidthSE
  2547. ) &&
  2548. ((m.plugOutlineMaskShapeSE[n].style.strokeWidth =
  2549. S + 'px'),
  2550. (E = !0)),
  2551. Xe(
  2552. m,
  2553. _.plugOutline_inStrokeWidthSE,
  2554. n,
  2555. (S = g.plugOutline_inStrokeWidthSE[n]),
  2556. v.apl_plugOutline_inStrokeWidthSE
  2557. ) &&
  2558. ((m.plugMaskShapeSE[n].style.strokeWidth = S + 'px'),
  2559. (E = !0))));
  2560. }),
  2561. E)),
  2562. (t.position || U.line || U.plug) && (U.position = Ke(e)),
  2563. (t.path || U.position) &&
  2564. (U.path =
  2565. ((k = (x = e).curStats),
  2566. (I = x.aplStats),
  2567. (M = x.pathList.animVal || x.pathList.baseVal),
  2568. (w = k.path_edge),
  2569. (C = !1),
  2570. M &&
  2571. ((w.x1 = w.x2 = M[0][0].x),
  2572. (w.y1 = w.y2 = M[0][0].y),
  2573. (k.path_pathData = b =
  2574. Be(M, function (e) {
  2575. e.x < w.x1 && (w.x1 = e.x),
  2576. e.y < w.y1 && (w.y1 = e.y),
  2577. e.x > w.x2 && (w.x2 = e.x),
  2578. e.y > w.y2 && (w.y2 = e.y);
  2579. })),
  2580. Fe(b, I.path_pathData) &&
  2581. (x.linePath.setPathData(b),
  2582. (I.path_pathData = b),
  2583. (C = !0),
  2584. ie
  2585. ? (je(x, x.plugsFace), je(x, x.lineMaskCaps))
  2586. : oe && je(x, x.linePath),
  2587. x.events.apl_path &&
  2588. x.events.apl_path.forEach(function (e) {
  2589. e(x, b);
  2590. }))),
  2591. C)),
  2592. (U.viewBox =
  2593. ((M = (O = e).curStats),
  2594. (I = O.aplStats),
  2595. (C = M.path_edge),
  2596. (L = M.viewBox_bBox),
  2597. (A = I.viewBox_bBox),
  2598. (V = O.svg.viewBox.baseVal),
  2599. (P = O.svg.style),
  2600. (N = !1),
  2601. (I = Math.max(
  2602. M.line_strokeWidth / 2,
  2603. M.viewBox_plugBCircleSE[0] || 0,
  2604. M.viewBox_plugBCircleSE[1] || 0
  2605. )),
  2606. (T = { x1: C.x1 - I, y1: C.y1 - I, x2: C.x2 + I, y2: C.y2 + I }),
  2607. O.events.new_edge4viewBox &&
  2608. O.events.new_edge4viewBox.forEach(function (e) {
  2609. e(O, T);
  2610. }),
  2611. (L.x = M.lineMask_x = M.lineOutlineMask_x = M.maskBGRect_x = T.x1),
  2612. (L.y = M.lineMask_y = M.lineOutlineMask_y = M.maskBGRect_y = T.y1),
  2613. (L.width = T.x2 - T.x1),
  2614. (L.height = T.y2 - T.y1),
  2615. ['x', 'y', 'width', 'height'].forEach(function (e) {
  2616. var t;
  2617. (t = L[e]) !== A[e] &&
  2618. ((V[e] = A[e] = t),
  2619. (P[Q[e]] =
  2620. t + ('x' === e || 'y' === e ? O.bodyOffset[e] : 0) + 'px'),
  2621. (N = !0));
  2622. }),
  2623. N)),
  2624. (U.mask =
  2625. ((R = (W = e).curStats),
  2626. (F = W.aplStats),
  2627. (G = !1),
  2628. R.plug_enabled
  2629. ? [0, 1].forEach(function (e) {
  2630. R.capsMaskMarker_enabledSE[e] =
  2631. (R.plug_enabledSE[e] && R.plug_colorTraSE[e]) ||
  2632. (R.plugOutline_enabledSE[e] && R.plugOutline_colorTraSE[e]);
  2633. })
  2634. : (R.capsMaskMarker_enabledSE[0] = R.capsMaskMarker_enabledSE[1] =
  2635. !1),
  2636. (R.capsMaskMarker_enabled =
  2637. R.capsMaskMarker_enabledSE[0] || R.capsMaskMarker_enabledSE[1]),
  2638. (R.lineMask_outlineMode = R.lineOutline_enabled),
  2639. (R.caps_enabled =
  2640. R.capsMaskMarker_enabled ||
  2641. R.capsMaskAnchor_enabledSE[0] ||
  2642. R.capsMaskAnchor_enabledSE[1]),
  2643. (R.lineMask_enabled = R.caps_enabled || R.lineMask_outlineMode),
  2644. ((R.lineMask_enabled && !R.lineMask_outlineMode) ||
  2645. R.lineOutline_enabled) &&
  2646. ['x', 'y'].forEach(function (e) {
  2647. var t = 'maskBGRect_' + e;
  2648. Xe(W, F, t, (B = R[t])) &&
  2649. ((W.maskBGRect[e].baseVal.value = B), (G = !0));
  2650. }),
  2651. Xe(W, F, 'lineMask_enabled', (B = R.lineMask_enabled)) &&
  2652. ((W.lineFace.style.mask = B ? 'url(#' + W.lineMaskId + ')' : 'none'),
  2653. (G = !0),
  2654. re && je(W, W.lineMask)),
  2655. R.lineMask_enabled &&
  2656. (Xe(W, F, 'lineMask_outlineMode', (B = R.lineMask_outlineMode)) &&
  2657. (B
  2658. ? ((W.lineMaskBG.style.display = 'none'),
  2659. (W.lineMaskShape.style.display = 'inline'))
  2660. : ((W.lineMaskBG.style.display = 'inline'),
  2661. (W.lineMaskShape.style.display = 'none')),
  2662. (G = !0)),
  2663. ['x', 'y'].forEach(function (e) {
  2664. var t = 'lineMask_' + e;
  2665. Xe(W, F, t, (B = R[t])) &&
  2666. ((W.lineMask[e].baseVal.value = B), (G = !0));
  2667. }),
  2668. Xe(W, F, 'caps_enabled', (B = R.caps_enabled)) &&
  2669. ((W.lineMaskCaps.style.display =
  2670. W.lineOutlineMaskCaps.style.display =
  2671. B ? 'inline' : 'none'),
  2672. (G = !0),
  2673. re && je(W, W.capsMaskLine)),
  2674. R.caps_enabled &&
  2675. ([0, 1].forEach(function (e) {
  2676. var t;
  2677. Xe(
  2678. W,
  2679. F.capsMaskAnchor_enabledSE,
  2680. e,
  2681. (B = R.capsMaskAnchor_enabledSE[e])
  2682. ) &&
  2683. ((W.capsMaskAnchorSE[e].style.display = B ? 'inline' : 'none'),
  2684. (G = !0),
  2685. re && je(W, W.lineMask)),
  2686. R.capsMaskAnchor_enabledSE[e] &&
  2687. (Fe(
  2688. (t = R.capsMaskAnchor_pathDataSE[e]),
  2689. F.capsMaskAnchor_pathDataSE[e]
  2690. ) &&
  2691. (W.capsMaskAnchorSE[e].setPathData(t),
  2692. (F.capsMaskAnchor_pathDataSE[e] = t),
  2693. (G = !0)),
  2694. Xe(
  2695. W,
  2696. F.capsMaskAnchor_strokeWidthSE,
  2697. e,
  2698. (B = R.capsMaskAnchor_strokeWidthSE[e])
  2699. ) &&
  2700. ((W.capsMaskAnchorSE[e].style.strokeWidth = B + 'px'),
  2701. (G = !0)));
  2702. }),
  2703. Xe(
  2704. W,
  2705. F,
  2706. 'capsMaskMarker_enabled',
  2707. (B = R.capsMaskMarker_enabled)
  2708. ) &&
  2709. ((W.capsMaskLine.style.display = B ? 'inline' : 'none'),
  2710. (G = !0)),
  2711. R.capsMaskMarker_enabled &&
  2712. [0, 1].forEach(function (n) {
  2713. var e = R.capsMaskMarker_plugSE[n],
  2714. t = e !== Y ? X[q[e]] : null,
  2715. a = Ze(n, t);
  2716. Xe(
  2717. W,
  2718. F.capsMaskMarker_enabledSE,
  2719. n,
  2720. (B = R.capsMaskMarker_enabledSE[n])
  2721. ) &&
  2722. ((W.capsMaskLine.style[a.prop] = B
  2723. ? 'url(#' + W.lineMaskMarkerIdSE[n] + ')'
  2724. : 'none'),
  2725. (G = !0)),
  2726. R.capsMaskMarker_enabledSE[n] &&
  2727. (Xe(W, F.capsMaskMarker_plugSE, n, e) &&
  2728. ((W.capsMaskMarkerShapeSE[n].href.baseVal =
  2729. '#' + t.elmId),
  2730. Ue(
  2731. W,
  2732. W.capsMaskMarkerSE[n],
  2733. a.orient,
  2734. t.bBox,
  2735. W.svg,
  2736. W.capsMaskMarkerShapeSE[n],
  2737. W.capsMaskLine
  2738. ),
  2739. (G = !0),
  2740. oe && (je(W, W.capsMaskLine), je(W, W.lineFace))),
  2741. ['markerWidth', 'markerHeight'].forEach(function (e) {
  2742. var t = 'capsMaskMarker_' + e + 'SE';
  2743. Xe(W, F[t], n, (B = R[t][n])) &&
  2744. ((W.capsMaskMarkerSE[n][e].baseVal.value = B),
  2745. (G = !0));
  2746. }));
  2747. }))),
  2748. R.lineOutline_enabled &&
  2749. ['x', 'y'].forEach(function (e) {
  2750. var t = 'lineOutlineMask_' + e;
  2751. Xe(W, F, t, (B = R[t])) &&
  2752. ((W.lineOutlineMask[e].baseVal.value = B), (G = !0));
  2753. }),
  2754. G)),
  2755. t.effect &&
  2756. ((j = (D = e).curStats),
  2757. (H = D.aplStats),
  2758. Object.keys(Z).forEach(function (e) {
  2759. var t = Z[e],
  2760. n = e + '_enabled',
  2761. a = e + '_options',
  2762. e = j[a];
  2763. Xe(D, H, n, (z = j[n]))
  2764. ? (z && (H[a] = we(e)), t[z ? 'init' : 'remove'](D))
  2765. : z &&
  2766. ke(e, H[a]) &&
  2767. (t.remove(D), (H[n] = !0), (H[a] = we(e)), t.init(D));
  2768. })),
  2769. (le || re) && U.line && !U.path && je(e, e.lineShape),
  2770. le && U.plug && !U.line && je(e, e.plugsFace),
  2771. He(e);
  2772. }
  2773. function et(e, t) {
  2774. return {
  2775. duration: (pe(e.duration) && 0 < e.duration ? e : t).duration,
  2776. timing: g.validTiming(e.timing) ? e.timing : we(t.timing),
  2777. };
  2778. }
  2779. function tt(e, t, n, a) {
  2780. var i = e.curStats,
  2781. o = e.aplStats,
  2782. l = {};
  2783. function r() {
  2784. ['show_on', 'show_effect', 'show_animOptions'].forEach(function (e) {
  2785. o[e] = i[e];
  2786. });
  2787. }
  2788. (i.show_on = t),
  2789. n &&
  2790. w[n] &&
  2791. ((i.show_effect = n),
  2792. (i.show_animOptions = et(he(a) ? a : {}, w[n].defaultAnimOptions))),
  2793. (l.show_on = i.show_on !== o.show_on),
  2794. (l.show_effect = i.show_effect !== o.show_effect),
  2795. (l.show_animOptions = ke(i.show_animOptions, o.show_animOptions)),
  2796. l.show_effect || l.show_animOptions
  2797. ? i.show_inAnim
  2798. ? ((n = l.show_effect
  2799. ? w[o.show_effect].stop(e, !0, !0)
  2800. : w[o.show_effect].stop(e)),
  2801. r(),
  2802. w[o.show_effect].init(e, n))
  2803. : l.show_on &&
  2804. (o.show_effect && l.show_effect && w[o.show_effect].stop(e, !0, !0),
  2805. r(),
  2806. w[o.show_effect].init(e))
  2807. : l.show_on && (r(), w[o.show_effect].start(e));
  2808. }
  2809. function nt(e, t, n) {
  2810. n = { props: e, optionName: n };
  2811. return (
  2812. e.attachments.indexOf(t) < 0 &&
  2813. (!t.conf.bind || t.conf.bind(t, n)) &&
  2814. (e.attachments.push(t), t.boundTargets.push(n), 1)
  2815. );
  2816. }
  2817. function at(n, a, e) {
  2818. var i = n.attachments.indexOf(a);
  2819. -1 < i && n.attachments.splice(i, 1),
  2820. a.boundTargets.some(function (e, t) {
  2821. return (
  2822. e.props === n && (a.conf.unbind && a.conf.unbind(a, e), (i = t), !0)
  2823. );
  2824. }) &&
  2825. (a.boundTargets.splice(i, 1),
  2826. e ||
  2827. ze(function () {
  2828. a.boundTargets.length || o(a);
  2829. }));
  2830. }
  2831. function it(s, u) {
  2832. var i,
  2833. n,
  2834. e,
  2835. t,
  2836. a,
  2837. o,
  2838. l,
  2839. r,
  2840. h,
  2841. p,
  2842. c,
  2843. d,
  2844. f,
  2845. y,
  2846. m,
  2847. S = s.options,
  2848. g = {};
  2849. function _(e, t, n, a, i) {
  2850. var o = {};
  2851. return (
  2852. n
  2853. ? null != a
  2854. ? ((o.container = e[n]), (o.key = a))
  2855. : ((o.container = e), (o.key = n))
  2856. : ((o.container = e), (o.key = t)),
  2857. (o.default = i),
  2858. (o.acceptsAuto = null == o.default),
  2859. o
  2860. );
  2861. }
  2862. function v(e, t, n, a, i, o, l) {
  2863. var r,
  2864. s,
  2865. u,
  2866. l = _(e, n, i, o, l);
  2867. return (
  2868. null != t[n] &&
  2869. (s = (t[n] + '').toLowerCase()) &&
  2870. ((l.acceptsAuto && s === D) || (u = a[s])) &&
  2871. u !== l.container[l.key] &&
  2872. ((l.container[l.key] = u), (r = !0)),
  2873. null != l.container[l.key] ||
  2874. l.acceptsAuto ||
  2875. ((l.container[l.key] = l.default), (r = !0)),
  2876. r
  2877. );
  2878. }
  2879. function E(e, t, n, a, i, o, l, r, s) {
  2880. var u,
  2881. h,
  2882. p,
  2883. c,
  2884. l = _(e, n, i, o, l);
  2885. if (!a) {
  2886. if (null == l.default) throw new Error('Invalid `type`: ' + n);
  2887. a = typeof l.default;
  2888. }
  2889. return (
  2890. null != t[n] &&
  2891. ((l.acceptsAuto && (t[n] + '').toLowerCase() === D) ||
  2892. ((p = h = t[n]),
  2893. ('number' === (c = a) ? pe(p) : typeof p === c) &&
  2894. ((h = s && 'string' === a && h ? h.trim() : h), 1) &&
  2895. (!r || r(h)))) &&
  2896. h !== l.container[l.key] &&
  2897. ((l.container[l.key] = h), (u = !0)),
  2898. null != l.container[l.key] ||
  2899. l.acceptsAuto ||
  2900. ((l.container[l.key] = l.default), (u = !0)),
  2901. u
  2902. );
  2903. }
  2904. if (
  2905. ((u = u || {}),
  2906. ['start', 'end'].forEach(function (e, t) {
  2907. var n = u[e],
  2908. a = !1;
  2909. if (n && (Me(n) || (a = I(n, 'anchor'))) && n !== S.anchorSE[t]) {
  2910. if (
  2911. (!1 !== s.optionIsAttach.anchorSE[t] &&
  2912. at(s, _e[S.anchorSE[t]._id]),
  2913. a && !nt(s, _e[n._id], e))
  2914. )
  2915. throw new Error("Can't bind attachment");
  2916. (S.anchorSE[t] = n),
  2917. (s.optionIsAttach.anchorSE[t] = a),
  2918. (i = g.position = !0);
  2919. }
  2920. }),
  2921. !S.anchorSE[0] || !S.anchorSE[1] || S.anchorSE[0] === S.anchorSE[1])
  2922. )
  2923. throw new Error('`start` and `end` are required.');
  2924. function x(e) {
  2925. var t = a.appendChild(y.createElementNS(ae, 'mask'));
  2926. return (
  2927. (t.id = e),
  2928. (t.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE),
  2929. [t.x, t.y, t.width, t.height].forEach(function (e) {
  2930. e.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 0);
  2931. }),
  2932. t
  2933. );
  2934. }
  2935. function b(e) {
  2936. var t = a.appendChild(y.createElementNS(ae, 'marker'));
  2937. return (
  2938. (t.id = e),
  2939. (t.markerUnits.baseVal = SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH),
  2940. t.viewBox.baseVal || t.setAttribute('viewBox', '0 0 0 0'),
  2941. t
  2942. );
  2943. }
  2944. function k(e) {
  2945. return (
  2946. [e.width, e.height].forEach(function (e) {
  2947. e.baseVal.newValueSpecifiedUnits(
  2948. SVGLength.SVG_LENGTHTYPE_PERCENTAGE,
  2949. 100
  2950. );
  2951. }),
  2952. e
  2953. );
  2954. }
  2955. i &&
  2956. (c = (function (e, t) {
  2957. var n, a;
  2958. if (!(e = Ce(e)) || !(n = Ce(t))) throw new Error('Cannot get frames.');
  2959. return (
  2960. e.length &&
  2961. n.length &&
  2962. (e.reverse(),
  2963. n.reverse(),
  2964. e.some(function (t) {
  2965. return n.some(function (e) {
  2966. return e === t && ((a = e.contentWindow), !0);
  2967. });
  2968. })),
  2969. a || window
  2970. );
  2971. })(
  2972. !1 !== s.optionIsAttach.anchorSE[0]
  2973. ? _e[S.anchorSE[0]._id].element
  2974. : S.anchorSE[0],
  2975. !1 !== s.optionIsAttach.anchorSE[1]
  2976. ? _e[S.anchorSE[1]._id].element
  2977. : S.anchorSE[1]
  2978. )) !== s.baseWindow &&
  2979. ((e = c),
  2980. (f = (n = s).aplStats),
  2981. (y = e.document),
  2982. (m = C + '-' + n._id),
  2983. (n.pathList = {}),
  2984. Ye(f, de),
  2985. Object.keys(Z).forEach(function (e) {
  2986. var t = e + '_enabled';
  2987. f[t] && (Z[e].remove(n), (f[t] = !1));
  2988. }),
  2989. n.baseWindow && n.svg && n.baseWindow.document.body.removeChild(n.svg),
  2990. Qe((n.baseWindow = e)),
  2991. (n.bodyOffset = qe(e)),
  2992. (n.svg = t = y.createElementNS(ae, 'svg')),
  2993. (t.className.baseVal = C),
  2994. t.viewBox.baseVal || t.setAttribute('viewBox', '0 0 0 0'),
  2995. (n.defs = a = t.appendChild(y.createElementNS(ae, 'defs'))),
  2996. (n.linePath = l = a.appendChild(y.createElementNS(ae, 'path'))),
  2997. (l.id = r = m + '-line-path'),
  2998. (l.className.baseVal = C + '-line-path'),
  2999. re && (l.style.fill = 'none'),
  3000. (n.lineShape = l = a.appendChild(y.createElementNS(ae, 'use'))),
  3001. (l.id = h = m + '-line-shape'),
  3002. (l.href.baseVal = '#' + r),
  3003. ((o = a.appendChild(y.createElementNS(ae, 'g'))).id = p = m + '-caps'),
  3004. (n.capsMaskAnchorSE = [0, 1].map(function () {
  3005. var e = o.appendChild(y.createElementNS(ae, 'path'));
  3006. return (e.className.baseVal = C + '-caps-mask-anchor'), e;
  3007. })),
  3008. (n.lineMaskMarkerIdSE = [
  3009. m + '-caps-mask-marker-0',
  3010. m + '-caps-mask-marker-1',
  3011. ]),
  3012. (n.capsMaskMarkerSE = [0, 1].map(function (e) {
  3013. return b(n.lineMaskMarkerIdSE[e]);
  3014. })),
  3015. (n.capsMaskMarkerShapeSE = [0, 1].map(function (e) {
  3016. e = n.capsMaskMarkerSE[e].appendChild(y.createElementNS(ae, 'use'));
  3017. return (e.className.baseVal = C + '-caps-mask-marker-shape'), e;
  3018. })),
  3019. (n.capsMaskLine = l = o.appendChild(y.createElementNS(ae, 'use'))),
  3020. (l.className.baseVal = C + '-caps-mask-line'),
  3021. (l.href.baseVal = '#' + h),
  3022. (n.maskBGRect = l = k(a.appendChild(y.createElementNS(ae, 'rect')))),
  3023. (l.id = c = m + '-mask-bg-rect'),
  3024. (l.className.baseVal = C + '-mask-bg-rect'),
  3025. re && (l.style.fill = 'white'),
  3026. (n.lineMask = k(x((n.lineMaskId = m + '-line-mask')))),
  3027. (n.lineMaskBG = l = n.lineMask.appendChild(y.createElementNS(ae, 'use'))),
  3028. (l.href.baseVal = '#' + c),
  3029. (n.lineMaskShape = l =
  3030. n.lineMask.appendChild(y.createElementNS(ae, 'use'))),
  3031. (l.className.baseVal = C + '-line-mask-shape'),
  3032. (l.href.baseVal = '#' + r),
  3033. (l.style.display = 'none'),
  3034. (n.lineMaskCaps = l =
  3035. n.lineMask.appendChild(y.createElementNS(ae, 'use'))),
  3036. (l.href.baseVal = '#' + p),
  3037. (n.lineOutlineMask = k(x((e = m + '-line-outline-mask')))),
  3038. ((l = n.lineOutlineMask.appendChild(
  3039. y.createElementNS(ae, 'use')
  3040. )).href.baseVal = '#' + c),
  3041. (n.lineOutlineMaskShape = l =
  3042. n.lineOutlineMask.appendChild(y.createElementNS(ae, 'use'))),
  3043. (l.className.baseVal = C + '-line-outline-mask-shape'),
  3044. (l.href.baseVal = '#' + r),
  3045. (n.lineOutlineMaskCaps = l =
  3046. n.lineOutlineMask.appendChild(y.createElementNS(ae, 'use'))),
  3047. (l.href.baseVal = '#' + p),
  3048. (n.face = t.appendChild(y.createElementNS(ae, 'g'))),
  3049. (n.lineFace = l = n.face.appendChild(y.createElementNS(ae, 'use'))),
  3050. (l.href.baseVal = '#' + h),
  3051. (n.lineOutlineFace = l =
  3052. n.face.appendChild(y.createElementNS(ae, 'use'))),
  3053. (l.href.baseVal = '#' + h),
  3054. (l.style.mask = 'url(#' + e + ')'),
  3055. (l.style.display = 'none'),
  3056. (n.plugMaskIdSE = [m + '-plug-mask-0', m + '-plug-mask-1']),
  3057. (n.plugMaskSE = [0, 1].map(function (e) {
  3058. return x(n.plugMaskIdSE[e]);
  3059. })),
  3060. (n.plugMaskShapeSE = [0, 1].map(function (e) {
  3061. e = n.plugMaskSE[e].appendChild(y.createElementNS(ae, 'use'));
  3062. return (e.className.baseVal = C + '-plug-mask-shape'), e;
  3063. })),
  3064. (d = []),
  3065. (n.plugOutlineMaskSE = [0, 1].map(function (e) {
  3066. return x((d[e] = m + '-plug-outline-mask-' + e));
  3067. })),
  3068. (n.plugOutlineMaskShapeSE = [0, 1].map(function (e) {
  3069. e = n.plugOutlineMaskSE[e].appendChild(y.createElementNS(ae, 'use'));
  3070. return (e.className.baseVal = C + '-plug-outline-mask-shape'), e;
  3071. })),
  3072. (n.plugMarkerIdSE = [m + '-plug-marker-0', m + '-plug-marker-1']),
  3073. (n.plugMarkerSE = [0, 1].map(function (e) {
  3074. e = b(n.plugMarkerIdSE[e]);
  3075. return (
  3076. re &&
  3077. (e.markerUnits.baseVal =
  3078. SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE),
  3079. e
  3080. );
  3081. })),
  3082. (n.plugMarkerShapeSE = [0, 1].map(function (e) {
  3083. return n.plugMarkerSE[e].appendChild(y.createElementNS(ae, 'g'));
  3084. })),
  3085. (n.plugFaceSE = [0, 1].map(function (e) {
  3086. return n.plugMarkerShapeSE[e].appendChild(y.createElementNS(ae, 'use'));
  3087. })),
  3088. (n.plugOutlineFaceSE = [0, 1].map(function (e) {
  3089. var t = n.plugMarkerShapeSE[e].appendChild(
  3090. y.createElementNS(ae, 'use')
  3091. );
  3092. return (
  3093. (t.style.mask = 'url(#' + d[e] + ')'), (t.style.display = 'none'), t
  3094. );
  3095. })),
  3096. (n.plugsFace = l = n.face.appendChild(y.createElementNS(ae, 'use'))),
  3097. (l.className.baseVal = C + '-plugs-face'),
  3098. (l.href.baseVal = '#' + h),
  3099. (l.style.display = 'none'),
  3100. n.curStats.show_inAnim
  3101. ? ((n.isShown = 1), w[f.show_effect].stop(n, !0))
  3102. : n.isShown || (t.style.visibility = 'hidden'),
  3103. y.body.appendChild(t),
  3104. [0, 1, 2].forEach(function (e) {
  3105. var t,
  3106. e = n.options.labelSEM[e];
  3107. e &&
  3108. I(e, 'label') &&
  3109. (t = _e[e._id]).conf.initSvg &&
  3110. t.conf.initSvg(t, n);
  3111. }),
  3112. (g.line =
  3113. g.plug =
  3114. g.lineOutline =
  3115. g.plugOutline =
  3116. g.faces =
  3117. g.effect =
  3118. !0)),
  3119. (g.position = v(S, u, 'path', R, null, null, ue.path) || g.position),
  3120. (g.position = v(S, u, 'startSocket', V, 'socketSE', 0) || g.position),
  3121. (g.position = v(S, u, 'endSocket', V, 'socketSE', 1) || g.position),
  3122. [u.startSocketGravity, u.endSocketGravity].forEach(function (e, t) {
  3123. var n,
  3124. a,
  3125. i = !1;
  3126. null != e &&
  3127. (Array.isArray(e)
  3128. ? pe(e[0]) &&
  3129. pe(e[1]) &&
  3130. ((i = [e[0], e[1]]),
  3131. Array.isArray(S.socketGravitySE[t]) &&
  3132. ((n = i),
  3133. (a = S.socketGravitySE[t]),
  3134. n.length === a.length &&
  3135. n.every(function (e, t) {
  3136. return e === a[t];
  3137. })) &&
  3138. (i = !1))
  3139. : ((e + '').toLowerCase() === D
  3140. ? (i = null)
  3141. : pe(e) && 0 <= e && (i = e),
  3142. i === S.socketGravitySE[t] && (i = !1)),
  3143. !1 !== i && ((S.socketGravitySE[t] = i), (g.position = !0)));
  3144. }),
  3145. (g.line =
  3146. E(S, u, 'color', null, 'lineColor', null, ue.lineColor, null, !0) ||
  3147. g.line),
  3148. (g.line =
  3149. E(S, u, 'size', null, 'lineSize', null, ue.lineSize, function (e) {
  3150. return 0 < e;
  3151. }) || g.line),
  3152. ['startPlug', 'endPlug'].forEach(function (e, t) {
  3153. (g.plug = v(S, u, e, F, 'plugSE', t, ue.plugSE[t]) || g.plug),
  3154. (g.plug =
  3155. E(S, u, e + 'Color', 'string', 'plugColorSE', t, null, null, !0) ||
  3156. g.plug),
  3157. (g.plug =
  3158. E(
  3159. S,
  3160. u,
  3161. e + 'Size',
  3162. null,
  3163. 'plugSizeSE',
  3164. t,
  3165. ue.plugSizeSE[t],
  3166. function (e) {
  3167. return 0 < e;
  3168. }
  3169. ) || g.plug);
  3170. }),
  3171. (g.lineOutline =
  3172. E(
  3173. S,
  3174. u,
  3175. 'outline',
  3176. null,
  3177. 'lineOutlineEnabled',
  3178. null,
  3179. ue.lineOutlineEnabled
  3180. ) || g.lineOutline),
  3181. (g.lineOutline =
  3182. E(
  3183. S,
  3184. u,
  3185. 'outlineColor',
  3186. null,
  3187. 'lineOutlineColor',
  3188. null,
  3189. ue.lineOutlineColor,
  3190. null,
  3191. !0
  3192. ) || g.lineOutline),
  3193. (g.lineOutline =
  3194. E(
  3195. S,
  3196. u,
  3197. 'outlineSize',
  3198. null,
  3199. 'lineOutlineSize',
  3200. null,
  3201. ue.lineOutlineSize,
  3202. function (e) {
  3203. return 0 < e && e <= 0.48;
  3204. }
  3205. ) || g.lineOutline),
  3206. ['startPlugOutline', 'endPlugOutline'].forEach(function (e, t) {
  3207. (g.plugOutline =
  3208. E(
  3209. S,
  3210. u,
  3211. e,
  3212. null,
  3213. 'plugOutlineEnabledSE',
  3214. t,
  3215. ue.plugOutlineEnabledSE[t]
  3216. ) || g.plugOutline),
  3217. (g.plugOutline =
  3218. E(
  3219. S,
  3220. u,
  3221. e + 'Color',
  3222. 'string',
  3223. 'plugOutlineColorSE',
  3224. t,
  3225. null,
  3226. null,
  3227. !0
  3228. ) || g.plugOutline),
  3229. (g.plugOutline =
  3230. E(
  3231. S,
  3232. u,
  3233. e + 'Size',
  3234. null,
  3235. 'plugOutlineSizeSE',
  3236. t,
  3237. ue.plugOutlineSizeSE[t],
  3238. function (e) {
  3239. return 1 <= e;
  3240. }
  3241. ) || g.plugOutline);
  3242. }),
  3243. ['startLabel', 'endLabel', 'middleLabel'].forEach(function (e, t) {
  3244. var n,
  3245. a,
  3246. i,
  3247. o = u[e],
  3248. l =
  3249. S.labelSEM[t] && !s.optionIsAttach.labelSEM[t]
  3250. ? _e[S.labelSEM[t]._id].text
  3251. : S.labelSEM[t],
  3252. r = !1;
  3253. if (
  3254. ((n = 'string' == typeof o) && (o = o.trim()),
  3255. (n || (o && (r = I(o, 'label')))) && o !== l)
  3256. ) {
  3257. if (
  3258. (S.labelSEM[t] &&
  3259. (at(s, _e[S.labelSEM[t]._id]), (S.labelSEM[t] = '')),
  3260. o)
  3261. ) {
  3262. if (
  3263. (r
  3264. ? (a = _e[(i = o)._id]).boundTargets
  3265. .slice()
  3266. .forEach(function (e) {
  3267. a.conf.removeOption(a, e);
  3268. })
  3269. : (i = new M(O.captionLabel, [o])),
  3270. !nt(s, _e[i._id], e))
  3271. )
  3272. throw new Error("Can't bind attachment");
  3273. S.labelSEM[t] = i;
  3274. }
  3275. s.optionIsAttach.labelSEM[t] = r;
  3276. }
  3277. }),
  3278. Object.keys(Z).forEach(function (a) {
  3279. var e,
  3280. t,
  3281. o = Z[a],
  3282. n = a + '_enabled',
  3283. i = a + '_options';
  3284. function l(a) {
  3285. var i = {};
  3286. return (
  3287. o.optionsConf.forEach(function (e) {
  3288. var t = e[0],
  3289. n = e[3];
  3290. null == e[4] || i[n] || (i[n] = []),
  3291. ('function' == typeof t ? t : 'id' === t ? v : E).apply(
  3292. null,
  3293. [i, a].concat(e.slice(1))
  3294. );
  3295. }),
  3296. i
  3297. );
  3298. }
  3299. function r(e) {
  3300. var t,
  3301. n = a + '_animOptions';
  3302. return (
  3303. e.hasOwnProperty('animation')
  3304. ? he(e.animation)
  3305. ? (t = s.curStats[n] = et(e.animation, o.defaultAnimOptions))
  3306. : ((t = !!e.animation),
  3307. (s.curStats[n] = t ? et({}, o.defaultAnimOptions) : null))
  3308. : ((t = !!o.defaultEnabled),
  3309. (s.curStats[n] = t ? et({}, o.defaultAnimOptions) : null)),
  3310. t
  3311. );
  3312. }
  3313. u.hasOwnProperty(a) &&
  3314. ((e = u[a]),
  3315. he(e)
  3316. ? ((s.curStats[n] = !0),
  3317. (t = s.curStats[i] = l(e)),
  3318. o.anim && (s.curStats[i].animation = r(e)))
  3319. : (t = s.curStats[n] = !!e) &&
  3320. ((s.curStats[i] = l({})),
  3321. o.anim && (s.curStats[i].animation = r({}))),
  3322. ke(t, S[a]) && ((S[a] = t), (g.effect = !0)));
  3323. }),
  3324. $e(s, g);
  3325. }
  3326. function ot(e, t, n) {
  3327. var a = {
  3328. options: {
  3329. anchorSE: [],
  3330. socketSE: [],
  3331. socketGravitySE: [],
  3332. plugSE: [],
  3333. plugColorSE: [],
  3334. plugSizeSE: [],
  3335. plugOutlineEnabledSE: [],
  3336. plugOutlineColorSE: [],
  3337. plugOutlineSizeSE: [],
  3338. labelSEM: ['', '', ''],
  3339. },
  3340. optionIsAttach: { anchorSE: [!1, !1], labelSEM: [!1, !1, !1] },
  3341. curStats: {},
  3342. aplStats: {},
  3343. attachments: [],
  3344. events: {},
  3345. reflowTargets: [],
  3346. };
  3347. Ye(a.curStats, de),
  3348. Ye(a.aplStats, de),
  3349. Object.keys(Z).forEach(function (e) {
  3350. var t = Z[e].stats;
  3351. Ye(a.curStats, t), Ye(a.aplStats, t), (a.options[e] = !1);
  3352. }),
  3353. Ye(a.curStats, fe),
  3354. Ye(a.aplStats, fe),
  3355. (a.curStats.show_effect = ye),
  3356. (a.curStats.show_animOptions = we(w[ye].defaultAnimOptions)),
  3357. Object.defineProperty(this, '_id', { value: ++ge }),
  3358. (a._id = this._id),
  3359. (Se[this._id] = a),
  3360. 1 === arguments.length && ((n = e), (e = null)),
  3361. (n = n || {}),
  3362. (e || t) && ((n = we(n)), e && (n.start = e), t && (n.end = t)),
  3363. (a.isShown = a.aplStats.show_on = !n.hide),
  3364. this.setOptions(n);
  3365. }
  3366. function lt(n) {
  3367. return function (e) {
  3368. var t = {};
  3369. (t[n] = e), this.setOptions(t);
  3370. };
  3371. }
  3372. function rt(e, t) {
  3373. var n,
  3374. a = { conf: e, curStats: {}, aplStats: {}, boundTargets: [] },
  3375. i = {};
  3376. e.argOptions.every(function (e) {
  3377. return (
  3378. !(
  3379. !t.length ||
  3380. ('string' == typeof e.type
  3381. ? typeof t[0] !== e.type
  3382. : 'function' != typeof e.type || !e.type(t[0]))
  3383. ) && ((i[e.optionName] = t.shift()), !0)
  3384. );
  3385. }),
  3386. (n = t.length && he(t[0]) ? we(t[0]) : {}),
  3387. Object.keys(i).forEach(function (e) {
  3388. n[e] = i[e];
  3389. }),
  3390. e.stats && (Ye(a.curStats, e.stats), Ye(a.aplStats, e.stats)),
  3391. Object.defineProperty(this, '_id', { value: ++ve }),
  3392. Object.defineProperty(this, 'isRemoved', {
  3393. get: function () {
  3394. return !_e[this._id];
  3395. },
  3396. }),
  3397. (a._id = this._id),
  3398. (e.init && !e.init(a, n)) || (_e[this._id] = a);
  3399. }
  3400. return (
  3401. (Z = {
  3402. dash: {
  3403. stats: { dash_len: {}, dash_gap: {}, dash_maxOffset: {} },
  3404. anim: !0,
  3405. defaultAnimOptions: { duration: 1e3, timing: 'linear' },
  3406. optionsConf: [
  3407. [
  3408. 'type',
  3409. 'len',
  3410. 'number',
  3411. null,
  3412. null,
  3413. null,
  3414. function (e) {
  3415. return 0 < e;
  3416. },
  3417. ],
  3418. [
  3419. 'type',
  3420. 'gap',
  3421. 'number',
  3422. null,
  3423. null,
  3424. null,
  3425. function (e) {
  3426. return 0 < e;
  3427. },
  3428. ],
  3429. ],
  3430. init: function (e) {
  3431. Ge(e, 'apl_line_strokeWidth', Z.dash.update),
  3432. (e.lineFace.style.strokeDashoffset = 0),
  3433. Z.dash.update(e);
  3434. },
  3435. remove: function (e) {
  3436. var t = e.curStats;
  3437. De(e, 'apl_line_strokeWidth', Z.dash.update),
  3438. t.dash_animId && (g.remove(t.dash_animId), (t.dash_animId = null)),
  3439. (e.lineFace.style.strokeDasharray = 'none'),
  3440. (e.lineFace.style.strokeDashoffset = 0),
  3441. Ye(e.aplStats, Z.dash.stats);
  3442. },
  3443. update: function (t) {
  3444. var e,
  3445. n = t.curStats,
  3446. a = t.aplStats,
  3447. i = a.dash_options,
  3448. o = !1;
  3449. (n.dash_len = i.len || 2 * a.line_strokeWidth),
  3450. (n.dash_gap = i.gap || a.line_strokeWidth),
  3451. (n.dash_maxOffset = n.dash_len + n.dash_gap),
  3452. (o = Xe(t, a, 'dash_len', n.dash_len) || o),
  3453. (o = Xe(t, a, 'dash_gap', n.dash_gap) || o) &&
  3454. (t.lineFace.style.strokeDasharray =
  3455. a.dash_len + ',' + a.dash_gap),
  3456. n.dash_animOptions
  3457. ? ((o = Xe(t, a, 'dash_maxOffset', n.dash_maxOffset)),
  3458. a.dash_animOptions &&
  3459. (o || ke(n.dash_animOptions, a.dash_animOptions)) &&
  3460. (n.dash_animId &&
  3461. ((e = g.stop(n.dash_animId)), g.remove(n.dash_animId)),
  3462. (a.dash_animOptions = null)),
  3463. a.dash_animOptions ||
  3464. ((n.dash_animId = g.add(
  3465. function (e) {
  3466. return (1 - e) * a.dash_maxOffset + 'px';
  3467. },
  3468. function (e) {
  3469. t.lineFace.style.strokeDashoffset = e;
  3470. },
  3471. n.dash_animOptions.duration,
  3472. 0,
  3473. n.dash_animOptions.timing,
  3474. !1,
  3475. e
  3476. )),
  3477. (a.dash_animOptions = we(n.dash_animOptions))))
  3478. : a.dash_animOptions &&
  3479. (n.dash_animId &&
  3480. (g.remove(n.dash_animId), (n.dash_animId = null)),
  3481. (t.lineFace.style.strokeDashoffset = 0),
  3482. (a.dash_animOptions = null));
  3483. },
  3484. },
  3485. gradient: {
  3486. stats: {
  3487. gradient_colorSE: { hasSE: !0 },
  3488. gradient_pointSE: { hasSE: !0, hasProps: !0 },
  3489. },
  3490. optionsConf: [
  3491. ['type', 'startColor', 'string', 'colorSE', 0, null, null, !0],
  3492. ['type', 'endColor', 'string', 'colorSE', 1, null, null, !0],
  3493. ],
  3494. init: function (e) {
  3495. var a = e.baseWindow.document,
  3496. t = e.defs,
  3497. n = C + '-' + e._id + '-gradient';
  3498. (e.efc_gradient_gradient = t =
  3499. t.appendChild(a.createElementNS(ae, 'linearGradient'))),
  3500. (t.id = n),
  3501. (t.gradientUnits.baseVal =
  3502. SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE),
  3503. [t.x1, t.y1, t.x2, t.y2].forEach(function (e) {
  3504. e.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 0);
  3505. }),
  3506. (e.efc_gradient_stopSE = [0, 1].map(function (t) {
  3507. var n = e.efc_gradient_gradient.appendChild(
  3508. a.createElementNS(ae, 'stop')
  3509. );
  3510. try {
  3511. n.offset.baseVal = t;
  3512. } catch (e) {
  3513. if (e.code !== DOMException.NO_MODIFICATION_ALLOWED_ERR)
  3514. throw e;
  3515. n.setAttribute('offset', t);
  3516. }
  3517. return n;
  3518. })),
  3519. Ge(e, 'cur_plug_colorSE', Z.gradient.update),
  3520. Ge(e, 'apl_path', Z.gradient.update),
  3521. (e.curStats.line_altColor = !0),
  3522. (e.lineFace.style.stroke = 'url(#' + n + ')'),
  3523. Z.gradient.update(e);
  3524. },
  3525. remove: function (e) {
  3526. e.efc_gradient_gradient &&
  3527. (e.defs.removeChild(e.efc_gradient_gradient),
  3528. (e.efc_gradient_gradient = e.efc_gradient_stopSE = null)),
  3529. De(e, 'cur_plug_colorSE', Z.gradient.update),
  3530. De(e, 'apl_path', Z.gradient.update),
  3531. (e.curStats.line_altColor = !1),
  3532. (e.lineFace.style.stroke = e.curStats.line_color),
  3533. Ye(e.aplStats, Z.gradient.stats);
  3534. },
  3535. update: function (a) {
  3536. var e,
  3537. i = a.curStats,
  3538. o = a.aplStats,
  3539. t = o.gradient_options,
  3540. n = a.pathList.animVal || a.pathList.baseVal;
  3541. [0, 1].forEach(function (e) {
  3542. i.gradient_colorSE[e] = t.colorSE[e] || i.plug_colorSE[e];
  3543. }),
  3544. (e = n[0][0]),
  3545. (i.gradient_pointSE[0] = { x: e.x, y: e.y }),
  3546. (e = (n = n[n.length - 1])[n.length - 1]),
  3547. (i.gradient_pointSE[1] = { x: e.x, y: e.y }),
  3548. [0, 1].forEach(function (t) {
  3549. var n;
  3550. Xe(a, o.gradient_colorSE, t, (n = i.gradient_colorSE[t])) &&
  3551. (re
  3552. ? ((n = Oe(n)),
  3553. (a.efc_gradient_stopSE[t].style.stopColor = n[1]),
  3554. (a.efc_gradient_stopSE[t].style.stopOpacity = n[0]))
  3555. : (a.efc_gradient_stopSE[t].style.stopColor = n)),
  3556. ['x', 'y'].forEach(function (e) {
  3557. (n = i.gradient_pointSE[t][e]) !== o.gradient_pointSE[t][e] &&
  3558. (a.efc_gradient_gradient[e + (t + 1)].baseVal.value =
  3559. o.gradient_pointSE[t][e] =
  3560. n);
  3561. });
  3562. });
  3563. },
  3564. },
  3565. dropShadow: {
  3566. stats: {
  3567. dropShadow_dx: {},
  3568. dropShadow_dy: {},
  3569. dropShadow_blur: {},
  3570. dropShadow_color: {},
  3571. dropShadow_opacity: {},
  3572. dropShadow_x: {},
  3573. dropShadow_y: {},
  3574. },
  3575. optionsConf: [
  3576. ['type', 'dx', null, null, null, 2],
  3577. ['type', 'dy', null, null, null, 4],
  3578. [
  3579. 'type',
  3580. 'blur',
  3581. null,
  3582. null,
  3583. null,
  3584. 3,
  3585. function (e) {
  3586. return 0 <= e;
  3587. },
  3588. ],
  3589. ['type', 'color', null, null, null, '#000', null, !0],
  3590. [
  3591. 'type',
  3592. 'opacity',
  3593. null,
  3594. null,
  3595. null,
  3596. 0.8,
  3597. function (e) {
  3598. return 0 <= e && e <= 1;
  3599. },
  3600. ],
  3601. ],
  3602. init: function (t) {
  3603. var e,
  3604. n,
  3605. a,
  3606. i,
  3607. o = t.baseWindow.document,
  3608. l = t.defs,
  3609. r = C + '-' + t._id + '-dropShadow',
  3610. s =
  3611. ((e = o),
  3612. (n = r),
  3613. (i = {}),
  3614. 'boolean' != typeof u &&
  3615. (u = !!window.SVGFEDropShadowElement && !re),
  3616. (i.elmsAppend = [
  3617. (i.elmFilter = o = e.createElementNS(ae, 'filter')),
  3618. ]),
  3619. (o.filterUnits.baseVal =
  3620. SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE),
  3621. o.x.baseVal.newValueSpecifiedUnits(
  3622. SVGLength.SVG_LENGTHTYPE_PX,
  3623. 0
  3624. ),
  3625. o.y.baseVal.newValueSpecifiedUnits(
  3626. SVGLength.SVG_LENGTHTYPE_PX,
  3627. 0
  3628. ),
  3629. o.width.baseVal.newValueSpecifiedUnits(
  3630. SVGLength.SVG_LENGTHTYPE_PERCENTAGE,
  3631. 100
  3632. ),
  3633. o.height.baseVal.newValueSpecifiedUnits(
  3634. SVGLength.SVG_LENGTHTYPE_PERCENTAGE,
  3635. 100
  3636. ),
  3637. (o.id = n),
  3638. u
  3639. ? ((i.elmOffset =
  3640. i.elmBlur =
  3641. a =
  3642. o.appendChild(e.createElementNS(ae, 'feDropShadow'))),
  3643. (i.styleFlood = a.style))
  3644. : ((i.elmBlur = o.appendChild(
  3645. e.createElementNS(ae, 'feGaussianBlur')
  3646. )),
  3647. (i.elmOffset = a =
  3648. o.appendChild(e.createElementNS(ae, 'feOffset'))),
  3649. (a.result.baseVal = 'offsetblur'),
  3650. (a = o.appendChild(e.createElementNS(ae, 'feFlood'))),
  3651. (i.styleFlood = a.style),
  3652. ((a = o.appendChild(
  3653. e.createElementNS(ae, 'feComposite')
  3654. )).in2.baseVal = 'offsetblur'),
  3655. (a.operator.baseVal =
  3656. SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_IN),
  3657. (a = o.appendChild(
  3658. e.createElementNS(ae, 'feMerge')
  3659. )).appendChild(e.createElementNS(ae, 'feMergeNode')),
  3660. (a.appendChild(
  3661. e.createElementNS(ae, 'feMergeNode')
  3662. ).in1.baseVal = 'SourceGraphic')),
  3663. i);
  3664. [
  3665. 'elmFilter',
  3666. 'elmOffset',
  3667. 'elmBlur',
  3668. 'styleFlood',
  3669. 'elmsAppend',
  3670. ].forEach(function (e) {
  3671. t['efc_dropShadow_' + e] = s[e];
  3672. }),
  3673. s.elmsAppend.forEach(function (e) {
  3674. l.appendChild(e);
  3675. }),
  3676. t.face.setAttribute('filter', 'url(#' + r + ')'),
  3677. Ge(t, 'new_edge4viewBox', Z.dropShadow.adjustEdge),
  3678. Z.dropShadow.update(t);
  3679. },
  3680. remove: function (e) {
  3681. var t = e.defs;
  3682. e.efc_dropShadow_elmsAppend &&
  3683. (e.efc_dropShadow_elmsAppend.forEach(function (e) {
  3684. t.removeChild(e);
  3685. }),
  3686. (e.efc_dropShadow_elmFilter =
  3687. e.efc_dropShadow_elmOffset =
  3688. e.efc_dropShadow_elmBlur =
  3689. e.efc_dropShadow_styleFlood =
  3690. e.efc_dropShadow_elmsAppend =
  3691. null)),
  3692. De(e, 'new_edge4viewBox', Z.dropShadow.adjustEdge),
  3693. $e(e, {}),
  3694. e.face.removeAttribute('filter'),
  3695. Ye(e.aplStats, Z.dropShadow.stats);
  3696. },
  3697. update: function (e) {
  3698. var t,
  3699. n,
  3700. a = e.curStats,
  3701. i = e.aplStats,
  3702. o = i.dropShadow_options;
  3703. (a.dropShadow_dx = t = o.dx),
  3704. Xe(e, i, 'dropShadow_dx', t) &&
  3705. ((e.efc_dropShadow_elmOffset.dx.baseVal = t), (n = !0)),
  3706. (a.dropShadow_dy = t = o.dy),
  3707. Xe(e, i, 'dropShadow_dy', t) &&
  3708. ((e.efc_dropShadow_elmOffset.dy.baseVal = t), (n = !0)),
  3709. (a.dropShadow_blur = t = o.blur),
  3710. Xe(e, i, 'dropShadow_blur', t) &&
  3711. (e.efc_dropShadow_elmBlur.setStdDeviation(t, t), (n = !0)),
  3712. n && $e(e, {}),
  3713. (a.dropShadow_color = t = o.color),
  3714. Xe(e, i, 'dropShadow_color', t) &&
  3715. (e.efc_dropShadow_styleFlood.floodColor = t),
  3716. (a.dropShadow_opacity = t = o.opacity),
  3717. Xe(e, i, 'dropShadow_opacity', t) &&
  3718. (e.efc_dropShadow_styleFlood.floodOpacity = t);
  3719. },
  3720. adjustEdge: function (a, i) {
  3721. var e,
  3722. o = a.curStats,
  3723. l = a.aplStats;
  3724. null != o.dropShadow_dx &&
  3725. ((e = 3 * o.dropShadow_blur),
  3726. (e = {
  3727. x1: i.x1 - e + o.dropShadow_dx,
  3728. y1: i.y1 - e + o.dropShadow_dy,
  3729. x2: i.x2 + e + o.dropShadow_dx,
  3730. y2: i.y2 + e + o.dropShadow_dy,
  3731. }).x1 < i.x1 && (i.x1 = e.x1),
  3732. e.y1 < i.y1 && (i.y1 = e.y1),
  3733. e.x2 > i.x2 && (i.x2 = e.x2),
  3734. e.y2 > i.y2 && (i.y2 = e.y2),
  3735. ['x', 'y'].forEach(function (e) {
  3736. var t,
  3737. n = 'dropShadow_' + e;
  3738. (o[n] = t = i[e + '1']),
  3739. Xe(a, l, n, t) &&
  3740. (a.efc_dropShadow_elmFilter[e].baseVal.value = t);
  3741. }));
  3742. },
  3743. },
  3744. }),
  3745. Object.keys(Z).forEach(function (e) {
  3746. var t = Z[e],
  3747. n = t.stats;
  3748. (n[e + '_enabled'] = { iniValue: !1 }),
  3749. (n[e + '_options'] = { hasProps: !0 }),
  3750. t.anim && ((n[e + '_animOptions'] = {}), (n[e + '_animId'] = {}));
  3751. }),
  3752. (w = {
  3753. none: {
  3754. defaultAnimOptions: {},
  3755. init: function (e, t) {
  3756. var n = e.curStats;
  3757. n.show_animId && (g.remove(n.show_animId), (n.show_animId = null)),
  3758. w.none.start(e, t);
  3759. },
  3760. start: function (e, t) {
  3761. w.none.stop(e, !0);
  3762. },
  3763. stop: function (e, t, n) {
  3764. var a = e.curStats;
  3765. return (
  3766. (n = null != n ? n : e.aplStats.show_on),
  3767. (a.show_inAnim = !1),
  3768. t && Je(e, n),
  3769. n ? 1 : 0
  3770. );
  3771. },
  3772. },
  3773. fade: {
  3774. defaultAnimOptions: { duration: 300, timing: 'linear' },
  3775. init: function (n, e) {
  3776. var t = n.curStats,
  3777. a = n.aplStats;
  3778. t.show_animId && g.remove(t.show_animId),
  3779. (t.show_animId = g.add(
  3780. function (e) {
  3781. return e;
  3782. },
  3783. function (e, t) {
  3784. t
  3785. ? w.fade.stop(n, !0)
  3786. : ((n.svg.style.opacity = e + ''),
  3787. ie && (je(n, n.svg), He(n)));
  3788. },
  3789. a.show_animOptions.duration,
  3790. 1,
  3791. a.show_animOptions.timing,
  3792. null,
  3793. !1
  3794. )),
  3795. w.fade.start(n, e);
  3796. },
  3797. start: function (e, t) {
  3798. var n,
  3799. a = e.curStats;
  3800. a.show_inAnim && (n = g.stop(a.show_animId)),
  3801. Je(e, 1),
  3802. (a.show_inAnim = !0),
  3803. g.start(a.show_animId, !e.aplStats.show_on, null != t ? t : n);
  3804. },
  3805. stop: function (e, t, n) {
  3806. var a,
  3807. i = e.curStats;
  3808. return (
  3809. (n = null != n ? n : e.aplStats.show_on),
  3810. (a = i.show_inAnim ? g.stop(i.show_animId) : n ? 1 : 0),
  3811. (i.show_inAnim = !1),
  3812. t && ((e.svg.style.opacity = n ? '' : '0'), Je(e, n)),
  3813. a
  3814. );
  3815. },
  3816. },
  3817. draw: {
  3818. defaultAnimOptions: { duration: 500, timing: [0.58, 0, 0.42, 1] },
  3819. init: function (n, e) {
  3820. var t = n.curStats,
  3821. a = n.aplStats,
  3822. o = n.pathList.baseVal,
  3823. i = Re(o),
  3824. l = i.segsLen,
  3825. r = i.lenAll;
  3826. t.show_animId && g.remove(t.show_animId),
  3827. (t.show_animId = g.add(
  3828. function (e) {
  3829. var t,
  3830. n,
  3831. a,
  3832. i = -1;
  3833. if (0 === e) n = [[o[0][0], o[0][0]]];
  3834. else if (1 === e) n = o;
  3835. else {
  3836. for (t = r * e, n = []; t >= l[++i]; )
  3837. n.push(o[i]), (t -= l[i]);
  3838. t &&
  3839. (2 === (a = o[i]).length
  3840. ? n.push([a[0], Ve(a[0], a[1], t / l[i])])
  3841. : ((e = Ne(
  3842. a[0],
  3843. a[1],
  3844. a[2],
  3845. a[3],
  3846. We(a[0], a[1], a[2], a[3], t)
  3847. )),
  3848. n.push([a[0], e.fromP1, e.fromP2, e])));
  3849. }
  3850. return n;
  3851. },
  3852. function (e, t) {
  3853. t
  3854. ? w.draw.stop(n, !0)
  3855. : ((n.pathList.animVal = e), $e(n, { path: !0 }));
  3856. },
  3857. a.show_animOptions.duration,
  3858. 1,
  3859. a.show_animOptions.timing,
  3860. null,
  3861. !1
  3862. )),
  3863. w.draw.start(n, e);
  3864. },
  3865. start: function (e, t) {
  3866. var n,
  3867. a = e.curStats;
  3868. a.show_inAnim && (n = g.stop(a.show_animId)),
  3869. Je(e, 1),
  3870. (a.show_inAnim = !0),
  3871. Ge(e, 'apl_position', w.draw.update),
  3872. g.start(a.show_animId, !e.aplStats.show_on, null != t ? t : n);
  3873. },
  3874. stop: function (e, t, n) {
  3875. var a,
  3876. i = e.curStats;
  3877. return (
  3878. (n = null != n ? n : e.aplStats.show_on),
  3879. (a = i.show_inAnim ? g.stop(i.show_animId) : n ? 1 : 0),
  3880. (i.show_inAnim = !1),
  3881. t &&
  3882. ((e.pathList.animVal = n
  3883. ? null
  3884. : [[e.pathList.baseVal[0][0], e.pathList.baseVal[0][0]]]),
  3885. $e(e, { path: !0 }),
  3886. Je(e, n)),
  3887. a
  3888. );
  3889. },
  3890. update: function (e) {
  3891. De(e, 'apl_position', w.draw.update),
  3892. e.curStats.show_inAnim
  3893. ? w.draw.init(e, w.draw.stop(e))
  3894. : (e.aplStats.show_animOptions = {});
  3895. },
  3896. },
  3897. }),
  3898. [
  3899. ['start', 'anchorSE', 0],
  3900. ['end', 'anchorSE', 1],
  3901. ['color', 'lineColor'],
  3902. ['size', 'lineSize'],
  3903. ['startSocketGravity', 'socketGravitySE', 0],
  3904. ['endSocketGravity', 'socketGravitySE', 1],
  3905. ['startPlugColor', 'plugColorSE', 0],
  3906. ['endPlugColor', 'plugColorSE', 1],
  3907. ['startPlugSize', 'plugSizeSE', 0],
  3908. ['endPlugSize', 'plugSizeSE', 1],
  3909. ['outline', 'lineOutlineEnabled'],
  3910. ['outlineColor', 'lineOutlineColor'],
  3911. ['outlineSize', 'lineOutlineSize'],
  3912. ['startPlugOutline', 'plugOutlineEnabledSE', 0],
  3913. ['endPlugOutline', 'plugOutlineEnabledSE', 1],
  3914. ['startPlugOutlineColor', 'plugOutlineColorSE', 0],
  3915. ['endPlugOutlineColor', 'plugOutlineColorSE', 1],
  3916. ['startPlugOutlineSize', 'plugOutlineSizeSE', 0],
  3917. ['endPlugOutlineSize', 'plugOutlineSizeSE', 1],
  3918. ].forEach(function (e) {
  3919. var t = e[0],
  3920. n = e[1],
  3921. a = e[2];
  3922. Object.defineProperty(ot.prototype, t, {
  3923. get: function () {
  3924. var e =
  3925. null != a
  3926. ? Se[this._id].options[n][a]
  3927. : n
  3928. ? Se[this._id].options[n]
  3929. : Se[this._id].options[t];
  3930. return null == e ? D : we(e);
  3931. },
  3932. set: lt(t),
  3933. enumerable: !0,
  3934. });
  3935. }),
  3936. [
  3937. ['path', R],
  3938. ['startSocket', V, 'socketSE', 0],
  3939. ['endSocket', V, 'socketSE', 1],
  3940. ['startPlug', F, 'plugSE', 0],
  3941. ['endPlug', F, 'plugSE', 1],
  3942. ].forEach(function (e) {
  3943. var a = e[0],
  3944. i = e[1],
  3945. o = e[2],
  3946. l = e[3];
  3947. Object.defineProperty(ot.prototype, a, {
  3948. get: function () {
  3949. var t,
  3950. n =
  3951. null != l
  3952. ? Se[this._id].options[o][l]
  3953. : o
  3954. ? Se[this._id].options[o]
  3955. : Se[this._id].options[a];
  3956. return n
  3957. ? Object.keys(i).some(function (e) {
  3958. return i[e] === n && ((t = e), !0);
  3959. })
  3960. ? t
  3961. : new Error("It's broken")
  3962. : D;
  3963. },
  3964. set: lt(a),
  3965. enumerable: !0,
  3966. });
  3967. }),
  3968. Object.keys(Z).forEach(function (n) {
  3969. var a = Z[n];
  3970. Object.defineProperty(ot.prototype, n, {
  3971. get: function () {
  3972. var s,
  3973. e,
  3974. t = Se[this._id].options[n];
  3975. return he(t)
  3976. ? ((s = t),
  3977. (e = a.optionsConf.reduce(function (e, t) {
  3978. var n,
  3979. a = t[0],
  3980. i = t[1],
  3981. o = t[2],
  3982. l = t[3],
  3983. t = t[4],
  3984. r = null != t ? s[l][t] : l ? s[l] : s[i];
  3985. return (
  3986. (e[i] =
  3987. 'id' === a
  3988. ? r
  3989. ? Object.keys(o).some(function (e) {
  3990. return o[e] === r && ((n = e), !0);
  3991. })
  3992. ? n
  3993. : new Error("It's broken")
  3994. : D
  3995. : null == r
  3996. ? D
  3997. : we(r)),
  3998. e
  3999. );
  4000. }, {})),
  4001. a.anim && (e.animation = we(s.animation)),
  4002. e)
  4003. : t;
  4004. },
  4005. set: lt(n),
  4006. enumerable: !0,
  4007. });
  4008. }),
  4009. ['startLabel', 'endLabel', 'middleLabel'].forEach(function (e, n) {
  4010. Object.defineProperty(ot.prototype, e, {
  4011. get: function () {
  4012. var e = Se[this._id],
  4013. t = e.options;
  4014. return t.labelSEM[n] && !e.optionIsAttach.labelSEM[n]
  4015. ? _e[t.labelSEM[n]._id].text
  4016. : t.labelSEM[n] || '';
  4017. },
  4018. set: lt(e),
  4019. enumerable: !0,
  4020. });
  4021. }),
  4022. (ot.prototype.setOptions = function (e) {
  4023. return it(Se[this._id], e), this;
  4024. }),
  4025. (ot.prototype.position = function () {
  4026. return $e(Se[this._id], { position: !0 }), this;
  4027. }),
  4028. (ot.prototype.remove = function () {
  4029. var t = Se[this._id],
  4030. n = t.curStats;
  4031. Object.keys(Z).forEach(function (e) {
  4032. e += '_animId';
  4033. n[e] && g.remove(n[e]);
  4034. }),
  4035. n.show_animId && g.remove(n.show_animId),
  4036. t.attachments.slice().forEach(function (e) {
  4037. at(t, e);
  4038. }),
  4039. t.baseWindow && t.svg && t.baseWindow.document.body.removeChild(t.svg),
  4040. delete Se[this._id];
  4041. }),
  4042. (ot.prototype.show = function (e, t) {
  4043. return tt(Se[this._id], !0, e, t), this;
  4044. }),
  4045. (ot.prototype.hide = function (e, t) {
  4046. return tt(Se[this._id], !1, e, t), this;
  4047. }),
  4048. (o = function (t) {
  4049. t &&
  4050. _e[t._id] &&
  4051. (t.boundTargets.slice().forEach(function (e) {
  4052. at(e.props, t, !0);
  4053. }),
  4054. t.conf.remove && t.conf.remove(t),
  4055. delete _e[t._id]);
  4056. }),
  4057. (rt.prototype.remove = function () {
  4058. var t = this,
  4059. n = _e[t._id];
  4060. n &&
  4061. (n.boundTargets.slice().forEach(function (e) {
  4062. n.conf.removeOption(n, e);
  4063. }),
  4064. ze(function () {
  4065. var e = _e[t._id];
  4066. e &&
  4067. (console.error(
  4068. 'LeaderLineAttachment was not removed by removeOption'
  4069. ),
  4070. o(e));
  4071. }));
  4072. }),
  4073. (M = rt),
  4074. (window.LeaderLineAttachment = M),
  4075. (I = function (e, t) {
  4076. return (
  4077. e instanceof M &&
  4078. (!(e.isRemoved || (t && _e[e._id].conf.type !== t)) || null)
  4079. );
  4080. }),
  4081. (O = {
  4082. pointAnchor: {
  4083. type: 'anchor',
  4084. argOptions: [{ optionName: 'element', type: Me }],
  4085. init: function (e, t) {
  4086. return (
  4087. (e.element = O.pointAnchor.checkElement(t.element)),
  4088. (e.x = O.pointAnchor.parsePercent(t.x, !0) || [0.5, !0]),
  4089. (e.y = O.pointAnchor.parsePercent(t.y, !0) || [0.5, !0]),
  4090. !0
  4091. );
  4092. },
  4093. removeOption: function (e, t) {
  4094. var n = t.props,
  4095. a = {},
  4096. i = e.element,
  4097. e = n.options.anchorSE['start' === t.optionName ? 1 : 0];
  4098. i === e &&
  4099. (i =
  4100. e === document.body ? new M(O.pointAnchor, [i]) : document.body),
  4101. (a[t.optionName] = i),
  4102. it(n, a);
  4103. },
  4104. getBBoxNest: function (e, t) {
  4105. var n = Le(e.element, t.baseWindow),
  4106. a = n.width,
  4107. t = n.height;
  4108. return (
  4109. (n.width = n.height = 0),
  4110. (n.left = n.right = n.left + e.x[0] * (e.x[1] ? a : 1)),
  4111. (n.top = n.bottom = n.top + e.y[0] * (e.y[1] ? t : 1)),
  4112. n
  4113. );
  4114. },
  4115. parsePercent: function (e, t) {
  4116. var n,
  4117. a,
  4118. i = !1;
  4119. return (
  4120. pe(e)
  4121. ? (a = e)
  4122. : 'string' == typeof e &&
  4123. (n = m.exec(e)) &&
  4124. n[2] &&
  4125. (i = 0 !== (a = parseFloat(n[1]) / 100)),
  4126. null != a && (t || 0 <= a) ? [a, i] : null
  4127. );
  4128. },
  4129. checkElement: function (e) {
  4130. if (null == e) e = document.body;
  4131. else if (!Me(e)) throw new Error('`element` must be Element');
  4132. return e;
  4133. },
  4134. },
  4135. areaAnchor: {
  4136. type: 'anchor',
  4137. argOptions: [
  4138. { optionName: 'element', type: Me },
  4139. { optionName: 'shape', type: 'string' },
  4140. ],
  4141. stats: {
  4142. color: {},
  4143. strokeWidth: {},
  4144. elementWidth: {},
  4145. elementHeight: {},
  4146. elementLeft: {},
  4147. elementTop: {},
  4148. pathListRel: {},
  4149. bBoxRel: {},
  4150. pathData: {},
  4151. viewBoxBBox: { hasProps: !0 },
  4152. dashLen: {},
  4153. dashGap: {},
  4154. },
  4155. init: function (a, e) {
  4156. var t,
  4157. n = [];
  4158. return (
  4159. (a.element = O.pointAnchor.checkElement(e.element)),
  4160. 'string' == typeof e.color && (a.color = e.color.trim()),
  4161. 'string' == typeof e.fillColor && (a.fill = e.fillColor.trim()),
  4162. pe(e.size) && 0 <= e.size && (a.size = e.size),
  4163. e.dash &&
  4164. ((a.dash = !0),
  4165. pe(e.dash.len) && 0 < e.dash.len && (a.dashLen = e.dash.len),
  4166. pe(e.dash.gap) && 0 < e.dash.gap && (a.dashGap = e.dash.gap)),
  4167. 'circle' === e.shape
  4168. ? (a.shape = e.shape)
  4169. : 'polygon' === e.shape &&
  4170. Array.isArray(e.points) &&
  4171. 3 <= e.points.length &&
  4172. e.points.every(function (e) {
  4173. var t = {};
  4174. return (
  4175. !(
  4176. !(t.x = O.pointAnchor.parsePercent(e[0], !0)) ||
  4177. !(t.y = O.pointAnchor.parsePercent(e[1], !0))
  4178. ) &&
  4179. (n.push(t), (t.x[1] || t.y[1]) && (a.hasRatio = !0), !0)
  4180. );
  4181. })
  4182. ? ((a.shape = e.shape), (a.points = n))
  4183. : ((a.shape = 'rect'),
  4184. (a.radius = pe(e.radius) && 0 <= e.radius ? e.radius : 0)),
  4185. ('rect' !== a.shape && 'circle' !== a.shape) ||
  4186. ((a.x = O.pointAnchor.parsePercent(e.x, !0) || [-0.05, !0]),
  4187. (a.y = O.pointAnchor.parsePercent(e.y, !0) || [-0.05, !0]),
  4188. (a.width = O.pointAnchor.parsePercent(e.width) || [1.1, !0]),
  4189. (a.height = O.pointAnchor.parsePercent(e.height) || [1.1, !0]),
  4190. (a.x[1] || a.y[1] || a.width[1] || a.height[1]) &&
  4191. (a.hasRatio = !0)),
  4192. (t = a.element.ownerDocument),
  4193. (a.svg = e = t.createElementNS(ae, 'svg')),
  4194. (e.className.baseVal = C + '-areaAnchor'),
  4195. e.viewBox.baseVal || e.setAttribute('viewBox', '0 0 0 0'),
  4196. (a.path = e.appendChild(t.createElementNS(ae, 'path'))),
  4197. (a.path.style.fill = a.fill || 'none'),
  4198. (a.isShown = !1),
  4199. (e.style.visibility = 'hidden'),
  4200. t.body.appendChild(e),
  4201. Qe((t = t.defaultView)),
  4202. (a.bodyOffset = qe(t)),
  4203. (a.updateColor = function () {
  4204. var e = a.curStats,
  4205. t = a.aplStats,
  4206. n = a.boundTargets.length
  4207. ? a.boundTargets[0].props.curStats
  4208. : null;
  4209. (e.color = n = a.color || (n ? n.line_color : ue.lineColor)),
  4210. Xe(a, t, 'color', n) && (a.path.style.stroke = n);
  4211. }),
  4212. (a.updateShow = function () {
  4213. Je(
  4214. a,
  4215. a.boundTargets.some(function (e) {
  4216. return !0 === e.props.isShown;
  4217. })
  4218. );
  4219. }),
  4220. !0
  4221. );
  4222. },
  4223. bind: function (e, t) {
  4224. t = t.props;
  4225. return (
  4226. e.color || Ge(t, 'cur_line_color', e.updateColor),
  4227. Ge(t, 'svgShow', e.updateShow),
  4228. ze(function () {
  4229. e.updateColor(), e.updateShow();
  4230. }),
  4231. !0
  4232. );
  4233. },
  4234. unbind: function (e, t) {
  4235. t = t.props;
  4236. e.color || De(t, 'cur_line_color', e.updateColor),
  4237. De(t, 'svgShow', e.updateShow),
  4238. 1 < e.boundTargets.length &&
  4239. ze(function () {
  4240. e.updateColor(),
  4241. e.updateShow(),
  4242. O.areaAnchor.update(e) &&
  4243. e.boundTargets.forEach(function (e) {
  4244. $e(e.props, { position: !0 });
  4245. });
  4246. });
  4247. },
  4248. removeOption: function (e, t) {
  4249. O.pointAnchor.removeOption(e, t);
  4250. },
  4251. remove: function (t) {
  4252. t.boundTargets.length &&
  4253. (console.error('LeaderLineAttachment was not unbound by remove'),
  4254. t.boundTargets.forEach(function (e) {
  4255. O.areaAnchor.unbind(t, e);
  4256. })),
  4257. t.svg.parentNode.removeChild(t.svg);
  4258. },
  4259. getStrokeWidth: function (e, t) {
  4260. return (
  4261. O.areaAnchor.update(e) &&
  4262. 1 < e.boundTargets.length &&
  4263. ze(function () {
  4264. e.boundTargets.forEach(function (e) {
  4265. e.props !== t && $e(e.props, { position: !0 });
  4266. });
  4267. }),
  4268. e.curStats.strokeWidth
  4269. );
  4270. },
  4271. getPathData: function (e, t) {
  4272. var n = Le(e.element, t.baseWindow);
  4273. return Be(e.curStats.pathListRel, function (e) {
  4274. (e.x += n.left), (e.y += n.top);
  4275. });
  4276. },
  4277. getBBoxNest: function (e, t) {
  4278. (t = Le(e.element, t.baseWindow)), (e = e.curStats.bBoxRel);
  4279. return {
  4280. left: e.left + t.left,
  4281. top: e.top + t.top,
  4282. right: e.right + t.left,
  4283. bottom: e.bottom + t.top,
  4284. width: e.width,
  4285. height: e.height,
  4286. };
  4287. },
  4288. update: function (t) {
  4289. var n,
  4290. a,
  4291. i,
  4292. o,
  4293. e,
  4294. l,
  4295. r,
  4296. s,
  4297. u,
  4298. h,
  4299. p,
  4300. c,
  4301. d,
  4302. f,
  4303. y,
  4304. m,
  4305. S = t.curStats,
  4306. g = t.aplStats,
  4307. _ = t.boundTargets.length ? t.boundTargets[0].props.curStats : null,
  4308. v = {};
  4309. if (
  4310. ((v.strokeWidth = Xe(
  4311. t,
  4312. S,
  4313. 'strokeWidth',
  4314. null != t.size ? t.size : _ ? _.line_strokeWidth : ue.lineSize
  4315. )),
  4316. (n = Ie(t.element)),
  4317. (v.elementWidth = Xe(t, S, 'elementWidth', n.width)),
  4318. (v.elementHeight = Xe(t, S, 'elementHeight', n.height)),
  4319. (v.elementLeft = Xe(t, S, 'elementLeft', n.left)),
  4320. (v.elementTop = Xe(t, S, 'elementTop', n.top)),
  4321. v.strokeWidth ||
  4322. (t.hasRatio && (v.elementWidth || v.elementHeight)))
  4323. ) {
  4324. switch (t.shape) {
  4325. case 'rect':
  4326. ((c = {
  4327. left: t.x[0] * (t.x[1] ? n.width : 1),
  4328. top: t.y[0] * (t.y[1] ? n.height : 1),
  4329. width: t.width[0] * (t.width[1] ? n.width : 1),
  4330. height: t.height[0] * (t.height[1] ? n.height : 1),
  4331. }).right = c.left + c.width),
  4332. (c.bottom = c.top + c.height),
  4333. (p = S.strokeWidth / 2),
  4334. (s = (r = Math.min(c.width, c.height))
  4335. ? (r / 2) * Math.SQRT2 + p
  4336. : 0),
  4337. (h = (r = t.radius ? (t.radius <= s ? t.radius : s) : 0)
  4338. ? ((s = (r - p) / Math.SQRT2),
  4339. (h = [
  4340. { x: c.left - (u = r - s), y: c.top + s },
  4341. { x: c.left + s, y: c.top - u },
  4342. { x: c.right - s, y: c.top - u },
  4343. { x: c.right + u, y: c.top + s },
  4344. { x: c.right + u, y: c.bottom - s },
  4345. { x: c.right - s, y: c.bottom + u },
  4346. { x: c.left + s, y: c.bottom + u },
  4347. { x: c.left - u, y: c.bottom - s },
  4348. ]),
  4349. (S.pathListRel = [
  4350. [
  4351. h[0],
  4352. { x: h[0].x, y: h[0].y - (p = r * te) },
  4353. { x: h[1].x - p, y: h[1].y },
  4354. h[1],
  4355. ],
  4356. ]),
  4357. h[1].x !== h[2].x && S.pathListRel.push([h[1], h[2]]),
  4358. S.pathListRel.push([
  4359. h[2],
  4360. { x: h[2].x + p, y: h[2].y },
  4361. { x: h[3].x, y: h[3].y - p },
  4362. h[3],
  4363. ]),
  4364. h[3].y !== h[4].y && S.pathListRel.push([h[3], h[4]]),
  4365. S.pathListRel.push([
  4366. h[4],
  4367. { x: h[4].x, y: h[4].y + p },
  4368. { x: h[5].x + p, y: h[5].y },
  4369. h[5],
  4370. ]),
  4371. h[5].x !== h[6].x && S.pathListRel.push([h[5], h[6]]),
  4372. S.pathListRel.push([
  4373. h[6],
  4374. { x: h[6].x - p, y: h[6].y },
  4375. { x: h[7].x, y: h[7].y + p },
  4376. h[7],
  4377. ]),
  4378. h[7].y !== h[0].y && S.pathListRel.push([h[7], h[0]]),
  4379. S.pathListRel.push([]),
  4380. (u = r - s + S.strokeWidth / 2),
  4381. [
  4382. { x: c.left - u, y: c.top - u },
  4383. { x: c.right + u, y: c.bottom + u },
  4384. ])
  4385. : ((u = S.strokeWidth / 2),
  4386. (h = [
  4387. { x: c.left - u, y: c.top - u },
  4388. { x: c.right + u, y: c.bottom + u },
  4389. ]),
  4390. (S.pathListRel = [
  4391. [h[0], { x: h[1].x, y: h[0].y }],
  4392. [{ x: h[1].x, y: h[0].y }, h[1]],
  4393. [h[1], { x: h[0].x, y: h[1].y }],
  4394. [],
  4395. ]),
  4396. [
  4397. { x: c.left - S.strokeWidth, y: c.top - S.strokeWidth },
  4398. {
  4399. x: c.right + S.strokeWidth,
  4400. y: c.bottom + S.strokeWidth,
  4401. },
  4402. ])),
  4403. (S.bBoxRel = {
  4404. left: h[0].x,
  4405. top: h[0].y,
  4406. right: h[1].x,
  4407. bottom: h[1].y,
  4408. width: h[1].x - h[0].x,
  4409. height: h[1].y - h[0].y,
  4410. });
  4411. break;
  4412. case 'circle':
  4413. (l = {
  4414. left: t.x[0] * (t.x[1] ? n.width : 1),
  4415. top: t.y[0] * (t.y[1] ? n.height : 1),
  4416. width: t.width[0] * (t.width[1] ? n.width : 1),
  4417. height: t.height[0] * (t.height[1] ? n.height : 1),
  4418. }).width ||
  4419. l.height ||
  4420. (l.width = l.height = 10),
  4421. l.width || (l.width = l.height),
  4422. l.height || (l.height = l.width),
  4423. (l.right = l.left + l.width),
  4424. (l.bottom = l.top + l.height),
  4425. (p = l.left + l.width / 2),
  4426. (r = l.top + l.height / 2),
  4427. (e = S.strokeWidth / 2),
  4428. (s = l.width / 2),
  4429. (u = l.height / 2),
  4430. (c = s * Math.SQRT2 + e),
  4431. (h = u * Math.SQRT2 + e),
  4432. (S.pathListRel = [
  4433. [
  4434. (e = [
  4435. { x: p - c, y: r },
  4436. { x: p, y: r - h },
  4437. { x: p + c, y: r },
  4438. { x: p, y: r + h },
  4439. ])[0],
  4440. { x: e[0].x, y: e[0].y - (p = h * te) },
  4441. { x: e[1].x - (r = c * te), y: e[1].y },
  4442. e[1],
  4443. ],
  4444. [
  4445. e[1],
  4446. { x: e[1].x + r, y: e[1].y },
  4447. { x: e[2].x, y: e[2].y - p },
  4448. e[2],
  4449. ],
  4450. [
  4451. e[2],
  4452. { x: e[2].x, y: e[2].y + p },
  4453. { x: e[3].x + r, y: e[3].y },
  4454. e[3],
  4455. ],
  4456. [
  4457. e[3],
  4458. { x: e[3].x - r, y: e[3].y },
  4459. { x: e[0].x, y: e[0].y + p },
  4460. e[0],
  4461. ],
  4462. [],
  4463. ]),
  4464. (s = c - s + S.strokeWidth / 2),
  4465. (u = h - u + S.strokeWidth / 2),
  4466. (e = [
  4467. { x: l.left - s, y: l.top - u },
  4468. { x: l.right + s, y: l.bottom + u },
  4469. ]),
  4470. (S.bBoxRel = {
  4471. left: e[0].x,
  4472. top: e[0].y,
  4473. right: e[1].x,
  4474. bottom: e[1].y,
  4475. width: e[1].x - e[0].x,
  4476. height: e[1].y - e[0].y,
  4477. });
  4478. break;
  4479. case 'polygon':
  4480. t.points.forEach(function (e) {
  4481. var t = e.x[0] * (e.x[1] ? n.width : 1),
  4482. e = e.y[0] * (e.y[1] ? n.height : 1);
  4483. i
  4484. ? (t < i.left && (i.left = t),
  4485. t > i.right && (i.right = t),
  4486. e < i.top && (i.top = e),
  4487. e > i.bottom && (i.bottom = e))
  4488. : (i = { left: t, right: t, top: e, bottom: e }),
  4489. o
  4490. ? S.pathListRel.push([o, { x: t, y: e }])
  4491. : (S.pathListRel = []),
  4492. (o = { x: t, y: e });
  4493. }),
  4494. S.pathListRel.push([]),
  4495. (e = S.strokeWidth / 2),
  4496. (e = [
  4497. { x: i.left - e, y: i.top - e },
  4498. { x: i.right + e, y: i.bottom + e },
  4499. ]),
  4500. (S.bBoxRel = {
  4501. left: e[0].x,
  4502. top: e[0].y,
  4503. right: e[1].x,
  4504. bottom: e[1].y,
  4505. width: e[1].x - e[0].x,
  4506. height: e[1].y - e[0].y,
  4507. });
  4508. }
  4509. v.pathListRel = v.bBoxRel = !0;
  4510. }
  4511. return (
  4512. (v.pathListRel || v.elementLeft || v.elementTop) &&
  4513. (S.pathData = Be(S.pathListRel, function (e) {
  4514. (e.x += n.left), (e.y += n.top);
  4515. })),
  4516. Xe(t, g, 'strokeWidth', (a = S.strokeWidth)) &&
  4517. (t.path.style.strokeWidth = a + 'px'),
  4518. Fe((a = S.pathData), g.pathData) &&
  4519. (t.path.setPathData(a), (g.pathData = a), (v.pathData = !0)),
  4520. t.dash &&
  4521. ((!v.pathData && (!v.strokeWidth || (t.dashLen && t.dashGap))) ||
  4522. ((S.dashLen = t.dashLen || 2 * S.strokeWidth),
  4523. (S.dashGap = t.dashGap || S.strokeWidth)),
  4524. (v.dash = Xe(t, g, 'dashLen', S.dashLen) || v.dash),
  4525. (v.dash = Xe(t, g, 'dashGap', S.dashGap) || v.dash),
  4526. v.dash &&
  4527. (t.path.style.strokeDasharray = g.dashLen + ',' + g.dashGap)),
  4528. (d = S.viewBoxBBox),
  4529. (f = g.viewBoxBBox),
  4530. (y = t.svg.viewBox.baseVal),
  4531. (m = t.svg.style),
  4532. (d.x = S.bBoxRel.left + n.left),
  4533. (d.y = S.bBoxRel.top + n.top),
  4534. (d.width = S.bBoxRel.width),
  4535. (d.height = S.bBoxRel.height),
  4536. ['x', 'y', 'width', 'height'].forEach(function (e) {
  4537. (a = d[e]) !== f[e] &&
  4538. ((y[e] = f[e] = a),
  4539. (m[Q[e]] =
  4540. a + ('x' === e || 'y' === e ? t.bodyOffset[e] : 0) + 'px'));
  4541. }),
  4542. v.strokeWidth || v.pathListRel || v.bBoxRel
  4543. );
  4544. },
  4545. },
  4546. mouseHoverAnchor: {
  4547. type: 'anchor',
  4548. argOptions: [
  4549. { optionName: 'element', type: Me },
  4550. { optionName: 'showEffectName', type: 'string' },
  4551. ],
  4552. style: {
  4553. backgroundImage:
  4554. "url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cG9seWdvbiBwb2ludHM9IjI0LDAgMCw4IDgsMTEgMCwxOSA1LDI0IDEzLDE2IDE2LDI0IiBmaWxsPSJjb3JhbCIvPjwvc3ZnPg==')",
  4555. backgroundSize: '',
  4556. backgroundRepeat: 'no-repeat',
  4557. backgroundColor: '#f8f881',
  4558. cursor: 'default',
  4559. },
  4560. hoverStyle: { backgroundImage: 'none', backgroundColor: '#fadf8f' },
  4561. padding: { top: 1, right: 15, bottom: 1, left: 2 },
  4562. minHeight: 15,
  4563. backgroundPosition: { right: 2, top: 2 },
  4564. backgroundSize: { width: 12, height: 12 },
  4565. dirKeys: [
  4566. ['top', 'Top'],
  4567. ['right', 'Right'],
  4568. ['bottom', 'Bottom'],
  4569. ['left', 'Left'],
  4570. ],
  4571. init: function (a, i) {
  4572. var n,
  4573. t,
  4574. e,
  4575. o,
  4576. l,
  4577. r,
  4578. s,
  4579. u,
  4580. h,
  4581. p = O.mouseHoverAnchor,
  4582. c = {};
  4583. if (
  4584. ((a.element = O.pointAnchor.checkElement(i.element)),
  4585. (s = a.element),
  4586. !(
  4587. (u = s.ownerDocument) &&
  4588. (h = u.defaultView) &&
  4589. h.HTMLElement &&
  4590. s instanceof h.HTMLElement
  4591. ))
  4592. )
  4593. throw new Error('`element` must be HTML element');
  4594. return (
  4595. (p.style.backgroundSize =
  4596. p.backgroundSize.width + 'px ' + p.backgroundSize.height + 'px'),
  4597. ['style', 'hoverStyle'].forEach(function (e) {
  4598. var n = p[e];
  4599. a[e] = Object.keys(n).reduce(function (e, t) {
  4600. return (e[t] = n[t]), e;
  4601. }, {});
  4602. }),
  4603. 'inline' ===
  4604. (n = a.element.ownerDocument.defaultView.getComputedStyle(
  4605. a.element,
  4606. ''
  4607. )).display
  4608. ? (a.style.display = 'inline-block')
  4609. : 'none' === n.display && (a.style.display = 'block'),
  4610. O.mouseHoverAnchor.dirKeys.forEach(function (e) {
  4611. var t = e[0],
  4612. e = 'padding' + e[1];
  4613. parseFloat(n[e]) < p.padding[t] &&
  4614. (a.style[e] = p.padding[t] + 'px');
  4615. }),
  4616. a.style.display &&
  4617. ((e = a.element.style.display),
  4618. (a.element.style.display = a.style.display)),
  4619. O.mouseHoverAnchor.dirKeys.forEach(function (e) {
  4620. e = 'padding' + e[1];
  4621. a.style[e] &&
  4622. ((c[e] = a.element.style[e]),
  4623. (a.element.style[e] = a.style[e]));
  4624. }),
  4625. (s = a.element.getBoundingClientRect()).height < p.minHeight &&
  4626. (ie
  4627. ? ((h = p.minHeight),
  4628. 'content-box' === n.boxSizing
  4629. ? (h -=
  4630. parseFloat(n.borderTopWidth) +
  4631. parseFloat(n.borderBottomWidth) +
  4632. parseFloat(n.paddingTop) +
  4633. parseFloat(n.paddingBottom))
  4634. : 'padding-box' === n.boxSizing &&
  4635. (h -=
  4636. parseFloat(n.borderTopWidth) +
  4637. parseFloat(n.borderBottomWidth)),
  4638. (a.style.height = h + 'px'))
  4639. : (a.style.height =
  4640. parseFloat(n.height) + (p.minHeight - s.height) + 'px')),
  4641. (a.style.backgroundPosition = re
  4642. ? s.width -
  4643. p.backgroundSize.width -
  4644. p.backgroundPosition.right +
  4645. 'px ' +
  4646. p.backgroundPosition.top +
  4647. 'px'
  4648. : 'right ' +
  4649. p.backgroundPosition.right +
  4650. 'px top ' +
  4651. p.backgroundPosition.top +
  4652. 'px'),
  4653. a.style.display && (a.element.style.display = e),
  4654. O.mouseHoverAnchor.dirKeys.forEach(function (e) {
  4655. e = 'padding' + e[1];
  4656. a.style[e] && (a.element.style[e] = c[e]);
  4657. }),
  4658. ['style', 'hoverStyle'].forEach(function (e) {
  4659. var t = a[e],
  4660. n = i[e];
  4661. he(n) &&
  4662. Object.keys(n).forEach(function (e) {
  4663. 'string' == typeof n[e] || pe(n[e])
  4664. ? (t[e] = n[e])
  4665. : null == n[e] && delete t[e];
  4666. });
  4667. }),
  4668. 'function' == typeof i.onSwitch && (r = i.onSwitch),
  4669. i.showEffectName &&
  4670. w[i.showEffectName] &&
  4671. (a.showEffectName = o = i.showEffectName),
  4672. (l = i.animOptions),
  4673. (a.elmStyle = t = a.element.style),
  4674. (a.mouseenter = function (e) {
  4675. (a.hoverStyleSave = p.getStyles(t, Object.keys(a.hoverStyle))),
  4676. p.setStyles(t, a.hoverStyle),
  4677. a.boundTargets.forEach(function (e) {
  4678. tt(e.props, !0, o, l);
  4679. }),
  4680. r && r(e);
  4681. }),
  4682. (a.mouseleave = function (e) {
  4683. p.setStyles(t, a.hoverStyleSave),
  4684. a.boundTargets.forEach(function (e) {
  4685. tt(e.props, !1, o, l);
  4686. }),
  4687. r && r(e);
  4688. }),
  4689. !0
  4690. );
  4691. },
  4692. bind: function (e, t) {
  4693. var n, a, i, o, l;
  4694. return (
  4695. t.props.svg
  4696. ? O.mouseHoverAnchor.llShow(t.props, !1, e.showEffectName)
  4697. : ze(function () {
  4698. O.mouseHoverAnchor.llShow(t.props, !1, e.showEffectName);
  4699. }),
  4700. e.enabled ||
  4701. ((e.styleSave = O.mouseHoverAnchor.getStyles(
  4702. e.elmStyle,
  4703. Object.keys(e.style)
  4704. )),
  4705. O.mouseHoverAnchor.setStyles(e.elmStyle, e.style),
  4706. (e.removeEventListener =
  4707. ((n = e.element),
  4708. (a = e.mouseenter),
  4709. (i = e.mouseleave),
  4710. 'onmouseenter' in n && 'onmouseleave' in n
  4711. ? (n.addEventListener('mouseenter', a, !1),
  4712. n.addEventListener('mouseleave', i, !1),
  4713. function () {
  4714. n.removeEventListener('mouseenter', a, !1),
  4715. n.removeEventListener('mouseleave', i, !1);
  4716. })
  4717. : (console.warn(
  4718. 'mouseenter and mouseleave events polyfill is enabled.'
  4719. ),
  4720. n.addEventListener(
  4721. 'mouseover',
  4722. (o = function (e) {
  4723. (e.relatedTarget &&
  4724. (e.relatedTarget === this ||
  4725. this.compareDocumentPosition(e.relatedTarget) &
  4726. Node.DOCUMENT_POSITION_CONTAINED_BY)) ||
  4727. a.apply(this, arguments);
  4728. })
  4729. ),
  4730. n.addEventListener(
  4731. 'mouseout',
  4732. (l = function (e) {
  4733. (e.relatedTarget &&
  4734. (e.relatedTarget === this ||
  4735. this.compareDocumentPosition(e.relatedTarget) &
  4736. Node.DOCUMENT_POSITION_CONTAINED_BY)) ||
  4737. i.apply(this, arguments);
  4738. })
  4739. ),
  4740. function () {
  4741. n.removeEventListener('mouseover', o, !1),
  4742. n.removeEventListener('mouseout', l, !1);
  4743. }))),
  4744. (e.enabled = !0)),
  4745. !0
  4746. );
  4747. },
  4748. unbind: function (e, t) {
  4749. e.enabled &&
  4750. e.boundTargets.length <= 1 &&
  4751. (e.removeEventListener(),
  4752. O.mouseHoverAnchor.setStyles(e.elmStyle, e.styleSave),
  4753. (e.enabled = !1)),
  4754. O.mouseHoverAnchor.llShow(t.props, !0, e.showEffectName);
  4755. },
  4756. removeOption: function (e, t) {
  4757. O.pointAnchor.removeOption(e, t);
  4758. },
  4759. remove: function (t) {
  4760. t.boundTargets.length &&
  4761. (console.error('LeaderLineAttachment was not unbound by remove'),
  4762. t.boundTargets.forEach(function (e) {
  4763. O.mouseHoverAnchor.unbind(t, e);
  4764. }));
  4765. },
  4766. getBBoxNest: function (e, t) {
  4767. return Le(e.element, t.baseWindow);
  4768. },
  4769. llShow: function (e, t, n) {
  4770. w[n || e.curStats.show_effect].stop(e, !0, t),
  4771. (e.aplStats.show_on = t);
  4772. },
  4773. getStyles: function (n, e) {
  4774. return e.reduce(function (e, t) {
  4775. return (e[t] = n[t]), e;
  4776. }, {});
  4777. },
  4778. setStyles: function (t, n) {
  4779. Object.keys(n).forEach(function (e) {
  4780. t[e] = n[e];
  4781. });
  4782. },
  4783. },
  4784. captionLabel: {
  4785. type: 'label',
  4786. argOptions: [{ optionName: 'text', type: 'string' }],
  4787. stats: { color: {}, x: {}, y: {} },
  4788. textStyleProps: [
  4789. 'fontFamily',
  4790. 'fontStyle',
  4791. 'fontVariant',
  4792. 'fontWeight',
  4793. 'fontStretch',
  4794. 'fontSize',
  4795. 'fontSizeAdjust',
  4796. 'kerning',
  4797. 'letterSpacing',
  4798. 'wordSpacing',
  4799. 'textDecoration',
  4800. ],
  4801. init: function (l, t) {
  4802. return (
  4803. 'string' == typeof t.text && (l.text = t.text.trim()),
  4804. !!l.text &&
  4805. ('string' == typeof t.color && (l.color = t.color.trim()),
  4806. (l.outlineColor =
  4807. 'string' == typeof t.outlineColor
  4808. ? t.outlineColor.trim()
  4809. : '#fff'),
  4810. Array.isArray(t.offset) &&
  4811. pe(t.offset[0]) &&
  4812. pe(t.offset[1]) &&
  4813. (l.offset = { x: t.offset[0], y: t.offset[1] }),
  4814. pe(t.lineOffset) && (l.lineOffset = t.lineOffset),
  4815. O.captionLabel.textStyleProps.forEach(function (e) {
  4816. null != t[e] && (l[e] = t[e]);
  4817. }),
  4818. (l.updateColor = function (e) {
  4819. O.captionLabel.updateColor(l, e);
  4820. }),
  4821. (l.updateSocketXY = function (e) {
  4822. var t,
  4823. n = l.curStats,
  4824. a = l.aplStats,
  4825. i = e.curStats,
  4826. o = i.position_socketXYSE[l.socketIndex];
  4827. null != o.x &&
  4828. (l.offset
  4829. ? ((n.x = o.x + l.offset.x), (n.y = o.y + l.offset.y))
  4830. : ((t = l.height / 2),
  4831. (e = Math.max(
  4832. i.attach_plugSideLenSE[l.socketIndex] || 0,
  4833. i.line_strokeWidth / 2
  4834. )),
  4835. (i = i.position_socketXYSE[l.socketIndex ? 0 : 1]),
  4836. o.socketId === A || o.socketId === k
  4837. ? ((n.x =
  4838. o.socketId === A ? o.x - t - l.width : o.x + t),
  4839. (n.y =
  4840. i.y < o.y ? o.y + e + t : o.y - e - t - l.height))
  4841. : ((n.x =
  4842. i.x < o.x ? o.x + e + t : o.x - e - t - l.width),
  4843. (n.y =
  4844. o.socketId === b ? o.y - t - l.height : o.y + t))),
  4845. Xe(l, a, 'x', (t = n.x)) &&
  4846. (l.elmPosition.x.baseVal.getItem(0).value = t),
  4847. Xe(l, a, 'y', (t = n.y)) &&
  4848. (l.elmPosition.y.baseVal.getItem(0).value = t + l.height));
  4849. }),
  4850. (l.updatePath = function (e) {
  4851. var t = l.curStats,
  4852. n = l.aplStats,
  4853. e = e.pathList.animVal || e.pathList.baseVal;
  4854. e &&
  4855. ((e = O.captionLabel.getMidPoint(e, l.lineOffset)),
  4856. (t.x = e.x - l.width / 2),
  4857. (t.y = e.y - l.height / 2),
  4858. Xe(l, n, 'x', (e = t.x)) &&
  4859. (l.elmPosition.x.baseVal.getItem(0).value = e),
  4860. Xe(l, n, 'y', (e = t.y)) &&
  4861. (l.elmPosition.y.baseVal.getItem(0).value = e + l.height));
  4862. }),
  4863. (l.updateShow = function (e) {
  4864. O.captionLabel.updateShow(l, e);
  4865. }),
  4866. re &&
  4867. (l.adjustEdge = function (e, t) {
  4868. var n = l.curStats;
  4869. null != n.x &&
  4870. O.captionLabel.adjustEdge(
  4871. t,
  4872. { x: n.x, y: n.y, width: l.width, height: l.height },
  4873. l.strokeWidth / 2
  4874. );
  4875. }),
  4876. !0)
  4877. );
  4878. },
  4879. updateColor: function (e, t) {
  4880. var n = e.curStats,
  4881. a = e.aplStats,
  4882. t = t.curStats;
  4883. (n.color = t = e.color || t.line_color),
  4884. Xe(e, a, 'color', t) && (e.styleFill.fill = t);
  4885. },
  4886. updateShow: function (e, t) {
  4887. t = !0 === t.isShown;
  4888. t !== e.isShown &&
  4889. ((e.styleShow.visibility = t ? '' : 'hidden'), (e.isShown = t));
  4890. },
  4891. adjustEdge: function (e, t, n) {
  4892. n = {
  4893. x1: t.x - n,
  4894. y1: t.y - n,
  4895. x2: t.x + t.width + n,
  4896. y2: t.y + t.height + n,
  4897. };
  4898. n.x1 < e.x1 && (e.x1 = n.x1),
  4899. n.y1 < e.y1 && (e.y1 = n.y1),
  4900. n.x2 > e.x2 && (e.x2 = n.x2),
  4901. n.y2 > e.y2 && (e.y2 = n.y2);
  4902. },
  4903. newText: function (e, t, n, a, i) {
  4904. var o,
  4905. l,
  4906. r = t.createElementNS(ae, 'text');
  4907. return (
  4908. (r.textContent = e),
  4909. [r.x, r.y].forEach(function (e) {
  4910. var t = n.createSVGLength();
  4911. t.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 0),
  4912. e.baseVal.initialize(t);
  4913. }),
  4914. 'boolean' != typeof h && (h = 'paintOrder' in r.style),
  4915. i && !h
  4916. ? ((o = t.createElementNS(ae, 'defs')),
  4917. (r.id = a),
  4918. o.appendChild(r),
  4919. ((l = (e = t.createElementNS(ae, 'g')).appendChild(
  4920. t.createElementNS(ae, 'use')
  4921. )).href.baseVal = '#' + a),
  4922. ((t = e.appendChild(
  4923. t.createElementNS(ae, 'use')
  4924. )).href.baseVal = '#' + a),
  4925. ((l = l.style).strokeLinejoin = 'round'),
  4926. {
  4927. elmPosition: r,
  4928. styleText: r.style,
  4929. styleFill: t.style,
  4930. styleStroke: l,
  4931. styleShow: e.style,
  4932. elmsAppend: [o, e],
  4933. })
  4934. : ((l = r.style),
  4935. i && ((l.strokeLinejoin = 'round'), (l.paintOrder = 'stroke')),
  4936. {
  4937. elmPosition: r,
  4938. styleText: l,
  4939. styleFill: l,
  4940. styleStroke: i ? l : null,
  4941. styleShow: l,
  4942. elmsAppend: [r],
  4943. })
  4944. );
  4945. },
  4946. getMidPoint: function (e, t) {
  4947. var n,
  4948. a,
  4949. i = Re(e),
  4950. o = i.segsLen,
  4951. i = i.lenAll,
  4952. l = -1,
  4953. r = i / 2 + (t || 0);
  4954. if (r <= 0)
  4955. return 2 === (n = e[0]).length
  4956. ? Ve(n[0], n[1], 0)
  4957. : Ne(n[0], n[1], n[2], n[3], 0);
  4958. if (i <= r)
  4959. return 2 === (n = e[e.length - 1]).length
  4960. ? Ve(n[0], n[1], 1)
  4961. : Ne(n[0], n[1], n[2], n[3], 1);
  4962. for (a = []; r > o[++l]; ) a.push(e[l]), (r -= o[l]);
  4963. return 2 === (n = e[l]).length
  4964. ? Ve(n[0], n[1], r / o[l])
  4965. : Ne(n[0], n[1], n[2], n[3], We(n[0], n[1], n[2], n[3], r));
  4966. },
  4967. initSvg: function (t, n) {
  4968. var e,
  4969. a,
  4970. i = O.captionLabel.newText(
  4971. t.text,
  4972. n.baseWindow.document,
  4973. n.svg,
  4974. C + '-captionLabel-' + t._id,
  4975. t.outlineColor
  4976. );
  4977. ['elmPosition', 'styleFill', 'styleShow', 'elmsAppend'].forEach(
  4978. function (e) {
  4979. t[e] = i[e];
  4980. }
  4981. ),
  4982. (t.isShown = !1),
  4983. (t.styleShow.visibility = 'hidden'),
  4984. O.captionLabel.textStyleProps.forEach(function (e) {
  4985. null != t[e] && (i.styleText[e] = t[e]);
  4986. }),
  4987. i.elmsAppend.forEach(function (e) {
  4988. n.svg.appendChild(e);
  4989. }),
  4990. (e = i.elmPosition.getBBox()),
  4991. (t.width = e.width),
  4992. (t.height = e.height),
  4993. t.outlineColor &&
  4994. ((a = e.height / 9),
  4995. (i.styleStroke.strokeWidth =
  4996. (a = 10 < a ? 10 : a < 2 ? 2 : a) + 'px'),
  4997. (i.styleStroke.stroke = t.outlineColor)),
  4998. (t.strokeWidth = a || 0),
  4999. Ye(t.aplStats, O.captionLabel.stats),
  5000. t.updateColor(n),
  5001. t.refSocketXY ? t.updateSocketXY(n) : t.updatePath(n),
  5002. re && $e(n, {}),
  5003. t.updateShow(n);
  5004. },
  5005. bind: function (e, t) {
  5006. var n = t.props;
  5007. return (
  5008. e.color || Ge(n, 'cur_line_color', e.updateColor),
  5009. (e.refSocketXY =
  5010. 'startLabel' === t.optionName || 'endLabel' === t.optionName)
  5011. ? ((e.socketIndex = 'startLabel' === t.optionName ? 0 : 1),
  5012. Ge(n, 'apl_position', e.updateSocketXY),
  5013. e.offset ||
  5014. (Ge(n, 'cur_attach_plugSideLenSE', e.updateSocketXY),
  5015. Ge(n, 'cur_line_strokeWidth', e.updateSocketXY)))
  5016. : Ge(n, 'apl_path', e.updatePath),
  5017. Ge(n, 'svgShow', e.updateShow),
  5018. re && Ge(n, 'new_edge4viewBox', e.adjustEdge),
  5019. O.captionLabel.initSvg(e, n),
  5020. !0
  5021. );
  5022. },
  5023. unbind: function (e, t) {
  5024. var n = t.props;
  5025. e.elmsAppend &&
  5026. (e.elmsAppend.forEach(function (e) {
  5027. n.svg.removeChild(e);
  5028. }),
  5029. (e.elmPosition = e.styleFill = e.styleShow = e.elmsAppend = null)),
  5030. Ye(e.curStats, O.captionLabel.stats),
  5031. Ye(e.aplStats, O.captionLabel.stats),
  5032. e.color || De(n, 'cur_line_color', e.updateColor),
  5033. e.refSocketXY
  5034. ? (De(n, 'apl_position', e.updateSocketXY),
  5035. e.offset ||
  5036. (De(n, 'cur_attach_plugSideLenSE', e.updateSocketXY),
  5037. De(n, 'cur_line_strokeWidth', e.updateSocketXY)))
  5038. : De(n, 'apl_path', e.updatePath),
  5039. De(n, 'svgShow', e.updateShow),
  5040. re && (De(n, 'new_edge4viewBox', e.adjustEdge), $e(n, {}));
  5041. },
  5042. removeOption: function (e, t) {
  5043. var n = t.props,
  5044. a = {};
  5045. (a[t.optionName] = ''), it(n, a);
  5046. },
  5047. remove: function (t) {
  5048. t.boundTargets.length &&
  5049. (console.error('LeaderLineAttachment was not unbound by remove'),
  5050. t.boundTargets.forEach(function (e) {
  5051. O.captionLabel.unbind(t, e);
  5052. }));
  5053. },
  5054. },
  5055. pathLabel: {
  5056. type: 'label',
  5057. argOptions: [{ optionName: 'text', type: 'string' }],
  5058. stats: { color: {}, startOffset: {}, pathData: {} },
  5059. init: function (l, t) {
  5060. return (
  5061. 'string' == typeof t.text && (l.text = t.text.trim()),
  5062. !!l.text &&
  5063. ('string' == typeof t.color && (l.color = t.color.trim()),
  5064. (l.outlineColor =
  5065. 'string' == typeof t.outlineColor
  5066. ? t.outlineColor.trim()
  5067. : '#fff'),
  5068. pe(t.lineOffset) && (l.lineOffset = t.lineOffset),
  5069. O.captionLabel.textStyleProps.forEach(function (e) {
  5070. null != t[e] && (l[e] = t[e]);
  5071. }),
  5072. (l.updateColor = function (e) {
  5073. O.captionLabel.updateColor(l, e);
  5074. }),
  5075. (l.updatePath = function (e) {
  5076. var t = l.curStats,
  5077. n = l.aplStats,
  5078. a = e.curStats,
  5079. i = e.pathList.animVal || e.pathList.baseVal;
  5080. i &&
  5081. ((t.pathData = a =
  5082. O.pathLabel.getOffsetPathData(
  5083. i,
  5084. a.line_strokeWidth / 2 + l.strokeWidth / 2 + l.height / 4,
  5085. 1.25 * l.height
  5086. )),
  5087. Fe(a, n.pathData) &&
  5088. (l.elmPath.setPathData(a),
  5089. (n.pathData = a),
  5090. (l.bBox = l.elmPosition.getBBox()),
  5091. l.updateStartOffset(e)));
  5092. }),
  5093. (l.updateStartOffset = function (e) {
  5094. var i,
  5095. t,
  5096. n = l.curStats,
  5097. a = l.aplStats,
  5098. o = e.curStats;
  5099. n.pathData &&
  5100. ((2 === l.semIndex && !l.lineOffset) ||
  5101. ((t = n.pathData.reduce(function (e, t) {
  5102. var n,
  5103. a = t.values;
  5104. switch (t.type) {
  5105. case 'M':
  5106. i = { x: a[0], y: a[1] };
  5107. break;
  5108. case 'L':
  5109. (n = { x: a[0], y: a[1] }),
  5110. i && (e += Ae(i, n)),
  5111. (i = n);
  5112. break;
  5113. case 'C':
  5114. (n = { x: a[4], y: a[5] }),
  5115. i &&
  5116. (e += Te(
  5117. i,
  5118. { x: a[0], y: a[1] },
  5119. { x: a[2], y: a[3] },
  5120. n
  5121. )),
  5122. (i = n);
  5123. }
  5124. return e;
  5125. }, 0)),
  5126. (e = 0 === l.semIndex ? 0 : 1 === l.semIndex ? t : t / 2),
  5127. 2 !== l.semIndex &&
  5128. ((o =
  5129. Math.max(
  5130. o.attach_plugBackLenSE[l.semIndex] || 0,
  5131. o.line_strokeWidth / 2
  5132. ) +
  5133. l.strokeWidth / 2 +
  5134. l.height / 4),
  5135. (e =
  5136. (e += 0 === l.semIndex ? o : -o) < 0
  5137. ? 0
  5138. : t < e
  5139. ? t
  5140. : e)),
  5141. l.lineOffset &&
  5142. (e = (e += l.lineOffset) < 0 ? 0 : t < e ? t : e),
  5143. (n.startOffset = e),
  5144. Xe(l, a, 'startOffset', e) &&
  5145. (l.elmOffset.startOffset.baseVal.value = e)));
  5146. }),
  5147. (l.updateShow = function (e) {
  5148. O.captionLabel.updateShow(l, e);
  5149. }),
  5150. re &&
  5151. (l.adjustEdge = function (e, t) {
  5152. l.bBox &&
  5153. O.captionLabel.adjustEdge(t, l.bBox, l.strokeWidth / 2);
  5154. }),
  5155. !0)
  5156. );
  5157. },
  5158. getOffsetPathData: function (e, c, n) {
  5159. var d,
  5160. a,
  5161. f = [];
  5162. function y(e, t) {
  5163. return Math.abs(e.x - t.x) < 3 && Math.abs(e.y - t.y) < 3;
  5164. }
  5165. return (
  5166. e.forEach(function (e) {
  5167. var t, n, a, i, o, l, r, s, u, h, p;
  5168. 2 === e.length
  5169. ? ((s = e[0]),
  5170. (u = e[1]),
  5171. (h = c),
  5172. (p = Math.atan2(s.y - u.y, u.x - s.x) + 0.5 * Math.PI),
  5173. (t = [
  5174. { x: s.x + Math.cos(p) * h, y: s.y + Math.sin(p) * h * -1 },
  5175. { x: u.x + Math.cos(p) * h, y: u.y + Math.sin(p) * h * -1 },
  5176. ]),
  5177. d
  5178. ? ((a = d.points),
  5179. 0 <=
  5180. (r =
  5181. Math.atan2(a[1].y - a[0].y, a[0].x - a[1].x) -
  5182. Math.atan2(e[0].y - e[1].y, e[1].x - e[0].x)) &&
  5183. r <= Math.PI
  5184. ? (n = { type: 'line', points: t, inside: !0 })
  5185. : ((o = Pe(a[0], a[1], c)),
  5186. (i = Pe(t[1], t[0], c)),
  5187. (l = a[0]),
  5188. (s = t[1]),
  5189. (p = (u = o).x - l.x),
  5190. (h = u.y - l.y),
  5191. (r = s.x - i.x),
  5192. (u = s.y - i.y),
  5193. (s =
  5194. (-h * (l.x - i.x) + p * (l.y - i.y)) /
  5195. (-r * h + p * u)),
  5196. (u =
  5197. (r * (l.y - i.y) - u * (l.x - i.x)) /
  5198. (-r * h + p * u)),
  5199. (n = (h =
  5200. 0 <= s && s <= 1 && 0 <= u && u <= 1
  5201. ? { x: l.x + u * p, y: l.y + u * h }
  5202. : null)
  5203. ? { type: 'line', points: [(a[1] = h), t[1]] }
  5204. : ((a[1] = y(i, o) ? i : o),
  5205. { type: 'line', points: [i, t[1]] })),
  5206. (d.len = Ae(a[0], a[1]))))
  5207. : (n = { type: 'line', points: t }),
  5208. (n.len = Ae(n.points[0], n.points[1])),
  5209. f.push((d = n)))
  5210. : (f.push({
  5211. type: 'cubic',
  5212. points: (function (e, t, n, a, i, o) {
  5213. for (
  5214. var l,
  5215. r,
  5216. s = Te(e, t, n, a) / o,
  5217. u = 1 / (o < i ? (i / o) * s : s),
  5218. h = [],
  5219. p = 0;
  5220. (r =
  5221. (90 - (l = Ne(e, t, n, a, p)).angle) *
  5222. (Math.PI / 180)),
  5223. h.push({
  5224. x: l.x + Math.cos(r) * i,
  5225. y: l.y + Math.sin(r) * i * -1,
  5226. }),
  5227. !(1 <= p);
  5228. )
  5229. 1 < (p += u) && (p = 1);
  5230. return h;
  5231. })(e[0], e[1], e[2], e[3], c, 16),
  5232. }),
  5233. (d = null));
  5234. }),
  5235. (d = null),
  5236. f.forEach(function (e) {
  5237. var t;
  5238. d =
  5239. 'line' === e.type
  5240. ? (e.inside &&
  5241. (d.len > c
  5242. ? (((t = d.points)[1] = Pe(t[0], t[1], -c)),
  5243. (d.len = Ae(t[0], t[1])))
  5244. : ((d.points = null), (d.len = 0)),
  5245. e.len > c + n
  5246. ? (((t = e.points)[0] = Pe(t[1], t[0], -(c + n))),
  5247. (e.len = Ae(t[0], t[1])))
  5248. : ((e.points = null), (e.len = 0))),
  5249. e)
  5250. : null;
  5251. }),
  5252. f.reduce(function (t, e) {
  5253. var n = e.points;
  5254. return (
  5255. n &&
  5256. ((a && y(n[0], a)) ||
  5257. t.push({ type: 'M', values: [n[0].x, n[0].y] }),
  5258. 'line' === e.type
  5259. ? t.push({ type: 'L', values: [n[1].x, n[1].y] })
  5260. : (n.shift(),
  5261. n.forEach(function (e) {
  5262. t.push({ type: 'L', values: [e.x, e.y] });
  5263. })),
  5264. (a = n[n.length - 1])),
  5265. t
  5266. );
  5267. }, [])
  5268. );
  5269. },
  5270. newText: function (e, t, n, a) {
  5271. var i,
  5272. o,
  5273. l,
  5274. r,
  5275. s = t.createElementNS(ae, 'defs'),
  5276. u = s.appendChild(t.createElementNS(ae, 'path'));
  5277. return (
  5278. (u.id = i = n + '-path'),
  5279. ((l = (o = t.createElementNS(ae, 'text')).appendChild(
  5280. t.createElementNS(ae, 'textPath')
  5281. )).href.baseVal = '#' + i),
  5282. l.startOffset.baseVal.newValueSpecifiedUnits(
  5283. SVGLength.SVG_LENGTHTYPE_PX,
  5284. 0
  5285. ),
  5286. (l.textContent = e),
  5287. 'boolean' != typeof h && (h = 'paintOrder' in o.style),
  5288. a && !h
  5289. ? ((o.id = e = n + '-text'),
  5290. s.appendChild(o),
  5291. ((r = (n = t.createElementNS(ae, 'g')).appendChild(
  5292. t.createElementNS(ae, 'use')
  5293. )).href.baseVal = '#' + e),
  5294. ((t = n.appendChild(
  5295. t.createElementNS(ae, 'use')
  5296. )).href.baseVal = '#' + e),
  5297. ((r = r.style).strokeLinejoin = 'round'),
  5298. {
  5299. elmPosition: o,
  5300. elmPath: u,
  5301. elmOffset: l,
  5302. styleText: o.style,
  5303. styleFill: t.style,
  5304. styleStroke: r,
  5305. styleShow: n.style,
  5306. elmsAppend: [s, n],
  5307. })
  5308. : ((r = o.style),
  5309. a && ((r.strokeLinejoin = 'round'), (r.paintOrder = 'stroke')),
  5310. {
  5311. elmPosition: o,
  5312. elmPath: u,
  5313. elmOffset: l,
  5314. styleText: r,
  5315. styleFill: r,
  5316. styleStroke: a ? r : null,
  5317. styleShow: r,
  5318. elmsAppend: [s, o],
  5319. })
  5320. );
  5321. },
  5322. initSvg: function (t, n) {
  5323. var e,
  5324. a,
  5325. i,
  5326. o = O.pathLabel.newText(
  5327. t.text,
  5328. n.baseWindow.document,
  5329. C + '-pathLabel-' + t._id,
  5330. t.outlineColor
  5331. );
  5332. [
  5333. 'elmPosition',
  5334. 'elmPath',
  5335. 'elmOffset',
  5336. 'styleFill',
  5337. 'styleShow',
  5338. 'elmsAppend',
  5339. ].forEach(function (e) {
  5340. t[e] = o[e];
  5341. }),
  5342. (t.isShown = !1),
  5343. (t.styleShow.visibility = 'hidden'),
  5344. O.captionLabel.textStyleProps.forEach(function (e) {
  5345. null != t[e] && (o.styleText[e] = t[e]);
  5346. }),
  5347. o.elmsAppend.forEach(function (e) {
  5348. n.svg.appendChild(e);
  5349. }),
  5350. o.elmPath.setPathData([
  5351. { type: 'M', values: [0, 100] },
  5352. { type: 'h', values: [100] },
  5353. ]),
  5354. le &&
  5355. ((i = o.elmOffset.href.baseVal), (o.elmOffset.href.baseVal = '')),
  5356. (e = o.elmPosition.getBBox()),
  5357. le && (o.elmOffset.href.baseVal = i),
  5358. (o.styleText.textAnchor = ['start', 'end', 'middle'][t.semIndex]),
  5359. 2 !== t.semIndex ||
  5360. t.lineOffset ||
  5361. o.elmOffset.startOffset.baseVal.newValueSpecifiedUnits(
  5362. SVGLength.SVG_LENGTHTYPE_PERCENTAGE,
  5363. 50
  5364. ),
  5365. (t.height = e.height),
  5366. t.outlineColor &&
  5367. ((a = e.height / 9),
  5368. (o.styleStroke.strokeWidth =
  5369. (a = 10 < a ? 10 : a < 2 ? 2 : a) + 'px'),
  5370. (o.styleStroke.stroke = t.outlineColor)),
  5371. (t.strokeWidth = a || 0),
  5372. Ye(t.aplStats, O.pathLabel.stats),
  5373. t.updateColor(n),
  5374. t.updatePath(n),
  5375. t.updateStartOffset(n),
  5376. re && $e(n, {}),
  5377. t.updateShow(n);
  5378. },
  5379. bind: function (e, t) {
  5380. var n = t.props;
  5381. return (
  5382. e.color || Ge(n, 'cur_line_color', e.updateColor),
  5383. Ge(n, 'cur_line_strokeWidth', e.updatePath),
  5384. Ge(n, 'apl_path', e.updatePath),
  5385. (e.semIndex =
  5386. 'startLabel' === t.optionName
  5387. ? 0
  5388. : 'endLabel' === t.optionName
  5389. ? 1
  5390. : 2),
  5391. (2 === e.semIndex && !e.lineOffset) ||
  5392. Ge(n, 'cur_attach_plugBackLenSE', e.updateStartOffset),
  5393. Ge(n, 'svgShow', e.updateShow),
  5394. re && Ge(n, 'new_edge4viewBox', e.adjustEdge),
  5395. O.pathLabel.initSvg(e, n),
  5396. !0
  5397. );
  5398. },
  5399. unbind: function (e, t) {
  5400. var n = t.props;
  5401. e.elmsAppend &&
  5402. (e.elmsAppend.forEach(function (e) {
  5403. n.svg.removeChild(e);
  5404. }),
  5405. (e.elmPosition =
  5406. e.elmPath =
  5407. e.elmOffset =
  5408. e.styleFill =
  5409. e.styleShow =
  5410. e.elmsAppend =
  5411. null)),
  5412. Ye(e.curStats, O.pathLabel.stats),
  5413. Ye(e.aplStats, O.pathLabel.stats),
  5414. e.color || De(n, 'cur_line_color', e.updateColor),
  5415. De(n, 'cur_line_strokeWidth', e.updatePath),
  5416. De(n, 'apl_path', e.updatePath),
  5417. (2 === e.semIndex && !e.lineOffset) ||
  5418. De(n, 'cur_attach_plugBackLenSE', e.updateStartOffset),
  5419. De(n, 'svgShow', e.updateShow),
  5420. re && (De(n, 'new_edge4viewBox', e.adjustEdge), $e(n, {}));
  5421. },
  5422. removeOption: function (e, t) {
  5423. var n = t.props,
  5424. a = {};
  5425. (a[t.optionName] = ''), it(n, a);
  5426. },
  5427. remove: function (t) {
  5428. t.boundTargets.length &&
  5429. (console.error('LeaderLineAttachment was not unbound by remove'),
  5430. t.boundTargets.forEach(function (e) {
  5431. O.pathLabel.unbind(t, e);
  5432. }));
  5433. },
  5434. },
  5435. }),
  5436. Object.keys(O).forEach(function (e) {
  5437. ot[e] = function () {
  5438. return new M(O[e], Array.prototype.slice.call(arguments));
  5439. };
  5440. }),
  5441. (ot.positionByWindowResize = !0),
  5442. window.addEventListener(
  5443. 'resize',
  5444. S.add(function () {
  5445. ot.positionByWindowResize &&
  5446. Object.keys(Se).forEach(function (e) {
  5447. $e(Se[e], { position: !0 });
  5448. });
  5449. }),
  5450. !1
  5451. ),
  5452. ot
  5453. );
  5454. })();