diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | api/app-images.php | 2 | ||||
-rw-r--r-- | api/cloudburst-banners.php | 8 | ||||
-rw-r--r-- | api/cloudburst-data.php | 6 | ||||
-rw-r--r-- | api/cloudburst-scored.php | 8 | ||||
-rw-r--r-- | api/cloudburst.php | 2 | ||||
-rw-r--r-- | api/data.php | 4 | ||||
-rw-r--r-- | api/docs.php | 2 | ||||
-rw-r--r-- | api/emergency-real.php | 2 | ||||
-rw-r--r-- | api/emergency.php | 2 | ||||
-rw-r--r-- | api/eval.php | 2 | ||||
-rw-r--r-- | api/fronter.php | 6 | ||||
-rw-r--r-- | api/me-picture.php | 5 | ||||
-rw-r--r-- | api/me.php | 2 | ||||
-rw-r--r-- | api/pleasure-real.php | 6 | ||||
-rw-r--r-- | api/pleasure.php | 6 | ||||
-rw-r--r-- | api/pluralkit-integration.php | 10 | ||||
-rw-r--r-- | api/raindrops-banners.php | 8 | ||||
-rw-r--r-- | api/raindrops-data.php | 6 | ||||
-rw-r--r-- | api/raindrops-img.php | 2 | ||||
-rw-r--r-- | api/raindrops-scored.php | 8 | ||||
-rw-r--r-- | api/raindrops.php | 2 | ||||
-rw-r--r-- | api/save-private.php | 8 | ||||
-rw-r--r-- | api/save.php | 8 | ||||
-rw-r--r-- | api/session.php | 2 | ||||
-rw-r--r-- | api/token.php | 2 | ||||
-rw-r--r-- | api/video.php | 2 | ||||
-rw-r--r-- | api/wakeup-real.php | 6 | ||||
-rw-r--r-- | api/wakeup.php | 6 | ||||
-rw-r--r-- | app.php | 22 | ||||
-rw-r--r-- | app/banner.js | 6 | ||||
-rwxr-xr-x | app/bits/assets/graph.js | 11 | ||||
-rw-r--r-- | app/demo/index.php | 2 | ||||
-rw-r--r-- | app/emergency/index.php | 4 | ||||
-rw-r--r-- | app/fronters/ponies/auvwc.png | bin | 0 -> 6074 bytes | |||
-rw-r--r-- | app/fronters/ponies/bbrig.png | bin | 0 -> 5945 bytes | |||
-rw-r--r-- | app/fronters/ponies/ghrby.png | bin | 0 -> 6337 bytes | |||
-rw-r--r-- | app/fronters/ponies/mvaws.png | bin | 0 -> 7189 bytes | |||
-rw-r--r-- | app/fronters/ponies/rirgf.png | bin | 24981 -> 5480 bytes | |||
-rw-r--r-- | app/fronters/profiles/auvwc.png | bin | 0 -> 504733 bytes | |||
-rw-r--r-- | app/fronters/profiles/ckqsw.png | bin | 237290 -> 237290 bytes | |||
-rw-r--r-- | app/fronters/profiles/cmeyc.png | bin | 0 -> 1542918 bytes | |||
-rw-r--r-- | app/fronters/profiles/dogwu.png | bin | 0 -> 2055 bytes | |||
-rw-r--r-- | app/fronters/profiles/epvhq.png | bin | 0 -> 825561 bytes | |||
-rw-r--r-- | app/fronters/profiles/erefx.png | bin | 826530 -> 826530 bytes | |||
-rw-r--r-- | app/fronters/profiles/erknz.png | bin | 56915 -> 56915 bytes | |||
-rw-r--r-- | app/fronters/profiles/exidq.png | bin | 0 -> 45898 bytes | |||
-rw-r--r-- | app/fronters/profiles/ezqym.png | bin | 0 -> 184686 bytes | |||
-rw-r--r-- | app/fronters/profiles/famxl.png | bin | 0 -> 825561 bytes | |||
-rw-r--r-- | app/fronters/profiles/gevde.png | bin | 100880 -> 100880 bytes | |||
-rw-r--r-- | app/fronters/profiles/gfhsr.png | bin | 2283131 -> 2283131 bytes | |||
-rw-r--r-- | app/fronters/profiles/ghrby.png | bin | 0 -> 167497 bytes | |||
-rw-r--r-- | app/fronters/profiles/ghuln.png | bin | 370233 -> 370233 bytes | |||
-rw-r--r-- | app/fronters/profiles/hpwyq.png | bin | 2770 -> 2770 bytes | |||
-rw-r--r-- | app/fronters/profiles/irxyh.png | bin | 26543 -> 26543 bytes | |||
-rw-r--r-- | app/fronters/profiles/jhemc.png | bin | 0 -> 100880 bytes | |||
-rw-r--r-- | app/fronters/profiles/jnbae.png | bin | 60223 -> 60223 bytes | |||
-rw-r--r-- | app/fronters/profiles/khsbb.png | bin | 249236 -> 249236 bytes | |||
-rw-r--r-- | app/fronters/profiles/kkhbw.png | bin | 40300 -> 40300 bytes | |||
-rw-r--r-- | app/fronters/profiles/lllfw.png | bin | 745786 -> 745786 bytes | |||
-rw-r--r-- | app/fronters/profiles/lzlaq.png | bin | 26543 -> 26543 bytes | |||
-rw-r--r-- | app/fronters/profiles/mglyq.png | bin | 91476 -> 91476 bytes | |||
-rw-r--r-- | app/fronters/profiles/mhnqy.png | bin | 27452 -> 27452 bytes | |||
-rw-r--r-- | app/fronters/profiles/mvaws.png | bin | 0 -> 473421 bytes | |||
-rw-r--r-- | app/fronters/profiles/pabmo.png | bin | 124750 -> 124750 bytes | |||
-rw-r--r-- | app/fronters/profiles/ppukh.png | bin | 0 -> 2843 bytes | |||
-rw-r--r-- | app/fronters/profiles/qbzxm.png | bin | 2843 -> 2843 bytes | |||
-rw-r--r-- | app/fronters/profiles/qraku.png | bin | 45898 -> 45898 bytes | |||
-rw-r--r-- | app/fronters/profiles/qzbpf.png | bin | 0 -> 56915 bytes | |||
-rw-r--r-- | app/fronters/profiles/rdstg.png | bin | 16881 -> 16881 bytes | |||
-rw-r--r-- | app/fronters/profiles/rirgf.png | bin | 825561 -> 825561 bytes | |||
-rw-r--r-- | app/fronters/profiles/rpjok.png | bin | 1542918 -> 1542918 bytes | |||
-rw-r--r-- | app/fronters/profiles/sbxze.png | bin | 50554 -> 50554 bytes | |||
-rw-r--r-- | app/fronters/profiles/sehke.png | bin | 1947 -> 1947 bytes | |||
-rw-r--r-- | app/fronters/profiles/sjuao.png | bin | 0 -> 1045570 bytes | |||
-rw-r--r-- | app/fronters/profiles/souga.png | bin | 0 -> 45898 bytes | |||
-rw-r--r-- | app/fronters/profiles/tfbob.png | bin | 14049 -> 14049 bytes | |||
-rw-r--r-- | app/fronters/profiles/tmgiu.png | bin | 260760 -> 260760 bytes | |||
-rw-r--r-- | app/fronters/profiles/trefr.png | bin | 0 -> 1947 bytes | |||
-rw-r--r-- | app/fronters/profiles/vahcl.png | bin | 0 -> 45898 bytes | |||
-rw-r--r-- | app/fronters/profiles/vncoa.png | bin | 46475 -> 46475 bytes | |||
-rw-r--r-- | app/fronters/profiles/vvsxf.png | bin | 61010 -> 61010 bytes | |||
-rw-r--r-- | app/fronters/profiles/wjovt.png | bin | 0 -> 2097 bytes | |||
-rw-r--r-- | app/fronters/profiles/xbvwt.png | bin | 70342 -> 70342 bytes | |||
-rw-r--r-- | app/fronters/profiles/xcjhj.png | bin | 107053 -> 107053 bytes | |||
-rw-r--r-- | app/fronters/profiles/ynpba.png | bin | 0 -> 69145 bytes | |||
-rw-r--r-- | app/fronters/profiles/zajrk.png | bin | 2097 -> 2097 bytes | |||
-rw-r--r-- | app/fronters/profiles/zdtsg.png | bin | 3046 -> 3046 bytes | |||
-rw-r--r-- | app/fronters/profiles/zhtzs.png | bin | 673763 -> 673763 bytes | |||
-rw-r--r-- | app/fronters/profiles/ztfjz.png | bin | 184686 -> 184686 bytes | |||
-rw-r--r-- | app/fronters/profiles/zzise.png | bin | 69145 -> 69145 bytes | |||
-rwxr-xr-x | app/fronters/script.js | 2 | ||||
-rw-r--r-- | app/functions.js | 4 | ||||
-rw-r--r-- | app/index.html | 4 | ||||
-rw-r--r-- | app/load.js | 105 | ||||
-rw-r--r-- | app/planner/index.php | 14 | ||||
-rw-r--r-- | app/sw.js | 29 | ||||
-rw-r--r-- | assets/editor/chart.js | 13 | ||||
-rw-r--r-- | assets/icons/about.svg | 2 | ||||
-rw-r--r-- | assets/icons/actions.svg | 2 | ||||
-rw-r--r-- | assets/icons/add.svg | 2 | ||||
-rw-r--r-- | assets/icons/admin.svg | 2 | ||||
-rw-r--r-- | assets/icons/bitset.svg | 2 | ||||
-rw-r--r-- | assets/icons/byfront.svg | 2 | ||||
-rw-r--r-- | assets/icons/compare.svg | 2 | ||||
-rw-r--r-- | assets/icons/complete.svg | 2 | ||||
-rw-r--r-- | assets/icons/dashboard.svg | 2 | ||||
-rw-r--r-- | assets/icons/debug.svg | 2 | ||||
-rw-r--r-- | assets/icons/delete.svg | 2 | ||||
-rw-r--r-- | assets/icons/disclaimers.svg | 2 | ||||
-rw-r--r-- | assets/icons/docs.svg | 2 | ||||
-rw-r--r-- | assets/icons/down.svg | 2 | ||||
-rw-r--r-- | assets/icons/emergency.svg | 2 | ||||
-rw-r--r-- | assets/icons/favicon/about.png | bin | 596940 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/actions.png | bin | 441293 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/add.png | bin | 591800 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/admin.png | bin | 656859 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/bitset.png | bin | 446413 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/byfront.png | bin | 614768 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/compare.png | bin | 526904 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/complete.png | bin | 938661 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/dashboard.png | bin | 411540 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/debug.png | bin | 537769 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/delete.png | bin | 428605 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/disclaimers.png | bin | 595791 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/docs.png | bin | 431810 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/down.png | bin | 472767 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/emergency.png | bin | 647174 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/form.png | bin | 434475 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/fronting.png | bin | 460693 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/global.png | bin | 518499 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/history.png | bin | 580502 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/home.png | bin | 488436 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/login.png | bin | 478948 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/logout.png | bin | 472253 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/nicknames.png | bin | 550708 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/none.png | bin | 743266 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/page.png | bin | 442099 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/parser.png | bin | 420554 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/partial.png | bin | 628940 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/pleasure-0.png | bin | 0 -> 15175 bytes | |||
-rw-r--r-- | assets/icons/favicon/pleasure-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/pleasure.png | bin | 570067 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/prefix-0.png | bin | 0 -> 9983 bytes | |||
-rw-r--r-- | assets/icons/favicon/prefix-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/prefix.png | bin | 502208 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/relations-0.png | bin | 0 -> 10301 bytes | |||
-rw-r--r-- | assets/icons/favicon/relations-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/relations.png | bin | 505476 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/right-0.png | bin | 0 -> 19284 bytes | |||
-rw-r--r-- | assets/icons/favicon/right-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/right.png | bin | 512397 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/rules-0.png | bin | 0 -> 19622 bytes | |||
-rw-r--r-- | assets/icons/favicon/rules-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/rules.png | bin | 567258 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/score-0.png | bin | 0 -> 12593 bytes | |||
-rw-r--r-- | assets/icons/favicon/score-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/score.png | bin | 514720 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/shield-0.png | bin | 0 -> 13275 bytes | |||
-rw-r--r-- | assets/icons/favicon/shield-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/shield.png | bin | 556026 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/species-0.png | bin | 0 -> 15267 bytes | |||
-rw-r--r-- | assets/icons/favicon/species-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/species.png | bin | 630114 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/splitting-0.png | bin | 0 -> 10267 bytes | |||
-rw-r--r-- | assets/icons/favicon/splitting-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/splitting.png | bin | 434475 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/stats-0.png | bin | 0 -> 8683 bytes | |||
-rw-r--r-- | assets/icons/favicon/stats-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/terminology-0.png | bin | 0 -> 9447 bytes | |||
-rw-r--r-- | assets/icons/favicon/terminology-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/terminology.png | bin | 434068 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/together-0.png | bin | 0 -> 10297 bytes | |||
-rw-r--r-- | assets/icons/favicon/together-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/together.png | bin | 442299 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/toys-0.png | bin | 0 -> 14074 bytes | |||
-rw-r--r-- | assets/icons/favicon/toys-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/toys.png | bin | 516116 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/travel-0.png | bin | 0 -> 15968 bytes | |||
-rw-r--r-- | assets/icons/favicon/travel-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/travel.png | bin | 640477 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/travelling-0.png | bin | 0 -> 22918 bytes | |||
-rw-r--r-- | assets/icons/favicon/travelling-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/travelling.png | bin | 640477 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/tree-0.png | bin | 0 -> 8627 bytes | |||
-rw-r--r-- | assets/icons/favicon/tree-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/tree.png | bin | 405267 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/up-0.png | bin | 0 -> 19368 bytes | |||
-rw-r--r-- | assets/icons/favicon/up-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/up.png | bin | 481492 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/user-0.png | bin | 0 -> 13806 bytes | |||
-rw-r--r-- | assets/icons/favicon/user-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/user.png | bin | 527532 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/visibility-depends-0.png | bin | 0 -> 16975 bytes | |||
-rw-r--r-- | assets/icons/favicon/visibility-depends-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/visibility-depends.png | bin | 510495 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/visibility-private-0.png | bin | 0 -> 15429 bytes | |||
-rw-r--r-- | assets/icons/favicon/visibility-private-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/visibility-private.png | bin | 491609 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/visibility-public-0.png | bin | 0 -> 13935 bytes | |||
-rw-r--r-- | assets/icons/favicon/visibility-public-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/visibility-public.png | bin | 518499 -> 0 bytes | |||
-rw-r--r-- | assets/icons/favicon/wakeup-0.png | bin | 0 -> 14847 bytes | |||
-rw-r--r-- | assets/icons/favicon/wakeup-1.png | bin | 0 -> 249141 bytes | |||
-rw-r--r-- | assets/icons/favicon/wakeup.png | bin | 809231 -> 0 bytes | |||
-rw-r--r-- | assets/icons/form.svg | 2 | ||||
-rw-r--r-- | assets/icons/fronting.svg | 2 | ||||
-rw-r--r-- | assets/icons/global.svg | 2 | ||||
-rw-r--r-- | assets/icons/government.svg | 1 | ||||
-rw-r--r-- | assets/icons/history.svg | 2 | ||||
-rw-r--r-- | assets/icons/home.svg | 2 | ||||
-rw-r--r-- | assets/icons/icongen.js | 12 | ||||
-rw-r--r-- | assets/icons/login.svg | 2 | ||||
-rw-r--r-- | assets/icons/logout.svg | 2 | ||||
-rw-r--r-- | assets/icons/nicknames.svg | 2 | ||||
-rw-r--r-- | assets/icons/none.svg | 2 | ||||
-rw-r--r-- | assets/icons/page.svg | 2 | ||||
-rw-r--r-- | assets/icons/parser.svg | 2 | ||||
-rw-r--r-- | assets/icons/partial.svg | 2 | ||||
-rw-r--r-- | assets/icons/pleasure.svg | 2 | ||||
-rw-r--r-- | assets/icons/prefix.svg | 2 | ||||
-rw-r--r-- | assets/icons/relations.svg | 2 | ||||
-rw-r--r-- | assets/icons/right.svg | 2 | ||||
-rw-r--r-- | assets/icons/rules.svg | 2 | ||||
-rw-r--r-- | assets/icons/score.svg | 2 | ||||
-rw-r--r-- | assets/icons/shield.svg | 2 | ||||
-rw-r--r-- | assets/icons/species.svg | 2 | ||||
-rw-r--r-- | assets/icons/splitting.svg | 2 | ||||
-rw-r--r-- | assets/icons/stats.svg | 1 | ||||
-rw-r--r-- | assets/icons/terminology.svg | 2 | ||||
-rw-r--r-- | assets/icons/together.svg | 2 | ||||
-rw-r--r-- | assets/icons/toys.svg | 2 | ||||
-rw-r--r-- | assets/icons/travel.svg | 2 | ||||
-rw-r--r-- | assets/icons/travelling.svg | 2 | ||||
-rw-r--r-- | assets/icons/tree.svg | 2 | ||||
-rw-r--r-- | assets/icons/uncolored/complete.svg | 1 | ||||
-rw-r--r-- | assets/icons/uncolored/emergency.svg | 1 | ||||
-rw-r--r-- | assets/icons/uncolored/none.svg | 1 | ||||
-rw-r--r-- | assets/icons/uncolored/partial.svg | 1 | ||||
-rw-r--r-- | assets/icons/uncolored/pleasure.svg | 1 | ||||
-rw-r--r-- | assets/icons/uncolored/wakeup.svg | 1 | ||||
-rw-r--r-- | assets/icons/up.svg | 2 | ||||
-rw-r--r-- | assets/icons/user.svg | 2 | ||||
-rw-r--r-- | assets/icons/visibility-depends.svg | 2 | ||||
-rw-r--r-- | assets/icons/visibility-private.svg | 2 | ||||
-rw-r--r-- | assets/icons/visibility-public.svg | 2 | ||||
-rw-r--r-- | assets/icons/wakeup.svg | 2 | ||||
-rw-r--r-- | assets/logo/newlogo-template.png | bin | 0 -> 24959 bytes | |||
-rw-r--r-- | assets/logo/newlogo.png | bin | 0 -> 3982 bytes | |||
-rw-r--r-- | assets/uploads/pt-applebloom.png | bin | 0 -> 6219 bytes | |||
-rw-r--r-- | assets/uploads/pt-izzymoonbow.png (renamed from assets/uploads/pt-izzy.png) | bin | 6379 -> 6379 bytes | |||
-rw-r--r-- | assets/uploads/pt-mistybrightdawn.png | bin | 0 -> 6142 bytes | |||
-rw-r--r-- | assets/uploads/pt-scootaloo.png | bin | 4287 -> 4147 bytes | |||
-rw-r--r-- | assets/uploads/pt-thunder.png | bin | 0 -> 5214 bytes | |||
-rw-r--r-- | assets/uploads/pt-zoomzephyrwing.png | bin | 0 -> 4696 bytes | |||
-rw-r--r-- | autoschedule/main.php | 13 | ||||
-rw-r--r-- | autoschedule/ponies.php | 6 | ||||
-rw-r--r-- | includes/ai.inc (renamed from includes/ai.php) | 0 | ||||
-rw-r--r-- | includes/assets.inc | 55 | ||||
-rw-r--r-- | includes/backup.inc (renamed from includes/backup.php) | 2 | ||||
-rw-r--r-- | includes/banner.inc (renamed from includes/banner.php) | 42 | ||||
-rw-r--r-- | includes/bitset.inc (renamed from includes/bitset.php) | 0 | ||||
-rw-r--r-- | includes/edit-private.inc (renamed from includes/edit-private.php) | 12 | ||||
-rw-r--r-- | includes/edit.inc (renamed from includes/edit.php) | 12 | ||||
-rw-r--r-- | includes/emergency.inc (renamed from includes/emergency.php) | 0 | ||||
-rw-r--r-- | includes/footer.inc (renamed from includes/footer.php) | 9 | ||||
-rw-r--r-- | includes/functions.inc (renamed from includes/functions.php) | 186 | ||||
-rw-r--r-- | includes/header.inc (renamed from includes/header.php) | 82 | ||||
-rw-r--r-- | includes/icons.inc | 5 | ||||
-rw-r--r-- | includes/init.inc | 28 | ||||
-rw-r--r-- | includes/init.php | 18 | ||||
-rw-r--r-- | includes/keywords.inc (renamed from includes/keywords.php) | 4 | ||||
-rw-r--r-- | includes/logo.inc | 97 | ||||
-rw-r--r-- | includes/member.inc (renamed from includes/member.php) | 38 | ||||
-rw-r--r-- | includes/member/hierarchy.inc (renamed from includes/member/hierarchy.php) | 20 | ||||
-rw-r--r-- | includes/member/tree.inc (renamed from includes/member/tree.php) | 0 | ||||
-rw-r--r-- | includes/pages.json | 116 | ||||
-rw-r--r-- | includes/planner.inc (renamed from includes/planner.php) | 173 | ||||
-rw-r--r-- | includes/pleasure.inc (renamed from includes/pleasure.php) | 0 | ||||
-rw-r--r-- | includes/pronouns.inc (renamed from includes/pronouns.php) | 0 | ||||
-rw-r--r-- | includes/rail.inc | 176 | ||||
-rw-r--r-- | includes/rainbow.inc (renamed from includes/rainbow.php) | 46 | ||||
-rw-r--r-- | includes/random.inc (renamed from includes/random.php) | 0 | ||||
-rw-r--r-- | includes/refresh.php | 144 | ||||
-rw-r--r-- | includes/restore.inc (renamed from includes/restore.php) | 0 | ||||
-rw-r--r-- | includes/score.inc (renamed from includes/score.php) | 29 | ||||
-rw-r--r-- | includes/search.inc (renamed from includes/search.php) | 10 | ||||
-rw-r--r-- | includes/session.inc (renamed from includes/session.php) | 0 | ||||
-rw-r--r-- | includes/short.inc (renamed from includes/short.php) | 6 | ||||
-rw-r--r-- | includes/subsysbanner.inc (renamed from includes/subsysbanner.php) | 11 | ||||
-rw-r--r-- | includes/subsysedit.inc (renamed from includes/subsysedit.php) | 10 | ||||
-rw-r--r-- | includes/sysbanner.inc (renamed from includes/sysbanner.php) | 34 | ||||
-rw-r--r-- | includes/sysedit.inc (renamed from includes/sysedit.php) | 6 | ||||
-rw-r--r-- | includes/system.inc (renamed from includes/system.php) | 8 | ||||
-rw-r--r-- | includes/system/compare.inc (renamed from includes/system/compare.php) | 16 | ||||
-rw-r--r-- | includes/system/history.inc (renamed from includes/system/history.php) | 222 | ||||
-rw-r--r-- | includes/system/species.inc (renamed from includes/system/species.php) | 12 | ||||
-rw-r--r-- | includes/system/subsystem.inc (renamed from includes/system/subsystem.php) | 14 | ||||
-rw-r--r-- | includes/system/tree.inc (renamed from includes/system/tree.php) | 16 | ||||
-rw-r--r-- | includes/travelling.inc (renamed from includes/travelling.php) | 10 | ||||
-rw-r--r-- | includes/wakeup.inc (renamed from includes/wakeup.php) | 0 | ||||
-rw-r--r-- | pages/about.inc | 96 | ||||
-rw-r--r-- | pages/actions.inc (renamed from pages/actions.php) | 110 | ||||
-rw-r--r-- | pages/alphabet.inc (renamed from pages/alphabet.php) | 14 | ||||
-rw-r--r-- | pages/api.inc (renamed from pages/api.php) | 0 | ||||
-rw-r--r-- | pages/app.inc (renamed from pages/app.php) | 0 | ||||
-rw-r--r-- | pages/bitset.inc (renamed from pages/bitset.php) | 6 | ||||
-rw-r--r-- | pages/byfront.inc (renamed from pages/byfront.php) | 20 | ||||
-rw-r--r-- | pages/dashboard.inc | 231 | ||||
-rw-r--r-- | pages/dashboard.php | 321 | ||||
-rw-r--r-- | pages/debug.inc (renamed from pages/debug.php) | 35 | ||||
-rw-r--r-- | pages/demo.inc (renamed from pages/demo.php) | 20 | ||||
-rw-r--r-- | pages/disclaimers.inc (renamed from pages/disclaimers.php) | 6 | ||||
-rw-r--r-- | pages/docs.inc (renamed from pages/docs.php) | 8 | ||||
-rw-r--r-- | pages/edit-private.inc (renamed from pages/edit-private.php) | 12 | ||||
-rw-r--r-- | pages/edit.inc (renamed from pages/edit.php) | 14 | ||||
-rw-r--r-- | pages/emergency.inc (renamed from pages/emergency.php) | 8 | ||||
-rw-r--r-- | pages/fronting.inc (renamed from pages/fronting.php) | 8 | ||||
-rw-r--r-- | pages/government.inc | 142 | ||||
-rw-r--r-- | pages/home.inc (renamed from pages/home.php) | 14 | ||||
-rw-r--r-- | pages/login.inc (renamed from pages/login.php) | 12 | ||||
-rw-r--r-- | pages/logout.inc (renamed from pages/logout.php) | 0 | ||||
-rw-r--r-- | pages/nicknames.inc (renamed from pages/nicknames.php) | 12 | ||||
-rw-r--r-- | pages/page.inc (renamed from pages/page.php) | 22 | ||||
-rw-r--r-- | pages/parser.inc (renamed from pages/parser.php) | 22 | ||||
-rw-r--r-- | pages/pleasure.inc (renamed from pages/pleasure.php) | 8 | ||||
-rw-r--r-- | pages/prefix.inc (renamed from pages/prefix.php) | 16 | ||||
-rw-r--r-- | pages/relations.inc (renamed from pages/relations.php) | 14 | ||||
-rw-r--r-- | pages/rules.inc (renamed from pages/rules.php) | 12 | ||||
-rw-r--r-- | pages/score.inc (renamed from pages/score.php) | 60 | ||||
-rw-r--r-- | pages/splitting.inc (renamed from pages/splitting.php) | 8 | ||||
-rw-r--r-- | pages/stats.inc | 441 | ||||
-rw-r--r-- | pages/terminology.inc (renamed from pages/terminology.php) | 6 | ||||
-rw-r--r-- | pages/together-dev.inc (renamed from pages/together-dev.php) | 2 | ||||
-rw-r--r-- | pages/together.inc (renamed from pages/together.php) | 4 | ||||
-rw-r--r-- | pages/toys.inc (renamed from pages/toys.php) | 69 | ||||
-rw-r--r-- | pages/travelling.inc (renamed from pages/travelling.php) | 16 | ||||
-rw-r--r-- | pages/wakeup.inc (renamed from pages/wakeup.php) | 8 |
338 files changed, 2724 insertions, 1229 deletions
@@ -5,4 +5,5 @@ includes/app.json includes/tokens together/build assets/editor/thing.mp4 -includes/_restore
\ No newline at end of file +includes/_restore +includes/data.new
\ No newline at end of file diff --git a/api/app-images.php b/api/app-images.php index 76b11a0..dea66cb 100644 --- a/api/app-images.php +++ b/api/app-images.php @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); global $_PROFILE; diff --git a/api/cloudburst-banners.php b/api/cloudburst-banners.php index 8bbd575..62e6936 100644 --- a/api/cloudburst-banners.php +++ b/api/cloudburst-banners.php @@ -1,13 +1,13 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc"; if (!$isLoggedIn) header("Location: /-/login") and die(); $data = []; -foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { +foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { if ($member['name'] === "unknown") continue; if ($member['name'] === "fusion") continue; if ($member['name'] === "new") continue; diff --git a/api/cloudburst-data.php b/api/cloudburst-data.php index c996815..edddd2d 100644 --- a/api/cloudburst-data.php +++ b/api/cloudburst-data.php @@ -1,14 +1,14 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; if (!$isLoggedIn) header("Location: /-/login") and die(); $data = []; $data["members"] = []; foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data"), function ($i) { return !str_starts_with($i, "."); }) as $file) { - if (str_starts_with($file, "ynmuc-") && !(str_ends_with($file, "-members.json") || str_ends_with($file, "-fronters.json") || str_ends_with($file, "-general.json") || str_ends_with($file, "-switches.json"))) { + if (str_starts_with($file, "ynmuc-") && !(str_ends_with($file, "/members.json") || str_ends_with($file, "/content.html") || str_ends_with($file, "/general.json") || str_ends_with($file, "/switches.json"))) { $name = substr(explode(".", $file)[0], 6); $parts = explode("-", $name); diff --git a/api/cloudburst-scored.php b/api/cloudburst-scored.php index 37acbcc..649b4fc 100644 --- a/api/cloudburst-scored.php +++ b/api/cloudburst-scored.php @@ -1,9 +1,9 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; if (!$isLoggedIn) header("Location: /-/login") and die(); header("Content-Type: application/json"); -die(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true), "ynmuc")), JSON_PRETTY_PRINT));
\ No newline at end of file +die(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true), "ynmuc")), JSON_PRETTY_PRINT));
\ No newline at end of file diff --git a/api/cloudburst.php b/api/cloudburst.php index 3002e00..efdcd73 100644 --- a/api/cloudburst.php +++ b/api/cloudburst.php @@ -2,5 +2,5 @@ header("Content-Type: text/plain"); -$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true); +$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/content.html"), true); echo($fronters['members'][0]['display_name'] ?? $fronters['members'][0]['name']);
\ No newline at end of file diff --git a/api/data.php b/api/data.php index 51df59a..0a1b01b 100644 --- a/api/data.php +++ b/api/data.php @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; if (!$isLoggedIn) header("Location: /-/login") and die(); if (!isset($_GET['f']) || !file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $_GET['f'])) { diff --git a/api/docs.php b/api/docs.php index edcd4fb..1c9429b 100644 --- a/api/docs.php +++ b/api/docs.php @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; global $_PROFILE; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $_PROFILE; if (!$isLoggedIn) header("Location: /-/login") and die(); $request_raw = file_get_contents('php://input'); diff --git a/api/emergency-real.php b/api/emergency-real.php index 06e1813..2dd7172 100644 --- a/api/emergency-real.php +++ b/api/emergency-real.php @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); global $_PROFILE; diff --git a/api/emergency.php b/api/emergency.php index 5c9f32f..e0726e7 100644 --- a/api/emergency.php +++ b/api/emergency.php @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); global $_PROFILE; diff --git a/api/eval.php b/api/eval.php index 4270ed1..cebf38b 100644 --- a/api/eval.php +++ b/api/eval.php @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); header("Content-Type: text/plain"); diff --git a/api/fronter.php b/api/fronter.php index f962625..0dd6e99 100644 --- a/api/fronter.php +++ b/api/fronter.php @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); $system = $_GET['s'] ?? null; @@ -18,7 +18,7 @@ if (!isset($type) || trim($type) === "") if (!isset($date) || trim($date) === "" || strlen($date) !== 10 || !preg_match("/[\d-]/i", $date)) header("Location: /?error=Date not found") and die(); -$list = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-planner.json"), true); +$list = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/$system.json"), true); function moveElement(&$array, $a, $b) { $out = array_splice($array, $a, 1); @@ -105,6 +105,6 @@ switch ($type) { break; } -file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-planner.json", json_encode($list)); +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/$system.json", json_encode($list)); die();
\ No newline at end of file diff --git a/api/me-picture.php b/api/me-picture.php index 636188e..3f0bce0 100644 --- a/api/me-picture.php +++ b/api/me-picture.php @@ -1,12 +1,12 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); global $_PROFILE; header("Content-Type: application/json"); -$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($_PROFILE['name'] === "Cloudburst System" ? "ynmuc" : "gdapd") . "-fronters.json"), true); +$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($_PROFILE['name'] === "Cloudburst System" ? "ynmuc" : "gdapd") . "/fronters.json"), true); $member = $fronters["members"][0]; if (isset($member["avatar_url"])) { @@ -15,7 +15,6 @@ if (isset($member["avatar_url"])) { exec("convert -resize 256x256 -quality 50 \"" . $tempfile . "-original" . "\" \"" . $tempfile . "\"", $output); echo("data:image/jpg;base64," . base64_encode(file_get_contents($tempfile))); - //echo(implode("\n", $output)); unlink($tempfile . "-original"); unlink($tempfile); } else { @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); global $_PROFILE; diff --git a/api/pleasure-real.php b/api/pleasure-real.php index fe8896d..27f2fcf 100644 --- a/api/pleasure-real.php +++ b/api/pleasure-real.php @@ -1,11 +1,11 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); global $_PROFILE; -$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true)["members"]; -$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true)["members"]; +$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/content.html"), true)["members"]; +$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/content.html"), true)["members"]; if ($frontCloudburst[0]["id"] === "erknz" && $frontRaindrops[0]["id"] === "qbzxm") { if ($_PROFILE['login'] === "raindrops") $pony = "Cloudy"; else $pony = "Lavender"; diff --git a/api/pleasure.php b/api/pleasure.php index cdd49c0..1a561df 100644 --- a/api/pleasure.php +++ b/api/pleasure.php @@ -1,11 +1,11 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); global $_PROFILE; -$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true)["members"]; -$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true)["members"]; +$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/content.html"), true)["members"]; +$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/content.html"), true)["members"]; if ($frontCloudburst[0]["id"] === "erknz" && $frontRaindrops[0]["id"] === "qbzxm") { if ($_PROFILE['login'] === "raindrops") $pony = "Cloudy"; else $pony = "Lavender"; diff --git a/api/pluralkit-integration.php b/api/pluralkit-integration.php index 3582df1..2736f67 100644 --- a/api/pluralkit-integration.php +++ b/api/pluralkit-integration.php @@ -27,15 +27,15 @@ if ($input['system_id'] === "7d9f543e-f742-40f6-9d07-86c3f2983124") { $name = "Cloudburst System"; } -$lastFronter = json_decode(@file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-last.json"), true) ?? ""; +$lastFronter = json_decode(@file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/last.json"), true) ?? ""; if ($input["type"] === "CREATE_SWITCH" || $input["type"] === "UPDATE_SWITCH" || $input["type"] === "DELETE_SWITCH") { - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/fronters")); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-switches.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/switches")); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/fronters")); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$input[system_id]/switches")); - $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true); + $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true); $currentFronter = $fronters["members"][0]["id"]; - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-last.json", json_encode($currentFronter)); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/last.json", json_encode($currentFronter)); $ntfy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"]; diff --git a/api/raindrops-banners.php b/api/raindrops-banners.php index b2a5ef4..97fc954 100644 --- a/api/raindrops-banners.php +++ b/api/raindrops-banners.php @@ -1,13 +1,13 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc"; if (!$isLoggedIn) header("Location: /-/login") and die(); $data = []; -foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { +foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { if ($member['name'] === "unknown") continue; if ($member['name'] === "fusion") continue; if ($member['name'] === "new") continue; diff --git a/api/raindrops-data.php b/api/raindrops-data.php index 958fb8f..492f561 100644 --- a/api/raindrops-data.php +++ b/api/raindrops-data.php @@ -1,14 +1,14 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; if (!$isLoggedIn) header("Location: /-/login") and die(); $data = []; $data["members"] = []; foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data"), function ($i) { return !str_starts_with($i, "."); }) as $file) { - if (str_starts_with($file, "gdapd-") && !(str_ends_with($file, "-members.json") || str_ends_with($file, "-fronters.json") || str_ends_with($file, "-general.json") || str_ends_with($file, "-switches.json"))) { + if (str_starts_with($file, "gdapd-") && !(str_ends_with($file, "/members.json") || str_ends_with($file, "/fronters.json") || str_ends_with($file, "/general.json") || str_ends_with($file, "/switches.json"))) { $name = substr(explode(".", $file)[0], 6); $parts = explode("-", $name); diff --git a/api/raindrops-img.php b/api/raindrops-img.php index 3b24d97..6a7484f 100644 --- a/api/raindrops-img.php +++ b/api/raindrops-img.php @@ -1,6 +1,6 @@ <?php -$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true); +$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true); $url = isset($fronters['members'][0]) ? ($fronters['members'][0]["avatar_url"] ?? "https://static.equestria.horse/ponies/uploads/raindrops.png") : "https://static.equestria.horse/ponies/uploads/raindrops.png"; file_put_contents("/tmp/temp", file_get_contents($url)); diff --git a/api/raindrops-scored.php b/api/raindrops-scored.php index 929cdc8..75da62a 100644 --- a/api/raindrops-scored.php +++ b/api/raindrops-scored.php @@ -1,9 +1,9 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; if (!$isLoggedIn) header("Location: /-/login") and die(); header("Content-Type: application/json"); -die(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true), "gdapd")), JSON_PRETTY_PRINT));
\ No newline at end of file +die(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), "gdapd")), JSON_PRETTY_PRINT));
\ No newline at end of file diff --git a/api/raindrops.php b/api/raindrops.php index 9f07aff..c44faa6 100644 --- a/api/raindrops.php +++ b/api/raindrops.php @@ -2,5 +2,5 @@ header("Content-Type: text/plain"); -$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true); +$fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true); echo($fronters['members'][0]['display_name'] ?? $fronters['members'][0]['name']);
\ No newline at end of file diff --git a/api/save-private.php b/api/save-private.php index 13e3ecf..a7430ad 100644 --- a/api/save-private.php +++ b/api/save-private.php @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); $request_raw = file_get_contents('php://input'); @@ -24,12 +24,12 @@ if (!isset($content)) header("Location: /?error=No content") and die(); if ($member !== null && $member !== "null") { - $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-" . $member . "-private.html"; + $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member . "-private.html"; } else { if ($subsystem !== null && $subsystem !== "null") { - $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-subsystem-" . $subsystem . ".html"; + $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/" . $system . "-" . $subsystem . ".html"; } else { - $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-content.html"; + $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $system . ".html"; } } diff --git a/api/save.php b/api/save.php index f679a71..ed6cc17 100644 --- a/api/save.php +++ b/api/save.php @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); $request_raw = file_get_contents('php://input'); @@ -24,12 +24,12 @@ if (!isset($content)) header("Location: /?error=No content") and die(); if ($member !== null && $member !== "null") { - $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-" . $member . "-content.html"; + $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member . ".html"; } else { if ($subsystem !== null && $subsystem !== "null") { - $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-subsystem-" . $subsystem . ".html"; + $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/" . $system . "-" . $subsystem . ".html"; } else { - $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "-content.html"; + $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $system . ".html"; } } diff --git a/api/session.php b/api/session.php index 3cf7cff..55d2fd3 100644 --- a/api/session.php +++ b/api/session.php @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; header("Content-Type: text/plain"); die($isLoggedIn ? "VALID" : "ERROR");
\ No newline at end of file diff --git a/api/token.php b/api/token.php index 8c18c30..99b9158 100644 --- a/api/token.php +++ b/api/token.php @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); header("Content-Type: text/plain"); diff --git a/api/video.php b/api/video.php index e960ddf..00c8214 100644 --- a/api/video.php +++ b/api/video.php @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); if (isset($_GET['id'])) { diff --git a/api/wakeup-real.php b/api/wakeup-real.php index a263bf0..2267a4e 100644 --- a/api/wakeup-real.php +++ b/api/wakeup-real.php @@ -1,11 +1,11 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); global $_PROFILE; -$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true)["members"]; -$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true)["members"]; +$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/fronters.json"), true)["members"]; +$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"]; $pony = "somepony"; if ($_PROFILE['login'] === "raindrops") $pony = $frontRaindrops[0]["display_name"]; else $pony = $frontCloudburst[0]["display_name"]; diff --git a/api/wakeup.php b/api/wakeup.php index 7eb96c3..69b0a68 100644 --- a/api/wakeup.php +++ b/api/wakeup.php @@ -1,11 +1,11 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); global $_PROFILE; -$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true)["members"]; -$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true)["members"]; +$frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/fronters.json"), true)["members"]; +$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"]; $pony = "somepony"; if ($_PROFILE['login'] === "raindrops") $pony = $frontRaindrops[0]["display_name"]; else $pony = $frontCloudburst[0]["display_name"]; @@ -16,20 +16,20 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { header("Location: /?error=File not found") and die(); } } elseif ($toplevel === "") { - require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/home.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/home.inc"; } else { if ($toplevel === "-") { $pagename = substr($pagename, 2); $toplevel = explode("/", $pagename)[0]; - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".php")) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".php"; + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { + require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; } else { header("Location: /?error=Page not found: " . strip_tags($pagename)) and die(); } } else if ($toplevel === "api") { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".php")) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".php"; + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { + require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; } } else if ($toplevel === "cloudburst" || $toplevel === "raindrops") { $parts = explode("/", $_GET['_']); @@ -48,23 +48,23 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { die(); } - require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/page.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc"; } else { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".php")) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { header("Location: /-/" . $toplevel); } else { $namesCloudburst = [...array_map(function ($i) { return $i['name']; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true)), "unknown-cb"]; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true)), "unknown-cb"]; $namesRaindrops = [...array_map(function ($i) { return $i['name']; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true)), "unknown-rd"]; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)), "unknown-rd"]; if ((in_array($toplevel, $namesCloudburst) || in_array($toplevel, $namesRaindrops)) && $toplevel !== "unknown") { - require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/page.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc"; } else { global $toplevel; - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/short.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/short.inc"; } } } diff --git a/app/banner.js b/app/banner.js index 6815de1..a3e6173 100644 --- a/app/banner.js +++ b/app/banner.js @@ -183,20 +183,20 @@ async function refreshBanner(offline, french) { <span> <b>${french ? (data['relations']['marefriends'].length > 1 ? 'Partenaires ' : 'Partenaire ') : `Marefriend${data['relations']['marefriends'].length > 1 ? 's' : ''}`}: </b>${data['relations']['marefriends'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} ${data['relations']['marefriends'].map(relation => ` - <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `/assets/uploads/${relation['icon']}`}" style="width:24px;"></a>`).join(``)} + <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `${relation['icon']}`}" style="width:24px;"></a>`).join(``)} ${data['relations']['marefriends'].length === 0 ? '-' : ''} </span> <span> <b>${french ? (data['relations']['sisters'].length > 1 ? 'Sœurs ' : 'Sœur ') : `Sister${data['relations']['sisters'].length > 1 ? 's' : ''}`}: </b>${data['relations']['sisters'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} ${data['relations']['sisters'].map(relation => ` - <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `/assets/uploads/${relation['icon']}`}" style="width:24px;"></a>`).join(``)} + <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `${relation['icon']}`}" style="width:24px;"></a>`).join(``)} ${data['relations']['sisters'].length === 0 ? '-' : ''} </span> ${data['little'] ? ` <span> <b>${french ? (data['relations']['sisters'].length > 1 ? 'Caretakers ' : 'Caretaker ') : `Caretaker${data['relations']['caretakers'].length > 1 ? 's' : ''}`}: </b>${data['relations']['caretakers'].length > 1 ? '<span class="list-separator-mobile"><br></span>' : ''} ${data['relations']['caretakers'].map(relation => ` - <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `/assets/uploads/${relation['icon']}`}" style="width:24px;"></a>`).join(``)} + <a title="${relation['name']}" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="${relation['link']}"><img src="${offline ? relation['icon_offline'] : `${relation['icon']}`}" style="width:24px;"></a>`).join(``)} ${data['relations']['caretakers'].length === 0 ? '-' : ''} </span> ` : ''} diff --git a/app/bits/assets/graph.js b/app/bits/assets/graph.js index 908c2e9..0503b99 100755 --- a/app/bits/assets/graph.js +++ b/app/bits/assets/graph.js @@ -25,14 +25,9 @@ const graph = new Chart(ctx, { } }, scaleLabel: "<%=value%>%", - legend: { - display: false - }, - tooltips: { - callbacks: { - label: function(tooltipItem, data) { - return data.labels[tooltipItem.index] + ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index] + '€'; - } + plugins: { + legend: { + display: false } } } diff --git a/app/demo/index.php b/app/demo/index.php index 154f099..cd54738 100644 --- a/app/demo/index.php +++ b/app/demo/index.php @@ -1,3 +1,3 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/demo.php";
\ No newline at end of file +require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/demo.inc";
\ No newline at end of file diff --git a/app/emergency/index.php b/app/emergency/index.php index d8cfedf..c6e1436 100644 --- a/app/emergency/index.php +++ b/app/emergency/index.php @@ -1,4 +1,4 @@ -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); ?> <!DOCTYPE html> <html lang="en"> @@ -26,7 +26,7 @@ <body> <div class="container"> <br> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/emergency.php"; ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/emergency.inc"; ?> </div> </body> </html>
\ No newline at end of file diff --git a/app/fronters/ponies/auvwc.png b/app/fronters/ponies/auvwc.png Binary files differnew file mode 100644 index 0000000..c87a4f8 --- /dev/null +++ b/app/fronters/ponies/auvwc.png diff --git a/app/fronters/ponies/bbrig.png b/app/fronters/ponies/bbrig.png Binary files differnew file mode 100644 index 0000000..c5e2e3c --- /dev/null +++ b/app/fronters/ponies/bbrig.png diff --git a/app/fronters/ponies/ghrby.png b/app/fronters/ponies/ghrby.png Binary files differnew file mode 100644 index 0000000..f7fe2f8 --- /dev/null +++ b/app/fronters/ponies/ghrby.png diff --git a/app/fronters/ponies/mvaws.png b/app/fronters/ponies/mvaws.png Binary files differnew file mode 100644 index 0000000..5f51abe --- /dev/null +++ b/app/fronters/ponies/mvaws.png diff --git a/app/fronters/ponies/rirgf.png b/app/fronters/ponies/rirgf.png Binary files differindex 9f4096c..315321f 100644 --- a/app/fronters/ponies/rirgf.png +++ b/app/fronters/ponies/rirgf.png diff --git a/app/fronters/profiles/auvwc.png b/app/fronters/profiles/auvwc.png Binary files differnew file mode 100644 index 0000000..824a20f --- /dev/null +++ b/app/fronters/profiles/auvwc.png diff --git a/app/fronters/profiles/ckqsw.png b/app/fronters/profiles/ckqsw.png Binary files differindex aa8b705..c12493f 100644 --- a/app/fronters/profiles/ckqsw.png +++ b/app/fronters/profiles/ckqsw.png diff --git a/app/fronters/profiles/cmeyc.png b/app/fronters/profiles/cmeyc.png Binary files differnew file mode 100644 index 0000000..b13c2b1 --- /dev/null +++ b/app/fronters/profiles/cmeyc.png diff --git a/app/fronters/profiles/dogwu.png b/app/fronters/profiles/dogwu.png Binary files differnew file mode 100644 index 0000000..4404e65 --- /dev/null +++ b/app/fronters/profiles/dogwu.png diff --git a/app/fronters/profiles/epvhq.png b/app/fronters/profiles/epvhq.png Binary files differnew file mode 100644 index 0000000..30b1160 --- /dev/null +++ b/app/fronters/profiles/epvhq.png diff --git a/app/fronters/profiles/erefx.png b/app/fronters/profiles/erefx.png Binary files differindex e5175fb..afdef5c 100644 --- a/app/fronters/profiles/erefx.png +++ b/app/fronters/profiles/erefx.png diff --git a/app/fronters/profiles/erknz.png b/app/fronters/profiles/erknz.png Binary files differindex 4d1f0dd..2fbea15 100644 --- a/app/fronters/profiles/erknz.png +++ b/app/fronters/profiles/erknz.png diff --git a/app/fronters/profiles/exidq.png b/app/fronters/profiles/exidq.png Binary files differnew file mode 100644 index 0000000..9b72e5a --- /dev/null +++ b/app/fronters/profiles/exidq.png diff --git a/app/fronters/profiles/ezqym.png b/app/fronters/profiles/ezqym.png Binary files differnew file mode 100644 index 0000000..36d34f6 --- /dev/null +++ b/app/fronters/profiles/ezqym.png diff --git a/app/fronters/profiles/famxl.png b/app/fronters/profiles/famxl.png Binary files differnew file mode 100644 index 0000000..9a28b13 --- /dev/null +++ b/app/fronters/profiles/famxl.png diff --git a/app/fronters/profiles/gevde.png b/app/fronters/profiles/gevde.png Binary files differindex f08887d..b000840 100644 --- a/app/fronters/profiles/gevde.png +++ b/app/fronters/profiles/gevde.png diff --git a/app/fronters/profiles/gfhsr.png b/app/fronters/profiles/gfhsr.png Binary files differindex 1d12f37..72f5a89 100644 --- a/app/fronters/profiles/gfhsr.png +++ b/app/fronters/profiles/gfhsr.png diff --git a/app/fronters/profiles/ghrby.png b/app/fronters/profiles/ghrby.png Binary files differnew file mode 100644 index 0000000..c0d75f8 --- /dev/null +++ b/app/fronters/profiles/ghrby.png diff --git a/app/fronters/profiles/ghuln.png b/app/fronters/profiles/ghuln.png Binary files differindex d975de1..3856e60 100644 --- a/app/fronters/profiles/ghuln.png +++ b/app/fronters/profiles/ghuln.png diff --git a/app/fronters/profiles/hpwyq.png b/app/fronters/profiles/hpwyq.png Binary files differindex 6014172..447f028 100644 --- a/app/fronters/profiles/hpwyq.png +++ b/app/fronters/profiles/hpwyq.png diff --git a/app/fronters/profiles/irxyh.png b/app/fronters/profiles/irxyh.png Binary files differindex ff9b84a..652a951 100644 --- a/app/fronters/profiles/irxyh.png +++ b/app/fronters/profiles/irxyh.png diff --git a/app/fronters/profiles/jhemc.png b/app/fronters/profiles/jhemc.png Binary files differnew file mode 100644 index 0000000..4c71982 --- /dev/null +++ b/app/fronters/profiles/jhemc.png diff --git a/app/fronters/profiles/jnbae.png b/app/fronters/profiles/jnbae.png Binary files differindex 67a3cc6..0a9d069 100644 --- a/app/fronters/profiles/jnbae.png +++ b/app/fronters/profiles/jnbae.png diff --git a/app/fronters/profiles/khsbb.png b/app/fronters/profiles/khsbb.png Binary files differindex 4a19d1d..27a85bd 100644 --- a/app/fronters/profiles/khsbb.png +++ b/app/fronters/profiles/khsbb.png diff --git a/app/fronters/profiles/kkhbw.png b/app/fronters/profiles/kkhbw.png Binary files differindex db09107..62ff738 100644 --- a/app/fronters/profiles/kkhbw.png +++ b/app/fronters/profiles/kkhbw.png diff --git a/app/fronters/profiles/lllfw.png b/app/fronters/profiles/lllfw.png Binary files differindex 922ae6f..c09cfc1 100644 --- a/app/fronters/profiles/lllfw.png +++ b/app/fronters/profiles/lllfw.png diff --git a/app/fronters/profiles/lzlaq.png b/app/fronters/profiles/lzlaq.png Binary files differindex 19890f3..3341acf 100644 --- a/app/fronters/profiles/lzlaq.png +++ b/app/fronters/profiles/lzlaq.png diff --git a/app/fronters/profiles/mglyq.png b/app/fronters/profiles/mglyq.png Binary files differindex 2350ce9..9258fb2 100644 --- a/app/fronters/profiles/mglyq.png +++ b/app/fronters/profiles/mglyq.png diff --git a/app/fronters/profiles/mhnqy.png b/app/fronters/profiles/mhnqy.png Binary files differindex bbc296e..fdd5963 100644 --- a/app/fronters/profiles/mhnqy.png +++ b/app/fronters/profiles/mhnqy.png diff --git a/app/fronters/profiles/mvaws.png b/app/fronters/profiles/mvaws.png Binary files differnew file mode 100644 index 0000000..6a2cc05 --- /dev/null +++ b/app/fronters/profiles/mvaws.png diff --git a/app/fronters/profiles/pabmo.png b/app/fronters/profiles/pabmo.png Binary files differindex 855989d..5bda618 100644 --- a/app/fronters/profiles/pabmo.png +++ b/app/fronters/profiles/pabmo.png diff --git a/app/fronters/profiles/ppukh.png b/app/fronters/profiles/ppukh.png Binary files differnew file mode 100644 index 0000000..a0f10cd --- /dev/null +++ b/app/fronters/profiles/ppukh.png diff --git a/app/fronters/profiles/qbzxm.png b/app/fronters/profiles/qbzxm.png Binary files differindex 59cfdaf..21fd437 100644 --- a/app/fronters/profiles/qbzxm.png +++ b/app/fronters/profiles/qbzxm.png diff --git a/app/fronters/profiles/qraku.png b/app/fronters/profiles/qraku.png Binary files differindex 0935261..67fb221 100644 --- a/app/fronters/profiles/qraku.png +++ b/app/fronters/profiles/qraku.png diff --git a/app/fronters/profiles/qzbpf.png b/app/fronters/profiles/qzbpf.png Binary files differnew file mode 100644 index 0000000..904b914 --- /dev/null +++ b/app/fronters/profiles/qzbpf.png diff --git a/app/fronters/profiles/rdstg.png b/app/fronters/profiles/rdstg.png Binary files differindex 3a28375..ac28034 100644 --- a/app/fronters/profiles/rdstg.png +++ b/app/fronters/profiles/rdstg.png diff --git a/app/fronters/profiles/rirgf.png b/app/fronters/profiles/rirgf.png Binary files differindex 3fdf039..428032d 100644 --- a/app/fronters/profiles/rirgf.png +++ b/app/fronters/profiles/rirgf.png diff --git a/app/fronters/profiles/rpjok.png b/app/fronters/profiles/rpjok.png Binary files differindex 1475d47..283cd2a 100644 --- a/app/fronters/profiles/rpjok.png +++ b/app/fronters/profiles/rpjok.png diff --git a/app/fronters/profiles/sbxze.png b/app/fronters/profiles/sbxze.png Binary files differindex 4390c22..f70ee90 100644 --- a/app/fronters/profiles/sbxze.png +++ b/app/fronters/profiles/sbxze.png diff --git a/app/fronters/profiles/sehke.png b/app/fronters/profiles/sehke.png Binary files differindex efcdf4a..ef93187 100644 --- a/app/fronters/profiles/sehke.png +++ b/app/fronters/profiles/sehke.png diff --git a/app/fronters/profiles/sjuao.png b/app/fronters/profiles/sjuao.png Binary files differnew file mode 100644 index 0000000..16a4dd5 --- /dev/null +++ b/app/fronters/profiles/sjuao.png diff --git a/app/fronters/profiles/souga.png b/app/fronters/profiles/souga.png Binary files differnew file mode 100644 index 0000000..fdde626 --- /dev/null +++ b/app/fronters/profiles/souga.png diff --git a/app/fronters/profiles/tfbob.png b/app/fronters/profiles/tfbob.png Binary files differindex a63b6e3..edf68db 100644 --- a/app/fronters/profiles/tfbob.png +++ b/app/fronters/profiles/tfbob.png diff --git a/app/fronters/profiles/tmgiu.png b/app/fronters/profiles/tmgiu.png Binary files differindex acaf6f3..bb45dc3 100644 --- a/app/fronters/profiles/tmgiu.png +++ b/app/fronters/profiles/tmgiu.png diff --git a/app/fronters/profiles/trefr.png b/app/fronters/profiles/trefr.png Binary files differnew file mode 100644 index 0000000..fec4dc3 --- /dev/null +++ b/app/fronters/profiles/trefr.png diff --git a/app/fronters/profiles/vahcl.png b/app/fronters/profiles/vahcl.png Binary files differnew file mode 100644 index 0000000..aeb7ba9 --- /dev/null +++ b/app/fronters/profiles/vahcl.png diff --git a/app/fronters/profiles/vncoa.png b/app/fronters/profiles/vncoa.png Binary files differindex ac1596f..e49a38f 100644 --- a/app/fronters/profiles/vncoa.png +++ b/app/fronters/profiles/vncoa.png diff --git a/app/fronters/profiles/vvsxf.png b/app/fronters/profiles/vvsxf.png Binary files differindex df4566d..009b060 100644 --- a/app/fronters/profiles/vvsxf.png +++ b/app/fronters/profiles/vvsxf.png diff --git a/app/fronters/profiles/wjovt.png b/app/fronters/profiles/wjovt.png Binary files differnew file mode 100644 index 0000000..8d40347 --- /dev/null +++ b/app/fronters/profiles/wjovt.png diff --git a/app/fronters/profiles/xbvwt.png b/app/fronters/profiles/xbvwt.png Binary files differindex 2b94fa8..2d76e48 100644 --- a/app/fronters/profiles/xbvwt.png +++ b/app/fronters/profiles/xbvwt.png diff --git a/app/fronters/profiles/xcjhj.png b/app/fronters/profiles/xcjhj.png Binary files differindex 02a635f..31ca4b9 100644 --- a/app/fronters/profiles/xcjhj.png +++ b/app/fronters/profiles/xcjhj.png diff --git a/app/fronters/profiles/ynpba.png b/app/fronters/profiles/ynpba.png Binary files differnew file mode 100644 index 0000000..61e9a74 --- /dev/null +++ b/app/fronters/profiles/ynpba.png diff --git a/app/fronters/profiles/zajrk.png b/app/fronters/profiles/zajrk.png Binary files differindex ebfc4d8..3f960fb 100644 --- a/app/fronters/profiles/zajrk.png +++ b/app/fronters/profiles/zajrk.png diff --git a/app/fronters/profiles/zdtsg.png b/app/fronters/profiles/zdtsg.png Binary files differindex 1c1704d..e3aff68 100644 --- a/app/fronters/profiles/zdtsg.png +++ b/app/fronters/profiles/zdtsg.png diff --git a/app/fronters/profiles/zhtzs.png b/app/fronters/profiles/zhtzs.png Binary files differindex 2af80d2..b802367 100644 --- a/app/fronters/profiles/zhtzs.png +++ b/app/fronters/profiles/zhtzs.png diff --git a/app/fronters/profiles/ztfjz.png b/app/fronters/profiles/ztfjz.png Binary files differindex cb81f5f..e604ed1 100644 --- a/app/fronters/profiles/ztfjz.png +++ b/app/fronters/profiles/ztfjz.png diff --git a/app/fronters/profiles/zzise.png b/app/fronters/profiles/zzise.png Binary files differindex d200bdf..d767964 100644 --- a/app/fronters/profiles/zzise.png +++ b/app/fronters/profiles/zzise.png diff --git a/app/fronters/script.js b/app/fronters/script.js index 6450bba..4e51b22 100755 --- a/app/fronters/script.js +++ b/app/fronters/script.js @@ -1,7 +1,7 @@ function getMiniName(name) { let parts = name.split(" "); - if (parts[0].length > 3 && !parts[0].endsWith("e") && parts[0] !== "Filly" && parts[0] !== "Windy") { + if (parts[0].length > 3 && !parts[0].endsWith("e") && parts[0] !== "Filly" && parts[0] !== "Windy" && parts[1] !== "Brightdawn") { if (parts[0].includes("/")) { return parts[0].split("/")[0]; } else { diff --git a/app/functions.js b/app/functions.js index 207bc42..4d89e30 100644 --- a/app/functions.js +++ b/app/functions.js @@ -1,9 +1,9 @@ -// Function ported from /includes/header.php (line 18) +// Function ported from /includes/header.inc (line 18) // Ported function has matched behavior. function getMiniName(name) { let parts = name.split(" "); - if (parts[0].length > 3 && !parts[0].endsWith("e") && parts[0] !== "Filly" && parts[0] !== "Windy") { + if (parts[0].length > 3 && !parts[0].endsWith("e") && parts[0] !== "Filly" && parts[0] !== "Windy" && parts[1] !== "Brightdawn") { if (parts[0].includes("/")) { return parts[0].split("/")[0]; } else { diff --git a/app/index.html b/app/index.html index 22ee9a9..e8fd5a0 100644 --- a/app/index.html +++ b/app/index.html @@ -291,7 +291,7 @@ <div style="width:100%;"> <div class="container"> <br><br> - <h2 style="text-align: center;"><img id="home-avatar" alt="" src="" style="width: 48px;height: 48px;border-radius: 999px;vertical-align: middle;"> <span style="vertical-align: middle;"><span id="home-greeting">Greetings</span> <span id="home-name">Name</span>!</span></h2> + <h2 style="text-align: center;" id="home-front"><img id="home-avatar" alt="" src="" style="width: 48px;height: 48px;border-radius: 999px;vertical-align: middle;"> <span style="vertical-align: middle;"><span id="home-greeting">Greetings</span> <span id="home-name">Name</span>!</span></h2> <br> <div id="home-apps"> @@ -313,7 +313,7 @@ </a> </div> </div> - <p style="text-align: center;margin-top:15px;"><b style="vertical-align: middle;">In the <span id="home-other-system">other system</span>:</b> <img id="home-other-img" alt="" src="" style="vertical-align:middle;width:24px;height:24px;border-radius:999px;background:#333;"> <span id="home-other-name" style="vertical-align: middle;">Some member</span></p> + <p id="home-other" style="text-align: center;margin-top:15px;"><b style="vertical-align: middle;">In the <span id="home-other-system">other system</span>:</b> <img id="home-other-img" alt="" src="" style="vertical-align:middle;width:24px;height:24px;border-radius:999px;background:#333;"> <span id="home-other-name" style="vertical-align: middle;">Some member</span></p> </div> </div> <div> diff --git a/app/load.js b/app/load.js index 1be0b57..97b030a 100644 --- a/app/load.js +++ b/app/load.js @@ -17,32 +17,32 @@ window.connected = false; let valuesToGet = { "pluralkit-cloudburst-members": { - url: "/api/data?f=ynmuc-members.json", + url: "/api/data?f=ynmuc/members.json", limited: false, name: "Members at Cloudburst...", }, "pluralkit-cloudburst-fronters": { - url: "/api/data?f=ynmuc-fronters.json", + url: "/api/data?f=ynmuc/fronters.json", limited: false, name: "Fronters at Cloudburst...", }, "pluralkit-cloudburst-switches": { - url: "/api/data?f=ynmuc-switches.json", + url: "/api/data?f=ynmuc/switches.json", limited: false, name: "Switches at Cloudburst...", }, "pluralkit-raindrops-members": { - url: "/api/data?f=gdapd-members.json", + url: "/api/data?f=gdapd/members.json", limited: false, name: "Members at Raindrops...", }, "pluralkit-raindrops-fronters": { - url: "/api/data?f=gdapd-fronters.json", + url: "/api/data?f=gdapd/fronters.json", limited: false, name: "Fronters at Raindrops...", }, "pluralkit-raindrops-switches": { - url: "/api/data?f=gdapd-switches.json", + url: "/api/data?f=gdapd/switches.json", limited: false, name: "Switches at Raindrops...", }, @@ -243,55 +243,64 @@ async function postLoad() { try { let member = window.currentFronter; await (await window.fetch("/bits/Application/SetCurrentIdentity/index.php?Name=" + btoa(member['display_name'] ?? member['name']).replaceAll("+", "-").replaceAll("/", "_") + "&Picture=" + btoa(member['avatar_url'] ?? "./assets/default.png").replaceAll("+", "-").replaceAll("/", "_"))).text(); - } catch (e) {} + } catch (e) { + try { + await (await window.fetch("/bits/Application/SetCurrentIdentity/index.php?Name=" + btoa(window.data['pluralkit-' + window.data['identity'].id + '-members'].filter(i => i.name === "unknown")[0]['display_name']).replaceAll("+", "-").replaceAll("/", "_") + "&Picture=" + btoa(window.data['pluralkit-' + window.data['identity'].id + '-members'].filter(i => i.name === "unknown")[0]['avatar_url']).replaceAll("+", "-").replaceAll("/", "_"))).text(); + } catch (e) {} + } - document.getElementById("home-name").innerText = getMiniName(window.currentFronter['display_name'] ?? window.currentFronter['name']); - document.getElementById("home-avatar").src = window.data['image-me']; - - switch (new Date().getHours()) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - document.getElementById("home-greeting").innerText = "Good night"; - break; - - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - document.getElementById("home-greeting").innerText = "Good morning"; - break; - - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - document.getElementById("home-greeting").innerText = "Good afternoon"; - break; - - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - document.getElementById("home-greeting").innerText = "Good evening"; - break; + try { + document.getElementById("home-name").innerText = getMiniName(window.currentFronter['display_name'] ?? window.currentFronter['name']); + document.getElementById("home-avatar").src = window.data['image-me']; + + switch (new Date().getHours()) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + document.getElementById("home-greeting").innerText = "Good night"; + break; + + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + document.getElementById("home-greeting").innerText = "Good morning"; + break; + + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + document.getElementById("home-greeting").innerText = "Good afternoon"; + break; + + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + document.getElementById("home-greeting").innerText = "Good evening"; + break; + } + } catch (e) { + document.getElementById("home-front").style.display = "none"; } window.otherSystem = window.data.identity.id === "raindrops" ? "cloudburst" : "raindrops"; window.otherFronters = window.data["pluralkit-" + otherSystem + "-fronters"]; document.getElementById("home-other-system").innerText = otherSystem === "raindrops" ? "Raindrops System" : "Cloudburst System"; - document.getElementById("home-other-name").innerText = window.otherFronters.members[0].display_name ?? window.otherFronters.members[0].name; - document.getElementById("home-other-img").src = window.images.profile[otherSystem === "raindrops" ? "gdapd" : "ynmuc"][window.otherFronters.members[0].id]; + if (window.otherFronters.members[0]) document.getElementById("home-other-name").innerText = window.otherFronters.members[0].display_name ?? window.otherFronters.members[0].name; + if (window.otherFronters.members[0]) document.getElementById("home-other-img").src = window.images.profile[otherSystem === "raindrops" ? "gdapd" : "ynmuc"][window.otherFronters.members[0].id]; + if (!window.otherFronters.members[0]) document.getElementById("home-other").style.display = "none"; if (!window.connected) { document.getElementById("home-app-planner").classList.add("disabled"); diff --git a/app/planner/index.php b/app/planner/index.php index 775fec3..0ae3663 100644 --- a/app/planner/index.php +++ b/app/planner/index.php @@ -1,4 +1,4 @@ -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; if (!$isLoggedIn) header("Location: /-/login") and die(); ?> <!DOCTYPE html> <html lang="en"> @@ -33,13 +33,13 @@ <br> <?php - require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.php"; - require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.php"; + require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.inc"; + require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.inc"; function getMiniName(string $name) { $parts = explode(" ", $name); - if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy") { + if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy" && (isset($parts[1]) && $parts[1] !== "Brightdawn")) { if (str_contains($parts[0], "/")) { return explode("/", $parts[0])[0]; } else { @@ -53,17 +53,19 @@ function getSystemMember(string $system, string $id) { $systemID = $system; - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true); + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); $member = null; foreach ($members as $m) { if ($m["id"] === $id) $member = $m; } + $member["system"] = $member["_system"] = $system; + return $member; } - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/planner.php"; ?> + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/planner.inc"; ?> </div> </body> </html>
\ No newline at end of file @@ -57,11 +57,13 @@ let filesToCache = [ "/app/fronters/bootstrap/bootstrap.js", "/app/fronters/bootstrap/bootstrap.js.map", "/app/fronters/index.html", + "/app/fronters/ponies/auvwc.png", "/app/fronters/ponies/ckqsw.png", "/app/fronters/ponies/erefx.png", "/app/fronters/ponies/erknz.png", "/app/fronters/ponies/gevde.png", "/app/fronters/ponies/gfhsr.png", + "/app/fronters/ponies/ghrby.png", "/app/fronters/ponies/hpwyq.png", "/app/fronters/ponies/jnbae.png", "/app/fronters/ponies/khsbb.png", @@ -69,6 +71,7 @@ let filesToCache = [ "/app/fronters/ponies/lllfw.png", "/app/fronters/ponies/mglyq.png", "/app/fronters/ponies/mhnqy.png", + "/app/fronters/ponies/mvaws.png", "/app/fronters/ponies/nabky.png", "/app/fronters/ponies/pabmo.png", "/app/fronters/ponies/qbzxm.png", @@ -86,16 +89,25 @@ let filesToCache = [ "/app/fronters/ponies/zhtzs.png", "/app/fronters/ponies/ztfjz.png", "/app/fronters/ponies/zzise.png", + "/app/fronters/profiles/auvwc.png", "/app/fronters/profiles/ckqsw.png", + "/app/fronters/profiles/cmeyc.png", "/app/fronters/profiles/djnko.png", + "/app/fronters/profiles/dogwu.png", + "/app/fronters/profiles/epvhq.png", "/app/fronters/profiles/erefx.png", "/app/fronters/profiles/erknz.png", + "/app/fronters/profiles/exidq.png", + "/app/fronters/profiles/ezqym.png", + "/app/fronters/profiles/famxl.png", "/app/fronters/profiles/flukm.png", "/app/fronters/profiles/gevde.png", "/app/fronters/profiles/gfhsr.png", + "/app/fronters/profiles/ghrby.png", "/app/fronters/profiles/ghuln.png", "/app/fronters/profiles/hpwyq.png", "/app/fronters/profiles/irxyh.png", + "/app/fronters/profiles/jhemc.png", "/app/fronters/profiles/jnbae.png", "/app/fronters/profiles/khsbb.png", "/app/fronters/profiles/kkhbw.png", @@ -104,25 +116,34 @@ let filesToCache = [ "/app/fronters/profiles/lzlaq.png", "/app/fronters/profiles/mglyq.png", "/app/fronters/profiles/mhnqy.png", + "/app/fronters/profiles/mvaws.png", "/app/fronters/profiles/mxpxm.png", "/app/fronters/profiles/nabky.png", "/app/fronters/profiles/pabmo.png", + "/app/fronters/profiles/ppukh.png", "/app/fronters/profiles/qbzxm.png", "/app/fronters/profiles/qraku.png", + "/app/fronters/profiles/qzbpf.png", "/app/fronters/profiles/rdstg.png", "/app/fronters/profiles/rirgf.png", "/app/fronters/profiles/rmlbf.png", "/app/fronters/profiles/rpjok.png", "/app/fronters/profiles/sbxze.png", "/app/fronters/profiles/sehke.png", + "/app/fronters/profiles/sjuao.png", + "/app/fronters/profiles/souga.png", "/app/fronters/profiles/tfbob.png", "/app/fronters/profiles/tgxst.png", "/app/fronters/profiles/tmgiu.png", + "/app/fronters/profiles/trefr.png", + "/app/fronters/profiles/vahcl.png", "/app/fronters/profiles/vncoa.png", "/app/fronters/profiles/vvsxf.png", + "/app/fronters/profiles/wjovt.png", "/app/fronters/profiles/xbvwt.png", "/app/fronters/profiles/xcjhj.png", "/app/fronters/profiles/ybmig.png", + "/app/fronters/profiles/ynpba.png", "/app/fronters/profiles/zajrk.png", "/app/fronters/profiles/zdtsg.png", "/app/fronters/profiles/zhtzs.png", @@ -160,9 +181,11 @@ let filesToCache = [ "/assets/uploads/pt-duskrainbow.png", "/assets/uploads/pt-fluttershy.png", "/assets/uploads/pt-frostcrystals.png", - "/assets/uploads/pt-izzy.png", + "/assets/uploads/pt-izzymoonbow.png", "/assets/uploads/pt-lavender.png", + "/assets/uploads/pt-lilacbloom.png", "/assets/uploads/pt-mintygrape.png", + "/assets/uploads/pt-mistybrightdawn.png", "/assets/uploads/pt-mistycloud.png", "/assets/uploads/pt-mossystorm.png", "/assets/uploads/pt-pipppetals.png", @@ -172,20 +195,24 @@ let filesToCache = [ "/assets/uploads/pt-scootaloo.png", "/assets/uploads/pt-skydream.png", "/assets/uploads/pt-smolscoots.png", + "/assets/uploads/pt-smolsunny.png", "/assets/uploads/pt-smoltwi.png", "/assets/uploads/pt-starrynight.png", "/assets/uploads/pt-stuffie.png", "/assets/uploads/pt-sunnystarscout.png", "/assets/uploads/pt-sweetiebelle.png", "/assets/uploads/pt-sweetiebot.png", + "/assets/uploads/pt-thunder.png", "/assets/uploads/pt-twilight.png", "/assets/uploads/pt-velvet.png", "/assets/uploads/pt-violetdawn.png", "/assets/uploads/pt-windy.png", "/assets/uploads/pt-windyleaves.png", "/assets/uploads/pt-zippstorm.png", + "/assets/uploads/pt-zoomzephyrwing.png", "/assets/uploads/pt.png", "/assets/uploads/raindrops.png", + "/assets/uploads/ss-lostequestrians.png", "/assets/uploads/ss-sparkles.png" ]; diff --git a/assets/editor/chart.js b/assets/editor/chart.js new file mode 100644 index 0000000..92ce789 --- /dev/null +++ b/assets/editor/chart.js @@ -0,0 +1,13 @@ +/*! + * Chart.js v3.9.1 + * https://www.chartjs.org + * (c) 2022 Chart.js Contributors + * Released under the MIT License + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,(function(){"use strict";function t(){}const e=function(){let t=0;return function(){return t++}}();function i(t){return null==t}function s(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function n(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const o=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function a(t,e){return o(t)?t:e}function r(t,e){return void 0===t?e:t}const l=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,h=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function c(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function d(t,e,i,o){let a,r,l;if(s(t))if(r=t.length,o)for(a=r-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;a<r;a++)e.call(i,t[a],a);else if(n(t))for(l=Object.keys(t),r=l.length,a=0;a<r;a++)e.call(i,t[l[a]],l[a])}function u(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function f(t){if(s(t))return t.map(f);if(n(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=f(t[i[n]]);return e}return t}function g(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function p(t,e,i,s){if(!g(t))return;const o=e[t],a=i[t];n(o)&&n(a)?m(o,a,s):e[t]=f(a)}function m(t,e,i){const o=s(e)?e:[e],a=o.length;if(!n(t))return t;const r=(i=i||{}).merger||p;for(let s=0;s<a;++s){if(!n(e=o[s]))continue;const a=Object.keys(e);for(let s=0,n=a.length;s<n;++s)r(a[s],t,e,i)}return t}function b(t,e){return m(t,e,{merger:x})}function x(t,e,i){if(!g(t))return;const s=e[t],o=i[t];n(s)&&n(o)?b(s,o):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=f(o))}const _={"":t=>t,x:t=>t.x,y:t=>t.y};function y(t,e){const i=_[e]||(_[e]=function(t){const e=v(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function v(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}function w(t){return t.charAt(0).toUpperCase()+t.slice(1)}const M=t=>void 0!==t,k=t=>"function"==typeof t,S=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function P(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const D=Math.PI,O=2*D,C=O+D,A=Number.POSITIVE_INFINITY,T=D/180,L=D/2,E=D/4,R=2*D/3,I=Math.log10,z=Math.sign;function F(t){const e=Math.round(t);t=N(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(I(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function V(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s==0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}function B(t){return!isNaN(parseFloat(t))&&isFinite(t)}function N(t,e,i){return Math.abs(t-e)<i}function W(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function j(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function H(t){return t*(D/180)}function $(t){return t*(180/D)}function Y(t){if(!o(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function U(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*D&&(o+=O),{angle:o,distance:n}}function X(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function q(t,e){return(t-e+C)%O-D}function K(t){return(t%O+O)%O}function G(t,e,i,s){const n=K(t),o=K(e),a=K(i),r=K(o-n),l=K(a-n),h=K(n-o),c=K(n-a);return n===o||n===a||s&&o===a||r>l&&h<c}function Z(t,e,i){return Math.max(e,Math.min(i,t))}function J(t){return Z(t,-32768,32767)}function Q(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function tt(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const et=(t,e,i,s)=>tt(t,i,s?s=>t[s][e]<=i:s=>t[s][e]<i),it=(t,e,i)=>tt(t,i,(s=>t[s][e]>=i));function st(t,e,i){let s=0,n=t.length;for(;s<n&&t[s]<e;)s++;for(;n>s&&t[n-1]>i;)n--;return s>0||n<t.length?t.slice(s,n):t}const nt=["push","pop","shift","splice","unshift"];function ot(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),nt.forEach((e=>{const i="_onData"+w(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[i]&&t[i](...e)})),n}})})))}function at(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(nt.forEach((e=>{delete t[e]})),delete t._chartjs)}function rt(t){const e=new Set;let i,s;for(i=0,s=t.length;i<s;++i)e.add(t[i]);return e.size===s?t:Array.from(e)}const lt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function ht(t,e,i){const s=i||(t=>Array.prototype.slice.call(t));let n=!1,o=[];return function(...i){o=s(i),n||(n=!0,lt.call(window,(()=>{n=!1,t.apply(e,o)})))}}function ct(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const dt=t=>"start"===t?"left":"end"===t?"right":"center",ut=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,ft=(t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e;function gt(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:a,_parsed:r}=t,l=a.axis,{min:h,max:c,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(n=Z(Math.min(et(r,a.axis,h).lo,i?s:et(e,l,a.getPixelForValue(h)).lo),0,s-1)),o=u?Z(Math.max(et(r,a.axis,c,!0).hi+1,i?0:et(e,l,a.getPixelForValue(c),!0).hi+1),n,s)-n:s-n}return{start:n,count:o}}function pt(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}var mt=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=lt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}; + /*! + * @kurkle/color v0.2.1 + * https://github.com/kurkle/color#readme + * (c) 2022 Jukka Kurkela + * Released under the MIT License + */function bt(t){return t+.5|0}const xt=(t,e,i)=>Math.max(Math.min(t,i),e);function _t(t){return xt(bt(2.55*t),0,255)}function yt(t){return xt(bt(255*t),0,255)}function vt(t){return xt(bt(t/2.55)/100,0,1)}function wt(t){return xt(bt(100*t),0,100)}const Mt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},kt=[..."0123456789ABCDEF"],St=t=>kt[15&t],Pt=t=>kt[(240&t)>>4]+kt[15&t],Dt=t=>(240&t)>>4==(15&t);function Ot(t){var e=(t=>Dt(t.r)&&Dt(t.g)&&Dt(t.b)&&Dt(t.a))(t)?St:Pt;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const Ct=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function At(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function Tt(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function Lt(t,e,i){const s=At(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function Et(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,h,n),r=60*r+.5),[0|r,l||0,a]}function Rt(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(yt)}function It(t,e,i){return Rt(At,t,e,i)}function zt(t){return(t%360+360)%360}function Ft(t){const e=Ct.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?_t(+e[5]):yt(+e[5]));const n=zt(+e[2]),o=+e[3]/100,a=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Rt(Lt,t,e,i)}(n,o,a):"hsv"===e[1]?function(t,e,i){return Rt(Tt,t,e,i)}(n,o,a):It(n,o,a),{r:i[0],g:i[1],b:i[2],a:s}}const Vt={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Bt={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let Nt;function Wt(t){Nt||(Nt=function(){const t={},e=Object.keys(Bt),i=Object.keys(Vt);let s,n,o,a,r;for(s=0;s<e.length;s++){for(a=r=e[s],n=0;n<i.length;n++)o=i[n],r=r.replace(o,Vt[o]);o=parseInt(Bt[a],16),t[r]=[o>>16&255,o>>8&255,255&o]}return t}(),Nt.transparent=[0,0,0,0]);const e=Nt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const jt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const Ht=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,$t=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Yt(t,e,i){if(t){let s=Et(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=It(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function Ut(t,e){return t?Object.assign(e||{},t):t}function Xt(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=yt(t[3]))):(e=Ut(t,{r:0,g:0,b:0,a:1})).a=yt(e.a),e}function qt(t){return"r"===t.charAt(0)?function(t){const e=jt.exec(t);let i,s,n,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?_t(t):xt(255*t,0,255)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?_t(i):xt(i,0,255)),s=255&(e[4]?_t(s):xt(s,0,255)),n=255&(e[6]?_t(n):xt(n,0,255)),{r:i,g:s,b:n,a:o}}}(t):Ft(t)}class Kt{constructor(t){if(t instanceof Kt)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=Xt(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*Mt[s[1]],g:255&17*Mt[s[2]],b:255&17*Mt[s[3]],a:5===o?17*Mt[s[4]]:255}:7!==o&&9!==o||(n={r:Mt[s[1]]<<4|Mt[s[2]],g:Mt[s[3]]<<4|Mt[s[4]],b:Mt[s[5]]<<4|Mt[s[6]],a:9===o?Mt[s[7]]<<4|Mt[s[8]]:255})),i=n||Wt(t)||qt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ut(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Xt(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?Ot(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=Et(t),i=e[0],s=wt(e[1]),n=wt(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${vt(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,l=((a*r==-1?a:(a+r)/(1+a*r))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=$t(vt(t.r)),n=$t(vt(t.g)),o=$t(vt(t.b));return{r:yt(Ht(s+i*($t(vt(e.r))-s))),g:yt(Ht(n+i*($t(vt(e.g))-n))),b:yt(Ht(o+i*($t(vt(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Kt(this.rgb)}alpha(t){return this._rgb.a=yt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=bt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Yt(this._rgb,2,t),this}darken(t){return Yt(this._rgb,2,-t),this}saturate(t){return Yt(this._rgb,1,t),this}desaturate(t){return Yt(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Et(t);i[0]=zt(i[0]+e),i=It(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function Gt(t){return new Kt(t)}function Zt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Jt(t){return Zt(t)?t:Gt(t)}function Qt(t){return Zt(t)?t:Gt(t).saturate(.5).darken(.1).hexString()}const te=Object.create(null),ee=Object.create(null);function ie(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;e<s;++e){const s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function se(t,e,i){return"string"==typeof e?m(ie(t,e),i):m(ie(t,""),e)}var ne=new class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Qt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Qt(e.borderColor),this.hoverColor=(t,e)=>Qt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return se(this,t,e)}get(t){return ie(this,t)}describe(t,e){return se(ee,t,e)}override(t,e){return se(te,t,e)}route(t,e,i,s){const o=ie(this,t),a=ie(this,i),l="_"+e;Object.defineProperties(o,{[l]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[l],e=a[s];return n(t)?Object.assign({},e,t):r(t,e)},set(t){this[l]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function oe(){return"undefined"!=typeof window&&"undefined"!=typeof document}function ae(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function re(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const le=t=>window.getComputedStyle(t,null);function he(t,e){return le(t).getPropertyValue(e)}const ce=["top","right","bottom","left"];function de(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=ce[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function ue(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=le(i),o="border-box"===n.boxSizing,a=de(n,"padding"),r=de(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,l=!0}return{x:a,y:r,box:l}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:g}=e;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/g*i.height/s)}}const fe=t=>Math.round(10*t)/10;function ge(t,e,i,s){const n=le(t),o=de(n,"margin"),a=re(n.maxWidth,t,"clientWidth")||A,r=re(n.maxHeight,t,"clientHeight")||A,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=ae(t);if(o){const t=o.getBoundingClientRect(),a=le(o),r=de(a,"border","width"),l=de(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=re(a.maxWidth,o,"clientWidth"),n=re(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||A,maxHeight:n||A}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=de(n,"border","width"),e=de(n,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-o.width),c=Math.max(0,s?Math.floor(h/s):c-o.height),h=fe(Math.min(h,a,l.maxWidth)),c=fe(Math.min(c,r,l.maxHeight)),h&&!c&&(c=fe(h/2)),{width:h,height:c}}function pe(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=n/s,t.width=o/s;const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const me=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function be(t,e){const i=he(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function xe(t){return!t||i(t.size)||i(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function _e(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function ye(t,e,i,n){let o=(n=n||{}).data=n.data||{},a=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(o=n.data={},a=n.garbageCollect=[],n.font=e),t.save(),t.font=e;let r=0;const l=i.length;let h,c,d,u,f;for(h=0;h<l;h++)if(u=i[h],null!=u&&!0!==s(u))r=_e(t,o,a,r,u);else if(s(u))for(c=0,d=u.length;c<d;c++)f=u[c],null==f||s(f)||(r=_e(t,o,a,r,f));t.restore();const g=a.length/2;if(g>i.length){for(h=0;h<g;h++)delete o[a[h]];a.splice(0,g)}return r}function ve(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function we(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function Me(t,e,i,s){ke(t,e,i,s,null)}function ke(t,e,i,s,n){let o,a,r,l,h,c;const d=e.pointStyle,u=e.rotation,f=e.radius;let g=(u||0)*T;if(d&&"object"==typeof d&&(o=d.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(g),t.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),void t.restore();if(!(isNaN(f)||f<=0)){switch(t.beginPath(),d){default:n?t.ellipse(i,s,n/2,f,0,0,O):t.arc(i,s,f,0,O),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(g)*f,s-Math.cos(g)*f),g+=R,t.lineTo(i+Math.sin(g)*f,s-Math.cos(g)*f),g+=R,t.lineTo(i+Math.sin(g)*f,s-Math.cos(g)*f),t.closePath();break;case"rectRounded":h=.516*f,l=f-h,a=Math.cos(g+E)*l,r=Math.sin(g+E)*l,t.arc(i-a,s-r,h,g-D,g-L),t.arc(i+r,s-a,h,g-L,g),t.arc(i+a,s+r,h,g,g+L),t.arc(i-r,s+a,h,g+L,g+D),t.closePath();break;case"rect":if(!u){l=Math.SQRT1_2*f,c=n?n/2:l,t.rect(i-c,s-l,2*c,2*l);break}g+=E;case"rectRot":a=Math.cos(g)*f,r=Math.sin(g)*f,t.moveTo(i-a,s-r),t.lineTo(i+r,s-a),t.lineTo(i+a,s+r),t.lineTo(i-r,s+a),t.closePath();break;case"crossRot":g+=E;case"cross":a=Math.cos(g)*f,r=Math.sin(g)*f,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r),t.moveTo(i+r,s-a),t.lineTo(i-r,s+a);break;case"star":a=Math.cos(g)*f,r=Math.sin(g)*f,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r),t.moveTo(i+r,s-a),t.lineTo(i-r,s+a),g+=E,a=Math.cos(g)*f,r=Math.sin(g)*f,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r),t.moveTo(i+r,s-a),t.lineTo(i-r,s+a);break;case"line":a=n?n/2:Math.cos(g)*f,r=Math.sin(g)*f,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(g)*f,s+Math.sin(g)*f)}t.fill(),e.borderWidth>0&&t.stroke()}}function Se(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Pe(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function De(t){t.restore()}function Oe(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Ce(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function Ae(t,e,n,o,a,r={}){const l=s(e)?e:[e],h=r.strokeWidth>0&&""!==r.strokeColor;let c,d;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);i(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,r),c=0;c<l.length;++c)d=l[c],h&&(r.strokeColor&&(t.strokeStyle=r.strokeColor),i(r.strokeWidth)||(t.lineWidth=r.strokeWidth),t.strokeText(d,n,o,r.maxWidth)),t.fillText(d,n,o,r.maxWidth),Te(t,n,o,d,r),o+=a.lineHeight;t.restore()}function Te(t,e,i,s,n){if(n.strikethrough||n.underline){const o=t.measureText(s),a=e-o.actualBoundingBoxLeft,r=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(a,c),t.lineTo(r,c),t.stroke()}}function Le(t,e){const{x:i,y:s,w:n,h:o,radius:a}=e;t.arc(i+a.topLeft,s+a.topLeft,a.topLeft,-L,D,!0),t.lineTo(i,s+o-a.bottomLeft),t.arc(i+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,D,L,!0),t.lineTo(i+n-a.bottomRight,s+o),t.arc(i+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,L,0,!0),t.lineTo(i+n,s+a.topRight),t.arc(i+n-a.topRight,s+a.topRight,a.topRight,0,-L,!0),t.lineTo(i+a.topLeft,s)}function Ee(t,e=[""],i=t,s,n=(()=>t[0])){M(s)||(s=$e("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:s,_getTarget:n,override:n=>Ee([n,...t],e,i,s)};return new Proxy(o,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>Ve(i,s,(()=>function(t,e,i,s){let n;for(const o of e)if(n=$e(ze(o,t),i),M(n))return Fe(t,n)?je(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Ye(t).includes(e),ownKeys:t=>Ye(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function Re(t,e,i,o){const a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ie(t,o),setContext:e=>Re(t,e,i,o),override:s=>Re(t.override(s),e,i,o)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Ve(t,e,(()=>function(t,e,i){const{_proxy:o,_context:a,_subProxy:r,_descriptors:l}=t;let h=o[e];k(h)&&l.isScriptable(e)&&(h=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t),e=e(o,a||s),r.delete(t),Fe(t,e)&&(e=je(n._scopes,n,t,e));return e}(e,h,t,i));s(h)&&h.length&&(h=function(t,e,i,s){const{_proxy:o,_context:a,_subProxy:r,_descriptors:l}=i;if(M(a.index)&&s(t))e=e[a.index%e.length];else if(n(e[0])){const i=e,s=o._scopes.filter((t=>t!==i));e=[];for(const n of i){const i=je(s,o,t,n);e.push(Re(i,a,r&&r[t],l))}}return e}(e,h,t,l.isIndexable));Fe(e,h)&&(h=Re(h,a,r&&r[e],l));return h}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function Ie(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:k(i)?i:()=>i,isIndexable:k(s)?s:()=>s}}const ze=(t,e)=>t?t+w(e):e,Fe=(t,e)=>n(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ve(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const s=i();return t[e]=s,s}function Be(t,e,i){return k(t)?t(e,i):t}const Ne=(t,e)=>!0===t?e:"string"==typeof t?y(e,t):void 0;function We(t,e,i,s,n){for(const o of e){const e=Ne(i,o);if(e){t.add(e);const o=Be(e._fallback,i,n);if(M(o)&&o!==i&&o!==s)return o}else if(!1===e&&M(s)&&i!==s)return null}return!1}function je(t,e,i,o){const a=e._rootScopes,r=Be(e._fallback,i,o),l=[...t,...a],h=new Set;h.add(o);let c=He(h,l,i,r||i,o);return null!==c&&((!M(r)||r===i||(c=He(h,l,r,c,o),null!==c))&&Ee(Array.from(h),[""],a,r,(()=>function(t,e,i){const o=t._getTarget();e in o||(o[e]={});const a=o[e];if(s(a)&&n(i))return i;return a}(e,i,o))))}function He(t,e,i,s,n){for(;i;)i=We(t,e,i,s,n);return i}function $e(t,e){for(const i of e){if(!i)continue;const e=i[t];if(M(e))return e}}function Ye(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function Ue(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={r:n.parse(y(c,o),h)};return a}const Xe=Number.EPSILON||1e-14,qe=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ke=t=>"x"===t?"y":"x";function Ge(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=X(o,n),l=X(a,o);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function Ze(t,e="x"){const i=Ke(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,l,h=qe(t,0);for(a=0;a<s;++a)if(r=l,l=h,h=qe(t,a+1),l){if(h){const t=h[e]-l[e];n[a]=0!==t?(h[i]-l[i])/t:0}o[a]=r?h?z(n[a-1])!==z(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}!function(t,e,i){const s=t.length;let n,o,a,r,l,h=qe(t,0);for(let c=0;c<s-1;++c)l=h,h=qe(t,c+1),l&&h&&(N(e[c],0,Xe)?i[c]=i[c+1]=0:(n=i[c]/e[c],o=i[c+1]/e[c],r=Math.pow(n,2)+Math.pow(o,2),r<=9||(a=3/Math.sqrt(r),i[c]=n*a*e[c],i[c+1]=o*a*e[c])))}(t,n,o),function(t,e,i="x"){const s=Ke(i),n=t.length;let o,a,r,l=qe(t,0);for(let h=0;h<n;++h){if(a=r,r=l,l=qe(t,h+1),!r)continue;const n=r[i],c=r[s];a&&(o=(n-a[i])/3,r[`cp1${i}`]=n-o,r[`cp1${s}`]=c-o*e[h]),l&&(o=(l[i]-n)/3,r[`cp2${i}`]=n+o,r[`cp2${s}`]=c+o*e[h])}}(t,o,e)}function Je(t,e,i){return Math.max(Math.min(t,i),e)}function Qe(t,e,i,s,n){let o,a,r,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)Ze(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)r=t[o],l=Ge(i,r,t[Math.min(o+1,a-(s?0:1))%a],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&function(t,e){let i,s,n,o,a,r=Se(t[0],e);for(i=0,s=t.length;i<s;++i)a=o,o=r,r=i<s-1&&Se(t[i+1],e),o&&(n=t[i],a&&(n.cp1x=Je(n.cp1x,e.left,e.right),n.cp1y=Je(n.cp1y,e.top,e.bottom)),r&&(n.cp2x=Je(n.cp2x,e.left,e.right),n.cp2y=Je(n.cp2y,e.top,e.bottom)))}(t,i)}const ti=t=>0===t||1===t,ei=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*O/i),ii=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*O/i)+1,si={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*L),easeOutSine:t=>Math.sin(t*L),easeInOutSine:t=>-.5*(Math.cos(D*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ti(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ti(t)?t:ei(t,.075,.3),easeOutElastic:t=>ti(t)?t:ii(t,.075,.3),easeInOutElastic(t){const e=.1125;return ti(t)?t:t<.5?.5*ei(2*t,e,.45):.5+.5*ii(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-si.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*si.easeInBounce(2*t):.5*si.easeOutBounce(2*t-1)+.5};function ni(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function oi(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function ai(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=ni(t,n,i),r=ni(n,o,i),l=ni(o,e,i),h=ni(a,r,i),c=ni(r,l,i);return ni(h,c,i)}const ri=new Map;function li(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=ri.get(i);return s||(s=new Intl.NumberFormat(t,e),ri.set(i,s)),s}(e,i).format(t)}const hi=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),ci=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function di(t,e){const i=(""+t).match(hi);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function ui(t,e){const i={},s=n(e),o=s?Object.keys(e):e,a=n(t)?s?i=>r(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of o)i[t]=+a(t)||0;return i}function fi(t){return ui(t,{top:"y",right:"x",bottom:"y",left:"x"})}function gi(t){return ui(t,["topLeft","topRight","bottomLeft","bottomRight"])}function pi(t){const e=fi(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function mi(t,e){t=t||{},e=e||ne.font;let i=r(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=r(t.style,e.style);s&&!(""+s).match(ci)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const n={family:r(t.family,e.family),lineHeight:di(r(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:r(t.weight,e.weight),string:""};return n.string=xe(n),n}function bi(t,e,i,n){let o,a,r,l=!0;for(o=0,a=t.length;o<a;++o)if(r=t[o],void 0!==r&&(void 0!==e&&"function"==typeof r&&(r=r(e),l=!1),void 0!==i&&s(r)&&(r=r[i%r.length],l=!1),void 0!==r))return n&&!l&&(n.cacheable=!1),r}function xi(t,e,i){const{min:s,max:n}=t,o=h(e,(n-s)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function _i(t,e){return Object.assign(Object.create(t),e)}function yi(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function vi(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function wi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Mi(t){return"angle"===t?{between:G,compare:q,normalize:K}:{between:Q,compare:(t,e)=>t-e,normalize:t=>t}}function ki({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function Si(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:l,normalize:h}=Mi(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=Mi(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;h<c&&a(r(e[d%l][s]),n,o);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}(t,e,i),g=[];let p,m,b,x=!1,_=null;const y=()=>x||l(n,b,p)&&0!==r(n,b),v=()=>!x||0===r(o,p)||l(o,b,p);for(let t=c,i=c;t<=d;++t)m=e[t%a],m.skip||(p=h(m[s]),p!==b&&(x=l(p,n,o),null===_&&y()&&(_=0===r(p,n)?t:i),null!==_&&v()&&(g.push(ki({start:_,end:t,loop:u,count:a,style:f})),_=null),i=t,b=p));return null!==_&&g.push(ki({start:_,end:d,loop:u,count:a,style:f})),g}function Pi(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const o=Si(s[n],t.points,e);o.length&&i.push(...o)}return i}function Di(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:a,end:r}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);if(!0===s)return Oi(t,[{start:a,end:r,loop:o}],i,e);return Oi(t,function(t,e,i,s){const n=t.length,o=[];let a,r=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:e%n,end:(a-1)%n,loop:s}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}return null!==r&&o.push({start:e%n,end:r%n,loop:s}),o}(i,a,r<a?r+n:r,!!t._fullLoop&&0===a&&r===n-1),i,e)}function Oi(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=Ci(t.options),{_datasetIndex:a,options:{spanGaps:r}}=t,l=i.length,h=[];let c=o,d=e[0].start,u=d;function f(t,e,s,n){const o=r?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:s,style:n}),c=n,d=e%l)}}for(const t of e){d=r?d:t.start;let e,o=i[d%l];for(u=d+1;u<=t.end;u++){const r=i[u%l];e=Ci(s.setContext(_i(n,{type:"segment",p0:o,p1:r,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Ai(e,c)&&f(d,u-1,t.loop,c),o=r,c=e}d<u-1&&f(d,u-1,t.loop,c)}return h}(t,e,i,s):e}function Ci(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Ai(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var Ti=Object.freeze({__proto__:null,easingEffects:si,isPatternOrGradient:Zt,color:Jt,getHoverColor:Qt,noop:t,uid:e,isNullOrUndef:i,isArray:s,isObject:n,isFinite:o,finiteOrDefault:a,valueOrDefault:r,toPercentage:l,toDimension:h,callback:c,each:d,_elementsEqual:u,clone:f,_merger:p,merge:m,mergeIf:b,_mergerIf:x,_deprecated:function(t,e,i,s){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+s+'" instead')},resolveObjectKey:y,_splitKey:v,_capitalize:w,defined:M,isFunction:k,setsEqual:S,_isClickEvent:P,toFontString:xe,_measureText:_e,_longestText:ye,_alignPixel:ve,clearCanvas:we,drawPoint:Me,drawPointLegend:ke,_isPointInArea:Se,clipArea:Pe,unclipArea:De,_steppedLineTo:Oe,_bezierCurveTo:Ce,renderText:Ae,addRoundedRectPath:Le,_lookup:tt,_lookupByKey:et,_rlookupByKey:it,_filterBetween:st,listenArrayEvents:ot,unlistenArrayEvents:at,_arrayUnique:rt,_createResolver:Ee,_attachContext:Re,_descriptors:Ie,_parseObjectDataRadialScale:Ue,splineCurve:Ge,splineCurveMonotone:Ze,_updateBezierControlPoints:Qe,_isDomSupported:oe,_getParentNode:ae,getStyle:he,getRelativePosition:ue,getMaximumSize:ge,retinaScale:pe,supportsEventListenerOptions:me,readUsedSize:be,fontString:function(t,e,i){return e+" "+t+"px "+i},requestAnimFrame:lt,throttled:ht,debounce:ct,_toLeftRightCenter:dt,_alignStartEnd:ut,_textX:ft,_getStartAndCountOfVisiblePoints:gt,_scaleRangesChanged:pt,_pointInLine:ni,_steppedInterpolation:oi,_bezierInterpolation:ai,formatNumber:li,toLineHeight:di,_readValueToProps:ui,toTRBL:fi,toTRBLCorners:gi,toPadding:pi,toFont:mi,resolve:bi,_addGrace:xi,createContext:_i,PI:D,TAU:O,PITAU:C,INFINITY:A,RAD_PER_DEG:T,HALF_PI:L,QUARTER_PI:E,TWO_THIRDS_PI:R,log10:I,sign:z,niceNum:F,_factorize:V,isNumber:B,almostEquals:N,almostWhole:W,_setMinAndMaxByKey:j,toRadians:H,toDegrees:$,_decimalPlaces:Y,getAngleFromPoint:U,distanceBetweenPoints:X,_angleDiff:q,_normalizeAngle:K,_angleBetween:G,_limitValue:Z,_int16Range:J,_isBetween:Q,getRtlAdapter:yi,overrideTextDirection:vi,restoreTextDirection:wi,_boundSegment:Si,_boundSegments:Pi,_computeSegments:Di});function Li(t,e,i,s){const{controller:n,data:o,_sorted:a}=t,r=n._cachedMeta.iScale;if(r&&e===r.axis&&"r"!==e&&a&&o.length){const t=r._reversePixels?it:et;if(!s)return t(o,e,i);if(n._sharedOptions){const s=o[0],n="function"==typeof s.getRange&&s.getRange(e);if(n){const s=t(o,e,i-n),a=t(o,e,i+n);return{lo:s.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function Ei(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:r}=o[t],{lo:l,hi:h}=Li(o[t],e,a,n);for(let t=l;t<=h;++t){const e=r[t];e.skip||s(e,i,t)}}}function Ri(t,e,i,s,n){const o=[];if(!n&&!t.isPointInArea(e))return o;return Ei(t,i,e,(function(i,a,r){(n||Se(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&o.push({element:i,datasetIndex:a,index:r})}),!0),o}function Ii(t,e,i,s,n,o){let a=[];const r=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let l=Number.POSITIVE_INFINITY;return Ei(t,i,e,(function(i,h,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!(!!o||t.isPointInArea(u))&&!d)return;const f=r(e,u);f<l?(a=[{element:i,datasetIndex:h,index:c}],l=f):f===l&&a.push({element:i,datasetIndex:h,index:c})})),a}function zi(t,e,i,s,n,o){return o||t.isPointInArea(e)?"r"!==i||s?Ii(t,e,i,s,n,o):function(t,e,i,s){let n=[];return Ei(t,i,e,(function(t,i,o){const{startAngle:a,endAngle:r}=t.getProps(["startAngle","endAngle"],s),{angle:l}=U(t,{x:e.x,y:e.y});G(l,a,r)&&n.push({element:t,datasetIndex:i,index:o})})),n}(t,e,i,n):[]}function Fi(t,e,i,s,n){const o=[],a="x"===i?"inXRange":"inYRange";let r=!1;return Ei(t,i,e,((t,s,l)=>{t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:l}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:o}var Vi={evaluateInteractionItems:Ei,modes:{index(t,e,i,s){const n=ue(e,t),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?Ri(t,n,o,s,a):zi(t,n,o,!1,s,a),l=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,s){const n=ue(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?Ri(t,n,o,s,a):zi(t,n,o,!1,s,a);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;t<i.length;++t)r.push({element:i[t],datasetIndex:e,index:t})}return r},point:(t,e,i,s)=>Ri(t,ue(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=ue(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;return zi(t,n,o,i.intersect,s,a)},x:(t,e,i,s)=>Fi(t,ue(e,t),"x",i.intersect,s),y:(t,e,i,s)=>Fi(t,ue(e,t),"y",i.intersect,s)}};const Bi=["left","top","right","bottom"];function Ni(t,e){return t.filter((t=>t.pos===e))}function Wi(t,e){return t.filter((t=>-1===Bi.indexOf(t.pos)&&t.box.axis===e))}function ji(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Hi(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!Bi.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o<a;++o){r=t[o];const{fullSize:a}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*s:a&&e.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:a&&e.availableHeight)}return i}function $i(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function Yi(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Ui(t,e,i,s){const{pos:o,box:a}=i,r=t.maxPadding;if(!n(o)){i.size&&(t[o]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?a.height:a.width),i.size=e.size/e.count,t[o]+=i.size}a.getPadding&&Yi(r,a.getPadding());const l=Math.max(0,e.outerWidth-$i(r,t,"left","right")),h=Math.max(0,e.outerHeight-$i(r,t,"top","bottom")),c=l!==t.w,d=h!==t.h;return t.w=l,t.h=h,i.horizontal?{same:c,other:d}:{same:d,other:c}}function Xi(t,e){const i=e.maxPadding;function s(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function qi(t,e,i,s){const n=[];let o,a,r,l,h,c;for(o=0,a=t.length,h=0;o<a;++o){r=t[o],l=r.box,l.update(r.width||e.w,r.height||e.h,Xi(r.horizontal,e));const{same:a,other:d}=Ui(e,i,r,s);h|=a&&n.length,c=c||d,l.fullSize||n.push(r)}return h&&qi(n,e,i,s)||c}function Ki(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function Gi(t,e,i,s){const n=i.padding;let{x:o,y:a}=e;for(const r of t){const t=r.box,l=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/l.weight||1;if(r.horizontal){const s=e.w*h,o=l.size||t.height;M(l.start)&&(a=l.start),t.fullSize?Ki(t,n.left,a,i.outerWidth-n.right-n.left,o):Ki(t,e.left+l.placed,a,s,o),l.start=a,l.placed+=s,a=t.bottom}else{const s=e.h*h,a=l.size||t.width;M(l.start)&&(o=l.start),t.fullSize?Ki(t,o,n.top,a,i.outerHeight-n.bottom-n.top):Ki(t,o,e.top+l.placed,a,s),l.start=o,l.placed+=s,o=t.right}}e.x=o,e.y=a}ne.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Zi={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;const n=pi(t.options.layout.padding),o=Math.max(e-n.width,0),a=Math.max(i-n.height,0),r=function(t){const e=function(t){const e=[];let i,s,n,o,a,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:a,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return e}(t),i=ji(e.filter((t=>t.box.fullSize)),!0),s=ji(Ni(e,"left"),!0),n=ji(Ni(e,"right")),o=ji(Ni(e,"top"),!0),a=ji(Ni(e,"bottom")),r=Wi(e,"x"),l=Wi(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:Ni(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}(t.boxes),l=r.vertical,h=r.horizontal;d(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),f=Object.assign({},n);Yi(f,pi(s));const g=Object.assign({maxPadding:f,w:o,h:a,x:n.left,y:n.top},n),p=Hi(l.concat(h),u);qi(r.fullSize,g,u,p),qi(l,g,u,p),qi(h,g,u,p)&&qi(l,g,u,p),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(g),Gi(r.leftAndTop,g,u,p),g.x+=g.w,g.y+=g.h,Gi(r.rightAndBottom,g,u,p),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},d(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})}))}};class Ji{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Qi extends Ji{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ts={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},es=t=>null===t||""===t;const is=!!me&&{passive:!0};function ss(t,e,i){t.canvas.removeEventListener(e,i,is)}function ns(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function os(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ns(i.addedNodes,s),e=e&&!ns(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function as(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ns(i.removedNodes,s),e=e&&!ns(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const rs=new Map;let ls=0;function hs(){const t=window.devicePixelRatio;t!==ls&&(ls=t,rs.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function cs(t,e,i){const s=t.canvas,n=s&&ae(s);if(!n)return;const o=ht(((t,e)=>{const s=n.clientWidth;i(t,e),s<n.clientWidth&&i()}),window),a=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)}));return a.observe(n),function(t,e){rs.size||window.addEventListener("resize",hs),rs.set(t,e)}(t,o),a}function ds(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){rs.delete(t),rs.size||window.removeEventListener("resize",hs)}(t)}function us(t,e,i){const s=t.canvas,n=ht((e=>{null!==t.ctx&&i(function(t,e){const i=ts[t.type]||t.type,{x:s,y:n}=ue(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,i){t.addEventListener(e,i,is)}(s,e,n),n}class fs extends Ji{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t.$chartjs={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",es(n)){const e=be(t,"width");void 0!==e&&(t.width=e)}if(es(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=be(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const s=e.$chartjs.initial;["height","width"].forEach((t=>{const n=s[t];i(n)?e.removeAttribute(t):e.setAttribute(t,n)}));const n=s.style||{};return Object.keys(n).forEach((t=>{e.style[t]=n[t]})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:os,detach:as,resize:cs}[e]||us;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:ds,detach:ds,resize:ds}[e]||ss)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return ge(t,e,i,s)}isAttached(t){const e=ae(t);return!(!e||!e.isConnected)}}function gs(t){return!oe()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Qi:fs}var ps=Object.freeze({__proto__:null,_detectPlatform:gs,BasePlatform:Ji,BasicPlatform:Qi,DomPlatform:fs});const ms="transparent",bs={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=Jt(t||ms),n=s.valid&&Jt(e||ms);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class xs{constructor(t,e,i,s){const n=e[i];s=bi([t.to,s,n,t.from]);const o=bi([t.from,n,s]);this._active=!0,this._fn=t.fn||bs[t.type||typeof o],this._easing=si[t.easing]||si.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=bi([t.to,e,s,t.from]),this._from=bi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e<i),!this._active)return this._target[s]=a,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}ne.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const _s=Object.keys(ne.animation);ne.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),ne.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),ne.describe("animations",{_fallback:"animation"}),ne.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class ys{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!n(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const o=t[i];if(!n(o))return;const a={};for(const t of _s)a[t]=o[t];(s(o.properties)&&o.properties||[i]).forEach((t=>{t!==i&&e.has(t)||e.set(t,a)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const l=o[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,a);continue}c.cancel()}d&&d.duration?(n[l]=c=new xs(d,t,l,h),s.push(c)):t[l]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(mt.add(this._chart,i),!0):void 0}}function vs(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function ws(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function Ms(t,e,i,s={}){const n=t.keys,a="single"===s.mode;let r,l,h,c;if(null!==e){for(r=0,l=n.length;r<l;++r){if(h=+n[r],h===i){if(s.all)continue;break}c=t.values[h],o(c)&&(a||0===e||z(e)===z(c))&&(e+=c)}return e}}function ks(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Ss(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function Ps(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function Ds(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:o,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=Ss(n,c,o),u[r]=d,u._top=Ps(u,a,!0,s.type),u._bottom=Ps(u,a,!1,s.type)}}function Os(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function Cs(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i]}}}const As=t=>"reset"===t||"none"===t,Ts=(t,e)=>e?t:Object.assign({},t);class Ls{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ks(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Cs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=r(i.xAxisID,Os(t,"x")),o=e.yAxisID=r(i.yAxisID,Os(t,"y")),a=e.rAxisID=r(i.rAxisID,Os(t,"r")),l=e.indexAxis,h=e.iAxisID=s(l,n,o,a),c=e.vAxisID=s(l,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&at(this._data,this),t._stacked&&Cs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(n(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let s,n,o;for(s=0,n=e.length;s<n;++s)o=e[s],i[s]={x:o,y:t[o]};return i}(e);else if(i!==e){if(i){at(i,this);const t=this._cachedMeta;Cs(t),t._parsed=[]}e&&Object.isExtensible(e)&&ot(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=ks(e.vScale,e),e.stack!==i.stack&&(s=!0,Cs(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&Ds(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:o}=this,{iScale:a,_stacked:r}=i,l=a.axis;let h,c,d,u=0===t&&e===o.length||i._sorted,f=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=o,i._sorted=!0,d=o;else{d=s(o[t])?this.parseArrayData(i,o,t,e):n(o[t])?this.parseObjectData(i,o,t,e):this.parsePrimitiveData(i,o,t,e);const a=()=>null===c[l]||f&&c[l]<f[l];for(h=0;h<e;++h)i._parsed[h+t]=c=d[h],u&&(a()&&(u=!1),f=c);i._sorted=u}r&&Ds(this,d)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,a=n.axis,r=o.axis,l=n.getLabels(),h=n===o,c=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+i,c[d]={[a]:h||n.parse(l[f],f),[r]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={x:n.parse(c[0],h),y:o.parse(c[1],h)};return a}parseObjectData(t,e,i,s){const{xScale:n,yScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)d=h+i,u=e[d],l[h]={x:n.parse(y(u,a),d),y:o.parse(y(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return Ms({keys:ws(s,!0),values:e._stacks[t.axis]},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=Ms(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,n=i._sorted&&t===i.iScale,a=s.length,r=this._getOtherScale(t),l=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:ws(i,!0),values:null})(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(r);let u,f;function g(){f=s[u];const e=f[r.axis];return!o(f[t.axis])||c>e||d<e}for(u=0;u<a&&(g()||(this.updateRangeFromParsed(h,t,f,l),!n));++u);if(n)for(u=a-1;u>=0;--u)if(!g()){this.updateRangeFromParsed(h,t,f,l);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,a;for(s=0,n=e.length;s<n;++s)a=e[s][t.axis],o(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,s,o;return n(t)?(e=t.top,i=t.right,s=t.bottom,o=t.left):e=i=s=o=t,{top:e,right:i,bottom:s,left:o,disabled:!1===t}}(r(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=vs(t,i),n=vs(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,n,a,r),h=a;h<a+r;++h){const e=s[h];e.hidden||(e.active&&l?o.push(e):e.draw(t,n))}for(h=0;h<o.length;++h)o[h].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=function(t,e,i){return _i(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return _i(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,n=this._cachedDataOpts,o=t+"-"+e,a=n[o],r=this.enableOptionSharing&&M(i);if(a)return Ts(a,r);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(ne.elements[t]),f=l.resolveNamedOptions(d,u,(()=>this.getContext(i,s)),c);return f.$shared&&(f.$shared=r,n[o]=Object.freeze(Ts(f,r))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const l=new ys(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||As(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){As(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!As(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,o=t+e;let a;const r=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;a<o;++a)n[a]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Cs(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Ls.defaults={},Ls.prototype.datasetElementType=null,Ls.prototype.dataElementType=null;class Es{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return B(this.x)&&B(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}Es.defaults={},Es.defaultRoutes=void 0;const Rs={values:t=>s(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const a=I(Math.abs(o)),r=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),li(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=t/Math.pow(10,Math.floor(I(t)));return 1===s||2===s||5===s?Rs.numeric.call(this,t,e,i):""}};var Is={formatters:Rs};function zs(t,e){const s=t.options.ticks,n=s.maxTicksLimit||function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),o=s.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],a=o.length,r=o[0],l=o[a-1],h=[];if(a>n)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===a&&(e.push(t[n]),o++,a=i[o*s])}(e,h,o,a/n),h;const c=function(t,e,i){const s=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),n=e.length/i;if(!s)return Math.max(n,1);const o=V(s);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>n)return e}return Math.max(n,1)}(o,e,n);if(a>0){let t,s;const n=a>1?Math.round((l-r)/(a-1)):null;for(Fs(e,h,c,i(n)?0:r-n,r),t=0,s=a-1;t<s;t++)Fs(e,h,c,o[t],o[t+1]);return Fs(e,h,c,l,i(n)?e.length:l+n),h}return Fs(e,h,c),h}function Fs(t,e,i,s,n){const o=r(s,0),a=Math.min(r(n,t.length),t.length);let l,h,c,d=0;for(i=Math.ceil(i),n&&(l=n-s,i=l/Math.floor(l/i)),c=o;c<0;)d++,c=Math.round(o+d*i);for(h=Math.max(o,0);h<a;h++)h===c&&(e.push(t[h]),d++,c=Math.round(o+d*i))}ne.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Is.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),ne.route("scale.ticks","color","","color"),ne.route("scale.grid","color","","borderColor"),ne.route("scale.grid","borderColor","","borderColor"),ne.route("scale.title","color","","color"),ne.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),ne.describe("scales",{_fallback:"scale"}),ne.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Vs=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Bs(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function Ns(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,a=t._endPixel,r=1e-6;let l,h=t.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-o,a-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,h+=n<e?l:-l,h<o-r||h>a+r)))return h}function Ws(t){return t.drawTicks?t.tickLength:0}function js(t,e){if(!t.display)return 0;const i=mi(t.font,e),n=pi(t.padding);return(s(t.text)?t.text.length:1)*i.lineHeight+n.height}function Hs(t,e,i){let s=dt(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class $s extends Es{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=a(t,Number.POSITIVE_INFINITY),e=a(e,Number.NEGATIVE_INFINITY),i=a(i,Number.POSITIVE_INFINITY),s=a(s,Number.NEGATIVE_INFINITY),{min:a(t,i),max:a(e,s),minDefined:o(t),maxDefined:o(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const r=this.getMatchingVisibleMetas();for(let a=0,l=r.length;a<l;++a)e=r[a].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),o||(s=Math.max(s,e.max));return i=o&&i>s?s:i,s=n&&i>s?i:s,{min:a(i,a(s,i)),max:a(s,a(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){c(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=xi(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=a<this.ticks.length;this._convertTicksToLabels(r?Bs(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=zs(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){c(this.options.afterUpdate,[this])}beforeSetDimensions(){c(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){c(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),c(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){c(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,n;for(i=0,s=t.length;i<s;i++)n=t[i],n.label=c(e.callback,[n.value,i,t],this)}afterTickToLabelConversion(){c(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){c(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=this.ticks.length,s=e.minRotation||0,n=e.maxRotation;let o,a,r,l=s;if(!this._isVisible()||!e.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=Z(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-Ws(t.grid)-e.padding-js(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=$(Math.min(Math.asin(Z((h.highest.height+6)/o,-1,1)),Math.asin(Z(a/r,-1,1))-Math.asin(Z(d/r,-1,1)))),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){c(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){c(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=js(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ws(n)+o):(t.height=this.maxHeight,t.width=Ws(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,l=H(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(a){const e=i.mirror?0:c*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:h*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,h)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){c(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,s;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,s=t.length;e<s;e++)i(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Bs(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:o}=this,a=[],r=[];let l,h,c,u,f,g,p,m,b,x,_,y=0,v=0;for(l=0;l<e;++l){if(u=t[l].label,f=this._resolveTickFontOptions(l),n.font=g=f.string,p=o[g]=o[g]||{data:{},gc:[]},m=f.lineHeight,b=x=0,i(u)||s(u)){if(s(u))for(h=0,c=u.length;h<c;++h)_=u[h],i(_)||s(_)||(b=_e(n,p.data,p.gc,b,_),x+=m)}else b=_e(n,p.data,p.gc,b,u),x=m;a.push(b),r.push(x),y=Math.max(b,y),v=Math.max(x,v)}!function(t,e){d(t,(t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}}))}(o,e);const w=a.indexOf(y),M=r.indexOf(v),k=t=>({width:a[t]||0,height:r[t]||0});return{first:k(0),last:k(e-1),widest:k(w),highest:k(M),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return J(this._alignToPixels?ve(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return _i(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=_i(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=H(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),o=t.autoSkipPadding||0,a=n?n.widest.width+o:0,r=n?n.highest.height+o:0;return this.isHorizontal()?r*i>a*s?a/i:r/s:r*s<a*i?r/i:a/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:a}=s,l=o.offset,h=this.isHorizontal(),c=this.ticks.length+(l?1:0),d=Ws(o),u=[],f=o.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,p=g/2,m=function(t){return ve(i,t,g)};let b,x,_,y,v,w,M,k,S,P,D,O;if("top"===a)b=m(this.bottom),w=this.bottom-d,k=b-p,P=m(t.top)+p,O=t.bottom;else if("bottom"===a)b=m(this.top),P=t.top,O=m(t.bottom)-p,w=b+p,k=this.top+d;else if("left"===a)b=m(this.right),v=this.right-d,M=b-p,S=m(t.left)+p,D=t.right;else if("right"===a)b=m(this.left),S=t.left,D=m(t.right)-p,v=b+p,M=this.left+d;else if("x"===e){if("center"===a)b=m((t.top+t.bottom)/2+.5);else if(n(a)){const t=Object.keys(a)[0],e=a[t];b=m(this.chart.scales[t].getPixelForValue(e))}P=t.top,O=t.bottom,w=b+p,k=w+d}else if("y"===e){if("center"===a)b=m((t.left+t.right)/2);else if(n(a)){const t=Object.keys(a)[0],e=a[t];b=m(this.chart.scales[t].getPixelForValue(e))}v=b-p,M=v-d,S=t.left,D=t.right}const C=r(s.ticks.maxTicksLimit,c),A=Math.max(1,Math.ceil(c/C));for(x=0;x<c;x+=A){const t=o.setContext(this.getContext(x)),e=t.lineWidth,s=t.color,n=t.borderDash||[],a=t.borderDashOffset,r=t.tickWidth,c=t.tickColor,d=t.tickBorderDash||[],f=t.tickBorderDashOffset;_=Ns(this,x,l),void 0!==_&&(y=ve(i,_,e),h?v=M=S=D=y:w=k=P=O=y,u.push({tx1:v,ty1:w,tx2:M,ty2:k,x1:S,y1:P,x2:D,y2:O,width:e,color:s,borderDash:n,borderDashOffset:a,tickWidth:r,tickColor:c,tickBorderDash:d,tickBorderDashOffset:f}))}return this._ticksLength=c,this._borderValue=b,u}_computeLabelItems(t){const e=this.axis,i=this.options,{position:o,ticks:a}=i,r=this.isHorizontal(),l=this.ticks,{align:h,crossAlign:c,padding:d,mirror:u}=a,f=Ws(i.grid),g=f+d,p=u?-d:g,m=-H(this.labelRotation),b=[];let x,_,y,v,w,M,k,S,P,D,O,C,A="middle";if("top"===o)M=this.bottom-p,k=this._getXAxisLabelAlignment();else if("bottom"===o)M=this.top+p,k=this._getXAxisLabelAlignment();else if("left"===o){const t=this._getYAxisLabelAlignment(f);k=t.textAlign,w=t.x}else if("right"===o){const t=this._getYAxisLabelAlignment(f);k=t.textAlign,w=t.x}else if("x"===e){if("center"===o)M=(t.top+t.bottom)/2+g;else if(n(o)){const t=Object.keys(o)[0],e=o[t];M=this.chart.scales[t].getPixelForValue(e)+g}k=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===o)w=(t.left+t.right)/2-g;else if(n(o)){const t=Object.keys(o)[0],e=o[t];w=this.chart.scales[t].getPixelForValue(e)}k=this._getYAxisLabelAlignment(f).textAlign}"y"===e&&("start"===h?A="top":"end"===h&&(A="bottom"));const T=this._getLabelSizes();for(x=0,_=l.length;x<_;++x){y=l[x],v=y.label;const t=a.setContext(this.getContext(x));S=this.getPixelForTick(x)+a.labelOffset,P=this._resolveTickFontOptions(x),D=P.lineHeight,O=s(v)?v.length:1;const e=O/2,i=t.color,n=t.textStrokeColor,h=t.textStrokeWidth;let d,f=k;if(r?(w=S,"inner"===k&&(f=x===_-1?this.options.reverse?"left":"right":0===x?this.options.reverse?"right":"left":"center"),C="top"===o?"near"===c||0!==m?-O*D+D/2:"center"===c?-T.highest.height/2-e*D+D:-T.highest.height+D/2:"near"===c||0!==m?D/2:"center"===c?T.highest.height/2-e*D:T.highest.height-O*D,u&&(C*=-1)):(M=S,C=(1-O)*D/2),t.showLabelBackdrop){const e=pi(t.backdropPadding),i=T.heights[x],s=T.widths[x];let n=M+C-e.top,o=w-e.left;switch(A){case"middle":n-=i/2;break;case"bottom":n-=i}switch(k){case"center":o-=s/2;break;case"right":o-=s}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}b.push({rotation:m,label:v,font:P,color:i,strokeColor:n,strokeWidth:h,textOffset:C,textAlign:f,textBaseline:A,translation:[w,M],backdrop:d})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-H(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,l;return"left"===e?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l+=a)):(l=this.right-o,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l-=a)):(l=this.left+o,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:i}}=this,s=i.setContext(this.getContext()),n=i.drawBorder?s.borderWidth:0;if(!n)return;const o=i.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let r,l,h,c;this.isHorizontal()?(r=ve(t,this.left,n)-n/2,l=ve(t,this.right,o)+o/2,h=c=a):(h=ve(t,this.top,n)-n/2,c=ve(t,this.bottom,o)+o/2,r=l=a),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(r,h),e.lineTo(l,c),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&Pe(e,i);const s=this._labelItems||(this._labelItems=this._computeLabelItems(t));let n,o;for(n=0,o=s.length;n<o;++n){const t=s[n],i=t.font,o=t.label;t.backdrop&&(e.fillStyle=t.backdrop.color,e.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),Ae(e,o,0,t.textOffset,i,t)}i&&De(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:o}}=this;if(!i.display)return;const a=mi(i.font),r=pi(i.padding),l=i.align;let h=a.lineHeight/2;"bottom"===e||"center"===e||n(e)?(h+=r.bottom,s(i.text)&&(h+=a.lineHeight*(i.text.length-1))):h+=r.top;const{titleX:c,titleY:d,maxWidth:u,rotation:f}=function(t,e,i,s){const{top:o,left:a,bottom:r,right:l,chart:h}=t,{chartArea:c,scales:d}=h;let u,f,g,p=0;const m=r-o,b=l-a;if(t.isHorizontal()){if(f=ut(s,a,l),n(i)){const t=Object.keys(i)[0],s=i[t];g=d[t].getPixelForValue(s)+m-e}else g="center"===i?(c.bottom+c.top)/2+m-e:Vs(t,i,e);u=l-a}else{if(n(i)){const t=Object.keys(i)[0],s=i[t];f=d[t].getPixelForValue(s)-b+e}else f="center"===i?(c.left+c.right)/2-b+e:Vs(t,i,e);g=ut(s,r,o),p="left"===i?-L:L}return{titleX:f,titleY:g,maxWidth:u,rotation:p}}(this,h,e,l);Ae(t,i.text,0,0,a,{color:i.color,maxWidth:u,rotation:f,textAlign:Hs(l,e,o),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=r(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===$s.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(t){return mi(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ys{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const s=this.items,n=t.id,o=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,e,i){const s=m(Object.create(null),[i?ne.get(i):{},ne.get(e),t.defaults]);ne.set(e,s),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),a=e[i].split("."),r=a.pop(),l=a.join(".");ne.route(o,n,l,r)}))}(e,t.defaultRoutes);t.descriptors&&ne.describe(e,t.descriptors)}(t,o,i),this.override&&ne.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in ne[s]&&(delete ne[s][i],this.override&&delete te[i])}}var Us=new class{constructor(){this.controllers=new Ys(Ls,"datasets",!0),this.elements=new Ys(Es,"elements"),this.plugins=new Ys(Object,"plugins"),this.scales=new Ys($s,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):d(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=w(t);c(i["before"+s],[],i),e[t](i),c(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}};class Xs{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===c(t[i],[e,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){i(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=r(i.options&&i.options.plugins,{}),n=function(t){const e={},i=[],s=Object.keys(Us.plugins.items);for(let t=0;t<s.length;t++)i.push(Us.getPlugin(s[t]));const n=t.plugins||[];for(let t=0;t<n.length;t++){const s=n[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==s||e?function(t,{plugins:e,localIds:i},s,n){const o=[],a=t.getContext();for(const r of e){const e=r.id,l=qs(s[e],n);null!==l&&o.push({plugin:r,options:Ks(t.config,{plugin:r,local:i[e]},l,a)})}return o}(t,n,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function qs(t,e){return e||!1!==t?!0===t?{}:t:null}function Ks(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(s,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Gs(t,e){const i=ne.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Zs(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function Js(t){const e=t.options||(t.options={});e.plugins=r(e.plugins,{}),e.scales=function(t,e){const i=te[t.type]||{scales:{}},s=e.scales||{},o=Gs(t.type,e),a=Object.create(null),r=Object.create(null);return Object.keys(s).forEach((t=>{const e=s[t];if(!n(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const l=Zs(t,e),h=function(t,e){return t===e?"_index_":"_value_"}(l,o),c=i.scales||{};a[l]=a[l]||t,r[t]=b(Object.create(null),[{axis:l},e,c[l],c[h]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,o=i.indexAxis||Gs(n,e),l=(te[n]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),n=i[e+"AxisID"]||a[e]||e;r[n]=r[n]||Object.create(null),b(r[n],[{axis:e},s[n],l[t]])}))})),Object.keys(r).forEach((t=>{const e=r[t];b(e,[ne.scales[e.type],ne.scale])})),r}(t,e)}function Qs(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const tn=new Map,en=new Set;function sn(t,e){let i=tn.get(t);return i||(i=e(),tn.set(t,i),en.add(i)),i}const nn=(t,e,i)=>{const s=y(e,i);void 0!==s&&t.add(s)};class on{constructor(t){this._config=function(t){return(t=t||{}).data=Qs(t.data),Js(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Qs(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Js(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return sn(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return sn(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return sn(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return sn(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>nn(r,t,e)))),e.forEach((t=>nn(r,s,t))),e.forEach((t=>nn(r,te[n]||{},t))),e.forEach((t=>nn(r,ne,t))),e.forEach((t=>nn(r,ee,t)))}));const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),en.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,te[e]||{},ne.datasets[e]||{},{type:e},ne,ee]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=an(this._resolverCache,t,n);let l=a;if(function(t,e){const{isScriptable:i,isIndexable:n}=Ie(t);for(const o of e){const e=i(o),a=n(o),r=(a||e)&&t[o];if(e&&(k(r)||rn(r))||a&&s(r))return!0}return!1}(a,e)){o.$shared=!1;l=Re(a,i=k(i)?i():i,this.createResolver(t,i,r))}for(const t of e)o[t]=l[t];return o}createResolver(t,e,i=[""],s){const{resolver:o}=an(this._resolverCache,t,i);return n(e)?Re(o,e,void 0,s):o}}function an(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);if(!o){o={resolver:Ee(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)}return o}const rn=t=>n(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||k(t[i])),!1);const ln=["top","bottom","left","right","chartArea"];function hn(t,e){return"top"===t||"bottom"===t||-1===ln.indexOf(t)&&"x"===e}function cn(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function dn(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),c(i&&i.onComplete,[t],e)}function un(t){const e=t.chart,i=e.options.animation;c(i&&i.onProgress,[t],e)}function fn(t){return oe()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const gn={},pn=t=>{const e=fn(t);return Object.values(gn).filter((t=>t.canvas===e)).pop()};function mn(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class bn{constructor(t,i){const s=this.config=new on(i),n=fn(t),o=pn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||gs(n)),this.platform.updateConfig(s);const r=this.platform.acquireContext(n,a.aspectRatio),l=r&&r.canvas,h=l&&l.height,c=l&&l.width;this.id=e(),this.ctx=r,this.canvas=l,this.width=c,this.height=h,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Xs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ct((t=>this.update(t)),a.resizeDelay||0),this._dataChanges=[],gn[this.id]=this,r&&l?(mt.listen(this,"complete",dn),mt.listen(this,"progress",un),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return i(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():pe(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return we(this.canvas,this.ctx),this}stop(){return mt.stop(this),this}resize(t,e){mt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,pe(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),c(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){d(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=Zs(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),d(n,(e=>{const n=e.options,o=n.id,a=Zs(o,n),l=r(n.type,e.dtype);void 0!==n.position&&hn(n.position,a)===hn(e.dposition)||(n.position=e.dposition),s[o]=!0;let h=null;if(o in i&&i[o].type===l)h=i[o];else{h=new(Us.getScale(l))({id:o,type:l,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(n,t)})),d(s,((t,e)=>{t||delete i[e]})),d(i,(t=>{Zi.configure(this,t,t.options),Zi.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(cn("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let n=this.getDatasetMeta(i);const o=s.type||this.config.type;if(n.type&&n.type!==o&&(this._destroyDatasetMeta(i),n=this.getDatasetMeta(i)),n.type=o,n.indexAxis=s.indexAxis||Gs(o,this.options),n.order=s.order||0,n.index=i,n.label=""+s.label,n.visible=this.isDatasetVisible(i),n.controller)n.controller.updateIndex(i),n.controller.linkScales();else{const e=Us.getController(o),{datasetElementType:s,dataElementType:a}=ne.datasets[o];Object.assign(e.prototype,{dataElementType:Us.getElement(a),datasetElementType:s&&Us.getElement(s)}),n.controller=new e(this,i),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){d(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!s&&-1===n.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||d(n,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(cn("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){d(this.scales,(t=>{Zi.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);S(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){mn(t,s,"_removeElements"===i?-n:n)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;t<e;t++)if(!S(s,i(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Zi.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],d(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,k(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(mt.has(this)?this.attached&&!mt.running(this)&&mt.start(this):(this.draw(),dn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=this.chartArea,o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(s&&Pe(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&De(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Se(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=Vi.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=_i(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);M(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),mt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),we(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete gn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};d(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){d(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},d(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!u(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),r=P(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,c(n.onHover,[t,a,this],this),r&&c(n.onClick,[t,a,this],this));const h=!u(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}const xn=()=>d(bn.instances,(t=>t._plugins.invalidate())),_n=!0;function yn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Object.defineProperties(bn,{defaults:{enumerable:_n,value:ne},instances:{enumerable:_n,value:gn},overrides:{enumerable:_n,value:te},registry:{enumerable:_n,value:Us},version:{enumerable:_n,value:"3.9.1"},getChart:{enumerable:_n,value:pn},register:{enumerable:_n,value:(...t)=>{Us.add(...t),xn()}},unregister:{enumerable:_n,value:(...t)=>{Us.remove(...t),xn()}}});class vn{constructor(t){this.options=t||{}}init(t){}formats(){return yn()}parse(t,e){return yn()}format(t,e){return yn()}add(t,e,i){return yn()}diff(t,e,i){return yn()}startOf(t,e,i){return yn()}endOf(t,e){return yn()}}vn.override=function(t){Object.assign(vn.prototype,t)};var wn={_date:vn};function Mn(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=rt(s.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let s,n,o,a,r=e._length;const l=()=>{32767!==o&&-32768!==o&&(M(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;s<n;++s)o=e.getPixelForValue(i[s]),l();for(a=void 0,s=0,n=e.ticks.length;s<n;++s)o=e.getPixelForTick(s),l();return r}function kn(t,e,i,n){return s(t)?function(t,e,i,s){const n=i.parse(t[0],s),o=i.parse(t[1],s),a=Math.min(n,o),r=Math.max(n,o);let l=a,h=r;Math.abs(a)>Math.abs(r)&&(l=r,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:o,min:a,max:r}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Sn(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,l=[];let h,c,d,u;for(h=i,c=i+s;h<c;++h)u=e[h],d={},d[n.axis]=r||n.parse(a[h],h),l.push(kn(u,d,o,h));return l}function Pn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Dn(t,e,i,s){let n=e.borderSkipped;const o={};if(!n)return void(t.borderSkipped=o);if(!0===n)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:r,reverse:l,top:h,bottom:c}=function(t){let e,i,s,n,o;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(n="end",o="start"):(n="start",o="end"),{start:i,end:s,reverse:e,top:n,bottom:o}}(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?n=h:(i._bottom||0)===s?n=c:(o[On(c,a,r,l)]=!0,n=h)),o[On(n,a,r,l)]=!0,t.borderSkipped=o}function On(t,e,i,s){var n,o,a;return s?(a=i,t=Cn(t=(n=t)===(o=e)?a:n===a?o:n,i,e)):t=Cn(t,e,i),t}function Cn(t,e,i){return"start"===t?e:"end"===t?i:t}function An(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class Tn extends Ls{parsePrimitiveData(t,e,i,s){return Sn(t,e,i,s)}parseArrayData(t,e,i,s){return Sn(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l="x"===n.axis?a:r,h="x"===o.axis?a:r,c=[];let d,u,f,g;for(d=i,u=i+s;d<u;++d)g=e[d],f={},f[n.axis]=n.parse(y(g,l),d),c.push(kn(y(g,h),f,o,d));return c}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,n=this.getParsed(t),o=n._custom,a=Pn(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,n){const o="reset"===n,{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),h=r.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+s;f++){const e=this.getParsed(f),s=o||i(e[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),g=this._calculateBarIndexPixels(f,c),p=(e._stacks||{})[r.axis],m={horizontal:h,base:s.base,enableBorderRadius:!p||Pn(e._custom)||a===p._top||a===p._bottom,x:h?s.head:g.center,y:h?g.center:s.head,height:h?g.size:Math.abs(s.size),width:h?Math.abs(s.size):g.size};u&&(m.options=d||this.resolveDataElementOptions(f,t[f].active?"active":n));const b=m.options||t[f].options;Dn(m,b,p,a),An(m,b,c.ratio),this.updateElement(t[f],f,m,n)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter((t=>t.controller.options.grouped)),o=s.options.stacked,a=[],r=t=>{const s=t.controller.getParsed(e),n=s&&s[t.vScale.axis];if(i(n)||isNaN(n))return!0};for(const i of n)if((void 0===e||!r(i))&&((!1===o||-1===a.indexOf(i.stack)||void 0===o&&void 0===i.stack)&&a.push(i.stack),i.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n<o;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const a=t.barThickness;return{min:a||Mn(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s},options:{base:n,minBarLength:o}}=this,a=n||0,r=this.getParsed(t),l=r._custom,h=Pn(l);let c,d,u=r[e.axis],f=0,g=s?this.applyStack(e,r,s):u;g!==u&&(f=g-u,g=u),h&&(u=l.barStart,g=l.barEnd-l.barStart,0!==u&&z(u)!==z(l.barEnd)&&(f=0),f+=u);const p=i(n)||h?f:n;let m=e.getPixelForValue(p);if(c=this.chart.getDataVisibility(t)?e.getPixelForValue(f+g):m,d=c-m,Math.abs(d)<o){d=function(t,e,i){return 0!==t?z(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(d,e,a)*o,u===a&&(m-=d/2);const t=e.getPixelForDecimal(0),i=e.getPixelForDecimal(1),s=Math.min(t,i),n=Math.max(t,i);m=Math.max(Math.min(m,n),s),c=m+d}if(m===e.getPixelForValue(a)){const t=z(d)*e.getLineWidthForValue(a)/2;m+=t,d-=t}return{size:d,base:m,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const s=e.scale,n=this.options,o=n.skipNull,a=r(n.maxBarThickness,1/0);let l,h;if(e.grouped){const s=o?this._getStackCount(t):e.stackCount,r="flex"===n.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t<n.length-1?n[t+1]:null;const l=i.categoryPercentage;null===a&&(a=o-(null===r?e.end-e.start:r-o)),null===r&&(r=o+o-a);const h=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/s,ratio:i.barPercentage,start:h}}(t,e,n,s):function(t,e,s,n){const o=s.barThickness;let a,r;return i(o)?(a=e.min*s.categoryPercentage,r=s.barPercentage):(a=o*n,r=1),{chunk:a/n,ratio:r,start:e.pixels[t]-a/2}}(t,e,n,s),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);l=r.start+r.chunk*c+r.chunk/2,h=Math.min(a,r.chunk*r.ratio)}else l=s.getPixelForValue(this.getParsed(t)[s.axis],t),h=Math.min(a,e.min*e.ratio);return{base:l-h/2,head:l+h/2,center:l,size:h}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let n=0;for(;n<s;++n)null!==this.getParsed(n)[e.axis]&&i[n].draw(this._ctx)}}Tn.id="bar",Tn.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Tn.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Ln extends Ls{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const n=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<n.length;t++)n[t]._custom=this.resolveDataElementOptions(t+i).radius;return n}parseArrayData(t,e,i,s){const n=super.parseArrayData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=r(s[2],this.resolveDataElementOptions(t+i).radius)}return n}parseObjectData(t,e,i,s){const n=super.parseObjectData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=r(s&&s.r&&+s.r,this.resolveDataElementOptions(t+i).radius)}return n}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:s}=e,n=this.getParsed(t),o=i.getLabelForValue(n.x),a=s.getLabelForValue(n.y),r=n._custom;return{label:e.label,value:"("+o+", "+a+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:r,includeOptions:l}=this._getSharedOptions(e,s),h=o.axis,c=a.axis;for(let d=e;d<e+i;d++){const e=t[d],i=!n&&this.getParsed(d),u={},f=u[h]=n?o.getPixelForDecimal(.5):o.getPixelForValue(i[h]),g=u[c]=n?a.getBasePixel():a.getPixelForValue(i[c]);u.skip=isNaN(f)||isNaN(g),l&&(u.options=r||this.resolveDataElementOptions(d,e.active?"active":s),n&&(u.options.radius=0)),this.updateElement(e,d,u,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const n=s.radius;return"active"!==e&&(s.radius=0),s.radius+=r(i&&i._custom,n),s}}Ln.id="bubble",Ln.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Ln.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class En extends Ls{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let o,a,r=t=>+i[t];if(n(i[t])){const{key:t="value"}=this._parsing;r=e=>+y(i[e],t)}for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return H(this.options.rotation-90)}_getCircumference(){return H(this.options.circumference)}_getRotationExtents(){let t=O,e=-O;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const s=this.chart.getDatasetMeta(i).controller,n=s._getRotation(),o=s._getCircumference();t=Math.min(t,n),e=Math.max(e,n+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,n=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),r=Math.min(l(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:m}=function(t,e,i){let s=1,n=1,o=0,a=0;if(e<O){const r=t,l=r+e,h=Math.cos(r),c=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(t,e,s)=>G(t,r,l,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>G(t,r,l,!0)?-1:Math.min(e,e*i,s,s*i),p=f(0,h,d),m=f(L,c,u),b=g(D,h,d),x=g(D+L,c,u);s=(p-b)/2,n=(m-x)/2,o=-(p+b)/2,a=-(m+x)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}(u,d,r),b=(i.width-o)/f,x=(i.height-o)/g,_=Math.max(Math.min(b,x)/2,0),y=h(this.options.radius,_),v=(y-Math.max(y*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*y,this.offsetY=m*y,s.total=this.calculateTotal(),this.outerRadius=y-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*c,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/O)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,l=(a.left+a.right)/2,h=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:f,includeOptions:g}=this._getSharedOptions(e,s);let p,m=this._getRotation();for(p=0;p<e;++p)m+=this._circumference(p,n);for(p=e;p<e+i;++p){const e=this._circumference(p,n),i=t[p],o={x:l+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:u,innerRadius:d};g&&(o.options=f||this.resolveDataElementOptions(p,i.active?"active":s)),m+=e,this.updateElement(i,p,o,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?O*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=li(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)r=a.resolveDataElementOptions(s),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(r(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}En.id="doughnut",En.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},En.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},En.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return s(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Rn extends Ls{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,o=this.chart._animationsDisabled;let{start:a,count:r}=gt(e,s,o);this._drawStart=a,this._drawCount=r,pt(e)&&(a=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(s,a,r,t)}updateElements(t,e,s,n){const o="reset"===n,{iScale:a,vScale:r,_stacked:l,_dataset:h}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,n),u=a.axis,f=r.axis,{spanGaps:g,segment:p}=this.options,m=B(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||"none"===n;let x=e>0&&this.getParsed(e-1);for(let g=e;g<e+s;++g){const e=t[g],s=this.getParsed(g),_=b?e:{},y=i(s[f]),v=_[u]=a.getPixelForValue(s[u],g),w=_[f]=o||y?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,s,l):s[f],g);_.skip=isNaN(v)||isNaN(w)||y,_.stop=g>0&&Math.abs(s[u]-x[u])>m,p&&(_.parsed=s,_.raw=h.data[g]),d&&(_.options=c||this.resolveDataElementOptions(g,e.active?"active":n)),b||this.updateElement(e,g,_,n),x=s}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Rn.id="line",Rn.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Rn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class In extends Ls{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=li(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}parseObjectData(t,e,i,s){return Ue.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.options.animation,r=this._cachedMeta.rScale,l=r.xCenter,h=r.yCenter,c=r.getIndexAngle(0)-.5*D;let d,u=c;const f=360/this.countVisibleElements();for(d=0;d<e;++d)u+=this._computeAngle(d,s,f);for(d=e;d<e+i;d++){const e=t[d];let i=u,g=u+this._computeAngle(d,s,f),p=o.getDataVisibility(d)?r.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=g,n&&(a.animateScale&&(p=0),a.animateRotate&&(i=g=c));const m={x:l,y:h,innerRadius:0,outerRadius:p,startAngle:i,endAngle:g,options:this.resolveDataElementOptions(d,e.active?"active":s)};this.updateElement(e,d,m,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?H(this.resolveDataElementOptions(t,e).angle||i):0}}In.id="polarArea",In.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},In.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class zn extends En{}zn.id="pie",zn.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Fn extends Ls{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return Ue.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this._cachedMeta.rScale,o="reset"===s;for(let a=e;a<e+i;a++){const e=t[a],i=this.resolveDataElementOptions(a,e.active?"active":s),r=n.getPointPositionForValue(a,this.getParsed(a).r),l=o?n.xCenter:r.x,h=o?n.yCenter:r.y,c={x:l,y:h,angle:r.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,a,c,s)}}}Fn.id="radar",Fn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Fn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class Vn extends Ls{update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:n,count:o}=gt(e,i,s);if(this._drawStart=n,this._drawCount=o,pt(e)&&(n=0,o=i.length),this.options.showLine){const{dataset:n,_dataset:o}=e;n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=i;const a=this.resolveDatasetElementOptions(t);a.segment=this.options.segment,this.updateElement(n,void 0,{animated:!s,options:a},t)}this.updateElements(i,n,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=Us.getElement("line")),super.addElements()}updateElements(t,e,s,n){const o="reset"===n,{iScale:a,vScale:r,_stacked:l,_dataset:h}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(c),u=this.includeOptions(n,d),f=a.axis,g=r.axis,{spanGaps:p,segment:m}=this.options,b=B(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||"none"===n;let _=e>0&&this.getParsed(e-1);for(let c=e;c<e+s;++c){const e=t[c],s=this.getParsed(c),p=x?e:{},y=i(s[g]),v=p[f]=a.getPixelForValue(s[f],c),w=p[g]=o||y?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,s,l):s[g],c);p.skip=isNaN(v)||isNaN(w)||y,p.stop=c>0&&Math.abs(s[f]-_[f])>b,m&&(p.parsed=s,p.raw=h.data[c]),u&&(p.options=d||this.resolveDataElementOptions(c,e.active?"active":n)),x||this.updateElement(e,c,p,n),_=s}this.updateSharedOptions(d,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const n=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,n,o)/2}}Vn.id="scatter",Vn.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},Vn.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Bn=Object.freeze({__proto__:null,BarController:Tn,BubbleController:Ln,DoughnutController:En,LineController:Rn,PolarAreaController:In,PieController:zn,RadarController:Fn,ScatterController:Vn});function Nn(t,e,i){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=e;let h=n/r;t.beginPath(),t.arc(o,a,r,s-h,i+h),l>n?(h=n/l,t.arc(o,a,l,i+h,s-h,!0)):t.arc(o,a,n,i+L,s-L),t.closePath(),t.clip()}function Wn(t,e,i,s){const n=ui(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,a=Math.min(o,s*e/2),r=t=>{const e=(i-Math.min(o,t))*s/2;return Z(t,0,Math.min(o,e))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:Z(n.innerStart,0,a),innerEnd:Z(n.innerEnd,0,a)}}function jn(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function Hn(t,e,i,s,n,o){const{x:a,y:r,startAngle:l,pixelMargin:h,innerRadius:c}=e,d=Math.max(e.outerRadius+s+i-h,0),u=c>0?c+s+i+h:0;let f=0;const g=n-l;if(s){const t=((c>0?c-s:0)+(d>0?d-s:0))/2;f=(g-(0!==t?g*t/(t+s):g))/2}const p=(g-Math.max(.001,g*d-i/D)/d)/2,m=l+p+f,b=n-p-f,{outerStart:x,outerEnd:_,innerStart:y,innerEnd:v}=Wn(e,u,d,b-m),w=d-x,M=d-_,k=m+x/w,S=b-_/M,P=u+y,O=u+v,C=m+y/P,A=b-v/O;if(t.beginPath(),o){if(t.arc(a,r,d,k,S),_>0){const e=jn(M,S,a,r);t.arc(e.x,e.y,_,S,b+L)}const e=jn(O,b,a,r);if(t.lineTo(e.x,e.y),v>0){const e=jn(O,A,a,r);t.arc(e.x,e.y,v,b+L,A+Math.PI)}if(t.arc(a,r,u,b-v/u,m+y/u,!0),y>0){const e=jn(P,C,a,r);t.arc(e.x,e.y,y,C+Math.PI,m-L)}const i=jn(w,m,a,r);if(t.lineTo(i.x,i.y),x>0){const e=jn(w,k,a,r);t.arc(e.x,e.y,x,m-L,k)}}else{t.moveTo(a,r);const e=Math.cos(k)*d+a,i=Math.sin(k)*d+r;t.lineTo(e,i);const s=Math.cos(S)*d+a,n=Math.sin(S)*d+r;t.lineTo(s,n)}t.closePath()}function $n(t,e,i,s,n,o){const{options:a}=e,{borderWidth:r,borderJoinStyle:l}=a,h="inner"===a.borderAlign;r&&(h?(t.lineWidth=2*r,t.lineJoin=l||"round"):(t.lineWidth=r,t.lineJoin=l||"bevel"),e.fullCircles&&function(t,e,i){const{x:s,y:n,startAngle:o,pixelMargin:a,fullCircles:r}=e,l=Math.max(e.outerRadius-a,0),h=e.innerRadius+a;let c;for(i&&Nn(t,e,o+O),t.beginPath(),t.arc(s,n,h,o+O,o,!0),c=0;c<r;++c)t.stroke();for(t.beginPath(),t.arc(s,n,l,o,o+O),c=0;c<r;++c)t.stroke()}(t,e,h),h&&Nn(t,e,n),Hn(t,e,i,s,n,o),t.stroke())}class Yn extends Es{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=U(s,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:h,outerRadius:c,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),u=this.options.spacing/2,f=r(d,l-a)>=O||G(n,a,l),g=Q(o,h+u,c+u);return f&&g}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:r,spacing:l}=this.options,h=(s+n)/2,c=(o+a+l+r)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/2,n=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>O?Math.floor(i/O):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*a,Math.sin(e)*a),this.circumference>=D&&(a=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const r=function(t,e,i,s,n){const{fullCircles:o,startAngle:a,circumference:r}=e;let l=e.endAngle;if(o){Hn(t,e,i,s,a+O,n);for(let e=0;e<o;++e)t.fill();isNaN(r)||(l=a+r%O,r%O==0&&(l+=O))}return Hn(t,e,i,s,l,n),t.fill(),l}(t,this,a,n,o);$n(t,this,a,n,r,o),t.restore()}}function Un(t,e,i=e){t.lineCap=r(i.borderCapStyle,e.borderCapStyle),t.setLineDash(r(i.borderDash,e.borderDash)),t.lineDashOffset=r(i.borderDashOffset,e.borderDashOffset),t.lineJoin=r(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=r(i.borderWidth,e.borderWidth),t.strokeStyle=r(i.borderColor,e.borderColor)}function Xn(t,e,i){t.lineTo(i.x,i.y)}function qn(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,l=Math.max(n,a),h=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function Kn(t,e,i,s){const{points:n,options:o}=e,{count:a,start:r,loop:l,ilen:h}=qn(n,i,s),c=function(t){return t.stepped?Oe:t.tension||"monotone"===t.cubicInterpolationMode?Ce:Xn}(o);let d,u,f,{move:g=!0,reverse:p}=s||{};for(d=0;d<=h;++d)u=n[(r+(p?h-d:d))%a],u.skip||(g?(t.moveTo(u.x,u.y),g=!1):c(t,f,u,p,o.stepped),f=u);return l&&(u=n[(r+(p?h:0))%a],c(t,f,u,p,o.stepped)),!!l}function Gn(t,e,i,s){const n=e.points,{count:o,start:a,ilen:r}=qn(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,f,g,p,m=0,b=0;const x=t=>(a+(h?r-t:t))%o,_=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=n[x(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[x(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<f?f=i:i>g&&(g=i),m=(b*m+e)/++b):(_(),t.lineTo(e,i),u=s,b=0,f=g=i),p=i}_()}function Zn(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Gn:Kn}Yn.id="arc",Yn.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},Yn.defaultRoutes={backgroundColor:"backgroundColor"};const Jn="function"==typeof Path2D;function Qn(t,e,i,s){Jn&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Un(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=Zn(e);for(const r of n)Un(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}class to extends Es{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Qe(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Di(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,o=Pi(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],r=function(t){return t.stepped?oi:t.tension||"monotone"===t.cubicInterpolationMode?ai:ni}(i);let l,h;for(l=0,h=o.length;l<h;++l){const{start:h,end:c}=o[l],d=n[h],u=n[c];if(d===u){a.push(d);continue}const f=r(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],a.push(f)}return 1===a.length?a[0]:a}pathSegment(t,e,i){return Zn(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=Zn(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=n(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),Qn(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function eo(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}to.id="line",to.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},to.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},to.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class io extends Es{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return eo(this,t,"x",e)}inYRange(t,e){return eo(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Se(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Me(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function so(t,e){const{x:i,y:s,base:n,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let r,l,h,c,d;return t.horizontal?(d=a/2,r=Math.min(i,n),l=Math.max(i,n),h=s-d,c=s+d):(d=o/2,r=i-d,l=i+d,h=Math.min(s,n),c=Math.max(s,n)),{left:r,top:h,right:l,bottom:c}}function no(t,e,i,s){return t?0:Z(e,i,s)}function oo(t){const e=so(t),i=e.right-e.left,s=e.bottom-e.top,o=function(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,o=fi(s);return{t:no(n.top,o.top,0,i),r:no(n.right,o.right,0,e),b:no(n.bottom,o.bottom,0,i),l:no(n.left,o.left,0,e)}}(t,i/2,s/2),a=function(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),o=t.options.borderRadius,a=gi(o),r=Math.min(e,i),l=t.borderSkipped,h=s||n(o);return{topLeft:no(!h||l.top||l.left,a.topLeft,0,r),topRight:no(!h||l.top||l.right,a.topRight,0,r),bottomLeft:no(!h||l.bottom||l.left,a.bottomLeft,0,r),bottomRight:no(!h||l.bottom||l.right,a.bottomRight,0,r)}}(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:a},inner:{x:e.left+o.l,y:e.top+o.t,w:i-o.l-o.r,h:s-o.t-o.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,a.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(o.b,o.r))}}}}function ao(t,e,i,s){const n=null===e,o=null===i,a=t&&!(n&&o)&&so(t,s);return a&&(n||Q(e,a.left,a.right))&&(o||Q(i,a.top,a.bottom))}function ro(t,e){t.rect(e.x,e.y,e.w,e.h)}function lo(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-s,a=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+o,h:t.h+a,radius:t.radius}}io.id="point",io.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},io.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class ho extends Es{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=oo(this),a=(r=o.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?Le:ro;var r;t.save(),o.w===n.w&&o.h===n.h||(t.beginPath(),a(t,lo(o,e,n)),t.clip(),a(t,lo(n,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,lo(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ao(this,t,e,i)}inXRange(t,e){return ao(this,t,null,e)}inYRange(t,e){return ao(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}ho.id="bar",ho.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},ho.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var co=Object.freeze({__proto__:null,ArcElement:Yn,LineElement:to,PointElement:io,BarElement:ho});function uo(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function fo(t){t.data.datasets.forEach((t=>{uo(t)}))}var go={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,s)=>{if(!s.enabled)return void fo(t);const n=t.width;t.data.datasets.forEach(((e,o)=>{const{_data:a,indexAxis:r}=e,l=t.getDatasetMeta(o),h=a||e.data;if("y"===bi([r,t.options.indexAxis]))return;if(!l.controller.supportsDecimation)return;const c=t.scales[l.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let{start:d,count:u}=function(t,e){const i=e.length;let s,n=0;const{iScale:o}=t,{min:a,max:r,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(n=Z(et(e,o.axis,a).lo,0,i-1)),s=h?Z(et(e,o.axis,r).hi+1,n,i)-n:i-n,{start:n,count:s}}(l,h);if(u<=(s.threshold||4*n))return void uo(e);let f;switch(i(a)&&(e._data=h,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),s.algorithm){case"lttb":f=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let l=0;const h=e+i-1;let c,d,u,f,g,p=e;for(a[l++]=t[p],c=0;c<o-2;c++){let s,n=0,o=0;const h=Math.floor((c+1)*r)+1+e,m=Math.min(Math.floor((c+2)*r)+1,i)+e,b=m-h;for(s=h;s<m;s++)n+=t[s].x,o+=t[s].y;n/=b,o/=b;const x=Math.floor(c*r)+1+e,_=Math.min(Math.floor((c+1)*r)+1,i)+e,{x:y,y:v}=t[p];for(u=f=-1,s=x;s<_;s++)f=.5*Math.abs((y-n)*(t[s].y-v)-(y-t[s].x)*(o-v)),f>u&&(u=f,d=t[s],g=s);a[l++]=d,p=g}return a[l++]=t[h],a}(h,d,u,n,s);break;case"min-max":f=function(t,e,s,n){let o,a,r,l,h,c,d,u,f,g,p=0,m=0;const b=[],x=e+s-1,_=t[e].x,y=t[x].x-_;for(o=e;o<e+s;++o){a=t[o],r=(a.x-_)/y*n,l=a.y;const e=0|r;if(e===h)l<f?(f=l,c=o):l>g&&(g=l,d=o),p=(m*p+a.x)/++m;else{const s=o-1;if(!i(c)&&!i(d)){const e=Math.min(c,d),i=Math.max(c,d);e!==u&&e!==s&&b.push({...t[e],x:p}),i!==u&&i!==s&&b.push({...t[i],x:p})}o>0&&s!==u&&b.push(t[s]),b.push(a),h=e,m=0,f=g=l,c=d=u=o}}return b}(h,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${s.algorithm}'`)}e._decimated=f}))},destroy(t){fo(t)}};function po(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=K(n),o=K(o)),{property:t,start:n,end:o}}function mo(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function bo(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function xo(t,e){let i=[],n=!1;return s(t)?(n=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=mo(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))})),o}(t,e),i.length?new to({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function _o(t){return t&&!1!==t.fill}function yo(t,e,i){let s=t[e].fill;const n=[e];let a;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!o(s))return s;if(a=t[s],!a)return!1;if(a.visible)return s;n.push(s),s=a.fill}return!1}function vo(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=r(i&&i.target,i);void 0===s&&(s=!!e.backgroundColor);if(!1===s||null===s)return!1;if(!0===s)return"origin";return s}(t);if(n(s))return!isNaN(s.value)&&s;let a=parseFloat(s);return o(a)&&Math.floor(a)===a?function(t,e,i,s){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=s)return!1;return i}(s[0],e,a,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function wo(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:a,last:r,point:l}=Mo(o,e,"x");if(!(!l||a&&r))if(a)s.unshift(l);else if(t.push(l),!r)break}t.push(...s)}function Mo(t,e,i){const s=t.interpolate(e,i);if(!s)return{};const n=s[i],o=t.segments,a=t.points;let r=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],s=a[e.start][i],h=a[e.end][i];if(Q(n,s,h)){r=n===s,l=n===h;break}}return{first:r,last:l,point:s}}class ko{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:n,radius:o}=this;return e=e||{start:0,end:O},t.arc(s,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function So(t){const{chart:e,fill:i,line:s}=t;if(o(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,a=s.points,r=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);r.push(xo({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)wo(n,a[t],r)}return new to({points:n,options:{}})}(t);if("shape"===i)return!0;const a=function(t){if((t.scale||{}).getPointPositionForValue)return function(t){const{scale:e,fill:i}=t,s=e.options,o=e.getLabels().length,a=s.reverse?e.max:e.min,r=function(t,e,i){let s;return s="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:n(t)?t.value:e.getBaseValue(),s}(i,e,a),l=[];if(s.grid.circular){const t=e.getPointPositionForValue(0,a);return new ko({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<o;++t)l.push(e.getPointPositionForValue(t,r));return l}(t);return function(t){const{scale:e={},fill:i}=t,s=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:n(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(o(s)){const t=e.isHorizontal();return{x:t?s:null,y:t?null:s}}return null}(t)}(t);return a instanceof ko?a:xo(a,s)}function Po(t,e,i){const s=So(e),{line:n,scale:o,axis:a}=e,r=n.options,l=r.fill,h=r.backgroundColor,{above:c=h,below:d=h}=l||{};s&&n.points.length&&(Pe(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&o!==n&&(Do(t,s,a.top),Oo(t,{line:i,target:s,color:n,scale:r,property:l}),t.restore(),t.save(),Do(t,s,a.bottom));Oo(t,{line:i,target:s,color:o,scale:r,property:l}),t.restore()}(t,{line:n,target:s,above:c,below:d,area:i,scale:o,axis:a}),De(t))}function Do(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[mo(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Oo(t,e){const{line:i,target:s,property:n,color:o,scale:a}=e,r=function(t,e,i){const s=t.segments,n=t.points,o=e.points,a=[];for(const t of s){let{start:s,end:r}=t;r=mo(s,r,n);const l=po(i,n[s],n[r],t.loop);if(!e.segments){a.push({source:t,target:l,start:n[s],end:n[r]});continue}const h=Pi(e,l);for(const e of h){const s=po(i,o[e.start],o[e.end],e.loop),r=Si(t,n,s);for(const t of r)a.push({source:t,target:e,start:{[i]:bo(l,s,"start",Math.max)},end:{[i]:bo(l,s,"end",Math.min)}})}}return a}(i,s,n);for(const{source:e,target:l,start:h,end:c}of r){const{style:{backgroundColor:r=o}={}}=e,d=!0!==s;t.save(),t.fillStyle=r,Co(t,a,d&&po(n,h,c)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():Ao(t,s,c,n);const e=!!s.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||Ao(t,s,h,n)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function Co(t,e,i){const{top:s,bottom:n}=e.chart.chartArea,{property:o,start:a,end:r}=i||{};"x"===o&&(t.beginPath(),t.rect(a,s,r-a,n-s),t.clip())}function Ao(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var To={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,l;for(a=0;a<s;++a)o=t.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof to&&(l={visible:t.isDatasetVisible(a),index:a,fill:vo(r,a,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,n.push(l);for(a=0;a<s;++a)l=n[a],l&&!1!==l.fill&&(l.fill=yo(n,a,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&i.fill&&Po(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;_o(i)&&Po(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;_o(s)&&"beforeDatasetDraw"===i.drawTime&&Po(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Lo=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class Eo extends Es{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=c(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=mi(i.font),n=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:r}=Lo(i,n);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(o,n,a,r)+10):(h=this.maxHeight,l=this._fitCols(o,n,a,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach(((t,f)=>{const g=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+g+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,u+=h,d++),r[f]={left:0,top:u,row:d,width:g,height:s},l[l.length-1]+=g+a})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=a,d=0,u=0,f=0,g=0;return this.legendItems.forEach(((t,o)=>{const p=i+e/2+n.measureText(t.text).width;o>0&&u+s+2*a>h&&(c+=d+a,l.push({width:d,height:u}),f+=d+a,g++,d=u=0),r[o]={left:f,top:u,col:g,width:p,height:s},d=Math.max(d,p),u+=s+a})),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:n}}=this,o=yi(n,this.left,this.width);if(this.isHorizontal()){let n=0,a=ut(i,this.left+s,this.right-this.lineWidths[n]);for(const r of e)n!==r.row&&(n=r.row,a=ut(i,this.left+s,this.right-this.lineWidths[n])),r.top+=this.top+t+s,r.left=o.leftForLtr(o.x(a),r.width),a+=r.width+s}else{let n=0,a=ut(i,this.top+t+s,this.bottom-this.columnSizes[n].height);for(const r of e)r.col!==n&&(n=r.col,a=ut(i,this.top+t+s,this.bottom-this.columnSizes[n].height)),r.top=a,r.left+=this.left+s,r.left=o.leftForLtr(o.x(r.left),r.width),a+=r.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Pe(t,this),this._draw(),De(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:n,labels:o}=t,a=ne.color,l=yi(t.rtl,this.left,this.width),h=mi(o.font),{color:c,padding:d}=o,u=h.size,f=u/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=h.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=Lo(o,u),x=this.isHorizontal(),_=this._computeTitleHeight();g=x?{x:ut(n,this.left+d,this.right-i[0]),y:this.top+d+_,line:0}:{x:this.left+d,y:ut(n,this.top+_+d,this.bottom-e[0].height),line:0},vi(this.ctx,t.textDirection);const y=b+d;this.legendItems.forEach(((v,w)=>{s.strokeStyle=v.fontColor||c,s.fillStyle=v.fontColor||c;const M=s.measureText(v.text).width,k=l.textAlign(v.textAlign||(v.textAlign=o.textAlign)),S=p+f+M;let P=g.x,D=g.y;l.setWidth(this.width),x?w>0&&P+S+d>this.right&&(D=g.y+=y,g.line++,P=g.x=ut(n,this.left+d,this.right-i[g.line])):w>0&&D+y>this.bottom&&(P=g.x=P+e[g.line].width+d,g.line++,D=g.y=ut(n,this.top+_+d,this.bottom-e[g.line].height));!function(t,e,i){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;s.save();const n=r(i.lineWidth,1);if(s.fillStyle=r(i.fillStyle,a),s.lineCap=r(i.lineCap,"butt"),s.lineDashOffset=r(i.lineDashOffset,0),s.lineJoin=r(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=r(i.strokeStyle,a),s.setLineDash(r(i.lineDash,[])),o.usePointStyle){const a={radius:m*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},r=l.xPlus(t,p/2);ke(s,a,r,e+f,o.pointStyleWidth&&p)}else{const o=e+Math.max((u-m)/2,0),a=l.leftForLtr(t,p),r=gi(i.borderRadius);s.beginPath(),Object.values(r).some((t=>0!==t))?Le(s,{x:a,y:o,w:p,h:m,radius:r}):s.rect(a,o,p,m),s.fill(),0!==n&&s.stroke()}s.restore()}(l.x(P),D,v),P=ft(k,P+p+f,x?P+S:this.right,t.rtl),function(t,e,i){Ae(s,i.text,t,e+b/2,h,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})}(l.x(P),D,v),x?g.x+=S+d:g.y+=y})),wi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=mi(e.font),s=pi(e.padding);if(!e.display)return;const n=yi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,r=i.size/2,l=s.top+r;let h,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+l,c=ut(t.align,c,this.right-d);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);h=l+ut(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=ut(a,c,c+d);o.textAlign=n.textAlign(dt(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Ae(o,e.text,u,h,i)}_computeTitleHeight(){const t=this.options.title,e=mi(t.font),i=pi(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(Q(t,this.left,this.right)&&Q(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(s=n[i],Q(t,s.left,s.left+s.width)&&Q(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const o=this._hoveredItem,a=(n=i,null!==(s=o)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);o&&!a&&c(e.onLeave,[t,o,this],this),this._hoveredItem=i,i&&!a&&c(e.onHover,[t,i,this],this)}else i&&c(e.onClick,[t,i,this],this);var s,n}}var Ro={id:"legend",_element:Eo,start(t,e,i){const s=t.legend=new Eo({ctx:t.ctx,options:i,chart:t});Zi.configure(t,s,i),Zi.addBox(t,s)},stop(t){Zi.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;Zi.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(i?0:void 0),r=pi(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(r.width+r.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Io extends Es{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const n=s(i.text)?i.text.length:1;this._padding=pi(i.padding);const o=n*mi(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:n,options:o}=this,a=o.align;let r,l,h,c=0;return this.isHorizontal()?(l=ut(a,i,n),h=e+t,r=n-i):("left"===o.position?(l=i+t,h=ut(a,s,e),c=-.5*D):(l=n-t,h=ut(a,e,s),c=.5*D),r=s-e),{titleX:l,titleY:h,maxWidth:r,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=mi(e.font),s=i.lineHeight/2+this._padding.top,{titleX:n,titleY:o,maxWidth:a,rotation:r}=this._drawArgs(s);Ae(t,e.text,0,0,i,{color:e.color,maxWidth:a,rotation:r,textAlign:dt(e.align),textBaseline:"middle",translation:[n,o]})}}var zo={id:"title",_element:Io,start(t,e,i){!function(t,e){const i=new Io({ctx:t.ctx,options:e,chart:t});Zi.configure(t,i,e),Zi.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Zi.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;Zi.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Fo=new WeakMap;var Vo={id:"subtitle",start(t,e,i){const s=new Io({ctx:t.ctx,options:i,chart:t});Zi.configure(t,s,i),Zi.addBox(t,s),Fo.set(t,s)},stop(t){Zi.removeBox(t,Fo.get(t)),Fo.delete(t)},beforeUpdate(t,e,i){const s=Fo.get(t);Zi.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Bo={average(t){if(!t.length)return!1;let e,i,s=0,n=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s+=t.x,n+=t.y,++o}}return{x:s/o,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,s,n,o=e.x,a=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=X(e,s.getCenterPoint());t<r&&(r=t,n=s)}}if(n){const t=n.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function No(t,e){return e&&(s(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Wo(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function jo(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Ho(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:a,boxHeight:r}=e,l=mi(e.bodyFont),h=mi(e.titleFont),c=mi(e.footerFont),u=o.length,f=n.length,g=s.length,p=pi(e.padding);let m=p.height,b=0,x=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(x+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*h.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),x){m+=g*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(x-g)*l.lineHeight+(x-1)*e.bodySpacing}f&&(m+=e.footerMarginTop+f*c.lineHeight+(f-1)*e.footerSpacing);let _=0;const y=function(t){b=Math.max(b,i.measureText(t).width+_)};return i.save(),i.font=h.string,d(t.title,y),i.font=l.string,d(t.beforeBody.concat(t.afterBody),y),_=e.displayColors?a+2+e.boxPadding:0,d(s,(t=>{d(t.before,y),d(t.lines,y),d(t.after,y)})),_=0,i.font=c.string,d(t.footer,y),i.restore(),b+=p.width,{width:b,height:m}}function $o(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:l}}=t;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(h,t,e,i)&&(h="center"),h}function Yo(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||$o(t,e,i,s),yAlign:s}}function Uo(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:r,yAlign:l}=i,h=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=gi(a);let g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,r);const p=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,h);return"center"===l?"left"===r?g+=h:"right"===r&&(g-=h):"left"===r?g-=Math.max(c,u)+n:"right"===r&&(g+=Math.max(d,f)+n),{x:Z(g,0,s.width-e.width),y:Z(p,0,s.height-e.height)}}function Xo(t,e,i){const s=pi(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function qo(t){return No([],Wo(t))}function Ko(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class Go extends Es{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new ys(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,_i(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),n=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let a=[];return a=No(a,Wo(s)),a=No(a,Wo(n)),a=No(a,Wo(o)),a}getBeforeBody(t,e){return qo(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,s=[];return d(t,(t=>{const e={before:[],lines:[],after:[]},n=Ko(i,t);No(e.before,Wo(n.beforeLabel.call(this,t))),No(e.lines,n.label.call(this,t)),No(e.after,Wo(n.afterLabel.call(this,t))),s.push(e)})),s}getAfterBody(t,e){return qo(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),n=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let a=[];return a=No(a,Wo(s)),a=No(a,Wo(n)),a=No(a,Wo(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let a,r,l=[];for(a=0,r=e.length;a<r;++a)l.push(jo(this.chart,e[a]));return t.filter&&(l=l.filter(((e,s,n)=>t.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),d(l,(e=>{const i=Ko(t.callbacks,e);s.push(i.labelColor.call(this,e)),n.push(i.labelPointStyle.call(this,e)),o.push(i.labelTextColor.call(this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=Bo[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Ho(this,i),a=Object.assign({},t,e),r=Yo(this.chart,i,a),l=Uo(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=gi(a),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,_,y;return"center"===n?(_=u+g/2,"left"===s?(p=d,m=p-o,x=_+o,y=_-o):(p=d+f,m=p+o,x=_-o,y=_+o),b=p):(m="left"===s?d+Math.max(r,h)+o:"right"===s?d+f-Math.max(l,c)-o:this.caretX,"top"===n?(x=u,_=x-o,p=m-o,b=m+o):(x=u+g,_=x+o,p=m+o,b=m-o),y=x),{x1:p,x2:m,x3:b,y1:x,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,a,r;if(n){const l=yi(i.rtl,this.x,this.width);for(t.x=Xo(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=mi(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,r=0;r<n;++r)e.fillText(s[r],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,r+1===n&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:h,boxPadding:c}=o,d=mi(o.bodyFont),u=Xo(this,"left",o),f=s.x(u),g=l<d.lineHeight?(d.lineHeight-l)/2:0,p=e.y+g;if(o.usePointStyle){const e={radius:Math.min(h,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=s.leftForLtr(f,h)+h/2,n=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Me(t,e,i,n),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Me(t,e,i,n)}else{t.lineWidth=n(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const e=s.leftForLtr(f,h-c),i=s.leftForLtr(s.xPlus(f,1),h-c-2),r=gi(a.borderRadius);Object.values(r).some((t=>0!==t))?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Le(t,{x:e,y:p,w:h,h:l,radius:r}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Le(t,{x:i,y:p+1,w:h-2,h:l-2,radius:r}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(e,p,h,l),t.strokeRect(e,p,h,l),t.fillStyle=a.backgroundColor,t.fillRect(i,p+1,h-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:a,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=mi(i.bodyFont);let u=c.lineHeight,f=0;const g=yi(i.rtl,this.x,this.width),p=function(i){e.fillText(i,g.x(t.x+f),t.y+u/2),t.y+=u+n},m=g.textAlign(o);let b,x,_,y,v,w,M;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=Xo(this,m,i),e.fillStyle=i.bodyColor,d(this.beforeBody,p),f=a&&"right"!==m?"center"===o?l/2+h:l+2+h:0,y=0,w=s.length;y<w;++y){for(b=s[y],x=this.labelTextColors[y],e.fillStyle=x,d(b.before,p),_=b.lines,a&&_.length&&(this._drawColorBox(e,t,y,g,i),u=Math.max(c.lineHeight,r)),v=0,M=_.length;v<M;++v)p(_[v]),u=c.lineHeight;d(b.after,p)}f=0,u=c.lineHeight,d(this.afterBody,p),t.y-=n}drawFooter(t,e,i){const s=this.footer,n=s.length;let o,a;if(n){const r=yi(i.rtl,this.x,this.width);for(t.x=Xo(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=r.textAlign(i.footerAlign),e.textBaseline="middle",o=mi(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<n;++a)e.fillText(s[a],r.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:n,yAlign:o}=this,{x:a,y:r}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=gi(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+c,r),"top"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+l-d,r),e.quadraticCurveTo(a+l,r,a+l,r+d),"center"===o&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(a+l,r+h-f),e.quadraticCurveTo(a+l,r+h,a+l-f,r+h),"bottom"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+u,r+h),e.quadraticCurveTo(a,r+h,a,r+h-u),"center"===o&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(a,r+c),e.quadraticCurveTo(a,r,a+c,r),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Bo[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Ho(this,t),a=Object.assign({},i,this._size),r=Yo(e,t,a),l=Uo(t,a,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=pi(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),vi(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),wi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!u(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),r=e||!u(o,n)||a;return r&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e;const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=Bo[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}Go.positioners=Bo;var Zo={id:"tooltip",_element:Go,positioners:Bo,afterInit(t,e,i){i&&(t.tooltip=new Go({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",i))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:t,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:t,beforeBody:t,beforeLabel:t,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const s=t.formattedValue;return i(s)||(e+=s),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:t,afterBody:t,beforeFooter:t,footer:t,afterFooter:t}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Jo=Object.freeze({__proto__:null,Decimation:go,Filler:To,Legend:Ro,SubTitle:Vo,Title:zo,Tooltip:Zo});function Qo(t,e,i,s){const n=t.indexOf(e);if(-1===n)return((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s);return n!==t.lastIndexOf(e)?i:n}class ta extends $s{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(i(t))return null;const s=this.getLabels();return((t,e)=>null===t?null:Z(Math.round(t),0,e))(e=isFinite(e)&&s[e]===t?e:Qo(s,t,r(e,t),this._addedLabels),s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function ea(t,e,{horizontal:i,minRotation:s}){const n=H(s),o=(i?Math.sin(n):Math.cos(n))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}ta.id="category",ta.defaults={ticks:{callback:ta.prototype.getLabelForValue}};class ia extends $s{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return i(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=t=>s=e?s:t,a=t=>n=i?n:t;if(t){const t=z(s),e=z(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=1;(n>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*n)),a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n=function(t,e){const s=[],{bounds:n,step:o,min:a,max:r,precision:l,count:h,maxTicks:c,maxDigits:d,includeBounds:u}=t,f=o||1,g=c-1,{min:p,max:m}=e,b=!i(a),x=!i(r),_=!i(h),y=(m-p)/(d+1);let v,w,M,k,S=F((m-p)/g/f)*f;if(S<1e-14&&!b&&!x)return[{value:p},{value:m}];k=Math.ceil(m/S)-Math.floor(p/S),k>g&&(S=F(k*S/g/f)*f),i(l)||(v=Math.pow(10,l),S=Math.ceil(S*v)/v),"ticks"===n?(w=Math.floor(p/S)*S,M=Math.ceil(m/S)*S):(w=p,M=m),b&&x&&o&&W((r-a)/o,S/1e3)?(k=Math.round(Math.min((r-a)/S,c)),S=(r-a)/k,w=a,M=r):_?(w=b?a:w,M=x?r:M,k=h-1,S=(M-w)/k):(k=(M-w)/S,k=N(k,Math.round(k),S/1e3)?Math.round(k):Math.ceil(k));const P=Math.max(Y(S),Y(w));v=Math.pow(10,i(l)?P:l),w=Math.round(w*v)/v,M=Math.round(M*v)/v;let D=0;for(b&&(u&&w!==a?(s.push({value:a}),w<a&&D++,N(Math.round((w+D*S)*v)/v,a,ea(a,y,t))&&D++):w<a&&D++);D<k;++D)s.push({value:Math.round((w+D*S)*v)/v});return x&&u&&M!==r?s.length&&N(s[s.length-1].value,r,ea(r,y,t))?s[s.length-1].value=r:s.push({value:r}):x&&M!==r||s.push({value:M}),s}({maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&j(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return li(t,this.chart.options.locale,this.options.ticks.format)}}class sa extends ia{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=o(t)?t:0,this.max=o(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=H(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function na(t){return 1===t/Math.pow(10,Math.floor(I(t)))}sa.id="linear",sa.defaults={ticks:{callback:Is.formatters.numeric}};class oa extends $s{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=ia.prototype.parse.apply(this,[t,e]);if(0!==i)return o(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=o(t)?Math.max(0,t):null,this.max=o(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,o=t=>s=e?s:t,a=(t,e)=>Math.pow(10,Math.floor(I(t))+e);i===s&&(i<=0?(n(1),o(10)):(n(a(i,-1)),o(a(s,1)))),i<=0&&n(a(s,-1)),s<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&n(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(I(e.max)),s=Math.ceil(e.max/Math.pow(10,i)),n=[];let o=a(t.min,Math.pow(10,Math.floor(I(e.min)))),r=Math.floor(I(o)),l=Math.floor(o/Math.pow(10,r)),h=r<0?Math.pow(10,Math.abs(r)):1;do{n.push({value:o,major:na(o)}),++l,10===l&&(l=1,++r,h=r>=0?1:h),o=Math.round(l*Math.pow(10,r)*h)/h}while(r<i||r===i&&l<s);const c=a(t.max,o);return n.push({value:c,major:na(o)}),n}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&j(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":li(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=I(t),this._valueRange=I(this.max)-I(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(I(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function aa(t){const e=t.ticks;if(e.display&&t.display){const t=pi(e.backdropPadding);return r(e.font&&e.font.size,ne.font.size)+t.height}return 0}function ra(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:t<s||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function la(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),n=[],o=[],a=t._pointLabels.length,r=t.options.pointLabels,l=r.centerPointLabels?D/a:0;for(let u=0;u<a;u++){const a=r.setContext(t.getPointLabelContext(u));o[u]=a.padding;const f=t.getPointPosition(u,t.drawingArea+o[u],l),g=mi(a.font),p=(h=t.ctx,c=g,d=s(d=t._pointLabels[u])?d:[d],{w:ye(h,c.string,d),h:d.length*c.lineHeight});n[u]=p;const m=K(t.getIndexAngle(u)+l),b=Math.round($(m));ha(i,e,m,ra(b,f.x,p.w,0,180),ra(b,f.y,p.h,90,270))}var h,c,d;t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const s=[],n=t._pointLabels.length,o=t.options,a=aa(o)/2,r=t.drawingArea,l=o.pointLabels.centerPointLabels?D/n:0;for(let o=0;o<n;o++){const n=t.getPointPosition(o,r+a+i[o],l),h=Math.round($(K(n.angle+L))),c=e[o],d=ua(n.y,c.h,h),u=ca(h),f=da(n.x,c.w,u);s.push({x:n.x,y:d,textAlign:u,left:f,top:d,right:f+c.w,bottom:d+c.h})}return s}(t,n,o)}function ha(t,e,i,s,n){const o=Math.abs(Math.sin(i)),a=Math.abs(Math.cos(i));let r=0,l=0;s.start<e.l?(r=(e.l-s.start)/o,t.l=Math.min(t.l,e.l-r)):s.end>e.r&&(r=(s.end-e.r)/o,t.r=Math.max(t.r,e.r+r)),n.start<e.t?(l=(e.t-n.start)/a,t.t=Math.min(t.t,e.t-l)):n.end>e.b&&(l=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function ca(t){return 0===t||180===t?"center":t<180?"left":"right"}function da(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function ua(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function fa(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,O);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;o<s;o++)i=t.getPointPosition(o,e),n.lineTo(i.x,i.y)}}oa.id="logarithmic",oa.defaults={ticks:{callback:Is.formatters.logarithmic,major:{enabled:!0}}};class ga extends ia{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=pi(aa(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=o(t)&&!isNaN(t)?t:0,this.max=o(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/aa(this.options))}generateTickLabels(t){ia.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=c(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?la(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){return K(t*(O/(this._pointLabels.length||1))+H(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(i(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(i(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return _i(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-L+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:n}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:n}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),fa(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:s,grid:n}=e,o=this._pointLabels.length;let a,r,l;if(e.pointLabels.display&&function(t,e){const{ctx:s,options:{pointLabels:n}}=t;for(let o=e-1;o>=0;o--){const e=n.setContext(t.getPointLabelContext(o)),a=mi(e.font),{x:r,y:l,textAlign:h,left:c,top:d,right:u,bottom:f}=t._pointLabelItems[o],{backdropColor:g}=e;if(!i(g)){const t=gi(e.borderRadius),i=pi(e.backdropPadding);s.fillStyle=g;const n=c-i.left,o=d-i.top,a=u-c+i.width,r=f-d+i.height;Object.values(t).some((t=>0!==t))?(s.beginPath(),Le(s,{x:n,y:o,w:a,h:r,radius:t}),s.fill()):s.fillRect(n,o,a,r)}Ae(s,t._pointLabels[o],r,l+a.lineHeight/2,a,{color:e.color,textAlign:h,textBaseline:"middle"})}}(this,o),n.display&&this.ticks.forEach(((t,e)=>{if(0!==e){r=this.getDistanceFromCenterForValue(t.value);!function(t,e,i,s){const n=t.ctx,o=e.circular,{color:a,lineWidth:r}=e;!o&&!s||!a||!r||i<0||(n.save(),n.strokeStyle=a,n.lineWidth=r,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.beginPath(),fa(t,i,o,s),n.closePath(),n.stroke(),n.restore())}(this,n.setContext(this.getContext(e-1)),r,o)}})),s.display){for(t.save(),a=o-1;a>=0;a--){const i=s.setContext(this.getPointLabelContext(a)),{color:n,lineWidth:o}=i;o&&n&&(t.lineWidth=o,t.strokeStyle=n,t.setLineDash(i.borderDash),t.lineDashOffset=i.borderDashOffset,r=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(a,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,a)=>{if(0===a&&!e.reverse)return;const r=i.setContext(this.getContext(a)),l=mi(r.font);if(n=this.getDistanceFromCenterForValue(this.ticks[a].value),r.showLabelBackdrop){t.font=l.string,o=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=pi(r.backdropPadding);t.fillRect(-o/2-e.left,-n-l.size/2-e.top,o+e.width,l.size+e.height)}Ae(t,s.label,0,-n,l,{color:r.color})})),t.restore()}drawTitle(){}}ga.id="radialLinear",ga.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Is.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},ga.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},ga.descriptors={angleLines:{_fallback:"grid"}};const pa={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ma=Object.keys(pa);function ba(t,e){return t-e}function xa(t,e){if(i(e))return null;const s=t._adapter,{parser:n,round:a,isoWeekday:r}=t._parseOpts;let l=e;return"function"==typeof n&&(l=n(l)),o(l)||(l="string"==typeof n?s.parse(l,n):s.parse(l)),null===l?null:(a&&(l="week"!==a||!B(r)&&!0!==r?s.startOf(l,a):s.startOf(l,"isoWeek",r)),+l)}function _a(t,e,i,s){const n=ma.length;for(let o=ma.indexOf(t);o<n-1;++o){const t=pa[ma[o]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=s)return ma[o]}return ma[n-1]}function ya(t,e,i){if(i){if(i.length){const{lo:s,hi:n}=tt(i,e);t[i[s]>=e?i[s]:i[n]]=!0}}else t[e]=!0}function va(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a<o;++a)r=e[a],n[r]=a,s.push({value:r,major:!1});return 0!==o&&i?function(t,e,i,s){const n=t._adapter,o=+n.startOf(e[0].value,s),a=e[e.length-1].value;let r,l;for(r=o;r<=a;r=+n.add(r,1,s))l=i[r],l>=0&&(e[l].major=!0);return e}(t,s,n,i):s}class wa extends $s{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),s=this._adapter=new wn._date(t.adapters.date);s.init(e),b(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:xa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:a,maxDefined:r}=this.getUserBounds();function l(t){a||isNaN(t.min)||(s=Math.min(s,t.min)),r||isNaN(t.max)||(n=Math.max(n,t.max))}a&&r||(l(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||l(this.getMinMax(!1))),s=o(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=o(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,o=st(s,n,this.max);return this._unit=e.unit||(i.autoSkip?_a(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,i,s,n){for(let o=ma.length-1;o>=ma.indexOf(i);o--){const i=ma[o];if(pa[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return ma[i?ma.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=ma.indexOf(t)+1,i=ma.length;e<i;++e)if(pa[ma[e]].common)return ma[e]}(this._unit):void 0,this.initOffsets(s),t.reverse&&o.reverse(),va(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;s=Z(s,0,o),n=Z(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,o=n.unit||_a(n.minUnit,e,i,this._getLabelCapacity(e)),a=r(n.stepSize,1),l="week"===o&&n.isoWeekday,h=B(l)||!0===l,c={};let d,u,f=e;if(h&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,h?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const g="data"===s.ticks.source&&this.getDataTimestamps();for(d=f,u=0;d<i;d=+t.add(d,a,o),u++)ya(c,d,g);return d!==i&&"ticks"!==s.bounds&&1!==u||ya(c,d,g),Object.keys(c).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){const n=this.options,o=n.time.displayFormats,a=this._unit,r=this._majorUnit,l=a&&o[a],h=r&&o[r],d=i[e],u=r&&h&&d&&d.major,f=this._adapter.format(t,s||(u?h:l)),g=n.ticks.callback;return g?c(g,[f,e,i],this):f}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=H(this.isHorizontal()?e.maxRotation:e.minRotation),n=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*n+a*o,h:i*o+a*n}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,n=this._tickFormatFunction(t,0,va(this,[t],this._majorUnit),s),o=this._getLabelSize(n),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(xa(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return rt(t.sort(ba))}}function Ma(t,e,i){let s,n,o,a,r=0,l=t.length-1;i?(e>=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=et(t,"pos",e)),({pos:s,time:o}=t[r]),({pos:n,time:a}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=et(t,"time",e)),({time:s,pos:o}=t[r]),({time:n,pos:a}=t[l]));const h=n-s;return h?o+(a-o)*(e-s)/h:o}wa.id="time",wa.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class ka extends wa{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ma(e,this.min),this._tableRange=Ma(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,a,r,l,h;for(o=0,a=t.length;o<a;++o)l=t[o],l>=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)h=s[o+1],r=s[o-1],l=s[o],Math.round((h+r)/2)!==l&&n.push({time:l,pos:o/(a-1)});return n}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ma(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ma(this._table,i*this._tableRange+this._minPos,!0)}}ka.id="timeseries",ka.defaults=wa.defaults;var Sa=Object.freeze({__proto__:null,CategoryScale:ta,LinearScale:sa,LogarithmicScale:oa,RadialLinearScale:ga,TimeScale:wa,TimeSeriesScale:ka});return bn.register(Bn,Sa,co,Jo),bn.helpers={...Ti},bn._adapters=wn,bn.Animation=xs,bn.Animations=ys,bn.animator=mt,bn.controllers=Us.controllers.items,bn.DatasetController=Ls,bn.Element=Es,bn.elements=co,bn.Interaction=Vi,bn.layouts=Zi,bn.platforms=ps,bn.Scale=$s,bn.Ticks=Is,Object.assign(bn,Bn,Sa,co,Jo,ps),bn.Chart=bn,"undefined"!=typeof window&&(window.Chart=bn),bn}));
\ No newline at end of file diff --git a/assets/icons/about.svg b/assets/icons/about.svg index b2a0001..ca9e3ce 100644 --- a/assets/icons/about.svg +++ b/assets/icons/about.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M23.3 33h1.55V22H23.3Zm.7-13.7q.45 0 .75-.3t.3-.75q0-.5-.3-.8-.3-.3-.75-.3-.5 0-.775.3t-.275.8q0 .45.3.75t.75.3ZM24 42q-3.75 0-7-1.425T11.3 36.7Q8.85 34.25 7.425 31 6 27.75 6 24t1.425-7.025q1.425-3.275 3.875-5.7 2.45-2.425 5.7-3.85Q20.25 6 24 6t7.025 1.425q3.275 1.425 5.7 3.85 2.425 2.425 3.85 5.7Q42 20.25 42 24q0 3.75-1.425 7t-3.85 5.7q-2.425 2.45-5.7 3.875Q27.75 42 24 42Zm.05-1.55q6.8 0 11.6-4.8t4.8-11.7q0-6.8-4.775-11.6T24 7.55q-6.85 0-11.65 4.775Q7.55 17.1 7.55 24q0 6.85 4.8 11.65 4.8 4.8 11.7 4.8ZM24 24Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.999c5.524 0 10.002 4.478 10.002 10.002 0 5.523-4.478 10.001-10.002 10.001-5.524 0-10.002-4.478-10.002-10.001C1.998 6.477 6.476 1.999 12 1.999Zm0 1.5a8.502 8.502 0 1 0 0 17.003A8.502 8.502 0 0 0 12 3.5Zm-.004 7a.75.75 0 0 1 .744.648l.007.102.003 5.502a.75.75 0 0 1-1.493.102l-.007-.101-.003-5.502a.75.75 0 0 1 .75-.75ZM12 7.003a.999.999 0 1 1 0 1.997.999.999 0 0 1 0-1.997Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/actions.svg b/assets/icons/actions.svg index 7b36d3d..3e73e7d 100644 --- a/assets/icons/actions.svg +++ b/assets/icons/actions.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M6 36V25.65q0-.85.5-1.85T8 22.35V17.7q0-1.55 1.075-2.625T11.7 14h9.45q1 0 1.7.45T24 15.7q.45-.8 1.15-1.25.7-.45 1.7-.45h9.45q1.55 0 2.625 1.075T40 17.7v4.65q1 .45 1.5 1.45t.5 1.85V36h-1.55v-4H7.55v4Zm18.75-13.9h13.7v-4.4q0-.95-.625-1.55-.625-.6-1.525-.6h-9.55q-.85 0-1.425.625-.575.625-.575 1.525Zm-15.2 0h13.7v-4.4q0-.9-.575-1.525-.575-.625-1.425-.625H11.7q-.9 0-1.525.625-.625.625-.625 1.525Zm-2 8.35h32.9v-4.8q0-.85-.575-1.425-.575-.575-1.425-.575H9.55q-.85 0-1.425.575-.575.575-.575 1.425Zm32.9 0H7.55h32.9Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.75 4h10.5a2.75 2.75 0 0 1 2.745 2.582L20 6.75v3.354a2.752 2.752 0 0 1 1.994 2.459l.006.187v7.5a.75.75 0 0 1-1.493.102l-.007-.102V18h-17v2.25a.75.75 0 0 1-.648.743L2.75 21a.75.75 0 0 1-.743-.648L2 20.25v-7.5c0-1.259.846-2.32 2-2.647V6.75a2.75 2.75 0 0 1 2.582-2.745L6.75 4Zm12.5 7.5H4.75a1.25 1.25 0 0 0-1.244 1.122l-.006.128v3.75h17v-3.75a1.25 1.25 0 0 0-1.122-1.243l-.128-.007Zm-2-6H6.75a1.25 1.25 0 0 0-1.244 1.122L5.5 6.75V10H7a1 1 0 0 1 1-1h2a1 1 0 0 1 .993.883L11 10h2a1 1 0 0 1 1-1h2a1 1 0 0 1 .993.883L17 10h1.5V6.75a1.25 1.25 0 0 0-1.122-1.244L17.25 5.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/add.svg b/assets/icons/add.svg index a769676..79a2511 100644 --- a/assets/icons/add.svg +++ b/assets/icons/add.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M23.3 33h1.55v-8.15H33V23.3h-8.15V15H23.3v8.3H15v1.55h8.3Zm.7 9q-3.75 0-7-1.425T11.3 36.7Q8.85 34.25 7.425 31 6 27.75 6 24t1.425-7.025q1.425-3.275 3.875-5.7 2.45-2.425 5.7-3.85Q20.25 6 24 6t7.025 1.425q3.275 1.425 5.7 3.85 2.425 2.425 3.85 5.7Q42 20.25 42 24q0 3.75-1.425 7t-3.85 5.7q-2.425 2.45-5.7 3.875Q27.75 42 24 42Zm.05-1.55q6.8 0 11.6-4.8t4.8-11.7q0-6.8-4.775-11.6T24 7.55q-6.85 0-11.65 4.775Q7.55 17.1 7.55 24q0 6.85 4.8 11.65 4.8 4.8 11.7 4.8ZM24 24Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2Zm0 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17ZM12 7a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 12 7Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/admin.svg b/assets/icons/admin.svg index a9426d4..fe00d1b 100644 --- a/assets/icons/admin.svg +++ b/assets/icons/admin.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m20.65 42-.8-5.7q-1.1-.35-2.425-1.1-1.325-.75-2.225-1.6L9.9 36l-3.3-5.9 4.7-3.5q-.1-.6-.175-1.275-.075-.675-.075-1.275 0-.6.075-1.25t.175-1.4l-4.7-3.5 3.3-5.85 5.25 2.35q1.05-.85 2.3-1.575 1.25-.725 2.35-1.075L20.65 6h6.7l.8 5.75q1.25.5 2.375 1.125T32.7 14.4l5.4-2.35 3.3 5.85-4.85 3.55q.2.7.25 1.325.05.625.05 1.225 0 .55-.075 1.175t-.225 1.375l4.85 3.55-3.35 5.9-5.35-2.4q-1.1.9-2.225 1.6-1.125.7-2.325 1.05l-.8 5.75Zm3.25-13.25q2 0 3.375-1.375T28.65 24q0-2-1.375-3.375T23.9 19.25q-2 0-3.4 1.375T19.1 24q0 2 1.4 3.375t3.4 1.375Zm0-1.5q-1.35 0-2.3-.95-.95-.95-.95-2.3 0-1.35.95-2.3.95-.95 2.3-.95 1.35 0 2.275.95.925.95.925 2.3 0 1.35-.925 2.3-.925.95-2.275.95ZM24 24Zm-2.1 16.45h4.15l.75-5.55q1.5-.4 2.8-1.125 1.3-.725 2.6-1.975l5.15 2.2 2-3.45-4.55-3.4q.2-.9.3-1.65.1-.75.1-1.5 0-.8-.1-1.525-.1-.725-.3-1.575l4.6-3.45-2-3.45-5.25 2.2q-.95-1.05-2.475-2-1.525-.95-2.925-1.1l-.65-5.55h-4.2l-.6 5.5q-1.65.3-2.95 1.075-1.3.775-2.6 2.025L10.6 14l-2 3.45 4.5 3.35q-.2.75-.325 1.55t-.125 1.7q0 .8.125 1.575.125.775.325 1.525l-4.5 3.4 2 3.45 5.1-2.15q1.2 1.2 2.55 1.95 1.35.75 3 1.15Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.012 2.25c.734.008 1.465.093 2.182.253a.75.75 0 0 1 .582.649l.17 1.527a1.384 1.384 0 0 0 1.927 1.116l1.401-.615a.75.75 0 0 1 .85.174 9.792 9.792 0 0 1 2.204 3.792.75.75 0 0 1-.271.825l-1.242.916a1.381 1.381 0 0 0 0 2.226l1.243.915a.75.75 0 0 1 .272.826 9.797 9.797 0 0 1-2.204 3.792.75.75 0 0 1-.848.175l-1.407-.617a1.38 1.38 0 0 0-1.926 1.114l-.169 1.526a.75.75 0 0 1-.572.647 9.518 9.518 0 0 1-4.406 0 .75.75 0 0 1-.572-.647l-.168-1.524a1.382 1.382 0 0 0-1.926-1.11l-1.406.616a.75.75 0 0 1-.849-.175 9.798 9.798 0 0 1-2.204-3.796.75.75 0 0 1 .272-.826l1.243-.916a1.38 1.38 0 0 0 0-2.226l-1.243-.914a.75.75 0 0 1-.271-.826 9.793 9.793 0 0 1 2.204-3.792.75.75 0 0 1 .85-.174l1.4.615a1.387 1.387 0 0 0 1.93-1.118l.17-1.526a.75.75 0 0 1 .583-.65c.717-.159 1.45-.243 2.201-.252Zm0 1.5a9.135 9.135 0 0 0-1.354.117l-.109.977A2.886 2.886 0 0 1 6.525 7.17l-.898-.394a8.293 8.293 0 0 0-1.348 2.317l.798.587a2.881 2.881 0 0 1 0 4.643l-.799.588c.32.842.776 1.626 1.348 2.322l.905-.397a2.882 2.882 0 0 1 4.017 2.318l.11.984c.889.15 1.798.15 2.687 0l.11-.984a2.881 2.881 0 0 1 4.018-2.322l.905.396a8.296 8.296 0 0 0 1.347-2.318l-.798-.588a2.881 2.881 0 0 1 0-4.643l.796-.587a8.293 8.293 0 0 0-1.348-2.317l-.896.393a2.884 2.884 0 0 1-4.023-2.324l-.11-.976a8.988 8.988 0 0 0-1.333-.117ZM12 8.25a3.75 3.75 0 1 1 0 7.5 3.75 3.75 0 0 1 0-7.5Zm0 1.5a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/bitset.svg b/assets/icons/bitset.svg index c842261..632b184 100644 --- a/assets/icons/bitset.svg +++ b/assets/icons/bitset.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M27 17.25V15.7h6.25V7h1.5v8.7H41v1.55ZM33.25 41V22.75h1.5V41Zm-20 0v-8.45H7V31h14v1.55h-6.25V41Zm0-15.55V7h1.5v18.45Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8.75 13.5a3.251 3.251 0 0 1 3.163 2.498L21.25 16a.75.75 0 0 1 .102 1.493l-.102.007h-9.337a3.251 3.251 0 0 1-6.326 0H2.75a.75.75 0 0 1-.102-1.493L2.75 16h2.837a3.251 3.251 0 0 1 3.163-2.5Zm0 1.5a1.75 1.75 0 0 0-1.652 1.172l-.021.063-.039.148a1.756 1.756 0 0 0 .02.815l.04.13.025.069a1.75 1.75 0 0 0 3.28-.069l.04-.13-.018.06a1.75 1.75 0 0 0 .048-.815l-.03-.137-.02-.07-.047-.134A1.75 1.75 0 0 0 8.75 15Zm6.5-11a3.251 3.251 0 0 1 3.163 2.5h2.837a.75.75 0 0 1 .102 1.493L21.25 8h-2.837a3.251 3.251 0 0 1-6.326 0H2.75a.75.75 0 0 1-.102-1.493L2.75 6.5l9.337-.002A3.251 3.251 0 0 1 15.25 4Zm0 1.5a1.75 1.75 0 0 0-1.652 1.173l-.021.062-.038.148a1.757 1.757 0 0 0 .019.815l.04.13.025.069a1.75 1.75 0 0 0 3.28-.068l.04-.131-.018.06a1.75 1.75 0 0 0 .048-.815l-.03-.137-.02-.07-.047-.134A1.75 1.75 0 0 0 15.25 5.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/byfront.svg b/assets/icons/byfront.svg index a3089f5..054d7b6 100644 --- a/assets/icons/byfront.svg +++ b/assets/icons/byfront.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M19.3 37.4q-5.75-1.55-9.5-6.325T6.05 20q0-1.75.325-3.425.325-1.675.975-3.325L2.55 16l-.7-1.3 7.35-4.3 4.3 7.4-1.35.8-3.1-5.35q-.7 1.6-1.075 3.325T7.6 20.05q0 5.85 3.575 10.225t8.975 5.775Zm11.6-25.85V10H37q-2.35-3.05-5.75-4.725Q27.85 3.6 24 3.6q-3.5 0-6.5 1.325T12.25 8.6l-.8-1.5q2.45-2.35 5.625-3.675Q20.25 2.1 23.95 2.1q4.1 0 7.725 1.7T37.9 8.65V3h1.5v8.55Zm-.2 30.25-7.35-4.3 4.3-7.35 1.25.8-3.1 5.4q6.2-.7 10.4-5.325t4.2-10.975q0-1.3-.2-2.55-.2-1.25-.55-2.4h1.65q.3 1.15.45 2.4.15 1.25.15 2.5 0 6.75-4.3 11.75t-10.85 6l4.75 2.75Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m14.61 2.47-.077-.067a.748.748 0 0 0-.983.067l-.068.078a.755.755 0 0 0 .068.987l1.971 1.977H8.5l-.233.004C4.785 5.639 2 8.51 2 12.036c0 1.69.64 3.23 1.692 4.39l.072.069a.751.751 0 0 0 1.08-1.033l-.2-.231A5.009 5.009 0 0 1 3.5 12.035c0-2.771 2.239-5.018 5-5.018h6.881l-1.832 1.84-.067.078a.755.755 0 0 0 .068.987.748.748 0 0 0 1.06 0l3.182-3.193.067-.078a.755.755 0 0 0-.067-.987L14.61 2.47Zm5.62 5.101a.751.751 0 0 0-1.05 1.066 5.01 5.01 0 0 1 1.32 3.398c0 2.772-2.239 5.019-5 5.019H8.558l1.905-1.911.074-.086a.755.755 0 0 0-.007-.902l-.067-.077-.084-.073a.748.748 0 0 0-.9.006l-.076.067-3.182 3.194-.073.085a.755.755 0 0 0 .006.902l.067.077 3.182 3.194.084.072c.293.22.71.195.976-.073a.755.755 0 0 0 .068-.987l-.068-.077-1.899-1.906H15.5l.233-.004C19.215 18.432 22 15.56 22 12.035a6.513 6.513 0 0 0-1.697-4.395l-.073-.069Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/compare.svg b/assets/icons/compare.svg index db51639..e7b5ecf 100644 --- a/assets/icons/compare.svg +++ b/assets/icons/compare.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m15.95 38.6-1.1-1.1 6.6-6.55H5V29.4h16.45l-6.6-6.6 1.1-1.1 8.45 8.45Zm16.1-12.3-8.45-8.45 8.45-8.45 1.1 1.05-6.6 6.6H43v1.55H26.55l6.6 6.6Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m14.783 2.22 4.495 4.494a.75.75 0 0 1 .073.976l-.072.085-4.495 4.504a.75.75 0 0 1-1.135-.975l.073-.084 3.217-3.223H5.243A.75.75 0 0 1 4.5 7.35l-.007-.101a.75.75 0 0 1 .648-.743l.102-.007 11.697-.001-3.218-3.217a.75.75 0 0 1-.072-.976l.072-.084a.75.75 0 0 1 .977-.073l.084.073 4.495 4.494-4.495-4.494ZM19.5 16.65l.006.1a.75.75 0 0 1-.648.744l-.102.007L7.063 17.5l3.22 3.22a.75.75 0 0 1 .074.976l-.073.084a.75.75 0 0 1-.976.073l-.085-.072-4.5-4.497a.75.75 0 0 1-.073-.976l.073-.084 4.5-4.504a.75.75 0 0 1 1.134.976l-.073.084L7.066 16h11.692a.75.75 0 0 1 .743.65l.006.1-.006-.1Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/complete.svg b/assets/icons/complete.svg index e6a8a86..b291037 100644 --- a/assets/icons/complete.svg +++ b/assets/icons/complete.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m21.05 31.75 12.8-12.8-1.2-1.15-11.6 11.65-5.85-5.85-1.15 1.15ZM24 42q-3.7 0-6.975-1.425Q13.75 39.15 11.3 36.7 8.85 34.25 7.425 31 6 27.75 6 24t1.425-7.025q1.425-3.275 3.875-5.7 2.45-2.425 5.7-3.85Q20.25 6 24 6t7.025 1.425q3.275 1.425 5.7 3.85 2.425 2.425 3.85 5.7Q42 20.25 42 24q0 3.7-1.425 6.975-1.425 3.275-3.85 5.725-2.425 2.45-5.7 3.875Q27.75 42 24 42Zm0-1.55q6.85 0 11.65-4.8 4.8-4.8 4.8-11.65 0-6.85-4.8-11.65-4.8-4.8-11.65-4.8-6.85 0-11.65 4.8-4.8 4.8-4.8 11.65 0 6.85 4.8 11.65 4.8 4.8 11.65 4.8ZM24 24Z" fill="#aefcae"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2Zm0 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm-1.25 9.94 4.47-4.47a.75.75 0 0 1 1.133.976l-.073.084-5 5a.75.75 0 0 1-.976.073l-.084-.073-2.5-2.5a.75.75 0 0 1 .976-1.133l.084.073 1.97 1.97 4.47-4.47-4.47 4.47Z" fill="#aefcae"/></svg>
\ No newline at end of file diff --git a/assets/icons/dashboard.svg b/assets/icons/dashboard.svg index 984a8b7..8e5328f 100644 --- a/assets/icons/dashboard.svg +++ b/assets/icons/dashboard.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M26.75 18.7V8H40v10.7ZM8 23.75V8h13.25v15.75ZM26.75 40V24.25H40V40ZM8 40V29.3h13.25V40Zm1.55-17.75H19.7V9.55H9.55Zm18.75 16.2h10.15v-12.7H28.3Zm0-21.3h10.15v-7.6H28.3ZM9.55 38.45H19.7v-7.6H9.55Zm10.15-16.2Zm8.6-5.1Zm0 8.6Zm-8.6 5.1Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18.25 3A2.75 2.75 0 0 1 21 5.75v12.5A2.75 2.75 0 0 1 18.25 21H5.75A2.75 2.75 0 0 1 3 18.25V5.75A2.75 2.75 0 0 1 5.75 3h12.5Zm0 1.5H5.75c-.69 0-1.25.56-1.25 1.25v12.5c0 .69.56 1.25 1.25 1.25h12.5c.69 0 1.25-.56 1.25-1.25V5.75c0-.69-.56-1.25-1.25-1.25Zm-8.498 8c.966 0 1.75.784 1.75 1.75v2A1.75 1.75 0 0 1 9.752 18h-2a1.75 1.75 0 0 1-1.75-1.75v-2c0-.966.783-1.75 1.75-1.75h2Zm6.497 0c.967 0 1.75.784 1.75 1.75v2A1.75 1.75 0 0 1 16.25 18h-2a1.75 1.75 0 0 1-1.75-1.75v-2c0-.966.784-1.75 1.75-1.75h2ZM9.752 14h-2a.25.25 0 0 0-.25.25v2c0 .138.112.25.25.25h2a.25.25 0 0 0 .25-.25v-2a.25.25 0 0 0-.25-.25Zm6.497 0h-2a.25.25 0 0 0-.25.25v2c0 .138.112.25.25.25h2a.25.25 0 0 0 .25-.25v-2a.25.25 0 0 0-.25-.25ZM9.751 6c.966 0 1.75.784 1.75 1.75v2a1.75 1.75 0 0 1-1.75 1.75h-2A1.75 1.75 0 0 1 6 9.75v-2C6 6.784 6.784 6 7.75 6h2Zm6.497 0c.967 0 1.75.784 1.75 1.75v2a1.75 1.75 0 0 1-1.75 1.75h-2a1.75 1.75 0 0 1-1.75-1.75v-2c0-.966.784-1.75 1.75-1.75h2ZM9.751 7.5h-2a.25.25 0 0 0-.25.25v2c0 .138.112.25.25.25h2a.25.25 0 0 0 .25-.25v-2a.25.25 0 0 0-.25-.25Zm6.497 0h-2a.25.25 0 0 0-.25.25v2c0 .138.112.25.25.25h2a.25.25 0 0 0 .25-.25v-2a.25.25 0 0 0-.25-.25Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/debug.svg b/assets/icons/debug.svg index e147a29..ec074f1 100644 --- a/assets/icons/debug.svg +++ b/assets/icons/debug.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M24 40q-2.7 0-5-1.325T15.45 35h-5.7v-1.55h4.95q-.55-1.6-.55-3.275V26.85h-4.4V25.3h4.4q0-1.7-.025-3.425-.025-1.725.625-3.325h-5V17h5.8q.75-1.45 1.975-2.475Q18.75 13.5 20.2 12.9l-3.9-3.85 1-.95 4.4 4.35q1.2-.35 2.375-.35t2.325.35l4.45-4.35 1 .95L28 12.9q1.45.6 2.6 1.65 1.15 1.05 1.95 2.45h5.7v1.55h-5q.7 1.6.65 3.325-.05 1.725-.05 3.425h4.4v1.55h-4.4v3.325q0 1.675-.55 3.275h4.95V35h-5.7q-1.2 2.4-3.5 3.7Q26.75 40 24 40Zm0-1.55q3.45 0 5.875-2.425T32.3 30.15V22q0-3.45-2.425-5.875T24 13.7q-3.45 0-5.875 2.425T15.7 22v8.15q0 3.45 2.425 5.875T24 38.45ZM20.6 31h6.8v-1.55h-6.8Zm0-8.3h6.8v-1.55h-6.8Zm3.4 3.4Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.5 2.751a.75.75 0 0 0-1.5 0v.752c0 .633.196 1.22.53 1.703A3.753 3.753 0 0 0 7.01 8.49h-.257a2.25 2.25 0 0 1-2.24-2.26l.006-1.485a.75.75 0 1 0-1.5-.006l-.007 1.485A3.75 3.75 0 0 0 6.747 9.99H7v1.51H2.75a.75.75 0 0 0 0 1.5H7v1.992h-.253a3.75 3.75 0 0 0-3.735 3.765l.007 1.486a.75.75 0 0 0 1.5-.006l-.007-1.486a2.25 2.25 0 0 1 2.241-2.259H7.226a5.002 5.002 0 0 0 9.548 0H17.247a2.25 2.25 0 0 1 2.24 2.26l-.006 1.485a.75.75 0 0 0 1.5.006l.006-1.486a3.75 3.75 0 0 0-3.734-3.765H17V13h4.251a.75.75 0 0 0 0-1.5H17V9.99h.253a3.75 3.75 0 0 0 3.735-3.766L20.98 4.74a.75.75 0 0 0-1.5.006l.006 1.486a2.25 2.25 0 0 1-2.24 2.259h-.256a3.753 3.753 0 0 0-2.52-3.284c.333-.484.529-1.07.529-1.703v-.752a.75.75 0 0 0-1.5 0v.752a1.5 1.5 0 0 1-3 0v-.752Zm-2 6.002a2.25 2.25 0 0 1 2.25-2.25h2.5a2.25 2.25 0 0 1 2.25 2.25V15a3.5 3.5 0 1 1-7 0V8.753Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/delete.svg b/assets/icons/delete.svg index 0584654..ccfd685 100644 --- a/assets/icons/delete.svg +++ b/assets/icons/delete.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M14.8 40q-1.15 0-1.975-.825Q12 38.35 12 37.25V11.3h-2V9.75h7.7v-1.3h12.6v1.3H38v1.55h-2v25.95q0 1.15-.825 1.95T33.2 40Zm19.65-28.7h-20.9v25.95q0 .5.375.85t.875.35h18.4q.5 0 .875-.375t.375-.825Zm-14.7 23h1.55V15.4h-1.55Zm6.95 0h1.55V15.4H26.7Zm-13.15-23V38.45v-1.2Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.75a3.25 3.25 0 0 1 3.245 3.066L15.25 5h5.25a.75.75 0 0 1 .102 1.493L20.5 6.5h-.796l-1.28 13.02a2.75 2.75 0 0 1-2.561 2.474l-.176.006H8.313a2.75 2.75 0 0 1-2.714-2.307l-.023-.174L4.295 6.5H3.5a.75.75 0 0 1-.743-.648L2.75 5.75a.75.75 0 0 1 .648-.743L3.5 5h5.25A3.25 3.25 0 0 1 12 1.75Zm6.197 4.75H5.802l1.267 12.872a1.25 1.25 0 0 0 1.117 1.122l.127.006h7.374c.6 0 1.109-.425 1.225-1.002l.02-.126L18.196 6.5ZM13.75 9.25a.75.75 0 0 1 .743.648L14.5 10v7a.75.75 0 0 1-1.493.102L13 17v-7a.75.75 0 0 1 .75-.75Zm-3.5 0a.75.75 0 0 1 .743.648L11 10v7a.75.75 0 0 1-1.493.102L9.5 17v-7a.75.75 0 0 1 .75-.75Zm1.75-6a1.75 1.75 0 0 0-1.744 1.606L10.25 5h3.5A1.75 1.75 0 0 0 12 3.25Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/disclaimers.svg b/assets/icons/disclaimers.svg index a2a71a5..03b9c57 100644 --- a/assets/icons/disclaimers.svg +++ b/assets/icons/disclaimers.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M24 32.9q.5 0 .775-.275t.275-.775q0-.5-.275-.775T24 30.8q-.5 0-.775.275t-.275.775q0 .5.275.775T24 32.9Zm-.7-6.45h1.55v-12.3H23.3ZM24 42q-3.75 0-7-1.425T11.3 36.7Q8.85 34.25 7.425 31 6 27.75 6 24t1.425-7.025q1.425-3.275 3.875-5.7 2.45-2.425 5.7-3.85Q20.25 6 24 6t7.025 1.425q3.275 1.425 5.7 3.85 2.425 2.425 3.85 5.7Q42 20.25 42 24q0 3.75-1.425 7t-3.85 5.7q-2.425 2.45-5.7 3.875Q27.75 42 24 42Zm.05-1.55q6.8 0 11.6-4.8t4.8-11.7q0-6.8-4.775-11.6T24 7.55q-6.85 0-11.65 4.775Q7.55 17.1 7.55 24q0 6.85 4.8 11.65 4.8 4.8 11.7 4.8ZM24 24Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 6.5a.75.75 0 0 1 .75.75v6.25a.75.75 0 0 1-1.5 0V7.25A.75.75 0 0 1 12 6.5ZM12 17.498a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" fill="#000000"/><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10a9.96 9.96 0 0 1-4.587-1.112l-3.826 1.067a1.25 1.25 0 0 1-1.54-1.54l1.068-3.823A9.96 9.96 0 0 1 2 12C2 6.477 6.477 2 12 2Zm0 1.5A8.5 8.5 0 0 0 3.5 12c0 1.47.373 2.883 1.073 4.137l.15.27-1.112 3.984 3.987-1.112.27.15A8.5 8.5 0 1 0 12 3.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/docs.svg b/assets/icons/docs.svg index 2fff0cf..04b93d3 100644 --- a/assets/icons/docs.svg +++ b/assets/icons/docs.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M14.95 33h11.9v-1.55h-11.9Zm0-8.25h18.1v-1.5h-18.1Zm0-8.2h18.1V15h-18.1ZM10.75 40q-1.15 0-1.95-.8T8 37.25v-26.5q0-1.15.8-1.95t1.95-.8h26.5q1.15 0 1.95.8t.8 1.95v26.5q0 1.15-.8 1.95t-1.95.8Zm0-1.55h26.5q.45 0 .825-.375.375-.375.375-.825v-26.5q0-.45-.375-.825-.375-.375-.825-.375h-26.5q-.45 0-.825.375-.375.375-.375.825v26.5q0 .45.375.825.375.375.825.375Zm-1.2-28.9V38.45 9.55Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 12.25a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0Zm.75 2.25a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM7 18.25a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0Zm3.75-6.75a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5h-5.5ZM10 15.25a.75.75 0 0 1 .75-.75h5.5a.75.75 0 0 1 0 1.5h-5.5a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5h-5.5Zm8.664-9.086-5.829-5.828a.493.493 0 0 0-.049-.04.626.626 0 0 1-.036-.03 2.072 2.072 0 0 0-.219-.18.652.652 0 0 0-.08-.044l-.048-.024-.05-.029c-.054-.031-.109-.063-.166-.087a1.977 1.977 0 0 0-.624-.138c-.02-.001-.04-.004-.059-.007A.605.605 0 0 0 12.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9.828a2 2 0 0 0-.586-1.414ZM18.5 20a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5h6V8a2 2 0 0 0 2 2h4.5v10Zm-5-15.379L17.378 8.5H14a.5.5 0 0 1-.5-.5V4.621Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/down.svg b/assets/icons/down.svg index f53b64f..ad28be7 100644 --- a/assets/icons/down.svg +++ b/assets/icons/down.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M9 41v-1.55h30V41Zm15-7.45-8.45-8.5 1.1-1.1 6.6 6.6V7h1.5v23.55l6.5-6.5 1.15 1.1Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m16.53 11.72-.084-.074a.75.75 0 0 0-.977.073l-2.72 2.72v-6.69l-.007-.102A.75.75 0 0 0 12 6.999l-.101.007a.75.75 0 0 0-.649.743v6.692l-2.72-2.722-.084-.073a.75.75 0 0 0-.977 1.133l4 4.002.084.072a.75.75 0 0 0 .977-.072l4-4.001.073-.084a.75.75 0 0 0-.072-.977ZM1.999 12c0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.524-4.477-10-10-10s-10 4.476-10 10Zm18.5 0a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/emergency.svg b/assets/icons/emergency.svg index 498396c..03f278f 100644 --- a/assets/icons/emergency.svg +++ b/assets/icons/emergency.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M11.6 38v-1.55h2.85l3.9-13q.25-.9.95-1.45.7-.55 1.7-.55h6q1 0 1.7.55t.95 1.45l3.9 13h2.85V38Zm4.55-1.55h15.7l-3.7-12.55q-.1-.45-.425-.675Q27.4 23 26.95 23h-5.9q-.45 0-.775.225t-.425.675Zm7.1-21.15V7.75h1.5v7.55Zm10.8 4.5-1.1-1.1 5.35-5.3 1.05 1.05Zm3.4 9.75V28H45v1.55Zm-23.5-9.75-5.3-5.35L9.7 13.4l5.35 5.3ZM3 29.55V28h7.55v1.55Z" fill="rgb(220,53,69)"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m10.429 19.924 3.562-1.512a1.999 1.999 0 0 1-3.562 1.512Zm5.432-17.83c2.086 1.14 3.652 2.603 4.682 4.387 1.03 1.784 1.515 3.872 1.459 6.248a.75.75 0 0 1-1.5-.035c.05-2.112-.372-3.928-1.258-5.463-.886-1.535-2.249-2.808-4.102-3.82a.75.75 0 1 1 .72-1.317Zm-9.15 4.421a5.824 5.824 0 0 1 7.6 2.746l.098.21 1.288 2.891 1.698 1.47c.093.08.173.174.266.325l.059.114a1.25 1.25 0 0 1-.637 1.65L6.755 20.49A1.25 1.25 0 0 1 5 19.347l-.001-2.343-1.242-2.792A5.822 5.822 0 0 1 6.71 6.515Zm-1.584 7.088 1.372 3.083v2.277l9.616-4.255-1.653-1.43-1.417-3.183-.085-.182a4.321 4.321 0 0 0-5.638-2.027 4.322 4.322 0 0 0-2.195 5.717Zm10.497-7.908c.967.527 1.742 1.294 2.316 2.289.574.995.851 2.05.824 3.15a.75.75 0 1 1-1.5-.036c.02-.822-.185-1.605-.623-2.364-.438-.76-1.014-1.33-1.735-1.722a.75.75 0 0 1 .718-1.317Z" fill="rgb(220,53,69)"/></svg>
\ No newline at end of file diff --git a/assets/icons/favicon/about.png b/assets/icons/favicon/about.png Binary files differdeleted file mode 100644 index e61e6ec..0000000 --- a/assets/icons/favicon/about.png +++ /dev/null diff --git a/assets/icons/favicon/actions.png b/assets/icons/favicon/actions.png Binary files differdeleted file mode 100644 index b953234..0000000 --- a/assets/icons/favicon/actions.png +++ /dev/null diff --git a/assets/icons/favicon/add.png b/assets/icons/favicon/add.png Binary files differdeleted file mode 100644 index a966c31..0000000 --- a/assets/icons/favicon/add.png +++ /dev/null diff --git a/assets/icons/favicon/admin.png b/assets/icons/favicon/admin.png Binary files differdeleted file mode 100644 index 05907fc..0000000 --- a/assets/icons/favicon/admin.png +++ /dev/null diff --git a/assets/icons/favicon/bitset.png b/assets/icons/favicon/bitset.png Binary files differdeleted file mode 100644 index 28c9b85..0000000 --- a/assets/icons/favicon/bitset.png +++ /dev/null diff --git a/assets/icons/favicon/byfront.png b/assets/icons/favicon/byfront.png Binary files differdeleted file mode 100644 index 2c9ea80..0000000 --- a/assets/icons/favicon/byfront.png +++ /dev/null diff --git a/assets/icons/favicon/compare.png b/assets/icons/favicon/compare.png Binary files differdeleted file mode 100644 index fc93e2e..0000000 --- a/assets/icons/favicon/compare.png +++ /dev/null diff --git a/assets/icons/favicon/complete.png b/assets/icons/favicon/complete.png Binary files differdeleted file mode 100644 index eb322db..0000000 --- a/assets/icons/favicon/complete.png +++ /dev/null diff --git a/assets/icons/favicon/dashboard.png b/assets/icons/favicon/dashboard.png Binary files differdeleted file mode 100644 index d3d90c8..0000000 --- a/assets/icons/favicon/dashboard.png +++ /dev/null diff --git a/assets/icons/favicon/debug.png b/assets/icons/favicon/debug.png Binary files differdeleted file mode 100644 index fe52f23..0000000 --- a/assets/icons/favicon/debug.png +++ /dev/null diff --git a/assets/icons/favicon/delete.png b/assets/icons/favicon/delete.png Binary files differdeleted file mode 100644 index 17cd8a3..0000000 --- a/assets/icons/favicon/delete.png +++ /dev/null diff --git a/assets/icons/favicon/disclaimers.png b/assets/icons/favicon/disclaimers.png Binary files differdeleted file mode 100644 index 079fcab..0000000 --- a/assets/icons/favicon/disclaimers.png +++ /dev/null diff --git a/assets/icons/favicon/docs.png b/assets/icons/favicon/docs.png Binary files differdeleted file mode 100644 index 8e1d623..0000000 --- a/assets/icons/favicon/docs.png +++ /dev/null diff --git a/assets/icons/favicon/down.png b/assets/icons/favicon/down.png Binary files differdeleted file mode 100644 index 0a91c5c..0000000 --- a/assets/icons/favicon/down.png +++ /dev/null diff --git a/assets/icons/favicon/emergency.png b/assets/icons/favicon/emergency.png Binary files differdeleted file mode 100644 index 2e9a5fb..0000000 --- a/assets/icons/favicon/emergency.png +++ /dev/null diff --git a/assets/icons/favicon/form.png b/assets/icons/favicon/form.png Binary files differdeleted file mode 100644 index 0e00af6..0000000 --- a/assets/icons/favicon/form.png +++ /dev/null diff --git a/assets/icons/favicon/fronting.png b/assets/icons/favicon/fronting.png Binary files differdeleted file mode 100644 index 581ee43..0000000 --- a/assets/icons/favicon/fronting.png +++ /dev/null diff --git a/assets/icons/favicon/global.png b/assets/icons/favicon/global.png Binary files differdeleted file mode 100644 index 9509623..0000000 --- a/assets/icons/favicon/global.png +++ /dev/null diff --git a/assets/icons/favicon/history.png b/assets/icons/favicon/history.png Binary files differdeleted file mode 100644 index 7c71320..0000000 --- a/assets/icons/favicon/history.png +++ /dev/null diff --git a/assets/icons/favicon/home.png b/assets/icons/favicon/home.png Binary files differdeleted file mode 100644 index 70ddef5..0000000 --- a/assets/icons/favicon/home.png +++ /dev/null diff --git a/assets/icons/favicon/login.png b/assets/icons/favicon/login.png Binary files differdeleted file mode 100644 index b5dfb88..0000000 --- a/assets/icons/favicon/login.png +++ /dev/null diff --git a/assets/icons/favicon/logout.png b/assets/icons/favicon/logout.png Binary files differdeleted file mode 100644 index 8481793..0000000 --- a/assets/icons/favicon/logout.png +++ /dev/null diff --git a/assets/icons/favicon/nicknames.png b/assets/icons/favicon/nicknames.png Binary files differdeleted file mode 100644 index cb66338..0000000 --- a/assets/icons/favicon/nicknames.png +++ /dev/null diff --git a/assets/icons/favicon/none.png b/assets/icons/favicon/none.png Binary files differdeleted file mode 100644 index e17635e..0000000 --- a/assets/icons/favicon/none.png +++ /dev/null diff --git a/assets/icons/favicon/page.png b/assets/icons/favicon/page.png Binary files differdeleted file mode 100644 index 38ef4b4..0000000 --- a/assets/icons/favicon/page.png +++ /dev/null diff --git a/assets/icons/favicon/parser.png b/assets/icons/favicon/parser.png Binary files differdeleted file mode 100644 index 980aec8..0000000 --- a/assets/icons/favicon/parser.png +++ /dev/null diff --git a/assets/icons/favicon/partial.png b/assets/icons/favicon/partial.png Binary files differdeleted file mode 100644 index 9715809..0000000 --- a/assets/icons/favicon/partial.png +++ /dev/null diff --git a/assets/icons/favicon/pleasure-0.png b/assets/icons/favicon/pleasure-0.png Binary files differnew file mode 100644 index 0000000..41ddd7d --- /dev/null +++ b/assets/icons/favicon/pleasure-0.png diff --git a/assets/icons/favicon/pleasure-1.png b/assets/icons/favicon/pleasure-1.png Binary files differnew file mode 100644 index 0000000..2c3f614 --- /dev/null +++ b/assets/icons/favicon/pleasure-1.png diff --git a/assets/icons/favicon/pleasure.png b/assets/icons/favicon/pleasure.png Binary files differdeleted file mode 100644 index 71cd148..0000000 --- a/assets/icons/favicon/pleasure.png +++ /dev/null diff --git a/assets/icons/favicon/prefix-0.png b/assets/icons/favicon/prefix-0.png Binary files differnew file mode 100644 index 0000000..890c978 --- /dev/null +++ b/assets/icons/favicon/prefix-0.png diff --git a/assets/icons/favicon/prefix-1.png b/assets/icons/favicon/prefix-1.png Binary files differnew file mode 100644 index 0000000..9309529 --- /dev/null +++ b/assets/icons/favicon/prefix-1.png diff --git a/assets/icons/favicon/prefix.png b/assets/icons/favicon/prefix.png Binary files differdeleted file mode 100644 index 0183a06..0000000 --- a/assets/icons/favicon/prefix.png +++ /dev/null diff --git a/assets/icons/favicon/relations-0.png b/assets/icons/favicon/relations-0.png Binary files differnew file mode 100644 index 0000000..e6a716a --- /dev/null +++ b/assets/icons/favicon/relations-0.png diff --git a/assets/icons/favicon/relations-1.png b/assets/icons/favicon/relations-1.png Binary files differnew file mode 100644 index 0000000..9309529 --- /dev/null +++ b/assets/icons/favicon/relations-1.png diff --git a/assets/icons/favicon/relations.png b/assets/icons/favicon/relations.png Binary files differdeleted file mode 100644 index eb7cea9..0000000 --- a/assets/icons/favicon/relations.png +++ /dev/null diff --git a/assets/icons/favicon/right-0.png b/assets/icons/favicon/right-0.png Binary files differnew file mode 100644 index 0000000..d656072 --- /dev/null +++ b/assets/icons/favicon/right-0.png diff --git a/assets/icons/favicon/right-1.png b/assets/icons/favicon/right-1.png Binary files differnew file mode 100644 index 0000000..9309529 --- /dev/null +++ b/assets/icons/favicon/right-1.png diff --git a/assets/icons/favicon/right.png b/assets/icons/favicon/right.png Binary files differdeleted file mode 100644 index 310abc7..0000000 --- a/assets/icons/favicon/right.png +++ /dev/null diff --git a/assets/icons/favicon/rules-0.png b/assets/icons/favicon/rules-0.png Binary files differnew file mode 100644 index 0000000..f1ce107 --- /dev/null +++ b/assets/icons/favicon/rules-0.png diff --git a/assets/icons/favicon/rules-1.png b/assets/icons/favicon/rules-1.png Binary files differnew file mode 100644 index 0000000..9309529 --- /dev/null +++ b/assets/icons/favicon/rules-1.png diff --git a/assets/icons/favicon/rules.png b/assets/icons/favicon/rules.png Binary files differdeleted file mode 100644 index cdfd45a..0000000 --- a/assets/icons/favicon/rules.png +++ /dev/null diff --git a/assets/icons/favicon/score-0.png b/assets/icons/favicon/score-0.png Binary files differnew file mode 100644 index 0000000..4aa9f70 --- /dev/null +++ b/assets/icons/favicon/score-0.png diff --git a/assets/icons/favicon/score-1.png b/assets/icons/favicon/score-1.png Binary files differnew file mode 100644 index 0000000..9309529 --- /dev/null +++ b/assets/icons/favicon/score-1.png diff --git a/assets/icons/favicon/score.png b/assets/icons/favicon/score.png Binary files differdeleted file mode 100644 index cd4c297..0000000 --- a/assets/icons/favicon/score.png +++ /dev/null diff --git a/assets/icons/favicon/shield-0.png b/assets/icons/favicon/shield-0.png Binary files differnew file mode 100644 index 0000000..6ecfe5e --- /dev/null +++ b/assets/icons/favicon/shield-0.png diff --git a/assets/icons/favicon/shield-1.png b/assets/icons/favicon/shield-1.png Binary files differnew file mode 100644 index 0000000..fd4b6da --- /dev/null +++ b/assets/icons/favicon/shield-1.png diff --git a/assets/icons/favicon/shield.png b/assets/icons/favicon/shield.png Binary files differdeleted file mode 100644 index 4574d62..0000000 --- a/assets/icons/favicon/shield.png +++ /dev/null diff --git a/assets/icons/favicon/species-0.png b/assets/icons/favicon/species-0.png Binary files differnew file mode 100644 index 0000000..fa5d95f --- /dev/null +++ b/assets/icons/favicon/species-0.png diff --git a/assets/icons/favicon/species-1.png b/assets/icons/favicon/species-1.png Binary files differnew file mode 100644 index 0000000..fd4b6da --- /dev/null +++ b/assets/icons/favicon/species-1.png diff --git a/assets/icons/favicon/species.png b/assets/icons/favicon/species.png Binary files differdeleted file mode 100644 index 770b510..0000000 --- a/assets/icons/favicon/species.png +++ /dev/null diff --git a/assets/icons/favicon/splitting-0.png b/assets/icons/favicon/splitting-0.png Binary files differnew file mode 100644 index 0000000..91d1c5c --- /dev/null +++ b/assets/icons/favicon/splitting-0.png diff --git a/assets/icons/favicon/splitting-1.png b/assets/icons/favicon/splitting-1.png Binary files differnew file mode 100644 index 0000000..fd4b6da --- /dev/null +++ b/assets/icons/favicon/splitting-1.png diff --git a/assets/icons/favicon/splitting.png b/assets/icons/favicon/splitting.png Binary files differdeleted file mode 100644 index afe2736..0000000 --- a/assets/icons/favicon/splitting.png +++ /dev/null diff --git a/assets/icons/favicon/stats-0.png b/assets/icons/favicon/stats-0.png Binary files differnew file mode 100644 index 0000000..f379879 --- /dev/null +++ b/assets/icons/favicon/stats-0.png diff --git a/assets/icons/favicon/stats-1.png b/assets/icons/favicon/stats-1.png Binary files differnew file mode 100644 index 0000000..fd4b6da --- /dev/null +++ b/assets/icons/favicon/stats-1.png diff --git a/assets/icons/favicon/terminology-0.png b/assets/icons/favicon/terminology-0.png Binary files differnew file mode 100644 index 0000000..cb4ae80 --- /dev/null +++ b/assets/icons/favicon/terminology-0.png diff --git a/assets/icons/favicon/terminology-1.png b/assets/icons/favicon/terminology-1.png Binary files differnew file mode 100644 index 0000000..fd4b6da --- /dev/null +++ b/assets/icons/favicon/terminology-1.png diff --git a/assets/icons/favicon/terminology.png b/assets/icons/favicon/terminology.png Binary files differdeleted file mode 100644 index 96bb455..0000000 --- a/assets/icons/favicon/terminology.png +++ /dev/null diff --git a/assets/icons/favicon/together-0.png b/assets/icons/favicon/together-0.png Binary files differnew file mode 100644 index 0000000..f48cb1a --- /dev/null +++ b/assets/icons/favicon/together-0.png diff --git a/assets/icons/favicon/together-1.png b/assets/icons/favicon/together-1.png Binary files differnew file mode 100644 index 0000000..d20f64b --- /dev/null +++ b/assets/icons/favicon/together-1.png diff --git a/assets/icons/favicon/together.png b/assets/icons/favicon/together.png Binary files differdeleted file mode 100644 index 98153e9..0000000 --- a/assets/icons/favicon/together.png +++ /dev/null diff --git a/assets/icons/favicon/toys-0.png b/assets/icons/favicon/toys-0.png Binary files differnew file mode 100644 index 0000000..2e2703a --- /dev/null +++ b/assets/icons/favicon/toys-0.png diff --git a/assets/icons/favicon/toys-1.png b/assets/icons/favicon/toys-1.png Binary files differnew file mode 100644 index 0000000..d20f64b --- /dev/null +++ b/assets/icons/favicon/toys-1.png diff --git a/assets/icons/favicon/toys.png b/assets/icons/favicon/toys.png Binary files differdeleted file mode 100644 index 43f7ad9..0000000 --- a/assets/icons/favicon/toys.png +++ /dev/null diff --git a/assets/icons/favicon/travel-0.png b/assets/icons/favicon/travel-0.png Binary files differnew file mode 100644 index 0000000..a8894fe --- /dev/null +++ b/assets/icons/favicon/travel-0.png diff --git a/assets/icons/favicon/travel-1.png b/assets/icons/favicon/travel-1.png Binary files differnew file mode 100644 index 0000000..d20f64b --- /dev/null +++ b/assets/icons/favicon/travel-1.png diff --git a/assets/icons/favicon/travel.png b/assets/icons/favicon/travel.png Binary files differdeleted file mode 100644 index af9cfc9..0000000 --- a/assets/icons/favicon/travel.png +++ /dev/null diff --git a/assets/icons/favicon/travelling-0.png b/assets/icons/favicon/travelling-0.png Binary files differnew file mode 100644 index 0000000..bd38437 --- /dev/null +++ b/assets/icons/favicon/travelling-0.png diff --git a/assets/icons/favicon/travelling-1.png b/assets/icons/favicon/travelling-1.png Binary files differnew file mode 100644 index 0000000..d20f64b --- /dev/null +++ b/assets/icons/favicon/travelling-1.png diff --git a/assets/icons/favicon/travelling.png b/assets/icons/favicon/travelling.png Binary files differdeleted file mode 100644 index 582e1fd..0000000 --- a/assets/icons/favicon/travelling.png +++ /dev/null diff --git a/assets/icons/favicon/tree-0.png b/assets/icons/favicon/tree-0.png Binary files differnew file mode 100644 index 0000000..5dd2df5 --- /dev/null +++ b/assets/icons/favicon/tree-0.png diff --git a/assets/icons/favicon/tree-1.png b/assets/icons/favicon/tree-1.png Binary files differnew file mode 100644 index 0000000..d20f64b --- /dev/null +++ b/assets/icons/favicon/tree-1.png diff --git a/assets/icons/favicon/tree.png b/assets/icons/favicon/tree.png Binary files differdeleted file mode 100644 index 2041ab5..0000000 --- a/assets/icons/favicon/tree.png +++ /dev/null diff --git a/assets/icons/favicon/up-0.png b/assets/icons/favicon/up-0.png Binary files differnew file mode 100644 index 0000000..400f4cd --- /dev/null +++ b/assets/icons/favicon/up-0.png diff --git a/assets/icons/favicon/up-1.png b/assets/icons/favicon/up-1.png Binary files differnew file mode 100644 index 0000000..d20f64b --- /dev/null +++ b/assets/icons/favicon/up-1.png diff --git a/assets/icons/favicon/up.png b/assets/icons/favicon/up.png Binary files differdeleted file mode 100644 index e036bfd..0000000 --- a/assets/icons/favicon/up.png +++ /dev/null diff --git a/assets/icons/favicon/user-0.png b/assets/icons/favicon/user-0.png Binary files differnew file mode 100644 index 0000000..0b30ce7 --- /dev/null +++ b/assets/icons/favicon/user-0.png diff --git a/assets/icons/favicon/user-1.png b/assets/icons/favicon/user-1.png Binary files differnew file mode 100644 index 0000000..1c7cf77 --- /dev/null +++ b/assets/icons/favicon/user-1.png diff --git a/assets/icons/favicon/user.png b/assets/icons/favicon/user.png Binary files differdeleted file mode 100644 index af87990..0000000 --- a/assets/icons/favicon/user.png +++ /dev/null diff --git a/assets/icons/favicon/visibility-depends-0.png b/assets/icons/favicon/visibility-depends-0.png Binary files differnew file mode 100644 index 0000000..9481aae --- /dev/null +++ b/assets/icons/favicon/visibility-depends-0.png diff --git a/assets/icons/favicon/visibility-depends-1.png b/assets/icons/favicon/visibility-depends-1.png Binary files differnew file mode 100644 index 0000000..1c7cf77 --- /dev/null +++ b/assets/icons/favicon/visibility-depends-1.png diff --git a/assets/icons/favicon/visibility-depends.png b/assets/icons/favicon/visibility-depends.png Binary files differdeleted file mode 100644 index 1601ee9..0000000 --- a/assets/icons/favicon/visibility-depends.png +++ /dev/null diff --git a/assets/icons/favicon/visibility-private-0.png b/assets/icons/favicon/visibility-private-0.png Binary files differnew file mode 100644 index 0000000..cb5616b --- /dev/null +++ b/assets/icons/favicon/visibility-private-0.png diff --git a/assets/icons/favicon/visibility-private-1.png b/assets/icons/favicon/visibility-private-1.png Binary files differnew file mode 100644 index 0000000..1c7cf77 --- /dev/null +++ b/assets/icons/favicon/visibility-private-1.png diff --git a/assets/icons/favicon/visibility-private.png b/assets/icons/favicon/visibility-private.png Binary files differdeleted file mode 100644 index 1fea0f6..0000000 --- a/assets/icons/favicon/visibility-private.png +++ /dev/null diff --git a/assets/icons/favicon/visibility-public-0.png b/assets/icons/favicon/visibility-public-0.png Binary files differnew file mode 100644 index 0000000..e5088f4 --- /dev/null +++ b/assets/icons/favicon/visibility-public-0.png diff --git a/assets/icons/favicon/visibility-public-1.png b/assets/icons/favicon/visibility-public-1.png Binary files differnew file mode 100644 index 0000000..1c7cf77 --- /dev/null +++ b/assets/icons/favicon/visibility-public-1.png diff --git a/assets/icons/favicon/visibility-public.png b/assets/icons/favicon/visibility-public.png Binary files differdeleted file mode 100644 index 0b24f95..0000000 --- a/assets/icons/favicon/visibility-public.png +++ /dev/null diff --git a/assets/icons/favicon/wakeup-0.png b/assets/icons/favicon/wakeup-0.png Binary files differnew file mode 100644 index 0000000..cb5b690 --- /dev/null +++ b/assets/icons/favicon/wakeup-0.png diff --git a/assets/icons/favicon/wakeup-1.png b/assets/icons/favicon/wakeup-1.png Binary files differnew file mode 100644 index 0000000..1c7cf77 --- /dev/null +++ b/assets/icons/favicon/wakeup-1.png diff --git a/assets/icons/favicon/wakeup.png b/assets/icons/favicon/wakeup.png Binary files differdeleted file mode 100644 index 966d4fa..0000000 --- a/assets/icons/favicon/wakeup.png +++ /dev/null diff --git a/assets/icons/form.svg b/assets/icons/form.svg index b1e150f..9f7c290 100644 --- a/assets/icons/form.svg +++ b/assets/icons/form.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M10.75 42q-1.15 0-1.95-.8T8 39.25V12.3q0-1.15.8-1.95t1.95-.8h4.15v-4h1.8v4h14.75v-4h1.7v4h4.1q1.15 0 1.95.8t.8 1.95v26.95q0 1.15-.8 1.95t-1.95.8Zm0-1.55h26.5q.45 0 .825-.375.375-.375.375-.825V21H9.55v18.25q0 .45.375.825.375.375.825.375Zm-1.2-21h28.9V12.3q0-.45-.375-.825-.375-.375-.825-.375h-26.5q-.45 0-.825.375-.375.375-.375.825Zm0 0V11.1v8.35Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M21 6.25A3.25 3.25 0 0 0 17.75 3H6.25A3.25 3.25 0 0 0 3 6.25v11.5A3.25 3.25 0 0 0 6.25 21h5.772a6.471 6.471 0 0 1-.709-1.5H6.25a1.75 1.75 0 0 1-1.75-1.75V8.5h15v2.813a6.471 6.471 0 0 1 1.5.709V6.25ZM6.25 4.5h11.5c.966 0 1.75.784 1.75 1.75V7h-15v-.75c0-.966.784-1.75 1.75-1.75Z" fill="#000000"/><path d="M23 17.5a5.5 5.5 0 1 0-11 0 5.5 5.5 0 0 0 11 0Zm-5.5 0h2a.5.5 0 0 1 0 1H17a.5.5 0 0 1-.5-.491v-3.01a.5.5 0 0 1 1 0V17.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/fronting.svg b/assets/icons/fronting.svg index 842f6cc..9c29c07 100644 --- a/assets/icons/fronting.svg +++ b/assets/icons/fronting.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M9.55 40q-.65 0-1.1-.45Q8 39.1 8 38.45h1.55ZM8 34.4v-4.1h1.55v4.1Zm0-8.25V22.1h1.55v4.05ZM8 18v-4.05h1.55V18Zm5.6 22v-1.55h4.1V40Zm4.8-7.6q-1.15 0-1.975-.825-.825-.825-.825-1.975V10.75q0-1.15.825-1.95T18.4 8h18.85q1.15 0 1.95.8t.8 1.95V29.6q0 1.15-.8 1.975-.8.825-1.95.825Zm0-1.55h18.85q.45 0 .825-.4.375-.4.375-.85V10.75q0-.45-.375-.825-.375-.375-.825-.375H18.4q-.45 0-.85.375-.4.375-.4.825V29.6q0 .45.4.85.4.4.85.4ZM21.85 40v-1.55h4.05V40ZM30 40v-1.55h4.1V40Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.5 2a7.503 7.503 0 0 1 7.179 5.321 7.5 7.5 0 1 1-9.357 9.358A7.5 7.5 0 0 1 9.5 2Zm7.486 7.038.01.22L17 9.5a7.5 7.5 0 0 1-7.962 7.486 6 6 0 1 0 7.947-7.948ZM9.5 3.5a6 6 0 0 0-2.486 11.463l-.01-.22L7 14.5a7.5 7.5 0 0 1 7.962-7.486A5.999 5.999 0 0 0 9.5 3.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/global.svg b/assets/icons/global.svg index 1872822..f5a35c3 100644 --- a/assets/icons/global.svg +++ b/assets/icons/global.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M24 42q-3.75 0-7.025-1.425-3.275-1.425-5.7-3.85-2.425-2.425-3.85-5.7Q6 27.75 6 24q0-3.75 1.425-7.025 1.425-3.275 3.85-5.7 2.425-2.425 5.7-3.85Q20.25 6 24 6q3.75 0 7.025 1.425 3.275 1.425 5.7 3.85 2.425 2.425 3.85 5.7Q42 20.25 42 24q0 3.75-1.425 7.025-1.425 3.275-3.85 5.7-2.425 2.425-5.7 3.85Q27.75 42 24 42Zm-2.05-1.65V36.4q-1.75 0-2.925-1.225-1.175-1.225-1.175-2.925v-2.1l-9.9-9.9q-.15.9-.275 1.85-.125.95-.125 1.9 0 6.25 4.075 10.925Q15.7 39.6 21.95 40.35Zm14.2-5.2Q37.2 34 38 32.7q.8-1.3 1.35-2.725t.825-2.925q.275-1.5.275-3.05 0-5.1-2.775-9.325T30.15 8.6v.95q0 1.7-1.175 2.925Q27.8 13.7 26.1 13.7h-4.15v4.15q0 .85-.625 1.425-.625.575-1.475.575h-4.1V24h12.4q.9 0 1.45.6.55.6.55 1.45v6.2h2.05q1.4 0 2.475.8 1.075.8 1.475 2.1Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m10.946 2.047.005.007C11.296 2.018 11.646 2 12 2c5.522 0 10 4.477 10 10s-4.478 10-10 10a9.983 9.983 0 0 1-7.896-3.862h-.003v-.003A9.957 9.957 0 0 1 2 12c0-5.162 3.911-9.41 8.932-9.944l.014-.009ZM12 3.5l-.16.001c.123.245.255.533.374.85.347.923.666 2.282.1 3.487-.522 1.113-1.424 1.4-2.09 1.573l-.084.021c-.657.17-.91.235-1.093.514-.17.257-.144.582.061 1.25l.046.148c.082.258.18.57.23.863.064.364.082.827-.152 1.275a2.187 2.187 0 0 1-.9.945c-.341.185-.694.256-.958.302l-.093.017c-.515.09-.761.134-1 .39-.187.2-.307.553-.377 1.079-.029.214-.046.427-.064.646l-.01.117c-.02.242-.044.521-.099.76v.002a8.478 8.478 0 0 0 6.27 2.76c1.576 0 3.053-.43 4.319-1.178a4.47 4.47 0 0 1-.31-.35c-.34-.428-.786-1.164-.631-2.033.074-.418.298-.768.515-1.036a7.12 7.12 0 0 1 .72-.74l.158-.146c.179-.163.33-.301.46-.437.172-.18.21-.262.212-.267.068-.224-.015-.384-.106-.454a.304.304 0 0 0-.19-.061c-.084 0-.22.024-.401.14a.912.912 0 0 1-.836.085 1.025 1.025 0 0 1-.486-.432c-.144-.237-.225-.546-.278-.772-.04-.174-.08-.372-.115-.553l-.04-.206a4.127 4.127 0 0 0-.134-.54l-.02-.037a1.507 1.507 0 0 0-.064-.105 6.233 6.233 0 0 0-.227-.317l-.11-.143a12.686 12.686 0 0 1-.516-.712c-.196-.298-.417-.688-.487-1.104a1.46 1.46 0 0 1 .055-.734c.094-.264.265-.482.487-.649.483-.362 1.193-1.172 1.823-1.959.288-.359.544-.695.736-.95A8.46 8.46 0 0 0 12 3.5Zm5.727 2.22c-.197.263-.461.608-.757.978-.602.751-1.4 1.685-2.05 2.187.026.1.1.262.255.498.131.2.281.396.44.604l.129.17c.172.229.411.548.52.844.087.234.149.519.198.762l.049.246c.025.13.049.253.075.37.601-.172 1.201-.068 1.67.294.608.47.862 1.286.624 2.074-.11.362-.364.66-.563.869-.17.177-.372.362-.556.53l-.132.12c-.23.212-.423.4-.568.579-.148.184-.195.299-.205.356-.04.219.067.51.328.838a3.138 3.138 0 0 0 .374.392A8.48 8.48 0 0 0 20.5 12a8.478 8.478 0 0 0-2.773-6.28ZM3.5 12c0 1.398.338 2.718.936 3.881.085-.557.262-1.248.748-1.768.6-.642 1.335-.763 1.798-.839l.13-.021c.248-.044.391-.083.502-.143.088-.049.188-.128.288-.321.015-.028.042-.107.004-.325a5.236 5.236 0 0 0-.172-.636c-.02-.06-.04-.125-.06-.192-.185-.604-.48-1.602.12-2.515.522-.792 1.36-.994 1.893-1.123l.162-.04c.563-.145.883-.28 1.108-.758.295-.629.168-1.485-.146-2.32a7.615 7.615 0 0 0-.58-1.196A8.503 8.503 0 0 0 3.502 12Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/government.svg b/assets/icons/government.svg new file mode 100644 index 0000000..1de282c --- /dev/null +++ b/assets/icons/government.svg @@ -0,0 +1 @@ +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 6.25a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" fill="#000000"/><path d="M13.032 2.325a1.75 1.75 0 0 0-2.064 0L3.547 7.74c-.978.713-.473 2.26.736 2.26H4.5v5.8A2.75 2.75 0 0 0 3 18.25v1.5c0 .413.336.75.75.75h16.5a.75.75 0 0 0 .75-.75v-1.5a2.75 2.75 0 0 0-1.5-2.45V10h.217c1.21 0 1.713-1.547.736-2.26l-7.421-5.416Zm-1.18 1.211a.25.25 0 0 1 .295 0L18.95 8.5H5.05l6.803-4.964ZM18 10v5.5h-2V10h2Zm-3.5 0v5.5h-1.75V10h1.75Zm-3.25 0v5.5H9.5V10h1.75Zm-5.5 7h12.5c.69 0 1.25.56 1.25 1.25V19h-15v-.75c0-.69.56-1.25 1.25-1.25ZM6 15.5V10h2v5.5H6Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/history.svg b/assets/icons/history.svg index 96f25f0..47fc198 100644 --- a/assets/icons/history.svg +++ b/assets/icons/history.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M23.85 40q-6.35 0-10.9-4.3Q8.4 31.4 8 25.05h1.55q.45 5.65 4.525 9.525t9.775 3.875q6.1 0 10.325-4.25T38.4 23.85q0-6-4.25-10.15t-10.3-4.15q-3.05 0-5.8 1.275T13.2 14.3H18v1.55h-7.55v-7.6H12v5.05q2.3-2.45 5.375-3.875Q20.45 8 23.85 8q3.35 0 6.25 1.25t5.1 3.425q2.2 2.175 3.45 5.075 1.25 2.9 1.25 6.2 0 3.3-1.25 6.25t-3.45 5.1q-2.2 2.15-5.1 3.425Q27.2 40 23.85 40Zm6.8-8.45L23.3 24.3V13.95h1.5v9.7l6.95 6.8Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3a9 9 0 1 1-8.963 8.182.75.75 0 1 1 1.494.135 7.46 7.46 0 0 0 2.166 5.986A7.46 7.46 0 0 0 12 19.5 7.5 7.5 0 1 0 5.997 7.502h2.756a.75.75 0 0 1 .102 1.493l-.102.007H4.25a.75.75 0 0 1-.743-.648L3.5 8.252v-4.5a.75.75 0 0 1 1.493-.102L5 3.752l-.001 2.591A8.986 8.986 0 0 1 12 3Zm-.75 4a.75.75 0 0 1 .743.648L12 7.75V12h2.25a.75.75 0 0 1 .102 1.493l-.102.007h-3a.75.75 0 0 1-.743-.648l-.007-.102v-5a.75.75 0 0 1 .75-.75Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/home.svg b/assets/icons/home.svg index 5b58c4a..c8e4131 100644 --- a/assets/icons/home.svg +++ b/assets/icons/home.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M10 40V19L24.05 8.45 38 19v21H27.85V27h-7.7v13Zm1.55-1.55h7.05V25.5h10.8v12.95h7.05v-18.7l-12.4-9.35-12.5 9.35Zm12.45-14Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.55 2.532a2.25 2.25 0 0 1 2.9 0l6.75 5.692c.507.428.8 1.057.8 1.72v9.803a1.75 1.75 0 0 1-1.75 1.75h-3.5a1.75 1.75 0 0 1-1.75-1.75v-5.5a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25v5.5a1.75 1.75 0 0 1-1.75 1.75h-3.5A1.75 1.75 0 0 1 3 19.747V9.944c0-.663.293-1.292.8-1.72l6.75-5.692Zm1.933 1.147a.75.75 0 0 0-.966 0L4.767 9.37a.75.75 0 0 0-.267.573v9.803c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-5.5c0-.967.784-1.75 1.75-1.75h3.5c.966 0 1.75.783 1.75 1.75v5.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25V9.944a.75.75 0 0 0-.267-.573l-6.75-5.692Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/icongen.js b/assets/icons/icongen.js index 694b063..1d591bf 100644 --- a/assets/icons/icongen.js +++ b/assets/icons/icongen.js @@ -7,9 +7,15 @@ let files = fs.readdirSync(".").filter(i => i.endsWith(".svg")); for (let file of files) { let name = file.substring(0, file.length - path.extname(file).length); - console.log(name); - exec("convert -density 1200 -resize 1000x1000 -channel RGB -depth 32 -negate -background none " + file + " ./favicon/" + name + "-pre.png"); - exec("convert -composite -compose Dst_Over -gravity center -depth 32 -geometry 1026x1026 ./favicon/" + name + "-pre.png ../logo/logo-template.png -set colorspace RGB ./favicon/" + name + ".png"); + if (fs.existsSync("./uncolored/" + name + ".svg")) { + console.log(name + "*"); + exec("convert -density 1200 -resize 448x448 -border 56x56 -bordercolor \"rgba(0,0,0,0)\" -channel RGB -depth 32 -negate -background none ./uncolored/" + file + " ./favicon/" + name + "-pre.png"); + exec("convert -composite -compose Dst_Over -gravity center -depth 32 -geometry 512x512 ./favicon/" + name + "-pre.png ../logo/newlogo-template.png -set colorspace RGB ./favicon/" + name + ".png"); + } else { + console.log(name); + exec("convert -density 1200 -resize 448x448 -border 56x56 -bordercolor \"rgba(0,0,0,0)\" -channel RGB -depth 32 -negate -background none " + file + " ./favicon/" + name + "-pre.png"); + exec("convert -composite -compose Dst_Over -gravity center -depth 32 -geometry 512x512 ./favicon/" + name + "-pre.png ../logo/newlogo-template.png -set colorspace RGB ./favicon/" + name + ".png"); + } fs.unlinkSync("./favicon/" + name + "-pre.png"); }
\ No newline at end of file diff --git a/assets/icons/login.svg b/assets/icons/login.svg index 87d1622..d9a3995 100644 --- a/assets/icons/login.svg +++ b/assets/icons/login.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M23.75 42v-1.55h13.1q.45 0 .85-.375.4-.375.4-.825v-28.5q0-.45-.4-.825-.4-.375-.85-.375h-13.1V8h13.1q1.15 0 1.95.8t.8 1.95v28.5q0 1.15-.8 1.95t-1.95.8ZM22.7 31.5l-1.1-1.1 4.65-4.65H8.4v-1.5h17.75l-4.6-4.65 1.15-1.1 6.5 6.5Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.004c1.875 0 3.334 1.206 3.928 3.003a.75.75 0 1 1-1.425.47C14.102 4.262 13.185 3.504 12 3.504c-1.407 0-2.42.958-2.496 2.551l-.005.195v1.749h8.251a2.25 2.25 0 0 1 2.245 2.097l.005.154v9.496a2.25 2.25 0 0 1-2.096 2.245l-.154.005H6.25A2.25 2.25 0 0 1 4.005 19.9L4 19.746V10.25a2.25 2.25 0 0 1 2.096-2.245L6.25 8l1.749-.001v-1.75C8 3.712 9.71 2.005 12 2.005ZM17.75 9.5H6.25a.75.75 0 0 0-.743.648l-.007.102v9.496c0 .38.282.693.648.743l.102.007h11.5a.75.75 0 0 0 .743-.648l.007-.102V10.25a.75.75 0 0 0-.648-.744L17.75 9.5Zm-5.75 4a1.499 1.499 0 1 1 0 2.996 1.499 1.499 0 0 1 0-2.997Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/logout.svg b/assets/icons/logout.svg index bbaddd0..47dcaff 100644 --- a/assets/icons/logout.svg +++ b/assets/icons/logout.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M11.15 42Q10 42 9.2 41.2t-.8-1.95v-28.5q0-1.15.8-1.95t1.95-.8h13.1v1.55h-13.1q-.45 0-.85.375-.4.375-.4.825v28.5q0 .45.4.825.4.375.85.375h13.1V42Zm22-10.5L32 30.4l4.65-4.65h-17.8v-1.5H36.6l-4.65-4.65 1.15-1.1 6.5 6.55Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a4 4 0 0 1 4 4v2h1.75A2.25 2.25 0 0 1 20 10.25v9.5A2.25 2.25 0 0 1 17.75 22H6.25A2.25 2.25 0 0 1 4 19.75v-9.5A2.25 2.25 0 0 1 6.25 8H8V6a4 4 0 0 1 4-4Zm5.75 7.5H6.25a.75.75 0 0 0-.75.75v9.5c0 .414.336.75.75.75h11.5a.75.75 0 0 0 .75-.75v-9.5a.75.75 0 0 0-.75-.75Zm-5.75 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm0-10A2.5 2.5 0 0 0 9.5 6v2h5V6A2.5 2.5 0 0 0 12 3.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/nicknames.svg b/assets/icons/nicknames.svg index f1eef81..dab78cb 100644 --- a/assets/icons/nicknames.svg +++ b/assets/icons/nicknames.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m17.1 40 3.55-3.55H42V40Zm-9.55-1.55H9.4l22.05-22-1.9-1.9-22 22.05Zm27.2-23.15-4.05-4.05 2.1-2.15q.45-.4 1.1-.4.65 0 1.15.45L36.9 11q.4.45.4 1.1 0 .65-.45 1.1Zm-1.1 1.1L10 40H6v-4l23.6-23.65Zm-3.15-.95-.95-.9 1.9 1.9Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.75 2h3.998a.75.75 0 0 1 .102 1.493l-.102.007H12.5v17h1.245a.75.75 0 0 1 .743.648l.007.102a.75.75 0 0 1-.648.743l-.102.007H9.75a.75.75 0 0 1-.102-1.493l.102-.007H11v-17H9.75a.75.75 0 0 1-.743-.648L9 2.75a.75.75 0 0 1 .648-.743L9.75 2h3.998H9.75Zm8.496 2.997a3.253 3.253 0 0 1 3.25 3.25l.004 7.504a3.249 3.249 0 0 1-3.064 3.246l-.186.005h-4.745v-1.5h4.803A1.749 1.749 0 0 0 20 15.751l-.003-7.505a1.753 1.753 0 0 0-1.752-1.75h-4.74v-1.5h4.74Zm-8.246 0v1.5H5.25a1.75 1.75 0 0 0-1.75 1.75v7.504c0 .967.784 1.75 1.75 1.75h4.745v1.5H5.25A3.25 3.25 0 0 1 2 15.751V8.247a3.25 3.25 0 0 1 3.25-3.25H10Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/none.svg b/assets/icons/none.svg index db37798..62554a8 100644 --- a/assets/icons/none.svg +++ b/assets/icons/none.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m12.65 36.45-1.1-1.1L22.9 24 11.55 12.65l1.1-1.1L24 22.9l11.35-11.35 1.1 1.1L25.1 24l11.35 11.35-1.1 1.1L24 25.1Z" fill="#fcb4ae"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.001c5.524 0 10 4.477 10 10s-4.476 10-10 10c-5.522 0-10-4.477-10-10s4.478-10 10-10Zm0 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm-4.25 7.75h8.5a.75.75 0 0 1 .102 1.492l-.102.007h-8.5a.75.75 0 0 1-.102-1.493l.102-.007h8.5-8.5Z" fill="#fcb4ae"/></svg>
\ No newline at end of file diff --git a/assets/icons/page.svg b/assets/icons/page.svg index 73094b6..b6721e6 100644 --- a/assets/icons/page.svg +++ b/assets/icons/page.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M17 34.75h14v-1.5H17Zm0-8.2h14V25H17ZM12.75 42q-1.15 0-1.95-.8t-.8-1.95V8.75q0-1.15.8-1.95t1.95-.8h16.7L38 14.55v24.7q0 1.15-.8 1.95t-1.95.8ZM28.7 15.2V7.55H12.75q-.45 0-.825.375-.375.375-.375.825v30.5q0 .45.375.825.375.375.825.375h22.5q.45 0 .825-.375.375-.375.375-.825V15.2ZM11.55 7.55v7.65-7.65V40.45 7.55Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.75 2.001a2.25 2.25 0 0 1 2.245 2.096L20 4.25v15.498a2.25 2.25 0 0 1-2.096 2.245l-.154.005H6.25a2.25 2.25 0 0 1-2.245-2.096L4 19.75V4.251a2.25 2.25 0 0 1 2.096-2.245l.154-.005h11.5Zm0 1.5H6.25a.75.75 0 0 0-.743.648l-.007.102v15.498c0 .38.282.694.648.743l.102.007h11.5a.75.75 0 0 0 .743-.648l.007-.102V4.251a.75.75 0 0 0-.648-.743L17.75 3.5Z" fill="#000000"/><path d="M7 15.75a.75.75 0 0 1 .75-.75h8.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 0 1-.75-.75ZM7 7.75A.75.75 0 0 1 7.75 7h8.5a.75.75 0 1 1 0 1.5h-8.5A.75.75 0 0 1 7 7.75ZM7 11.75a.75.75 0 0 1 .75-.75h8.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 0 1-.75-.75Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/parser.svg b/assets/icons/parser.svg index 7819a5a..94c2068 100644 --- a/assets/icons/parser.svg +++ b/assets/icons/parser.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M6 40.15V8.75q0-1.15.8-1.95T8.75 6h30.5q1.15 0 1.95.8t.8 1.95v22.5q0 1.15-.8 1.95t-1.95.8h-27.1Zm1.55-3.75 3.95-3.95h27.75q.5 0 .85-.35t.35-.85V8.75q0-.5-.35-.85t-.85-.35H8.75q-.5 0-.85.35t-.35.85Zm0-27.65v-1.2V36.4Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5.25 18A3.25 3.25 0 0 1 2 14.75v-8.5A3.25 3.25 0 0 1 5.25 3h13.5A3.25 3.25 0 0 1 22 6.25v8.5A3.25 3.25 0 0 1 18.75 18h-5.738L8 21.75a1.25 1.25 0 0 1-1.999-1V18h-.75Zm7.264-1.5h6.236a1.75 1.75 0 0 0 1.75-1.75v-8.5a1.75 1.75 0 0 0-1.75-1.75H5.25A1.75 1.75 0 0 0 3.5 6.25v8.5c0 .966.784 1.75 1.75 1.75h2.249v3.75l5.015-3.75Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/partial.svg b/assets/icons/partial.svg index d5411ee..0daec8d 100644 --- a/assets/icons/partial.svg +++ b/assets/icons/partial.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M19 34.45 9.15 24.6l1.1-1.05L19 32.3l18.7-18.75 1.15 1.1Z" fill="#fcf7ae"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.53 12.97a.75.75 0 0 0-1.06 1.06l4.5 4.5a.75.75 0 0 0 1.06 0l11-11a.75.75 0 0 0-1.06-1.06L8.5 16.94l-3.97-3.97Z" fill="#fcf7ae"/></svg>
\ No newline at end of file diff --git a/assets/icons/pleasure.svg b/assets/icons/pleasure.svg index ff335e4..1ed49ed 100644 --- a/assets/icons/pleasure.svg +++ b/assets/icons/pleasure.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M24 24q0-3.8 2.75-6.55t6.55-2.75q3.85 0 6.575 2.75T42.6 24Zm-9.3 9.3q-3.85 0-6.575-2.75T5.4 24H24q0 3.8-2.75 6.55T14.7 33.3ZM24 24q-3.8 0-6.55-2.75T14.7 14.7q0-3.85 2.75-6.575T24 5.4Zm0 18.6V24q3.8 0 6.55 2.75t2.75 6.55q0 3.85-2.75 6.575T24 42.6Z" fill="rgb(25,135,84)"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.996a7.49 7.49 0 0 1 7.496 7.25l.004.25v4.097l1.38 3.156a1.249 1.249 0 0 1-1.145 1.75L15 18.502a3 3 0 0 1-5.995.177L9 18.499H4.275a1.251 1.251 0 0 1-1.147-1.747L4.5 13.594V9.496c0-4.155 3.352-7.5 7.5-7.5ZM13.5 18.5l-3 .002a1.5 1.5 0 0 0 2.993.145l.006-.147ZM12 3.496c-3.32 0-6 2.674-6 6v4.41L4.656 17h14.697L18 13.907V9.509l-.004-.225A5.988 5.988 0 0 0 12 3.496Zm9 4.754h2a.75.75 0 0 1 .102 1.493L23 9.75h-2a.75.75 0 0 1-.102-1.493L21 8.25Zm-20 0h2a.75.75 0 0 1 .102 1.493L3 9.75H1a.75.75 0 0 1-.102-1.493L1 8.25Zm21.6-5.7a.75.75 0 0 1-.066.977l-.084.073-2 1.5a.75.75 0 0 1-.984-1.127l.084-.073 2-1.5a.75.75 0 0 1 1.05.15ZM2.45 2.4l2 1.5a.75.75 0 1 1-.9 1.2l-2-1.5a.75.75 0 1 1 .9-1.2Z" fill="rgb(25,135,84)"/></svg>
\ No newline at end of file diff --git a/assets/icons/prefix.svg b/assets/icons/prefix.svg index 1e73b37..b1b71db 100644 --- a/assets/icons/prefix.svg +++ b/assets/icons/prefix.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m18.8 34.6-1.1-1.1 9.5-9.5-9.5-9.55 1.1-1.15L29.4 24Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m19.704 12-8.492-8.727a.75.75 0 1 1 1.075-1.046l9 9.25a.75.75 0 0 1 0 1.046l-9 9.25a.75.75 0 1 1-1.075-1.046L19.705 12Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/relations.svg b/assets/icons/relations.svg index 8c51f14..14a54ad 100644 --- a/assets/icons/relations.svg +++ b/assets/icons/relations.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M21.45 32.15H14q-3.4 0-5.775-2.375Q5.85 27.4 5.85 24q0-3.4 2.375-5.775Q10.6 15.85 14 15.85h7.45v1.55H14q-2.75 0-4.675 1.925Q7.4 21.25 7.4 24t1.925 4.675Q11.25 30.6 14 30.6h7.45Zm-4.3-7.4v-1.5H30.9v1.5Zm9.4 7.4V30.6H34q2.75 0 4.675-1.925Q40.6 26.75 40.6 24t-1.925-4.675Q36.75 17.4 34 17.4h-7.45v-1.55H34q3.4 0 5.775 2.375Q42.15 20.6 42.15 24q0 3.4-2.375 5.775Q37.4 32.15 34 32.15Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.25 3A3.25 3.25 0 0 0 3 6.25v6a3.25 3.25 0 0 0 3.25 3.25H7.5V14H6.25a1.75 1.75 0 0 1-1.75-1.75v-6c0-.966.784-1.75 1.75-1.75h6c.966 0 1.75.784 1.75 1.75v6A1.75 1.75 0 0 1 12.25 14H11v1.5h1.25a3.25 3.25 0 0 0 3.25-3.25v-6A3.25 3.25 0 0 0 12.25 3h-6Z" fill="#000000"/><path d="M10 11.75c0-.966.784-1.75 1.75-1.75h1.248V8.5H11.75a3.25 3.25 0 0 0-3.25 3.25v6A3.25 3.25 0 0 0 11.75 21h6A3.25 3.25 0 0 0 21 17.75v-6a3.25 3.25 0 0 0-3.25-3.25H16.5V10h1.25c.966 0 1.75.784 1.75 1.75v6a1.75 1.75 0 0 1-1.75 1.75h-6A1.75 1.75 0 0 1 10 17.75v-6Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/right.svg b/assets/icons/right.svg index 3c933cf..3d68582 100644 --- a/assets/icons/right.svg +++ b/assets/icons/right.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m24 38.45-1.05-1.1 12.55-12.6H9.55v-1.5H35.5l-12.55-12.6L24 9.55 38.45 24Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.001c5.524 0 10 4.477 10 10s-4.476 10-10 10c-5.522 0-10-4.477-10-10s4.478-10 10-10Zm0 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm-.352 4.053.072-.084a.75.75 0 0 1 .977-.073l.084.073 4 4a.75.75 0 0 1 .073.977l-.072.085-4.002 4a.75.75 0 0 1-1.133-.977l.073-.084 2.722-2.721H7.75a.75.75 0 0 1-.743-.648L7 12a.75.75 0 0 1 .648-.743l.102-.007h6.69l-2.72-2.72a.75.75 0 0 1-.072-.976l.072-.084-.072.084Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/rules.svg b/assets/icons/rules.svg index 633f0b2..1dcb80a 100644 --- a/assets/icons/rules.svg +++ b/assets/icons/rules.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M8.25 41v-1.55h22V41Zm11.8-11.35-9.8-9.8 2.5-2.6 9.9 9.8Zm11-11-9.8-9.9 2.6-2.5 9.8 9.8ZM41.5 38.6l-25-25 1.1-1.1 25 25Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M14.14 2.978a2.25 2.25 0 0 0-3.412-.267L7.264 6.176a2.25 2.25 0 0 0 .342 3.463l2.01 1.339-6.873 6.743a2.51 2.51 0 1 0 3.532 3.565l6.872-6.872 1.216 1.911a2.25 2.25 0 0 0 3.49.383l3.436-3.436a2.25 2.25 0 0 0-.268-3.411l-3.888-2.828a.75.75 0 0 1-.166-.166L14.14 2.978Zm-2.35.793a.75.75 0 0 1 1.136.09l.46.632L9.068 8.81l-.63-.42a.75.75 0 0 1-.114-1.154l3.465-3.465ZM10.34 9.66l3.939-3.938 1.475 2.028c.139.19.306.358.496.497L18.21 9.67l-3.852 3.851-1.054-1.657a2.25 2.25 0 0 0-.65-.664L10.34 9.66Zm4.842 5.159 4.255-4.255.702.51a.75.75 0 0 1 .09 1.138l-3.437 3.436a.75.75 0 0 1-1.163-.127l-.447-.702Zm-2.86-1.7-7.108 7.108a1.01 1.01 0 1 1-1.42-1.435l7.096-6.963.93.62c.088.058.161.134.217.222l.285.447ZM14.75 19a.75.75 0 1 0 0 1.5h-2a.75.75 0 1 0 0 1.5h8.5a.75.75 0 0 0 0-1.5h-2a.75.75 0 0 0 0-1.5h-4.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/score.svg b/assets/icons/score.svg index 742e211..fce0154 100644 --- a/assets/icons/score.svg +++ b/assets/icons/score.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M10.75 40q-1.15 0-1.95-.8T8 37.25v-26.5q0-1.15.8-1.95t1.95-.8h26.5q1.15 0 1.95.8t.8 1.95v26.5q0 1.15-.8 1.95t-1.95.8Zm7.1-13.05L26 35.1l12.45-12.5V10.75q0-.45-.375-.825-.375-.375-.825-.375h-26.5q-.45 0-.825.375-.375.375-.375.825v24.5Zm6.9-3.7v-10.8h1.55v10.8Zm5.25 0-3.7-5.4 3.7-5.4h1.95l-3.7 5.25 3.7 5.55Zm-15.55 0V17h5.1v-3h-5.1v-1.55h6.6v6.05H16v3.2h5.05v1.55Zm3.4 6.05-8.4 8.4q0 .2.35.475.35.275.85.275h26.6q.5 0 .85-.35t.35-.85V25L26 37.45Zm-8.3-18.55v27.7-28.9 1.2Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16.749 2h4.554l.1.014.099.028.06.026c.08.034.153.085.219.15l.04.044.044.057.054.09.039.09.019.064.014.064.009.095v4.532a.75.75 0 0 1-1.493.102l-.007-.102V4.559l-6.44 6.44a.75.75 0 0 1-.976.073L13 11 9.97 8.09l-5.69 5.689a.75.75 0 0 1-1.133-.977l.073-.084 6.22-6.22a.75.75 0 0 1 .976-.072l.084.072 3.03 2.91L19.438 3.5h-2.69a.75.75 0 0 1-.742-.648l-.007-.102a.75.75 0 0 1 .648-.743L16.75 2ZM3.75 17a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.75.75 0 0 1 .75-.75Zm5.75-3.25a.75.75 0 0 0-1.5 0v7.5a.75.75 0 0 0 1.5 0v-7.5ZM13.75 15a.75.75 0 0 1 .75.75v5.5a.75.75 0 0 1-1.5 0v-5.5a.75.75 0 0 1 .75-.75Zm5.75-4.25a.75.75 0 0 0-1.5 0v10.5a.75.75 0 0 0 1.5 0v-10.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/shield.svg b/assets/icons/shield.svg index 3e875bd..fe17693 100644 --- a/assets/icons/shield.svg +++ b/assets/icons/shield.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M24 41.9q-6.05-1.8-10.025-7.375Q10 28.95 10 22.05v-10.7l14-5.2 14 5.2v10.7q0 6.9-3.975 12.475Q30.05 40.1 24 41.9Zm0-1.65q5.45-1.7 8.95-6.825 3.5-5.125 3.5-11.375v-9.6L24 7.75l-12.45 4.7v9.6q0 6.25 3.5 11.375T24 40.25Zm0-16.2Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5.75A.75.75 0 0 1 3.75 5c2.663 0 5.258-.943 7.8-2.85a.75.75 0 0 1 .9 0C14.992 4.057 17.587 5 20.25 5a.75.75 0 0 1 .75.75V11c0 5.001-2.958 8.676-8.725 10.948a.75.75 0 0 1-.55 0C5.958 19.676 3 16 3 11V5.75Zm1.5.728V11c0 4.256 2.453 7.379 7.5 9.442 5.047-2.063 7.5-5.186 7.5-9.442V6.478c-2.577-.152-5.08-1.09-7.5-2.8-2.42 1.71-4.923 2.648-7.5 2.8Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/species.svg b/assets/icons/species.svg index aede58d..2a885c3 100644 --- a/assets/icons/species.svg +++ b/assets/icons/species.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M18.25 30.85q1.2 0 2.025-.825T21.1 28q0-1.2-.825-2.025t-2.025-.825q-1.2 0-2.025.825T15.4 28q0 1.2.825 2.025t2.025.825Zm11.5 0q1.2 0 2.025-.825T32.6 28q0-1.2-.825-2.025t-2.025-.825q-1.2 0-2.025.825T26.9 28q0 1.2.825 2.025t2.025.825ZM24 20.45q1.2 0 2.025-.825t.825-2.025q0-1.2-.825-2.025T24 14.75q-1.2 0-2.025.825T21.15 17.6q0 1.2.825 2.025T24 20.45ZM24 42q-3.75 0-7-1.425T11.3 36.7Q8.85 34.25 7.425 31 6 27.75 6 24t1.425-7.025q1.425-3.275 3.875-5.7 2.45-2.425 5.7-3.85Q20.25 6 24 6t7.025 1.425q3.275 1.425 5.7 3.85 2.425 2.425 3.85 5.7Q42 20.25 42 24q0 3.75-1.425 7t-3.85 5.7q-2.425 2.45-5.7 3.875Q27.75 42 24 42Zm0-1.55q6.85 0 11.65-4.8 4.8-4.8 4.8-11.65 0-6.85-4.775-11.65Q30.9 7.55 24 7.55q-6.85 0-11.65 4.775Q7.55 17.1 7.55 24q0 6.85 4.8 11.65 4.8 4.8 11.65 4.8ZM24 24Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3.533 11.25h16.934a8.5 8.5 0 0 0-16.934 0Zm16.934 1.5H3.533a8.5 8.5 0 0 0 16.934 0ZM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/splitting.svg b/assets/icons/splitting.svg index b1e150f..9f7c290 100644 --- a/assets/icons/splitting.svg +++ b/assets/icons/splitting.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M10.75 42q-1.15 0-1.95-.8T8 39.25V12.3q0-1.15.8-1.95t1.95-.8h4.15v-4h1.8v4h14.75v-4h1.7v4h4.1q1.15 0 1.95.8t.8 1.95v26.95q0 1.15-.8 1.95t-1.95.8Zm0-1.55h26.5q.45 0 .825-.375.375-.375.375-.825V21H9.55v18.25q0 .45.375.825.375.375.825.375Zm-1.2-21h28.9V12.3q0-.45-.375-.825-.375-.375-.825-.375h-26.5q-.45 0-.825.375-.375.375-.375.825Zm0 0V11.1v8.35Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M21 6.25A3.25 3.25 0 0 0 17.75 3H6.25A3.25 3.25 0 0 0 3 6.25v11.5A3.25 3.25 0 0 0 6.25 21h5.772a6.471 6.471 0 0 1-.709-1.5H6.25a1.75 1.75 0 0 1-1.75-1.75V8.5h15v2.813a6.471 6.471 0 0 1 1.5.709V6.25ZM6.25 4.5h11.5c.966 0 1.75.784 1.75 1.75V7h-15v-.75c0-.966.784-1.75 1.75-1.75Z" fill="#000000"/><path d="M23 17.5a5.5 5.5 0 1 0-11 0 5.5 5.5 0 0 0 11 0Zm-5.5 0h2a.5.5 0 0 1 0 1H17a.5.5 0 0 1-.5-.491v-3.01a.5.5 0 0 1 1 0V17.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/stats.svg b/assets/icons/stats.svg new file mode 100644 index 0000000..ed35af6 --- /dev/null +++ b/assets/icons/stats.svg @@ -0,0 +1 @@ +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 4.25a.75.75 0 0 0-1.5 0v14.5c0 .966.784 1.75 1.75 1.75h14.5a.75.75 0 0 0 0-1.5H5.25a.25.25 0 0 1-.25-.25V4.25Zm9 2.5a.75.75 0 0 1 .75-.75h5.002a.75.75 0 0 1 .75.75v5.005a.75.75 0 1 1-1.5 0V8.559L13.78 13.78a.75.75 0 0 1-1.06 0l-1.97-1.97-3.22 3.22a.75.75 0 0 1-1.06-1.06l3.75-3.75a.75.75 0 0 1 1.06 0l1.97 1.97 4.69-4.69h-3.19a.75.75 0 0 1-.75-.75Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/terminology.svg b/assets/icons/terminology.svg index c9d1247..dd8771b 100644 --- a/assets/icons/terminology.svg +++ b/assets/icons/terminology.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M12.75 42q-1.15 0-1.95-.8t-.8-1.95V8.75q0-1.15.8-1.95t1.95-.8h22.5q1.15 0 1.95.8t.8 1.95v30.5q0 1.15-.8 1.95t-1.95.8Zm0-1.55h22.5q.45 0 .825-.375.375-.375.375-.825V8.75q0-.45-.375-.825-.375-.375-.825-.375H32.9v11.9l-3.9-2.3-3.95 2.3V7.55h-12.3q-.45 0-.825.375-.375.375-.375.825v30.5q0 .45.375.825.375.375.825.375Zm-1.2 0V7.55v32.9Zm13.5-21 3.95-2.3 3.9 2.3-3.9-2.3-3.95 2.3Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 8.018a.75.75 0 0 1-.75.732c-.75 0-.75-.751-.75-.751V7.99a1.403 1.403 0 0 1 .008-.134 2.222 2.222 0 0 1 .42-1.067c.454-.613 1.27-1.062 2.585-1.039.95.017 1.793.415 2.321 1.07.537.667.718 1.57.362 2.459-.362.905-1.181 1.265-1.652 1.471l-.05.023c-.28.123-.413.187-.493.251l-.001.001v.724a.75.75 0 0 1-1.5.001V11c0-.523.252-.897.563-1.147.25-.2.565-.338.786-.436l.038-.017c.542-.239.8-.387.917-.679a.92.92 0 0 0-.138-.96c-.222-.275-.629-.502-1.179-.511-.935-.016-1.245.285-1.353.432a.722.722 0 0 0-.134.33v.006ZM12.25 15.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" fill="#000000"/><path d="M4 4.5A2.5 2.5 0 0 1 6.5 2H18a2.5 2.5 0 0 1 2.5 2.5v14.25a.75.75 0 0 1-.75.75H5.5a1 1 0 0 0 1 1h13.25a.75.75 0 0 1 0 1.5H6.5A2.5 2.5 0 0 1 4 19.5v-15Zm1.5 0V18H19V4.5a1 1 0 0 0-1-1H6.5a1 1 0 0 0-1 1Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/together.svg b/assets/icons/together.svg index e63da95..8353168 100644 --- a/assets/icons/together.svg +++ b/assets/icons/together.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m8.75 10 2.85 5.85h6.25L15 10h4.2l2.85 5.85h6.25L25.45 10h4.2l2.85 5.85h6.25L35.85 10h3.4q1.15 0 1.95.8t.8 1.95v22.5q0 1.15-.8 1.95t-1.95.8H8.75q-1.15 0-1.95-.8T6 35.25v-22.5q0-1.15.8-1.95t1.95-.8Zm-1.2 7.35v17.9q0 .5.35.85t.85.35h30.5q.5 0 .85-.35t.35-.85v-17.9Zm0 0v19.1-1.2Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m19.729 3.917.05.16.552 1.922a.75.75 0 0 1-.418.893l-.096.035L9.09 10.002h11.159a.75.75 0 0 1 .743.65l.007.1v8.499a2.75 2.75 0 0 1-2.583 2.745L18.25 22H5.75a2.75 2.75 0 0 1-2.745-2.582L3 19.25v-8.392l-.522-1.821a2.75 2.75 0 0 1 1.726-3.35l.16-.052 12.014-3.445a2.75 2.75 0 0 1 3.35 1.726Zm-.23 7.585H4.5v7.749c0 .604.429 1.108.998 1.224l.124.02.128.006H18.25a1.25 1.25 0 0 0 1.244-1.122l.006-.128v-7.749ZM6.272 6.649l-1.496.43a1.25 1.25 0 0 0-.886 1.42l.029.125.344 1.201.295-.085 1.714-3.09Zm4.756-1.363-2.717.779-1.714 3.09 2.718-.778 1.713-3.091Zm4.757-1.365-2.717.78-1.714 3.09 2.717-.778 1.714-3.092Zm1.848-.233-1.521 2.74 2.568-.737-.343-1.2a1.248 1.248 0 0 0-.704-.803Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/toys.svg b/assets/icons/toys.svg index 3fcc608..f21b085 100644 --- a/assets/icons/toys.svg +++ b/assets/icons/toys.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M24 38q-4.15 0-7.075-2.825T14 28.3h1.55q0 3.45 2.5 5.8 2.5 2.35 5.95 2.35t5.95-2.35q2.5-2.35 2.5-5.8H34q0 4.05-2.925 6.875T24 38Zm-.05-9.35L17.3 22l1.1-1.1 4.75 4.8V11.05h1.55v14.6l4.75-4.75 1.1 1.1Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 8a.75.75 0 0 1 .743.648l.007.102v10.705l2.22-2.218a.75.75 0 0 1 .976-.073l.084.072a.75.75 0 0 1 .073.977l-.073.084-3.5 3.5a.75.75 0 0 1-.976.073l-.084-.073-3.5-3.5a.75.75 0 0 1 .976-1.133l.084.072 2.22 2.219V8.75A.75.75 0 0 1 12 8Zm0-6a7 7 0 0 1 1.75 13.78v-1.564a5.5 5.5 0 1 0-3.5 0v1.563A7 7 0 0 1 12 2Zm0 2.5a4.5 4.5 0 0 1 1.751 8.647v-1.71a3 3 0 1 0-3.5 0l-.001 1.71A4.501 4.501 0 0 1 12 4.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/travel.svg b/assets/icons/travel.svg index f2b1f9d..c41a26b 100644 --- a/assets/icons/travel.svg +++ b/assets/icons/travel.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m14.4 33.6 12.35-6.8 6.85-12.4-12.4 6.85ZM24 26q-.85 0-1.425-.575Q22 24.85 22 24q0-.85.575-1.425Q23.15 22 24 22q.85 0 1.425.575Q26 23.15 26 24q0 .85-.575 1.425Q24.85 26 24 26Zm0 16q-3.7 0-6.975-1.425Q13.75 39.15 11.3 36.7 8.85 34.25 7.425 31 6 27.75 6 24t1.425-7.025q1.425-3.275 3.875-5.7 2.45-2.425 5.7-3.85Q20.25 6 24 6t7.025 1.425q3.275 1.425 5.7 3.85 2.425 2.425 3.85 5.7Q42 20.25 42 24q0 3.7-1.425 6.975-1.425 3.275-3.85 5.725-2.425 2.45-5.7 3.875Q27.75 42 24 42Zm0-1.55q6.85 0 11.65-4.8 4.8-4.8 4.8-11.65 0-6.85-4.8-11.65-4.8-4.8-11.65-4.8-6.85 0-11.65 4.8-4.8 4.8-4.8 11.65 0 6.85 4.8 11.65 4.8 4.8 11.65 4.8ZM24 24Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8.707 7.084c-1.02-.407-2.03.604-1.624 1.624l1.606 4.028a4.75 4.75 0 0 0 2.541 2.607l4.325 1.854c1.038.445 2.086-.604 1.642-1.641l-1.854-4.326a4.75 4.75 0 0 0-2.607-2.541L8.707 7.084Zm1.375 5.096-1.39-3.488 3.488 1.39a3.25 3.25 0 0 1 1.784 1.74l1.608 3.75-3.751-1.607a3.25 3.25 0 0 1-1.739-1.785Z" fill="#212121"/><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm-7.75 9h-.692A8.504 8.504 0 0 1 11 3.558v.692a.75.75 0 0 0 1.5 0v-.736A8.502 8.502 0 0 1 20.442 11h-.692a.75.75 0 0 0 0 1.5h.735a8.501 8.501 0 0 1-7.985 7.985v-.735a.75.75 0 0 0-1.5 0v.692A8.502 8.502 0 0 1 3.514 12.5h.736a.75.75 0 0 0 0-1.5Z" fill="#212121"/></svg>
\ No newline at end of file diff --git a/assets/icons/travelling.svg b/assets/icons/travelling.svg index f2b1f9d..4e701a8 100644 --- a/assets/icons/travelling.svg +++ b/assets/icons/travelling.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="m14.4 33.6 12.35-6.8 6.85-12.4-12.4 6.85ZM24 26q-.85 0-1.425-.575Q22 24.85 22 24q0-.85.575-1.425Q23.15 22 24 22q.85 0 1.425.575Q26 23.15 26 24q0 .85-.575 1.425Q24.85 26 24 26Zm0 16q-3.7 0-6.975-1.425Q13.75 39.15 11.3 36.7 8.85 34.25 7.425 31 6 27.75 6 24t1.425-7.025q1.425-3.275 3.875-5.7 2.45-2.425 5.7-3.85Q20.25 6 24 6t7.025 1.425q3.275 1.425 5.7 3.85 2.425 2.425 3.85 5.7Q42 20.25 42 24q0 3.7-1.425 6.975-1.425 3.275-3.85 5.725-2.425 2.45-5.7 3.875Q27.75 42 24 42Zm0-1.55q6.85 0 11.65-4.8 4.8-4.8 4.8-11.65 0-6.85-4.8-11.65-4.8-4.8-11.65-4.8-6.85 0-11.65 4.8-4.8 4.8-4.8 11.65 0 6.85 4.8 11.65 4.8 4.8 11.65 4.8ZM24 24Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8.707 7.084c-1.02-.407-2.03.604-1.624 1.624l1.606 4.028a4.75 4.75 0 0 0 2.541 2.607l4.325 1.854c1.038.445 2.086-.604 1.642-1.641l-1.854-4.326a4.75 4.75 0 0 0-2.607-2.541L8.707 7.084Zm1.375 5.096-1.39-3.488 3.488 1.39a3.25 3.25 0 0 1 1.784 1.74l1.608 3.75-3.751-1.607a3.25 3.25 0 0 1-1.739-1.785Z" fill="#000000"/><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm-7.75 9h-.692A8.504 8.504 0 0 1 11 3.558v.692a.75.75 0 0 0 1.5 0v-.736A8.502 8.502 0 0 1 20.442 11h-.692a.75.75 0 0 0 0 1.5h.735a8.501 8.501 0 0 1-7.985 7.985v-.735a.75.75 0 0 0-1.5 0v.692A8.502 8.502 0 0 1 3.514 12.5h.736a.75.75 0 0 0 0-1.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/tree.svg b/assets/icons/tree.svg index a0718e3..9c675fe 100644 --- a/assets/icons/tree.svg +++ b/assets/icons/tree.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M31.1 41v-6.15h-7.85v-20.2h-6.3v6.2H5V7h11.95v6.1H31.1V7H43v13.85H31.1v-6.2h-6.35v18.7h6.35V27.1H43V41ZM6.55 8.55v10.8Zm26.05 20.1v10.8Zm0-20.1v10.8Zm0 10.8h8.85V8.55H32.6Zm0 20.1h8.85v-10.8H32.6ZM6.55 19.35h8.85V8.55H6.55Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7.25 16a1.25 1.25 0 1 1 0 2.499 1.25 1.25 0 0 1 0-2.499Zm3.5.5h10.5a.75.75 0 0 1 .102 1.493L21.25 18h-10.5a.75.75 0 0 1-.102-1.493l.102-.007ZM3.25 11a1.25 1.25 0 1 1 0 2.499 1.25 1.25 0 0 1 0-2.499Zm3.5.5h14.5a.75.75 0 0 1 .102 1.493L21.25 13H6.75a.75.75 0 0 1-.102-1.493l.102-.007ZM3.25 6a1.25 1.25 0 1 1 0 2.499A1.25 1.25 0 0 1 3.25 6Zm3.5.5h14.5a.75.75 0 0 1 .102 1.493L21.25 8H6.75a.75.75 0 0 1-.102-1.493L6.75 6.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/uncolored/complete.svg b/assets/icons/uncolored/complete.svg new file mode 100644 index 0000000..0cb3ff6 --- /dev/null +++ b/assets/icons/uncolored/complete.svg @@ -0,0 +1 @@ +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2Zm0 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm-1.25 9.94 4.47-4.47a.75.75 0 0 1 1.133.976l-.073.084-5 5a.75.75 0 0 1-.976.073l-.084-.073-2.5-2.5a.75.75 0 0 1 .976-1.133l.084.073 1.97 1.97 4.47-4.47-4.47 4.47Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/uncolored/emergency.svg b/assets/icons/uncolored/emergency.svg new file mode 100644 index 0000000..27fc1b1 --- /dev/null +++ b/assets/icons/uncolored/emergency.svg @@ -0,0 +1 @@ +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m10.429 19.924 3.562-1.512a1.999 1.999 0 0 1-3.562 1.512Zm5.432-17.83c2.086 1.14 3.652 2.603 4.682 4.387 1.03 1.784 1.515 3.872 1.459 6.248a.75.75 0 0 1-1.5-.035c.05-2.112-.372-3.928-1.258-5.463-.886-1.535-2.249-2.808-4.102-3.82a.75.75 0 1 1 .72-1.317Zm-9.15 4.421a5.824 5.824 0 0 1 7.6 2.746l.098.21 1.288 2.891 1.698 1.47c.093.08.173.174.266.325l.059.114a1.25 1.25 0 0 1-.637 1.65L6.755 20.49A1.25 1.25 0 0 1 5 19.347l-.001-2.343-1.242-2.792A5.822 5.822 0 0 1 6.71 6.515Zm-1.584 7.088 1.372 3.083v2.277l9.616-4.255-1.653-1.43-1.417-3.183-.085-.182a4.321 4.321 0 0 0-5.638-2.027 4.322 4.322 0 0 0-2.195 5.717Zm10.497-7.908c.967.527 1.742 1.294 2.316 2.289.574.995.851 2.05.824 3.15a.75.75 0 1 1-1.5-.036c.02-.822-.185-1.605-.623-2.364-.438-.76-1.014-1.33-1.735-1.722a.75.75 0 0 1 .718-1.317Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/uncolored/none.svg b/assets/icons/uncolored/none.svg new file mode 100644 index 0000000..edb63f7 --- /dev/null +++ b/assets/icons/uncolored/none.svg @@ -0,0 +1 @@ +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.001c5.524 0 10 4.477 10 10s-4.476 10-10 10c-5.522 0-10-4.477-10-10s4.478-10 10-10Zm0 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm-4.25 7.75h8.5a.75.75 0 0 1 .102 1.492l-.102.007h-8.5a.75.75 0 0 1-.102-1.493l.102-.007h8.5-8.5Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/uncolored/partial.svg b/assets/icons/uncolored/partial.svg new file mode 100644 index 0000000..566d1eb --- /dev/null +++ b/assets/icons/uncolored/partial.svg @@ -0,0 +1 @@ +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.53 12.97a.75.75 0 0 0-1.06 1.06l4.5 4.5a.75.75 0 0 0 1.06 0l11-11a.75.75 0 0 0-1.06-1.06L8.5 16.94l-3.97-3.97Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/uncolored/pleasure.svg b/assets/icons/uncolored/pleasure.svg new file mode 100644 index 0000000..4f2d0d7 --- /dev/null +++ b/assets/icons/uncolored/pleasure.svg @@ -0,0 +1 @@ +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.996a7.49 7.49 0 0 1 7.496 7.25l.004.25v4.097l1.38 3.156a1.249 1.249 0 0 1-1.145 1.75L15 18.502a3 3 0 0 1-5.995.177L9 18.499H4.275a1.251 1.251 0 0 1-1.147-1.747L4.5 13.594V9.496c0-4.155 3.352-7.5 7.5-7.5ZM13.5 18.5l-3 .002a1.5 1.5 0 0 0 2.993.145l.006-.147ZM12 3.496c-3.32 0-6 2.674-6 6v4.41L4.656 17h14.697L18 13.907V9.509l-.004-.225A5.988 5.988 0 0 0 12 3.496Zm9 4.754h2a.75.75 0 0 1 .102 1.493L23 9.75h-2a.75.75 0 0 1-.102-1.493L21 8.25Zm-20 0h2a.75.75 0 0 1 .102 1.493L3 9.75H1a.75.75 0 0 1-.102-1.493L1 8.25Zm21.6-5.7a.75.75 0 0 1-.066.977l-.084.073-2 1.5a.75.75 0 0 1-.984-1.127l.084-.073 2-1.5a.75.75 0 0 1 1.05.15ZM2.45 2.4l2 1.5a.75.75 0 1 1-.9 1.2l-2-1.5a.75.75 0 1 1 .9-1.2Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/uncolored/wakeup.svg b/assets/icons/uncolored/wakeup.svg new file mode 100644 index 0000000..e6b23f2 --- /dev/null +++ b/assets/icons/uncolored/wakeup.svg @@ -0,0 +1 @@ +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3.5c-3.104 0-6 2.432-6 6.25v4.153L4.682 17h14.67l-1.354-3.093V11.75a.75.75 0 0 1 1.5 0v1.843l1.381 3.156a1.25 1.25 0 0 1-1.145 1.751H15a3.002 3.002 0 0 1-6.003 0H4.305a1.25 1.25 0 0 1-1.15-1.739l1.344-3.164V9.75C4.5 5.068 8.103 2 12 2c.86 0 1.705.15 2.5.432a.75.75 0 0 1-.502 1.413A5.964 5.964 0 0 0 12 3.5ZM12 20c.828 0 1.5-.671 1.501-1.5h-3.003c0 .829.673 1.5 1.502 1.5Z" fill="#000000"/><path d="M15.25 7h-2.5l-.101.007A.75.75 0 0 0 12.75 8.5h1.043l-1.653 2.314-.055.09A.75.75 0 0 0 12.75 12h2.5l.102-.007a.75.75 0 0 0-.102-1.493h-1.042l1.653-2.314.055-.09A.75.75 0 0 0 15.25 7ZM21.25 2h-3.5l-.101.007A.75.75 0 0 0 17.75 3.5h2.134l-2.766 4.347-.05.09A.75.75 0 0 0 17.75 9h3.5l.102-.007A.75.75 0 0 0 21.25 7.5h-2.133l2.766-4.347.05-.09A.75.75 0 0 0 21.25 2Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/up.svg b/assets/icons/up.svg index eaae635..094d395 100644 --- a/assets/icons/up.svg +++ b/assets/icons/up.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M23.25 40.95v-23.5l-6.55 6.5-1.1-1.1 8.4-8.4 8.4 8.4-1.1 1.1-6.55-6.5v23.5ZM9 8.55V7h30v1.55Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m7.47 12.281.084.073a.75.75 0 0 0 .977-.073l2.72-2.72v6.69l.006.102a.75.75 0 0 0 .743.648l.102-.006a.75.75 0 0 0 .648-.744V9.56l2.72 2.722.085.072a.75.75 0 0 0 .977-1.133l-4-4.001-.085-.073a.75.75 0 0 0-.976.073l-4.001 4-.073.085a.75.75 0 0 0 .073.976Z" fill="#000000"/><path d="M22 12.001c0-5.523-4.476-10-10-10-5.522 0-10 4.477-10 10s4.478 10 10 10c5.524 0 10-4.477 10-10Zm-18.5 0a8.5 8.5 0 1 1 17 0 8.5 8.5 0 0 1-17 0Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/user.svg b/assets/icons/user.svg index 2540260..45d534d 100644 --- a/assets/icons/user.svg +++ b/assets/icons/user.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M24 22.75q-2.5 0-4.125-1.65t-1.625-4.15q0-2.5 1.625-4.125T24 11.2q2.5 0 4.125 1.625t1.625 4.125q0 2.5-1.625 4.15Q26.5 22.75 24 22.75Zm-14 14.5v-2.9q0-1.35.75-2.375t2-1.625q2.95-1.3 5.75-1.975T24 27.7q2.7 0 5.5.675t5.7 1.975q1.3.6 2.05 1.625Q38 33 38 34.35v2.9Zm1.55-1.55h24.9v-1.35q0-.75-.5-1.475-.5-.725-1.4-1.175-2.7-1.3-5.275-1.875T24 29.25q-2.7 0-5.3.575-2.6.575-5.25 1.875-.9.45-1.4 1.175-.5.725-.5 1.475ZM24 21.2q1.8 0 3.025-1.2 1.225-1.2 1.225-3t-1.225-3.025Q25.8 12.75 24 12.75q-1.8 0-3.025 1.225Q19.75 15.2 19.75 17q0 1.8 1.225 3T24 21.2Zm0-4.2Zm0 18.7Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.754 14a2.249 2.249 0 0 1 2.25 2.249v.575c0 .894-.32 1.76-.902 2.438-1.57 1.834-3.957 2.739-7.102 2.739-3.146 0-5.532-.905-7.098-2.74a3.75 3.75 0 0 1-.898-2.435v-.577a2.249 2.249 0 0 1 2.249-2.25h11.501Zm0 1.5H6.253a.749.749 0 0 0-.75.749v.577c0 .536.192 1.054.54 1.461 1.253 1.468 3.219 2.214 5.957 2.214s4.706-.746 5.962-2.214a2.25 2.25 0 0 0 .541-1.463v-.575a.749.749 0 0 0-.749-.75ZM12 2.004a5 5 0 1 1 0 10 5 5 0 0 1 0-10Zm0 1.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/visibility-depends.svg b/assets/icons/visibility-depends.svg index a94d92b..03aac83 100644 --- a/assets/icons/visibility-depends.svg +++ b/assets/icons/visibility-depends.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M24 43.15 18.85 38h-8.1q-1.15 0-1.95-.8T8 35.25V8.75q0-1.15.8-1.95t1.95-.8h26.5q1.15 0 1.95.8t.8 1.95v26.5q0 1.15-.8 1.95t-1.95.8h-8.1Zm-13.25-6.7h8.75l4.5 4.5 4.5-4.5h8.75q.5 0 .85-.35t.35-.85V8.75q0-.5-.35-.85t-.85-.35h-26.5q-.5 0-.85.35t-.35.85v26.5q0 .5.35.85t.85.35Zm-1.2-28.9V36.45 7.55Zm14.5 24.4q.5 0 .9-.375t.4-.925q0-.5-.375-.9t-.925-.4q-.55 0-.95.4-.4.4-.4.9 0 .55.4.925t.95.375Zm.6-6.5q0-1.2.5-2.05.5-.85 1.6-2 1.45-1.45 2.05-2.55.6-1.1.6-2.4 0-2.35-1.55-3.725t-3.8-1.375q-2.05 0-3.55 1.05t-2.25 2.55l1.55.7q.65-1.2 1.6-1.95.95-.75 2.6-.75 2 0 2.925 1.075.925 1.075.925 2.475 0 1.05-.55 1.875t-1.55 1.775q-1.7 1.65-2.175 2.8-.475 1.15-.475 2.5Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.75 2A2.25 2.25 0 0 1 22 4.25v5.462a3.25 3.25 0 0 1-.952 2.298l-.026.026a6.476 6.476 0 0 0-1.43-.692l.396-.395a1.75 1.75 0 0 0 .512-1.237V4.25a.75.75 0 0 0-.75-.75h-5.465c-.465 0-.91.185-1.239.513l-8.512 8.523a1.75 1.75 0 0 0 .015 2.462l4.461 4.454a1.755 1.755 0 0 0 2.33.13c.165.487.386.947.654 1.375a3.256 3.256 0 0 1-4.043-.443L3.489 16.06a3.25 3.25 0 0 1-.003-4.596l8.5-8.51A3.25 3.25 0 0 1 14.284 2h5.465Z" fill="#000000"/><path d="M17 5.502a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM23 17.5a5.5 5.5 0 1 0-11 0 5.5 5.5 0 0 0 11 0Zm-6.125 3.005a.625.625 0 1 1 1.25 0 .625.625 0 0 1-1.25 0Zm-1.228-4.548c-.011-1.137.805-1.954 1.853-1.954 1.031 0 1.853.846 1.853 1.95 0 .566-.185.913-.663 1.447l-.265.29-.101.116c-.248.292-.324.462-.324.695a.5.5 0 1 1-1 0c0-.576.187-.926.671-1.468l.265-.29.1-.113c.242-.286.317-.453.317-.677 0-.558-.38-.95-.853-.95-.494 0-.859.366-.853.945a.5.5 0 1 1-1 .01Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/visibility-private.svg b/assets/icons/visibility-private.svg index 717077d..5572b92 100644 --- a/assets/icons/visibility-private.svg +++ b/assets/icons/visibility-private.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M12.75 42q-1.1 0-1.925-.825T10 39.25V20.9q0-1.15.825-1.95t1.925-.8h3.5v-4.4q0-3.25 2.25-5.5T24 6q3.25 0 5.5 2.25t2.25 5.5v4.4h3.5q1.1 0 1.925.8T38 20.9v18.35q0 1.1-.825 1.925T35.25 42Zm0-1.55h22.5q.5 0 .85-.35t.35-.85V20.9q0-.5-.35-.85t-.85-.35h-22.5q-.5 0-.85.35t-.35.85v18.35q0 .5.35.85t.85.35ZM24 33q1.2 0 2.075-.85.875-.85.875-2.05 0-1.15-.875-2.05-.875-.9-2.075-.9-1.2 0-2.075.9-.875.9-.875 2.05 0 1.2.875 2.05Q22.8 33 24 33Zm-6.25-14.85h12.5v-4.4q0-2.6-1.825-4.4Q26.6 7.55 24 7.55q-2.6 0-4.425 1.8-1.825 1.8-1.825 4.4Zm-6.2 22.3V19.7 40.45Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.75 2A2.25 2.25 0 0 1 22 4.25v5.462a3.25 3.25 0 0 1-.952 2.298l-.42.42a3.513 3.513 0 0 0-.95-1.17l.31-.31a1.75 1.75 0 0 0 .512-1.238V4.25a.75.75 0 0 0-.75-.75h-5.466c-.464 0-.91.185-1.238.513l-8.512 8.523a1.75 1.75 0 0 0 .015 2.462l4.461 4.454a1.755 1.755 0 0 0 2.477 0l.513-.513v2.014a3.256 3.256 0 0 1-4.05-.439L3.49 16.06a3.25 3.25 0 0 1-.005-4.596l8.5-8.51a3.25 3.25 0 0 1 2.3-.953h5.465ZM17 5.502a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM15 15h-.5a1.5 1.5 0 0 0-1.5 1.5v5a1.5 1.5 0 0 0 1.5 1.5h6a1.5 1.5 0 0 0 1.5-1.5v-5a1.5 1.5 0 0 0-1.5-1.5H20v-1a2.5 2.5 0 0 0-5 0v1Zm1.5-1a1 1 0 1 1 2 0v1h-2v-1Zm2 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/visibility-public.svg b/assets/icons/visibility-public.svg index 1872822..426047e 100644 --- a/assets/icons/visibility-public.svg +++ b/assets/icons/visibility-public.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M24 42q-3.75 0-7.025-1.425-3.275-1.425-5.7-3.85-2.425-2.425-3.85-5.7Q6 27.75 6 24q0-3.75 1.425-7.025 1.425-3.275 3.85-5.7 2.425-2.425 5.7-3.85Q20.25 6 24 6q3.75 0 7.025 1.425 3.275 1.425 5.7 3.85 2.425 2.425 3.85 5.7Q42 20.25 42 24q0 3.75-1.425 7.025-1.425 3.275-3.85 5.7-2.425 2.425-5.7 3.85Q27.75 42 24 42Zm-2.05-1.65V36.4q-1.75 0-2.925-1.225-1.175-1.225-1.175-2.925v-2.1l-9.9-9.9q-.15.9-.275 1.85-.125.95-.125 1.9 0 6.25 4.075 10.925Q15.7 39.6 21.95 40.35Zm14.2-5.2Q37.2 34 38 32.7q.8-1.3 1.35-2.725t.825-2.925q.275-1.5.275-3.05 0-5.1-2.775-9.325T30.15 8.6v.95q0 1.7-1.175 2.925Q27.8 13.7 26.1 13.7h-4.15v4.15q0 .85-.625 1.425-.625.575-1.475.575h-4.1V24h12.4q.9 0 1.45.6.55.6.55 1.45v6.2h2.05q1.4 0 2.475.8 1.075.8 1.475 2.1Z"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.75 2A2.25 2.25 0 0 1 22 4.25v5.462a3.25 3.25 0 0 1-.952 2.298l-8.5 8.503a3.255 3.255 0 0 1-4.597.001L3.489 16.06a3.25 3.25 0 0 1-.003-4.596l8.5-8.51A3.25 3.25 0 0 1 14.284 2h5.465Zm0 1.5h-5.465c-.465 0-.91.185-1.239.513l-8.512 8.523a1.75 1.75 0 0 0 .015 2.462l4.461 4.454a1.755 1.755 0 0 0 2.477 0l8.5-8.503a1.75 1.75 0 0 0 .513-1.237V4.25a.75.75 0 0 0-.75-.75ZM17 5.502a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z" fill="#000000"/></svg>
\ No newline at end of file diff --git a/assets/icons/wakeup.svg b/assets/icons/wakeup.svg index 701611c..0f1c507 100644 --- a/assets/icons/wakeup.svg +++ b/assets/icons/wakeup.svg @@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48"><path d="M26.2 44q-3.8 0-7.1-1.425t-5.775-3.9Q10.85 36.2 9.425 32.9 8 29.6 8 25.8q0-5.85 3.35-10.525 3.35-4.675 8.9-6.525-.25 4.65 1.4 8.975 1.65 4.325 5 7.625 3.3 3.35 7.625 4.975Q38.6 31.95 43.25 31.75q-1.8 5.5-6.5 8.875T26.2 44Zm0-1.55q4.7 0 8.6-2.5 3.9-2.5 6.2-6.6-4.35-.4-8.35-2.15t-7.1-4.85q-3.15-3.1-4.875-7.05Q18.95 15.35 18.6 11q-4.1 2.25-6.575 6.175Q9.55 21.1 9.55 25.8q0 6.95 4.85 11.8 4.85 4.85 11.8 4.85Zm-.7-16.1Z" fill="rgb(13,202,240)"/></svg>
\ No newline at end of file +<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3.5c-3.104 0-6 2.432-6 6.25v4.153L4.682 17h14.67l-1.354-3.093V11.75a.75.75 0 0 1 1.5 0v1.843l1.381 3.156a1.25 1.25 0 0 1-1.145 1.751H15a3.002 3.002 0 0 1-6.003 0H4.305a1.25 1.25 0 0 1-1.15-1.739l1.344-3.164V9.75C4.5 5.068 8.103 2 12 2c.86 0 1.705.15 2.5.432a.75.75 0 0 1-.502 1.413A5.964 5.964 0 0 0 12 3.5ZM12 20c.828 0 1.5-.671 1.501-1.5h-3.003c0 .829.673 1.5 1.502 1.5Z" fill="rgb(13,202,240)"/><path d="M15.25 7h-2.5l-.101.007A.75.75 0 0 0 12.75 8.5h1.043l-1.653 2.314-.055.09A.75.75 0 0 0 12.75 12h2.5l.102-.007a.75.75 0 0 0-.102-1.493h-1.042l1.653-2.314.055-.09A.75.75 0 0 0 15.25 7ZM21.25 2h-3.5l-.101.007A.75.75 0 0 0 17.75 3.5h2.134l-2.766 4.347-.05.09A.75.75 0 0 0 17.75 9h3.5l.102-.007A.75.75 0 0 0 21.25 7.5h-2.133l2.766-4.347.05-.09A.75.75 0 0 0 21.25 2Z" fill="rgb(13,202,240)"/></svg>
\ No newline at end of file diff --git a/assets/logo/newlogo-template.png b/assets/logo/newlogo-template.png Binary files differnew file mode 100644 index 0000000..36dfc83 --- /dev/null +++ b/assets/logo/newlogo-template.png diff --git a/assets/logo/newlogo.png b/assets/logo/newlogo.png Binary files differnew file mode 100644 index 0000000..7b5922d --- /dev/null +++ b/assets/logo/newlogo.png diff --git a/assets/uploads/pt-applebloom.png b/assets/uploads/pt-applebloom.png Binary files differnew file mode 100644 index 0000000..35f844f --- /dev/null +++ b/assets/uploads/pt-applebloom.png diff --git a/assets/uploads/pt-izzy.png b/assets/uploads/pt-izzymoonbow.png Binary files differindex e01ab3b..e01ab3b 100644 --- a/assets/uploads/pt-izzy.png +++ b/assets/uploads/pt-izzymoonbow.png diff --git a/assets/uploads/pt-mistybrightdawn.png b/assets/uploads/pt-mistybrightdawn.png Binary files differnew file mode 100644 index 0000000..3afb56c --- /dev/null +++ b/assets/uploads/pt-mistybrightdawn.png diff --git a/assets/uploads/pt-scootaloo.png b/assets/uploads/pt-scootaloo.png Binary files differindex 591c35e..436d6a3 100644 --- a/assets/uploads/pt-scootaloo.png +++ b/assets/uploads/pt-scootaloo.png diff --git a/assets/uploads/pt-thunder.png b/assets/uploads/pt-thunder.png Binary files differnew file mode 100644 index 0000000..48ed462 --- /dev/null +++ b/assets/uploads/pt-thunder.png diff --git a/assets/uploads/pt-zoomzephyrwing.png b/assets/uploads/pt-zoomzephyrwing.png Binary files differnew file mode 100644 index 0000000..e75a6c3 --- /dev/null +++ b/assets/uploads/pt-zoomzephyrwing.png diff --git a/autoschedule/main.php b/autoschedule/main.php index 892ea02..e3ae2bf 100644 --- a/autoschedule/main.php +++ b/autoschedule/main.php @@ -2,9 +2,9 @@ $_SERVER['DOCUMENT_ROOT'] = ".."; -require_once "../includes/score.php"; -require_once "../includes/bitset.php"; -require_once "../includes/functions.php"; +require_once "../includes/score.inc"; +require_once "../includes/bitset.inc"; +require_once "../includes/functions.inc"; $days = []; $today_date = date('Y-m-d', time() + 86400); @@ -172,6 +172,7 @@ foreach (scoreOrderGlobal() as $pony) { ]; } +$runs = 0; while (!$correct) { $ponies = []; $fixed = false; @@ -270,6 +271,12 @@ while (!$correct) { } if (!$fixed) $correct = true; + + if ($runs > 8) { + $correct = true; + } + + $runs++; } echo("--------------\n"); diff --git a/autoschedule/ponies.php b/autoschedule/ponies.php index 3346452..d16e701 100644 --- a/autoschedule/ponies.php +++ b/autoschedule/ponies.php @@ -4,14 +4,14 @@ global $ponies_raindrops; global $ponies_cloudburst; global $weekend; -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json"), true); +$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); function ponies(string $system): array { global $travelling; global $weekend; return array_map(function ($i) use ($system, $weekend) { - $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-switches.json"), true); + $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true); $memberData = $i; $i["_lastFronted"] = -1; @@ -53,7 +53,7 @@ function ponies(string $system): array { $fronters = array_map(function ($item) { return $item["id"]; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true)["members"]); + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]); if (in_array($id, $fronters)) { $i["_lastFronted"] = time(); diff --git a/includes/ai.php b/includes/ai.inc index 8f5f7ba..8f5f7ba 100644 --- a/includes/ai.php +++ b/includes/ai.inc diff --git a/includes/assets.inc b/includes/assets.inc new file mode 100644 index 0000000..9a0a9ac --- /dev/null +++ b/includes/assets.inc @@ -0,0 +1,55 @@ +<?php + +if (!file_exists("../assets/avatars")) mkdir("../assets/avatars"); +if (!file_exists("../assets/banners")) mkdir("../assets/banners"); +if (!file_exists("../assets/heads")) mkdir("../assets/heads"); +if (!file_exists("../assets/bodies")) mkdir("../assets/bodies"); + +function downloadAssets($system) { + $general = json_decode(file_get_contents("./data/$system/general.json"), true); + + if (isset($general["avatar_url"])) { + $id = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $general["uuid"]); + echo(" /avatars/$id.webp\n"); + exec("convert -resize 512x512 \"" . $general["avatar_url"] . "\" ../assets/avatars/" . $id . ".webp"); + exec("convert -resize 512x512 \"" . $general["avatar_url"] . "\" ../assets/uploads/" . ($id === "gdapd" ? "raindrops" : "cloudburst") . ".png"); + } + + if (isset($general["banner"])) { + $id = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $general["uuid"]); + echo(" /banners/$id.webp\n"); + exec("convert -resize 2048x2048 \"" . $general["banner"] . "\" ../assets/banners/" . $id . ".webp"); + } + + $members = json_decode(file_get_contents("./data/$system/members.json"), true); + + foreach ($members as $member) { + $id = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $general["uuid"]) . preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", $member["uuid"]); + + if (isset($member["avatar_url"])) { + echo(" /avatars/$id.webp\n"); + exec("convert -resize 512x512 \"" . $member["avatar_url"] . "\" ../assets/avatars/" . $id . ".webp"); + } + + if (isset($member["banner"])) { + echo(" /banners/$id.webp\n"); + exec("convert -resize 2048x2048 \"" . $member["banner"] . "\" ../assets/banners/" . $id . ".webp"); + } + + if (file_exists("../assets/uploads/pt-" . $member["name"] . ".png")) { + $url = "../assets/uploads/pt-" . $member["name"] . ".png"; + } else { + $url = "../assets/uploads/pt.png"; + } + echo(" /heads/$id.webp\n"); + exec("convert -resize 64x64 \"" . $url . "\" ../assets/heads/" . $id . ".webp"); + + if (file_exists("../app/fronters/ponies/" . $member["id"] . ".png")) { + echo(" /bodies/$id.webp\n"); + exec("convert -resize 128x128 \"" . "../app/fronters/ponies/" . $member["id"] . ".png" . "\" ../assets/bodies/" . $id . ".webp"); + } + } +} + +downloadAssets("gdapd"); +downloadAssets("ynmuc");
\ No newline at end of file diff --git a/includes/backup.php b/includes/backup.inc index ad09617..489390b 100644 --- a/includes/backup.php +++ b/includes/backup.inc @@ -18,7 +18,7 @@ foreach ($root as $file) { foreach (array_filter(scandir("data/$file"), function ($i) { return !str_starts_with($i, "."); }) as $dirfile) { - if ($dirfile === "backup.poniesbackup" || $dirfile === "backup.ponieskey" || $dirfile === "encrypted" || $dirfile === "oldactions" || str_ends_with($dirfile, ".poniesbackup")) continue; + if ($dirfile === "backup.poniesbackup" || $dirfile === "backup.ponieskey" || $dirfile === "encrypted" || str_ends_with($dirfile, ".poniesbackup")) continue; echo(" /$dirfile/$file\n"); $files[] = [ diff --git a/includes/banner.php b/includes/banner.inc index 213863a..a3c6f10 100644 --- a/includes/banner.php +++ b/includes/banner.inc @@ -1,13 +1,13 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/pronouns.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/pronouns.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json"), true); +$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); function _header_getMember(string $id, $system) { - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-members.json"), true); + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/members.json"), true); $member = null; foreach ($members as $m) { @@ -48,10 +48,10 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { global $travelling; global $isLoggedIn; - $subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-subsystems.json"), true) ?? []; + $subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$system.json"), true) ?? []; $member = getSystemMember($system, $id); - $metadata = file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-$id-metadata.json") ? parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-$id-metadata.json"), true)) : parseMetadata([ + $metadata = file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$id.json") ? parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$id.json"), true)) : parseMetadata([ "bitset" => 4196352, "regression" => null, "median" => null, @@ -73,21 +73,21 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { if (!$metadata["median"]) { $fronters = array_map(function ($item) { return $item["id"]; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true)["members"]); + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]); if (in_array($id, $fronters)) { $lastFronted = [ 'now' => true, - 'relative' => timeAgo(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true)["timestamp"]), - 'absolute' => date("D j M Y, G:i:s (e)", strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true)["timestamp"])), - 'timestamp' => strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true)["timestamp"]), + 'relative' => timeAgo(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["timestamp"]), + 'absolute' => date("D j M Y, G:i:s (e)", strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["timestamp"])), + 'timestamp' => strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["timestamp"]), 'duration' => [ 'seconds' => null, 'pretty' => null ] ]; } else { - $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-switches.json"), true); + $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true); $thisMember = array_filter($switches, function ($item) { global $memberData; @@ -184,13 +184,13 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $systemData['subsystem'] = [ "page" => $systemData['page'] . "/-/subsystem/" . $subsystem["source"], "icon" => "ss-$subsystem[source].png", - "name" => file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-subsystem-$subsystem[source].json") ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-subsystem-$subsystem[source].json"), true)["name"] : $subsystem["source"] + "name" => file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$system-$subsystem[source].json") ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$system-$subsystem[source].json"), true)["name"] : $subsystem["source"] ]; } if ($travelling[$member['id']]["travelling"]) { $systemData['page'] = "/" . ($system === "gdapd" ? "cloudburst" : "raindrops"); - $systemData['icon'] = ($system === "gdapd" ? "cloudburst" : "raindrops") . ".png"; + $systemData['icon'] = getAsset($system); $systemData['name'] = $system === "gdapd" ? "Cloudburst" : "Raindrops"; $systemData['full_name'] = $system === "gdapd" ? "Cloudburst System" : "Raindrops System"; $systemData['subsystem'] = null; @@ -201,7 +201,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { foreach ($metadata["marefriends"] as $marefriend) { $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; - $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) use ($mfMemberID) { + $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) use ($mfMemberID) { return $item["id"] === $mfMemberID; }); sort($mfMember); @@ -210,7 +210,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $marefriends[] = [ "id" => $marefriend, "link" => "/" . ($mfMember["name"]), - "icon" => "pt" . (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "") . ".png", + "icon" => getAsset($mfSystem, $mfMemberID, "heads"), "name" => getMiniName($mfMember["display_name"] ?? $mfMember["name"]), "full_name" => $mfMember["display_name"] ?? $mfMember["name"] ]; @@ -220,7 +220,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { foreach ($metadata["sisters"] as $marefriend) { $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; - $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) use ($mfMemberID) { + $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) use ($mfMemberID) { return $item["id"] === $mfMemberID; }); sort($mfMember); @@ -229,7 +229,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $sisters[] = [ "id" => $marefriend, "link" => "/" . ($mfMember["name"]), - "icon" => "pt" . (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "") . ".png", + "icon" => getAsset($mfSystem, $mfMemberID, "heads"), "name" => getMiniName($mfMember["display_name"] ?? $mfMember["name"]), "full_name" => $mfMember["display_name"] ?? $mfMember["name"] ]; @@ -242,7 +242,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { foreach ($metadata["caretakers"] as $marefriend) { $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; - $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) use ($mfMemberID) { + $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) use ($mfMemberID) { return $item["id"] === $mfMemberID; }); sort($mfMember); @@ -251,7 +251,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { $caretakers[] = [ "id" => $marefriend, "link" => "/" . ($mfMember["name"]), - "icon" => "pt" . (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "") . ".png", + "icon" => getAsset($mfSystem, $mfMemberID, "heads"), "name" => getMiniName($mfMember["display_name"] ?? $mfMember["name"]), "full_name" => $mfMember["display_name"] ?? $mfMember["name"] ]; @@ -434,7 +434,7 @@ function getMemberBannerData(string $id, string $system, bool $french = false) { 'id' => $member['name'], 'color' => $member["color"] ?? "000000", 'icon' => [ - "online" => $member['avatar_url'], + "online" => getAsset($system, $member["id"]), "offline" => "pf-$system-$id.webp" ], 'median' => $metadata["median"], diff --git a/includes/bitset.php b/includes/bitset.inc index 1d026e5..1d026e5 100644 --- a/includes/bitset.php +++ b/includes/bitset.inc diff --git a/includes/edit-private.php b/includes/edit-private.inc index 58e9ed5..e760b94 100644 --- a/includes/edit-private.php +++ b/includes/edit-private.inc @@ -1,7 +1,7 @@ -<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing " . $memberCommonName . " (private page) · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing " . $memberCommonName . " (private page) · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; -if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" . $memberID . "-metadata.json")) { - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" . $memberID . "-metadata.json"), true)); +if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json")) { + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true)); } ?> @@ -16,12 +16,12 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" <br> <p class="text-muted" id="page-content"> - <span id="editor-save-status" class="text-muted">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-private.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-private.html")) : "0" ?></span> bytes · <a href="/<?= $memberData["name"] ?>">View page</a> + <span id="editor-save-status" class="text-muted">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html")) : "0" ?></span> bytes · <a href="/<?= $memberData["name"] ?>">View page</a> </p> <!--suppress HtmlFormInputWithoutLabel --> <textarea id="page-editor"> - <?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-private.html") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-private.html") : "" ?> + <?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") : "" ?> </textarea> <script src="/assets/editor/editor.js"></script> @@ -144,4 +144,4 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" </script> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/edit.php b/includes/edit.inc index 5bbd38a..d8cf673 100644 --- a/includes/edit.php +++ b/includes/edit.inc @@ -1,7 +1,7 @@ -<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing " . $memberCommonName . " (public page) · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +<?php global $system; global $systemCommonName; global $systemID; global $member; global $memberData; global $memberCommonName; global $memberID; $title = "Editing " . $memberCommonName . " (public page) · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; -if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" . $memberID . "-metadata.json")) { - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" . $memberID . "-metadata.json"), true)); +if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json")) { + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true)); } ?> @@ -16,12 +16,12 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" <br> <p class="text-muted" id="page-content"> - <span id="editor-save-status" class="text-muted">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-private.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-private.html")) : "0" ?></span> bytes · <a href="/<?= $memberData["name"] ?>">View page</a> + <span id="editor-save-status" class="text-muted">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html")) : "0" ?></span> bytes · <a href="/<?= $memberData["name"] ?>">View page</a> </p> <!--suppress HtmlFormInputWithoutLabel --> <textarea id="page-editor"> - <?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-content.html") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-content.html") : "" ?> + <?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") : "" ?> </textarea> <script src="/assets/editor/editor.js"></script> @@ -144,4 +144,4 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" </script> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/emergency.php b/includes/emergency.inc index 5490985..5490985 100644 --- a/includes/emergency.php +++ b/includes/emergency.inc diff --git a/includes/footer.php b/includes/footer.inc index 720881a..303b6f0 100644 --- a/includes/footer.php +++ b/includes/footer.inc @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; ?> @@ -9,10 +9,11 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; <?php $refresh = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/refresh.json"), true); + $version = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json"), true); ?> - © <?= date("Y") ?> <a href="https://equestria.horse" target="_blank" class="text-muted">Equestria.dev Developers</a> · <a href="https://git.equestria.dev/equestria.dev/ponies.equestria.horse" target="_blank" class="text-muted">Source Code</a><br> - <a href="/-/debug" class="text-muted" style="text-decoration: none;">Data updated <?= trim(timeAgo($refresh["timestamp"])) ?> (<?= date('D j M, G:i:s T', $refresh["timestamp"]) ?>; took <?= round($refresh["duration"] * 1000) ?> ms, <?= count($refresh["restored"]) > 0 ? (count($refresh["restored"]) > 1 ? "reported " . count($refresh["restored"]) . " failures" : "reported 1 failure") : "no failures reported" ?>)</a> + © <?= date("Y") ?> <a href="https://equestria.horse" target="_blank" class="text-muted">Equestria.dev Developers</a> · version 2.<?= $version["build"] ?>.<?= hexdec(substr($version["hash"], 0, 4)) ?>.<?= $version["revision"] ?><br> + <a href="/-/debug" class="text-muted" style="text-decoration: none;">Data updated <?= trim(timeAgo($refresh["timestamp"])) ?> (<?php if (time() - $refresh["timestamp"] > 360): ?>not updating; <?php endif; ?><?= date('D j M, G:i:s T', $refresh["timestamp"]) ?>; took <?= round($refresh["duration"] * 1000) ?> ms, <?= count($refresh["restored"]) > 0 ? (count($refresh["restored"]) > 1 ? "reported " . count($refresh["restored"]) . " failures" : "reported 1 failure") : "no failures reported" ?>)</a> <br><br><br> </div> @@ -29,7 +30,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; }) </script> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/search.php"; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/search.inc"; ?> </body> </html>
\ No newline at end of file diff --git a/includes/functions.php b/includes/functions.inc index 1a2bf4c..386d2b2 100644 --- a/includes/functions.php +++ b/includes/functions.inc @@ -1,13 +1,167 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; + +if (!function_exists("getAsset")) { + function getAsset($systemID, $memberID = null, $type = "avatars") { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/general.json")) { + $id1 = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/general.json"), true)["uuid"]); + + if (isset($memberID)) { + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); + $list = array_map(function ($i) { + return $i["id"]; + }, $members); + + if (in_array($memberID, $list)) { + $id2 = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", getMemberWithoutSystem($memberID)["uuid"]); + } else { + return "/error/nomember/?s=$systemID&m=$memberID&t=$type"; + } + + $id = $id1 . $id2; + } else { + $id = $id1; + } + + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/" . $type . "/" . $id . ".webp")) { + return "/assets/" . $type . "/" . $id . ".webp"; + } else { + return "/error/nofile/?s=$systemID&m=$memberID&t=$type"; + } + } else { + return "/error/nosys/?s=$systemID&m=$memberID&t=$type"; + } + } +} + +if (!function_exists("rgbToHsl")) { + function rgbToHsl($r, $g, $b) { + $oldR = $r; + $oldG = $g; + $oldB = $b; + + $r /= 255; + $g /= 255; + $b /= 255; + + $max = max($r, $g, $b); + $min = min($r, $g, $b); + + $l = ($max + $min) / 2; + $d = $max - $min; + + if ($d == 0) { + $h = $s = 0; + } else { + $s = $d / (1 - abs(2 * $l - 1)); + + switch ($max) { + case $r: + $h = 60 * fmod((($g - $b) / $d), 6); + if ($b > $g) { + $h += 360; + } + break; + + case $g: + $h = 60 * (($b - $r) / $d + 2); + break; + + case $b: + $h = 60 * (($r - $g) / $d + 4); + break; + } + } + + return array(round($h, 2), round($s, 2), round($l, 2)); + } +} + +if (!function_exists("imageCreateCorners")) { + function imageCreateCorners($sourceImageFile, $radius) { + # test source image + if (file_exists($sourceImageFile)) { + $res = is_array($info = getimagesize($sourceImageFile)); + } + else $res = false; + + # open image + if ($res) { + $w = $info[0]; + $h = $info[1]; + switch ($info['mime']) { + case 'image/jpeg': $src = imagecreatefromjpeg($sourceImageFile); + break; + case 'image/gif': $src = imagecreatefromgif($sourceImageFile); + break; + case 'image/png': $src = imagecreatefrompng($sourceImageFile); + break; + default: + $res = false; + } + } + + # create corners + if ($res) { + + $q = 10; # change this if you want + $radius *= $q; + + # find unique color + do { + $r = rand(0, 255); + $g = rand(0, 255); + $b = rand(0, 255); + } + while (imagecolorexact($src, $r, $g, $b) < 0); + + $nw = $w*$q; + $nh = $h*$q; + + $img = imagecreatetruecolor($nw, $nh); + $alphacolor = imagecolorallocatealpha($img, $r, $g, $b, 127); + imagealphablending($img, false); + imagesavealpha($img, true); + imagefilledrectangle($img, 0, 0, $nw, $nh, $alphacolor); + + imagefill($img, 0, 0, $alphacolor); + imagecopyresampled($img, $src, 0, 0, 0, 0, $nw, $nh, $w, $h); + + imagearc($img, $radius-1, $radius-1, $radius*2, $radius*2, 180, 270, $alphacolor); + imagefilltoborder($img, 0, 0, $alphacolor, $alphacolor); + imagearc($img, $nw-$radius, $radius-1, $radius*2, $radius*2, 270, 0, $alphacolor); + imagefilltoborder($img, $nw-1, 0, $alphacolor, $alphacolor); + imagearc($img, $radius-1, $nh-$radius, $radius*2, $radius*2, 90, 180, $alphacolor); + imagefilltoborder($img, 0, $nh-1, $alphacolor, $alphacolor); + imagearc($img, $nw-$radius, $nh-$radius, $radius*2, $radius*2, 0, 90, $alphacolor); + imagefilltoborder($img, $nw-1, $nh-1, $alphacolor, $alphacolor); + imagealphablending($img, true); + imagecolortransparent($img, $alphacolor); + + # resize image down + $dest = imagecreatetruecolor($w, $h); + imagealphablending($dest, false); + imagesavealpha($dest, true); + imagefilledrectangle($dest, 0, 0, $w, $h, $alphacolor); + imagecopyresampled($dest, $img, 0, 0, 0, 0, $w, $h, $nw, $nh); + + # output image + $res = $dest; + imagedestroy($src); + imagedestroy($img); + } + + return $res; + } +} if (!function_exists("getMiniName")) { function getMiniName(string $name) { $parts = explode(" ", $name); - if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy") { + if (strlen($parts[0]) > 3 && !str_ends_with($parts[0], "e") && $parts[0] !== "Filly" && $parts[0] !== "Windy" && (isset($parts[1]) && $parts[1] !== "Brightdawn")) { if (str_contains($parts[0], "/")) { return explode("/", $parts[0])[0]; } else { @@ -40,13 +194,15 @@ if (!function_exists("getSystemMember")) { function getSystemMember(string $system, string $id) { $systemID = $system; - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true); + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); $member = null; foreach ($members as $m) { if ($m["id"] === $id) $member = $m; } + $member["system"] = $member["_system"] = $system; + return $member; } } @@ -55,15 +211,17 @@ if (!function_exists("getMemberWithoutSystem")) { function getMemberWithoutSystem(string $id) { $member = null; - $members1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true); + $members1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true); foreach ($members1 as $m) { $m["_system"] = "ynmuc"; + $m["system"] = "ynmuc"; if ($m["id"] === $id) $member = $m; } - $members2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true); + $members2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true); foreach ($members2 as $m) { $m["_system"] = "gdapd"; + $m["system"] = "gdapd"; if ($m["id"] === $id) $member = $m; } @@ -76,7 +234,7 @@ if (!function_exists("showMembersFromList")) { foreach ($list as $member) { if ($member['name'] !== "unknown" && $member['name'] !== "fusion") { echo('<!-- ' . ($member['display_name'] ?? $member['name']) . ' --> <a href="/' . $member['name'] . '" style="text-decoration:none !important;filter:none !important;"><div class="hpd-item-card" style="background-color:rgba(255, 255, 255, .1);border:1px solid ' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';outline-color:' . (isset($member['color']) ? "#" . $member['color'] . "55" : "transparent") . ';border-radius:10px;text-align:center;display:flex;align-items:center;justify-content:center;padding:5px;"><div> -<img alt="" src="' . $member['avatar_url'] . '" style="border-radius:999px;background-color:rgba(0, 0, 0, .25);height:48px;display:block;margin-left:auto;margin-right:auto;"> +<img alt="" src="' . getAsset($member["system"], $member["id"]) . '" style="border-radius:999px;background-color:rgba(0, 0, 0, .25);height:48px;display:block;margin-left:auto;margin-right:auto;"> <div style="text-decoration:none;color:white;margin-top:5px;">' . ($member['display_name'] ?? $member['name']) . '</div> <div style="text-decoration:none !important;color:black !important;"><code style="text-decoration:none !important;color:white !important;">' . (isset($member['travelling']) && $member['travelling'] ? "+" . ($member['proxy_tags'][0]['prefix'] ?? " ") : ($member['proxy_tags'][0]['prefix'] ?? " ")) . '</code></div> </div></div></a>'); @@ -86,7 +244,7 @@ if (!function_exists("showMembersFromList")) { if (!function_exists("showSubsystem")) { function showSubsystem(array $data, string $parentSystem) { - $subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$parentSystem-subsystem-$data[source].json"), true); + $subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$parentSystem-$data[source].json"), true); echo('<!-- ' . $subsystemData["name"] . ' --> <div id="hpd-cloudburst" style="background:rgba(255, 255, 255, .1);border-radius:10px;padding:10px;display:grid;grid-template-columns: 1fr;margin-bottom:10px;">'); @@ -106,7 +264,7 @@ if (!function_exists("showSystem")) { function showSystem(string $id, string $name, string $color, bool $hideTitle) { global $travelling; - $global = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id-general.json"), true); + $global = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id/general.json"), true); if ($hideTitle) { echo('<!-- ' . $name . ' --> @@ -117,7 +275,7 @@ if (!function_exists("showSystem")) { } if (!$hideTitle) echo('<!-- System Name --> <a style="display:flex;margin: -10px -20px;align-items:center;justify-content:center;text-align:center;padding: 10px 20px;border-radius: 10px;background: #' . $global['color'] . '55;width: 148px;text-decoration:none;color:white;filter:none !important;" href="/' . ($id === "gdapd" ? "raindrops" : "cloudburst") . '" class="hpd-system"> -<div style="text-align:center;"><img src="/assets/uploads/' . ($id === "gdapd" ? "raindrops" : "cloudburst") . '.png" style="width:64px;"><br>' . $name . '</div> +<div style="text-align:center;"><img src="' . getAsset($id) . '" style="width:64px;"><br>' . $name . '</div> </a>'); if ($hideTitle) { @@ -130,13 +288,13 @@ if (!function_exists("showSystem")) { $i["travelling"] = false; $i["system"] = $id; return $i; - }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id-members.json"), true), function ($i) use ($travelling) { + }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$id/members.json"), true), function ($i) use ($travelling) { return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']); })), ...array_map(function ($i) use ($id) { $i["travelling"] = true; $i["system"] = ($id === "gdapd" ? "ynmuc" : "gdapd"); return $i; - }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($id === "gdapd" ? "ynmuc" : "gdapd") . "-members.json"), true), function ($i) use ($travelling) { + }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($id === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), function ($i) use ($travelling) { return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']; }))], $id)); @@ -162,7 +320,7 @@ if (!function_exists("getMember")) { function getMember(string $id) { global $systemID; - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true); + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); $member = null; foreach ($members as $m) { @@ -296,7 +454,7 @@ if (!function_exists("getMemberSystem")) { if (!function_exists("getMemberFromName")) { function getMemberFromName(string $name) { - $list = [...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true), ...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true)]; + $list = [...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), ...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true)]; foreach ($list as $item) { if ($item["name"] === $name) return $item; diff --git a/includes/header.php b/includes/header.inc index 91d0aee..e851c85 100644 --- a/includes/header.php +++ b/includes/header.inc @@ -1,5 +1,23 @@ <?php global $title; global $pages; +$readOnly = false; +@file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/.test", "hello"); + +if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/.test")) { + unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/.test"); +} else { + $readOnly = true; +} + +$isNormallyLoggedIn = false; + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isUserLoggedIn; +if ($readOnly && $isLoggedIn || $readOnly && $isUserLoggedIn) { + $isLoggedIn = false; + $isUserLoggedIn = false; + $isNormallyLoggedIn = true; +} + $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); function error($errno, $errstr, $file, $line) { @@ -23,14 +41,18 @@ global $_SystemName; global $_SystemPage; global $toplevel; -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/travelling.php"; global $travelling; -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.php"; -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/pronouns.php"; -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; global $isUserLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rainbow.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; +$pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); +$page = $pages[$toplevel] ?? [ + "rail" => false +]; + +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/travelling.inc"; global $travelling; +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.inc"; +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/pronouns.inc"; +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rainbow.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; ?> @@ -57,13 +79,21 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; <?php if (isset($_SystemName) && file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/" . $_SystemName . ".png") && (!isset($_MemberName) || $_MemberName !== "fusion")): ?> <link rel="shortcut icon" href="/assets/uploads/<?= $_SystemName ?>.png" type="image/png"> <?php else: ?> - <link rel="shortcut icon" href="/assets/logo/logo.png" type="image/png"> + <link rel="shortcut icon" href="/assets/logo/newlogo.png" type="image/png"> <?php endif; ?> <?php endif; ?> <?php endif; ?> <?php endif; ?> <?php endif; ?> <style> + #admin-page { + margin-left: 32px; + } + + #admin-page .navbar { + margin-left: -32px; + } + nav.navbar { background-color: black !important; border-bottom: 1px solid rgba(255, 255, 255, .25); @@ -723,10 +753,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; } </style> </head> -<body> +<body<?php if ($page["rail"] && $isLoggedIn): ?> id="admin-page"<?php endif; ?>> <nav class="navbar navbar-expand-<?= $isLoggedIn ? 'xl' : 'lg' ?> bg-dark navbar-dark" style="height:60px;"> <div class="container-fluid"> - <a class="navbar-brand" href="/"><img src="/assets/logo/logo.png" alt="" style="width:32px;vertical-align: middle;margin-right:5px;"> <span style="vertical-align: middle;">Cold Haze</span><a> + <a class="navbar-brand" href="/"><img src="/assets/logo/newlogo.png" alt="" style="width:32px;vertical-align: middle;margin-right:5px;"> <span style="vertical-align: middle;">Cold Haze</span><a> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#collapsibleNavbar"> <span class="navbar-toggler-icon"></span> </button> @@ -751,6 +781,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; <img src="/assets/icons/relations.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> <span style="vertical-align: middle;"><?= $pages["relations"]["name"] ?></span> </a></li> + <li><a class="dropdown-item" href="/-/government"> + <img src="/assets/icons/government.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> + <span style="vertical-align: middle;"><?= $pages["government"]["name"] ?></span> + </a></li> <li><a class="dropdown-item" href="/-/terminology"> <img src="/assets/icons/terminology.svg" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;"> <span style="vertical-align: middle;"><?= $pages["terminology"]["name"] ?></span> @@ -780,8 +814,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; </a></li> <?php - $frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true)["members"]; - $frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true)["members"]; + $frontCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/fronters.json"), true)["members"]; + $frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"]; if (isset($_GET['pleasure']) || (isset($frontRaindrops[0]) && isset($frontCloudburst[0]) && ( ((int)date('H') >= 20 || (int)date('H') < 6) && @@ -863,7 +897,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; </a></li> <?php - $subsystems1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-subsystems.json"), true); + $subsystems1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/ynmuc.json"), true); $subsystemsNotMember = array_values(array_filter($subsystems1, function ($i) { return $i["source_type"] !== "member"; })); @@ -871,7 +905,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; if (count($subsystemsNotMember) > 0): ?> <li><hr class="dropdown-divider"></li> <li><h5 class="dropdown-header">Subsystems</h5></li> - <?php foreach ($subsystemsNotMember as $subsystem): $ssData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-subsystem-" . $subsystem['source'] . ".json"), true); ?> + <?php foreach ($subsystemsNotMember as $subsystem): $ssData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/ynmuc-" . $subsystem['source'] . ".json"), true); ?> <li><a class="dropdown-item" href="/cloudburst/-/subsystem/<?= $subsystem['source'] ?>"> <img src="/assets/uploads/ss-<?= $subsystem['source'] ?>.png" alt="" style="border-radius:5px;width:24px;vertical-align: middle;"> <span style="vertical-align: middle;"><?= $ssData['name'] ?? $subsystem['source'] ?></span> @@ -880,9 +914,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; <?php endif; ?> <li><hr class="dropdown-divider"></li> <li><h5 class="dropdown-header">Members</h5></li> - <?php foreach (scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true), "ynmuc"), "ynmuc") as $member): if ($member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"): ?> + <?php foreach (scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true), "ynmuc"), "ynmuc") as $member): if ($member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"): ?> <li><a class="dropdown-item" href="/<?= $member['name'] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" alt="" style="width:24px;vertical-align: middle;"> + <img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" alt="" style="width:24px;vertical-align: middle;"> <span style="vertical-align: middle;"><?= $member['display_name'] ?? $member['name'] ?></span> </a></li> <?php endif; endforeach; ?> @@ -900,7 +934,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; </a></li> <?php - $subsystems1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-subsystems.json"), true); + $subsystems1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/gdapd.json"), true); $subsystemsNotMember = array_values(array_filter($subsystems1, function ($i) { return $i["source_type"] !== "member"; })); @@ -908,7 +942,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; if (count($subsystemsNotMember) > 0): ?> <li><hr class="dropdown-divider"></li> <li><h5 class="dropdown-header">Subsystems</h5></li> - <?php foreach ($subsystemsNotMember as $subsystem): $ssData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-subsystem-" . $subsystem['source'] . ".json"), true); ?> + <?php foreach ($subsystemsNotMember as $subsystem): $ssData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/gdapd-" . $subsystem['source'] . ".json"), true); ?> <li><a class="dropdown-item" href="/raindrops/-/subsystem/<?= $subsystem['source'] ?>"> <img src="/assets/uploads/ss-<?= $subsystem['source'] ?>.png" alt="" style="border-radius:5px;width:24px;vertical-align: middle;"> <span style="vertical-align: middle;"><?= $ssData['name'] ?? $subsystem['source'] ?></span> @@ -917,9 +951,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; <?php endif; ?> <li><hr class="dropdown-divider"></li> <li><h5 class="dropdown-header">Members</h5></li> - <?php foreach (scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true), "gdapd"), "gdapd") as $member): if ($member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"): ?> + <?php foreach (scoreOrder(withTravelers(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), "gdapd"), "gdapd") as $member): if ($member['name'] !== "unknown" && $member['name'] !== "fusion" && $member['name'] !== "new"): ?> <li><a class="dropdown-item" href="/<?= $member['name'] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" alt="" style="width:24px;vertical-align: middle;"> + <img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" alt="" style="width:24px;vertical-align: middle;"> <span style="vertical-align: middle;"><?= $member['display_name'] ?? $member['name'] ?></span> </a></li> <?php endif; endforeach; ?> @@ -960,4 +994,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ical/main.php"; </ul> </div> </div> - </nav>
\ No newline at end of file + </nav> + +<?php if ($page["rail"] && $isLoggedIn): ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rail.inc"; ?> +<?php endif; ?> diff --git a/includes/icons.inc b/includes/icons.inc new file mode 100644 index 0000000..ec433b2 --- /dev/null +++ b/includes/icons.inc @@ -0,0 +1,5 @@ +<?php + +chdir("../assets/icons"); +exec("node icongen.js"); +chdir("../../includes");
\ No newline at end of file diff --git a/includes/init.inc b/includes/init.inc new file mode 100644 index 0000000..7265c0e --- /dev/null +++ b/includes/init.inc @@ -0,0 +1,28 @@ +<?php + +global $title; +global $toplevel; +global $emergencyHeader; +global $pages; + +$pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; + +if (in_array($toplevel, array_keys($pages))) { + $title = $pages[$toplevel]["name"]; + + if ($pages[$toplevel]["admin"]) { + $readOnly = false; + @file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/.test", "hello"); + + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/.test")) { + unlink($_SERVER['DOCUMENT_ROOT'] . "/includes/data/.test"); + } else { + $readOnly = true; + } + + if (!$isLoggedIn || ($readOnly && !$emergencyHeader)) header("Location: /-/login/?return=$toplevel") and die(); + } +} else { + $title = $toplevel; +}
\ No newline at end of file diff --git a/includes/init.php b/includes/init.php deleted file mode 100644 index 71d7def..0000000 --- a/includes/init.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -global $title; -global $toplevel; -global $pages; - -$pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; - -if (in_array($toplevel, array_keys($pages))) { - $title = $pages[$toplevel]["name"]; - - if ($pages[$toplevel]["admin"]) { - if (!$isLoggedIn) header("Location: /-/login/?return=$toplevel") and die(); - } -} else { - $title = $toplevel; -}
\ No newline at end of file diff --git a/includes/keywords.php b/includes/keywords.inc index 270d905..9bea167 100644 --- a/includes/keywords.php +++ b/includes/keywords.inc @@ -1,8 +1,8 @@ <?php function getKeyWords() { - $actions = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json"), true); - $toys = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json"), true); + $actions = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true); + $toys = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true); $pages = []; foreach ($actions as $action) { diff --git a/includes/logo.inc b/includes/logo.inc new file mode 100644 index 0000000..442ff2b --- /dev/null +++ b/includes/logo.inc @@ -0,0 +1,97 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; + +$columns = round(sqrt(count(scoreOrderGlobal()))); +$members = scoreOrderGlobal(); + +usort($members, function ($a, $b) { + $vr = hexdec(substr($a["color"], 0, 2)); + $vg = hexdec(substr($a["color"], 2, 2)); + $vb = hexdec(substr($a["color"], 4, 2)); + + $hsl = rgbToHsl($vr, $vg, $vb); + if ($hsl[0] == 0) $hsl[0] = 360; + $ra = $hsl[0]; + + $vr = hexdec(substr($b["color"], 0, 2)); + $vg = hexdec(substr($b["color"], 2, 2)); + $vb = hexdec(substr($b["color"], 4, 2)); + + $hsl = rgbToHsl($vr, $vg, $vb); + if ($hsl[0] == 0) $hsl[0] = 360; + $rb = $hsl[0]; + + return $ra - $rb; +}); + +$packs = []; +$currentPack = []; + +foreach ($members as $member) { + if (count($currentPack) >= $columns) { + $packs[] = $currentPack; + $currentPack = []; + } + + $currentPack[] = $member["color"]; +} + +if (count($currentPack) > 0) $packs[] = $currentPack; + +$newPacks = []; +foreach ($packs as $pack) { + usort($pack, function ($a, $b) { + $vra = hexdec(substr($a, 0, 2)); + $vga = hexdec(substr($a, 2, 2)); + $vba = hexdec(substr($a, 4, 2)); + + $hsla = rgbToHsl($vra, $vga, $vba); + $ra = $hsla[2] * $hsla[1]; + + $vrb = hexdec(substr($b, 0, 2)); + $vgb = hexdec(substr($b, 2, 2)); + $vbb = hexdec(substr($b, 4, 2)); + + $hslb = rgbToHsl($vrb, $vgb, $vbb); + $rb = $hslb[2] * $hslb[1]; + + return $rb < $ra; + }); + + while (count($pack) < $columns) $pack[] = "ffffff"; + + $newPacks[] = $pack; +} + +$img = imagecreatetruecolor($columns, $columns); +$factor = 64; + +for ($y = 0; $y < $columns; ++$y) { + for ($x = 0; $x < $columns; ++$x) { + imagesetpixel($img, $x, $y, imagecolorallocate($img, hexdec(substr($newPacks[$y][$x], 0, 2)), hexdec(substr($newPacks[$y][$x], 2, 2)), hexdec(substr($newPacks[$y][$x], 4, 2)))); + } +} + +$img2 = imagecreatetruecolor($columns * $factor, $columns * $factor); +imagecopyresampled($img2, $img, 0, 0, 0, 0, $columns * $factor, $columns * $factor, $columns, $columns); + +imagepng($img2, "/tmp/image.png"); +$img3 = imageCreateCorners("/tmp/image.png", $columns * 10); +unlink("/tmp/image.png"); + +imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo.png"); + +for ($x = 1; $x <= 120; $x++) { + imagefilter($img2, IMG_FILTER_GAUSSIAN_BLUR); +} + +imagefilter($img2, IMG_FILTER_BRIGHTNESS, -100); + +imagepng($img2, "/tmp/image.png"); +$img3 = imageCreateCorners("/tmp/image.png", $columns * 10); +unlink("/tmp/image.png"); + +imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo-template.png");
\ No newline at end of file diff --git a/includes/member.php b/includes/member.inc index d0120d5..2a0c346 100644 --- a/includes/member.php +++ b/includes/member.inc @@ -6,18 +6,18 @@ if ($memberData["name"] === "fusion") { $title = $memberCommonName . " · " . $systemCommonName; } -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json"), true); +$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); if ($memberData["name"] !== "unknown" && $memberData["name"] !== "fusion") { - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" . $memberID . "-metadata.json"), true)); + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true)); } global $isLoggedIn; -$frontersRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true); -$frontersCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true); +$frontersRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true); +$frontersCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/fronters.json"), true); $fusionRaindrops = false; @@ -96,7 +96,7 @@ if ($memberData["name"] === "fusion") { <?= "<span data-bs-toggle='tooltip' title='" . str_replace("'", "'", ucfirst(getMemberPronouns($memberData['pronouns'])["subjective"])) . str_replace("'", "'", getMemberPronouns($memberData["pronouns"])["third"] ? " doesn't" : " don't") . " age like the body does, making " . str_replace("'", "'", getMemberPronouns($memberData['pronouns'])["object"]) . " stay " . $metadata["birth"]["age"] . " years old for " . str_replace("'", "'", getMemberPronouns($memberData['pronouns'])["possessive_det"]) . " entire life.'>" . $metadata["birth"]["age"] . "* years old</span>" ?> <?php endif; ?> <?php else: ?> - <?php if ($metadata["birth"]["year"] <= 2000): ?> + <?php if ($metadata["birth"]["year"] <= 1900): ?> - <?php else: ?> <?php @@ -139,7 +139,7 @@ if ($memberData["name"] === "fusion") { <?php global $isLoggedIn; if ($isLoggedIn && $memberData["name"] !== "unknown" && $memberData["name"] !== "fusion"): ?> <?php if (!isset($metadata["bitset"])): ?> <div class="alert alert-warning"> - <b>This member's metadata needs an update.</b> It still uses the old JSON metadata system instead of the new 24bit integer-based system. Contact a developer to request an update. (only administrators can see this; file: <code><?= $_SERVER['DOCUMENT_ROOT'] ?>/includes/data/<?= $systemID ?>-<?= $memberID ?>-metadata.json</code>) + <b>This member's metadata needs an update.</b> It still uses the old JSON metadata system instead of the new 24bit integer-based system. Contact a developer to request an update. (only administrators can see this; file: <code><?= $_SERVER['DOCUMENT_ROOT'] ?>/includes/data/metadata/<?= $memberID ?>.json</code>) </div> <?php endif; ?> <div class="alert alert-dark"> @@ -149,9 +149,9 @@ if ($memberData["name"] === "fusion") { <li><b>ID:</b> <code><?= $memberID ?></code> (<code><?= $systemID . "/" . $memberID ?></code>, <?= $memberData["name"] ?>)</li> <li><b>Files:</b> <ul> - <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-metadata.json" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-metadata.json") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-metadata.json") . " bytes" : "not found" ?>)</li> - <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-content.html" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-content.html") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-content.html") . " bytes" : "not found" ?>)</li> - <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-private.html" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-private.html") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-private.html") . " bytes" : "not found" ?>)</li> + <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$memberID.json") . " bytes" : "not found" ?>)</li> + <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") . " bytes" : "not found" ?>)</li> + <li><code><?= $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html" ?></code> (<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ? filesize($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") . " bytes" : "not found" ?>)</li> </ul> </li> <li><b>Date added:</b> <?= date('l j F Y', strtotime($memberData["created"])) ?> (<?= timeAgo($memberData["created"]) ?>, <code><?= $memberData["created"] ?></code>)</li> @@ -172,7 +172,7 @@ if ($memberData["name"] === "fusion") { <li><b>Protector:</b> <code><?= $metadata["protector"] ? "1" : "0" ?></code> (<?= $metadata["protector"] ? "Yes" : "No" ?>)</li> <li><b>Little:</b> <code><?= $metadata["little"] ?></code> (<?= $metadata["little"] === 2 ? "Is a little" : ($metadata["little"] === 1 ? "Is an age regressor" : ($metadata["little"] === 3 ? "Not a little, but younger" : "No")) ?>)</li> <li><b>Relations count:</b> <code><?= count($metadata["marefriends"]) + count($metadata["sisters"]) ?></code></li> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; $score = calculateScore($metadata, $memberData["display_name"] ?? $memberData["name"]); ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; $score = calculateScore($metadata, $memberData["display_name"] ?? $memberData["name"]); ?> <li> <b>Score breakdown:</b> <code><?= $score["total"] ?></code> <ul> @@ -204,7 +204,7 @@ if ($memberData["name"] === "fusion") { <br> <div style="filter:invert(0);" class="alert alert-warning"> <b>AI-generated page:</b> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ai.php"; ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/ai.inc"; ?> </div> </details> </div> @@ -238,7 +238,7 @@ if ($memberData["name"] === "fusion") { <p>Below is the list of who is merged, we can be either from a single system or from different systems.</p> <div class="list-group"> <?php $foundFusion = false; $fusionOn = false; foreach ($fusionRaindrops ? $frontersRaindrops['members'] : $frontersCloudburst['members'] as $fronter): if ($fronter["name"] !== "fusion"): if ($fusionOn): $foundFusion = true; $name = str_ends_with($fronter['name'], "-travelling") ? substr($fronter['name'], 0, strlen($fronter['name']) - 11) : $fronter['name'] ?> - <a class="list-group-item list-group-item-action text-black" href="/<?= $name ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $name . ".png") ? "-" . $name : "" ?>.png" style="filter:invert(1) hue-rotate(180deg);width:24px;"> <?= $fronter["display_name"] ?? $name ?></a> + <a class="list-group-item list-group-item-action text-black" href="/<?= $name ?>"><img src="<?= getAsset($system, $fronter["id"], "heads") ?>" style="filter:invert(1) hue-rotate(180deg);width:24px;"> <?= $fronter["display_name"] ?? $name ?></a> <?php endif; else: $fusionOn = true; endif; endforeach; ?> </div> <?php if (!$foundFusion): ?> @@ -250,19 +250,19 @@ if ($memberData["name"] === "fusion") { <small style="opacity:.5;display:block;">(edit: <a href="/-/edit/<?= $system ?>/<?= $memberData['name'] ?>">public</a>, <a href="/-/edit-private/<?= $system ?>/<?= $memberData['name'] ?>">private</a>)</small> <?php endif; ?> - <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-private.html") && $isLoggedIn): ?> - <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-private.html") ?> + <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") && $isLoggedIn): ?> + <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID-private.html") ?> <hr> <?php endif; ?> - <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-content.html")): ?> - <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$memberID-content.html") ?> + <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html")): ?> + <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$memberID.html") ?> <?php else: ?> <p class="text-muted">This page is automatically generated and may not be 100% accurate.</p> - <?php require $_SERVER['DOCUMENT_ROOT'] . "/includes/ai.php"; ?> + <?php require $_SERVER['DOCUMENT_ROOT'] . "/includes/ai.inc"; ?> <?php endif; ?> <?php endif; ?> </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/member/hierarchy.php b/includes/member/hierarchy.inc index 301bd1c..dfb42c9 100644 --- a/includes/member/hierarchy.php +++ b/includes/member/hierarchy.inc @@ -6,22 +6,22 @@ global $memberData; global $memberCommonName; global $memberID; $title = "Member hierarchy · " . $memberCommonName . " · " . $systemCommonName; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json"), true); +$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); -$metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-" . $memberID . "-metadata.json"), true)); +$metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $memberID . ".json"), true)); -$allMembers = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-members.json"), true), $systemID); -$allMembers2 = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "-members.json"), true), $systemID === "gdapd" ? "ynmuc" : "gdapd"); +$allMembers = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/members.json"), true), $systemID); +$allMembers2 = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), $systemID === "gdapd" ? "ynmuc" : "gdapd"); -$systemCommonData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-general.json"), true); +$systemCommonData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/general.json"), true); if ($travelling[$memberID]["travelling"]) { - $allMembers = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "-members.json"), true), $systemID === "gdapd" ? "ynmuc" : "gdapd"); - $allMembers2 = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-members.json"), true), $systemID); + $allMembers = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), $systemID === "gdapd" ? "ynmuc" : "gdapd"); + $allMembers2 = scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/members.json"), true), $systemID); - $systemCommonData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "-general.json"), true); + $systemCommonData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/general.json"), true); $system = $systemID === "gdapd" ? "cloudburst" : "raindrops"; $systemCommonName = $systemID === "gdapd" ? "Cloudburst System" : "Raindrops System"; @@ -174,4 +174,4 @@ if ($travelling[$memberID]["travelling"]) { } </style> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/member/tree.php b/includes/member/tree.inc index 2e94951..2e94951 100644 --- a/includes/member/tree.php +++ b/includes/member/tree.inc diff --git a/includes/pages.json b/includes/pages.json index 4fc023b..704fcbb 100644 --- a/includes/pages.json +++ b/includes/pages.json @@ -1,162 +1,212 @@ { + "about": { + "name": "About Cold Haze", + "short": "About", + "admin": true, + "rail": true + }, "actions": { "name": "Actions database", "short": "Actions", - "admin": true + "admin": true, + "rail": true }, "api": { "name": "API", "short": null, - "admin": false + "admin": false, + "rail": false }, "app": { "name": "Mobile application", "short": null, - "admin": false + "admin": false, + "rail": false }, "bitset": { "name": "Bitset calculator", "short": "Bitset", - "admin": true + "admin": true, + "rail": true }, "byfront": { "name": "Members by last fronted", "short": "Last fronts", - "admin": true + "admin": true, + "rail": true }, "dashboard": { "name": "Dashboard", "short": null, - "admin": true + "admin": true, + "rail": true }, "debug": { "name": "Data updater debugging", "short": null, - "admin": false + "admin": false, + "rail": true }, "demo": { "name": "Demo interface", "short": null, - "admin": false + "admin": false, + "rail": false }, "docs": { "name": "Documents", "short": "Docs", - "admin": true + "admin": true, + "rail": true }, "disclaimers": { "name": "Disclaimers", "short": null, - "admin": false + "admin": false, + "rail": false }, "edit": { "name": "Editor", "short": null, - "admin": true + "admin": true, + "rail": false }, "edit-private": { "name": "Editor (private)", "short": null, - "admin": true + "admin": true, + "rail": false }, "emergency": { "name": "Emergency alert", "short": null, - "admin": true + "admin": true, + "rail": true }, "fronting": { "name": "Front planner", "short": null, - "admin": true + "admin": true, + "rail": true + }, + "government": { + "name": "Government", + "short": null, + "admin": false, + "rail": false }, "home": { "name": "Home", "short": null, - "admin": false + "admin": false, + "rail": false }, "login": { "name": "Login", "short": null, - "admin": false + "admin": false, + "rail": false }, "logout": { "name": "Logout", "short": null, - "admin": false + "admin": false, + "rail": false }, "nicknames": { "name": "Relations nicknames", "short": "Nicknames", - "admin": true + "admin": true, + "rail": true }, "page": { "name": "Member/system page", "short": null, - "admin": false + "admin": false, + "rail": false }, "parser": { "name": "Message parser", "short": null, - "admin": false + "admin": false, + "rail": false }, "pleasure": { "name": "Pleasure alert", "short": null, - "admin": true + "admin": true, + "rail": true }, "prefix": { "name": "Prefix generator", "short": null, - "admin": false + "admin": false, + "rail": false }, "relations": { "name": "Relations", "short": null, - "admin": false + "admin": false, + "rail": false }, "rules": { "name": "Systems rules", "short": "Rules", - "admin": true + "admin": true, + "rail": true }, "score": { "name": "Score system testing", "short": null, - "admin": true + "admin": true, + "rail": true }, "splitting": { "name": "Members by splitting date", "short": "Splits", - "admin": true + "admin": true, + "rail": true + }, + "stats": { + "name": "Statistics", + "short": "Stats", + "admin": true, + "rail": true }, "terminology": { "name": "Terminology", "short": null, - "admin": false + "admin": false, + "rail": true }, "together": { "name": "Watch Together", "short": "Together", - "admin": true + "admin": true, + "rail": true }, "together-dev": { "name": "Watch Together (dev)", "short": null, - "admin": true + "admin": true, + "rail": false }, "toys": { "name": "Toys database", "short": "Toys", - "admin": true + "admin": true, + "rail": true }, "travelling": { "name": "System travels manager", - "short": null, - "admin": true + "short": "Travels", + "admin": true, + "rail": true }, "wakeup": { "name": "Wake-up alert", "short": null, - "admin": true + "admin": true, + "rail": true } }
\ No newline at end of file diff --git a/includes/planner.php b/includes/planner.inc index f98d83b..da25770 100644 --- a/includes/planner.php +++ b/includes/planner.inc @@ -1,16 +1,16 @@ <?php -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/travelling.php"; global $travelling; -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.php"; -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/pronouns.php"; -require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; global $isUserLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rainbow.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; - -$cloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-planner.json"), true); -$raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-planner.json"), true); +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/travelling.inc"; global $travelling; +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/score.inc"; +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/pronouns.inc"; +require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/bitset.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isUserLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/banner.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/rainbow.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; + +$cloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/ynmuc.json"), true); +$raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/gdapd.json"), true); foreach ($cloudburst as $id => $day) { foreach ($day as $index => $fronter) { @@ -70,11 +70,11 @@ foreach ($raindrops as $id => $day) { } } -function day($display, $diff): void { global $cloudburst; global $raindrops; ?> +function day($display, $diff): void { if ($diff < 0) $disabled = true; else $disabled = false; global $cloudburst; global $raindrops; ?> <?php if (!isset($display)) { $display = date('l', time() + (86400 * $diff)); }?> - <tr class="planner-day" id="planner-header-<?= $diff ?>"> + <tr class="planner-day" id="planner-header-<?= $diff ?>" <?php if ($disabled): ?>style="opacity: .75; pointer-events: none;"<?php endif; ?>> <td colspan="10"><?= $display ?></td> <?php @@ -90,12 +90,12 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> ?> </tr> - <tr class="planner-header"> + <tr class="planner-header" <?php if ($disabled): ?>style="opacity: .75; pointer-events: none;"<?php endif; ?>> <td colspan="5">Cloudburst System</td> <td colspan="5">Raindrops System</td> </tr> <?php for ($i = 0; $i <= $biggest; $i++): ?> - <tr class="planner-member"> + <tr class="planner-member" <?php if ($disabled): ?>style="opacity: .75; pointer-events: none;"<?php endif; ?>> <?php if (isset($dayCloudburst[$index])): ?> <td class="planner-member-id"> <?= $index + 1 ?> @@ -103,9 +103,9 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> <td class="planner-link" style="width:50vw;" <?php if (!isset($dayCloudburst[$index][1])): ?>colspan="3" <?php else: ?>colspan="2"<?php endif; ?>> <?php $member = getMemberWithoutSystem($dayCloudburst[$index][0]); ?> <?php if ($member["name"] === "fusion"): ?> - <a class="member-link" onclick="openEditFronter('cloudburst', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/logo/logo.png" style="width:24px;"> <span class="text-muted merge-desktop">Multiple merged members</span><span class="text-muted merge-mobile">Merge</span></a> + <a class="member-link" onclick="openEditFronter('cloudburst', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/logo/logo.png" style="width:24px;"> <span class="member-link-text"><span class="text-muted merge-desktop">Multiple merged members</span><span class="text-muted merge-mobile">Merge</span></span></a> <?php else: ?> - <a class="member-link" onclick="openEditFronter('cloudburst', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> + <a class="member-link" onclick="openEditFronter('cloudburst', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <span class="member-link-text"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></span></a> <?php endif; ?> </td> <?php if (!isset($dayCloudburst[$index][1])): ?> @@ -118,9 +118,9 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> <td class="planner-link" style="width:41.35vw;" colspan="2"> <?php $member = getMemberWithoutSystem($dayCloudburst[$index][1]); ?> <?php if ($member["name"] === "fusion"): ?> - <a class="member-link" onclick="openEditCofronter('cloudburst', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/logo/logo.png" style="width:24px;"> <span class="text-muted merge-desktop">Multiple merged members</span><span class="text-muted merge-mobile">Merge</span></a> + <a class="member-link" onclick="openEditCofronter('cloudburst', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/logo/logo.png" style="width:24px;"> <span class="member-link-text"><span class="text-muted merge-desktop">Multiple merged members</span><span class="text-muted merge-mobile">Merge</span></span></a> <?php else: ?> - <a class="member-link" onclick="openEditCofronter('cloudburst', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> + <a class="member-link" onclick="openEditCofronter('cloudburst', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <span class="member-link-text"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></span></a> <?php endif; ?> </td> <?php endif; ?> @@ -141,9 +141,9 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> <?php $member = getMemberWithoutSystem($dayRaindrops[$index][0]); ?> <td class="planner-link" style="width:50vw;" <?php if (!isset($dayRaindrops[$index][1])): ?>colspan="3" <?php else: ?>colspan="2"<?php endif; ?>> <?php if ($member["name"] === "fusion"): ?> - <a class="member-link" onclick="openEditFronter('raindrops', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/logo/logo.png" style="width:24px;"> <span class="text-muted merge-desktop">Multiple merged members</span><span class="text-muted merge-mobile">Merge</span></a> + <a class="member-link" onclick="openEditFronter('raindrops', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/logo/logo.png" style="width:24px;"> <span class="member-link-text"><span class="text-muted merge-desktop">Multiple merged members</span><span class="text-muted merge-mobile">Merge</span></span></a> <?php else: ?> - <a class="member-link" onclick="openEditFronter('raindrops', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> + <a class="member-link" onclick="openEditFronter('raindrops', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <span class="member-link-text"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></span></a> <?php endif; ?> </td> <?php if (!isset($dayRaindrops[$index][1])): ?> @@ -156,15 +156,15 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> <td class="planner-link" style="width:41.35vw;" colspan="2"> <?php $member = getMemberWithoutSystem($dayRaindrops[$index][1]); ?> <?php if ($member["name"] === "fusion"): ?> - <a class="member-link" onclick="openEditCofronter('raindrops', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/logo/logo.png" style="width:24px;"> <span class="text-muted merge-desktop">Multiple merged members</span><span class="text-muted merge-mobile">Merge</span></a> + <a class="member-link" onclick="openEditCofronter('raindrops', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/logo/logo.png" style="width:24px;"> <span class="member-link-text"><span class="text-muted merge-desktop">Multiple merged members</span><span class="text-muted merge-mobile">Merge</span></span></a> <?php else: ?> - <a class="member-link" onclick="openEditCofronter('raindrops', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> + <a class="member-link" onclick="openEditCofronter('raindrops', <?= $index ?>, '<?= date('Y-m-d', time() + (86400 * $diff)) ?>')"><img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <span class="member-link-text"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></span></a> <?php endif; ?> </td> <?php endif; ?> <?php elseif ($index === count($dayRaindrops)): ?> <td class="planner-add-inner planner-link" colspan="5"> - <a href="#" onclick="addFronter('raindrops', <?= $diff ?>);" class="planner-add-link"> + <a href="#" onclick="addFronter('raindrops', <?= $diff ?>, <?= $index ?>);" class="planner-add-link"> <img src="/assets/icons/add.svg" alt="" class="planner-add-icon"> <span class="planner-add-text">Add new fronter</span> </a> @@ -174,7 +174,7 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> <?php endif; ?> </tr> <?php $index++; endfor; ?> - <tr class="planner-day planner-end-of-day"> + <tr class="planner-day planner-end-of-day" <?php if ($disabled): ?>style="opacity: .75; pointer-events: none;"<?php endif; ?>> <td colspan="10"> <?php if (count($dayCloudburst) > 0 && count($dayRaindrops) > 0): ?> <?= getMiniName(getMemberWithoutSystem($dayCloudburst[count($dayCloudburst) - 1][0])["display_name"] ?? getMemberWithoutSystem($dayCloudburst[count($dayCloudburst) - 1][0])["name"]) ?> will sleep with <?= getMiniName(getMemberWithoutSystem($dayRaindrops[count($dayRaindrops) - 1][0])["display_name"] ?? getMemberWithoutSystem($dayRaindrops[count($dayRaindrops) - 1][0])["name"]) ?> @@ -191,13 +191,27 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> <h2>Front planner</h2> <table id="planner"> <tbody> + <?php day("Yesterday", -1) ?> <?php day("Today", 0) ?> <?php day("Tomorrow", 1) ?> - <?php day(null, 2) ?> - <?php day(null, 3) ?> - <?php day(null, 4) ?> - <?php day(null, 5) ?> - <?php day(null, 6) ?> + <?php + + $factor = 1; + $lastDay = time() + 86400; + $lastDayWeek = date('W', $lastDay); + $tomorrowWeek = date('W', time() + 86400); + + while ($lastDayWeek === $tomorrowWeek) { + $factor++; + $lastDay = time() + (86400 * $factor); + $lastDayWeek = date('W', $lastDay); + + if ($lastDayWeek === $tomorrowWeek) { + day(null, $factor); + } + } + + ?> </tbody> </table> @@ -336,6 +350,16 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> } } + @media (max-width: 991px) { + .member-link-text { + display: none; + } + + .planner-link .member-link { + text-align: center; + } + } + </style> <!--suppress JSUnresolvedVariable, JSUnresolvedFunction --> @@ -348,14 +372,40 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> window.names = JSON.parse(window.atob(`<?php $names = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { $names[$member['id']] = $member['display_name'] ?? $member['name']; } - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { $names[$member['id']] = $member['display_name'] ?? $member['name']; } echo(base64_encode(json_encode($names))) ?>`)); + window.relations = JSON.parse(window.atob(`<?php + + $relations = []; + foreach (scoreOrderGlobal() as $member) { + $relations[$member['id']] = array_map(function ($i) { + return explode("/", $i)[1]; + }, [...($member["_metadata"]["marefriends"] ?? []), ...($member["_metadata"]["sisters"] ?? []), ...($member["_metadata"]["caretakers"] ?? [])]); + } + + echo(base64_encode(json_encode($relations))) ?>`)); + + function getSuggestedPonies() { + if (window.fronting[window.addSystem === "gdapd" ? "cloudburst" : "raindrops"][window.currentWorkingDate][window.addIndex]) { + let otherPony = window.fronting[window.addSystem === "gdapd" ? "cloudburst" : "raindrops"][window.currentWorkingDate][window.addIndex][0]; + let availablePonies = window.relations[window.fronting[window.addSystem === "gdapd" ? "cloudburst" : "raindrops"][window.currentWorkingDate][window.addIndex][0]]; + + document.getElementById("associated-results").innerHTML = ""; + + for (let pony of availablePonies) { + document.getElementById("associated-results").innerHTML += document.getElementById("list-pony-" + pony).outerHTML; + } + + document.getElementById("list").style.display = "none"; + document.getElementById("associated-results").style.display = ""; + } + } function ordinal(n) { let s = ["th", "st", "nd", "rd"]; @@ -394,6 +444,26 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> case "<?= date('Y-m-d', time() + (86400 * 6)) ?>": display = "on <?= date('l', time() + (86400 * 6)) ?>"; break; + + case "<?= date('Y-m-d', time() + (86400 * 7)) ?>": + display = "on <?= date('l', time() + (86400 * 7)) ?>"; + break; + + case "<?= date('Y-m-d', time() + (86400 * 8)) ?>": + display = "on <?= date('l', time() + (86400 * 8)) ?>"; + break; + + case "<?= date('Y-m-d', time() + (86400 * 9)) ?>": + display = "on <?= date('l', time() + (86400 * 9)) ?>"; + break; + + case "<?= date('Y-m-d', time() + (86400 * 10)) ?>": + display = "on <?= date('l', time() + (86400 * 10)) ?>"; + break; + + case "<?= date('Y-m-d', time() + (86400 * 11)) ?>": + display = "on <?= date('l', time() + (86400 * 11)) ?>"; + break; } window.selectedFronting = { @@ -533,7 +603,7 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> document.getElementById("search2").focus(); } - function addFronter(system, offset) { + function addFronter(system, offset, index) { let date; let display; @@ -572,14 +642,41 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> date = "<?= date('Y-m-d', time() + (86400 * 6)) ?>"; display = "on <?= date('l', time() + (86400 * 6)) ?>"; break; + + case 7: + date = "<?= date('Y-m-d', time() + (86400 * 7)) ?>"; + display = "on <?= date('l', time() + (86400 * 7)) ?>"; + break; + + case 8: + date = "<?= date('Y-m-d', time() + (86400 * 8)) ?>"; + display = "on <?= date('l', time() + (86400 * 8)) ?>"; + break; + + case 9: + date = "<?= date('Y-m-d', time() + (86400 * 9)) ?>"; + display = "on <?= date('l', time() + (86400 * 9)) ?>"; + break; + + case 10: + date = "<?= date('Y-m-d', time() + (86400 * 10)) ?>"; + display = "on <?= date('l', time() + (86400 * 10)) ?>"; + break; + + case 11: + date = "<?= date('Y-m-d', time() + (86400 * 11)) ?>"; + display = "on <?= date('l', time() + (86400 * 11)) ?>"; + break; } window.currentWorkingDate = date; + window.addIndex = index; document.getElementById("new-fronter-date").innerText = display; document.getElementById("new-fronter-system").innerText = system === "cloudburst" ? "Cloudburst System" : "Raindrops System"; window.addSystem = system === "raindrops" ? "gdapd" : "ynmuc"; document.getElementById("list").style.display = "block"; + getSuggestedPonies(); document.getElementById("search-results").style.display = "none"; document.getElementById("search").value = ""; @@ -688,13 +785,14 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> <div id="list"> <div class="list-group"> <?php foreach (scoreOrderGlobal() as $member): ?> - <a id="list-pony-<?= $member['id'] ?>" onclick="confirmFronterAdd(window.addSystem, '<?= $member['id'] ?>');" class="new-fronter-link member-link list-group-item list-group-item-action" href="#"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?><peh-schedule-add></peh-schedule-add></a> + <a id="list-pony-<?= $member['id'] ?>" onclick="confirmFronterAdd(window.addSystem, '<?= $member['id'] ?>');" class="new-fronter-link member-link list-group-item list-group-item-action" href="#"><img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?><peh-schedule-add></peh-schedule-add></a> <?php endforeach; $member = getSystemMember("gdapd", "irxyh") ?> <a onclick="confirmFronterAdd(window.addSystem, 'irxyh');" class="new-fronter-link member-link list-group-item list-group-item-action" href="#"><img src="/assets/logo/logo.png" style="width:24px;"> <span class="text-muted">Multiple merged members</span></a> </div> </div> <div id="search-results" class="list-group"></div> + <div id="associated-results" class="list-group"></div> </div> </div> @@ -718,7 +816,7 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> <div id="list2"> <div class="list-group"> <?php foreach (scoreOrderGlobal() as $member): ?> - <a id="list2-pony-<?= $member['id'] ?>" onclick="confirmCofronterAdd(window.addSystem, '<?= $member['id'] ?>');" class="new-cofronter-link member-link list-group-item list-group-item-action" href="#"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?><peh-schedule-add></peh-schedule-add></a> + <a id="list2-pony-<?= $member['id'] ?>" onclick="confirmCofronterAdd(window.addSystem, '<?= $member['id'] ?>');" class="new-cofronter-link member-link list-group-item list-group-item-action" href="#"><img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?><peh-schedule-add></peh-schedule-add></a> <?php endforeach; $member = getSystemMember("gdapd", "irxyh") ?> </div> </div> @@ -858,6 +956,7 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> if (query.trim() === "") { document.getElementById("list").style.display = "block"; + getSuggestedPonies(); document.getElementById("search-results").style.display = "none"; } } @@ -920,7 +1019,7 @@ function day($display, $diff): void { global $cloudburst; global $raindrops; ?> <?php -file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-planner.json", json_encode($cloudburst)); -file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-planner.json", json_encode($raindrops)); +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/ynmuc.json", json_encode($cloudburst)); +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/gdapd.json", json_encode($raindrops)); ?>
\ No newline at end of file diff --git a/includes/pleasure.php b/includes/pleasure.inc index 8b4835b..8b4835b 100644 --- a/includes/pleasure.php +++ b/includes/pleasure.inc diff --git a/includes/pronouns.php b/includes/pronouns.inc index 6ab2487..6ab2487 100644 --- a/includes/pronouns.php +++ b/includes/pronouns.inc diff --git a/includes/rail.inc b/includes/rail.inc new file mode 100644 index 0000000..b2ed467 --- /dev/null +++ b/includes/rail.inc @@ -0,0 +1,176 @@ +<?php global $pages; ?> +<div id="rail" style="position: fixed;top: 60px;left: 0;bottom: 0;background: rgba(255, 255, 255, .1);width: 32px; display: grid; grid-template-rows: max-content 1fr;"> + <div> + <a id="rl-1" class="rail-link" href="/-/dashboard" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/home.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-2" class="rail-link" href="/-/fronting" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/fronting.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-3" class="rail-link" href="/-/actions" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/actions.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-4" class="rail-link" href="/-/rules" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/rules.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-5" class="rail-link" href="/-/docs" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/docs.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-6" class="rail-link" href="/-/nicknames" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/nicknames.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-7" class="rail-link" href="/-/together" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/together.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-8" class="rail-link" href="/-/splitting" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/splitting.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-9" class="rail-link" href="/-/byfront" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/byfront.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-10" class="rail-link" href="/-/bitset" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/bitset.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-11" class="rail-link" href="/-/travelling" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/travelling.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-12" class="rail-link" href="/-/toys" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/toys.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-16" class="rail-link" href="/-/stats" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/stats.svg" style="filter: invert(1) brightness(2000%); height: 24px; display:block;"> + </a> + <a id="rl-87" class="rail-link" href="/-/emergency" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/emergency.svg" style="height: 24px; display:block;"> + </a> + <a id="rl-88" class="rail-link" href="/-/wakeup" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/wakeup.svg" style="height: 24px; display:block;"> + </a> + <a id="rl-89" class="rail-link" href="/-/pleasure" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/pleasure.svg" style="height: 24px; display:block;"> + </a> + </div> + <div style="margin-top: auto; height: max-content;"> + <a id="rl-98" class="rail-link" href="/-/debug" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/debug.svg" style="filter: invert(1); height: 24px; display:block;"> + </a> + <a id="rl-99" class="rail-link" href="/-/about" style="padding: 4px; display: block;"> + <img alt="" src="/assets/icons/about.svg" style="filter: invert(1) brightness(2000%); height: 24px; display:block;"> + </a> + </div> +</div> +<div id="rail-text" style="position: fixed;top: 60px;left: 32px;bottom: 0; z-index: 9999999; opacity: 0; pointer-events: none; display: grid; grid-template-rows: max-content 1fr;"> + <div> + <div id="rlt-1" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["dashboard"]["name"] ?> + </div> + <div id="rlt-2" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["fronting"]["name"] ?> + </div> + <div id="rlt-3" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["actions"]["name"] ?> + </div> + <div id="rlt-4" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["rules"]["name"] ?> + </div> + <div id="rlt-5" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["docs"]["name"] ?> + </div> + <div id="rlt-6" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["nicknames"]["name"] ?> + </div> + <div id="rlt-7" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["together"]["name"] ?> + </div> + <div id="rlt-8" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["splitting"]["name"] ?> + </div> + <div id="rlt-9" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["byfront"]["name"] ?> + </div> + <div id="rlt-10" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["bitset"]["name"] ?> + </div> + <div id="rlt-11" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["travelling"]["name"] ?> + </div> + <div id="rlt-12" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["toys"]["name"] ?> + </div> + <div id="rlt-16" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["stats"]["name"] ?> + </div> + <div id="rlt-87" class="rail-text-item text-danger fw-bold" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["emergency"]["name"] ?> + </div> + <div id="rlt-88" class="rail-text-item text-info fw-bold" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["wakeup"]["name"] ?> + </div> + <div id="rlt-89" class="rail-text-item text-success fw-bold" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["pleasure"]["name"] ?> + </div> + </div> + <div style="margin-top: auto; height: max-content;"> + <div id="rlt-98" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["debug"]["name"] ?> + </div> + <div id="rlt-99" class="rail-text-item" style="height: 32px; display: flex; align-items: center; padding-left: 10px; opacity: 0;"> + <?= $pages["about"]["name"] ?> + </div> + </div> +</div> + +<style> + .rail-link:hover { + background: rgba(255, 255, 255, .1); + border-top: 1px solid #555; + border-bottom: 1px solid #555; + padding: 3px 4px !important; + } + + .rail-text-item { + border: 1px solid #555; + border-left: none; + padding-right: 10px; + border-top-right-radius: 999px; + border-bottom-right-radius: 999px; + width: 0; + } + + .rail-text-item.hovered { + background: #313131; + opacity: 1 !important; + width: max-content !important; + } +</style> + +<script> + Array.from(document.getElementsByClassName("rail-link")).forEach((i) => { + let rt = document.getElementById("rlt-" + i.id.split("-")[1]); + + i.onmouseenter = () => { + rt.classList.add("hovered"); + } + + i.onmouseleave = () => { + rt.classList.remove("hovered"); + } + }) + + document.getElementById("rail").onmouseenter = () => { + document.getElementById("rail-text").style.opacity = "1"; + } + + document.getElementById("rail").onmouseleave = () => { + document.getElementById("rail-text").style.opacity = "0"; + } + + window.onscroll = () => { + let scroll = document.getElementsByTagName("html")[0].scrollTop; + let pos = 60 - scroll; + + if (pos <= 0) pos = 0; + document.getElementById("rail").style.top = pos + "px"; + document.getElementById("rail-text").style.top = pos + "px"; + } +</script>
\ No newline at end of file diff --git a/includes/rainbow.php b/includes/rainbow.inc index c710be0..470f288 100644 --- a/includes/rainbow.php +++ b/includes/rainbow.inc @@ -1,48 +1,8 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; - -function rgbToHsl($r, $g, $b) { - $oldR = $r; - $oldG = $g; - $oldB = $b; - - $r /= 255; - $g /= 255; - $b /= 255; - - $max = max($r, $g, $b); - $min = min($r, $g, $b); - - $l = ($max + $min) / 2; - $d = $max - $min; - - if ($d == 0) { - $h = $s = 0; - } else { - $s = $d / (1 - abs(2 * $l - 1)); - - switch ($max) { - case $r: - $h = 60 * fmod((($g - $b) / $d), 6); - if ($b > $g) { - $h += 360; - } - break; - - case $g: - $h = 60 * (($b - $r) / $d + 2); - break; - - case $b: - $h = 60 * (($r - $g) / $d + 4); - break; - } - } - - return array(round($h, 2), round($s, 2), round($l, 2)); -} +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; function rainbow(): array { $members = scoreOrderGlobal(); diff --git a/includes/random.php b/includes/random.inc index b6e7905..b6e7905 100644 --- a/includes/random.php +++ b/includes/random.inc diff --git a/includes/refresh.php b/includes/refresh.php index 8f9da79..e8e12dd 100644 --- a/includes/refresh.php +++ b/includes/refresh.php @@ -1,5 +1,7 @@ <?php +$_SERVER['DOCUMENT_ROOT'] = ".."; + $app = json_decode(file_get_contents("./app.json"), true); $start = microtime(true); @mkdir("./data"); @@ -10,11 +12,11 @@ $restored = []; $times = []; $currentOpStart = microtime(true); -file_put_contents("./data/backup/actions_" . date('Y-m-d_H-i-s') . ".json", @file_get_contents("./data/actions.json")); -file_put_contents("./data/backup/toys_" . date('Y-m-d_H-i-s') . ".json", @file_get_contents("./data/toys.json")); +file_put_contents("./data/actions/" . date('Y-m-d_H-i-s') . ".json", @file_get_contents("./data/actions/actions.json")); +file_put_contents("./data/toys/" . date('Y-m-d_H-i-s') . ".json", @file_get_contents("./data/toys/toys.json")); -exec('bash -c "cd /nas/web/ponies.equestria.horse/includes/data/backup; ls -tp toys_* | grep -v \'/$\' | tail -n +20 | xargs -I {} rm -- {}"'); -exec('bash -c "cd /nas/web/ponies.equestria.horse/includes/data/backup; ls -tp actions_* | grep -v \'/$\' | tail -n +20 | xargs -I {} rm -- {}"'); +exec('bash -c "cd /nas/web/ponies.equestria.horse/includes/data; ls -tp toys/20* | grep -v \'/$\' | tail -n +20 | xargs -I {} rm -- {}"'); +exec('bash -c "cd /nas/web/ponies.equestria.horse/includes/data; ls -tp actions/20* | grep -v \'/$\' | tail -n +20 | xargs -I {} rm -- {}"'); $times["important_backup"] = microtime(true) - $currentOpStart; @@ -40,10 +42,83 @@ foreach ($deletable as $item) { $times["docs_cleanup"] = microtime(true) - $currentOpStart; $currentOpStart = microtime(true); +$version = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json"), true); + +$ignore = [ + $_SERVER['DOCUMENT_ROOT'] . "/Data", + $_SERVER['DOCUMENT_ROOT'] . "/bits/Data", + $_SERVER['DOCUMENT_ROOT'] . "/Private/Data", + $_SERVER['DOCUMENT_ROOT'] . "/bits/Data", + $_SERVER['DOCUMENT_ROOT'] . "/bits/Private/Data", + $_SERVER['DOCUMENT_ROOT'] . "/includes/data", + $_SERVER['DOCUMENT_ROOT'] . "/includes/tokens", + $_SERVER['DOCUMENT_ROOT'] . "/app", + $_SERVER['DOCUMENT_ROOT'] . "/assets", +]; + +function rscandir($dir) { + global $ignore; + $files = []; + + foreach (array_filter(scandir($dir), function ($i) { + return !str_starts_with($i, "."); + }) as $file) { + if (in_array($dir . "/" . $file, $ignore)) continue; + + if (is_dir($dir . "/" . $file)) { + array_push($files, ...rscandir($dir . "/" . $file)); + } else { + $files[] = $dir . "/" . $file; + } + } + + return array_unique($files); +} + +function calculateVersionNumber() { + $files = rscandir($_SERVER['DOCUMENT_ROOT']); + $hashes = []; + + foreach ($files as $file) { + $hashes[] = md5_file($file); + } + + $hash = md5(implode("", $hashes)); + return [$hash, $hashes]; +} + +$versionHash = calculateVersionNumber(); + +if ($versionHash[0] !== $version["hash"]) { + $version["hash"] = $versionHash[0]; + $version["timestamp"] = time(); + $version["revision"] = 0; + $version["list"] = [ + "current" => $versionHash[1], + "old" => isset($version["list"]) ? $version["list"]["current"] ?? null : null + ]; + $version["build"]++; +} else { + $version["revision"]++; +} + +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json", json_encode($version)); +$times["version"] = microtime(true) - $currentOpStart; + +$currentOpStart = microtime(true); foreach (array_filter(scandir("./data"), function ($i) { - return !str_starts_with($i, ".") && $i !== "backup" && is_file("./data/" . $i); + return !str_starts_with($i, ".") && $i !== "backup" && (is_file("./data/" . $i) || is_dir("./data/" . $i)); }) as $file) { - $files[] = $file; + if (is_dir("./data/" . $file)) { + foreach (array_filter(scandir("./data"), function ($i) use ($file) { + return !str_starts_with($i, ".") && $i !== "backup" && is_file("./data/" . $file . "/" . $i); + }) as $file2) { + @mkdir("./data/backup/" . $file); + $files[] = $file . "/" . $file2; + } + } else { + $files[] = $file; + } } @mkdir("./data/backup"); @@ -57,17 +132,28 @@ function getSystem(string $id) { echo(" Base system info\n"); $currentOpStart = microtime(true); - file_put_contents("./data/$id-general.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id")); + $data = file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id"); + + if (trim($data) !== "" && $data !== false) { + file_put_contents("./data/$id/general.json", $data); + } $times["system-general-$id"] = microtime(true) - $currentOpStart; echo(" System members\n"); $currentOpStart = microtime(true); - file_put_contents("./data/$id-members.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id/members")); + $data = file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id/members"); + + if (trim($data) !== "" && $data !== false) { + file_put_contents("./data/$id/members.json", $data); + } $times["system-members-$id"] = microtime(true) - $currentOpStart; echo(" Fronters\n"); - $currentOpStart = microtime(true); - file_put_contents("./data/$id-fronters.json", file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id/fronters")); + $data = file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id/fronters"); + + if (trim($data) !== "" && $data !== false) { + file_put_contents("./data/$id/fronters.json", $data); + } $times["system-fronters-$id"] = microtime(true) - $currentOpStart; echo(" Switches\n"); @@ -84,8 +170,10 @@ function getSystem(string $id) { echo(" Part 3/3\n"); $switches3 = json_decode(file_get_contents("https://pluralkit.equestria.dev/v2/systems/$id/switches?before=$oldest"), true); - file_put_contents("./data/$id-switches.json", json_encode([...$switches1, ...$switches2, ...$switches3], JSON_PRETTY_PRINT)); - $times["system-switches-$id"] = microtime(true) - $currentOpStart; + if ($switches1 !== null && $switches2 !== null && $switches3 !== null) { + file_put_contents("./data/$id/switches.json", json_encode([...$switches1, ...$switches2, ...$switches3], JSON_PRETTY_PRINT)); + $times["system-switches-$id"] = microtime(true) - $currentOpStart; + } } getSystem("gdapd"); // Raindrops @@ -93,13 +181,13 @@ getSystem("ynmuc"); // Cloudburst echo("Calendar\n"); $currentOpStart = microtime(true); -file_put_contents("./data/calendar.ics", file_get_contents($app["calendar"])); +file_put_contents("./data/calendar/calendar.ics", file_get_contents($app["calendar"])); $times["calendar"] = microtime(true) - $currentOpStart; echo("Downloading images.\n"); if (!file_exists("./data/images")) mkdir("./data/images"); -foreach (json_decode(file_get_contents("./data/gdapd-members.json"), true) as $member) { +foreach (json_decode(file_get_contents("./data/gdapd/members.json"), true) as $member) { $currentOpStart2 = microtime(true); echo(" " . $member['id'] . "\n"); @@ -117,7 +205,7 @@ foreach (json_decode(file_get_contents("./data/gdapd-members.json"), true) as $m $times["images-gdapd-" . $member['id']] = microtime(true) - $currentOpStart2; } -foreach (json_decode(file_get_contents("./data/ynmuc-members.json"), true) as $member) { +foreach (json_decode(file_get_contents("./data/ynmuc/members.json"), true) as $member) { $currentOpStart2 = microtime(true); echo(" " . $member['id'] . "\n"); @@ -152,12 +240,36 @@ $times["restore"] = microtime(true) - $currentOpStart; echo("Backing up...\n"); if (date('i') === "00") { - require_once "./backup.php"; + require_once "./backup.inc"; echo("Backup completed\n"); } else { echo("Backup skipped\n"); } +echo("Generating logo...\n"); + +$currentOpStart = microtime(true); +require_once "./logo.inc"; +$times["logo"] = microtime(true) - $currentOpStart; + +echo("Generated logo\n"); + +echo("Generating favicons...\n"); + +$currentOpStart = microtime(true); +require_once "./icons.inc"; +$times["favicons"] = microtime(true) - $currentOpStart; + +echo("Generated favicons\n"); + +echo("Downloading assets...\n"); + +$currentOpStart = microtime(true); +require_once "./assets.inc"; +$times["assets"] = microtime(true) - $currentOpStart; + +echo("Downloading assets\n"); + $time = array_sum($times); echo("Completed in " . $time . " seconds.\n"); diff --git a/includes/restore.php b/includes/restore.inc index 72748ab..72748ab 100644 --- a/includes/restore.php +++ b/includes/restore.inc diff --git a/includes/score.php b/includes/score.inc index cd8c389..c35e9bc 100644 --- a/includes/score.php +++ b/includes/score.inc @@ -15,6 +15,8 @@ function calculateScore($metadata, $name) { $scoreAdd = 0; if ($name === "Cloudy Dreams") $scoreAdd += 250; + if ($name === "Zoom Zephyrwing") $scoreAdd += 250; + if ($name === "Thunder") $scoreAdd += 250; if ($name === "Scoots/Mia") $scoreAdd -= 495; $score = $scoreHost + $scoreFictive + $scoreLittle + $scoreNotTalking + $scoreProtector + $scoreSharedMemory + $scoreRelations + $scoreSpecies + $scoreName + $scoreMedian + $scoreAdd; @@ -38,11 +40,11 @@ function calculateScore($metadata, $name) { function scoreOrder($members, $system) { $ordered = []; foreach ($members as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($member["system"] ?? $system) . "-$member[id]-metadata.json")) { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) { $systemID = $member["system"] ?? $system; - $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$member[id]-metadata.json"), true)); - $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$member[id]-metadata.json"), true)), $member["display_name"] ?? $member["name"]); + $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); + $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)), $member["display_name"] ?? $member["name"]); $ordered[] = $member; } } @@ -56,19 +58,22 @@ function scoreOrder($members, $system) { function scoreOrderGlobal() { $ordered = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json")) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) { $member["_system"] = "gdapd"; - $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)); - $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)), $member["display_name"] ?? $member["name"]); + $member["system"] = "gdapd"; + $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); + $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)), $member["display_name"] ?? $member["name"]); $ordered[] = $member; } } - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { - if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json")) { + + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { + if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling") && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) { $member["_system"] = "ynmuc"; - $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)); - $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)), $member["display_name"] ?? $member["name"]); + $member["system"] = "ynmuc"; + $member["_metadata"] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); + $member["_score"] = calculateScore(parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)), $member["display_name"] ?? $member["name"]); $ordered[] = $member; } } @@ -77,5 +82,5 @@ function scoreOrderGlobal() { return $b["_score"]["total"] - $a["_score"]["total"]; }); - return $ordered; + return array_values($ordered); }
\ No newline at end of file diff --git a/includes/search.php b/includes/search.inc index 037b6de..d8e573f 100644 --- a/includes/search.php +++ b/includes/search.inc @@ -22,7 +22,7 @@ const pages_list = JSON.parse(atob(`<?php $base = array_values(array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/pages"), function ($i) { - return !str_starts_with($i, ".") && $i !== "page.php" && $i !== "api.php" && $i !== "demo.php" && $i !== "logout.php" && $i !== "edit.php" && $i !== "edit-private.php" && $i !== "app.php" && !str_ends_with($i, ".bak.php") && !str_ends_with($i, ".old.php") && !str_ends_with($i, "-dev.php"); + return !str_starts_with($i, ".") && $i !== "page.inc" && $i !== "api.inc" && $i !== "demo.inc" && $i !== "logout.inc" && $i !== "edit.inc" && $i !== "edit-private.inc" && $i !== "app.inc" && !str_ends_with($i, ".bak.php") && !str_ends_with($i, ".old.php") && !str_ends_with($i, "-dev.php"); })); $list = array_values(array_filter(array_map(function ($i) { global $pages; @@ -70,9 +70,9 @@ $list = array_map(function ($i) { return [ 'name' => $i["display_name"] ?? $i["name"], - 'description' => file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$i[_system]-$i[id]-content.html") ? strip_tags(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$i[_system]-$i[id]-content.html")) : "", + 'description' => file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$i[id].html") ? strip_tags(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/$i[id].html")) : "", 'url' => '/' . $i["name"], - 'icon' => "/assets/uploads/pt" . (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($i['name']) . ".png") ? "-" . $i['name'] : "") . ".png", + 'icon' => getAsset($i["system"], $i["id"], "heads"), 'invert' => false ]; }, $base); @@ -103,7 +103,7 @@ global $isLoggedIn; if ($isLoggedIn) { - $base = array_values(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json"), true)); + $base = array_values(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true)); $list = array_map(function ($i) { return [ 'name' => $i["name"], @@ -143,7 +143,7 @@ global $isLoggedIn; if ($isLoggedIn) { - $base = array_values(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json"), true)); + $base = array_values(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true)); $list = array_map(function ($i) { return [ 'name' => $i["name"], diff --git a/includes/session.php b/includes/session.inc index b440c9c..b440c9c 100644 --- a/includes/session.php +++ b/includes/session.inc diff --git a/includes/short.php b/includes/short.inc index 59b3cae..66d749d 100644 --- a/includes/short.php +++ b/includes/short.inc @@ -1,8 +1,8 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; global $toplevel; diff --git a/includes/subsysbanner.php b/includes/subsysbanner.inc index 7788155..176380f 100644 --- a/includes/subsysbanner.php +++ b/includes/subsysbanner.inc @@ -12,7 +12,7 @@ global $subsystem; $fronters = array_map(function ($item) { return $item["id"]; -}, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-fronters.json"), true)["members"]); +}, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/fronters.json"), true)["members"]); ?> @@ -25,7 +25,7 @@ $fronters = array_map(function ($item) { <span> <b>Fronter:</b> <?php if (in_array($fronters[0], $subsystem["members"])): $member = getMember($fronters[0]); ?> - <a class="member-link" href="/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> + <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($member['system'], $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> <?php else: ?> <span class="text-muted">N/A</span> <?php endif; ?> @@ -34,14 +34,14 @@ $fronters = array_map(function ($item) { <?php $subsystem = getSubsystemByID($subsystemID); - $arr = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-switches.json"), true), function ($i) use ($subsystem) { + $arr = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/switches.json"), true), function ($i) use ($subsystem) { return isset($i["members"][0]) && in_array($i["members"][0], $subsystem["members"]); }); sort($arr); $previousID = $arr[in_array($fronters[0], $subsystem["members"]) ? 1 : 0]["members"][0]; $member = null; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true) as $members) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true) as $members) { if ($members["id"] === $previousID) { $member = $members; break; @@ -49,7 +49,8 @@ $fronters = array_map(function ($item) { } ?> - <b>Last fronter: </b><a class="member-link" href="/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> + <b>Last fronter: </b><a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID + , $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> </span> <span> <b>Members:</b> <?= count($subsystem["members"]) ?> diff --git a/includes/subsysedit.php b/includes/subsysedit.inc index e6aa9ca..e9c4b4c 100644 --- a/includes/subsysedit.php +++ b/includes/subsysedit.inc @@ -1,19 +1,19 @@ -<?php global $system; global $systemCommonName; global $systemID; global $subsystem; global $subsystemData; global $subsystemCommonName; global $subsystemID; $title = "Editing " . $subsystemCommonName . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +<?php global $system; global $systemCommonName; global $systemID; global $subsystem; global $subsystemData; global $subsystemCommonName; global $subsystemID; $title = "Editing " . $subsystemCommonName . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> <br> <div class="container"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/subsysbanner.php"; ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/subsysbanner.inc"; ?> <br> <p class="text-muted"> - <span id="editor-save-status">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.html")) : "0" ?></span> bytes + <span id="editor-save-status">Saved</span> · <span id="editor-size"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystemID.html") ? strlen(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.html")) : "0" ?></span> bytes </p> <!--suppress HtmlFormInputWithoutLabel --> <textarea id="page-editor"> - <?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.html") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.html") : "" ?> + <?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystemID.html") ? file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.html") : "" ?> </textarea> <script src="/assets/editor/editor.js"></script> @@ -140,4 +140,4 @@ </script> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/sysbanner.php b/includes/sysbanner.inc index 45c1c16..d3caecd 100644 --- a/includes/sysbanner.php +++ b/includes/sysbanner.inc @@ -7,7 +7,7 @@ global $systemCommonName; global $systemID; global $system; -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json"), true); +$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); ?> @@ -23,15 +23,15 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ $foundHost = false; $hostGoneTravelling = false; - $members = array_filter(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true), $systemID), function ($i) use ($travelling) { + $members = array_filter(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true), $systemID), function ($i) use ($travelling) { global $hostGoneTravelling; if ($travelling[$i['id']]['travelling'] && $i["_metadata"]["host"]) $hostGoneTravelling = true; return true; }); foreach ($members as $member) { - $data = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-$member[id]-metadata.json"), true)); + $data = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); if ($data["host"]): $foundHost = true; ?> - <a class="member-link" href="/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> + <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a> <?php endif; } @@ -42,29 +42,29 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ </span>--> <span> - <?php $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-fronters.json"), true); ?> + <?php $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/fronters.json"), true); ?> <b>Fronter: </b> <?php if (isset($fronters["members"][0])): ?> <?php $member = $fronters["members"][0]; ?> - <a class="member-link" href="/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . resolveMember($member['name']) : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member["name"])) ?></a> + <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member["name"])) ?></a> <?php if (isset($fronters["members"][1])): ?> <?php $member2 = $fronters["members"][1]; ?> <br>(with - <a class="member-link" href="/<?= $member2["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . resolveMember($member2['name']) : "" ?>.png" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a>) - <?php else: ?>-<?php endif; ?> + <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a>) + <?php endif; ?> <?php else: ?>-<?php endif; ?> </span> <span> <b>Last fronter: </b> <?php - $previous = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-switches.json"), true)[1]["members"]; + $previous = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/switches.json"), true)[1]["members"]; if (isset($previous[0])): $previousID = $previous[0]; $member = null; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true) as $members) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true) as $members) { if ($members["id"] === $previousID) { $member = $members; break; @@ -72,31 +72,31 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ } ?> - <a class="member-link" href="/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member["name"])) ?></a> + <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? ($member["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member["name"])) ?></a> <?php if (isset($previous[1])): $previousID = $previous[1]; $member2 = null; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true) as $members) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true) as $members) { if ($members["id"] === $previousID) { $member2 = $members; break; } } ?> <br>(with - <a class="member-link" href="/<?= $member2["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . resolveMember($member2['name']) : "" ?>.png" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a>) - <?php else: ?>-<?php endif; ?> + <a class="member-link" href="/<?= $member2["name"] ?>"><img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member2["display_name"] ?? ($member2["name"] === "fusion" ? "<peh-muted>More than one</peh-muted>" : $member2["name"])) ?></a>) + <?php endif; ?> <?php else: ?>-<?php endif; ?> </span> <span> <?php - $travellers = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "-members.json"), true), function ($i) use ($travelling) { + $travellers = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), function ($i) use ($travelling) { return $travelling[$i['id']]['travelling']; }); ?> - <b>Members: </b><?= count(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true), $systemID)) ?><?php + <b>Members: </b><?= count(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true), $systemID)) ?><?php if (count($travellers) > 0) { echo("<br>+ " . count($travellers) . " traveller" . (count($travellers) > 1 ? "s" : "")); @@ -105,7 +105,7 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ ?> </span> <span> - <b>Last switch: </b><span data-bs-toggle="tooltip" title="<?= date("D j M Y, G:i:s (e)", strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-fronters.json"), true)["timestamp"])) ?>"><?= timeAgo(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-fronters.json"), true)["timestamp"]) ?></span> + <b>Last switch: </b><span data-bs-toggle="tooltip" title="<?= date("D j M Y, G:i:s (e)", strtotime(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/fronters.json"), true)["timestamp"])) ?>"><?= timeAgo(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/fronters.json"), true)["timestamp"]) ?></span> </span> </div> </div> diff --git a/includes/sysedit.php b/includes/sysedit.inc index 0eca518..95a0b5b 100644 --- a/includes/sysedit.php +++ b/includes/sysedit.inc @@ -1,10 +1,10 @@ -<?php global $system; global $systemCommonName; global $systemID; $title = "Editing " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +<?php global $system; global $systemCommonName; global $systemID; $title = "Editing " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> <br> <div class="container"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/sysbanner.php"; ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/sysbanner.inc"; ?> <br> <p class="text-muted"> @@ -140,4 +140,4 @@ </script> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/system.php b/includes/system.inc index 46adeb1..099f522 100644 --- a/includes/system.php +++ b/includes/system.inc @@ -1,19 +1,19 @@ -<?php global $system; global $systemCommonName; global $systemID; $title = $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +<?php global $system; global $systemCommonName; global $systemID; $title = $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> <br> <div class="container"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/sysbanner.php"; ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/sysbanner.inc"; ?> <br> <div id="page-content"> <?php global $isLoggedIn; if ($isLoggedIn): ?> <small style="opacity:.5;display:block;">(<a href="/-/edit/<?= $system ?>">edit</a>)</small> <?php endif; ?> - <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-content.html") ?> + <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/content.html") ?> </div> <?php if ($system === "cloudburst") cloudburst(true); else raindrops(true); ?> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/system/compare.php b/includes/system/compare.inc index 9714488..de777aa 100644 --- a/includes/system/compare.php +++ b/includes/system/compare.inc @@ -1,6 +1,6 @@ -<?php global $system; global $systemCommonName; global $systemID; $title = "Compare members · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; global $travelling; +<?php global $system; global $systemCommonName; global $systemID; $title = "Compare members · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling; -$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true); +$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); function getMember(string $id) { global $systemID; @@ -90,7 +90,7 @@ function getMember(string $id) { ?> <a title="<?= $member["display_name"] ?? $member["name"] ?>" data-bs-toggle="tooltip" class="member-link comparison-item comparison-item-clickable" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <span style="vertical-align: middle;"><span class="comparison-name-full"><?= $member["display_name"] ?? $member["name"] ?></span><span class="comparison-name-small"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></span></span> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <span style="vertical-align: middle;"><span class="comparison-name-full"><?= $member["display_name"] ?? $member["name"] ?></span><span class="comparison-name-small"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></span></span> <span class="comparison-colors" style="background-color: #<?= $member["color"] ?? "ffffff" ?>; height: 16px; width: 16px;display: inline-block;vertical-align: middle;border-radius:2px;"></span> </a> <span class="comparison-item"> @@ -132,16 +132,16 @@ function getMember(string $id) { <?= count($metadata["marefriends"]) + count($metadata["sisters"]) > 0 ? count($metadata["marefriends"]) + count($metadata["sisters"]) : "" ?> </span> <span class="comparison-relations-full"> - <?php $index = 0; foreach ($metadata["marefriends"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) { + <?php $index = 0; foreach ($metadata["marefriends"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) { global $mfMemberID; return $item["id"] === $mfMemberID; - }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Marefriend" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "" ?>.png" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["sisters"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) { + }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Marefriend" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["sisters"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) { global $mfMemberID; return $item["id"] === $mfMemberID; - }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Sister" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "" ?>.png" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["caretakers"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem-members.json"), true), function ($item) { + }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Sister" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?><?php $index = 0; foreach ($metadata["caretakers"] as $marefriend): $mfSystem = explode("/", $marefriend)[0]; $mfMemberID = explode("/", $marefriend)[1]; $mfMember = array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$mfSystem/members.json"), true), function ($item) { global $mfMemberID; return $item["id"] === $mfMemberID; - }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Caretaker" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $mfMember['name'] . ".png") ? "-" . $mfMember['name'] : "" ?>.png" style="width:24px;"></a><?php $index++; endforeach; ?> + }); sort($mfMember); $mfMember = $mfMember[0]; ?><a title="<b><?= $mfMember["display_name"] ?? $mfMember["name"] ?></b><br>Caretaker" data-bs-toggle="tooltip" data-bs-html="true" class="member-link tooltip-nohelp" href="/<?= $mfMember["name"] ?>"><img src="<?= getAsset($mfSystem, $mfMember["id"], "heads") ?>" style="width:24px;"></a><?php $index++; endforeach; ?> </span> </span> <span class="comparison-item"> @@ -186,4 +186,4 @@ function getMember(string $id) { </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/system/history.php b/includes/system/history.inc index a13a3e1..ee687d7 100644 --- a/includes/system/history.php +++ b/includes/system/history.inc @@ -1,9 +1,9 @@ -<?php global $system; global $systemCommonName; global $systemID; $title = "Front history · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +<?php global $system; global $systemCommonName; global $systemID; $title = "Front history · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; function getMember(string $id) { global $systemID; - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true); + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); $member = null; foreach ($members as $m) { @@ -19,9 +19,7 @@ function getMember(string $id) { <div class="container" id="page-content"> <?php - $switches = array_values(array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-switches.json"), true), function ($i) { - return isset($i["members"][0]); - })); + $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/switches.json"), true); uksort($switches, function ($a, $b) { if (isset($b["timestamp"]) && isset($a["timestamp"])) { return strtotime($b["timestamp"]) - strtotime($a["timestamp"]); @@ -102,7 +100,7 @@ function getMember(string $id) { $fronters = array_map(function ($i) { return [ - "member" => $i["members"][0], + "member" => $i["members"][0] ?? null, "member2" => $i["members"][1] ?? null, "date" => strtotime($i["timestamp"]) ]; @@ -114,9 +112,7 @@ function getMember(string $id) { "date" => strtotime(isset($switches2[0]) ? $switches2[0]["timestamp"] : (isset($switches3[0]) ? $switches3[0]["timestamp"] : (isset($switches4[0]) ? $switches4[0]["timestamp"] : (isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))))))) ]; - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); ?> <div class="fronter"> <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 0) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -124,21 +120,30 @@ function getMember(string $id) { </span> <span class="fronter-profile" style="vertical-align: middle;"> <a class="member-link" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?> (with <a class="member-link" href="/<?= $member2["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . $member2['name'] : "" ?>.png" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) + <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) <?php endif; ?> </span> </div> - <?php endforeach; ?> + <?php else: ?> + <div class="fronter"> + <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 0) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + <?= isNotToday($fronter["date"], 0) ? "00:00" : date('H:i', $fronter["date"]) ?> + </span> + <span class="fronter-profile" style="vertical-align: middle;"> + <span class="text-muted">Fallback pony</span> + </span> + </div> + <?php endif; endforeach; ?> <h4 style="margin-top:15px;">Yesterday</h4> <?php $fronters = array_map(function ($i) { return [ - "member" => $i["members"][0], + "member" => $i["members"][0] ?? null, "member2" => $i["members"][1] ?? null, "date" => strtotime($i["timestamp"]) ]; @@ -150,9 +155,7 @@ function getMember(string $id) { "date" => strtotime(isset($switches3[0]) ? $switches3[0]["timestamp"] : (isset($switches4[0]) ? $switches4[0]["timestamp"] : (isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))))))) ]; - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); ?> <div class="fronter"> <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 1) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -160,21 +163,30 @@ function getMember(string $id) { </span> <span class="fronter-profile" style="vertical-align: middle;"> <a class="member-link" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?> (with <a class="member-link" href="/<?= $member2["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . $member2['name'] : "" ?>.png" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) + <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) <?php endif; ?> </span> </div> - <?php endforeach; ?> + <?php else: ?> + <div class="fronter"> + <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 1) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + <?= isNotToday($fronter["date"], 1) ? "00:00" : date('H:i', $fronter["date"]) ?> + </span> + <span class="fronter-profile" style="vertical-align: middle;"> + <span class="text-muted">Fallback pony</span> + </span> + </div> + <?php endif; endforeach; ?> <h4 style="margin-top:15px;"><?= date('D j M', time() - (86400 * 2)) ?></h4> <?php $fronters = array_map(function ($i) { return [ - "member" => $i["members"][0], + "member" => $i["members"][0] ?? null, "member2" => $i["members"][1] ?? null, "date" => strtotime($i["timestamp"]) ]; @@ -186,9 +198,7 @@ function getMember(string $id) { "date" => strtotime(isset($switches4[0]) ? $switches4[0]["timestamp"] : (isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))))) ]; - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); ?> <div class="fronter"> <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 2) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -196,21 +206,30 @@ function getMember(string $id) { </span> <span class="fronter-profile" style="vertical-align: middle;"> <a class="member-link" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?> (with <a class="member-link" href="/<?= $member2["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . $member2['name'] : "" ?>.png" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) + <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) <?php endif; ?> </span> </div> - <?php endforeach; ?> + <?php else: ?> + <div class="fronter"> + <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 2) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + <?= isNotToday($fronter["date"], 2) ? "00:00" : date('H:i', $fronter["date"]) ?> + </span> + <span class="fronter-profile" style="vertical-align: middle;"> + <span class="text-muted">Fallback pony</span> + </span> + </div> + <?php endif; endforeach; ?> <h4 style="margin-top:15px;"><?= date('D j M', time() - (86400 * 3)) ?></h4> <?php $fronters = array_map(function ($i) { return [ - "member" => $i["members"][0], + "member" => $i["members"][0] ?? null, "member2" => $i["members"][1] ?? null, "date" => strtotime($i["timestamp"]) ]; @@ -222,9 +241,7 @@ function getMember(string $id) { "date" => strtotime(isset($switches5[0]) ? $switches5[0]["timestamp"] : (isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))))) ]; - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); ?> <div class="fronter"> <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 3) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -232,21 +249,30 @@ function getMember(string $id) { </span> <span class="fronter-profile" style="vertical-align: middle;"> <a class="member-link" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?> (with <a class="member-link" href="/<?= $member2["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . $member2['name'] : "" ?>.png" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) + <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) <?php endif; ?> </span> </div> - <?php endforeach; ?> + <?php else: ?> + <div class="fronter"> + <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 3) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + <?= isNotToday($fronter["date"], 3) ? "00:00" : date('H:i', $fronter["date"]) ?> + </span> + <span class="fronter-profile" style="vertical-align: middle;"> + <span class="text-muted">Fallback pony</span> + </span> + </div> + <?php endif; endforeach; ?> <h4 style="margin-top:15px;"><?= date('D j M', time() - (86400 * 4)) ?></h4> <?php $fronters = array_map(function ($i) { return [ - "member" => $i["members"][0], + "member" => $i["members"][0] ?? null, "member2" => $i["members"][1] ?? null, "date" => strtotime($i["timestamp"]) ]; @@ -258,9 +284,7 @@ function getMember(string $id) { "date" => strtotime(isset($switches6[0]) ? $switches6[0]["timestamp"] : (isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])))) ]; - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); ?> <div class="fronter"> <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 4) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -268,21 +292,30 @@ function getMember(string $id) { </span> <span class="fronter-profile" style="vertical-align: middle;"> <a class="member-link" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?> (with <a class="member-link" href="/<?= $member2["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . $member2['name'] : "" ?>.png" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) + <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) <?php endif; ?> </span> </div> - <?php endforeach; ?> + <?php else: ?> + <div class="fronter"> + <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 4) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + <?= isNotToday($fronter["date"], 4) ? "00:00" : date('H:i', $fronter["date"]) ?> + </span> + <span class="fronter-profile" style="vertical-align: middle;"> + <span class="text-muted">Fallback pony</span> + </span> + </div> + <?php endif; endforeach; ?> <h4 style="margin-top:15px;"><?= date('D j M', time() - (86400 * 5)) ?></h4> <?php $fronters = array_map(function ($i) { return [ - "member" => $i["members"][0], + "member" => $i["members"][0] ?? null, "member2" => $i["members"][1] ?? null, "date" => strtotime($i["timestamp"]) ]; @@ -294,9 +327,7 @@ function getMember(string $id) { "date" => strtotime(isset($switches7[0]) ? $switches7[0]["timestamp"] : (isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]))) ]; - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); ?> <div class="fronter"> <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 5) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -304,21 +335,30 @@ function getMember(string $id) { </span> <span class="fronter-profile" style="vertical-align: middle;"> <a class="member-link" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?> (with <a class="member-link" href="/<?= $member2["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . $member2['name'] : "" ?>.png" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) + <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) <?php endif; ?> </span> </div> - <?php endforeach; ?> + <?php else: ?> + <div class="fronter"> + <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 5) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + <?= isNotToday($fronter["date"], 5) ? "00:00" : date('H:i', $fronter["date"]) ?> + </span> + <span class="fronter-profile" style="vertical-align: middle;"> + <span class="text-muted">Fallback pony</span> + </span> + </div> + <?php endif; endforeach; ?> <h4 style="margin-top:15px;"><?= date('D j M', time() - (86400 * 6)) ?></h4> <?php $fronters = array_map(function ($i) { return [ - "member" => $i["members"][0], + "member" => $i["members"][0] ?? null, "member2" => $i["members"][1] ?? null, "date" => strtotime($i["timestamp"]) ]; @@ -330,9 +370,7 @@ function getMember(string $id) { "date" => strtotime(isset($switches8[0]) ? $switches8[0]["timestamp"] : (isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"])) ]; - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); ?> <div class="fronter"> <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 6) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -340,21 +378,30 @@ function getMember(string $id) { </span> <span class="fronter-profile" style="vertical-align: middle;"> <a class="member-link" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?> (with <a class="member-link" href="/<?= $member2["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . $member2['name'] : "" ?>.png" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) + <img src="<?= getAsset($systemID, $member2["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) <?php endif; ?> </span> </div> - <?php endforeach; ?> + <?php else: ?> + <div class="fronter"> + <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 6) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + <?= isNotToday($fronter["date"], 6) ? "00:00" : date('H:i', $fronter["date"]) ?> + </span> + <span class="fronter-profile" style="vertical-align: middle;"> + <span class="text-muted">Fallback pony</span> + </span> + </div> + <?php endif; endforeach; ?> <h4 style="margin-top:15px;"><?= date('D j M', time() - (86400 * 7)) ?></h4> <?php $fronters = array_map(function ($i) { return [ - "member" => $i["members"][0], + "member" => $i["members"][0] ?? null, "member2" => $i["members"][1] ?? null, "date" => strtotime($i["timestamp"]) ]; @@ -366,9 +413,7 @@ function getMember(string $id) { "date" => strtotime(isset($switches9[0]) ? $switches9[0]["timestamp"] : $switches10[0]["timestamp"]) ]; - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); ?> <div class="fronter"> <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 7) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -376,21 +421,30 @@ function getMember(string $id) { </span> <span class="fronter-profile" style="vertical-align: middle;"> <a class="member-link" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?> (with <a class="member-link" href="/<?= $member2["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . $member2['name'] : "" ?>.png" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) <?php endif; ?> </span> </div> - <?php endforeach; ?> + <?php else: ?> + <div class="fronter"> + <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 7) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + <?= isNotToday($fronter["date"], 7) ? "00:00" : date('H:i', $fronter["date"]) ?> + </span> + <span class="fronter-profile" style="vertical-align: middle;"> + <span class="text-muted">Fallback pony</span> + </span> + </div> + <?php endif; endforeach; ?> <h4 style="margin-top:15px;"><?= date('D j M', time() - (86400 * 8)) ?></h4> <?php $fronters = array_map(function ($i) { return [ - "member" => $i["members"][0], + "member" => $i["members"][0] ?? null, "member2" => $i["members"][1] ?? null, "date" => strtotime($i["timestamp"]) ]; @@ -399,12 +453,10 @@ function getMember(string $id) { $fronters[] = [ "member" => isset($switches10[0]) ? $switches10[0]["members"][0] : getSwitchBefore($switches9[count($switches9) - 1]["id"])["members"][0], "member2" => isset($switches10[0]) && isset($switches10[0]["members"]) && isset($switches10[0]["members"][1]) ? $switches10[0]["members"][1] : (isset(getSwitchBefore($switches9[count($switches9) - 1]["id"])["members"][1]) ? getSwitchBefore($switches9[count($switches9) - 1]["id"])["members"][1] : null), - "date" => strtotime($switches10[0] ? $switches10[0]["timestamp"] : getSwitchBefore($switches9[count($switches9) - 1]["id"])["timestamp"]) + "date" => strtotime(isset($switches10[0]) ? $switches10[0]["timestamp"] : getSwitchBefore($switches9[count($switches9) - 1]["id"])["timestamp"]) ]; - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); ?> <div class="fronter"> <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 8) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -412,29 +464,36 @@ function getMember(string $id) { </span> <span class="fronter-profile" style="vertical-align: middle;"> <a class="member-link" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?> (with <a class="member-link" href="/<?= $member2["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . $member2['name'] : "" ?>.png" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) <?php endif; ?> </span> </div> - <?php endforeach; ?> + <?php else: ?> + <div class="fronter"> + <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 7) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + <?= isNotToday($fronter["date"], 7) ? "00:00" : date('H:i', $fronter["date"]) ?> + </span> + <span class="fronter-profile" style="vertical-align: middle;"> + <span class="text-muted">Fallback pony</span> + </span> + </div> + <?php endif; endforeach; ?> <h4 style="margin-top:15px;"><?= date('D j M', time() - (86400 * 9)) ?></h4> <?php $fronters = array_map(function ($i) { return [ - "member" => $i["members"][0], + "member" => $i["members"][0] ?? null, "member2" => $i["members"][1] ?? null, "date" => strtotime($i["timestamp"]) ]; }, $switches10); - $fronters = array_unique($fronters, SORT_REGULAR); - - foreach ($fronters as $fronter): $member = getMember($fronter["member"]); + foreach ($fronters as $fronter): if (isset($fronter["member"])): $member = getMember($fronter["member"]); ?> <div class="fronter"> <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 9) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> @@ -442,19 +501,28 @@ function getMember(string $id) { </span> <span class="fronter-profile" style="vertical-align: middle;"> <a class="member-link" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <?php if (isset($fronter["member2"])): $member2 = getMember($fronter["member2"]); ?> (with <a class="member-link" href="/<?= $member2["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member2['name']) . ".png") ? "-" . $member2['name'] : "" ?>.png" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= $member2["display_name"] ?? $member2["name"] ?></a>) <?php endif; ?> </span> </div> - <?php endforeach; ?> + <?php else: ?> + <div class="fronter"> + <span class="fronter-date" data-date-time="<?= isNotToday($fronter["date"], 7) ? strtotime(date('Y-m-d', $fronter["date"])) : $fronter["date"] ?>" style="opacity:.5;font-family: monospace;font-size:14px;vertical-align: middle;"> + <?= isNotToday($fronter["date"], 7) ? "00:00" : date('H:i', $fronter["date"]) ?> + </span> + <span class="fronter-profile" style="vertical-align: middle;"> + <span class="text-muted">Fallback pony</span> + </span> + </div> + <?php endif; endforeach; ?> </div> <script> Array.from(document.getElementsByClassName("fronter-date")).forEach((i) => { i.innerText = new Date(parseInt(i.getAttribute("data-date-time").trim()) * 1000).toTimeString().split(" ")[0].substring(0, 5) + " " }); document.getElementById("timezone").style.display = ""; </script> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/system/species.php b/includes/system/species.inc index a35e811..bd37d7b 100644 --- a/includes/system/species.php +++ b/includes/system/species.inc @@ -1,6 +1,6 @@ -<?php global $system; global $systemCommonName; global $systemID; $title = "Members by species · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; global $travelling; +<?php global $system; global $systemCommonName; global $systemID; $title = "Members by species · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling; -$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true); +$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); $members = scoreOrder($members, $systemID); function species(array $members, string $id, string $name) { global $systemID; ?> @@ -11,9 +11,9 @@ function species(array $members, string $id, string $name) { global $systemID; ? global $travelling; return !$travelling[$i['id']]['travelling']; }), - ...array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "-members.json"), true), function ($i) use ($id, $systemID) { + ...array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true), function ($i) use ($id, $systemID) { global $travelling; - return $travelling[$i['id']]['travelling'] && in_array($id, parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "-" . $i['id'] . "-metadata.json"), true))["species"]); + return $travelling[$i['id']]['travelling'] && in_array($id, parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $i['id'] . ".json"), true))["species"]); }) ]; @@ -26,7 +26,7 @@ function species(array $members, string $id, string $name) { global $systemID; ? <div class="relation-item" style="margin-left:10px;padding:0 20px;"> <?php if (count($members) > 0): ?> <?php $index = 0; foreach ($members as $member): ?> - <a class="member-link" href="/<?= $member["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a><?php if ($index + 2 <= count($members)) echo('<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>'); $index++; endforeach; ?> + <a class="member-link" href="/<?= $member["name"] ?>"><img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <?= getMiniName($member["display_name"] ?? $member["name"]) ?></a><?php if ($index + 2 <= count($members)) echo('<span class="list-separator-desktop">, </span><span class="list-separator-mobile"><br></span>'); $index++; endforeach; ?> <?php else: ?>-<?php endif; ?> </div> </div> @@ -67,4 +67,4 @@ function species(array $members, string $id, string $name) { global $systemID; ? <?php species($crystal, "crystal", "Crystal ponies"); ?> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/system/subsystem.php b/includes/system/subsystem.inc index 372ad08..b7d73f1 100644 --- a/includes/system/subsystem.php +++ b/includes/system/subsystem.inc @@ -2,11 +2,11 @@ if (str_ends_with($_GET['_'], "/subsystem")) header("Location: /?error=Invalid subsystem ID") and die(); -$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true); +$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); $subsystemID = $parts[3]; -$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystems.json"), true) ?? []; +$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID.json"), true) ?? []; function getMember(string $id) { global $systemID; @@ -74,27 +74,27 @@ function getSubsystemByID(string $id) { } if (getSubsystemByID($subsystemID) === null) header("Location: /?error=Invalid subsystem ID") and die(); -$subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.json"), true); +$subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystemID.json"), true); global $subsystem; $subsystem = getSubsystemByID($subsystemID); -$title = $subsystemData["name"] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +$title = $subsystemData["name"] . " · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> <br> <div class="container"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/subsysbanner.php"; ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/subsysbanner.inc"; ?> <br> <div id="page-content"> <?php global $isLoggedIn; if ($isLoggedIn): ?> <small style="opacity:.5;display:block;">(<a href="/-/edit/<?= $system ?>/<?= $subsystemID ?>">edit</a>)</small> <?php endif; ?> - <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystemID.html") ?> + <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystemID.html") ?> </div> <?php showSubsystem(getSubsystemByID($subsystemID), $systemID); ?> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/system/tree.php b/includes/system/tree.inc index 21d146b..c3cc5c4 100644 --- a/includes/system/tree.php +++ b/includes/system/tree.inc @@ -1,9 +1,9 @@ -<?php global $system; global $systemCommonName; global $systemID; $title = "System tree · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +<?php global $system; global $systemCommonName; global $systemID; $title = "System tree · " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; -$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-members.json"), true); +$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true); $members = scoreOrder($members, $systemID); -$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystems.json"), true) ?? []; +$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID.json"), true) ?? []; function getMember(string $id) { global $systemID; @@ -70,7 +70,7 @@ function getMemberSubsystem(array $member) { <div class="tree-l0-separator<?= $first ? " tree-first-separator" : "" ?>"> </div> <div class="tree-inner"> <a class="member-link" href="/<?= $systemID === "gdapd" ? "raindrops" : "cloudburst" ?>/-/subsystem/<?= $subsystem["source"] ?>"> - <img src="/assets/uploads/ss-<?= $subsystem["source"] ?>.png" style="width:24px;border-radius:5px;"> <span style="vertical-align: middle;"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystem[source].json") ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystem[source].json"), true)["name"] : $subsystem["source"] ?></span> + <img src="/assets/uploads/ss-<?= $subsystem["source"] ?>.png" style="width:24px;border-radius:5px;"> <span style="vertical-align: middle;"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json") ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json"), true)["name"] : $subsystem["source"] ?></span> </a> </div> <?php $ssfirst = true; foreach ($subsystem["members"] as $ssm): $ssmember = getMember($ssm); ?> @@ -79,7 +79,7 @@ function getMemberSubsystem(array $member) { <div class="tree-l1-separator<?= $ssfirst ? " tree-first-separator" : "" ?>"> </div> <div class="tree-inner"> <a class="member-link" href="/<?= $ssmember["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $ssmember['name'] . ".png") ? "-" . $ssmember['name'] : "" ?>.png" style="width:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span> + <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="width:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span> </a> </div> </div> @@ -91,7 +91,7 @@ function getMemberSubsystem(array $member) { <div class="tree-l0-separator<?= $first ? " tree-first-separator" : "" ?>"> </div> <div class="tree-inner"> <a class="member-link" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <span style="vertical-align: middle;"><?= $member["display_name"] ?? $member["name"] ?></span> + <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="width:24px;"> <span style="vertical-align: middle;"><?= $member["display_name"] ?? $member["name"] ?></span> </a> </div> <?php if (memberHasSubsystem($member)): ?> @@ -101,7 +101,7 @@ function getMemberSubsystem(array $member) { <div class="tree-l1-separator<?= $ssfirst ? " tree-first-separator" : "" ?>"> </div> <div class="tree-inner"> <a class="member-link" href="/<?= $ssmember["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $ssmember['name'] . ".png") ? "-" . $ssmember['name'] : "" ?>.png" style="width:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span> + <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="width:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span> </a> </div> </div> @@ -111,4 +111,4 @@ function getMemberSubsystem(array $member) { <?php $first = false; endif; endforeach; ?> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/includes/travelling.php b/includes/travelling.inc index b74c826..edcb267 100644 --- a/includes/travelling.php +++ b/includes/travelling.inc @@ -1,9 +1,9 @@ <?php -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json"), true); +$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); -$json_cloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true); -$json_raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true); +$json_cloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true); +$json_raindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true); if (!isset($json_cloudburst)) $json_cloudburst = []; if (!isset($json_raindrops)) $json_raindrops = []; @@ -38,10 +38,10 @@ function withTravelers(array $members, string $system): array { ...array_filter(array_map(function ($i) use ($system) { $i['system'] = $system === "gdapd" ? "ynmuc" : "gdapd"; return $i; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($system === "gdapd" ? "ynmuc" : "gdapd") . "-members.json"), true)), function ($i) use ($travelling) { + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($system === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true)), function ($i) use ($travelling) { return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling']; }) ]; } -file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT)));
\ No newline at end of file +@file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT)));
\ No newline at end of file diff --git a/includes/wakeup.php b/includes/wakeup.inc index 587e705..587e705 100644 --- a/includes/wakeup.php +++ b/includes/wakeup.inc diff --git a/pages/about.inc b/pages/about.inc new file mode 100644 index 0000000..d6b0eeb --- /dev/null +++ b/pages/about.inc @@ -0,0 +1,96 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; +$version = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json"), true); + +$ignore = [ + $_SERVER['DOCUMENT_ROOT'] . "/Data", + $_SERVER['DOCUMENT_ROOT'] . "/bits/Data", + $_SERVER['DOCUMENT_ROOT'] . "/Private/Data", + $_SERVER['DOCUMENT_ROOT'] . "/bits/Private/Data", + $_SERVER['DOCUMENT_ROOT'] . "/includes/data", + $_SERVER['DOCUMENT_ROOT'] . "/includes/tokens", +]; + +function rscandir($dir, $inverseIgnore = false) { + global $ignore; + $files = []; + + foreach (array_filter(scandir($dir), function ($i) { + return !str_starts_with($i, "."); + }) as $file) { + if (!(($inverseIgnore && !in_array($dir . "/" . $file, $ignore)) || (!$inverseIgnore && in_array($dir . "/" . $file, $ignore)))) { + if (is_dir($dir . "/" . $file)) { + array_push($files, ...rscandir($dir . "/" . $file)); + } else { + $files[] = $dir . "/" . $file; + } + } + } + + return array_unique($files); +} + +$sizeSystem = array_reduce(array_map(function ($i) { + return filesize($i); +}, rscandir($_SERVER['DOCUMENT_ROOT'])), function ($a, $b) { + return $a + $b; +}); + +$sizeData = array_reduce(array_map(function ($i) { + return filesize($i); +}, rscandir($_SERVER['DOCUMENT_ROOT'], true)), function ($a, $b) { + return $a + $b; +}); + +function prettySize($bytes) { + if ($bytes > 1024) { + if ($bytes > 1024**2) { + if ($bytes > 1024**3) { + return round($bytes / 1024**3, 1) . " MB"; + } else { + return round($bytes / 1024**2, 1) . " MB"; + } + } else { + return round($bytes / 1024, 1) . " KB"; + } + } else { + return $bytes . " B"; + } +} + +?> + +<br> +<div class="container"> + <div id="page-content"> + <h2>About Cold Haze</h2> + <p> + <b>Cold Haze Engine version 2.<?= $version["build"] ?>.<?= hexdec(substr($version["hash"], 0, 4)) ?>.<?= $version["revision"] ?></b><br> + Version date: <?= date('D j M Y, G:i:s T', $version["timestamp"]) ?><br> + Version ID: <code style="color: white;"><?= $version["hash"] ?></code><br> + Install path: <?= $_SERVER['DOCUMENT_ROOT'] ?><br> + Server software: <?= $_SERVER['SERVER_SOFTWARE'] ?>, via <?= $_SERVER['GATEWAY_INTERFACE'] ?><br> + Transport protocol: <?= $_SERVER['SERVER_PROTOCOL'] ?> + </p> + + <p> + <b>PHP <?= PHP_VERSION ?></b><br> + Zend Engine: <?= zend_version() ?><br> + Server API: <?= php_sapi_name() ?><br> + Memory usage: <?= prettySize(memory_get_peak_usage()) ?><br> + Server OS: <?= php_uname("s") ?> <?= php_uname("r") ?><br> + Server domain name: <?= php_uname("n") ?><br> + Server architecture: <?= php_uname("m") ?> + </p> + + <p> + <b>Disk space usage</b><br> + Engine: <?= prettySize($sizeSystem) ?><br> + Database: <?= prettySize($sizeData) ?> + </p> + </div> +</div> + +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/actions.php b/pages/actions.inc index 939ed7e..527b336 100644 --- a/pages/actions.php +++ b/pages/actions.inc @@ -1,9 +1,9 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; if (isset($_POST['deleteAction'])) { - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json"), true); + $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true); $selected = null; $selectedIndex = -1; @@ -23,15 +23,15 @@ if (isset($_POST['deleteAction'])) { } unset($data[$selectedIndex]); - @mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/oldactions"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/oldactions/" . date('c') . ".json", utf8_encode(json_encode($data))); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json", utf8_encode(json_encode($data))); + @mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions"); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/" . date('Y-m-d_H-i-s') . ".json", utf8_encode(json_encode($data))); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json", utf8_encode(json_encode($data))); header("Location: /-/actions/?d&id=" . $id); die(); } if (isset($_POST['updateAction'])) { - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json"), true); + $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true); $selected = null; $selectedIndex = -1; @@ -97,17 +97,17 @@ if (isset($_POST['updateAction'])) { } $data[$selectedIndex] = $selected; - @mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/oldactions"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/oldactions/" . date('c') . ".json", utf8_encode(json_encode($data))); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json", utf8_encode(json_encode($data))); + @mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions"); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/" . date('Y-m-d_H-i-s') . ".json", utf8_encode(json_encode($data))); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json", utf8_encode(json_encode($data))); header("Location: /-/actions/" . $id); die(); } if (isset($_POST['createAction'])) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.php"; - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json"), true); + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.inc"; + $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true); if (!isset($_POST["name"]) || !isset($_POST["type"])) { header("Location: /-/actions"); @@ -156,17 +156,17 @@ if (isset($_POST['createAction'])) { "consent" => $consent ]; - @mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/oldactions"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/oldactions/" . date('c') . ".json", utf8_encode(json_encode($data))); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json", utf8_encode(json_encode($data))); + @mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions"); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/" . date('Y-m-d_H-i-s') . ".json", utf8_encode(json_encode($data))); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json", utf8_encode(json_encode($data))); header("Location: /-/actions/" . $id); die(); } global $pagename; $parts = explode("/", $pagename); -$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json"), true); -$toys = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json"), true); +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true); +$toys = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true); $selected = null; @@ -188,10 +188,10 @@ if (isset($parts[1])) { } } -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/keywords.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/keywords.inc'; -if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json", "[]"); +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json", "[]"); global $_PROFILE; @@ -300,7 +300,7 @@ global $_PROFILE; </div> <?php endif; ?> - <hr> + <!--<hr> <b>Can be done by:</b> <?php @@ -336,8 +336,8 @@ global $_PROFILE; ?> <li> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member1["name"] ?>.png"> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member2["name"] ?>.png"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($systemID, $member1["id"], "heads") ?>"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($systemID, $member2["id"], "heads") ?>"> <span style="vertical-align: middle;"><?= getMiniName($member1["display_name"] ?? $member1["name"]) ?> and <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?></span> </li> @@ -350,8 +350,8 @@ global $_PROFILE; ?> <li> <span style="opacity:.5;"> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member1["name"] ?>.png"> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member2["name"] ?>.png"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($systemID, $member1["id"], "heads") ?>"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($systemID, $member2["id"], "heads") ?>"> <span style="vertical-align: middle;"><?= getMiniName($member1["display_name"] ?? $member1["name"]) ?> and <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?></span> </span> @@ -370,8 +370,8 @@ global $_PROFILE; ?> <li> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member1["name"] ?>.png"> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member2["name"] ?>.png"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($member1["system"], $member1["id"], "heads") ?>"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($member2["system"], $member2["id"], "heads") ?>"> <span style="vertical-align: middle;"><?= getMiniName($member1["display_name"] ?? $member1["name"]) ?> and <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?></span> </li> @@ -384,8 +384,8 @@ global $_PROFILE; ?> <li> <span style="opacity:.5;"> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member1["name"] ?>.png"> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member2["name"] ?>.png"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($member1["system"], $member1["id"], "heads") ?>"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($member2["system"], $member2["id"], "heads") ?>"> <span style="vertical-align: middle;"><?= getMiniName($member1["display_name"] ?? $member1["name"]) ?> and <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?></span> </span> @@ -404,8 +404,8 @@ global $_PROFILE; ?> <li> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member1["name"] ?>.png"> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member2["name"] ?>.png"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($member1["system"], $member1["id"], "heads") ?>"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($member2["system"], $member2["id"], "heads") ?>"> <span style="vertical-align: middle;"><?= getMiniName($member1["display_name"] ?? $member1["name"]) ?> and <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?></span> </li> @@ -418,8 +418,8 @@ global $_PROFILE; ?> <li> <span style="opacity:.5;"> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member1["name"] ?>.png"> - <img style="vertical-align: middle;width:24px;height:24px;" src="/assets/uploads/pt-<?= $member2["name"] ?>.png"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($member1["system"], $member1["id"], "heads") ?>"> + <img style="vertical-align: middle;width:24px;height:24px;" src="<?= getAsset($member2["system"], $member2["id"], "heads") ?>"> <span style="vertical-align: middle;"><?= getMiniName($member1["display_name"] ?? $member1["name"]) ?> and <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?></span> </span> @@ -427,7 +427,7 @@ global $_PROFILE; </li> <?php endif; endforeach; ?> </ul> - <?php endif; ?> + <?php endif; ?>--> <div style="margin-top:10px;"></div> @@ -502,7 +502,7 @@ global $_PROFILE; <div class="card-body"> <h4 class="card-title"><?= $item["name"] ?></h4> <p class="card-text"> - <?php + <!--<?php $uniquePonies = []; @@ -518,14 +518,15 @@ global $_PROFILE; foreach ($uniquePonies as $name => $deprecated): if (!$deprecated): ?> <span data-bs-toggle="tooltip" title="<?= getMemberWithoutSystem($name)["display_name"] ?? getMemberWithoutSystem($name)["display_name"] ?>" style="display: inline-block;"> - <img src="/assets/uploads/pt-<?= getMemberWithoutSystem($name)["name"] ?>.png" style="width:32px;"> + <img src="<?= getAsset(getMemberWithoutSystem($name)["system"], getMemberWithoutSystem($name)["id"], "heads") ?>" style="width:32px;"> </span> <?php endif; endforeach; ?> <?php foreach ($uniquePonies as $name => $deprecated): if ($deprecated): ?> <span data-bs-toggle="tooltip" data-bs-html="true" title="<i><?= strip_tags(getMemberWithoutSystem($name)["display_name"] ?? getMemberWithoutSystem($name)["name"]) ?></i>" style="opacity:.5;display: inline-block;"> - <img src="/assets/uploads/pt-<?= getMemberWithoutSystem($name)["name"] ?>.png" style="width:32px;"> + <img src="<?= getAsset(getMemberWithoutSystem($name)["system"], getMemberWithoutSystem($name)["id"], "heads") ?>" style="width:32px;"> </span> - <?php endif; endforeach; ?> + <?php endif; endforeach; ?>--> + - </p> <?php if ($item["type"] === "affectionate"): ?> <span style="" class="badge rounded-pill bg-primary">Affectionate</span> @@ -584,6 +585,7 @@ global $_PROFILE; <input type="text" placeholder="Action example" name="example" class="form-control" style="color:white;background:#111;border-color:#222;margin-bottom:10px;" value="<?= str_replace('"', '"', $selected["example"] ?? "") ?>"> <input type="text" placeholder="IRL steps" name="irl" class="form-control" style="color:white;background:#111;border-color:#222;" value="<?= str_replace('"', '"', $selected["irl"] ?? "") ?>"> + <div style="display: none;"> <hr> <p>Select the groups of ponies who can do this action:</p> @@ -677,6 +679,7 @@ global $_PROFILE; </label> </label> <?php endforeach; ?> + </div> <br> <input type="hidden" name="updateAction"> @@ -706,7 +709,7 @@ global $_PROFILE; return (isset($i["description"]) && trim($i["description"]) === "") || !isset($i["description"]); })) ?> incomplete)</p> - <p>TODO: add ponies for all actions (+ keywords)</p> + <p>TODO: fill everything and add keywords</p> <input type="text" placeholder="Search for an action..." class="form-control" style="margin-bottom:15px;color:white;background:#111;border-color:#222;" onchange="search();" onkeydown="search();" onkeyup="search();" id="search"> @@ -722,33 +725,15 @@ global $_PROFILE; ksort($init); $sorted = array_values($init); - uasort($sorted, function ($a, $b) { - $uniquePonies1 = []; - - foreach ($a["ponies"] as $ponies) { - foreach ($ponies["members"] as $member) { - $uniquePonies1[$member] = true; - } - } - - $uniquePonies2 = []; - - foreach ($b["ponies"] as $ponies) { - foreach ($ponies["members"] as $member) { - $uniquePonies2[$member] = true; - } - } - - return count($uniquePonies2) - count($uniquePonies1); - }); foreach ($sorted as $item): ?> - <a href="/-/actions/<?= $item["id"] ?>" id="action-<?= $item["id"] ?>" style="display:grid;grid-template-columns: 1fr 1fr 0.2fr;" class="list-group-item list-group-item-action action-listing"> + <a href="/-/actions/<?= $item["id"] ?>" id="action-<?= $item["id"] ?>" style="display:grid;grid-template-columns: 1fr 0.2fr;" class="list-group-item list-group-item-action action-listing"> <div> <span class="<?= trim($item["description"]) === "" ? "text-danger" : "" ?>"><?= $item["name"] ?></span> <?php if (!isset($item["verified"])): ?><span class="badge bg-warning rounded-pill text-black">Unverified</span><?php endif; ?> <?php if (isset($item["untested"])): ?><span class="badge bg-info rounded-pill">Untested</span><?php endif; ?> </div> + <!-- <div> <?php @@ -771,7 +756,6 @@ global $_PROFILE; $index = 1; foreach ($uniquePonies as $name => $deprecated): if (!$deprecated): ?> - <!-- <?= $index ?> --> <span title="<?= getMemberWithoutSystem($name)["display_name"] ?? getMemberWithoutSystem($name)["display_name"] ?>" style="display: inline-block;<?= $longPonyList && $index % 2 === 0 ? "position:absolute;margin-left:-12px;z-index:" . (999 - $index) . ";" : "position:relative;z-index:" . (999 - $index) . ";" ?>"> <img src="/assets/uploads/pt-<?= getMemberWithoutSystem($name)["name"] ?>.png" style="width:24px;"> </span> @@ -782,6 +766,7 @@ global $_PROFILE; </span> <?php $index++; endif; endforeach; ?> </div> + --> <div style="text-align: right;"> <?php if ($item["type"] === "affectionate"): ?> <span style="" class="badge rounded-pill bg-primary">Affectionate</span> @@ -806,7 +791,7 @@ global $_PROFILE; </div> <script> - window.actions = JSON.parse(atob(`<?= base64_encode(json_encode(array_values(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json"), true)))) ?>`)); + window.actions = JSON.parse(atob(`<?= base64_encode(json_encode(array_values(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true)))) ?>`)); </script> <div class="modal fade" id="creator"> @@ -840,6 +825,7 @@ global $_PROFILE; Requires consent </label> + <div style="display: none;"> <hr> <p>Select the groups of ponies who can do this action:</p> @@ -912,7 +898,7 @@ global $_PROFILE; "caretaking" => "Caretaker" } ?></span> </label> - <?php endforeach; ?> + <?php endforeach; ?></div> <p style="margin-top:10px;">You can add additional data (description, example, how to do the action IRL) after creating the action.</p> <input type="hidden" name="createAction"> @@ -1127,4 +1113,4 @@ global $_PROFILE; } </style> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/alphabet.php b/pages/alphabet.inc index b59772d..167ba92 100644 --- a/pages/alphabet.php +++ b/pages/alphabet.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -12,20 +12,20 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; <?php $members = scoreOrderGlobal(); ?> <div> - <?php foreach (str_split("abcdefgihjklmnopqrstuvwxyz") as $letter): ?> + <?php foreach (str_split("abcdefghijklmnopqrstuvwxyz") as $letter): ?> <div style="display:inline-grid;grid-template-columns: max-content 1fr;min-height:32px;"> <div style="display:flex;align-items:center;justify-content:center;font-weight: bold;margin-right:10px;" class="font-monospace"><?= $letter ?>.</div> <div> - <?php foreach ($members as $member): if (isset($member["proxy_tags"][0]) && isset($member["proxy_tags"][0]["prefix"]) && str_starts_with(strtolower($member["proxy_tags"][0]["prefix"]), strtolower($letter)) && strlen($member["proxy_tags"][0]["prefix"]) === 2): ?><a href="/<?= $member["name"] ?>" title="<b><?= $member["display_name"] ?></b> (<code class='text-white'><?= $member["proxy_tags"][0]["prefix"] ?></code>)" data-bs-toggle="tooltip" data-bs-html="true"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"></a><?php endif; endforeach; ?> + <?php foreach ($members as $member): if (isset($member["proxy_tags"][0]) && isset($member["proxy_tags"][0]["prefix"]) && str_starts_with(strtolower($member["proxy_tags"][0]["prefix"]), strtolower($letter)) && strlen($member["proxy_tags"][0]["prefix"]) === 2): ?><a href="/<?= $member["name"] ?>" title="<b><?= $member["display_name"] ?></b> (<code class='text-white'><?= $member["proxy_tags"][0]["prefix"] ?></code>)" data-bs-toggle="tooltip" data-bs-html="true"><img src="<?= getAsset($member['system'], $member["id"], "heads") ?>" style="width:24px;"></a><?php endif; endforeach; ?> </div> </div> - <?php foreach (str_split("abcdefgihjklmnopqrstuvwxyz") as $letter2): $list = array_filter($members, function ($member) use ($letter, $letter2) { + <?php foreach (str_split("abcdefghijklmnopqrstuvwxyz") as $letter2): $list = array_filter($members, function ($member) use ($letter, $letter2) { return isset($member["proxy_tags"][0]) && isset($member["proxy_tags"][0]["prefix"]) && str_starts_with(strtolower($member["proxy_tags"][0]["prefix"]), strtolower($letter . $letter2)) && strlen($member["proxy_tags"][0]["prefix"]) === 3; }); if (count($list) > 0): ?> (<div style="display:inline-grid;grid-template-columns: max-content 1fr;min-height:32px;"> <div style="display:flex;align-items:center;justify-content:center;" class="font-monospace"><?= $letter . $letter2 ?>.</div> <div> - <?php foreach ($list as $member): ?><a href="/<?= $member["name"] ?>" title="<b><?= $member["display_name"] ?></b> (<code class='text-white'><?= $member["proxy_tags"][0]["prefix"] ?></code>)" data-bs-toggle="tooltip" data-bs-html="true"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"></a><?php endforeach; ?> + <?php foreach ($list as $member): ?><a href="/<?= $member["name"] ?>" title="<b><?= $member["display_name"] ?></b> (<code class='text-white'><?= $member["proxy_tags"][0]["prefix"] ?></code>)" data-bs-toggle="tooltip" data-bs-html="true"><img src="<?= getAsset($member['system'], $member["id"], "heads") ?>" style="width:24px;"></a><?php endforeach; ?> </div> </div>) <?php endif; endforeach; ?> @@ -35,4 +35,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/api.php b/pages/api.inc index 1d83985..1d83985 100644 --- a/pages/api.php +++ b/pages/api.inc diff --git a/pages/app.php b/pages/app.inc index ceed71e..ceed71e 100644 --- a/pages/app.php +++ b/pages/app.inc diff --git a/pages/bitset.php b/pages/bitset.inc index 0d2d10e..b608c73 100644 --- a/pages/bitset.php +++ b/pages/bitset.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -406,4 +406,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; </p> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/byfront.php b/pages/byfront.inc index eb9050c..280d981 100644 --- a/pages/byfront.php +++ b/pages/byfront.inc @@ -1,8 +1,8 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json"), true); +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; +$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); ?> @@ -19,12 +19,12 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ $fronters = array_map(function ($item) { return $item["id"]; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true)["members"]); + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]); if (in_array($id, $fronters)) { $i["_lastFronted"] = time(); } else { - $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-switches.json"), true); + $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true); $thisMember = array_filter($switches, function ($item) use ($memberData) { return in_array($memberData["id"], $item["members"]); @@ -53,7 +53,7 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ }); foreach ($members as $member): ?> <div class="relation" style="background-color:rgba(255, 255, 255, .1);margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;"> <a class="relation-intro" style="background-color:rgba(255, 255, 255, .05);border-right:1px solid rgba(255, 255, 255, .1);margin:-10px;padding:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;color: white;display:flex;align-items:center;text-decoration: none;" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($member['system'], $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> <?php if ($member["_metadata"]["shared_memory"] !== 2): ?> <span class="badge text-black bg-warning rounded-pill">Not sharing memory</span> <?php endif; ?> @@ -78,12 +78,12 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ $fronters = array_map(function ($item) { return $item["id"]; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-fronters.json"), true)["members"]); + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/fronters.json"), true)["members"]); if (in_array($id, $fronters)) { $i["_lastFronted"] = time(); } else { - $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-switches.json"), true); + $switches = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/switches.json"), true); $thisMember = array_filter($switches, function ($item) use ($memberData) { return in_array($memberData["id"], $item["members"]); @@ -112,7 +112,7 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ }); foreach ($members as $member): ?> <div class="relation" style="background-color:rgba(255, 255, 255, .1);margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;"> <a class="relation-intro" style="background-color:rgba(255, 255, 255, .05);border-right:1px solid rgba(255, 255, 255, .1);margin:-10px;padding:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;color: white;display:flex;align-items:center;text-decoration: none;" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($member['system'], $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> <?php if ($member["_metadata"]["shared_memory"] !== 2): ?> <span class="badge text-black bg-warning rounded-pill">Not sharing memory</span> <?php endif; ?> @@ -157,4 +157,4 @@ $travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includ </style> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/dashboard.inc b/pages/dashboard.inc new file mode 100644 index 0000000..59396e5 --- /dev/null +++ b/pages/dashboard.inc @@ -0,0 +1,231 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $pages; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $_PROFILE; +use om\IcalParser; + +$poniesHavingSex = []; + +$actions = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true); + +foreach ($actions as $action) { + if ($action["type"] !== "sexual") continue; + + foreach ($action["ponies"] as $ponies) { + $id = implode("", $ponies["members"]); + + $member = getMemberWithoutSystem($ponies["members"][0]); + $otherMember = getMemberWithoutSystem($ponies["members"][1]); + + $parts = [ + $member["id"], + $otherMember["id"] + ]; + + asort($parts); + $poniesHavingSex[] = $parts[0]; + $poniesHavingSex[] = $parts[1]; + } +} + +$fronter = array_map(function ($i) { + return $i["id"]; +}, ($_PROFILE["login"] === "raindrops" ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true) : json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/fronters.json"), true))["members"])[0] ?? null; + +$viewingPonyHasSex = in_array($fronter, $poniesHavingSex) || isset($_GET['toys']); + +?> + +<br> +<div class="container"> + <div id="page-content"> + <h3 id="date" style="text-align: center;margin-bottom:20px;">Date</h3> + <script> + function _Date() { + let d = new Date(); + let m = d.getMonth(); + let w = d.getDay(); + + switch (m) { + case 0: m = "Jan"; break; + case 1: m = "Feb"; break; + case 2: m = "Mar"; break; + case 3: m = "Apr"; break; + case 4: m = "May"; break; + case 5: m = "Jun"; break; + case 6: m = "Jul"; break; + case 7: m = "Aug"; break; + case 8: m = "Sep"; break; + case 9: m = "Oct"; break; + case 10: m = "Nov"; break; + case 11: m = "Dec"; break; + } + + switch (w) { + case 0: w = "Sun"; break; + case 1: w = "Mon"; break; + case 2: w = "Tue"; break; + case 3: w = "Wed"; break; + case 4: w = "Thu"; break; + case 5: w = "Fri"; break; + case 6: w = "Sat"; break; + } + + function fixed(number) { + if (number < 10) { + return "0" + number; + } else { + return number.toString(); + } + } + + document.getElementById("date").innerText = `${w} ${d.getDate()} ${m} ${d.getHours()}:${fixed(d.getMinutes())}`; + } + + setInterval(_Date); + </script> + + <hr> + <h4>Next fronters <span class="small"><a href="/-/fronting">(edit)</a></span></h4> + <?php + + $scheduleCloudburstToday = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/ynmuc.json"), true)[date('Y-m-d')] ?? []; + $scheduleRaindropsToday = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/gdapd.json"), true)[date('Y-m-d')] ?? []; + + $scheduleCloudburstTomorrow = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/ynmuc.json"), true)[date('Y-m-d', time() + 86400)] ?? []; + $scheduleRaindropsTomorrow = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/gdapd.json"), true)[date('Y-m-d', time() + 86400)] ?? []; + + $scheduleCloudburstNextday = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/ynmuc.json"), true)[date('Y-m-d', time() + 172800)] ?? []; + $scheduleRaindropsNextday = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/planner/gdapd.json"), true)[date('Y-m-d', time() + 172800)] ?? []; + + $today1 = $_PROFILE["login"] === "raindrops" ? $scheduleRaindropsToday : $scheduleCloudburstToday; + $today2 = $_PROFILE["login"] === "raindrops" ? $scheduleCloudburstToday : $scheduleRaindropsToday; + $tomorrow1 = $_PROFILE["login"] === "raindrops" ? $scheduleRaindropsTomorrow : $scheduleCloudburstTomorrow; + $tomorrow2 = $_PROFILE["login"] === "raindrops" ? $scheduleCloudburstTomorrow : $scheduleRaindropsTomorrow; + $nextday1 = $_PROFILE["login"] === "raindrops" ? $scheduleRaindropsNextday : $scheduleCloudburstNextday; + $nextday2 = $_PROFILE["login"] === "raindrops" ? $scheduleCloudburstNextday : $scheduleRaindropsNextday; + + ?> + + <h5>Fronters today</h5> + <ul> + <?php foreach ($today1 as $index => $id): $member = getMemberWithoutSystem($id[0]); ?> + <li> + <?php if ($member["name"] === "fusion"): ?> + <img alt="" src="/assets/logo/logo.png" style="width:24px; height: 24px; vertical-align: middle;"> <span style="vertical-align: middle;">Merged members</span> + <?php else: ?> + <img alt="" src="<?= getAsset($member['system'], $member["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <b style="vertical-align: middle;"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></b> + <?php endif; ?> + <?php if (isset($id[1])): $member2 = getMemberWithoutSystem($id[1]); ?> + <b style="vertical-align: middle;">and <img alt="" src="<?= getAsset($member['system'], $member2["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?></b> + <?php endif; ?> + <?php if (isset($today2[$index])): $member2 = getSystemMember($_PROFILE["login"] === "raindrops" ? "ynmuc" : "gdapd", $today2[$index][0]); ?><span style="vertical-align: middle;">with</span> <img alt="" src="<?= getAsset($member2['system'], $member2["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <span style="vertical-align: middle;"><?= getMiniName($member2["display_name"] ?? $member2["name"]) ?><?php if (isset($today2[$index][1])): $member2 = getSystemMember($_PROFILE["login"] === "raindrops" ? "ynmuc" : "gdapd", $today2[$index][1]); ?> + and <img alt="" src="<?= getAsset($member['system'], $member2["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?> + <?php endif; ?></span><?php endif; ?> + </li> + <?php endforeach; ?> + </ul> + + <h5>Fronters tomorrow</h5> + <ul> + <?php foreach ($tomorrow1 as $index => $id): $member = getSystemMember($_PROFILE["login"] === "raindrops" ? "gdapd" : "ynmuc", $id[0]); ?> + <li> + <?php if ($member["name"] === "fusion"): ?> + <img alt="" src="/assets/logo/logo.png" style="width:24px; height: 24px; vertical-align: middle;"> <span style="vertical-align: middle;">Merged members</span> + <?php else: ?> + <img alt="" src="<?= getAsset($member['system'], $member["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <b style="vertical-align: middle;"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></b> + <?php endif; ?> + <?php if (isset($id[1])): $member2 = getMemberWithoutSystem($id[1]); ?> + <b style="vertical-align: middle;">and <img alt="" src="<?= getAsset($member['system'], $member2["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?></b> + <?php endif; ?> + <?php if (isset($tomorrow2[$index])): $member2 = getSystemMember($_PROFILE["login"] === "raindrops" ? "ynmuc" : "gdapd", $tomorrow2[$index][0]); ?><span style="vertical-align: middle;">with</span> <img alt="" src="<?= getAsset($member2['system'], $member2["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <span style="vertical-align: middle;"><?= getMiniName($member2["display_name"] ?? $member2["name"]) ?><?php if (isset($tomorrow2[$index][1])): $member2 = getSystemMember($_PROFILE["login"] === "raindrops" ? "ynmuc" : "gdapd", $tomorrow2[$index][1]); ?> + and <img alt="" src="<?= getAsset($member['system'], $member2["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?> + <?php endif; ?></span><?php endif; ?> + </li> + <?php endforeach; ?> + </ul> + + <h5>Fronters on <?= date('l', time() + 172800) ?></h5> + <ul> + <?php foreach ($nextday1 as $index => $id): $member = getSystemMember($_PROFILE["login"] === "raindrops" ? "gdapd" : "ynmuc", $id[0]); ?> + <li> + <?php if ($member["name"] === "fusion"): ?> + <img alt="" src="/assets/logo/logo.png" style="width:24px; height: 24px; vertical-align: middle;"> <span style="vertical-align: middle;">Merged members</span> + <?php else: ?> + <img alt="" src="<?= getAsset($member['system'], $member["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <b style="vertical-align: middle;"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></b> + <?php endif; ?> + <?php if (isset($id[1])): $member2 = getMemberWithoutSystem($id[1]); ?> + <b style="vertical-align: middle;">and <img alt="" src="<?= getAsset($member['system'], $member2["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?></b> + <?php endif; ?> + <?php if (isset($nextday2[$index])): $member2 = getSystemMember($_PROFILE["login"] === "raindrops" ? "ynmuc" : "gdapd", $nextday2[$index][0]); ?><span style="vertical-align: middle;">with</span> <img alt="" src="<?= getAsset($member2['system'], $member2["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <span style="vertical-align: middle;"><?= getMiniName($member2["display_name"] ?? $member2["name"]) ?><?php if (isset($nextday2[$index][1])): $member2 = getSystemMember($_PROFILE["login"] === "raindrops" ? "ynmuc" : "gdapd", $nextday2[$index][1]); ?> + and <img alt="" src="<?= getAsset($member['system'], $member2["id"], "heads") ?>" style="width:24px; height: 24px; vertical-align: middle;"> <?= getMiniName($member2["display_name"] ?? $member2["name"]) ?> + <?php endif; ?></span><?php endif; ?> + </li> + <?php endforeach; ?> + </ul> + + <hr> + <h4>Next events</h4> + <?php + + $cal = new IcalParser(); + $results = $cal->parseFile($_SERVER['DOCUMENT_ROOT'] . "/includes/data/calendar/calendar.ics"); + $events = []; + + foreach ($cal->getEvents()->sorted() as $event) { + $events[] = [ + "id" => $event['UID'], + "date" => [ + "created" => $event['CREATED']->format('c'), + "modified" => $event['LAST-MODIFIED']->format('c'), + "start" => $event['DTSTART']->format('c'), + "end" => $event['DTEND']->format('c'), + "duration" => strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')), + "full_day" => strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')) >= 86400, + "days" => ( + strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')) >= 86400 ? + round((strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c'))) / 86400) : + null + ) + ], + "name" => $event['SUMMARY'], + "description" => $event['DESCRIPTION'] ?? "", + ]; + } + + $events = array_values(array_filter($events, function ($i) { + return ( + strtotime($i["date"]["end"]) > time() && + strtotime($i["date"]["start"]) < time() + 2629800 + ); + })); + + ?> + <ul> + <?php foreach ($events as $event): ?> + <li> + <?php if ($event["date"]["full_day"]): ?> + <b> + <?php if (strtotime($event["date"]["start"]) < time()): ?> + Started <?= timeAgo($event["date"]["start"]) ?>, ends <?= timeIn($event["date"]["end"]) ?> + <?php else: ?> + <?= ucfirst(relativeDate($event["date"]["start"], false)) ?> + <?php endif; ?> + · + </b> + <?php else: ?> + <b> + <?= ucfirst(relativeDate($event["date"]["start"])) ?> + · + </b> + <?php endif; ?> + for <?= duration($event["date"]["duration"]) ?> + · + <?= $event["name"] ?> + </li> + <?php endforeach; ?> + </ul> + </div> +</div> + +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/dashboard.php b/pages/dashboard.php deleted file mode 100644 index a861636..0000000 --- a/pages/dashboard.php +++ /dev/null @@ -1,321 +0,0 @@ -<?php - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; global $pages; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; global $_PROFILE; -use om\IcalParser; - -$poniesHavingSex = []; - -$actions = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json"), true); - -foreach ($actions as $action) { - if ($action["type"] !== "sexual") continue; - - foreach ($action["ponies"] as $ponies) { - $id = implode("", $ponies["members"]); - - $member = getMemberWithoutSystem($ponies["members"][0]); - $otherMember = getMemberWithoutSystem($ponies["members"][1]); - - $parts = [ - $member["id"], - $otherMember["id"] - ]; - - asort($parts); - $poniesHavingSex[] = $parts[0]; - $poniesHavingSex[] = $parts[1]; - } -} - -$fronter = array_map(function ($i) { - return $i["id"]; -}, ($_PROFILE["login"] === "raindrops" ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-fronters.json"), true) : json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-fronters.json"), true))["members"])[0] ?? null; - -$viewingPonyHasSex = in_array($fronter, $poniesHavingSex) || isset($_GET['toys']); - -?> - -<br> -<div class="container"> - <div id="page-content"> - <h3 id="date" style="text-align: center;margin-bottom:20px;">Date</h3> - <script> - function _Date() { - let d = new Date(); - let m = d.getMonth(); - let w = d.getDay(); - - switch (m) { - case 0: m = "Jan"; break; - case 1: m = "Feb"; break; - case 2: m = "Mar"; break; - case 3: m = "Apr"; break; - case 4: m = "May"; break; - case 5: m = "Jun"; break; - case 6: m = "Jul"; break; - case 7: m = "Aug"; break; - case 8: m = "Sep"; break; - case 9: m = "Oct"; break; - case 10: m = "Nov"; break; - case 11: m = "Dec"; break; - } - - switch (w) { - case 0: w = "Sun"; break; - case 1: w = "Mon"; break; - case 2: w = "Tue"; break; - case 3: w = "Wed"; break; - case 4: w = "Thu"; break; - case 5: w = "Fri"; break; - case 6: w = "Sat"; break; - } - - function fixed(number) { - if (number < 10) { - return "0" + number; - } else { - return number.toString(); - } - } - - document.getElementById("date").innerText = `${w} ${d.getDate()} ${m} ${d.getHours()}:${fixed(d.getMinutes())}`; - } - - setInterval(_Date); - </script> - - <div class="peh-row" style="<?php if (!$viewingPonyHasSex): ?>grid-template-columns: repeat(8, 1fr) !important;<?php endif; ?>"> - <div class="column"> - <div class="card" title="<?= $pages["actions"]["name"] ?>" data-bs-toggle="tooltip"> - <a href="/-/actions" class="card-body" style="text-align:center;color: white !important; text-decoration: none !important;"> - <img src="/assets/icons/actions.svg" style="width:32px;height:32px;filter:invert(1);"><br> - <h6 class="app-name"><?= $pages["actions"]["short"] ?></h6> - </a> - </div> - </div> - <div class="column"> - <div class="card" title="<?= $pages["rules"]["name"] ?>" data-bs-toggle="tooltip"> - <a href="/-/rules" class="card-body" style="text-align:center;color: white !important; text-decoration: none !important;"> - <img src="/assets/icons/rules.svg" style="width:32px;height:32px;filter:invert(1);"><br> - <h6 class="app-name"><?= $pages["rules"]["short"] ?></h6> - </a> - </div> - </div> - <div class="column"> - <div class="card" title="<?= $pages["docs"]["name"] ?>" data-bs-toggle="tooltip"> - <a href="/-/docs" class="card-body" style="text-align:center;color: white !important; text-decoration: none !important;"> - <img src="/assets/icons/docs.svg" style="width:32px;height:32px;filter:invert(1);"><br> - <h6 class="app-name"><?= $pages["docs"]["short"] ?></h6> - </a> - </div> - </div> - <div class="column"> - <div class="card" title="<?= $pages["nicknames"]["name"] ?>" data-bs-toggle="tooltip"> - <a href="/-/nicknames" class="card-body" style="text-align:center;color: white !important; text-decoration: none !important;"> - <img src="/assets/icons/nicknames.svg" style="width:32px;height:32px;filter:invert(1);"><br> - <h6 class="app-name"><?= $pages["nicknames"]["short"] ?></h6> - </a> - </div> - </div> - <div class="column"> - <div class="card" title="<?= $pages["together"]["name"] ?>" data-bs-toggle="tooltip"> - <a href="/-/together" class="card-body" style="text-align:center;color: white !important; text-decoration: none !important;"> - <img src="/assets/icons/together.svg" style="width:32px;height:32px;filter:invert(1);"><br> - <h6 class="app-name"><?= $pages["together"]["short"] ?></h6> - </a> - </div> - </div> - <div class="column"> - <div class="card" title="<?= $pages["splitting"]["name"] ?>" data-bs-toggle="tooltip"> - <a href="/-/splitting" class="card-body" style="text-align:center;color: white !important; text-decoration: none !important;"> - <img src="/assets/icons/form.svg" style="width:32px;height:32px;filter:invert(1);"><br> - <h6 class="app-name"><?= $pages["splitting"]["short"] ?></h6> - </a> - </div> - </div> - <div class="column"> - <div class="card" title="<?= $pages["byfront"]["name"] ?>" data-bs-toggle="tooltip"> - <a href="/-/byfront" class="card-body" style="text-align:center;color: white !important; text-decoration: none !important;"> - <img src="/assets/icons/byfront.svg" style="width:32px;height:32px;filter:invert(1);"><br> - <h6 class="app-name"><?= $pages["byfront"]["short"] ?></h6> - </a> - </div> - </div> - <div class="column"> - <div class="card" title="<?= $pages["bitset"]["name"] ?>" data-bs-toggle="tooltip"> - <a href="/-/bitset" class="card-body" style="text-align:center;color: white !important; text-decoration: none !important;"> - <img src="/assets/icons/bitset.svg" style="width:32px;height:32px;filter:invert(1);"><br> - <h6 class="app-name"><?= $pages["bitset"]["short"] ?></h6> - </a> - </div> - </div> - <?php if ($viewingPonyHasSex): ?> - <div class="column"> - <div class="card" title="<?= $pages["toys"]["name"] ?>" data-bs-toggle="tooltip"> - <a href="/-/toys" class="card-body" style="text-align:center;color: white !important; text-decoration: none !important;"> - <img src="/assets/icons/toys.svg" style="width:32px;height:32px;filter:invert(1);"><br> - <h6 class="app-name"><?= $pages["toys"]["short"] ?></h6> - </a> - </div> - </div> - <?php endif; ?> - </div> - - <hr> - <h4>Next fronters <span class="small"><a href="/-/fronting">(edit)</a></span></h4> - <?php - - $scheduleCloudburstToday = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-planner.json"), true)[date('Y-m-d')] ?? []; - $scheduleRaindropsToday = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-planner.json"), true)[date('Y-m-d')] ?? []; - - $scheduleCloudburstTomorrow = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-planner.json"), true)[date('Y-m-d', time() + 86400)] ?? []; - $scheduleRaindropsTomorrow = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-planner.json"), true)[date('Y-m-d', time() + 86400)] ?? []; - - $today1 = $_PROFILE["login"] === "raindrops" ? $scheduleRaindropsToday : $scheduleCloudburstToday; - $today2 = $_PROFILE["login"] === "raindrops" ? $scheduleCloudburstToday : $scheduleRaindropsToday; - $tomorrow1 = $_PROFILE["login"] === "raindrops" ? $scheduleRaindropsTomorrow : $scheduleCloudburstTomorrow; - $tomorrow2 = $_PROFILE["login"] === "raindrops" ? $scheduleCloudburstTomorrow : $scheduleRaindropsTomorrow; - - ?> - - <h5>Fronters today</h5> - <ul> - <?php foreach ($today1 as $index => $id): $member = getMemberWithoutSystem($id); ?> - <li> - <?php if ($member["name"] === "fusion"): ?> - <img alt="" src="/assets/logo/logo.png" style="width:24px; height: 24px; vertical-align: middle;"> <span style="vertical-align: middle;">Merged members</span> - <?php else: ?> - <img alt="" src="/assets/uploads/pt-<?= $member["name"] ?>.png" style="width:24px; height: 24px; vertical-align: middle;"> <b style="vertical-align: middle;"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></b> - <?php endif; ?> - <?php if (isset($today2[$index])): $member2 = getSystemMember($_PROFILE["login"] === "raindrops" ? "ynmuc" : "gdapd", $today2[$index]); ?><span style="vertical-align: middle;">with</span> <img alt="" src="/assets/uploads/pt-<?= $member2["name"] ?>.png" style="width:24px; height: 24px; vertical-align: middle;"> <span style="vertical-align: middle;"><?= getMiniName($member2["display_name"] ?? $member2["name"]) ?></span><?php endif; ?> - </li> - <?php endforeach; ?> - </ul> - - <h5>Fronters tomorrow</h5> - <ul> - <?php foreach ($tomorrow1 as $index => $id): $member = getSystemMember($_PROFILE["login"] === "raindrops" ? "gdapd" : "ynmuc", $id); ?> - <li> - <?php if ($member["name"] === "fusion"): ?> - <img alt="" src="/assets/logo/logo.png" style="width:24px; height: 24px; vertical-align: middle;"> <span style="vertical-align: middle;">Merged members</span> - <?php else: ?> - <img alt="" src="/assets/uploads/pt-<?= $member["name"] ?>.png" style="width:24px; height: 24px; vertical-align: middle;"> <b style="vertical-align: middle;"><?= getMiniName($member["display_name"] ?? $member["name"]) ?></b> - <?php endif; ?> - <?php if (isset($tomorrow2[$index])): $member2 = getSystemMember($_PROFILE["login"] === "raindrops" ? "ynmuc" : "gdapd", $tomorrow2[$index]); ?><span style="vertical-align: middle;">with</span> <img alt="" src="/assets/uploads/pt-<?= $member2["name"] ?>.png" style="width:24px; height: 24px; vertical-align: middle;"> <span style="vertical-align: middle;"><?= getMiniName($member2["display_name"] ?? $member2["name"]) ?></span><?php endif; ?> - </li> - <?php endforeach; ?> - </ul> - - <hr> - <h4>Next events</h4> - <?php - - $cal = new IcalParser(); - $results = $cal->parseFile($_SERVER['DOCUMENT_ROOT'] . "/includes/data/calendar.ics"); - $events = []; - - foreach ($cal->getEvents()->sorted() as $event) { - $events[] = [ - "id" => $event['UID'], - "date" => [ - "created" => $event['CREATED']->format('c'), - "modified" => $event['LAST-MODIFIED']->format('c'), - "start" => $event['DTSTART']->format('c'), - "end" => $event['DTEND']->format('c'), - "duration" => strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')), - "full_day" => strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')) >= 86400, - "days" => ( - strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c')) >= 86400 ? - round((strtotime($event['DTEND']->format('c')) - strtotime($event['DTSTART']->format('c'))) / 86400) : - null - ) - ], - "name" => $event['SUMMARY'], - "description" => $event['DESCRIPTION'], - ]; - } - - $events = array_values(array_filter($events, function ($i) { - return ( - strtotime($i["date"]["end"]) > time() && - strtotime($i["date"]["start"]) < time() + 2629800 - ); - })); - - ?> - <ul> - <?php foreach ($events as $event): ?> - <li> - <?php if ($event["date"]["full_day"]): ?> - <b> - <?php if (strtotime($event["date"]["start"]) < time()): ?> - Started <?= timeAgo($event["date"]["start"]) ?>, ends <?= timeIn($event["date"]["end"]) ?> - <?php else: ?> - <?= ucfirst(relativeDate($event["date"]["start"], false)) ?> - <?php endif; ?> - · - </b> - <?php else: ?> - <b> - <?= ucfirst(relativeDate($event["date"]["start"])) ?> - · - </b> - <?php endif; ?> - for <?= duration($event["date"]["duration"]) ?> - · - <?= $event["name"] ?> - </li> - <?php endforeach; ?> - </ul> - </div> -</div> - -<style> - .peh-row { - display: grid; - grid-template-columns: repeat(9, 1fr); - } - - .column .card { - border-right: none !important; - border-radius: 0 !important; - } - - .column:nth-child(1) .card { - border-bottom-left-radius: 0.25rem !important; - border-top-left-radius: 0.25rem !important; - } - - .column:nth-last-child(1) .card { - border-right: 1px solid rgba(255, 255, 255, .125) !important; - border-bottom-right-radius: 0.25rem !important; - border-top-right-radius: 0.25rem !important; - } - - @media (max-width: 1199px) { - .app-name { - display: none; - } - } - - @media (max-width: 991px) { - .column { - padding-right: calc(var(--bs-gutter-x) * .25); - padding-left: calc(var(--bs-gutter-x) * .25); - } - } - - @media (max-width: 576px) { - .card-body { - padding: 0.5rem 0.5rem !important; - } - - .column { - padding-right: calc(var(--bs-gutter-x) * .175) !important; - padding-left: calc(var(--bs-gutter-x) * .175) !important; - } - } -</style> - -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> diff --git a/pages/debug.php b/pages/debug.inc index fdd6fec..77001d0 100644 --- a/pages/debug.php +++ b/pages/debug.inc @@ -1,14 +1,18 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; function itemToName(string $item): string { - if ($item === "docs_cleanup") return "Deleting scheduled documents"; - if ($item === "important_backup") return "Differential backups"; - if ($item === "restore") return "Failure protection"; - if ($item === "backups") return "Encrypted off-site backups"; - if ($item === "calendar") return "Google Calendar integration"; + if ($item === "docs_cleanup") return "Deleting scheduled documents"; + if ($item === "important_backup") return "Differential backups"; + if ($item === "restore") return "Failure protection"; + if ($item === "backups") return "Encrypted off-site backups"; + if ($item === "calendar") return "Google Calendar integration"; + if ($item === "version") return "Version information"; + if ($item === "logo") return "Website logo processing"; + if ($item === "favicons") return "Favicons processing"; + if ($item === "assets") return "External assets download"; if (str_starts_with($item, "system-")) { $system = explode("-", $item)[2]; @@ -50,6 +54,21 @@ function itemToName(string $item): string { <h2>Data updater debugging</h2> <p>This page provides debugging information to troubleshoot unexpectedly long update times or reported failures.</p> + <?php if (time() - $data["timestamp"] > 360): ?> + <div class="alert alert-warning"> + <p> + <b>The data is not updated periodically anymore.</b> + </p> + This can be due to multiple things: + <ul> + <li>the data updater has been disabled temporarily for maintenance;</li> + <li>the data updater cannot start on the server;</li> + <li>the server was down for an extended period of time</li> + </ul> + If you are an administrator and think this is not normal, you may investigate the issue. + </div> + <?php endif; ?> + <h4>General information</h4> <ul> <li><b>Update date:</b> <?php $dt = DateTime::createFromFormat('U.u', $data["timestamp"]); echo($dt->format("l j F Y, G:i:s.u T")); ?></li> @@ -93,4 +112,4 @@ function itemToName(string $item): string { } </style> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/demo.php b/pages/demo.inc index 381a7e4..d469908 100644 --- a/pages/demo.php +++ b/pages/demo.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -$demoHeader = true; $emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +$demoHeader = true; $emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -12,19 +12,17 @@ $demoHeader = true; $emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROO <div id="header" style="text-align: center;"> <img alt="" src="/assets/uploads/raindrops.png" style="width:128px;"> <h3>Raindrops System</h3> - <p>Système plural de <?= count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true)) - 1 ?> poneys</p> + <p>Système plural de <?= count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)) - 2 ?> poneys</p> <hr> </div> <div id="list"> - <p>Cliquez sur quelqu'un pour avoir plus d'information sur elle.</p> <div class="list-group"> - <?php foreach (scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true), "gdapd") as $member): ?> + <?php foreach (scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), "gdapd") as $member): ?> <a onclick="showMember('<?= $member["id"] ?>');" class="list-group-item"> - <img src="/assets/uploads/pt-<?= $member["name"] ?>.png" style="width:32px;vertical-align: middle;"> + <img src="<?= getAsset($member['system'], $member["id"], "heads") ?>" style="width:32px;vertical-align: middle;"> <span style="vertical-align: middle;margin-left: 5px;"> - <b><?= getMiniName($member["display_name"] ?? $member["name"]) ?></b> - <?= $member["_metadata"]["host"] ? "(hôte)" : "" ?><?= $member["_metadata"]["protector"] ? "(protectrice)" : "" ?><?= $member["_metadata"]["little"] === 2 ? (isset($member["_metadata"]["median"]) ? "(" . getMiniName(getSystemMember("gdapd", $member["_metadata"]["median"])["display_name"]) . " régressée en âge)" : "(petite)") : "" ?> + <b><?= $member["display_name"] ?? $member["name"] ?></b> </span> </a> <?php endforeach; ?> @@ -45,7 +43,7 @@ $demoHeader = true; $emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROO </div> <div class="modal-body"> - <?php foreach (scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true), "gdapd") as $member): ?> + <?php foreach (scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), "gdapd") as $member): ?> <div class="modal-member-content" id="modal-member-content-<?= $member["id"] ?>"> <script> <?php global $memberData; $memberData = $member; ?> @@ -106,7 +104,7 @@ $demoHeader = true; $emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROO </style> <script> - window._phpMembers = JSON.parse(atob(`<?= base64_encode(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true), "gdapd")))) ?>`)); + window._phpMembers = JSON.parse(atob(`<?= base64_encode(json_encode(array_values(scoreOrder(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), "gdapd")))) ?>`)); window.members = {}; for (let member of window._phpMembers) { @@ -128,4 +126,4 @@ $demoHeader = true; $emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROO } </script> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/disclaimers.php b/pages/disclaimers.inc index b47e33a..ae3d04e 100644 --- a/pages/disclaimers.php +++ b/pages/disclaimers.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -12,4 +12,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/docs.php b/pages/docs.inc index bbc3054..f893e95 100644 --- a/pages/docs.php +++ b/pages/docs.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; global $_PROFILE; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $_PROFILE; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.inc"; $parts = explode("/", $_GET['_']); $select = $parts[2] ?? null; @@ -32,7 +32,7 @@ if ($select === "add") { } } -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -358,4 +358,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; } </style> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/edit-private.php b/pages/edit-private.inc index ac93e06..880effe 100644 --- a/pages/edit-private.php +++ b/pages/edit-private.inc @@ -13,7 +13,7 @@ function getSubsystemByID(string $id) { return $subsystem; } -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; if (!isset($_GET['_']) || trim($_GET['_']) === "") header("Location: /?error=Invalid request") and die(); @@ -27,13 +27,13 @@ if ($system !== "cloudburst" && $system !== "raindrops") header("Location: /?err $systemCommonName = $system === "cloudburst" ? "Cloudburst System" : "Raindrops System"; $systemID = $system === "cloudburst" ? "ynmuc" : "gdapd"; -$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystems.json"), true) ?? []; +$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID.json"), true) ?? []; if ($member === null) { header("Location: /?error=Unsupported target: system") and die(); } else { $isSubsystem = false; - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-members.json"), true); + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/members.json"), true); $memberData = null; $memberCommonName = null; $memberID = null; @@ -53,16 +53,16 @@ if ($member === null) { $isSubsystem = true; $subsystemID = $member; $subsystem = getSubsystemByID($subsystemID); - $subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystem[source].json"), true); + $subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json"), true); $subsystemCommonName = $subsystemData["name"] ?? $subsystemID; - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/subsysedit.php'; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/subsysedit.inc'; } else { header("Location: /?error=System member or subsystem not found") and die(); } } - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/edit-private.php'; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/edit-private.inc'; } exit;
\ No newline at end of file diff --git a/pages/edit.php b/pages/edit.inc index 8e6de91..8be6730 100644 --- a/pages/edit.php +++ b/pages/edit.inc @@ -13,7 +13,7 @@ function getSubsystemByID(string $id) { return $subsystem; } -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; if (!isset($_GET['_']) || trim($_GET['_']) === "") header("Location: /?error=Invalid request") and die(); @@ -27,13 +27,13 @@ if ($system !== "cloudburst" && $system !== "raindrops") header("Location: /?err $systemCommonName = $system === "cloudburst" ? "Cloudburst System" : "Raindrops System"; $systemID = $system === "cloudburst" ? "ynmuc" : "gdapd"; -$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystems.json"), true) ?? []; +$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID.json"), true) ?? []; if ($member === null) { - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/sysedit.php'; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/sysedit.inc'; } else { $isSubsystem = false; - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-members.json"), true); + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/members.json"), true); $memberData = null; $memberCommonName = null; $memberID = null; @@ -53,16 +53,16 @@ if ($member === null) { $isSubsystem = true; $subsystemID = $member; $subsystem = getSubsystemByID($subsystemID); - $subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID-subsystem-$subsystem[source].json"), true); + $subsystemData = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json"), true); $subsystemCommonName = $subsystemData["name"] ?? $subsystemID; - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/subsysedit.php'; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/subsysedit.inc'; } else { header("Location: /?error=System member or subsystem not found: " . $subsystemID) and die(); } } - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/edit.php'; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/edit.inc'; } exit;
\ No newline at end of file diff --git a/pages/emergency.php b/pages/emergency.inc index 55ed49a..c13a62e 100644 --- a/pages/emergency.php +++ b/pages/emergency.inc @@ -1,15 +1,15 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> <br> <div class="container"> <div id="page-content"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/emergency.php"; ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/emergency.inc"; ?> </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/fronting.php b/pages/fronting.inc index 3e613c6..c1d8ead 100644 --- a/pages/fronting.php +++ b/pages/fronting.inc @@ -1,15 +1,15 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> <br> <div class="container"> <div> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/planner.php"; ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/planner.inc"; ?> </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/government.inc b/pages/government.inc new file mode 100644 index 0000000..4698c55 --- /dev/null +++ b/pages/government.inc @@ -0,0 +1,142 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; + +?> + +<br> +<div class="container"> + <div> + <h2>Cold Haze Government</h2> + <?php + + $members = scoreOrderGlobal(); + $zzise = getMemberWithoutSystem("zzise"); + $auvwc = getMemberWithoutSystem("auvwc"); + $qbzxm = getMemberWithoutSystem("qbzxm"); + $vncoa = getMemberWithoutSystem("vncoa"); + $qraku = getMemberWithoutSystem("qraku"); + $ghrby = getMemberWithoutSystem("ghrby"); + + ?> + + <div title="<b>System Council</b><br>-" data-bs-toggle="tooltip" data-bs-html="true" style="text-align: center;border-radius:10px;background:#222; padding: 10px; margin-top: 15px;"> + <b>Systems Council</b> + <div style="margin-top: 10px; display: flex; justify-content: center;"> + <a class="gov-link" href="/<?= $ghrby["name"] ?>" style="color: white !important; text-decoration: none;"><div style="margin-right: 10px;"> + <img style="width:48px; height: 48px; border-radius: 999px; background-color: #333;" src="<?= getAsset("ynmuc", "ghrby") ?>"><br> + <?= $ghrby["display_name"] ?> + </div></a> + <a class="gov-link" href="/<?= $auvwc["name"] ?>" style="color: white !important; text-decoration: none;"><div style=" margin-right: auto;"> + <img style="width:48px; height: 48px; border-radius: 999px; background-color: #333;" src="<?= getAsset("gdapd", "auvwc") ?>"><br> + <?= $auvwc["display_name"] ?> + </div></a> + </div> + </div> + <div style="display: grid; grid-template-columns: 1fr 1px 1fr; grid-column-gap: 15px; margin-top: 15px;"> + <div> + <p style="text-align: center;"> + <img style="width: 24px; vertical-align: middle;" src="/assets/uploads/cloudburst.png"> + <b style="vertical-align: middle;">Cloudburst System</b> + </p> + <div style="display: grid; grid-template-columns: 1.5fr 1fr; grid-column-gap: 15px;"> + <div title="<b>Head of System Operations</b><br>-" data-bs-toggle="tooltip" data-bs-html="true" style="text-align: center;border-radius:10px;background:#023100; padding: 10px;"> + <b><span class="list-separator-mobile">H. S. O.</span><span class="list-separator-desktop">Head of System Operations</span></b> + <div style="margin-top: 10px; display: flex; justify-content: center;"> + <a class="gov-link" href="/<?= $ghrby["name"] ?>" style="color: white !important; text-decoration: none;"><div> + <img style="width:48px; height: 48px; border-radius: 999px; background-color: #333;" src="<?= getAsset("ynmuc", "ghrby") ?>"> + <span class="list-separator-desktop"><br><?= $ghrby["display_name"] ?></span> + </div></a> + </div> + </div> + <div title="<b>Primary Protector</b><br>-" data-bs-toggle="tooltip" data-bs-html="true" style="text-align: center;border-radius:10px;background:#002d31; padding: 10px;"> + <b><span class="list-separator-mobile">P. P.</span><span class="list-separator-desktop">Primary Protector</span></b> + <div style="margin-top: 10px; display: flex; justify-content: center;"> + <a class="gov-link" href="/<?= $zzise["name"] ?>" style="color: white !important; text-decoration: none;"><div> + <img style="width:48px; height: 48px; border-radius: 999px; background-color: #333;" src="<?= getAsset("ynmuc", "zzise") ?>"> + <span class="list-separator-desktop"><br><?= $zzise["display_name"] ?></span> + </div></a> + </div> + </div> + </div> + </div> + <div style="background:rgba(255, 255, 255, .2);"></div> + <div> + <p style="text-align: center;"> + <img style="width: 24px; vertical-align: middle;" src="/assets/uploads/raindrops.png"> + <b style="vertical-align: middle;">Raindrops System</b> + </p> + <div style="display: grid; grid-template-columns: 1.5fr 1fr; grid-column-gap: 15px;"> + <div title="<b>Head of System Operations</b><br>-" data-bs-toggle="tooltip" data-bs-html="true" style="text-align: center;border-radius:10px;background:#023100; padding: 10px;"> + <b><span class="list-separator-mobile">H. S. O.</span><span class="list-separator-desktop">Head of System Operations</span></b> + <div style="margin-top: 10px; display: flex; justify-content: center;"> + <a class="gov-link" href="/<?= $auvwc["name"] ?>" style="color: white !important; text-decoration: none;"><div> + <img style="width:48px; height: 48px; border-radius: 999px; background-color: #333;" src="<?= getAsset("gdapd", "auvwc") ?>"> + <span class="list-separator-desktop"><br><?= $auvwc["display_name"] ?></span> + </div></a> + </div> + </div> + <div title="<b>Primary Protector</b><br>-" data-bs-toggle="tooltip" data-bs-html="true" style="text-align: center;border-radius:10px;background:#002d31; padding: 10px;"> + <b><span class="list-separator-mobile">P. P.</span><span class="list-separator-desktop">Primary Protector</span></b> + <div style="margin-top: 10px; display: flex; justify-content: center;"> + <a class="gov-link" href="/<?= $qbzxm["name"] ?>" style="color: white !important; text-decoration: none;"><div> + <img style="width:48px; height: 48px; border-radius: 999px; background-color: #333;" src="<?= getAsset("gdapd", "qbzxm") ?>"> + <span class="list-separator-desktop"><br><?= $qbzxm["display_name"] ?></span> + </div></a> + </div> + </div> + </div> + </div> + </div> + <div style="display: grid; grid-template-columns: 1fr 1px 1fr; grid-column-gap: 15px;"> + <div title="<b>Protectors</b><br>-" data-bs-toggle="tooltip" data-bs-html="true" style="margin-top: 15px;"> + <div style="text-align: center;border-radius:10px;background:#311a00; padding: 10px;"> + <b>Protectors</b> + <div style="margin-top: 10px; display: flex; justify-content: center;"> + <a class="gov-link" href="/<?= $zzise["name"] ?>" style="color: white !important; text-decoration: none;"><div style="margin-right: 20px;"> + <img style="width:48px; height: 48px; border-radius: 999px; background-color: #333;" src="<?= getAsset("ynmuc", "zzise") ?>"> + <span class="list-separator-desktop"><br><?= $zzise["display_name"] ?></span> + </div></a> + <a class="gov-link" href="/<?= $vncoa["name"] ?>" style="color: white !important; text-decoration: none;"><div style="margin-right: 20px;"> + <img style="width:48px; height: 48px; border-radius: 999px; background-color: #333;" src="<?= getAsset("ynmuc", "vncoa") ?>"> + <span class="list-separator-desktop"><br><?= $vncoa["display_name"] ?></span> + </div></a> + </div> + </div> + </div> + <div style="background:rgba(255, 255, 255, .2);"></div> + <div title="<b>Protectors</b><br>-" data-bs-toggle="tooltip" data-bs-html="true" style="margin-top: 15px;"> + <div style="text-align: center;border-radius:10px;background:#311a00; padding: 10px;"> + <b>Protectors</b> + <div style="margin-top: 10px; display: flex; justify-content: center;"> + <a class="gov-link" href="/<?= $qbzxm["name"] ?>" style="color: white !important; text-decoration: none;"><div style="margin-right: 20px;"> + <img style="width:48px; height: 48px; border-radius: 999px; background-color: #333;" src="<?= getAsset("gdapd", "qbzxm") ?>"> + <span class="list-separator-desktop"><br><?= $qbzxm["display_name"] ?></span> + </div></a> + <a class="gov-link" href="/<?= $qraku["name"] ?>" style="color: white !important; text-decoration: none;"><div style="margin-right: 20px;"> + <img style="width:48px; height: 48px; border-radius: 999px; background-color: #333;" src="<?= getAsset("gdapd", "qraku") ?>"> + <span class="list-separator-desktop"><br><?= $qraku["display_name"] ?></span> + </div></a> + </div> + </div> + </div> + </div> + </div> +</div> + +<style> + .gov-link:hover { + opacity: .75; + } + + .gov-link:active { + opacity: .5; + } + + .gov-link:focus { + opacity: .5; + } +</style> + +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/home.php b/pages/home.inc index a2fe0c3..4f4b0f6 100644 --- a/pages/home.php +++ b/pages/home.inc @@ -1,4 +1,4 @@ -<?php if (isset($_GET['error'])) header("HTTP/1.1 404 Not Found"); require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; ?> +<?php if (isset($_GET['error'])) header("HTTP/1.1 404 Not Found"); require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $readOnly; global $isNormallyLoggedIn; global $_PROFILE; ?> <br> <div class="container"> @@ -9,11 +9,17 @@ </div> <?php endif; ?> + <?php if ($readOnly && $isNormallyLoggedIn): ?> + <div class="alert alert-warning"> + <b>Notice: </b>This website is temporarily under maintenance and the administrators have locked the database. Although you are logged in as <?= $_PROFILE['name'] ?>, you cannot access any of the logged-in features while the website is under maintenance. <a href="/-/emergency">Alerts dispatching</a> remains possible in case of an emergency. + </div> + <?php endif; ?> + <?php global $travelling; if (!isset($_GET['legacy'])): $byColor = getMembersByColor(); ?> <div style="text-align: center;"> - <img alt="" src="/assets/logo/logo.png" style="width:128px;"> + <img alt="" src="/assets/logo/newlogo.png" style="width:128px;"> <p style="z-index:999;position:relative;background:black;margin: 20px -10px 0 -20px;padding-right:30px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);"> - <?php foreach ($byColor as $member): ?><a data-bs-html="true" class="rainbow-item tooltip-nohelp" title="<b><?= $member["display_name"] ?? $member["name"] ?></b><br><?= ($travelling[$member['id']]["travelling"] ? $member["_system"] === "ynmuc" : $member["_system"] === "gdapd") ? "Raindrops System" : "Cloudburst System" ?>" data-bs-toggle="tooltip" style="overflow: hidden;" href="/<?= $member["name"] ?>"><img src="/assets/uploads/pt-<?= $member["name"] ?>.png" style="width:32px;height:32px;position:absolute;z-index:99;"></a><?php endforeach; ?> + <?php foreach ($byColor as $member): ?><a data-bs-html="true" class="rainbow-item tooltip-nohelp" title="<b><?= $member["display_name"] ?? $member["name"] ?></b><br><?= ($travelling[$member['id']]["travelling"] ? $member["_system"] === "ynmuc" : $member["_system"] === "gdapd") ? "Raindrops System" : "Cloudburst System" ?>" data-bs-toggle="tooltip" style="overflow: hidden;" href="/<?= $member["name"] ?>"><img src="<?= getAsset($member["_system"], $member["id"], "heads") ?>" style="width:32px;height:32px;position:absolute;z-index:99;"></a><?php endforeach; ?> </p> <div style="margin-top:-33px;margin-bottom:0;margin-left:-20px;margin-right:20px;height:32px;text-align: center;display:grid;grid-template-columns: repeat(<?= count($byColor) ?>, 1fr);"> <?php foreach ($byColor as $member): ?><div> @@ -64,4 +70,4 @@ </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/pages/login.php b/pages/login.inc index ebae1ae..ffbe2d7 100644 --- a/pages/login.php +++ b/pages/login.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $readOnly; global $isNormallyLoggedIn; ?> @@ -9,6 +9,11 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; <div class="container"> <div> <h2>Login</h2> + <?php if ($readOnly): ?> + <div class="alert alert-warning"> + <b>Login is temporarily disabled. </b>Login on this website has been temporarily disabled by the administrators for maintenance purposes. + </div> + <?php else: ?> <?php global $isLoggedIn; if ($isLoggedIn): ?> <div class="alert alert-warning"> <b>You are already logged in.</b> If you want to login to a different account or using a different authentication method, you may do so now. @@ -37,7 +42,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; </div> </div> </div> + <?php endif; ?> </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/logout.php b/pages/logout.inc index 0263278..0263278 100644 --- a/pages/logout.php +++ b/pages/logout.inc diff --git a/pages/nicknames.php b/pages/nicknames.inc index 4c06818..434477f 100644 --- a/pages/nicknames.php +++ b/pages/nicknames.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; $members = scoreOrderGlobal(); $relations = []; @@ -45,14 +45,14 @@ foreach ($members as $member) { "name" => getMiniName($member["display_name"] ?? $member["name"]) . " and " . getMiniName($otherMember["display_name"] ?? $otherMember["name"]), "type" => $rel["type"], "images" => [ - file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-$member[name].png") ? "/assets/uploads/pt-$member[name].png" : "/assets/uploads/pt.png", - file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-$otherMember[name].png") ? "/assets/uploads/pt-$otherMember[name].png" : "/assets/uploads/pt.png", + getAsset($member['system'], $member["id"], "heads"), + getAsset($otherMember['system'], $otherMember["id"], "heads") ] ]; } } -$nicknames = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/nicknames.json"), true); +$nicknames = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/nicknames/nicknames.json"), true); ?> @@ -112,4 +112,4 @@ $nicknames = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/include } </style> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/page.php b/pages/page.inc index cab5dcd..22291e2 100644 --- a/pages/page.php +++ b/pages/page.inc @@ -1,6 +1,6 @@ <?php -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json"), true); +$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); if (!isset($_GET['_']) || trim($_GET['_']) === "") header("Location: /?error=Invalid request") and die(); $parts = explode("/", $_GET['_']); @@ -8,10 +8,10 @@ $parts = explode("/", $_GET['_']); if (($parts[0] !== "cloudburst" && $parts[0] !== "raindrops") && (!(count($parts) > 2) || $parts[1] === "-")) { $namesCloudburst = [...array_map(function ($i) { return $i['name']; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true)), "unknown-cb"]; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true)), "unknown-cb"]; $namesRaindrops = [...array_map(function ($i) { return $i['name']; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true)), "unknown-rd"]; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)), "unknown-rd"]; $parts = explode("/", $_GET['_']); array_unshift($parts, ""); @@ -36,12 +36,12 @@ $systemID = $system === "cloudburst" ? "ynmuc" : "gdapd"; if ($member === null) { global $_SystemName; $_SystemName = $system; - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system.php'; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system.inc'; } else if ($member === "-" && isset($parts[2])) { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.php')) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.inc')) { global $_SystemPage; $_SystemPage = $parts[2]; - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.php'; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/system/' . $parts[2] . '.inc'; } else { header("Location: /?error=Page not found: " . $parts[2]) and die(); } @@ -49,8 +49,8 @@ if ($member === null) { $memberFoundInAnotherSystem = false; $traveller = false; - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "-members.json"), true); - $members2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "-members.json"), true); + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $systemID . "/members.json"), true); + $members2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true); $memberData = null; $memberCommonName = null; $memberID = null; @@ -84,10 +84,10 @@ if ($member === null) { } if (isset($parts[2]) && $parts[2] === "-" && isset($parts[3])) { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.php')) { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.inc')) { global $_MemberPage; $_MemberPage = $parts[3]; - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.php'; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member/' . $parts[3] . '.inc'; } else { header("Location: /?error=Page not found: " . $parts[3]) and die(); } @@ -96,7 +96,7 @@ if ($member === null) { global $_MemberName; $_MemberName = $member; - require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member.php'; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/member.inc'; } exit;
\ No newline at end of file diff --git a/pages/parser.php b/pages/parser.inc index 1c3dea4..dc07744 100644 --- a/pages/parser.php +++ b/pages/parser.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -80,8 +80,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; let existing = <?php - $existing1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true); - $existing2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true); + $existing1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true); + $existing2 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true); echo(json_encode([ "cloudburst" => $existing1, @@ -93,11 +93,11 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; let host = { raindrops: "<?php - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true); + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true); foreach ($members as $member) { - if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json")) continue; + if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) continue; - $data = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)); + $data = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); if ($data["host"]) { echo $member['id']; } @@ -106,11 +106,11 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; ?>", cloudburst: "<?php - $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true); + $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true); foreach ($members as $member) { - if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json")) continue; + if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json")) continue; - $data = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)); + $data = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); if ($data["host"]) { echo $member['id']; } @@ -252,4 +252,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; </style> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/pleasure.php b/pages/pleasure.inc index 14b5440..f59d187 100644 --- a/pages/pleasure.php +++ b/pages/pleasure.inc @@ -1,15 +1,15 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> <br> <div class="container"> <div id="page-content"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/pleasure.php"; ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/pleasure.inc"; ?> </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/prefix.php b/pages/prefix.inc index 2b1149b..d7d8a40 100644 --- a/pages/prefix.php +++ b/pages/prefix.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -52,7 +52,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; let existing = <?php $existing1 = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { if ($member["name"] !== "unknown") { foreach ($member['proxy_tags'] as $tag) { if (!$tag["prefix"]) { @@ -68,7 +68,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; $existing2 = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { if ($member["name"] !== "unknown") { foreach ($member['proxy_tags'] as $tag) { if (!$tag["prefix"]) { @@ -92,7 +92,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; let prefixesUsedBy = <?php $existing1 = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { if ($member["name"] !== "unknown") { foreach ($member['proxy_tags'] as $tag) { if (!$tag["prefix"]) { @@ -108,7 +108,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; $existing2 = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { if ($member["name"] !== "unknown") { foreach ($member['proxy_tags'] as $tag) { if (!$tag["prefix"]) { @@ -413,6 +413,8 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; let index = 1; for (let prefix of generated) { + if (prefix.prefix === "n." || prefix.prefix === "g.") continue; + html.push(`<li><code data-bs-toggle="tooltip" data-bs-html="true" data-bs-placement="right" title="<b>Prefix:</b> <code>${prefix.prefix}</code><br><b>Score:</b> ${((1 - (index/generated.length))*100).toFixed(2)}%<hr><div class='text-peh-nowrap'>- ${prefix.rules.join("</div><div class='text-peh-nowrap'>- ")}</div><hr><div class='text-peh-nowrap'>- <span class='text-${existing["cloudburst"].includes(prefix.prefix) ? "danger" : "success"}'>Cloudburst</span> ${existing["cloudburst"].includes(prefix.prefix) ? ` (${prefixesUsedBy["cloudburst"][prefix.prefix]})` : ""}</div><div class='text-peh-nowrap'>- <span class='text-${existing["raindrops"].includes(prefix.prefix) ? "danger" : "success"}'>Raindrops</span> ${existing["raindrops"].includes(prefix.prefix) ? ` (${prefixesUsedBy["raindrops"][prefix.prefix]})` : ""}">${prefix.prefix}</code></li>`); index++; @@ -446,4 +448,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; </style> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/relations.php b/pages/relations.inc index aac2839..80520da 100644 --- a/pages/relations.php +++ b/pages/relations.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -12,7 +12,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; <?php foreach (withCaretakersDown(scoreOrderGlobal()) as $member): if (count($member["_metadata"]["marefriends"]) > 0 || count($member["_metadata"]["sisters"]) > 0): ?> <div class="relation" style="background-color:rgba(255, 255, 255, .1);margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1.5fr <?= $member["_metadata"]["little"] === 2 ? "2fr 2fr 2fr" : "3fr 3fr" ?>;"> <a class="relation-intro" style="background-color:rgba(255, 255, 255, .05);border-right:1px solid rgba(255, 255, 255, .1);margin:-10px;padding:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;color: white;text-decoration: none;" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <table class="relation-item relation-item-marefriends" style="margin-left:10px;padding:0 20px;"> @@ -25,7 +25,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; <span class="text-muted">None</span> <?php else: ?> <?php foreach ($member["_metadata"]["marefriends"] as $id): $mfSystem = explode("/", $id)[0]; $marefriend = getSystemMember(explode("/", $id)[0], explode("/", $id)[1]); ?> - <a title="<?= getMiniName($marefriend["display_name"] ?? $marefriend["name"]) ?>" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="/<?= $marefriend["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $marefriend['name'] . ".png") ? "-" . $marefriend['name'] : "" ?>.png" style="width:24px;"></a> + <a title="<?= getMiniName($marefriend["display_name"] ?? $marefriend["name"]) ?>" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="/<?= $marefriend["name"] ?>"><img src="<?= getAsset($mfSystem, $marefriend["id"], "heads") ?>" style="width:24px;"></a> <?php endforeach; ?> <?php endif; ?> </td> @@ -42,7 +42,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; <span class="text-muted">None</span> <?php else: ?> <?php foreach ($member["_metadata"]["sisters"] as $id): $mfSystem = explode("/", $id)[0]; $marefriend = getSystemMember(explode("/", $id)[0], explode("/", $id)[1]); ?> - <a title="<?= getMiniName($marefriend["display_name"] ?? $marefriend["name"]) ?>" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="/<?= $marefriend["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $marefriend['name'] . ".png") ? "-" . $marefriend['name'] : "" ?>.png" style="width:24px;"></a> + <a title="<?= getMiniName($marefriend["display_name"] ?? $marefriend["name"]) ?>" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="/<?= $marefriend["name"] ?>"><img src="<?= getAsset($mfSystem, $marefriend["id"], "heads") ?>" style="width:24px;"></a> <?php endforeach; ?> <?php endif; ?> </td> @@ -60,7 +60,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; <span class="text-muted">None</span> <?php else: ?> <?php foreach ($member["_metadata"]["caretakers"] as $id): $mfSystem = explode("/", $id)[0]; $marefriend = getSystemMember(explode("/", $id)[0], explode("/", $id)[1]); ?> - <a title="<?= getMiniName($marefriend["display_name"] ?? $marefriend["name"]) ?>" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="/<?= $marefriend["name"] ?>"><img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $marefriend['name'] . ".png") ? "-" . $marefriend['name'] : "" ?>.png" style="width:24px;"></a> + <a title="<?= getMiniName($marefriend["display_name"] ?? $marefriend["name"]) ?>" data-bs-toggle="tooltip" class="member-link tooltip-nohelp" href="/<?= $marefriend["name"] ?>"><img src="<?= getAsset($mfSystem, $marefriend["id"], "heads") ?>" style="width:24px;"></a> <?php endforeach; ?> <?php endif; ?> </td> @@ -102,4 +102,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; </style> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/rules.php b/pages/rules.inc index 9148d89..21ae7e6 100644 --- a/pages/rules.php +++ b/pages/rules.inc @@ -1,6 +1,6 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; if (isset($_POST["updateRules"])) { header("Content-Type: text/plain"); @@ -28,13 +28,13 @@ if (isset($_POST["updateRules"])) { $_POST["payload"][$index] = $rule; } - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules.json", utf8_encode(json_encode($_POST["payload"]))); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules/rules.json", utf8_encode(json_encode($_POST["payload"]))); header("Location: /-/rules"); die(); } -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -46,7 +46,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; <?php - $rules = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules.json"), true); + $rules = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules/rules.json"), true); $protectorCloudburst = array_values(array_filter(scoreOrderGlobal(), function ($i) { return $i["_system"] === "ynmuc" && $i["_metadata"]["protector"]; @@ -72,7 +72,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; </summary> <?php if (in_array(false, $rule["approved"])): ?> <div style="margin-top:10px;" class="alert alert-warning"> - <b>This rule has not yet been approved.</b> All rules need to be approved by the primary protectors from both systems. This rule is still missing approval from <?php + <b>This rule has not yet been approved.</b> All rules need to be approved by the leaders from both systems. This rule is still missing approval from <?php if ($rule["approved"][0] === false) { if ($rule["approved"][1] === false) { @@ -250,4 +250,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; } </style> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/score.php b/pages/score.inc index 370d757..e04f9e7 100644 --- a/pages/score.php +++ b/pages/score.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -13,10 +13,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; <h4>Raindrops System (<code><?php $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)); + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); $scores[] = $score["total"]; @@ -27,18 +27,18 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; return $a + $b; }); - echo round($total / (count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true)) - 1)); + echo round($total / (count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)) - 1)); ?></code>)</h4> <ul> <?php $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { $name = $member["display_name"] ?? $member["name"]; - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)); + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); $scores[] = [ @@ -70,10 +70,10 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; <h4>Cloudburst System (<code><?php $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)); + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); $scores[] = $score["total"]; @@ -84,18 +84,18 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; return $a + $b; }); - echo round($total / (count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true)) - 1)); + echo round($total / (count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true)) - 1)); ?></code>)</h4> <ul> <?php $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { $name = $member["display_name"] ?? $member["name"]; - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)); + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); $scores[] = [ @@ -126,19 +126,19 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; <h4>Global (<code><?php $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)); + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); $scores[] = $score["total"]; } } - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)); + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); $scores[] = $score["total"]; @@ -149,18 +149,18 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; return $a + $b; }); - echo round($total / ((count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true)) + count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true))) - 2)); + echo round($total / ((count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)) + count(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true))) - 2)); ?></code>)</h4> <ul> <?php $scores = []; - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true) as $member) { if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { $name = $member["display_name"] ?? $member["name"]; - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd-$member[id]-metadata.json"), true)); + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); $scores[] = [ @@ -171,11 +171,11 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; ]; } } - foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-members.json"), true) as $member) { + foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true) as $member) { if ($member["name"] !== "unknown" && $member["name"] !== "fusion" && $member["name"] !== "new" && !str_ends_with($member["name"], "-travelling")) { $name = $member["display_name"] ?? $member["name"]; - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.php"; - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc-$member[id]-metadata.json"), true)); + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc"; + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$member[id].json"), true)); $score = calculateScore($metadata, $member["display_name"] ?? $member["name"]); $scores[] = [ @@ -205,4 +205,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/splitting.php b/pages/splitting.inc index d50ede8..1ea2d70 100644 --- a/pages/splitting.php +++ b/pages/splitting.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -14,7 +14,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; }); foreach ($members as $member): ?> <div class="relation" style="background-color:rgba(255, 255, 255, .1);margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;"> <a class="relation-intro" style="background-color:rgba(255, 255, 255, .05);border-right:1px solid rgba(255, 255, 255, .1);margin:-10px;padding:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;color: white;display:flex;align-items:center;text-decoration: none;" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($member["system"], $member["system"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <div class="relation-item" style="display:flex;align-items:center;margin-left:10px;padding:0 20px;"> @@ -52,4 +52,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; </style> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/stats.inc b/pages/stats.inc new file mode 100644 index 0000000..19d4453 --- /dev/null +++ b/pages/stats.inc @@ -0,0 +1,441 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; + +$switchesRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/switches.json"), true); +$switchesCloudburst = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/switches.json"), true); + +?> + +<script src="/assets/editor/chart.js"></script> + +<br> +<div class="container"> + <div id="page-content"> + <h2>Statistics</h2> + <?php + + $weeks = []; + $weeksRectified = []; + + $lastWeek = 0; + foreach ($switchesRaindrops as $switch) { + $week = date('YW', strtotime($switch["timestamp"])); + if ($lastWeek === 0) $lastWeek = $week; + + if (!isset($weeks[$week])) $weeks[$week] = [ + "cloudburst" => 0, + "raindrops" => 0, + "total" => 0, + "end" => strtotime($switch["timestamp"]), + "start" => null + ]; + + if ($week !== $lastWeek) { + if (isset($weeks[$lastWeek])) { + $weeks[$lastWeek]["start"] = strtotime($switch["timestamp"]); + $lastWeek = $week; + } + } + + $weeks[$week]["raindrops"]++; + $weeks[$week]["total"]++; + } + + $lastWeek = 0; + foreach ($switchesCloudburst as $switch) { + $week = date('YW', strtotime($switch["timestamp"])); + if ($lastWeek === 0) $lastWeek = $week; + + if (!isset($weeks[$week])) $weeks[$week] = [ + "cloudburst" => 0, + "raindrops" => 0, + "total" => 0, + "end" => strtotime($switch["timestamp"]), + "start" => null + ]; + + if ($week !== $lastWeek) { + if (isset($weeks[$lastWeek])) { + $weeks[$lastWeek]["start"] = strtotime($switch["timestamp"]); + $lastWeek = $week; + } + } + + $weeks[$week]["cloudburst"]++; + $weeks[$week]["total"]++; + } + + $index = 0; + foreach ($weeks as $id => $week) { + if ($index >= 20) continue; + $weeksRectified[$id] = $week; + $index++; + } + + $weeksRectified = array_filter(array_reverse($weeksRectified), function ($i) { + return $i["start"] > 1651363200; + }); + + $members = []; + $frontersMonth = []; + + $fronts = []; + $lastFrontIDs = []; + + foreach (array_reverse($switchesRaindrops) as $switch) { + foreach ($lastFrontIDs as $frontID) { + $fronts[$frontID]["end"] = strtotime($switch["timestamp"]); + } + $lastFrontIDs = []; + + $index = 0; foreach ($switch["members"] as $member) { + if (strtotime($switch["timestamp"]) - (time() - 86400*30) < 0) continue; + $fronts[$switch["id"] . ":" . $index] = [ + "member" => $member, + "start" => strtotime($switch["timestamp"]), + "end" => strtotime(date('c')), + "duration" => null + ]; + $lastFrontIDs[] = $switch["id"] . ":" . $index; + } $index++; + } + + foreach ($fronts as $id => $front) { + $fronts[$id]["duration"] = $front["end"] - $front["start"]; + + if (!($front["start"] - (time() - 86400*30) < 0)) { + if (!isset($members[$front["member"]])) $members[$front["member"]] = [ + "time" => 0, + "name" => getMemberWithoutSystem($front["member"])["display_name"], + "color" => getMemberWithoutSystem($front["member"])["color"], + ]; + $members[$front["member"]]["time"] += $fronts[$id]["duration"]; + } + } + + foreach ($fronts as $front) { + if (!isset($frontersMonth[date('Y-m', $front["start"])])) $frontersMonth[date('Y-m', $front["start"])] = []; + if (!isset($frontersMonth[date('Y-m', $front["start"])][$front["member"]])) $frontersMonth[date('Y-m', $front["start"])][$front["member"]] = 0; + $frontersMonth[date('Y-m', $front["start"])][$front["member"]] += $front["duration"]; + } + + $fronts = []; + $lastFrontIDs = []; + + foreach (array_reverse($switchesCloudburst) as $switch) { + foreach ($lastFrontIDs as $frontID) { + $fronts[$frontID]["end"] = strtotime($switch["timestamp"]); + } + $lastFrontIDs = []; + + $index = 0; foreach ($switch["members"] as $member) { + $fronts[$switch["id"] . ":" . $index] = [ + "member" => $member, + "start" => strtotime($switch["timestamp"]), + "end" => strtotime(date('c')), + "duration" => null + ]; + $lastFrontIDs[] = $switch["id"] . ":" . $index; + } $index++; + } + + foreach ($fronts as $id => $front) { + $fronts[$id]["duration"] = $front["end"] - $front["start"]; + + if (!($front["start"] - (time() - 86400*30) < 0)) { + if (!isset($members[$front["member"]])) $members[$front["member"]] = [ + "time" => 0, + "name" => getMemberWithoutSystem($front["member"])["display_name"], + "color" => getMemberWithoutSystem($front["member"])["color"], + ]; + $members[$front["member"]]["time"] += $fronts[$id]["duration"]; + } + } + + foreach ($fronts as $front) { + if (!isset($frontersMonth[date('Y-m', $front["start"])])) $frontersMonth[date('Y-m', $front["start"])] = []; + if (!isset($frontersMonth[date('Y-m', $front["start"])][$front["member"]])) $frontersMonth[date('Y-m', $front["start"])][$front["member"]] = 0; + $frontersMonth[date('Y-m', $front["start"])][$front["member"]] += $front["duration"]; + } + + $fronts = array_reverse($fronts); + uasort($members, function ($a, $b) { + return $b["time"] - $a["time"]; + }); + + $frontersMonthRectified = []; + foreach ($frontersMonth as $monthID => $month) { + $thisMonth = []; + + foreach ($month as $id => $time) { + $thisMonth[$id] = [ + "duration" => $time, + "name" => getMemberWithoutSystem($id)["display_name"], + "color" => getMemberWithoutSystem($id)["color"] + ]; + } + + $frontersMonthRectified[$monthID] = $thisMonth; + } + + uasort($frontersMonthRectified, function ($a, $b) use ($frontersMonthRectified) { + return strtotime(array_search($a, $frontersMonthRectified) . "-01") - strtotime(array_search($b, $frontersMonthRectified) . "-01"); + }); + + $frontersMonthMembers = []; + foreach ($frontersMonthRectified as $month => $fronters) { + foreach ($fronters as $fronter => $data) { + foreach (scoreOrderGlobal() as $member) { + if (!isset($frontersMonthMembers[$member["id"]])) $frontersMonthMembers[$member["id"]] = []; + } + } + + foreach ($frontersMonthMembers as $key => $member) { + $frontersMonthMembers[$key][$month] = $frontersMonthRectified[$month][$key] ?? [ + "duration" => 0 + ]; + /*$frontersMonthMembers[$key][$month] = array_map(function ($i) { + return $i["duration"]; + }, $frontersMonthMembers[$key][$month]);*/ + } + } + + ?> + + <h3>Switches per week</h3> + <canvas id="graph-00" style="width: 100%; height: 300px; max-height: 100%;"></canvas> + <script> + const ctx0 = document.getElementById('graph-00').getContext('2d'); + window.chart00 = [ + { + label: "Raindrops System", + data: JSON.parse(`<?= json_encode(array_map(function ($i) { + return $i["raindrops"]; + }, array_values($weeksRectified))) ?>`), + borderColor: "#e598ff" + }, + { + label: "Cloudburst System", + data: JSON.parse(`<?= json_encode(array_map(function ($i) { + return $i["cloudburst"]; + }, array_values($weeksRectified))) ?>`), + borderColor: "#98e0ff" + }, + { + label: "All systems", + data: JSON.parse(`<?= json_encode(array_map(function ($i) { + return $i["total"]; + }, array_values($weeksRectified))) ?>`), + borderColor: "rgba(160,255,153,0.5)", + borderDash: [5] + } + ]; + const graph0 = new Chart(ctx0, { + type: 'line', + data: { + labels: JSON.parse(`<?= json_encode(array_map(function ($i) { + return date("M d", $i["start"]) . " to " . date("M d", $i["end"]); + }, array_values($weeksRectified))) ?>`), + datasets: window.chart00 + }, + options: { + animation: { + duration: 0 + }, + scales: { + y: { + beginAtZero: true, + grid: { + color: "rgba(255,255,255,0.25)" + } + } + }, + plugins: { + legend: { + display: false + }, + tooltip: { + intersect: false + } + } + } + }); + </script> + + <br> + <h3>Time at front in the last 30 days</h3> + <canvas id="graph-01" style="width: 100%; height: 300px; max-height: 100%;"></canvas> + <script> + function toDuration(seconds, remainder) { + if (seconds > 60) { + if (seconds > 3600) { + if (seconds > 86400) { + if (remainder) { + return Math.floor(seconds / 86400) + " d. " + Math.floor((seconds / 3600) - Math.floor(seconds / 86400) * 24) + " hr. " + Math.floor((seconds - (Math.floor(seconds / 3600) * 3600)) / 60) + " min. " + Math.floor((seconds - (Math.floor(seconds / 3600) * 3600)) - (Math.floor((seconds - (Math.floor(seconds / 3600) * 3600)) / 60)) * 60) + " sec."; + } else { + return Math.round(seconds / 86400) + " d."; + } + } else { + if (remainder) { + return Math.floor(seconds / 3600) + " hr. " + Math.floor((seconds - (Math.floor(seconds / 3600) * 3600)) / 60) + " min. " + Math.floor((seconds - (Math.floor(seconds / 3600) * 3600)) - (Math.floor((seconds - (Math.floor(seconds / 3600) * 3600)) / 60)) * 60) + " sec."; + } else { + return Math.round(seconds / 3600) + " hr."; + } + } + } else { + if (remainder) { + return Math.round(seconds / 60) + " min. " + Math.floor((seconds - (Math.floor(seconds / 3600) * 3600)) - (Math.floor((seconds - (Math.floor(seconds / 3600) * 3600)) / 60)) * 60) + " sec."; + } else { + return Math.round(seconds / 60) + " min."; + } + } + } else { + return seconds + " sec."; + } + } + + const ctx1 = document.getElementById('graph-01').getContext('2d'); + window.graph01 = { + label: "Members", + data: JSON.parse(`<?= json_encode(array_map(function ($i) { + return $i["time"]; + }, array_values($members))) ?>`), + backgroundColor: JSON.parse(`<?= json_encode(array_map(function ($i) { + return "#" . $i["color"] . "33"; + }, array_values($members))) ?>`), + borderColor: JSON.parse(`<?= json_encode(array_map(function ($i) { + return "#" . $i["color"]; + }, array_values($members))) ?>`), + borderWidth: 1 + }; + const graph1 = new Chart(ctx1, { + type: 'bar', + data: { + labels: JSON.parse(`<?= json_encode(array_map(function ($i) { + return $i["name"]; + }, array_values($members))) ?>`), + datasets: [ + window.graph01 + ] + }, + options: { + animation: { + duration: 0 + }, + scales: { + y: { + beginAtZero: true, + ticks: { + callback: function(label) { + return toDuration(label); + } + } + }, + x: { + grid: { + color: "rgba(255,255,255,0.25)" + } + } + }, + elements: { + point:{ + radius: 0 + } + }, + plugins: { + legend: { + display: false + }, + tooltip: { + callbacks: { + label: function(tooltipItem) { + return toDuration(tooltipItem.raw, true); + } + } + } + } + } + }); + </script> + + <br> + <h3>Time at front per month</h3> + <canvas id="graph-02" style="width: 100%; height: 300px; max-height: 100%;"></canvas> + <script> + const ctx2 = document.getElementById('graph-02').getContext('2d'); + window.chart02 = JSON.parse(`<?= json_encode(array_values(array_map(function ($i) use ($frontersMonthMembers) { + $name = getMemberWithoutSystem(array_search($i, $frontersMonthMembers))["name"]; + $month = (int)implode("-", explode("-", array_search($i, $frontersMonthMembers))); + + $k = array_filter($i, function ($i) { + return isset($i["name"]) && isset($i["color"]); + }); + + if (count($k) > 0) { + return [ + "label" => $k[array_keys($k)[0]]["name"], + "data" => array_values(array_map(function ($j) use ($name, $month) { + return $name === "twilight" && $month < 202208 ? 0 : $j["duration"]; + }, $i)), + "borderColor" => "#" . $k[array_keys($k)[0]]["color"] + ]; + } else { + return [ + "label" => getMemberWithoutSystem(array_search($i, $frontersMonthMembers))["display_name"], + "data" => array_values(array_map(function ($j) { + return $j["duration"]; + }, $i)), + "borderColor" => "#" . getMemberWithoutSystem(array_search($i, $frontersMonthMembers))["color"] + ]; + } + }, $frontersMonthMembers))) ?>`); + console.log(JSON.parse(`<?= json_encode(array_map(function ($i) { + return date("M Y", strtotime($i . "-00T00:00:00.000Z")); + }, array_keys($frontersMonthRectified))) ?>`)); + const graph2 = new Chart(ctx2, { + type: 'line', + data: { + labels: JSON.parse(`<?= json_encode(array_map(function ($i) { + return date("M Y", strtotime($i . "-00T00:00:00.000Z")); + }, array_keys($frontersMonthRectified))) ?>`), + datasets: window.chart02 + }, + options: { + animation: { + duration: 0 + }, + scales: { + y: { + beginAtZero: true, + grid: { + color: "rgba(255,255,255,0.25)" + }, + ticks: { + callback: function(label) { + return toDuration(label); + } + } + } + }, + plugins: { + legend: { + display: false + }, + tooltip: { + intersect: false, + callbacks: { + label: function(tooltipItem) { + return tooltipItem.dataset.label + ": " + toDuration(tooltipItem.raw, true); + } + } + } + } + } + }); + </script> + </div> +</div> + +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/terminology.php b/pages/terminology.inc index 955e470..c115bcf 100644 --- a/pages/terminology.php +++ b/pages/terminology.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -12,4 +12,4 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?>
\ No newline at end of file +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?>
\ No newline at end of file diff --git a/pages/together-dev.php b/pages/together-dev.inc index d85cfe5..6ea9704 100644 --- a/pages/together-dev.php +++ b/pages/together-dev.inc @@ -1,4 +1,4 @@ <?php global $WebSocketAddress; $WebSocketAddress = "ws://localhost:22666"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/together.php";
\ No newline at end of file +require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/together.inc";
\ No newline at end of file diff --git a/pages/together.php b/pages/together.inc index 65786f5..87faf6a 100644 --- a/pages/together.php +++ b/pages/together.inc @@ -1,7 +1,7 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $WebSocketAddress; diff --git a/pages/toys.php b/pages/toys.inc index e0fb1fe..8e9ba57 100644 --- a/pages/toys.php +++ b/pages/toys.inc @@ -1,9 +1,9 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; if (isset($_POST['deleteAction'])) { - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json"), true); + $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true); $selected = null; $selectedIndex = -1; @@ -23,13 +23,13 @@ if (isset($_POST['deleteAction'])) { } unset($data[$selectedIndex]); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json", utf8_encode(json_encode($data))); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json", utf8_encode(json_encode($data))); header("Location: /-/toys/?d&id=" . $id); die(); } if (isset($_POST['updateAction'])) { - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json"), true); + $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true); $selected = null; $selectedIndex = -1; @@ -96,15 +96,15 @@ if (isset($_POST['updateAction'])) { } $data[$selectedIndex] = $selected; - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json", utf8_encode(json_encode($data))); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json", utf8_encode(json_encode($data))); header("Location: /-/toys/" . $id); die(); } if (isset($_POST['createAction'])) { - require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.php"; - $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json"), true); + require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/random.inc"; + $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true); if (!isset($_POST["name"]) || !isset($_POST["water"])) { header("Location: /-/toys"); @@ -153,14 +153,14 @@ if (isset($_POST['createAction'])) { "sexual" => $sexual ]; - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json", utf8_encode(json_encode($data))); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json", utf8_encode(json_encode($data))); header("Location: /-/toys/" . $id); die(); } global $pagename; $parts = explode("/", $pagename); -$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json"), true); +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true); $selected = null; @@ -182,10 +182,10 @@ if (isset($parts[1])) { } } -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/keywords.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/keywords.inc'; -if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json", "[]"); +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json", "[]"); global $_PROFILE; @@ -244,6 +244,7 @@ global $_PROFILE; <?php endif; ?> <hr> + <!-- <b>Can be used by:</b> <?php @@ -297,7 +298,7 @@ global $_PROFILE; <span class="badge bg-danger rounded-pill">Deprecated</span> </li> <?php endif; endforeach; ?> - </ul> + </ul>--> <div style="margin-top:10px;"></div> @@ -386,6 +387,7 @@ global $_PROFILE; <div class="card-body"> <h4 class="card-title"><?= $item["name"] ?></h4> <p class="card-text"> + <!-- <?php $uniquePonies = []; @@ -409,7 +411,8 @@ global $_PROFILE; <span data-bs-toggle="tooltip" data-bs-html="true" title="<i><?= strip_tags(getMemberWithoutSystem($name)["display_name"] ?? getMemberWithoutSystem($name)["name"]) ?></i>" style="opacity:.5;display: inline-block;"> <img src="/assets/uploads/pt-<?= getMemberWithoutSystem($name)["name"] ?>.png" style="width:32px;"> </span> - <?php endif; endforeach; ?> + <?php endif; endforeach; ?>--> + - </p> <?php if ($item["sexual"]): ?> <span style="" class="badge rounded-pill bg-danger">Sexual</span> @@ -477,13 +480,14 @@ global $_PROFILE; <input type="text" placeholder="Instructions to craft IRL" name="irl" class="form-control" style="color:white;background:#111;border-color:#222;" value="<?= str_replace('"', '"', $selected["irl"] ?? "") ?>"> + <div style="display:none;"> <hr> <p>Select the groups of ponies who can use this toy:</p> <?php $relations = []; - $actions = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json"), true); + $actions = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true); foreach ($actions as $action) { if ($action["type"] !== "sexual") continue; @@ -534,7 +538,7 @@ global $_PROFILE; Mark as deprecated </label> </label> - <?php endforeach; ?> + <?php endforeach; ?></div> <br> <input type="hidden" name="updateAction"> @@ -578,33 +582,15 @@ global $_PROFILE; ksort($init); $sorted = array_values($init); - uasort($sorted, function ($a, $b) { - $uniquePonies1 = []; - - foreach ($a["ponies"] as $ponies) { - foreach ($ponies["members"] as $member) { - $uniquePonies1[$member] = true; - } - } - - $uniquePonies2 = []; - - foreach ($b["ponies"] as $ponies) { - foreach ($ponies["members"] as $member) { - $uniquePonies2[$member] = true; - } - } - - return count($uniquePonies2) - count($uniquePonies1); - }); foreach ($sorted as $item): ?> - <a href="/-/toys/<?= $item["id"] ?>" id="action-<?= $item["id"] ?>" style="display:grid;grid-template-columns: 1fr 1fr 0.2fr;" class="list-group-item list-group-item-action action-listing"> + <a href="/-/toys/<?= $item["id"] ?>" id="action-<?= $item["id"] ?>" style="display:grid;grid-template-columns: 1fr 0.2fr;" class="list-group-item list-group-item-action action-listing"> <div> <span class="<?= trim($item["description"]) === "" ? "text-danger" : "" ?>"><?= $item["name"] ?></span> <?php if (!isset($item["verified"])): ?><span class="badge bg-warning rounded-pill text-black">Unverified</span><?php endif; ?> <?php if (isset($item["untested"])): ?><span class="badge bg-info rounded-pill">Untested</span><?php endif; ?> </div> + <!-- <div> <?php @@ -627,7 +613,6 @@ global $_PROFILE; $index = 1; foreach ($uniquePonies as $name => $deprecated): if (!$deprecated): ?> - <!-- <?= $index ?> --> <span title="<?= getMemberWithoutSystem($name)["display_name"] ?? getMemberWithoutSystem($name)["display_name"] ?>" style="display: inline-block;<?= $longPonyList && $index % 2 === 0 ? "position:absolute;margin-left:-12px;z-index:" . (999 - $index) . ";" : "position:relative;z-index:" . (999 - $index) . ";" ?>"> <img src="/assets/uploads/pt-<?= getMemberWithoutSystem($name)["name"] ?>.png" style="width:24px;"> </span> @@ -638,6 +623,7 @@ global $_PROFILE; </span> <?php $index++; endif; endforeach; ?> </div> + --> <div style="text-align: right;"> <?php if ($item["sexual"]): ?> <span style="" class="badge rounded-pill bg-danger">Sexual</span> @@ -658,7 +644,7 @@ global $_PROFILE; </div> <script> - window.actions = JSON.parse(atob(`<?= base64_encode(json_encode(array_values(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys.json"), true)))) ?>`)); + window.actions = JSON.parse(atob(`<?= base64_encode(json_encode(array_values(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/toys/toys.json"), true)))) ?>`)); </script> <div class="modal fade" id="creator"> @@ -684,13 +670,14 @@ global $_PROFILE; Sexual toy </label> + <div style="display: none;"> <hr> <p>Select the groups of ponies who can use this toy:</p> <?php $relations = []; - $actions = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions.json"), true); + $actions = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/actions/actions.json"), true); foreach ($actions as $action) { if ($action["type"] !== "sexual") continue; @@ -727,7 +714,7 @@ global $_PROFILE; <img style="vertical-align: middle;width:24px;height:24px;" src="<?= $relation["images"][1] ?>"> <span style="vertical-align: middle;"><?= $relation["name"] ?></span> </label> - <?php endforeach; ?> + <?php endforeach; ?></div> <p style="margin-top:10px;">You can add additional data (description, how to use) after adding the toy.</p> <input type="hidden" name="createAction"> @@ -912,4 +899,4 @@ global $_PROFILE; } </style> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/travelling.php b/pages/travelling.inc index 95c7851..e808063 100644 --- a/pages/travelling.php +++ b/pages/travelling.inc @@ -1,17 +1,17 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json"), true); +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +$travelling = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json"), true); $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc"; if (isset($_GET['toggleTravel'])) { if (isset($travelling[$_GET['member']])) { $id = $_GET['member']; $member = getSystemMember(getMemberSystem($id), $id); $system = getMemberSystem($id); - $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system-$id-metadata.json"), true)); + $metadata = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/$id.json"), true)); $travellingSystem = $system === "gdapd" ? "ynmuc" : "gdapd"; if ($travelling[$_GET['member']]["travelling"]) { @@ -93,11 +93,11 @@ if (isset($_GET['toggleTravel'])) { } header("Location: /-/travelling"); - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT))); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/travelling/travelling.json", utf8_encode(json_encode($travelling, JSON_PRETTY_PRINT))); die(); } -require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; global $travelling; ?> @@ -119,7 +119,7 @@ global $travelling; <?php foreach (scoreOrderGlobal() as $member): ?> <div class="relation" style="background-color:rgba(255, 255, 255, .1);margin-bottom:10px;padding:10px;border-radius:10px;display:grid;grid-template-columns: 1fr 2fr max-content;"> <a class="relation-intro" style="background-color:rgba(255, 255, 255, .05);border-right:1px solid rgba(255, 255, 255, .1);margin:-10px;padding:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;color: white;display:flex;align-items:center;text-decoration: none;" href="/<?= $member["name"] ?>"> - <img src="/assets/uploads/pt<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . resolveMember($member['name']) . ".png") ? "-" . $member['name'] : "" ?>.png" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> + <img src="<?= getAsset($member["system"], $member["id"], "heads") ?>" style="width:24px;"> <?= $member["display_name"] ?? $member["name"] ?> </a> <div class="relation-item" style="display:flex;align-items:center;margin-left:10px;padding:0 20px;"> @@ -172,4 +172,4 @@ global $travelling; </style> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> diff --git a/pages/wakeup.php b/pages/wakeup.inc index c90d93e..2438a27 100644 --- a/pages/wakeup.php +++ b/pages/wakeup.inc @@ -1,15 +1,15 @@ <?php -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.php"; global $title; global $isLoggedIn; -$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; +$emergencyHeader = true; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> <br> <div class="container"> <div id="page-content"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/wakeup.php"; ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/wakeup.inc"; ?> </div> </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; ?> +<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> |