fleet-contractor/Site/js/lib/ui.min.js.map
2024-03-26 15:56:31 +08:00

1 line
464 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"ui.min.js","sources":["../../../../../../UILib/ui-lib/lib/functions.js","../../../../../../UILib/ui-lib/lib/ui/icon.js","../../../../../../UILib/ui-lib/lib/ui/checkbox.js","../../../../../../UILib/ui-lib/lib/ui/tooltip.js","../../../../../../UILib/ui-lib/lib/ui/tab.js","../../../../../../UILib/ui-lib/lib/utility/request.js","../../../../../../UILib/ui-lib/lib/utility/strings.js","../../../../../../UILib/ui-lib/lib/utility/lgres.js","../../../../../../UILib/ui-lib/lib/utility.js","../../../../../../UILib/ui-lib/lib/ui/dropdown.js","../../../../../../UILib/ui-lib/lib/ui/popup.js","../../../../../../UILib/ui-lib/lib/ui/extension.js","../../../../../../UILib/ui-lib/lib/ui/date.js","../../../../../../UILib/ui-lib/lib/ui/grid/column.js","../../../../../../UILib/ui-lib/lib/ui/grid/grid.js","../../../../../../UILib/ui-lib/lib/ui/media.js"],"sourcesContent":["export function createElement(tagName, init, ...children) {\r\n const element = document.createElement(tagName);\r\n if (typeof init === 'function') {\r\n init(element);\r\n } else if (init != null) {\r\n element.className = init;\r\n }\r\n if (children.length > 0) {\r\n element.append(...children);\r\n }\r\n return element;\r\n}\r\n","const svgns = 'http://www.w3.org/2000/svg';\r\nconst dict = {\r\n \"\\uf000\": \"glass-martini\",\r\n \"\\uf001\": \"music\",\r\n \"\\uf002\": \"search\",\r\n \"\\uf004\": \"heart\",\r\n \"\\uf005\": \"star\",\r\n \"\\uf007\": \"user\",\r\n \"\\uf008\": \"film\",\r\n \"\\uf009\": \"th-large\",\r\n \"\\uf00a\": \"th\",\r\n \"\\uf00b\": \"th-list\",\r\n \"\\uf00c\": \"check\",\r\n \"\\uf00d\": \"times\",\r\n \"\\uf00e\": \"search-plus\",\r\n \"\\uf010\": \"search-minus\",\r\n \"\\uf011\": \"power-off\",\r\n \"\\uf012\": \"signal\",\r\n \"\\uf013\": \"cog\",\r\n \"\\uf015\": \"home\",\r\n \"\\uf017\": \"clock\",\r\n \"\\uf018\": \"road\",\r\n \"\\uf019\": \"download\",\r\n \"\\uf01c\": \"inbox\",\r\n \"\\uf01e\": \"redo\",\r\n \"\\uf021\": \"sync\",\r\n \"\\uf022\": \"list-alt\",\r\n \"\\uf023\": \"lock\",\r\n \"\\uf024\": \"flag\",\r\n \"\\uf025\": \"headphones\",\r\n \"\\uf026\": \"volume-off\",\r\n \"\\uf027\": \"volume-down\",\r\n \"\\uf028\": \"volume-up\",\r\n \"\\uf029\": \"qrcode\",\r\n \"\\uf02a\": \"barcode\",\r\n \"\\uf02b\": \"tag\",\r\n \"\\uf02c\": \"tags\",\r\n \"\\uf02d\": \"book\",\r\n \"\\uf02e\": \"bookmark\",\r\n \"\\uf02f\": \"print\",\r\n \"\\uf030\": \"camera\",\r\n \"\\uf031\": \"font\",\r\n \"\\uf032\": \"bold\",\r\n \"\\uf033\": \"italic\",\r\n \"\\uf034\": \"text-height\",\r\n \"\\uf035\": \"text-width\",\r\n \"\\uf036\": \"align-left\",\r\n \"\\uf037\": \"align-center\",\r\n \"\\uf038\": \"align-right\",\r\n \"\\uf039\": \"align-justify\",\r\n \"\\uf03a\": \"list\",\r\n \"\\uf03b\": \"outdent\",\r\n \"\\uf03c\": \"indent\",\r\n \"\\uf03d\": \"video\",\r\n \"\\uf03e\": \"image\",\r\n \"\\uf040\": \"pencil\",\r\n \"\\uf041\": \"map-marker\",\r\n \"\\uf042\": \"adjust\",\r\n \"\\uf043\": \"tint\",\r\n \"\\uf044\": \"edit\",\r\n \"\\uf047\": \"arrows\",\r\n \"\\uf048\": \"step-backward\",\r\n \"\\uf049\": \"fast-backward\",\r\n \"\\uf04a\": \"backward\",\r\n \"\\uf04b\": \"play\",\r\n \"\\uf04c\": \"pause\",\r\n \"\\uf04d\": \"stop\",\r\n \"\\uf04e\": \"forward\",\r\n \"\\uf050\": \"fast-forward\",\r\n \"\\uf051\": \"step-forward\",\r\n \"\\uf052\": \"eject\",\r\n \"\\uf053\": \"chevron-left\",\r\n \"\\uf054\": \"chevron-right\",\r\n \"\\uf055\": \"plus-circle\",\r\n \"\\uf056\": \"minus-circle\",\r\n \"\\uf057\": \"times-circle\",\r\n \"\\uf058\": \"check-circle\",\r\n \"\\uf059\": \"question-circle\",\r\n \"\\uf05a\": \"info-circle\",\r\n \"\\uf05b\": \"crosshairs\",\r\n \"\\uf05e\": \"ban\",\r\n \"\\uf060\": \"arrow-left\",\r\n \"\\uf061\": \"arrow-right\",\r\n \"\\uf062\": \"arrow-up\",\r\n \"\\uf063\": \"arrow-down\",\r\n \"\\uf064\": \"share\",\r\n \"\\uf065\": \"expand\",\r\n \"\\uf066\": \"compress\",\r\n \"\\uf067\": \"plus\",\r\n \"\\uf068\": \"minus\",\r\n \"\\uf069\": \"asterisk\",\r\n \"\\uf06a\": \"exclamation-circle\",\r\n \"\\uf06b\": \"gift\",\r\n \"\\uf06c\": \"leaf\",\r\n \"\\uf06d\": \"fire\",\r\n \"\\uf06e\": \"eye\",\r\n \"\\uf070\": \"eye-slash\",\r\n \"\\uf071\": \"exclamation-triangle\",\r\n \"\\uf072\": \"plane\",\r\n \"\\uf073\": \"calendar-alt\",\r\n \"\\uf074\": \"random\",\r\n \"\\uf075\": \"comment\",\r\n \"\\uf076\": \"magnet\",\r\n \"\\uf077\": \"chevron-up\",\r\n \"\\uf078\": \"chevron-down\",\r\n \"\\uf079\": \"retweet\",\r\n \"\\uf07a\": \"shopping-cart\",\r\n \"\\uf07b\": \"folder\",\r\n \"\\uf07c\": \"folder-open\",\r\n \"\\uf07d\": \"arrows-v\",\r\n \"\\uf07e\": \"arrows-h\",\r\n \"\\uf080\": \"chart-bar\",\r\n \"\\uf083\": \"camera-retro\",\r\n \"\\uf084\": \"key\",\r\n \"\\uf085\": \"cogs\",\r\n \"\\uf086\": \"comments\",\r\n \"\\uf089\": \"star-half\",\r\n \"\\uf08b\": \"sign-out\",\r\n \"\\uf08d\": \"thumbtack\",\r\n \"\\uf08e\": \"external-link\",\r\n \"\\uf090\": \"sign-in\",\r\n \"\\uf091\": \"trophy\",\r\n \"\\uf093\": \"upload\",\r\n \"\\uf094\": \"lemon\",\r\n \"\\uf095\": \"phone\",\r\n \"\\uf098\": \"phone-square\",\r\n \"\\uf09c\": \"unlock\",\r\n \"\\uf09d\": \"credit-card\",\r\n \"\\uf09e\": \"rss\",\r\n \"\\uf0a0\": \"hdd\",\r\n \"\\uf0a1\": \"bullhorn\",\r\n \"\\uf0a3\": \"certificate\",\r\n \"\\uf0a4\": \"hand-point-right\",\r\n \"\\uf0a5\": \"hand-point-left\",\r\n \"\\uf0a6\": \"hand-point-up\",\r\n \"\\uf0a7\": \"hand-point-down\",\r\n \"\\uf0a8\": \"arrow-circle-left\",\r\n \"\\uf0a9\": \"arrow-circle-right\",\r\n \"\\uf0aa\": \"arrow-circle-up\",\r\n \"\\uf0ab\": \"arrow-circle-down\",\r\n \"\\uf0ac\": \"globe\",\r\n \"\\uf0ad\": \"wrench\",\r\n \"\\uf0ae\": \"tasks\",\r\n \"\\uf0b0\": \"filter\",\r\n \"\\uf0b1\": \"briefcase\",\r\n \"\\uf0b2\": \"arrows-alt\",\r\n \"\\uf0c0\": \"users\",\r\n \"\\uf0c1\": \"link\",\r\n \"\\uf0c2\": \"cloud\",\r\n \"\\uf0c3\": \"flask\",\r\n \"\\uf0c4\": \"cut\",\r\n \"\\uf0c5\": \"copy\",\r\n \"\\uf0c6\": \"paperclip\",\r\n \"\\uf0c7\": \"save\",\r\n \"\\uf0c8\": \"square\",\r\n \"\\uf0c9\": \"bars\",\r\n \"\\uf0ca\": \"list-ul\",\r\n \"\\uf0cb\": \"list-ol\",\r\n \"\\uf0cc\": \"strikethrough\",\r\n \"\\uf0cd\": \"underline\",\r\n \"\\uf0ce\": \"table\",\r\n \"\\uf0d0\": \"magic\",\r\n \"\\uf0d1\": \"truck\",\r\n \"\\uf0d6\": \"money-bill\",\r\n \"\\uf0d7\": \"caret-down\",\r\n \"\\uf0d8\": \"caret-up\",\r\n \"\\uf0d9\": \"caret-left\",\r\n \"\\uf0da\": \"caret-right\",\r\n \"\\uf0db\": \"columns\",\r\n \"\\uf0dc\": \"sort\",\r\n \"\\uf0dd\": \"sort-down\",\r\n \"\\uf0de\": \"sort-up\",\r\n \"\\uf0e0\": \"envelope\",\r\n \"\\uf0e2\": \"undo\",\r\n \"\\uf0e3\": \"gavel\",\r\n \"\\uf0e4\": \"tachometer\",\r\n \"\\uf0e7\": \"bolt\",\r\n \"\\uf0e8\": \"sitemap\",\r\n \"\\uf0e9\": \"umbrella\",\r\n \"\\uf0ea\": \"paste\",\r\n \"\\uf0eb\": \"lightbulb\",\r\n \"\\uf0ec\": \"exchange\",\r\n \"\\uf0ed\": \"cloud-download\",\r\n \"\\uf0ee\": \"cloud-upload\",\r\n \"\\uf0f0\": \"user-md\",\r\n \"\\uf0f1\": \"stethoscope\",\r\n \"\\uf0f2\": \"suitcase\",\r\n \"\\uf0f3\": \"bell\",\r\n \"\\uf0f4\": \"coffee\",\r\n \"\\uf0f8\": \"hospital\",\r\n \"\\uf0f9\": \"ambulance\",\r\n \"\\uf0fa\": \"medkit\",\r\n \"\\uf0fb\": \"fighter-jet\",\r\n \"\\uf0fc\": \"beer\",\r\n \"\\uf0fd\": \"h-square\",\r\n \"\\uf0fe\": \"plus-square\",\r\n \"\\uf100\": \"angle-double-left\",\r\n \"\\uf101\": \"angle-double-right\",\r\n \"\\uf102\": \"angle-double-up\",\r\n \"\\uf103\": \"angle-double-down\",\r\n \"\\uf104\": \"angle-left\",\r\n \"\\uf105\": \"angle-right\",\r\n \"\\uf106\": \"angle-up\",\r\n \"\\uf107\": \"angle-down\",\r\n \"\\uf108\": \"desktop\",\r\n \"\\uf109\": \"laptop\",\r\n \"\\uf10a\": \"tablet\",\r\n \"\\uf10b\": \"mobile\",\r\n \"\\uf10d\": \"quote-left\",\r\n \"\\uf10e\": \"quote-right\",\r\n \"\\uf110\": \"spinner\",\r\n \"\\uf111\": \"circle\",\r\n \"\\uf118\": \"smile\",\r\n \"\\uf119\": \"frown\",\r\n \"\\uf11a\": \"meh\",\r\n \"\\uf11b\": \"gamepad\",\r\n \"\\uf11c\": \"keyboard\",\r\n \"\\uf11e\": \"flag-checkered\",\r\n \"\\uf120\": \"terminal\",\r\n \"\\uf121\": \"code\",\r\n \"\\uf122\": \"reply-all\",\r\n \"\\uf124\": \"location-arrow\",\r\n \"\\uf125\": \"crop\",\r\n \"\\uf126\": \"code-branch\",\r\n \"\\uf127\": \"unlink\",\r\n \"\\uf128\": \"question\",\r\n \"\\uf129\": \"info\",\r\n \"\\uf12a\": \"exclamation\",\r\n \"\\uf12b\": \"superscript\",\r\n \"\\uf12c\": \"subscript\",\r\n \"\\uf12d\": \"eraser\",\r\n \"\\uf12e\": \"puzzle-piece\",\r\n \"\\uf130\": \"microphone\",\r\n \"\\uf131\": \"microphone-slash\",\r\n \"\\uf132\": \"shield\",\r\n \"\\uf133\": \"calendar\",\r\n \"\\uf134\": \"fire-extinguisher\",\r\n \"\\uf135\": \"rocket\",\r\n \"\\uf137\": \"chevron-circle-left\",\r\n \"\\uf138\": \"chevron-circle-right\",\r\n \"\\uf139\": \"chevron-circle-up\",\r\n \"\\uf13a\": \"chevron-circle-down\",\r\n \"\\uf13d\": \"anchor\",\r\n \"\\uf13e\": \"unlock-alt\",\r\n \"\\uf140\": \"bullseye\",\r\n \"\\uf141\": \"ellipsis-h\",\r\n \"\\uf142\": \"ellipsis-v\",\r\n \"\\uf143\": \"rss-square\",\r\n \"\\uf144\": \"play-circle\",\r\n \"\\uf145\": \"ticket\",\r\n \"\\uf146\": \"minus-square\",\r\n \"\\uf148\": \"level-up\",\r\n \"\\uf149\": \"level-down\",\r\n \"\\uf14a\": \"check-square\",\r\n \"\\uf14b\": \"pen-square\",\r\n \"\\uf14c\": \"external-link-square\",\r\n \"\\uf14d\": \"share-square\",\r\n \"\\uf14e\": \"compass\",\r\n \"\\uf150\": \"caret-square-down\",\r\n \"\\uf151\": \"caret-square-up\",\r\n \"\\uf152\": \"caret-square-right\",\r\n \"\\uf153\": \"euro-sign\",\r\n \"\\uf154\": \"pound-sign\",\r\n \"\\uf155\": \"dollar-sign\",\r\n \"\\uf156\": \"rupee-sign\",\r\n \"\\uf157\": \"yen-sign\",\r\n \"\\uf158\": \"ruble-sign\",\r\n \"\\uf159\": \"won-sign\",\r\n \"\\uf15b\": \"file\",\r\n \"\\uf15c\": \"file-alt\",\r\n \"\\uf15d\": \"sort-alpha-down\",\r\n \"\\uf15e\": \"sort-alpha-up\",\r\n \"\\uf160\": \"sort-amount-down\",\r\n \"\\uf161\": \"sort-amount-up\",\r\n \"\\uf162\": \"sort-numeric-down\",\r\n \"\\uf163\": \"sort-numeric-up\",\r\n \"\\uf164\": \"thumbs-up\",\r\n \"\\uf165\": \"thumbs-down\",\r\n \"\\uf175\": \"long-arrow-down\",\r\n \"\\uf176\": \"long-arrow-up\",\r\n \"\\uf177\": \"long-arrow-left\",\r\n \"\\uf178\": \"long-arrow-right\",\r\n \"\\uf182\": \"female\",\r\n \"\\uf183\": \"male\",\r\n \"\\uf185\": \"sun\",\r\n \"\\uf186\": \"moon\",\r\n \"\\uf187\": \"archive\",\r\n \"\\uf188\": \"bug\",\r\n \"\\uf191\": \"caret-square-left\",\r\n \"\\uf192\": \"dot-circle\",\r\n \"\\uf193\": \"wheelchair\",\r\n \"\\uf195\": \"lira-sign\",\r\n \"\\uf197\": \"space-shuttle\",\r\n \"\\uf199\": \"envelope-square\",\r\n \"\\uf19c\": \"university\",\r\n \"\\uf19d\": \"graduation-cap\",\r\n \"\\uf1ab\": \"language\",\r\n \"\\uf1ac\": \"fax\",\r\n \"\\uf1ad\": \"building\",\r\n \"\\uf1ae\": \"child\",\r\n \"\\uf1b0\": \"paw\",\r\n \"\\uf1b2\": \"cube\",\r\n \"\\uf1b3\": \"cubes\",\r\n \"\\uf1b8\": \"recycle\",\r\n \"\\uf1b9\": \"car\",\r\n \"\\uf1ba\": \"taxi\",\r\n \"\\uf1bb\": \"tree\",\r\n \"\\uf1c0\": \"database\",\r\n \"\\uf1c1\": \"file-pdf\",\r\n \"\\uf1c2\": \"file-word\",\r\n \"\\uf1c3\": \"file-excel\",\r\n \"\\uf1c4\": \"file-powerpoint\",\r\n \"\\uf1c5\": \"file-image\",\r\n \"\\uf1c6\": \"file-archive\",\r\n \"\\uf1c7\": \"file-audio\",\r\n \"\\uf1c8\": \"file-video\",\r\n \"\\uf1c9\": \"file-code\",\r\n \"\\uf1cd\": \"life-ring\",\r\n \"\\uf1ce\": \"circle-notch\",\r\n \"\\uf1d8\": \"paper-plane\",\r\n \"\\uf1da\": \"history\",\r\n \"\\uf1dc\": \"heading\",\r\n \"\\uf1dd\": \"paragraph\",\r\n \"\\uf1de\": \"sliders-h\",\r\n \"\\uf1e0\": \"share-alt\",\r\n \"\\uf1e1\": \"share-alt-square\",\r\n \"\\uf1e2\": \"bomb\",\r\n \"\\uf1e3\": \"futbol\",\r\n \"\\uf1e4\": \"tty\",\r\n \"\\uf1e5\": \"binoculars\",\r\n \"\\uf1e6\": \"plug\",\r\n \"\\uf1ea\": \"newspaper\",\r\n \"\\uf1eb\": \"wifi\",\r\n \"\\uf1ec\": \"calculator\",\r\n \"\\uf1f6\": \"bell-slash\",\r\n \"\\uf1f8\": \"trash\",\r\n \"\\uf1f9\": \"copyright\",\r\n \"\\uf1fa\": \"at\",\r\n \"\\uf1fb\": \"eye-dropper\",\r\n \"\\uf1fc\": \"paint-brush\",\r\n \"\\uf1fd\": \"birthday-cake\",\r\n \"\\uf1fe\": \"chart-area\",\r\n \"\\uf200\": \"chart-pie\",\r\n \"\\uf201\": \"chart-line\",\r\n \"\\uf204\": \"toggle-off\",\r\n \"\\uf205\": \"toggle-on\",\r\n \"\\uf206\": \"bicycle\",\r\n \"\\uf207\": \"bus\",\r\n \"\\uf20a\": \"closed-captioning\",\r\n \"\\uf20b\": \"shekel-sign\",\r\n \"\\uf217\": \"cart-plus\",\r\n \"\\uf218\": \"cart-arrow-down\",\r\n \"\\uf219\": \"diamond\",\r\n \"\\uf21a\": \"ship\",\r\n \"\\uf21b\": \"user-secret\",\r\n \"\\uf21c\": \"motorcycle\",\r\n \"\\uf21d\": \"street-view\",\r\n \"\\uf21e\": \"heartbeat\",\r\n \"\\uf221\": \"venus\",\r\n \"\\uf222\": \"mars\",\r\n \"\\uf223\": \"mercury\",\r\n \"\\uf224\": \"transgender\",\r\n \"\\uf225\": \"transgender-alt\",\r\n \"\\uf226\": \"venus-double\",\r\n \"\\uf227\": \"mars-double\",\r\n \"\\uf228\": \"venus-mars\",\r\n \"\\uf229\": \"mars-stroke\",\r\n \"\\uf22a\": \"mars-stroke-v\",\r\n \"\\uf22b\": \"mars-stroke-h\",\r\n \"\\uf22c\": \"neuter\",\r\n \"\\uf22d\": \"genderless\",\r\n \"\\uf233\": \"server\",\r\n \"\\uf234\": \"user-plus\",\r\n \"\\uf235\": \"user-times\",\r\n \"\\uf236\": \"bed\",\r\n \"\\uf238\": \"train\",\r\n \"\\uf239\": \"subway\",\r\n \"\\uf240\": \"battery-full\",\r\n \"\\uf241\": \"battery-three-quarters\",\r\n \"\\uf242\": \"battery-half\",\r\n \"\\uf243\": \"battery-quarter\",\r\n \"\\uf244\": \"battery-empty\",\r\n \"\\uf245\": \"mouse-pointer\",\r\n \"\\uf246\": \"i-cursor\",\r\n \"\\uf247\": \"object-group\",\r\n \"\\uf248\": \"object-ungroup\",\r\n \"\\uf249\": \"sticky-note\",\r\n \"\\uf24d\": \"clone\",\r\n \"\\uf24e\": \"balance-scale\",\r\n \"\\uf251\": \"hourglass-start\",\r\n \"\\uf252\": \"hourglass-half\",\r\n \"\\uf253\": \"hourglass-end\",\r\n \"\\uf254\": \"hourglass\",\r\n \"\\uf255\": \"hand-rock\",\r\n \"\\uf256\": \"hand-paper\",\r\n \"\\uf257\": \"hand-scissors\",\r\n \"\\uf258\": \"hand-lizard\",\r\n \"\\uf259\": \"hand-spock\",\r\n \"\\uf25a\": \"hand-pointer\",\r\n \"\\uf25b\": \"hand-peace\",\r\n \"\\uf25c\": \"trademark\",\r\n \"\\uf25d\": \"registered\",\r\n \"\\uf26c\": \"tv\",\r\n \"\\uf271\": \"calendar-plus\",\r\n \"\\uf272\": \"calendar-minus\",\r\n \"\\uf273\": \"calendar-times\",\r\n \"\\uf274\": \"calendar-check\",\r\n \"\\uf275\": \"industry\",\r\n \"\\uf276\": \"map-pin\",\r\n \"\\uf277\": \"map-signs\",\r\n \"\\uf279\": \"map\",\r\n \"\\uf27a\": \"comment-alt\",\r\n \"\\uf28b\": \"pause-circle\",\r\n \"\\uf28d\": \"stop-circle\",\r\n \"\\uf290\": \"shopping-bag\",\r\n \"\\uf291\": \"shopping-basket\",\r\n \"\\uf292\": \"hashtag\",\r\n \"\\uf295\": \"percent\",\r\n \"\\uf29a\": \"universal-access\",\r\n \"\\uf29d\": \"blind\",\r\n \"\\uf29e\": \"audio-description\",\r\n \"\\uf2a0\": \"phone-volume\",\r\n \"\\uf2a1\": \"braille\",\r\n \"\\uf2a2\": \"assistive-listening-systems\",\r\n \"\\uf2a3\": \"american-sign-language-interpreting\",\r\n \"\\uf2a4\": \"deaf\",\r\n \"\\uf2a7\": \"sign-language\",\r\n \"\\uf2a8\": \"low-vision\",\r\n \"\\uf2b5\": \"handshake\",\r\n \"\\uf2b6\": \"envelope-open\",\r\n \"\\uf2b9\": \"address-book\",\r\n \"\\uf2bb\": \"address-card\",\r\n \"\\uf2bd\": \"user-circle\",\r\n \"\\uf2c1\": \"id-badge\",\r\n \"\\uf2c2\": \"id-card\",\r\n \"\\uf2c7\": \"thermometer-full\",\r\n \"\\uf2c8\": \"thermometer-three-quarters\",\r\n \"\\uf2c9\": \"thermometer-half\",\r\n \"\\uf2ca\": \"thermometer-quarter\",\r\n \"\\uf2cb\": \"thermometer-empty\",\r\n \"\\uf2cc\": \"shower\",\r\n \"\\uf2cd\": \"bath\",\r\n \"\\uf2ce\": \"podcast\",\r\n \"\\uf2d0\": \"window-maximize\",\r\n \"\\uf2d1\": \"window-minimize\",\r\n \"\\uf2d2\": \"window-restore\",\r\n \"\\uf2d3\": \"times-square\",\r\n \"\\uf2db\": \"microchip\",\r\n \"\\uf2dc\": \"snowflake\",\r\n \"\\uf2e1\": \"watch\",\r\n \"\\uf2e2\": \"volume-slash\",\r\n \"\\uf2e3\": \"utensil-fork\",\r\n \"\\uf2e4\": \"utensil-knife\",\r\n \"\\uf2e5\": \"utensil-spoon\",\r\n \"\\uf2e6\": \"utensils-alt\",\r\n \"\\uf2e7\": \"utensils\",\r\n \"\\uf2e8\": \"usd-circle\",\r\n \"\\uf2e9\": \"usd-square\",\r\n \"\\uf2ea\": \"undo-alt\",\r\n \"\\uf2eb\": \"trophy-alt\",\r\n \"\\uf2ec\": \"triangle\",\r\n \"\\uf2ed\": \"trash-alt\",\r\n \"\\uf2ee\": \"times-hexagon\",\r\n \"\\uf2f0\": \"times-octagon\",\r\n \"\\uf2f1\": \"sync-alt\",\r\n \"\\uf2f2\": \"stopwatch\",\r\n \"\\uf2f3\": \"star-exclamation\",\r\n \"\\uf2f4\": \"spade\",\r\n \"\\uf2f5\": \"sign-out-alt\",\r\n \"\\uf2f6\": \"sign-in-alt\",\r\n \"\\uf2f7\": \"shield-check\",\r\n \"\\uf2f8\": \"scrubber\",\r\n \"\\uf2f9\": \"redo-alt\",\r\n \"\\uf2fa\": \"rectangle-landscape\",\r\n \"\\uf2fb\": \"rectangle-portrait\",\r\n \"\\uf2fc\": \"rectangle-wide\",\r\n \"\\uf2fd\": \"question-square\",\r\n \"\\uf2fe\": \"poo\",\r\n \"\\uf300\": \"plus-hexagon\",\r\n \"\\uf301\": \"plus-octagon\",\r\n \"\\uf302\": \"images\",\r\n \"\\uf303\": \"pencil-alt\",\r\n \"\\uf304\": \"pen\",\r\n \"\\uf305\": \"pen-alt\",\r\n \"\\uf306\": \"octagon\",\r\n \"\\uf307\": \"minus-hexagon\",\r\n \"\\uf308\": \"minus-octagon\",\r\n \"\\uf309\": \"long-arrow-alt-down\",\r\n \"\\uf30a\": \"long-arrow-alt-left\",\r\n \"\\uf30b\": \"long-arrow-alt-right\",\r\n \"\\uf30c\": \"long-arrow-alt-up\",\r\n \"\\uf30d\": \"lock-alt\",\r\n \"\\uf30e\": \"jack-o-lantern\",\r\n \"\\uf30f\": \"info-square\",\r\n \"\\uf310\": \"inbox-in\",\r\n \"\\uf311\": \"inbox-out\",\r\n \"\\uf312\": \"hexagon\",\r\n \"\\uf313\": \"h1\",\r\n \"\\uf314\": \"h2\",\r\n \"\\uf315\": \"h3\",\r\n \"\\uf316\": \"file-check\",\r\n \"\\uf317\": \"file-times\",\r\n \"\\uf318\": \"file-minus\",\r\n \"\\uf319\": \"file-plus\",\r\n \"\\uf31a\": \"file-exclamation\",\r\n \"\\uf31c\": \"file-edit\",\r\n \"\\uf31d\": \"expand-arrows\",\r\n \"\\uf31e\": \"expand-arrows-alt\",\r\n \"\\uf320\": \"expand-wide\",\r\n \"\\uf321\": \"exclamation-square\",\r\n \"\\uf322\": \"chevron-double-down\",\r\n \"\\uf323\": \"chevron-double-left\",\r\n \"\\uf324\": \"chevron-double-right\",\r\n \"\\uf325\": \"chevron-double-up\",\r\n \"\\uf326\": \"compress-wide\",\r\n \"\\uf327\": \"club\",\r\n \"\\uf328\": \"clipboard\",\r\n \"\\uf329\": \"chevron-square-down\",\r\n \"\\uf32a\": \"chevron-square-left\",\r\n \"\\uf32b\": \"chevron-square-right\",\r\n \"\\uf32c\": \"chevron-square-up\",\r\n \"\\uf32d\": \"caret-circle-down\",\r\n \"\\uf32e\": \"caret-circle-left\",\r\n \"\\uf330\": \"caret-circle-right\",\r\n \"\\uf331\": \"caret-circle-up\",\r\n \"\\uf332\": \"camera-alt\",\r\n \"\\uf333\": \"calendar-edit\",\r\n \"\\uf334\": \"calendar-exclamation\",\r\n \"\\uf335\": \"badge\",\r\n \"\\uf336\": \"badge-check\",\r\n \"\\uf337\": \"arrows-alt-h\",\r\n \"\\uf338\": \"arrows-alt-v\",\r\n \"\\uf339\": \"arrow-square-down\",\r\n \"\\uf33a\": \"arrow-square-left\",\r\n \"\\uf33b\": \"arrow-square-right\",\r\n \"\\uf33c\": \"arrow-square-up\",\r\n \"\\uf33d\": \"arrow-to-bottom\",\r\n \"\\uf33e\": \"arrow-to-left\",\r\n \"\\uf340\": \"arrow-to-right\",\r\n \"\\uf341\": \"arrow-to-top\",\r\n \"\\uf342\": \"arrow-from-bottom\",\r\n \"\\uf343\": \"arrow-from-left\",\r\n \"\\uf344\": \"arrow-from-right\",\r\n \"\\uf345\": \"arrow-from-top\",\r\n \"\\uf346\": \"arrow-alt-from-bottom\",\r\n \"\\uf347\": \"arrow-alt-from-left\",\r\n \"\\uf348\": \"arrow-alt-from-right\",\r\n \"\\uf349\": \"arrow-alt-from-top\",\r\n \"\\uf34a\": \"arrow-alt-to-bottom\",\r\n \"\\uf34b\": \"arrow-alt-to-left\",\r\n \"\\uf34c\": \"arrow-alt-to-right\",\r\n \"\\uf34d\": \"arrow-alt-to-top\",\r\n \"\\uf34e\": \"alarm-clock\",\r\n \"\\uf350\": \"arrow-alt-square-down\",\r\n \"\\uf351\": \"arrow-alt-square-left\",\r\n \"\\uf352\": \"arrow-alt-square-right\",\r\n \"\\uf353\": \"arrow-alt-square-up\",\r\n \"\\uf354\": \"arrow-alt-down\",\r\n \"\\uf355\": \"arrow-alt-left\",\r\n \"\\uf356\": \"arrow-alt-right\",\r\n \"\\uf357\": \"arrow-alt-up\",\r\n \"\\uf358\": \"arrow-alt-circle-down\",\r\n \"\\uf359\": \"arrow-alt-circle-left\",\r\n \"\\uf35a\": \"arrow-alt-circle-right\",\r\n \"\\uf35b\": \"arrow-alt-circle-up\",\r\n \"\\uf35d\": \"external-link-alt\",\r\n \"\\uf360\": \"external-link-square-alt\",\r\n \"\\uf361\": \"retweet-alt\",\r\n \"\\uf362\": \"exchange-alt\",\r\n \"\\uf363\": \"repeat\",\r\n \"\\uf364\": \"repeat-alt\",\r\n \"\\uf365\": \"repeat-1\",\r\n \"\\uf366\": \"repeat-1-alt\",\r\n \"\\uf367\": \"share-all\",\r\n \"\\uf376\": \"battery-bolt\",\r\n \"\\uf377\": \"battery-slash\",\r\n \"\\uf37e\": \"browser\",\r\n \"\\uf381\": \"cloud-download-alt\",\r\n \"\\uf382\": \"cloud-upload-alt\",\r\n \"\\uf386\": \"code-commit\",\r\n \"\\uf387\": \"code-merge\",\r\n \"\\uf389\": \"credit-card-blank\",\r\n \"\\uf38a\": \"credit-card-front\",\r\n \"\\uf390\": \"desktop-alt\",\r\n \"\\uf39b\": \"ellipsis-h-alt\",\r\n \"\\uf39c\": \"ellipsis-v-alt\",\r\n \"\\uf3a0\": \"film-alt\",\r\n \"\\uf3a5\": \"gem\",\r\n \"\\uf3b3\": \"industry-alt\",\r\n \"\\uf3be\": \"level-down-alt\",\r\n \"\\uf3bf\": \"level-up-alt\",\r\n \"\\uf3c1\": \"lock-open\",\r\n \"\\uf3c2\": \"lock-open-alt\",\r\n \"\\uf3c5\": \"map-marker-alt\",\r\n \"\\uf3c9\": \"microphone-alt\",\r\n \"\\uf3cd\": \"mobile-alt\",\r\n \"\\uf3ce\": \"mobile-android\",\r\n \"\\uf3cf\": \"mobile-android-alt\",\r\n \"\\uf3d1\": \"money-bill-alt\",\r\n \"\\uf3dd\": \"phone-slash\",\r\n \"\\uf3de\": \"plane-alt\",\r\n \"\\uf3e0\": \"portrait\",\r\n \"\\uf3e5\": \"reply\",\r\n \"\\uf3ed\": \"shield-alt\",\r\n \"\\uf3f0\": \"sliders-h-square\",\r\n \"\\uf3f1\": \"sliders-v\",\r\n \"\\uf3f2\": \"sliders-v-square\",\r\n \"\\uf3f4\": \"spinner-third\",\r\n \"\\uf3fa\": \"tablet-alt\",\r\n \"\\uf3fb\": \"tablet-android\",\r\n \"\\uf3fc\": \"tablet-android-alt\",\r\n \"\\uf3fd\": \"tachometer-alt\",\r\n \"\\uf3ff\": \"ticket-alt\",\r\n \"\\uf400\": \"tree-alt\",\r\n \"\\uf401\": \"tv-retro\",\r\n \"\\uf406\": \"user-alt\",\r\n \"\\uf40e\": \"window\",\r\n \"\\uf40f\": \"window-alt\",\r\n \"\\uf410\": \"window-close\",\r\n \"\\uf422\": \"compress-alt\",\r\n \"\\uf424\": \"expand-alt\",\r\n \"\\uf432\": \"baseball\",\r\n \"\\uf433\": \"baseball-ball\",\r\n \"\\uf434\": \"basketball-ball\",\r\n \"\\uf435\": \"basketball-hoop\",\r\n \"\\uf436\": \"bowling-ball\",\r\n \"\\uf437\": \"bowling-pins\",\r\n \"\\uf438\": \"boxing-glove\",\r\n \"\\uf439\": \"chess\",\r\n \"\\uf43a\": \"chess-bishop\",\r\n \"\\uf43b\": \"chess-bishop-alt\",\r\n \"\\uf43c\": \"chess-board\",\r\n \"\\uf43d\": \"chess-clock\",\r\n \"\\uf43e\": \"chess-clock-alt\",\r\n \"\\uf43f\": \"chess-king\",\r\n \"\\uf440\": \"chess-king-alt\",\r\n \"\\uf441\": \"chess-knight\",\r\n \"\\uf442\": \"chess-knight-alt\",\r\n \"\\uf443\": \"chess-pawn\",\r\n \"\\uf444\": \"chess-pawn-alt\",\r\n \"\\uf445\": \"chess-queen\",\r\n \"\\uf446\": \"chess-queen-alt\",\r\n \"\\uf447\": \"chess-rook\",\r\n \"\\uf448\": \"chess-rook-alt\",\r\n \"\\uf449\": \"cricket\",\r\n \"\\uf44a\": \"curling\",\r\n \"\\uf44b\": \"dumbbell\",\r\n \"\\uf44c\": \"field-hockey\",\r\n \"\\uf44e\": \"football-ball\",\r\n \"\\uf44f\": \"football-helmet\",\r\n \"\\uf450\": \"golf-ball\",\r\n \"\\uf451\": \"golf-club\",\r\n \"\\uf453\": \"hockey-puck\",\r\n \"\\uf454\": \"hockey-sticks\",\r\n \"\\uf455\": \"luchador\",\r\n \"\\uf456\": \"pennant\",\r\n \"\\uf458\": \"quidditch\",\r\n \"\\uf45a\": \"racquet\",\r\n \"\\uf45b\": \"shuttlecock\",\r\n \"\\uf45c\": \"square-full\",\r\n \"\\uf45d\": \"table-tennis\",\r\n \"\\uf45e\": \"tennis-ball\",\r\n \"\\uf45f\": \"volleyball-ball\",\r\n \"\\uf460\": \"whistle\",\r\n \"\\uf461\": \"allergies\",\r\n \"\\uf462\": \"band-aid\",\r\n \"\\uf463\": \"barcode-alt\",\r\n \"\\uf464\": \"barcode-read\",\r\n \"\\uf465\": \"barcode-scan\",\r\n \"\\uf466\": \"box\",\r\n \"\\uf467\": \"box-check\",\r\n \"\\uf468\": \"boxes\",\r\n \"\\uf469\": \"briefcase-medical\",\r\n \"\\uf46a\": \"burn\",\r\n \"\\uf46b\": \"capsules\",\r\n \"\\uf46c\": \"clipboard-check\",\r\n \"\\uf46d\": \"clipboard-list\",\r\n \"\\uf46e\": \"conveyor-belt\",\r\n \"\\uf46f\": \"conveyor-belt-alt\",\r\n \"\\uf470\": \"diagnoses\",\r\n \"\\uf471\": \"dna\",\r\n \"\\uf472\": \"dolly\",\r\n \"\\uf473\": \"dolly-empty\",\r\n \"\\uf474\": \"dolly-flatbed\",\r\n \"\\uf475\": \"dolly-flatbed-alt\",\r\n \"\\uf476\": \"dolly-flatbed-empty\",\r\n \"\\uf477\": \"file-medical\",\r\n \"\\uf478\": \"file-medical-alt\",\r\n \"\\uf479\": \"first-aid\",\r\n \"\\uf47a\": \"forklift\",\r\n \"\\uf47b\": \"hand-holding-box\",\r\n \"\\uf47c\": \"hand-receiving\",\r\n \"\\uf47d\": \"hospital-alt\",\r\n \"\\uf47e\": \"hospital-symbol\",\r\n \"\\uf47f\": \"id-card-alt\",\r\n \"\\uf480\": \"inventory\",\r\n \"\\uf481\": \"notes-medical\",\r\n \"\\uf482\": \"pallet\",\r\n \"\\uf483\": \"pallet-alt\",\r\n \"\\uf484\": \"pills\",\r\n \"\\uf485\": \"prescription-bottle\",\r\n \"\\uf486\": \"prescription-bottle-alt\",\r\n \"\\uf487\": \"procedures\",\r\n \"\\uf488\": \"scanner\",\r\n \"\\uf489\": \"scanner-keyboard\",\r\n \"\\uf48a\": \"scanner-touchscreen\",\r\n \"\\uf48b\": \"shipping-fast\",\r\n \"\\uf48c\": \"shipping-timed\",\r\n \"\\uf48d\": \"smoking\",\r\n \"\\uf48e\": \"syringe\",\r\n \"\\uf48f\": \"tablet-rugged\",\r\n \"\\uf490\": \"tablets\",\r\n \"\\uf491\": \"thermometer\",\r\n \"\\uf492\": \"vial\",\r\n \"\\uf493\": \"vials\",\r\n \"\\uf494\": \"warehouse\",\r\n \"\\uf495\": \"warehouse-alt\",\r\n \"\\uf496\": \"weight\",\r\n \"\\uf497\": \"x-ray\",\r\n \"\\uf498\": \"blanket\",\r\n \"\\uf499\": \"book-heart\",\r\n \"\\uf49a\": \"box-alt\",\r\n \"\\uf49b\": \"box-fragile\",\r\n \"\\uf49c\": \"box-full\",\r\n \"\\uf49d\": \"box-heart\",\r\n \"\\uf49e\": \"box-open\",\r\n \"\\uf49f\": \"box-up\",\r\n \"\\uf4a0\": \"box-usd\",\r\n \"\\uf4a1\": \"boxes-alt\",\r\n \"\\uf4a2\": \"comment-alt-check\",\r\n \"\\uf4a3\": \"comment-alt-dots\",\r\n \"\\uf4a4\": \"comment-alt-edit\",\r\n \"\\uf4a5\": \"comment-alt-exclamation\",\r\n \"\\uf4a6\": \"comment-alt-lines\",\r\n \"\\uf4a7\": \"comment-alt-minus\",\r\n \"\\uf4a8\": \"comment-alt-plus\",\r\n \"\\uf4a9\": \"comment-alt-slash\",\r\n \"\\uf4aa\": \"comment-alt-smile\",\r\n \"\\uf4ab\": \"comment-alt-times\",\r\n \"\\uf4ac\": \"comment-check\",\r\n \"\\uf4ad\": \"comment-dots\",\r\n \"\\uf4ae\": \"comment-edit\",\r\n \"\\uf4af\": \"comment-exclamation\",\r\n \"\\uf4b0\": \"comment-lines\",\r\n \"\\uf4b1\": \"comment-minus\",\r\n \"\\uf4b2\": \"comment-plus\",\r\n \"\\uf4b3\": \"comment-slash\",\r\n \"\\uf4b4\": \"comment-smile\",\r\n \"\\uf4b5\": \"comment-times\",\r\n \"\\uf4b6\": \"comments-alt\",\r\n \"\\uf4b7\": \"container-storage\",\r\n \"\\uf4b8\": \"couch\",\r\n \"\\uf4b9\": \"donate\",\r\n \"\\uf4ba\": \"dove\",\r\n \"\\uf4bb\": \"fragile\",\r\n \"\\uf4bc\": \"hand-heart\",\r\n \"\\uf4bd\": \"hand-holding\",\r\n \"\\uf4be\": \"hand-holding-heart\",\r\n \"\\uf4bf\": \"hand-holding-seedling\",\r\n \"\\uf4c0\": \"hand-holding-usd\",\r\n \"\\uf4c1\": \"hand-holding-water\",\r\n \"\\uf4c2\": \"hands\",\r\n \"\\uf4c3\": \"hands-heart\",\r\n \"\\uf4c4\": \"hands-helping\",\r\n \"\\uf4c5\": \"hands-usd\",\r\n \"\\uf4c6\": \"handshake-alt\",\r\n \"\\uf4c7\": \"heart-circle\",\r\n \"\\uf4c8\": \"heart-square\",\r\n \"\\uf4c9\": \"home-heart\",\r\n \"\\uf4ca\": \"lamp\",\r\n \"\\uf4cb\": \"leaf-heart\",\r\n \"\\uf4cc\": \"loveseat\",\r\n \"\\uf4cd\": \"parachute-box\",\r\n \"\\uf4ce\": \"people-carry\",\r\n \"\\uf4cf\": \"person-carry\",\r\n \"\\uf4d0\": \"person-dolly\",\r\n \"\\uf4d1\": \"person-dolly-empty\",\r\n \"\\uf4d2\": \"phone-plus\",\r\n \"\\uf4d3\": \"piggy-bank\",\r\n \"\\uf4d4\": \"ramp-loading\",\r\n \"\\uf4d6\": \"ribbon\",\r\n \"\\uf4d7\": \"route\",\r\n \"\\uf4d8\": \"seedling\",\r\n \"\\uf4d9\": \"sign\",\r\n \"\\uf4da\": \"smile-wink\",\r\n \"\\uf4db\": \"tape\",\r\n \"\\uf4dc\": \"truck-container\",\r\n \"\\uf4dd\": \"truck-couch\",\r\n \"\\uf4de\": \"truck-loading\",\r\n \"\\uf4df\": \"truck-moving\",\r\n \"\\uf4e0\": \"truck-ramp\",\r\n \"\\uf4e1\": \"video-plus\",\r\n \"\\uf4e2\": \"video-slash\",\r\n \"\\uf4e3\": \"wine-glass\",\r\n \"\\uf4fa\": \"user-alt-slash\",\r\n \"\\uf4fb\": \"user-astronaut\",\r\n \"\\uf4fc\": \"user-check\",\r\n \"\\uf4fd\": \"user-clock\",\r\n \"\\uf4fe\": \"user-cog\",\r\n \"\\uf4ff\": \"user-edit\",\r\n \"\\uf500\": \"user-friends\",\r\n \"\\uf501\": \"user-graduate\",\r\n \"\\uf502\": \"user-lock\",\r\n \"\\uf503\": \"user-minus\",\r\n \"\\uf504\": \"user-ninja\",\r\n \"\\uf505\": \"user-shield\",\r\n \"\\uf506\": \"user-slash\",\r\n \"\\uf507\": \"user-tag\",\r\n \"\\uf508\": \"user-tie\",\r\n \"\\uf509\": \"users-cog\",\r\n \"\\uf515\": \"balance-scale-left\",\r\n \"\\uf516\": \"balance-scale-right\",\r\n \"\\uf517\": \"blender\",\r\n \"\\uf518\": \"book-open\",\r\n \"\\uf519\": \"broadcast-tower\",\r\n \"\\uf51a\": \"broom\",\r\n \"\\uf51b\": \"chalkboard\",\r\n \"\\uf51c\": \"chalkboard-teacher\",\r\n \"\\uf51d\": \"church\",\r\n \"\\uf51e\": \"coins\",\r\n \"\\uf51f\": \"compact-disc\",\r\n \"\\uf520\": \"crow\",\r\n \"\\uf521\": \"crown\",\r\n \"\\uf522\": \"dice\",\r\n \"\\uf523\": \"dice-five\",\r\n \"\\uf524\": \"dice-four\",\r\n \"\\uf525\": \"dice-one\",\r\n \"\\uf526\": \"dice-six\",\r\n \"\\uf527\": \"dice-three\",\r\n \"\\uf528\": \"dice-two\",\r\n \"\\uf529\": \"divide\",\r\n \"\\uf52a\": \"door-closed\",\r\n \"\\uf52b\": \"door-open\",\r\n \"\\uf52c\": \"equals\",\r\n \"\\uf52d\": \"feather\",\r\n \"\\uf52e\": \"frog\",\r\n \"\\uf52f\": \"gas-pump\",\r\n \"\\uf530\": \"glasses\",\r\n \"\\uf531\": \"greater-than\",\r\n \"\\uf532\": \"greater-than-equal\",\r\n \"\\uf533\": \"helicopter\",\r\n \"\\uf534\": \"infinity\",\r\n \"\\uf535\": \"kiwi-bird\",\r\n \"\\uf536\": \"less-than\",\r\n \"\\uf537\": \"less-than-equal\",\r\n \"\\uf538\": \"memory\",\r\n \"\\uf539\": \"microphone-alt-slash\",\r\n \"\\uf53a\": \"money-bill-wave\",\r\n \"\\uf53b\": \"money-bill-wave-alt\",\r\n \"\\uf53c\": \"money-check\",\r\n \"\\uf53d\": \"money-check-alt\",\r\n \"\\uf53e\": \"not-equal\",\r\n \"\\uf53f\": \"palette\",\r\n \"\\uf540\": \"parking\",\r\n \"\\uf541\": \"percentage\",\r\n \"\\uf542\": \"project-diagram\",\r\n \"\\uf543\": \"receipt\",\r\n \"\\uf544\": \"robot\",\r\n \"\\uf545\": \"ruler\",\r\n \"\\uf546\": \"ruler-combined\",\r\n \"\\uf547\": \"ruler-horizontal\",\r\n \"\\uf548\": \"ruler-vertical\",\r\n \"\\uf549\": \"school\",\r\n \"\\uf54a\": \"screwdriver\",\r\n \"\\uf54b\": \"shoe-prints\",\r\n \"\\uf54c\": \"skull\",\r\n \"\\uf54d\": \"smoking-ban\",\r\n \"\\uf54e\": \"store\",\r\n \"\\uf54f\": \"store-alt\",\r\n \"\\uf550\": \"stream\",\r\n \"\\uf551\": \"stroopwafel\",\r\n \"\\uf552\": \"toolbox\",\r\n \"\\uf553\": \"tshirt\",\r\n \"\\uf554\": \"walking\",\r\n \"\\uf555\": \"wallet\",\r\n \"\\uf556\": \"angry\",\r\n \"\\uf557\": \"archway\",\r\n \"\\uf558\": \"atlas\",\r\n \"\\uf559\": \"award\",\r\n \"\\uf55a\": \"backspace\",\r\n \"\\uf55b\": \"bezier-curve\",\r\n \"\\uf55c\": \"bong\",\r\n \"\\uf55d\": \"brush\",\r\n \"\\uf55e\": \"bus-alt\",\r\n \"\\uf55f\": \"cannabis\",\r\n \"\\uf560\": \"check-double\",\r\n \"\\uf561\": \"cocktail\",\r\n \"\\uf562\": \"concierge-bell\",\r\n \"\\uf563\": \"cookie\",\r\n \"\\uf564\": \"cookie-bite\",\r\n \"\\uf565\": \"crop-alt\",\r\n \"\\uf566\": \"digital-tachograph\",\r\n \"\\uf567\": \"dizzy\",\r\n \"\\uf568\": \"drafting-compass\",\r\n \"\\uf569\": \"drum\",\r\n \"\\uf56a\": \"drum-steelpan\",\r\n \"\\uf56b\": \"feather-alt\",\r\n \"\\uf56c\": \"file-contract\",\r\n \"\\uf56d\": \"file-download\",\r\n \"\\uf56e\": \"file-export\",\r\n \"\\uf56f\": \"file-import\",\r\n \"\\uf570\": \"file-invoice\",\r\n \"\\uf571\": \"file-invoice-dollar\",\r\n \"\\uf572\": \"file-prescription\",\r\n \"\\uf573\": \"file-signature\",\r\n \"\\uf574\": \"file-upload\",\r\n \"\\uf575\": \"fill\",\r\n \"\\uf576\": \"fill-drip\",\r\n \"\\uf577\": \"fingerprint\",\r\n \"\\uf578\": \"fish\",\r\n \"\\uf579\": \"flushed\",\r\n \"\\uf57a\": \"frown-open\",\r\n \"\\uf57b\": \"glass-martini-alt\",\r\n \"\\uf57c\": \"globe-africa\",\r\n \"\\uf57d\": \"globe-americas\",\r\n \"\\uf57e\": \"globe-asia\",\r\n \"\\uf57f\": \"grimace\",\r\n \"\\uf580\": \"grin\",\r\n \"\\uf581\": \"grin-alt\",\r\n \"\\uf582\": \"grin-beam\",\r\n \"\\uf583\": \"grin-beam-sweat\",\r\n \"\\uf584\": \"grin-hearts\",\r\n \"\\uf585\": \"grin-squint\",\r\n \"\\uf586\": \"grin-squint-tears\",\r\n \"\\uf587\": \"grin-stars\",\r\n \"\\uf588\": \"grin-tears\",\r\n \"\\uf589\": \"grin-tongue\",\r\n \"\\uf58a\": \"grin-tongue-squint\",\r\n \"\\uf58b\": \"grin-tongue-wink\",\r\n \"\\uf58c\": \"grin-wink\",\r\n \"\\uf58d\": \"grip-horizontal\",\r\n \"\\uf58e\": \"grip-vertical\",\r\n \"\\uf58f\": \"headphones-alt\",\r\n \"\\uf590\": \"headset\",\r\n \"\\uf591\": \"highlighter\",\r\n \"\\uf593\": \"hot-tub\",\r\n \"\\uf594\": \"hotel\",\r\n \"\\uf595\": \"joint\",\r\n \"\\uf596\": \"kiss\",\r\n \"\\uf597\": \"kiss-beam\",\r\n \"\\uf598\": \"kiss-wink-heart\",\r\n \"\\uf599\": \"laugh\",\r\n \"\\uf59a\": \"laugh-beam\",\r\n \"\\uf59b\": \"laugh-squint\",\r\n \"\\uf59c\": \"laugh-wink\",\r\n \"\\uf59d\": \"luggage-cart\",\r\n \"\\uf59f\": \"map-marked\",\r\n \"\\uf5a0\": \"map-marked-alt\",\r\n \"\\uf5a1\": \"marker\",\r\n \"\\uf5a2\": \"medal\",\r\n \"\\uf5a4\": \"meh-blank\",\r\n \"\\uf5a5\": \"meh-rolling-eyes\",\r\n \"\\uf5a6\": \"monument\",\r\n \"\\uf5a7\": \"mortar-pestle\",\r\n \"\\uf5a9\": \"paint-brush-alt\",\r\n \"\\uf5aa\": \"paint-roller\",\r\n \"\\uf5ab\": \"passport\",\r\n \"\\uf5ac\": \"pen-fancy\",\r\n \"\\uf5ad\": \"pen-nib\",\r\n \"\\uf5ae\": \"pencil-ruler\",\r\n \"\\uf5af\": \"plane-arrival\",\r\n \"\\uf5b0\": \"plane-departure\",\r\n \"\\uf5b1\": \"prescription\",\r\n \"\\uf5b3\": \"sad-cry\",\r\n \"\\uf5b4\": \"sad-tear\",\r\n \"\\uf5b6\": \"shuttle-van\",\r\n \"\\uf5b7\": \"signature\",\r\n \"\\uf5b8\": \"smile-beam\",\r\n \"\\uf5b9\": \"smile-plus\",\r\n \"\\uf5ba\": \"solar-panel\",\r\n \"\\uf5bb\": \"spa\",\r\n \"\\uf5bc\": \"splotch\",\r\n \"\\uf5bd\": \"spray-can\",\r\n \"\\uf5bf\": \"stamp\",\r\n \"\\uf5c0\": \"star-half-alt\",\r\n \"\\uf5c1\": \"suitcase-rolling\",\r\n \"\\uf5c2\": \"surprise\",\r\n \"\\uf5c3\": \"swatchbook\",\r\n \"\\uf5c4\": \"swimmer\",\r\n \"\\uf5c5\": \"swimming-pool\",\r\n \"\\uf5c7\": \"tint-slash\",\r\n \"\\uf5c8\": \"tired\",\r\n \"\\uf5c9\": \"tooth\",\r\n \"\\uf5ca\": \"umbrella-beach\",\r\n \"\\uf5cb\": \"vector-square\",\r\n \"\\uf5cd\": \"weight-hanging\",\r\n \"\\uf5ce\": \"wine-glass-alt\",\r\n \"\\uf5d0\": \"air-freshener\",\r\n \"\\uf5d1\": \"apple-alt\",\r\n \"\\uf5d2\": \"atom\",\r\n \"\\uf5d3\": \"atom-alt\",\r\n \"\\uf5d4\": \"backpack\",\r\n \"\\uf5d5\": \"bell-school\",\r\n \"\\uf5d6\": \"bell-school-slash\",\r\n \"\\uf5d7\": \"bone\",\r\n \"\\uf5d8\": \"bone-break\",\r\n \"\\uf5d9\": \"book-alt\",\r\n \"\\uf5da\": \"book-reader\",\r\n \"\\uf5db\": \"books\",\r\n \"\\uf5dc\": \"brain\",\r\n \"\\uf5dd\": \"bus-school\",\r\n \"\\uf5de\": \"car-alt\",\r\n \"\\uf5df\": \"car-battery\",\r\n \"\\uf5e0\": \"car-bump\",\r\n \"\\uf5e1\": \"car-crash\",\r\n \"\\uf5e2\": \"car-garage\",\r\n \"\\uf5e3\": \"car-mechanic\",\r\n \"\\uf5e4\": \"car-side\",\r\n \"\\uf5e5\": \"car-tilt\",\r\n \"\\uf5e6\": \"car-wash\",\r\n \"\\uf5e7\": \"charging-station\",\r\n \"\\uf5e8\": \"clipboard-prescription\",\r\n \"\\uf5e9\": \"compass-slash\",\r\n \"\\uf5ea\": \"diploma\",\r\n \"\\uf5eb\": \"directions\",\r\n \"\\uf5ec\": \"do-not-enter\",\r\n \"\\uf5ed\": \"draw-circle\",\r\n \"\\uf5ee\": \"draw-polygon\",\r\n \"\\uf5ef\": \"draw-square\",\r\n \"\\uf5f0\": \"ear\",\r\n \"\\uf5f2\": \"engine-warning\",\r\n \"\\uf5f3\": \"file-certificate\",\r\n \"\\uf5f4\": \"gas-pump-slash\",\r\n \"\\uf5f5\": \"glasses-alt\",\r\n \"\\uf5f6\": \"globe-stand\",\r\n \"\\uf5f8\": \"heart-rate\",\r\n \"\\uf5f9\": \"inhaler\",\r\n \"\\uf5fb\": \"kidneys\",\r\n \"\\uf5fc\": \"laptop-code\",\r\n \"\\uf5fd\": \"layer-group\",\r\n \"\\uf5fe\": \"layer-minus\",\r\n \"\\uf5ff\": \"layer-plus\",\r\n \"\\uf600\": \"lips\",\r\n \"\\uf601\": \"location\",\r\n \"\\uf602\": \"location-circle\",\r\n \"\\uf603\": \"location-slash\",\r\n \"\\uf604\": \"lungs\",\r\n \"\\uf605\": \"map-marker-alt-slash\",\r\n \"\\uf606\": \"map-marker-check\",\r\n \"\\uf607\": \"map-marker-edit\",\r\n \"\\uf608\": \"map-marker-exclamation\",\r\n \"\\uf609\": \"map-marker-minus\",\r\n \"\\uf60a\": \"map-marker-plus\",\r\n \"\\uf60b\": \"map-marker-question\",\r\n \"\\uf60c\": \"map-marker-slash\",\r\n \"\\uf60d\": \"map-marker-smile\",\r\n \"\\uf60e\": \"map-marker-times\",\r\n \"\\uf610\": \"microscope\",\r\n \"\\uf611\": \"monitor-heart-rate\",\r\n \"\\uf613\": \"oil-can\",\r\n \"\\uf614\": \"oil-temp\",\r\n \"\\uf615\": \"parking-circle\",\r\n \"\\uf616\": \"parking-circle-slash\",\r\n \"\\uf617\": \"parking-slash\",\r\n \"\\uf618\": \"pencil-paintbrush\",\r\n \"\\uf619\": \"poop\",\r\n \"\\uf61a\": \"route-highway\",\r\n \"\\uf61b\": \"route-interstate\",\r\n \"\\uf61c\": \"ruler-triangle\",\r\n \"\\uf61d\": \"scalpel\",\r\n \"\\uf61e\": \"scalpel-path\",\r\n \"\\uf61f\": \"shapes\",\r\n \"\\uf620\": \"skeleton\",\r\n \"\\uf621\": \"star-of-life\",\r\n \"\\uf622\": \"steering-wheel\",\r\n \"\\uf623\": \"stomach\",\r\n \"\\uf624\": \"tachometer-alt-average\",\r\n \"\\uf625\": \"tachometer-alt-fast\",\r\n \"\\uf626\": \"tachometer-alt-fastest\",\r\n \"\\uf627\": \"tachometer-alt-slow\",\r\n \"\\uf628\": \"tachometer-alt-slowest\",\r\n \"\\uf629\": \"tachometer-average\",\r\n \"\\uf62a\": \"tachometer-fast\",\r\n \"\\uf62b\": \"tachometer-fastest\",\r\n \"\\uf62c\": \"tachometer-slow\",\r\n \"\\uf62d\": \"tachometer-slowest\",\r\n \"\\uf62e\": \"teeth\",\r\n \"\\uf62f\": \"teeth-open\",\r\n \"\\uf630\": \"theater-masks\",\r\n \"\\uf631\": \"tire\",\r\n \"\\uf632\": \"tire-flat\",\r\n \"\\uf633\": \"tire-pressure-warning\",\r\n \"\\uf634\": \"tire-rugged\",\r\n \"\\uf635\": \"toothbrush\",\r\n \"\\uf636\": \"traffic-cone\",\r\n \"\\uf637\": \"traffic-light\",\r\n \"\\uf638\": \"traffic-light-go\",\r\n \"\\uf639\": \"traffic-light-slow\",\r\n \"\\uf63a\": \"traffic-light-stop\",\r\n \"\\uf63b\": \"truck-monster\",\r\n \"\\uf63c\": \"truck-pickup\",\r\n \"\\uf63d\": \"users-class\",\r\n \"\\uf63e\": \"watch-fitness\",\r\n \"\\uf640\": \"abacus\",\r\n \"\\uf641\": \"ad\",\r\n \"\\uf643\": \"analytics\",\r\n \"\\uf644\": \"ankh\",\r\n \"\\uf645\": \"badge-dollar\",\r\n \"\\uf646\": \"badge-percent\",\r\n \"\\uf647\": \"bible\",\r\n \"\\uf648\": \"bullseye-arrow\",\r\n \"\\uf649\": \"bullseye-pointer\",\r\n \"\\uf64a\": \"business-time\",\r\n \"\\uf64b\": \"cabinet-filing\",\r\n \"\\uf64c\": \"calculator-alt\",\r\n \"\\uf64d\": \"chart-line-down\",\r\n \"\\uf64e\": \"chart-pie-alt\",\r\n \"\\uf64f\": \"city\",\r\n \"\\uf650\": \"comment-alt-dollar\",\r\n \"\\uf651\": \"comment-dollar\",\r\n \"\\uf652\": \"comments-alt-dollar\",\r\n \"\\uf653\": \"comments-dollar\",\r\n \"\\uf654\": \"cross\",\r\n \"\\uf655\": \"dharmachakra\",\r\n \"\\uf656\": \"empty-set\",\r\n \"\\uf657\": \"envelope-open-dollar\",\r\n \"\\uf658\": \"envelope-open-text\",\r\n \"\\uf659\": \"file-chart-line\",\r\n \"\\uf65a\": \"file-chart-pie\",\r\n \"\\uf65b\": \"file-spreadsheet\",\r\n \"\\uf65c\": \"file-user\",\r\n \"\\uf65d\": \"folder-minus\",\r\n \"\\uf65e\": \"folder-plus\",\r\n \"\\uf65f\": \"folder-times\",\r\n \"\\uf660\": \"folders\",\r\n \"\\uf661\": \"function\",\r\n \"\\uf662\": \"funnel-dollar\",\r\n \"\\uf663\": \"gift-card\",\r\n \"\\uf664\": \"gopuram\",\r\n \"\\uf665\": \"hamsa\",\r\n \"\\uf666\": \"haykal\",\r\n \"\\uf667\": \"integral\",\r\n \"\\uf668\": \"intersection\",\r\n \"\\uf669\": \"jedi\",\r\n \"\\uf66a\": \"journal-whills\",\r\n \"\\uf66b\": \"kaaba\",\r\n \"\\uf66c\": \"keynote\",\r\n \"\\uf66d\": \"khanda\",\r\n \"\\uf66e\": \"lambda\",\r\n \"\\uf66f\": \"landmark\",\r\n \"\\uf670\": \"lightbulb-dollar\",\r\n \"\\uf671\": \"lightbulb-exclamation\",\r\n \"\\uf672\": \"lightbulb-on\",\r\n \"\\uf673\": \"lightbulb-slash\",\r\n \"\\uf674\": \"mail-bulk\",\r\n \"\\uf675\": \"megaphone\",\r\n \"\\uf676\": \"menorah\",\r\n \"\\uf677\": \"mind-share\",\r\n \"\\uf678\": \"mosque\",\r\n \"\\uf679\": \"om\",\r\n \"\\uf67a\": \"omega\",\r\n \"\\uf67b\": \"pastafarianism\",\r\n \"\\uf67c\": \"peace\",\r\n \"\\uf67d\": \"phone-office\",\r\n \"\\uf67e\": \"pi\",\r\n \"\\uf67f\": \"place-of-worship\",\r\n \"\\uf680\": \"podium\",\r\n \"\\uf681\": \"poll\",\r\n \"\\uf682\": \"poll-h\",\r\n \"\\uf683\": \"pray\",\r\n \"\\uf684\": \"praying-hands\",\r\n \"\\uf685\": \"presentation\",\r\n \"\\uf686\": \"print-slash\",\r\n \"\\uf687\": \"quran\",\r\n \"\\uf688\": \"search-dollar\",\r\n \"\\uf689\": \"search-location\",\r\n \"\\uf68a\": \"shredder\",\r\n \"\\uf68b\": \"sigma\",\r\n \"\\uf68c\": \"signal-1\",\r\n \"\\uf68d\": \"signal-2\",\r\n \"\\uf68e\": \"signal-3\",\r\n \"\\uf68f\": \"signal-4\",\r\n \"\\uf690\": \"signal-alt\",\r\n \"\\uf691\": \"signal-alt-1\",\r\n \"\\uf692\": \"signal-alt-2\",\r\n \"\\uf693\": \"signal-alt-3\",\r\n \"\\uf694\": \"signal-alt-slash\",\r\n \"\\uf695\": \"signal-slash\",\r\n \"\\uf696\": \"socks\",\r\n \"\\uf697\": \"square-root\",\r\n \"\\uf698\": \"square-root-alt\",\r\n \"\\uf699\": \"star-and-crescent\",\r\n \"\\uf69a\": \"star-of-david\",\r\n \"\\uf69b\": \"synagogue\",\r\n \"\\uf69c\": \"tally\",\r\n \"\\uf69e\": \"theta\",\r\n \"\\uf69f\": \"tilde\",\r\n \"\\uf6a0\": \"torah\",\r\n \"\\uf6a1\": \"torii-gate\",\r\n \"\\uf6a2\": \"union\",\r\n \"\\uf6a3\": \"user-chart\",\r\n \"\\uf6a4\": \"user-crown\",\r\n \"\\uf6a5\": \"users-crown\",\r\n \"\\uf6a6\": \"value-absolute\",\r\n \"\\uf6a7\": \"vihara\",\r\n \"\\uf6a8\": \"volume\",\r\n \"\\uf6a9\": \"volume-mute\",\r\n \"\\uf6aa\": \"wifi-1\",\r\n \"\\uf6ab\": \"wifi-2\",\r\n \"\\uf6ac\": \"wifi-slash\",\r\n \"\\uf6ad\": \"yin-yang\",\r\n \"\\uf6ae\": \"acorn\",\r\n \"\\uf6b0\": \"alicorn\",\r\n \"\\uf6b1\": \"apple-crate\",\r\n \"\\uf6b2\": \"axe\",\r\n \"\\uf6b3\": \"axe-battle\",\r\n \"\\uf6b4\": \"badger-honey\",\r\n \"\\uf6b5\": \"bat\",\r\n \"\\uf6b6\": \"blender-phone\",\r\n \"\\uf6b7\": \"book-dead\",\r\n \"\\uf6b8\": \"book-spells\",\r\n \"\\uf6b9\": \"bow-arrow\",\r\n \"\\uf6ba\": \"campfire\",\r\n \"\\uf6bb\": \"campground\",\r\n \"\\uf6bc\": \"candle-holder\",\r\n \"\\uf6bd\": \"candy-corn\",\r\n \"\\uf6be\": \"cat\",\r\n \"\\uf6bf\": \"cauldron\",\r\n \"\\uf6c0\": \"chair\",\r\n \"\\uf6c1\": \"chair-office\",\r\n \"\\uf6c2\": \"claw-marks\",\r\n \"\\uf6c3\": \"cloud-moon\",\r\n \"\\uf6c4\": \"cloud-sun\",\r\n \"\\uf6c5\": \"coffee-togo\",\r\n \"\\uf6c6\": \"coffin\",\r\n \"\\uf6c7\": \"corn\",\r\n \"\\uf6c8\": \"cow\",\r\n \"\\uf6cb\": \"dagger\",\r\n \"\\uf6cd\": \"dice-d10\",\r\n \"\\uf6ce\": \"dice-d12\",\r\n \"\\uf6cf\": \"dice-d20\",\r\n \"\\uf6d0\": \"dice-d4\",\r\n \"\\uf6d1\": \"dice-d6\",\r\n \"\\uf6d2\": \"dice-d8\",\r\n \"\\uf6d3\": \"dog\",\r\n \"\\uf6d4\": \"dog-leashed\",\r\n \"\\uf6d5\": \"dragon\",\r\n \"\\uf6d6\": \"drumstick\",\r\n \"\\uf6d7\": \"drumstick-bite\",\r\n \"\\uf6d8\": \"duck\",\r\n \"\\uf6d9\": \"dungeon\",\r\n \"\\uf6da\": \"elephant\",\r\n \"\\uf6db\": \"eye-evil\",\r\n \"\\uf6dd\": \"file-csv\",\r\n \"\\uf6de\": \"fist-raised\",\r\n \"\\uf6df\": \"flame\",\r\n \"\\uf6e0\": \"flask-poison\",\r\n \"\\uf6e1\": \"flask-potion\",\r\n \"\\uf6e2\": \"ghost\",\r\n \"\\uf6e3\": \"hammer\",\r\n \"\\uf6e4\": \"hammer-war\",\r\n \"\\uf6e5\": \"hand-holding-magic\",\r\n \"\\uf6e6\": \"hanukiah\",\r\n \"\\uf6e7\": \"hat-witch\",\r\n \"\\uf6e8\": \"hat-wizard\",\r\n \"\\uf6e9\": \"head-side\",\r\n \"\\uf6ea\": \"head-vr\",\r\n \"\\uf6eb\": \"helmet-battle\",\r\n \"\\uf6ec\": \"hiking\",\r\n \"\\uf6ed\": \"hippo\",\r\n \"\\uf6ee\": \"hockey-mask\",\r\n \"\\uf6ef\": \"hood-cloak\",\r\n \"\\uf6f0\": \"horse\",\r\n \"\\uf6f1\": \"house-damage\",\r\n \"\\uf6f2\": \"hryvnia\",\r\n \"\\uf6f3\": \"key-skeleton\",\r\n \"\\uf6f4\": \"kite\",\r\n \"\\uf6f5\": \"knife-kitchen\",\r\n \"\\uf6f6\": \"leaf-maple\",\r\n \"\\uf6f7\": \"leaf-oak\",\r\n \"\\uf6f8\": \"mace\",\r\n \"\\uf6f9\": \"mandolin\",\r\n \"\\uf6fa\": \"mask\",\r\n \"\\uf6fb\": \"monkey\",\r\n \"\\uf6fc\": \"mountain\",\r\n \"\\uf6fd\": \"mountains\",\r\n \"\\uf6fe\": \"narwhal\",\r\n \"\\uf6ff\": \"network-wired\",\r\n \"\\uf700\": \"otter\",\r\n \"\\uf701\": \"paw-alt\",\r\n \"\\uf702\": \"paw-claws\",\r\n \"\\uf703\": \"pegasus\",\r\n \"\\uf705\": \"pie\",\r\n \"\\uf706\": \"pig\",\r\n \"\\uf707\": \"pumpkin\",\r\n \"\\uf708\": \"rabbit\",\r\n \"\\uf709\": \"rabbit-fast\",\r\n \"\\uf70a\": \"ram\",\r\n \"\\uf70b\": \"ring\",\r\n \"\\uf70c\": \"running\",\r\n \"\\uf70d\": \"scarecrow\",\r\n \"\\uf70e\": \"scroll\",\r\n \"\\uf70f\": \"scroll-old\",\r\n \"\\uf710\": \"scythe\",\r\n \"\\uf711\": \"sheep\",\r\n \"\\uf712\": \"shield-cross\",\r\n \"\\uf713\": \"shovel\",\r\n \"\\uf714\": \"skull-crossbones\",\r\n \"\\uf715\": \"slash\",\r\n \"\\uf716\": \"snake\",\r\n \"\\uf717\": \"spider\",\r\n \"\\uf718\": \"spider-black-widow\",\r\n \"\\uf719\": \"spider-web\",\r\n \"\\uf71a\": \"squirrel\",\r\n \"\\uf71b\": \"staff\",\r\n \"\\uf71c\": \"sword\",\r\n \"\\uf71d\": \"swords\",\r\n \"\\uf71e\": \"toilet-paper\",\r\n \"\\uf71f\": \"toilet-paper-alt\",\r\n \"\\uf720\": \"tombstone\",\r\n \"\\uf721\": \"tombstone-alt\",\r\n \"\\uf722\": \"tractor\",\r\n \"\\uf723\": \"treasure-chest\",\r\n \"\\uf724\": \"trees\",\r\n \"\\uf725\": \"turkey\",\r\n \"\\uf726\": \"turtle\",\r\n \"\\uf727\": \"unicorn\",\r\n \"\\uf728\": \"user-injured\",\r\n \"\\uf729\": \"vr-cardboard\",\r\n \"\\uf72a\": \"wand\",\r\n \"\\uf72b\": \"wand-magic\",\r\n \"\\uf72c\": \"whale\",\r\n \"\\uf72d\": \"wheat\",\r\n \"\\uf72e\": \"wind\",\r\n \"\\uf72f\": \"wine-bottle\",\r\n \"\\uf732\": \"ballot\",\r\n \"\\uf733\": \"ballot-check\",\r\n \"\\uf734\": \"booth-curtain\",\r\n \"\\uf735\": \"box-ballot\",\r\n \"\\uf736\": \"calendar-star\",\r\n \"\\uf737\": \"clipboard-list-check\",\r\n \"\\uf738\": \"cloud-drizzle\",\r\n \"\\uf739\": \"cloud-hail\",\r\n \"\\uf73a\": \"cloud-hail-mixed\",\r\n \"\\uf73b\": \"cloud-meatball\",\r\n \"\\uf73c\": \"cloud-moon-rain\",\r\n \"\\uf73d\": \"cloud-rain\",\r\n \"\\uf73e\": \"cloud-rainbow\",\r\n \"\\uf73f\": \"cloud-showers\",\r\n \"\\uf740\": \"cloud-showers-heavy\",\r\n \"\\uf741\": \"cloud-sleet\",\r\n \"\\uf742\": \"cloud-snow\",\r\n \"\\uf743\": \"cloud-sun-rain\",\r\n \"\\uf744\": \"clouds\",\r\n \"\\uf745\": \"clouds-moon\",\r\n \"\\uf746\": \"clouds-sun\",\r\n \"\\uf747\": \"democrat\",\r\n \"\\uf748\": \"dewpoint\",\r\n \"\\uf749\": \"eclipse\",\r\n \"\\uf74a\": \"eclipse-alt\",\r\n \"\\uf74b\": \"fire-smoke\",\r\n \"\\uf74c\": \"flag-alt\",\r\n \"\\uf74d\": \"flag-usa\",\r\n \"\\uf74e\": \"fog\",\r\n \"\\uf74f\": \"house-flood\",\r\n \"\\uf750\": \"humidity\",\r\n \"\\uf751\": \"hurricane\",\r\n \"\\uf752\": \"landmark-alt\",\r\n \"\\uf753\": \"meteor\",\r\n \"\\uf754\": \"moon-cloud\",\r\n \"\\uf755\": \"moon-stars\",\r\n \"\\uf756\": \"person-booth\",\r\n \"\\uf757\": \"person-sign\",\r\n \"\\uf758\": \"podium-star\",\r\n \"\\uf759\": \"poll-people\",\r\n \"\\uf75a\": \"poo-storm\",\r\n \"\\uf75b\": \"rainbow\",\r\n \"\\uf75c\": \"raindrops\",\r\n \"\\uf75e\": \"republican\",\r\n \"\\uf75f\": \"smog\",\r\n \"\\uf760\": \"smoke\",\r\n \"\\uf761\": \"snow-blowing\",\r\n \"\\uf762\": \"stars\",\r\n \"\\uf763\": \"sun-cloud\",\r\n \"\\uf764\": \"sun-dust\",\r\n \"\\uf765\": \"sun-haze\",\r\n \"\\uf766\": \"sunrise\",\r\n \"\\uf767\": \"sunset\",\r\n \"\\uf768\": \"temperature-frigid\",\r\n \"\\uf769\": \"temperature-high\",\r\n \"\\uf76a\": \"temperature-hot\",\r\n \"\\uf76b\": \"temperature-low\",\r\n \"\\uf76c\": \"thunderstorm\",\r\n \"\\uf76d\": \"thunderstorm-moon\",\r\n \"\\uf76e\": \"thunderstorm-sun\",\r\n \"\\uf76f\": \"tornado\",\r\n \"\\uf770\": \"volcano\",\r\n \"\\uf771\": \"vote-nay\",\r\n \"\\uf772\": \"vote-yea\",\r\n \"\\uf773\": \"water\",\r\n \"\\uf774\": \"water-lower\",\r\n \"\\uf775\": \"water-rise\",\r\n \"\\uf776\": \"wind-warning\",\r\n \"\\uf777\": \"windsock\",\r\n \"\\uf779\": \"angel\",\r\n \"\\uf77c\": \"baby\",\r\n \"\\uf77d\": \"baby-carriage\",\r\n \"\\uf77e\": \"ball-pile\",\r\n \"\\uf77f\": \"bells\",\r\n \"\\uf780\": \"biohazard\",\r\n \"\\uf781\": \"blog\",\r\n \"\\uf782\": \"boot\",\r\n \"\\uf783\": \"calendar-day\",\r\n \"\\uf784\": \"calendar-week\",\r\n \"\\uf786\": \"candy-cane\",\r\n \"\\uf787\": \"carrot\",\r\n \"\\uf788\": \"cash-register\",\r\n \"\\uf78a\": \"chart-network\",\r\n \"\\uf78b\": \"chimney\",\r\n \"\\uf78c\": \"compress-arrows-alt\",\r\n \"\\uf78e\": \"deer\",\r\n \"\\uf78f\": \"deer-rudolph\",\r\n \"\\uf792\": \"dreidel\",\r\n \"\\uf793\": \"dumpster\",\r\n \"\\uf794\": \"dumpster-fire\",\r\n \"\\uf795\": \"ear-muffs\",\r\n \"\\uf796\": \"ethernet\",\r\n \"\\uf79a\": \"fireplace\",\r\n \"\\uf79b\": \"frosty-head\",\r\n \"\\uf79c\": \"gifts\",\r\n \"\\uf79d\": \"gingerbread-man\",\r\n \"\\uf79e\": \"glass-champagne\",\r\n \"\\uf79f\": \"glass-cheers\",\r\n \"\\uf7a0\": \"glass-whiskey\",\r\n \"\\uf7a1\": \"glass-whiskey-rocks\",\r\n \"\\uf7a2\": \"globe-europe\",\r\n \"\\uf7a3\": \"globe-snow\",\r\n \"\\uf7a4\": \"grip-lines\",\r\n \"\\uf7a5\": \"grip-lines-vertical\",\r\n \"\\uf7a6\": \"guitar\",\r\n \"\\uf7a7\": \"hat-santa\",\r\n \"\\uf7a8\": \"hat-winter\",\r\n \"\\uf7a9\": \"heart-broken\",\r\n \"\\uf7aa\": \"holly-berry\",\r\n \"\\uf7ab\": \"horse-head\",\r\n \"\\uf7ac\": \"ice-skate\",\r\n \"\\uf7ad\": \"icicles\",\r\n \"\\uf7ae\": \"igloo\",\r\n \"\\uf7b2\": \"lights-holiday\",\r\n \"\\uf7b4\": \"mistletoe\",\r\n \"\\uf7b5\": \"mitten\",\r\n \"\\uf7b6\": \"mug-hot\",\r\n \"\\uf7b7\": \"mug-marshmallows\",\r\n \"\\uf7b8\": \"ornament\",\r\n \"\\uf7b9\": \"radiation\",\r\n \"\\uf7ba\": \"radiation-alt\",\r\n \"\\uf7bd\": \"restroom\",\r\n \"\\uf7be\": \"rv\",\r\n \"\\uf7bf\": \"satellite\",\r\n \"\\uf7c0\": \"satellite-dish\",\r\n \"\\uf7c1\": \"scarf\",\r\n \"\\uf7c2\": \"sd-card\",\r\n \"\\uf7c3\": \"shovel-snow\",\r\n \"\\uf7c4\": \"sim-card\",\r\n \"\\uf7c5\": \"skating\",\r\n \"\\uf7c7\": \"ski-jump\",\r\n \"\\uf7c8\": \"ski-lift\",\r\n \"\\uf7c9\": \"skiing\",\r\n \"\\uf7ca\": \"skiing-nordic\",\r\n \"\\uf7cb\": \"sledding\",\r\n \"\\uf7cc\": \"sleigh\",\r\n \"\\uf7cd\": \"sms\",\r\n \"\\uf7ce\": \"snowboarding\",\r\n \"\\uf7cf\": \"snowflakes\",\r\n \"\\uf7d0\": \"snowman\",\r\n \"\\uf7d1\": \"snowmobile\",\r\n \"\\uf7d2\": \"snowplow\",\r\n \"\\uf7d4\": \"star-christmas\",\r\n \"\\uf7d5\": \"stocking\",\r\n \"\\uf7d7\": \"tenge\",\r\n \"\\uf7d8\": \"toilet\",\r\n \"\\uf7d9\": \"tools\",\r\n \"\\uf7da\": \"tram\",\r\n \"\\uf7db\": \"tree-christmas\",\r\n \"\\uf7dc\": \"tree-decorated\",\r\n \"\\uf7dd\": \"tree-large\",\r\n \"\\uf7de\": \"truck-plow\",\r\n \"\\uf7e2\": \"wreath\",\r\n \"\\uf7e4\": \"fire-alt\",\r\n \"\\uf7e5\": \"bacon\",\r\n \"\\uf7e6\": \"book-medical\",\r\n \"\\uf7e7\": \"book-user\",\r\n \"\\uf7e8\": \"books-medical\",\r\n \"\\uf7e9\": \"brackets\",\r\n \"\\uf7ea\": \"brackets-curly\",\r\n \"\\uf7eb\": \"bread-loaf\",\r\n \"\\uf7ec\": \"bread-slice\",\r\n \"\\uf7ed\": \"burrito\",\r\n \"\\uf7ee\": \"chart-scatter\",\r\n \"\\uf7ef\": \"cheese\",\r\n \"\\uf7f0\": \"cheese-swiss\",\r\n \"\\uf7f1\": \"cheeseburger\",\r\n \"\\uf7f2\": \"clinic-medical\",\r\n \"\\uf7f3\": \"clipboard-user\",\r\n \"\\uf7f4\": \"comment-alt-medical\",\r\n \"\\uf7f5\": \"comment-medical\",\r\n \"\\uf7f6\": \"croissant\",\r\n \"\\uf7f7\": \"crutch\",\r\n \"\\uf7f8\": \"crutches\",\r\n \"\\uf7f9\": \"debug\",\r\n \"\\uf7fa\": \"disease\",\r\n \"\\uf7fb\": \"egg\",\r\n \"\\uf7fc\": \"egg-fried\",\r\n \"\\uf7fd\": \"files-medical\",\r\n \"\\uf7fe\": \"fish-cooked\",\r\n \"\\uf7ff\": \"flower\",\r\n \"\\uf800\": \"flower-daffodil\",\r\n \"\\uf801\": \"flower-tulip\",\r\n \"\\uf802\": \"folder-tree\",\r\n \"\\uf803\": \"french-fries\",\r\n \"\\uf804\": \"glass\",\r\n \"\\uf805\": \"hamburger\",\r\n \"\\uf806\": \"hand-middle-finger\",\r\n \"\\uf807\": \"hard-hat\",\r\n \"\\uf808\": \"head-side-brain\",\r\n \"\\uf809\": \"head-side-medical\",\r\n \"\\uf80a\": \"home-alt\",\r\n \"\\uf80b\": \"home-lg\",\r\n \"\\uf80c\": \"home-lg-alt\",\r\n \"\\uf80d\": \"hospital-user\",\r\n \"\\uf80e\": \"hospitals\",\r\n \"\\uf80f\": \"hotdog\",\r\n \"\\uf810\": \"ice-cream\",\r\n \"\\uf811\": \"island-tropical\",\r\n \"\\uf812\": \"laptop-medical\",\r\n \"\\uf813\": \"mailbox\",\r\n \"\\uf814\": \"meat\",\r\n \"\\uf815\": \"pager\",\r\n \"\\uf816\": \"pepper-hot\",\r\n \"\\uf817\": \"pizza\",\r\n \"\\uf818\": \"pizza-slice\",\r\n \"\\uf819\": \"popcorn\",\r\n \"\\uf81a\": \"print-search\",\r\n \"\\uf81b\": \"rings-wedding\",\r\n \"\\uf81c\": \"sack\",\r\n \"\\uf81d\": \"sack-dollar\",\r\n \"\\uf81e\": \"salad\",\r\n \"\\uf81f\": \"sandwich\",\r\n \"\\uf820\": \"sausage\",\r\n \"\\uf821\": \"shish-kebab\",\r\n \"\\uf822\": \"sickle\",\r\n \"\\uf823\": \"soup\",\r\n \"\\uf824\": \"steak\",\r\n \"\\uf825\": \"stretcher\",\r\n \"\\uf826\": \"taco\",\r\n \"\\uf827\": \"tanakh\",\r\n \"\\uf828\": \"tasks-alt\",\r\n \"\\uf829\": \"trash-restore\",\r\n \"\\uf82a\": \"trash-restore-alt\",\r\n \"\\uf82b\": \"tree-palm\",\r\n \"\\uf82c\": \"user-hard-hat\",\r\n \"\\uf82d\": \"user-headset\",\r\n \"\\uf82e\": \"user-md-chat\",\r\n \"\\uf82f\": \"user-nurse\",\r\n \"\\uf830\": \"users-medical\",\r\n \"\\uf831\": \"walker\",\r\n \"\\uf832\": \"webcam\",\r\n \"\\uf833\": \"webcam-slash\",\r\n \"\\uf83e\": \"wave-square\",\r\n \"\\uf843\": \"alarm-exclamation\",\r\n \"\\uf844\": \"alarm-plus\",\r\n \"\\uf845\": \"alarm-snooze\",\r\n \"\\uf846\": \"align-slash\",\r\n \"\\uf847\": \"bags-shopping\",\r\n \"\\uf848\": \"bell-exclamation\",\r\n \"\\uf849\": \"bell-plus\",\r\n \"\\uf84a\": \"biking\",\r\n \"\\uf84b\": \"biking-mountain\",\r\n \"\\uf84c\": \"border-all\",\r\n \"\\uf84d\": \"border-bottom\",\r\n \"\\uf84e\": \"border-inner\",\r\n \"\\uf84f\": \"border-left\",\r\n \"\\uf850\": \"border-none\",\r\n \"\\uf851\": \"border-outer\",\r\n \"\\uf852\": \"border-right\",\r\n \"\\uf853\": \"border-style\",\r\n \"\\uf854\": \"border-style-alt\",\r\n \"\\uf855\": \"border-top\",\r\n \"\\uf856\": \"bring-forward\",\r\n \"\\uf857\": \"bring-front\",\r\n \"\\uf858\": \"burger-soda\",\r\n \"\\uf859\": \"car-building\",\r\n \"\\uf85a\": \"car-bus\",\r\n \"\\uf85b\": \"cars\",\r\n \"\\uf85c\": \"coin\",\r\n \"\\uf85d\": \"construction\",\r\n \"\\uf85e\": \"digging\",\r\n \"\\uf85f\": \"drone\",\r\n \"\\uf860\": \"drone-alt\",\r\n \"\\uf861\": \"dryer\",\r\n \"\\uf862\": \"dryer-alt\",\r\n \"\\uf863\": \"fan\",\r\n \"\\uf864\": \"farm\",\r\n \"\\uf865\": \"file-search\",\r\n \"\\uf866\": \"font-case\",\r\n \"\\uf867\": \"game-board\",\r\n \"\\uf868\": \"game-board-alt\",\r\n \"\\uf869\": \"glass-citrus\",\r\n \"\\uf86a\": \"h4\",\r\n \"\\uf86b\": \"hat-chef\",\r\n \"\\uf86c\": \"horizontal-rule\",\r\n \"\\uf86d\": \"icons\",\r\n \"\\uf86e\": \"icons-alt\",\r\n \"\\uf86f\": \"kerning\",\r\n \"\\uf870\": \"line-columns\",\r\n \"\\uf871\": \"line-height\",\r\n \"\\uf872\": \"money-check-edit\",\r\n \"\\uf873\": \"money-check-edit-alt\",\r\n \"\\uf874\": \"mug\",\r\n \"\\uf875\": \"mug-tea\",\r\n \"\\uf876\": \"overline\",\r\n \"\\uf877\": \"page-break\",\r\n \"\\uf878\": \"paragraph-rtl\",\r\n \"\\uf879\": \"phone-alt\",\r\n \"\\uf87a\": \"phone-laptop\",\r\n \"\\uf87b\": \"phone-square-alt\",\r\n \"\\uf87c\": \"photo-video\",\r\n \"\\uf87d\": \"remove-format\",\r\n \"\\uf87e\": \"send-back\",\r\n \"\\uf87f\": \"send-backward\",\r\n \"\\uf880\": \"snooze\",\r\n \"\\uf881\": \"sort-alpha-down-alt\",\r\n \"\\uf882\": \"sort-alpha-up-alt\",\r\n \"\\uf883\": \"sort-alt\",\r\n \"\\uf884\": \"sort-amount-down-alt\",\r\n \"\\uf885\": \"sort-amount-up-alt\",\r\n \"\\uf886\": \"sort-numeric-down-alt\",\r\n \"\\uf887\": \"sort-numeric-up-alt\",\r\n \"\\uf888\": \"sort-shapes-down\",\r\n \"\\uf889\": \"sort-shapes-down-alt\",\r\n \"\\uf88a\": \"sort-shapes-up\",\r\n \"\\uf88b\": \"sort-shapes-up-alt\",\r\n \"\\uf88c\": \"sort-size-down\",\r\n \"\\uf88d\": \"sort-size-down-alt\",\r\n \"\\uf88e\": \"sort-size-up\",\r\n \"\\uf88f\": \"sort-size-up-alt\",\r\n \"\\uf890\": \"sparkles\",\r\n \"\\uf891\": \"spell-check\",\r\n \"\\uf892\": \"sunglasses\",\r\n \"\\uf893\": \"text\",\r\n \"\\uf894\": \"text-size\",\r\n \"\\uf895\": \"trash-undo\",\r\n \"\\uf896\": \"trash-undo-alt\",\r\n \"\\uf897\": \"voicemail\",\r\n \"\\uf898\": \"washer\",\r\n \"\\uf899\": \"wave-sine\",\r\n \"\\uf89a\": \"wave-triangle\",\r\n \"\\uf89b\": \"wind-turbine\"\r\n};\r\n\r\nfunction createUse(type, id) {\r\n const c = typeof consts !== 'undefined' ? consts : {};\r\n const path = c.path ||\r\n (typeof _network !== 'undefined' ? _network.root :\r\n (typeof _net !== 'undefined' ? _net.root : ''));\r\n const ver = c.resver == null ? '' : `?${c.resver}`;\r\n const use = document.createElementNS(svgns, 'use');\r\n if (id?.length === 1 && id.charCodeAt(0) > 0xf000) {\r\n id = dict[id];\r\n }\r\n use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', `${path}fonts/${type}.svg${ver}#${id}`);\r\n return use;\r\n}\r\n\r\nexport function changeIcon(svg, type, id) {\r\n if (svg instanceof SVGElement) {\r\n svg.replaceChildren(createUse(type, id));\r\n }\r\n return svg;\r\n}\r\n\r\nexport function createIcon(type, id, style) {\r\n const svg = document.createElementNS(svgns, 'svg');\r\n svg.appendChild(createUse(type, id));\r\n if (style != null) {\r\n for (let css of Object.entries(style)) {\r\n svg.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n return svg;\r\n}\r\n\r\nexport function resolveIcon(container) {\r\n const svgs = container.querySelectorAll('svg[data-id]');\r\n for (let icon of svgs) {\r\n const type = icon.dataset.type;\r\n const id = icon.dataset.id;\r\n icon.replaceChildren(createUse(type, id));\r\n icon.removeAttribute('data-type');\r\n icon.removeAttribute('data-id');\r\n }\r\n return container;\r\n}","import './css/checkbox.scss';\r\nimport { createElement } from \"../functions\";\r\nimport { createIcon } from \"./icon\";\r\n\r\nfunction fillCheckbox(container, type = 'fa-regular', label, tabindex = -1, charactor = 'check', title) {\r\n container.appendChild(\r\n createElement('layer', layer => {\r\n layer.className = 'ui-check-inner';\r\n layer.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n const input = container.querySelector('input');\r\n if (input != null) {\r\n input.checked = !input.checked;\r\n input.dispatchEvent(new Event('change'));\r\n }\r\n }\r\n });\r\n if (tabindex >= 0) {\r\n layer.tabIndex = tabindex;\r\n }\r\n }, createIcon(type, charactor))\r\n );\r\n if (label instanceof Element) {\r\n container.appendChild(label);\r\n } else if (label != null && String(label).length > 0) {\r\n container.appendChild(\r\n createElement('span', span => {\r\n span.innerText = label;\r\n span.title = title;\r\n })\r\n );\r\n }\r\n}\r\n\r\nexport function createRadiobox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper ui-radio-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'radio');\r\n input.name = opts.name;\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customAttributes != null) {\r\n for (let entry of Object.entries(opts.customAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n }\r\n }\r\n if (typeof opts.onchange === 'function') {\r\n input.addEventListener('change', opts.onchange);\r\n }\r\n }));\r\n if (opts.className) {\r\n container.classList.add(opts.className);\r\n }\r\n fillCheckbox(container, opts.type, opts.label, opts.tabIndex, 'circle', opts.title);\r\n return container;\r\n}\r\n\r\nexport function createCheckbox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'checkbox');\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customAttributes != null) {\r\n for (let entry of Object.entries(opts.customAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n }\r\n }\r\n if (typeof opts.onchange === 'function') {\r\n input.addEventListener('change', opts.onchange);\r\n }\r\n }));\r\n if (opts.className) {\r\n container.classList.add(opts.className);\r\n }\r\n if (opts.enabled === false) {\r\n container.classList.add('disabled');\r\n }\r\n if (opts.checkedNode != null && opts.uncheckedNode != null) {\r\n container.classList.add('ui-check-image-wrapper');\r\n let height = opts.imageHeight;\r\n if (isNaN(height) || height <= 0) {\r\n height = 14;\r\n }\r\n opts.checkedNode.classList.add('checked');\r\n container.appendChild(opts.checkedNode);\r\n opts.uncheckedNode.classList.add('unchecked');\r\n container.appendChild(opts.uncheckedNode);\r\n } else {\r\n fillCheckbox(container, opts.type, opts.label, opts.tabIndex, undefined, opts.title);\r\n }\r\n return container;\r\n}\r\n\r\nexport function resolveCheckbox(container = document.body, legacy) {\r\n if (legacy) {\r\n const checks = container.querySelectorAll('input[type=\"checkbox\"]');\r\n for (let chk of checks) {\r\n if (chk.parentElement.classList.contains('ui-check-wrapper')) {\r\n // skip\r\n continue;\r\n }\r\n const id = chk.id;\r\n let label, text;\r\n if (id != null) {\r\n label = container.querySelector(`label[for=\"${id}\"]`);\r\n }\r\n if (label == null) {\r\n const e = chk.nextElementSibling;\r\n if (e != null) {\r\n if (e.tagName === 'LABEL') {\r\n label = e;\r\n } else if (e.tagName === 'SPAN' && e.dataset.lgid != null) {\r\n text = e.innerText;\r\n e.style.display = 'none';\r\n }\r\n }\r\n }\r\n if (label == null) {\r\n const e = chk.previousElementSibling;\r\n if (e != null) {\r\n if (e.tagName === 'LABEL') {\r\n label = e;\r\n } else if (text == null && e.tagName === 'SPAN' && e.dataset.lgid != null) {\r\n text = e.innerText;\r\n e.style.display = 'none';\r\n }\r\n }\r\n }\r\n if (label == null) {\r\n label = createElement('label');\r\n chk.parentElement.insertBefore(label, chk);\r\n } else {\r\n text = label.innerText;\r\n }\r\n if (chk.disabled) {\r\n label.className = 'ui-check-wrapper disabled';\r\n } else {\r\n label.className = 'ui-check-wrapper';\r\n }\r\n label.replaceChildren();\r\n fillCheckbox(label, 'fa-regular', text, chk.tabIndex, undefined, label.title);\r\n label.insertBefore(chk, label.firstChild);\r\n }\r\n }\r\n const boxes = container.querySelectorAll('label[data-checkbox]');\r\n for (let box of boxes) {\r\n if (!box.classList.contains('ui-check-wrapper')) {\r\n box.classList.add('ui-check-wrapper');\r\n }\r\n if (box.hasChildNodes()) {\r\n if (!box.classList.contains('ui-check-image-wrapper')) {\r\n box.classList.add('ui-check-image-wrapper');\r\n }\r\n } else {\r\n fillCheckbox(box,\r\n box.dataset.type,\r\n box.dataset.label,\r\n box.dataset.tabIndex,\r\n undefined,\r\n box.title);\r\n box.removeAttribute('title');\r\n box.removeAttribute('data-type');\r\n box.removeAttribute('data-label');\r\n }\r\n const input = createElement('input');\r\n const id = box.dataset.id;\r\n if (id?.length > 0) {\r\n input.id = id;\r\n }\r\n if (box.dataset.checked != null) {\r\n input.checked = true;\r\n }\r\n input.setAttribute('type', 'checkbox');\r\n box.insertBefore(input, box.firstChild);\r\n }\r\n return container;\r\n}","import './css/tooltip.scss';\r\nimport { createElement } from \"../functions\";\r\n// import { global } from \"../utility\";\r\n\r\nconst pointerHeight = 12;\r\n\r\nexport function setTooltip(container, content, flag = false, parent = null) {\r\n const isParent = parent instanceof HTMLElement;\r\n if (isParent) {\r\n const tipid = container.dataset.tipId;\r\n const tip = parent.querySelector(`.ui-tooltip-wrapper[data-tip-id=\"${tipid}\"]`);\r\n tip?.remove();\r\n } else {\r\n const tip = container.querySelector('.ui-tooltip-wrapper');\r\n tip?.remove();\r\n }\r\n const wrapper = createElement('div', wrapper => {\r\n wrapper.className = 'ui-tooltip-wrapper ui-tooltip-color';\r\n // wrapper.style.visibility = 'hidden';\r\n // wrapper.style.opacity = 0;\r\n // wrapper.style.top = '0';\r\n // wrapper.style.left = '0';\r\n wrapper.style.cssText += 'display: none; visibility: hidden; opacity: 0; top: 0; left: 0';\r\n },\r\n createElement('div', 'ui-tooltip-pointer ui-tooltip-color'),\r\n createElement('div', 'ui-tooltip-curtain ui-tooltip-color'),\r\n createElement('div', cnt => {\r\n cnt.className = 'ui-tooltip-content';\r\n if (content instanceof Element) {\r\n cnt.appendChild(content);\r\n } else {\r\n cnt.innerText = content;\r\n }\r\n })\r\n );\r\n // container.insertAdjacentElement('afterend', wrapper);\r\n if (isParent) {\r\n const tipId = String(Math.random()).substring(2);\r\n container.dataset.tipId = tipId;\r\n wrapper.dataset.tipId = tipId;\r\n parent.appendChild(wrapper);\r\n } else {\r\n container.appendChild(wrapper);\r\n }\r\n\r\n let tid;\r\n container.addEventListener('mouseenter', () => {\r\n tid && clearTimeout(tid);\r\n let c = container;\r\n while (c?.offsetWidth == null) {\r\n c = c.parentElement;\r\n }\r\n if (c == null) {\r\n return;\r\n }\r\n if (!flag || c.scrollWidth > c.offsetWidth) {\r\n tid = setTimeout(() => {\r\n let p;\r\n let left;\r\n let top;\r\n left = c.offsetLeft;\r\n top = c.offsetTop;\r\n if (isParent) {\r\n p = c.offsetParent;\r\n while (p != null && p !== parent) {\r\n left += p.offsetLeft;\r\n top += p.offsetTop;\r\n p = p.offsetParent;\r\n }\r\n }\r\n p = c.parentElement;\r\n const offsetParent = isParent ? parent : c.offsetParent;\r\n while (p != null && p !== offsetParent) {\r\n left -= p.scrollLeft;\r\n top -= p.scrollTop;\r\n p = p.parentElement;\r\n }\r\n wrapper.style.display = '';\r\n const offsetHeight = wrapper.offsetHeight;\r\n const offsetWidth = wrapper.offsetWidth;\r\n if (isParent) {\r\n top -= offsetHeight + pointerHeight;\r\n if (top < 0) {\r\n top += c.offsetHeight + offsetHeight + pointerHeight * 2;\r\n wrapper.classList.add('ui-tooltip-down');\r\n }\r\n left += (c.offsetWidth - offsetWidth) / 2;\r\n if (left < 1) {\r\n left = 1;\r\n }\r\n } else {\r\n // check overflow\r\n let t = c.offsetTop;\r\n let l = c.offsetLeft;\r\n p = c.offsetParent;\r\n if (p == null) {\r\n return;\r\n }\r\n let lastWidth = p.clientWidth;\r\n let lastHeight = p.clientHeight;\r\n while (p != null) {\r\n const overflow = window.getComputedStyle(p).overflow;\r\n if (overflow !== 'visible') {\r\n break;\r\n }\r\n t += p.offsetTop;\r\n l += p.offsetLeft;\r\n const parent = p.offsetParent;\r\n while (p != null) {\r\n const w = p.clientWidth;\r\n if (w < lastWidth) {\r\n lastWidth += l;\r\n } else {\r\n lastWidth = p.clientWidth;\r\n }\r\n const h = p.clientHeight;\r\n if (h < lastHeight) {\r\n lastHeight += t;\r\n } else {\r\n lastHeight = p.clientHeight;\r\n }\r\n t -= p.scrollTop;\r\n l -= p.scrollLeft;\r\n if (p === parent) {\r\n break;\r\n }\r\n p = p.parentElement;\r\n }\r\n }\r\n if (t - offsetHeight - pointerHeight < 0) {\r\n const containerOffsetHeight = c.offsetHeight;\r\n if (t + containerOffsetHeight + offsetHeight + pointerHeight > lastHeight) {\r\n top = t + (containerOffsetHeight - offsetHeight) / 2;\r\n if (top + offsetHeight + 1 > lastHeight) {\r\n top = lastHeight - offsetHeight - 1;\r\n }\r\n wrapper.classList.add('ui-tooltip-no');\r\n } else {\r\n top += containerOffsetHeight + pointerHeight;\r\n wrapper.classList.add('ui-tooltip-down');\r\n }\r\n } else {\r\n top -= offsetHeight + pointerHeight;\r\n wrapper.classList.remove('ui-tooltip-down');\r\n }\r\n left += (c.offsetWidth - offsetWidth) / 2;\r\n if (l - offsetWidth < 0) {\r\n left = 1;\r\n } else if (left + offsetWidth + 1 > lastWidth) {\r\n left = lastWidth - offsetWidth - 1;\r\n }\r\n }\r\n // wrapper.style.left = `${left}px`;\r\n // wrapper.style.top = `${top}px`;\r\n // wrapper.style.visibility = 'visible';\r\n // wrapper.style.opacity = 1;\r\n wrapper.style.cssText += `left: ${left}px; top: ${top}px; visibility: visible; opacity: 1`;\r\n }, 100);\r\n }\r\n });\r\n container.addEventListener('mouseleave', () => {\r\n tid && clearTimeout(tid);\r\n tid = setTimeout(() => {\r\n wrapper.style.visibility = 'hidden';\r\n wrapper.style.opacity = 0;\r\n tid = setTimeout(() => wrapper.style.display = 'none', 120);\r\n }, 300);\r\n });\r\n return container;\r\n}\r\n\r\nexport function resolveTooltip(container = document.body) {\r\n const tips = container.querySelectorAll('[title]');\r\n for (let tip of tips) {\r\n const title = tip.getAttribute('title');\r\n if (title != null) {\r\n tip.removeAttribute('title');\r\n setTooltip(tip, title);\r\n }\r\n }\r\n return container;\r\n}","import \"./css/tab.scss\";\r\n\r\n/**\r\n * Tab 页创建参数类\r\n * @typedef TabOption\r\n * @property {HTMLElement} container - 父容器\r\n */\r\n\r\nimport { createElement } from \"../functions\";\r\n\r\n/**\r\n * 创建 Tab 页\r\n * @param {TabOption | HTMLElement} options - 创建选项\r\n */\r\nexport function createTab(options) {\r\n if (options instanceof HTMLElement) {\r\n options = { container: options };\r\n }\r\n let container;\r\n if (options?.container instanceof HTMLElement) {\r\n container = options.container;\r\n if (!container.classList.contains('ui-tab-container')) {\r\n container.classList.add('ui-tab-container');\r\n }\r\n } else {\r\n container = createElement('div', 'ui-tab-container');\r\n }\r\n container.replaceChildren(\r\n createElement('div', header => {\r\n header.className = 'ui-tab-header';\r\n header.addEventListener('click', e => {\r\n const title = e.target;\r\n if (title.classList.contains('ui-tab-title')) {\r\n // title\r\n header.querySelectorAll('.ui-tab-title').forEach(t => t === title ? t.classList.add('selected') : t.classList.remove('selected'));\r\n // pages\r\n const page = title.dataset.for;\r\n container.querySelectorAll('[data-page]').forEach(p => p.style.display = p.dataset.page === page ? 'block' : '');\r\n }\r\n });\r\n })\r\n );\r\n}","function combineUrl(url) {\r\n if (/^(https?|wss?|ftp):/.test(url)) {\r\n return url;\r\n }\r\n if (typeof consts === 'undefined') {\r\n return url;\r\n }\r\n return (consts.path || '') + url;\r\n}\r\n\r\nexport function get(url, options = {}) {\r\n return fetch(combineUrl(url), {\r\n method: options.method || 'GET',\r\n headers: {\r\n ...options.customHeaders,\r\n 'Accept': options.accept ?? 'application/json'\r\n },\r\n mode: options.mode,\r\n signal: options.signal,\r\n cache: 'default'\r\n });\r\n}\r\n\r\nexport function post(url, data, options = {}) {\r\n // let contentType;\r\n if (data instanceof FormData) {\r\n // contentType = 'multipart/form-data';\r\n } else {\r\n if (typeof data !== 'string') {\r\n data = JSON.stringify(data);\r\n }\r\n // contentType = 'application/json';\r\n if (options.customHeaders == null) {\r\n options.customHeaders = {};\r\n }\r\n if (options.customHeaders['Content-Type'] == null) {\r\n options.customHeaders['Content-Type'] = 'application/json';\r\n }\r\n }\r\n return fetch(combineUrl(url), {\r\n method: options.method || 'POST',\r\n headers: options.customHeaders,\r\n body: data,\r\n signal: options.signal,\r\n cache: 'no-cache'\r\n });\r\n}\r\n\r\nexport function upload(url, data, options = {}) {\r\n return new Promise((resolve, reject) => {\r\n const request = new XMLHttpRequest();\r\n request.onreadystatechange = function () {\r\n if (this.readyState === XMLHttpRequest.DONE) {\r\n if (this.status === 200) {\r\n resolve(this);\r\n } else {\r\n reject(`${this.status} ${this.statusText}: ${this.responseText}`);\r\n }\r\n }\r\n };\r\n if (typeof options.progress === 'function') {\r\n request.upload.addEventListener('progress', function (ev) {\r\n if (ev.lengthComputable) {\r\n options.progress.call(this, ev);\r\n }\r\n }, false);\r\n }\r\n request.open('POST', combineUrl(url));\r\n if (options.customHeaders != null) {\r\n for (let header of Object.entries(options.customHeaders)) {\r\n request.setRequestHeader(header[0], header[1]);\r\n }\r\n }\r\n request.send(data);\r\n });\r\n}","export function nullOrEmpty(s) {\r\n return s == null || typeof s !== 'string' || s.length === 0;\r\n}\r\n\r\nexport function contains(s, key, ignoreCase) {\r\n if (nullOrEmpty(s) || key == null) {\r\n return false;\r\n }\r\n if (typeof key !== 'string') {\r\n key = String(key);\r\n }\r\n if (ignoreCase) {\r\n return s.toLowerCase().includes(key.toLowerCase());\r\n }\r\n return s.includes(key);\r\n}\r\n\r\nexport function endsWith(s, suffix) {\r\n if (nullOrEmpty(s) || nullOrEmpty(suffix)) {\r\n return false;\r\n }\r\n return s.endsWith(suffix); // === s.length - suffix.length;\r\n}\r\n\r\nexport function padStart(s, num, char) {\r\n if (nullOrEmpty(s) || isNaN(num) || num <= s.length) {\r\n return s;\r\n }\r\n return (char ?? ' ').repeat(num - s.length);\r\n}\r\n\r\nexport function formatUrl(msg) {\r\n //const urlReg = /(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?/ig;\r\n //const urlArrray = str.match(urlReg);\r\n const p = /(http|ftp|https):\\/\\/.+?(\\s|\\r\\n|\\r|\\n|\\\"|\\'|\\*|$)/g;\r\n const r = msg.match(p);\r\n msg = escapeHtml(msg);\r\n\r\n if (r?.length > 0) {\r\n const rs = [];\r\n for (let t of r) {\r\n t = t.replace(/[\"'\\r\\n ]/g, '');\r\n if (rs.indexOf(t) < 0) {\r\n rs.push(t);\r\n }\r\n }\r\n\r\n let path;\r\n if (typeof consts !== 'undefined') {\r\n path = consts.path;\r\n } else if (typeof _network !== 'undefined') {\r\n path = _network.root;\r\n } else if (typeof _net !== 'undefined') {\r\n path = _net.root;\r\n }\r\n for (let r of rs) {\r\n msg = msg.replaceAll(r, `<a target=\"_blank\" href=\"${r}\"><svg><use xlink:href=\"${path || ''}fonts/fa-regular.svg#link\"></use></svg></a>`);\r\n }\r\n }\r\n\r\n return msg;\r\n}\r\n\r\nexport function escapeHtml(text) {\r\n if (text == null) {\r\n return '';\r\n }\r\n return String(text)\r\n .replaceAll('&', '&amp;')\r\n .replaceAll('<', '&lt;')\r\n .replaceAll('>', '&gt;')\r\n .replaceAll('\\r\\n', '<br/>')\r\n .replaceAll('\\n', '<br/>')\r\n .replaceAll(' ', '&nbsp;');\r\n}\r\n\r\nexport function escapeEmoji(text) {\r\n if (text == null) {\r\n return '';\r\n }\r\n if (typeof text !== 'string') {\r\n text = String(text);\r\n }\r\n return text\r\n .replace(/(=[A-Fa-f0-9]{2}){4}/g, s => decodeURIComponent(s.replaceAll('=', '%')))\r\n .replace(/&#x([0-9a-fA-F]{2,6});/g, (_, h) => String.fromCodePoint(parseInt(h, 16)));\r\n}","import { getCookie } from \"./cookie\";\r\nimport { get } from \"./request\";\r\nimport { nullOrEmpty } from \"./strings\";\r\n\r\nlet cache;\r\n\r\nfunction getCurrentLgId() {\r\n let lgid;\r\n if (typeof consts !== 'undefined') {\r\n lgid = getCookie(consts.cookie?.lang);\r\n if (nullOrEmpty(lgid)) {\r\n lgid = consts.user?.language;\r\n }\r\n }\r\n if (nullOrEmpty(lgid)) {\r\n lgid = getCookie('lgid');\r\n }\r\n if (nullOrEmpty(lgid)) {\r\n lgid = navigator.language || 'en-us';\r\n }\r\n lgid = lgid.toLowerCase().replace(/-/g, '_');\r\n if (nullOrEmpty(lgid)) {\r\n lgid = 'en';\r\n }\r\n switch (lgid) {\r\n case 'en':\r\n case 'en_au':\r\n case 'fr':\r\n case 'zh_cn':\r\n return lgid;\r\n }\r\n const lang = lgid.split('_')[0];\r\n switch (lang) {\r\n case 'en':\r\n case 'fr':\r\n return lang;\r\n }\r\n return 'en';\r\n}\r\n\r\nfunction getStorageKey(lgid) {\r\n if (typeof consts !== 'undefined') {\r\n return (consts.prefix || '') + `res_${lgid}`;\r\n }\r\n return `res_${lgid}`;\r\n}\r\n\r\nasync function doRefreshLgres(template = '') {\r\n const lgid = getCurrentLgId();\r\n const url = template.length > 0 ? template.replace('{lgid}', lgid) : `language/${lgid}`;\r\n const r = await get(url);\r\n const dict = await r.json();\r\n localStorage.setItem(getStorageKey(lgid), JSON.stringify(dict));\r\n return dict;\r\n}\r\n\r\nasync function refreshLgres(template, lgres) {\r\n if (lgres == null || typeof consts === 'undefined') {\r\n lgres = await doRefreshLgres(template);\r\n }\r\n const ver = Number(consts.resver);\r\n if (isNaN(lgres.ver) || isNaN(ver) || ver > lgres.ver) {\r\n console.log(`found new language res version: ${lgres.ver} => ${ver}`);\r\n lgres = await doRefreshLgres(template);\r\n }\r\n Object.defineProperty(lgres, 'r', {\r\n writable: false,\r\n configurable: false,\r\n enumerable: false,\r\n value: function (key, defaultValue) {\r\n return getLanguage(this, key, defaultValue);\r\n }\r\n });\r\n cache = lgres;\r\n return lgres;\r\n}\r\n\r\nfunction getLanguage(lgres, key, defaultValue) {\r\n let value = lgres[key];\r\n return value ?? defaultValue;\r\n}\r\n\r\nfunction applyLanguage(dom, result) {\r\n for (let text of dom.querySelectorAll('[data-lgid]')) {\r\n const key = text.dataset.lgid;\r\n if (text.tagName === 'INPUT') {\r\n text.value = getLanguage(result, key, text.value);\r\n } else {\r\n text.innerText = getLanguage(result, key, text.innerText);\r\n }\r\n }\r\n for (let title of dom.querySelectorAll('[data-title-lgid]')) {\r\n const key = title.dataset.titleLgid;\r\n title.setAttribute('title', getLanguage(result, key, title.getAttribute('title')));\r\n }\r\n for (let holder of dom.querySelectorAll('[data-placeholder-lgid]')) {\r\n const key = holder.dataset.placeholderLgid;\r\n holder.setAttribute('placeholder', getLanguage(result, key, holder.getAttribute('placeholder')));\r\n }\r\n}\r\n\r\nexport async function init(dom = document.body, options = {}) {\r\n const lgid = getCurrentLgId();\r\n let lgres = localStorage.getItem(getStorageKey(lgid));\r\n let result;\r\n if (lgres != null) {\r\n try {\r\n lgres = JSON.parse(lgres);\r\n result = await refreshLgres(options.template, lgres);\r\n } catch (e) {\r\n console.error('error while parsing lgres, try refresh ...', e);\r\n result = await refreshLgres(options.template);\r\n }\r\n } else {\r\n result = await refreshLgres(options.template);\r\n }\r\n\r\n try {\r\n if (document.readyState === 'loading') {\r\n return await new Promise((resolve, reject) => {\r\n let tid = setTimeout(() => reject('timeout'), 30000);\r\n document.addEventListener('DOMContentLoaded', () => {\r\n clearTimeout(tid);\r\n tid = void 0;\r\n if (typeof options.callback === 'function') {\r\n options.callback(result);\r\n }\r\n applyLanguage(dom, result);\r\n resolve(result);\r\n });\r\n });\r\n }\r\n if (typeof options.callback === 'function') {\r\n options.callback(result);\r\n }\r\n applyLanguage(dom, result);\r\n return result;\r\n } catch (err) {\r\n console.error('error while loading language res ...', err);\r\n }\r\n}\r\n\r\nexport function r(key, defaultValue) {\r\n if (cache != null) {\r\n return getLanguage(cache, key, defaultValue);\r\n }\r\n return defaultValue;\r\n}\r\n\r\nexport const lang = {\r\n get current() {\r\n return getCurrentLgId();\r\n },\r\n get unknownError() {\r\n return r('unknownError', 'An unknown error occurred, please contact the administrator.');\r\n },\r\n get savedSuccessfully() {\r\n return r('savedSuccessfully', 'Saved successfully.');\r\n }\r\n}","import { getCookie, setCookie, deleteCookie } from \"./utility/cookie\";\r\nimport { init, r, lang } from \"./utility/lgres\";\r\nimport { get, post, upload } from \"./utility/request\";\r\nimport { nullOrEmpty, contains, endsWith, padStart, formatUrl, escapeHtml, escapeEmoji } from \"./utility/strings\";\r\n\r\nlet g = typeof globalThis !== 'undefined' ? globalThis : self;\r\n\r\nfunction isPositive(n) {\r\n return !isNaN(n) && n > 0;\r\n}\r\n\r\nfunction isMobile() {\r\n return /mobile/i.test(navigator.userAgent);\r\n}\r\n\r\nfunction throttle(method, delay = 100, context = g, ...args) {\r\n if (method == null) {\r\n return;\r\n }\r\n method.tiid && clearTimeout(method.tiid);\r\n const current = new Date();\r\n if (method.tdate == null || current - method.tdate > delay) {\r\n method.apply(context, args);\r\n method.tdate = current;\r\n } else {\r\n method.tiid = setTimeout(() => method.apply(context, args), delay);\r\n }\r\n}\r\n\r\nfunction debounce(method, delay = 100, context = g, ...args) {\r\n if (method == null) {\r\n return;\r\n }\r\n method.tiid && clearTimeout(method.tiid);\r\n method.tiid = setTimeout(() => method.apply(context, args), delay);\r\n}\r\n\r\nfunction truncate(v) {\r\n return (v > 0 ? Math.floor : Math.ceil)(v);\r\n}\r\n\r\nfunction isEmail(text) {\r\n return /^\\w[-\\w.+]*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/.test(text);\r\n}\r\n\r\nfunction isPhone(text) {\r\n if (/^[1-9]\\d{9,}$/.test(text)) {\r\n return true;\r\n }\r\n if (/^\\+?[1-9][\\d-]{9,}\\d$/.test(text) && /^[1-9]\\d{9,}$/.test(text.replace('+', '').replace(new RegExp('-', 'g'), ''))) {\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nexport {\r\n // cookie\r\n getCookie,\r\n setCookie,\r\n deleteCookie,\r\n // lgres\r\n init,\r\n r,\r\n lang,\r\n // request\r\n get,\r\n post,\r\n upload,\r\n // strings\r\n nullOrEmpty,\r\n contains,\r\n endsWith,\r\n padStart,\r\n formatUrl,\r\n escapeHtml,\r\n escapeEmoji,\r\n // variables\r\n g as global,\r\n isPositive,\r\n isMobile,\r\n // functions\r\n throttle,\r\n debounce,\r\n truncate,\r\n isEmail,\r\n isPhone\r\n}","// import { r, global, contains, isPositive, nullOrEmpty } from \"../utility\";\r\nimport './css/dropdown.scss';\r\nimport { r } from \"../utility/lgres\";\r\nimport { contains, nullOrEmpty } from \"../utility/strings\";\r\nimport { global, isPositive } from \"../utility\";\r\nimport { createElement } from \"../functions\";\r\nimport { createCheckbox } from \"./checkbox\";\r\nimport { createIcon } from \"./icon\"\r\n\r\nconst SymbolDropdown = Symbol.for('ui-dropdown');\r\nconst DropdownItemHeight = 30;\r\n\r\nlet dropdownGlobal = global[SymbolDropdown];\r\n\r\nif (dropdownGlobal == null) {\r\n // init\r\n dropdownGlobal = {};\r\n Object.defineProperty(dropdownGlobal, 'clear', {\r\n writable: false,\r\n configurable: false,\r\n enumerable: false,\r\n value: function () {\r\n const panels = document.querySelectorAll('.ui-drop-box.active');\r\n for (let panel of [...panels]) {\r\n if (panel == null) {\r\n continue;\r\n }\r\n panel.classList.remove('active');\r\n const dropId = panel.parentElement.dataset.dropId;\r\n if (dropId == null) {\r\n continue;\r\n }\r\n const dropdown = this[dropId];\r\n if (dropdown?.multiSelect && typeof dropdown.onCollapsed === 'function') {\r\n dropdown.onCollapsed();\r\n }\r\n }\r\n }\r\n })\r\n global[SymbolDropdown] = dropdownGlobal;\r\n\r\n document.addEventListener('mousedown', e => {\r\n let parent = e.target;\r\n while (parent != null) {\r\n if (parent.classList.contains('ui-drop-box')) {\r\n e.stopPropagation();\r\n return;\r\n }\r\n parent = parent.parentElement;\r\n }\r\n dropdownGlobal.clear();\r\n });\r\n}\r\n\r\nfunction selectItems(label, itemlist, htmlkey, textkey) {\r\n const htmls = itemlist.map(it => it[htmlkey]);\r\n if (htmls.some(it => it instanceof HTMLElement)) {\r\n label.replaceChildren(...htmls.filter(it => it != null).map(it => it.cloneNode(true)));\r\n } else {\r\n let text = itemlist.map(it => it[textkey]).join(', ');\r\n if (nullOrEmpty(text)) {\r\n text = r('noneItem', '( None )');\r\n }\r\n label.innerText = text;\r\n }\r\n}\r\n\r\nfunction filterSource(searchkeys, textkey, key, source) {\r\n if (!Array.isArray(searchkeys) || searchkeys.length === 0) {\r\n searchkeys = [textkey];\r\n }\r\n if (key.length > 0) {\r\n source = source.filter(it => {\r\n for (let k of searchkeys) {\r\n if (contains(it[k].toLowerCase(), key)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n });\r\n }\r\n return source;\r\n}\r\n\r\n/**\r\n * 下拉列表参数对象\r\n * @typedef DropdownOptions\r\n * @property {string} [textKey=text] - 文本关键字\r\n * @property {string} [valueKey=value] - 值关键字\r\n * @property {string} [htmlKey=html] - 源码显示的关键字\r\n * @property {number} [maxLength=500] - 最大输入长度\r\n * @property {boolean} [multiSelect] - 是否允许多选\r\n * @property {string} [selected] - 选中值\r\n * @property {string[]} [selectedList] - 选中的数组\r\n * @property {boolean} [disabled] - 是否禁用\r\n * @property {boolean} [input] - 是否支持输入\r\n * @property {boolean} [search] - 是否支持搜索\r\n * @property {string[]} [searchKeys] - 搜索的关键字数组\r\n * @property {string} [searchPlaceholder] - 搜索提示文本,默认值取语言资源 `searchHolder` \"Search...\"\r\n * @property {number} [tabIndex] - 焦点索引\r\n * @property {string} [placeholder] - 输入框的提示文本\r\n * @property {boolean} [slideFixed] - 是否固定为向下展开\r\n * @property {HTMLElement} [wrapper] - 父元素,默认添加到头元素之后\r\n */\r\n\r\nexport class Dropdown {\r\n _var = {};\r\n // _var.options;\r\n\r\n // _var.wrapper;\r\n // _var.container;\r\n // _var.label;\r\n\r\n // _var.allChecked;\r\n // _var.source;\r\n // _var.lastSelected;\r\n // _var.selected;\r\n // _var.selectedList;\r\n\r\n sourceFilter;\r\n onSelectedList;\r\n onSelected;\r\n onExpanded;\r\n onCollapsed;\r\n\r\n constructor(options = {}) {\r\n options.searchPlaceholder ??= r('searchHolder', 'Search...');\r\n options.textKey ??= 'text';\r\n options.valueKey ??= 'value';\r\n options.htmlKey ??= 'html';\r\n options.maxLength ??= 500;\r\n this._var.options = options;\r\n }\r\n\r\n create() {\r\n const options = this._var.options;\r\n\r\n // wrapper\r\n const wrapper = createElement('div', 'ui-drop-wrapper');\r\n const dropId = String(Math.random()).substring(2);\r\n wrapper.dataset.dropId = dropId;\r\n dropdownGlobal[dropId] = this;\r\n this._var.wrapper = wrapper;\r\n\r\n // header\r\n const header = createElement('div', 'ui-drop-header');\r\n header.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n header.dispatchEvent(new MouseEvent('click'));\r\n }\r\n });\r\n header.addEventListener('keydown', e => {\r\n const up = e.key === 'ArrowUp';\r\n const down = e.key === 'ArrowDown';\r\n if (up || down) {\r\n const source = this.source;\r\n const count = source.length;\r\n const valuekey = this._var.options.valueKey;\r\n let index = source?.indexOf(this._var.selected);\r\n if (isNaN(index) || index < -1) {\r\n index = -1;\r\n } else if (index >= count) {\r\n index = count - 1;\r\n }\r\n if (up) {\r\n if (index > 0) {\r\n index--;\r\n } else {\r\n index = 0;\r\n }\r\n } else if (down) {\r\n if (index < 0) {\r\n index = 0;\r\n } else if (index < count) {\r\n index++;\r\n } else {\r\n index = count - 1;\r\n }\r\n }\r\n const target = source[index]?.[valuekey];\r\n if (target != null) {\r\n this.select(target);\r\n }\r\n } else if (e.key === 'Tab') {\r\n this._dropdown(false);\r\n }\r\n });\r\n header.addEventListener('click', () => {\r\n if (this.disabled) {\r\n return;\r\n }\r\n const active = this._expanded;\r\n const label = this._var.label;\r\n if (active && label.ownerDocument.activeElement === label) {\r\n return;\r\n }\r\n this._dropdown(!active);\r\n if (!active && typeof this.onExpanded === 'function') {\r\n setTimeout(() => this.onExpanded(), 120);\r\n }\r\n });\r\n\r\n // label or input\r\n let label;\r\n if (options.input) {\r\n label = createElement('input', 'ui-drop-text');\r\n label.setAttribute('type', 'text');\r\n options.placeholder && label.setAttribute('placeholder', options.placeholder);\r\n isPositive(options.maxLength) && label.setAttribute('maxlength', options.maxLength);\r\n isPositive(options.tabIndex) && label.setAttribute('tabindex', options.tabIndex);\r\n label.addEventListener('input', e => {\r\n const key = e.target.value.toLowerCase();\r\n const source = filterSource(options.searchKeys, options.textKey, key, this.source);\r\n this._filllist(source);\r\n this._var.container.classList.add('active');\r\n });\r\n label.addEventListener('blur', e => this.select(e.target.value));\r\n label.addEventListener('mousedown', e => this._expanded && e.stopPropagation());\r\n } else {\r\n isPositive(options.tabIndex) && header.setAttribute('tabindex', options.tabIndex);\r\n label = createElement('label', 'ui-drop-text');\r\n }\r\n this._var.label = label;\r\n if (options.multiSelect) {\r\n if (Array.isArray(options.selectedList)) {\r\n this.selectlist(options.selectedList, true);\r\n } else {\r\n this._var.allChecked = true;\r\n label.innerText = r('allItem', '( All )');\r\n }\r\n } else if (options.selected != null) {\r\n this.select(options.selected, true);\r\n }\r\n header.append(label, createElement('label', 'ui-drop-caret'));\r\n wrapper.appendChild(header);\r\n\r\n this.disabled = options.disabled || false;\r\n return wrapper;\r\n }\r\n\r\n get multiSelect() { return this._var.options.multiSelect }\r\n\r\n get disabled() { return this._var.wrapper == null || this._var.wrapper.querySelector('.ui-drop-header.disabled') != null }\r\n\r\n set disabled(flag) {\r\n if (this._var.wrapper == null) {\r\n return;\r\n }\r\n if (flag) {\r\n this._var.wrapper.querySelector('.ui-drop-header').classList.add('disabled');\r\n } else {\r\n this._var.wrapper.querySelector('.ui-drop-header').classList.remove('disabled');\r\n }\r\n }\r\n\r\n get source() {\r\n let source = this._var.source;\r\n if (source == null || !Array.isArray(source)) {\r\n if (typeof this.sourceFilter === 'function') {\r\n source = this.sourceFilter();\r\n }\r\n if (!Array.isArray(source)) {\r\n source = [];\r\n }\r\n this._var.source = source;\r\n }\r\n return source;\r\n }\r\n\r\n set source(list) {\r\n if (!Array.isArray(list)) {\r\n return;\r\n }\r\n this._var.source = list;\r\n if (this._expanded) {\r\n setTimeout(() => this._dropdown(), 120);\r\n }\r\n }\r\n\r\n get selected() { return this._var.selected }\r\n\r\n get selectedList() { return this._var.selectedList || [] }\r\n\r\n select(selected, silence) {\r\n if (typeof selected !== 'string') {\r\n selected = String(selected);\r\n }\r\n if (this._var.lastSelected === selected) {\r\n return false;\r\n }\r\n this._var.lastSelected = selected;\r\n const valuekey = this._var.options.valueKey;\r\n const textkey = this._var.options.textKey;\r\n const htmlkey = this._var.options.htmlKey;\r\n let item = this.source.find(it => String(it[valuekey]) === selected);\r\n if (this._var.options.input) {\r\n if (item == null) {\r\n item = { [valuekey]: selected };\r\n }\r\n this._var.label.value = selected;\r\n } else {\r\n const expanded = this._expanded;\r\n if (expanded) {\r\n this._var.container.querySelectorAll('li[data-value].selected').forEach(li => li.classList.remove('selected'));\r\n }\r\n if (item == null) {\r\n this._var.selected = null;\r\n this._var.label.innerText = ' ';\r\n return false;\r\n }\r\n const html = item[htmlkey];\r\n if (html instanceof HTMLElement) {\r\n this._var.label.replaceChildren(html.cloneNode(true));\r\n } else if (typeof html === 'string') {\r\n this._var.label.innerHTML = html;\r\n } else {\r\n let text = item[textkey];\r\n if (nullOrEmpty(text)) {\r\n text = ' ';\r\n }\r\n this._var.label.innerText = text;\r\n }\r\n if (expanded) {\r\n for (let li of this._var.container.querySelectorAll('li[data-value]')) {\r\n if (li.dataset.value === selected) {\r\n li.classList.add('selected');\r\n break;\r\n }\r\n }\r\n // const val = selected.replace(/\"/g, '\\\\\"');\r\n // const li = this._var.container.querySelector(`li[data-value=\"${val}\"]`);\r\n // if (li != null) {\r\n // li.classList.add('selected');\r\n // }\r\n }\r\n }\r\n this._var.selected = item;\r\n if (!silence && typeof this.onSelected === 'function') {\r\n this.onSelected(item);\r\n }\r\n }\r\n\r\n selectlist(selectedlist, silence) {\r\n const source = this.source;\r\n const valuekey = this._var.options.valueKey;\r\n const textkey = this._var.options.textKey;\r\n const htmlkey = this._var.options.htmlKey;\r\n const itemlist = selectedlist.map(a => {\r\n const v = typeof a === 'string' ? a : String(a);\r\n let item = source.find(it => String(it[valuekey]) === v);\r\n if (item == null) {\r\n item = {\r\n [valuekey]: v,\r\n [textkey]: v\r\n };\r\n }\r\n return item;\r\n });\r\n if (itemlist.length === 0) {\r\n this._var.selectedList = null;\r\n this._var.label.innerText = none;\r\n return false;\r\n }\r\n selectItems(this._var.label, itemlist, htmlkey, textkey);\r\n this._var.selectedList = itemlist;\r\n if (!silence && typeof this.onSelectedList === 'function') {\r\n this.onSelectedList(itemlist);\r\n }\r\n }\r\n\r\n get _expanded() { return this._var.container?.classList?.contains('active') }\r\n\r\n _dropdown(flag = true) {\r\n const options = this._var.options;\r\n let panel = this._var.container;\r\n if (panel == null) {\r\n panel = createElement('div', 'ui-drop-box');\r\n // search box\r\n if (!options.input && options.search) {\r\n const search = createElement('div', 'ui-drop-search');\r\n const input = createElement('input');\r\n input.setAttribute('type', 'text');\r\n isPositive(options.tabIndex) && input.setAttribute('tabindex', options.tabIndex);\r\n !nullOrEmpty(options.searchPlaceholder) && input.setAttribute('placeholder', options.searchPlaceholder);\r\n input.addEventListener('input', e => {\r\n const key = e.target.value.toLowerCase();\r\n const source = filterSource(options.searchKeys, options.textKey, key, this.source);\r\n this._filllist(source);\r\n })\r\n search.append(input, createIcon('fa-light', 'search'));\r\n panel.appendChild(search);\r\n }\r\n // list\r\n const list = createElement('ul', 'ui-drop-list');\r\n if (!this.multiSelect) {\r\n list.addEventListener('click', e => {\r\n let li = e.target;\r\n while (li.tagName !== 'LI') {\r\n li = li.parentElement;\r\n if (li == null) {\r\n return;\r\n }\r\n }\r\n const value = li.dataset.value;\r\n if (this.select(value) !== false) {\r\n dropdownGlobal.clear();\r\n }\r\n });\r\n }\r\n panel.appendChild(list);\r\n this._var.container = panel;\r\n if (options.wrapper instanceof HTMLElement) {\r\n options.wrapper.appendChild(panel);\r\n } else {\r\n this._var.wrapper.appendChild(panel);\r\n }\r\n }\r\n if (flag) {\r\n let source = this.source;\r\n if (!options.input && options.search) {\r\n const search = panel.querySelector('.ui-drop-search > input');\r\n if (!nullOrEmpty(search?.value)) {\r\n source = filterSource(options.searchKeys, options.textKey, search.value, source);\r\n }\r\n }\r\n this._filllist(source);\r\n // slide direction\r\n if (!options.slideFixed) {\r\n const parent = options.wrapper ?? document.body;\r\n let p = this._var.wrapper;\r\n panel.style.minWidth = `${p.offsetWidth}px`;\r\n const headerHeight = p.offsetHeight;\r\n let top = p.offsetTop + headerHeight;\r\n let left = p.offsetLeft;\r\n if (p !== parent) {\r\n while ((p = p.parentElement) != null && p !== parent) {\r\n top -= p.scrollTop;\r\n left -= p.scrollLeft;\r\n }\r\n }\r\n p = this._var.wrapper;\r\n if (p !== parent) {\r\n while ((p = p.offsetParent) != null && p !== parent) {\r\n top += p.offsetTop;\r\n left += p.offsetLeft;\r\n }\r\n }\r\n const slideUp = top - parent.scrollTop + panel.offsetHeight >= parent.offsetHeight;\r\n if (options.wrapper instanceof HTMLElement) {\r\n if (slideUp) {\r\n panel.style.top = '';\r\n panel.style.bottom = `${parent.offsetHeight - top + headerHeight - 4}px`;\r\n } else {\r\n panel.style.top = `${top}px`;\r\n panel.style.bottom = '';\r\n }\r\n panel.style.left = `${left}px`;\r\n }\r\n if (slideUp) {\r\n panel.classList.add('slide-up');\r\n } else {\r\n panel.classList.remove('slide-up');\r\n }\r\n }\r\n panel.classList.add('active');\r\n } else {\r\n panel.classList.remove('active');\r\n }\r\n }\r\n\r\n _filllist(source) {\r\n const list = this._var.container.querySelector('.ui-drop-list');\r\n list.replaceChildren();\r\n const multiselect = this.multiSelect;\r\n const allchecked = this._var.allChecked;\r\n if (multiselect) {\r\n list.appendChild(\r\n createElement('li', null,\r\n createCheckbox({\r\n label: r('allItem', '( All )'),\r\n checked: allchecked,\r\n customAttributes: { 'isall': '1' },\r\n onchange: e => this._triggerselect(e.target)\r\n })\r\n )\r\n );\r\n }\r\n // TODO: virtual mode\r\n const valuekey = this._var.options.valueKey;\r\n const textkey = this._var.options.textKey;\r\n const htmlkey = this._var.options.htmlKey;\r\n const selected = this.selected;\r\n const selectedlist = this.selectedList;\r\n let scrolled;\r\n source.slice(0, 200).forEach((item, i) => {\r\n let val = item[valuekey];\r\n if (typeof val !== 'string') {\r\n val = String(val);\r\n }\r\n const li = createElement('li');\r\n li.dataset.value = val;\r\n li.setAttribute('title', item[textkey]);\r\n let label;\r\n const html = item[htmlkey];\r\n if (html instanceof HTMLElement) {\r\n label = html;\r\n } else if (typeof html === 'string') {\r\n label = createElement('span');\r\n label.innerHTML = html;\r\n }\r\n if (multiselect) {\r\n const selected = selectedlist.some(s => String(s[valuekey]) === val);\r\n if (label == null) {\r\n label = createElement('span');\r\n label.innerText = item[textkey];\r\n }\r\n const box = createCheckbox({\r\n label,\r\n checked: allchecked || selected,\r\n customAttributes: {\r\n 'class': 'dataitem',\r\n 'data-value': val\r\n },\r\n onchange: e => this._triggerselect(e.target)\r\n });\r\n li.appendChild(box);\r\n } else {\r\n if (label == null) {\r\n li.innerText = item[textkey];\r\n } else {\r\n li.appendChild(label);\r\n }\r\n if (selected != null && String(selected[valuekey]) === val) {\r\n scrolled = DropdownItemHeight * i;\r\n li.classList.add('selected');\r\n }\r\n }\r\n list.appendChild(li);\r\n });\r\n if (scrolled != null) {\r\n setTimeout(() => list.scrollTop = scrolled, 10);\r\n }\r\n }\r\n\r\n _triggerselect(checkbox) {\r\n let list;\r\n const valuekey = this._var.options.valueKey;\r\n const textkey = this._var.options.textKey;\r\n const htmlkey = this._var.options.htmlKey;\r\n if (checkbox.getAttribute('isall') === '1') {\r\n const allchecked = this._var.allChecked = checkbox.checked;\r\n const boxes = this._var.container.querySelectorAll('input.dataitem');\r\n boxes.forEach(box => box.checked = allchecked);\r\n list = [];\r\n } else if (checkbox.checked) {\r\n if (this._var.container.querySelectorAll('input.dataitem:not(:checked)').length === 0) {\r\n this._var.allChecked = true;\r\n this._var.container.querySelector('input[isall=\"1\"]').checked = true;\r\n list = [];\r\n } else {\r\n const source = this.source;\r\n list = [...this._var.container.querySelectorAll('input.dataitem:checked')]\r\n .map(c => {\r\n const v = c.dataset.value;\r\n return source.find(it => String(it[valuekey]) === v);\r\n })\r\n .filter(it => it != null);\r\n }\r\n } else {\r\n const val = checkbox.dataset.value;\r\n if (this._var.allChecked) {\r\n this._var.allChecked = false;\r\n this._var.container.querySelector('input[isall=\"1\"]').checked = false;\r\n list = this.source.filter(it => String(it[valuekey]) !== val);\r\n } else {\r\n list = this.selectedList.filter(it => String(it[valuekey]) !== val);\r\n }\r\n }\r\n if (this._var.allChecked) {\r\n this._var.label.innerText = r('allItem', '( All )');\r\n } else {\r\n selectItems(this._var.label, list, htmlkey, textkey);\r\n }\r\n this._var.selectedList = list;\r\n if (typeof this.onSelectedList === 'function') {\r\n this.onSelectedList(itemlist);\r\n }\r\n }\r\n\r\n static resolve(dom = document.body, trigger) {\r\n const selects = dom.querySelectorAll('select');\r\n for (let sel of selects) {\r\n const source = [...sel.children].map(it => {\r\n return { value: it.value, text: it.innerText }\r\n });\r\n const drop = new Dropdown({\r\n selected: sel.value,\r\n disabled: sel.disabled,\r\n tabIndex: sel.tabIndex\r\n });\r\n drop.source = source;\r\n if (typeof trigger === 'function') {\r\n drop.onSelected = item => trigger.call(drop, item);\r\n }\r\n sel.parentElement.replaceChild(drop.create(), sel);\r\n }\r\n return dom;\r\n }\r\n}","import \"./css/popup.scss\";\r\nimport { r } from \"../utility/lgres\";\r\nimport { nullOrEmpty } from \"../utility/strings\";\r\nimport { global } from \"../utility\";\r\nimport { createElement } from \"../functions\";\r\nimport { createIcon, changeIcon } from \"./icon\";\r\n\r\nconst ResizeMods = {\r\n right: 1,\r\n bottom: 2,\r\n left: 4,\r\n top: 8,\r\n bottomRight: 2 | 1,\r\n bottomLeft: 2 | 4,\r\n topRight: 8 | 1,\r\n topLeft: 8 | 4\r\n}\r\n\r\n// const Cursors = {\r\n// [ResizeMods.right]: 'ew-resize',\r\n// [ResizeMods.bottom]: 'ns-resize',\r\n// [ResizeMods.bottomRight]: 'nwse-resize',\r\n// [ResizeMods.left]: 'ew-resize',\r\n// [ResizeMods.bottomLeft]: 'nesw-resize',\r\n// [ResizeMods.top]: 'ns-resize',\r\n// [ResizeMods.topRight]: 'nesw-resize',\r\n// [ResizeMods.topLeft]: 'nwse-resize'\r\n// }\r\n\r\nfunction trimPx(px) {\r\n if (typeof px !== 'string') {\r\n return px;\r\n }\r\n if (px.endsWith('px')) {\r\n const size = Number(px.substring(0, px.length - 2));\r\n return isNaN(size) ? px : size;\r\n }\r\n return px;\r\n}\r\n\r\nexport class Popup {\r\n _var = {};\r\n // _var.mask;\r\n // _var.option;\r\n // _var.bounds;\r\n // _var.cursor;\r\n\r\n constructor(opts = {}) {\r\n this._var.option = opts;\r\n }\r\n\r\n get container() { return this._var.mask.querySelector('.ui-popup-container') }\r\n\r\n get rect() {\r\n const container = this.container;\r\n if (container == null) {\r\n return null;\r\n }\r\n const style = global.getComputedStyle(container);\r\n const collapsed = container.classList.contains('ui-popup-collapse');\r\n const bounds = this._var.bounds;\r\n return {\r\n collapsed,\r\n left: trimPx(style.left),\r\n top: trimPx(style.top),\r\n width: collapsed === true && bounds != null ? bounds.width : trimPx(style.width),\r\n height: collapsed === true && bounds != null ? bounds.height : trimPx(style.height)\r\n };\r\n }\r\n set rect(r) {\r\n const container = this.container;\r\n if (container == null) {\r\n return;\r\n }\r\n const css = [];\r\n if (!isNaN(r.left)) {\r\n css.push(`left: ${r.left}px`);\r\n }\r\n if (!isNaN(r.top)) {\r\n css.push(`top: ${r.top}px`);\r\n }\r\n const collapse = container.querySelector('.ui-popup-header-icons>.icon-expand');\r\n if (r.collapsed === true) {\r\n css.push('width: 160px', 'height: 40px');\r\n this._var.bounds = r;\r\n container.classList.add('ui-popup-collapse');\r\n if (collapse != null) {\r\n changeIcon(collapse, 'fa-regular', 'expand-alt');\r\n }\r\n } else {\r\n if (!isNaN(r.width) && r.width > 0) {\r\n css.push(`width: ${r.width}px`);\r\n }\r\n if (!isNaN(r.height) && r.height > 0) {\r\n css.push(`height: ${r.height}px`);\r\n }\r\n container.classList.remove('ui-popup-collapse');\r\n this._var.bounds = null;\r\n if (collapse != null) {\r\n changeIcon(collapse, 'fa-regular', 'compress-alt');\r\n }\r\n }\r\n if (css.length > 0) {\r\n container.style.cssText += css.join('; ');\r\n }\r\n }\r\n\r\n close(animation = true) {\r\n const mask = this._var.mask;\r\n if (animation) {\r\n mask.classList.add('ui-popup-active');\r\n mask.style.opacity = 0;\r\n setTimeout(() => { mask.remove(); }, 120);\r\n } else {\r\n mask.remove();\r\n }\r\n if (typeof this._var.option.onMasking === 'function') {\r\n this._var.option.onMasking.call(this, false);\r\n }\r\n if (typeof this._var.option.resolve === 'function') {\r\n this._var.option.resolve();\r\n }\r\n }\r\n\r\n create() {\r\n const mask = createElement('div', 'ui-popup-mask');\r\n const option = this._var.option;\r\n if (option.mask === false) {\r\n mask.classList.add('ui-popup-transparent');\r\n } else if (typeof option.onMasking === 'function') {\r\n option.onMasking.call(this, true);\r\n }\r\n if (!isNaN(option.zIndex)) {\r\n mask.style.zIndex = String(option.zIndex);\r\n }\r\n const container = createElement('div', 'ui-popup-container');\r\n if (option.changeZIndex === true) {\r\n container.addEventListener('mousedown', () => {\r\n const masks = [...this._var.mask.parentElement.children].filter(e => e.classList.contains('ui-popup-mask'));\r\n let max = 200;\r\n masks.forEach(m => {\r\n let index;\r\n if (m.dataset.zindex != null) {\r\n index = parseInt(m.dataset.zindex);\r\n m.style.zIndex = isNaN(index) ? '' : String(index);\r\n delete m.dataset.zindex;\r\n } else {\r\n index = parseInt(m.style.zIndex);\r\n }\r\n if (index > max) {\r\n max = index;\r\n }\r\n });\r\n mask.dataset.zindex = mask.style.zIndex;\r\n mask.style.zIndex = max + 1;\r\n });\r\n } else {\r\n\r\n }\r\n let tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0));\r\n if (tabIndex < 0) {\r\n tabIndex = 0;\r\n }\r\n container.tabIndex = tabIndex + 1;\r\n let content = option.content;\r\n if (!(content instanceof HTMLElement)) {\r\n content = createElement('div', d => d.innerText = content);\r\n }\r\n container.append(\r\n createElement('div', header => {\r\n header.className = 'ui-popup-header';\r\n let title = option.title;\r\n if (!(title instanceof HTMLElement)) {\r\n title = createElement('div', t => {\r\n if (option.movable === false) {\r\n t.className = 'ui-popup-header-title no-move';\r\n } else {\r\n t.className = 'ui-popup-header-title';\r\n }\r\n t.innerText = title;\r\n });\r\n }\r\n header.appendChild(title);\r\n if (option.movable !== false) {\r\n const move = header; // title.querySelector('.ui-popup-move') ?? title;\r\n move.addEventListener('mousedown', e => {\r\n if (['svg', 'use'].includes(e.target?.tagName)) {\r\n return;\r\n }\r\n if (e.buttons !== 1) {\r\n return;\r\n }\r\n const parent = option.mask === false ? mask.parentElement : mask;\r\n const x = e.clientX - container.offsetLeft;\r\n const y = e.clientY - container.offsetTop;\r\n let moved;\r\n const move = e => {\r\n if (e.buttons === 1) {\r\n container.style.left = `${e.clientX - x}px`;\r\n container.style.top = `${e.clientY - y}px`;\r\n moved = true;\r\n } else {\r\n parent.dispatchEvent(new MouseEvent('mouseup'));\r\n }\r\n };\r\n parent.addEventListener('mousemove', move, { passive: false });\r\n const up = () => {\r\n parent.removeEventListener('mousemove', move, { passive: false });\r\n parent.removeEventListener('mouseup', up);\r\n if (moved === true && typeof option.onMoveEnded === 'function') {\r\n option.onMoveEnded.call(this);\r\n }\r\n moved = false;\r\n };\r\n parent.addEventListener('mouseup', up);\r\n });\r\n }\r\n const icons = createElement('div', icons => {\r\n icons.className = 'ui-popup-header-icons';\r\n if (option.collapsable === true) {\r\n const collapse = createIcon('fa-regular', 'compress-alt');\r\n collapse.tabIndex = tabIndex + 2;\r\n collapse.classList.add('icon-expand');\r\n collapse.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n collapse.dispatchEvent(new MouseEvent('click'));\r\n }\r\n });\r\n collapse.addEventListener('click', () => {\r\n if (container.classList.contains('ui-popup-collapse')) {\r\n const bounds = this._var.bounds;\r\n if (bounds != null) {\r\n container.style.cssText += `width: ${bounds.width}px; height: ${bounds.height}px`;\r\n this._var.bounds = null;\r\n }\r\n container.classList.remove('ui-popup-collapse');\r\n changeIcon(collapse, 'fa-regular', 'compress-alt');\r\n } else {\r\n const rect = this.rect;\r\n this._var.bounds = rect;\r\n container.style.cssText += `width: 160px; height: 40px`;\r\n container.classList.add('ui-popup-collapse');\r\n changeIcon(collapse, 'fa-regular', 'expand-alt');\r\n }\r\n if (typeof option.onResizeEnded === 'function') {\r\n option.onResizeEnded.call(this);\r\n }\r\n });\r\n icons.appendChild(collapse);\r\n }\r\n if (option.closable !== false) {\r\n const cancel = createIcon('fa-regular', 'times');\r\n cancel.tabIndex = tabIndex + 3;\r\n cancel.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n this.close();\r\n }\r\n });\r\n cancel.addEventListener('click', () => this.close());\r\n icons.appendChild(cancel);\r\n }\r\n });\r\n header.appendChild(icons);\r\n }),\r\n createElement('div', 'ui-popup-body', content, createElement('div', 'ui-popup-loading',\r\n createElement('div', null, createIcon('fa-regular', 'spinner-third'))\r\n ))\r\n );\r\n if (Array.isArray(option.buttons) && option.buttons.length > 0) {\r\n tabIndex = Math.max.apply(null, [...container.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0));\r\n container.appendChild(\r\n createElement('div', 'ui-popup-footer', ...option.buttons.map((b, i) => {\r\n const button = createElement('button', 'ui-popup-button');\r\n if (b.tabIndex > 0) {\r\n button.tabIndex = b.tabIndex;\r\n } else {\r\n button.tabIndex = tabIndex + i + 1;\r\n }\r\n button.innerText = b.text;\r\n button.addEventListener('click', () => {\r\n if (typeof b.trigger === 'function') {\r\n const result = b.trigger(this);\r\n if (typeof result?.then === 'function') {\r\n result.then(r => {\r\n if (r !== false) {\r\n this.close();\r\n }\r\n }).catch(reason => console.warn(reason));\r\n } else if (result !== false) {\r\n this.close();\r\n }\r\n } else {\r\n this.close();\r\n }\r\n });\r\n return button;\r\n }))\r\n );\r\n const tabs = [...container.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0);\r\n const tabMin = Math.min.apply(null, tabs);\r\n const tabMax = Math.max.apply(null, tabs);\r\n const last = container.querySelector(`[tabindex=\"${tabMax}\"]`);\r\n if (last != null) {\r\n last.addEventListener('keydown', e => {\r\n if (e.key === 'Tab') {\r\n const first = container.querySelector(`[tabindex=\"${tabMin}\"]`);\r\n first?.focus();\r\n e.preventDefault();\r\n }\r\n });\r\n }\r\n } else {\r\n container.querySelector('.ui-popup-body>.ui-popup-loading').classList.add('ui-popup-loading-content');\r\n }\r\n // resizable\r\n if (option.resizable === true) {\r\n container.append(\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-right';\r\n layer.addEventListener('mousedown', e => this._resize(ResizeMods.right, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-bottom';\r\n layer.addEventListener('mousedown', e => this._resize(ResizeMods.bottom, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-left';\r\n layer.addEventListener('mousedown', e => this._resize(ResizeMods.left, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-top';\r\n layer.addEventListener('mousedown', e => this._resize(ResizeMods.top, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-bottom-right';\r\n layer.addEventListener('mousedown', e => this._resize(ResizeMods.bottomRight, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-bottom-left';\r\n layer.addEventListener('mousedown', e => this._resize(ResizeMods.bottomLeft, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-top-left';\r\n layer.addEventListener('mousedown', e => this._resize(ResizeMods.topLeft, e));\r\n }),\r\n createElement('layer', layer => {\r\n layer.className = 'ui-popup-border ui-popup-border-top-right';\r\n layer.addEventListener('mousedown', e => this._resize(ResizeMods.topRight, e));\r\n })\r\n )\r\n }\r\n mask.appendChild(container);\r\n this._var.mask = mask;\r\n return mask;\r\n }\r\n\r\n show(parent = document.body) {\r\n if (parent == null) {\r\n return;\r\n }\r\n let mask = this._var.mask ?? this.create();\r\n // const exists = [...parent.children].filter(e => e.classList.contains('ui-popup-mask'));\r\n const exists = parent.querySelectorAll('.ui-popup-mask');\r\n let zindex = 0;\r\n for (let ex of exists) {\r\n let z = parseInt(ex.style.zIndex);\r\n if (!isNaN(z) && z > zindex) {\r\n zindex = z;\r\n }\r\n }\r\n if (zindex > 0) {\r\n mask.style.zIndex = String(zindex + 1);\r\n }\r\n parent.appendChild(mask);\r\n if (this._var.option.mask === false) {\r\n // calculator position\r\n const container = this.container;\r\n container.style.left = String((parent.offsetWidth - container.offsetWidth) / 2) + 'px';\r\n container.style.top = String((parent.offsetHeight - container.offsetHeight) / 2) + 'px';\r\n }\r\n return new Promise(resolve => {\r\n setTimeout(() => {\r\n mask.style.opacity = 1;\r\n this.container.focus();\r\n resolve(mask);\r\n }, 0);\r\n });\r\n }\r\n\r\n get loading() { return this._var.mask?.querySelector('.ui-popup-body>.ui-popup-loading')?.style?.visibility === 'visible' }\r\n set loading(flag) {\r\n let loading = this._var.mask?.querySelector('.ui-popup-body>.ui-popup-loading');\r\n if (loading == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n loading.style.visibility = 'hidden';\r\n loading.style.opacity = 0;\r\n } else {\r\n loading.style.visibility = 'visible';\r\n loading.style.opacity = 1;\r\n }\r\n }\r\n\r\n _resize(mod, e) {\r\n if (e.buttons !== 1) {\r\n return;\r\n }\r\n const container = this.container;\r\n const option = this._var.option;\r\n if (typeof option.onResizeStarted === 'function') {\r\n option.onResizeStarted.call(this);\r\n }\r\n const mask = this._var.mask;\r\n // this._var.cursor = mask.style.cursor;\r\n // mask.style.cursor = Cursors[mod];\r\n const originalX = e.clientX;\r\n const originalY = e.clientY;\r\n const original = {\r\n width: container.offsetWidth,\r\n height: container.offsetHeight,\r\n left: container.offsetLeft,\r\n top: container.offsetTop\r\n };\r\n const minWidth = option.minWidth ?? 200;\r\n const minHeight = option.minHeight ?? 200;\r\n let resized;\r\n const parent = option.mask === false ? mask.parentElement : mask;\r\n const move = e => {\r\n if (e.buttons !== 1) {\r\n parent.dispatchEvent(new MouseEvent('mouseup'));\r\n return;\r\n }\r\n const offsetX = e.clientX - originalX;\r\n const offsetY = e.clientY - originalY;\r\n let width = original.width;\r\n let height = original.height;\r\n let x = original.left;\r\n let y = original.top;\r\n if ((mod & ResizeMods.right) === ResizeMods.right) {\r\n width += offsetX;\r\n if (width < minWidth) {\r\n width = minWidth;\r\n }\r\n }\r\n if ((mod & ResizeMods.bottom) === ResizeMods.bottom) {\r\n height += offsetY;\r\n if (height < minHeight) {\r\n height = minHeight;\r\n }\r\n }\r\n if ((mod & ResizeMods.left) === ResizeMods.left) {\r\n width -= offsetX;\r\n if (width < minWidth) {\r\n width = minWidth;\r\n x = originalX + original.width - minWidth;\r\n } else {\r\n x += offsetX;\r\n }\r\n }\r\n if ((mod & ResizeMods.top) === ResizeMods.top) {\r\n height -= offsetY;\r\n if (height < minHeight) {\r\n height = minHeight;\r\n y = originalY + original.height - minHeight;\r\n } else {\r\n y += offsetY;\r\n }\r\n }\r\n if (typeof option.onResizing === 'function') {\r\n option.onResizing.call(this, x, y, width, height);\r\n } else {\r\n container.style.cssText += `left: ${x}px; top: ${y}px; width: ${width}px; height: ${height}px`;\r\n }\r\n resized = true;\r\n }\r\n parent.addEventListener('mousemove', move, { passive: false });\r\n const up = () => {\r\n parent.removeEventListener('mousemove', move, { passive: false });\r\n parent.removeEventListener('mouseup', up);\r\n // mask.style.cursor = this._var.cursor;\r\n if (resized === true && typeof option.onResizeEnded === 'function') {\r\n option.onResizeEnded.call(this);\r\n }\r\n resized = false;\r\n };\r\n parent.addEventListener('mouseup', up);\r\n }\r\n}\r\n\r\nexport function createPopup(title, content, ...buttons) {\r\n const popup = new Popup({\r\n title,\r\n content,\r\n buttons\r\n });\r\n return popup;\r\n}\r\n\r\nconst iconTypes = {\r\n 'info': 'info-circle',\r\n 'information': 'info-circle',\r\n 'warn': 'exclamation-triangle',\r\n 'warning': 'exclamation-triangle',\r\n 'question': 'question-circle',\r\n 'error': 'times-circle'\r\n}\r\n\r\nexport function showAlert(title, message, iconType = 'info', parent = document.body) {\r\n return new Promise(resolve => {\r\n const popup = new Popup({\r\n title,\r\n content: createElement('div', 'message-wrapper',\r\n createIcon('fa-solid', iconTypes[iconType] ?? 'info-circle'),\r\n createElement('span', span => span.innerText = message)\r\n ),\r\n resolve,\r\n buttons: [\r\n { text: r('ok', 'OK'), trigger: resolve }\r\n ]\r\n });\r\n popup.show(parent).then(mask => {\r\n const button = mask.querySelector('.ui-popup-container .ui-popup-footer .ui-popup-button:last-child');\r\n button?.focus();\r\n });\r\n });\r\n}\r\n\r\nexport function showConfirm(title, content, buttons, iconType = 'question', parent = document.body) {\r\n return new Promise(resolve => {\r\n const wrapper = createElement('div', 'message-wrapper');\r\n if (!nullOrEmpty(iconType)) {\r\n wrapper.appendChild(createIcon('fa-solid', iconTypes[iconType] ?? 'question-circle'));\r\n }\r\n wrapper.appendChild(content instanceof HTMLElement ?\r\n content :\r\n createElement('span', span => span.innerText = content));\r\n const popup = new Popup({\r\n title,\r\n content: wrapper,\r\n resolve,\r\n buttons: buttons?.map(b => {\r\n return {\r\n text: b.text,\r\n trigger: p => {\r\n let result;\r\n if (typeof b.trigger === 'function') {\r\n result = b.trigger(p, b);\r\n if (typeof result?.then === 'function') {\r\n return result.then(r => {\r\n r !== false && resolve(r);\r\n return r;\r\n });\r\n }\r\n result !== false && resolve(result);\r\n } else {\r\n result = {\r\n key: b.key,\r\n popup: p\r\n };\r\n resolve(result);\r\n }\r\n return result;\r\n }\r\n };\r\n }) ??\r\n [\r\n { text: r('yes', 'Yes'), trigger: p => resolve({ key: 'yes', popup: p }) },\r\n { text: r('no', 'No'), trigger: p => resolve({ key: 'no', popup: p }) }\r\n ]\r\n });\r\n popup.show(parent).then(mask => {\r\n const button = mask.querySelector('.ui-popup-container .ui-popup-footer .ui-popup-button:last-child');\r\n button?.focus();\r\n });\r\n });\r\n}","export function validation(element, regex) {\r\n if (element instanceof HTMLElement && regex instanceof RegExp) {\r\n element.addEventListener('change', e => {\r\n if (regex.test(e.target.value)) {\r\n e.target.classList.remove('validation-error');\r\n } else {\r\n e.target.classList.add('validation-error');\r\n }\r\n })\r\n }\r\n return element;\r\n}\r\n\r\nexport function convertCssStyle(style) {\r\n return Object.entries(style).map(s => `${s[0]}: ${s[1]}`).join('; ');\r\n}","import { createElement } from \"../functions\";\r\n\r\n/**\r\n * 创建或转换日期选择框\r\n * @param {string} [min] - 最小可选日期\r\n * @param {string} [max] - 最大可选日期\r\n * @param {HTMLInputElement | string} [element] - 转换该元素为日期选择框\r\n * @returns {HTMLInputElement} 返回创建或转换的日期选择框\r\n */\r\nexport function createDateInput(min, max, element) {\r\n let date;\r\n if (typeof element === 'string') {\r\n element = document.querySelector(element);\r\n }\r\n if (element instanceof HTMLInputElement) {\r\n date = element;\r\n date.classList.add('ui-date-cell');\r\n } else {\r\n date = createElement('input', 'ui-date-cell');\r\n }\r\n date.required = true;\r\n date.type = 'date';\r\n if (min != null) {\r\n date.min = min;\r\n }\r\n if (max != null) {\r\n date.max = max;\r\n }\r\n return date;\r\n}\r\n\r\n/**\r\n * 将日期转换为 `yyyy-MM-dd` 格式的字符串\r\n * @param {Date} dt 要转换的日期值\r\n * @returns 返回 `yyyy-MM-dd` 格式的字符串\r\n */\r\nexport function toDateValue(dt) {\r\n if (isNaN(dt)) {\r\n return '';\r\n }\r\n const month = String(dt.getMonth() + 1).padStart(2, '0');\r\n const date = String(dt.getDate()).padStart(2, '0');\r\n return `${dt.getFullYear()}-${month}-${date}`;\r\n}\r\n\r\nfunction resolveDate(s) {\r\n if (s instanceof Date) {\r\n return s;\r\n }\r\n const ticks = Number(s);\r\n if (!isNaN(ticks) && ticks > 0) {\r\n return new Date((ticks - 621355968e9) / 1e4);\r\n }\r\n return new Date(s);\r\n}\r\n\r\n/**\r\n * 格式化日期为 M/d/yyyy 格式的字符串\r\n * @param {Date | number | string} date - 需要格式化的日期值,支持的格式如下:\r\n * \r\n * * `\"2024-01-26\"`\r\n * * `\"2024-01-26T00:00:00\"`\r\n * * `\"1/26/2024\"`\r\n * * `\"638418240000000000\"`\r\n * * `new Date('2024-01-26')`\r\n * @returns {string} 返回格式化后的日期字符串\r\n */\r\nexport function formatDate(date) {\r\n date = resolveDate(date);\r\n if (date instanceof Date && !isNaN(date)) {\r\n return `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`;\r\n }\r\n return '';\r\n}\r\n\r\n/**\r\n * 设置显示日期\r\n * @param {HTMLElement} element - 要设置显示日期的元素\r\n * @param {Date | number | string} val - 日期值,支持格式参见 {@linkcode formatDate}\r\n */\r\nexport function setDateValue(element, val) {\r\n if (element.tagName === 'INPUT') {\r\n if (val === '') {\r\n element.value = '';\r\n } else if (isNaN(val)) {\r\n if (/^\\d{4}-\\d{2}-\\d{2}/.test(val)) {\r\n element.value = String(val).substring(0, 10);\r\n } else if (/^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/.test(val)) {\r\n element.value = toDateValue(new Date(val));\r\n } else {\r\n element.value = '';\r\n }\r\n } else {\r\n if (!(val instanceof Date)) {\r\n val = new Date((val - 621355968e9) / 1e4);\r\n }\r\n element.value = toDateValue(val);\r\n }\r\n } else {\r\n element.innerText = formatDate(val);\r\n }\r\n}\r\n\r\n/**\r\n * 自定义日期格式化回调函数\r\n * @callback DateFormatterCallback\r\n * @param {Date} date - 日期值\r\n * @returns {any} 返回格式化后的结果\r\n */\r\n\r\n/**\r\n * 从日期选择框获取日期值\r\n * @param {HTMLInputElement} element - 要获取的日期选择框\r\n * @param {DateFormatterCallback} [formatter] - 自定义格式化函数,传入参数为 `Date` 类型\r\n * @returns {string | any} 默认返回日期 `ticks` 的字符串\r\n */\r\nexport function getDateValue(element, formatter) {\r\n const date = element?.valueAsDate;\r\n if (date instanceof Date && !isNaN(date)) {\r\n const year = date.getFullYear();\r\n if (year < 1900 || year > 9999) {\r\n return '';\r\n }\r\n if (typeof formatter === 'function') {\r\n return formatter(date);\r\n }\r\n return String(date.getTime() * 1e4 + 621355968e9);\r\n }\r\n return '';\r\n}\r\n\r\n/**\r\n * 日期选择框类\r\n * @class\r\n */\r\nexport class DateSelector {\r\n _var = {\r\n options: null\r\n };\r\n\r\n /**\r\n * 日期发生变化时触发的事件\r\n * @event\r\n * @param {Date} date - 修改后的日期值\r\n * @this DateSelector\r\n */\r\n onDateChanged;\r\n\r\n /**\r\n * 日期选择框构造函数\r\n * @constructor\r\n * @param {object} [opts] - 日期选择框初始化参数\r\n * @param {boolean} [opts.enabled] - 是否可用\r\n * @param {string} [opts.minDate] - 最小可选择日期\r\n * @param {string} [opts.maxDate] - 最大可选择日期\r\n * @param {DateFormatterCallback} [opts.valueFormatter] - 自定义格式化函数\r\n * @example <caption>创建一个 DateSelector 并插入到元素中</caption>\r\n * <div id=\"dateFrom\"></div>\r\n * @example\r\n * // 构造参数\r\n * const opts = {\r\n * minDate: '2020-01-01',\r\n * maxDate: '2024-02-01',\r\n * valueFormatter: (date) => {\r\n * return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`; // 2024/1/31\r\n * }\r\n * };\r\n * const dateSelectorFrom = new DateSelector(opts);\r\n * document.querySelector('#dateFrom').appendChild(dateSelectorFrom.create());\r\n * @example <caption>将一个元素转化为 DateSelector</caption>\r\n * <input id=\"dateTo\"></div>\r\n * @example\r\n * const dateSelectorTo = new DateSelector();\r\n * dateSelectorTo.create('#dateTo');\r\n */\r\n constructor(opts) {\r\n this._var.options = opts ?? {};\r\n }\r\n\r\n /**\r\n * 创建或转换日期选择框元素\r\n * @param {HTMLInputElement | string} [element] - 转换该元素为日期选择框\r\n * @returns {HTMLInputElement} 返回创建或转换的日期选择元素\r\n */\r\n create(element) {\r\n const opts = this._var.options;\r\n const el = createDateInput(opts.minDate, opts.maxDate, element);\r\n if (element == null) {\r\n el.disabled = opts.enabled === false;\r\n }\r\n el.addEventListener('blur', e => {\r\n const date = this._getDate(e.target.valueAsDate);\r\n if (date == null) {\r\n e.target.value = '';\r\n }\r\n if (typeof this.onDateChanged === 'function') {\r\n this.onDateChanged(date);\r\n }\r\n });\r\n this._var.el = el;\r\n return el;\r\n }\r\n\r\n /**\r\n * 获取日期选择框元素\r\n * @readonly\r\n * @type {HTMLInputElement}\r\n */\r\n get element() { return this._var.el }\r\n\r\n /**\r\n * 获取或设置日期选择框是否启用\r\n * @type {boolean}\r\n */\r\n get enabled() { return !this._var.el.disabled }\r\n set enabled(flag) {\r\n this._var.el.disabled = flag === false;\r\n }\r\n\r\n /**\r\n * 获取格式化的日期值,或设置日期值,支持的格式参见 {@linkcode formatDate}\r\n * @type {string | any}\r\n */\r\n get value() { return this._getDate(this._var.el.valueAsDate) }\r\n set value(val) {\r\n setDateValue(this._var.el, val);\r\n }\r\n\r\n /**\r\n * 获取或设置最小可选择日期\r\n * @type {string}\r\n */\r\n get minDate() { return this._var.el.min }\r\n set minDate(date) {\r\n this._var.el.min = date;\r\n this._var.options.minDate = date;\r\n }\r\n\r\n /**\r\n * 获取或设置最大可选择日期\r\n * @type {string}\r\n */\r\n get maxDate() { return this._var.el.max }\r\n set maxDate(date) {\r\n this._var.el.max = date;\r\n this._var.options.maxDate = date;\r\n }\r\n\r\n _getDate(date) {\r\n if (date instanceof Date && !isNaN(date)) {\r\n const year = date.getFullYear();\r\n if (year < 1900 || year > 9999) {\r\n return null;\r\n }\r\n if (typeof this._var.options.valueFormatter === 'function') {\r\n return this._var.options.valueFormatter(date);\r\n }\r\n return date;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * 把父容器下所有匹配 `input[data-type=\"date\"]` 的元素修改为统一的日期选择框<br/><br/>\r\n * 解析的属性为 `id`, `class`, `data-min`, `data-max`, `disabled`\r\n * @static\r\n * @param {HTMLElement} [dom=document.body] 父元素\r\n * @param {Function} [trigger] 日期设置事件触发函数\r\n * @param {Date} trigger.{this} - 上下文为触发设置日期的 `DateSelector` 实例\r\n * @param {Date} trigger.date - 修改后的日期值\r\n * @example <caption>HTML</caption>\r\n * <input id=\"dateFrom\" data-type=\"date\" data-min=\"1980-01-01\"/>\r\n * @example <caption>解析父容器</caption>\r\n * // 解析 document.body 下所有符合条件的元素,转换为日期选择框,第二个参数可选\r\n * DateSelector.resolve(document.body, function (date) {\r\n * console.log(`element(#${this.element.id}), date changed to: ${formatDate(date)}`);\r\n * // 当日期选择改变时控制台将会输出element(#dateFrom), date changed to: 1/30/2024\r\n * });\r\n * @example <caption>其他地方调用时</caption>\r\n * const value = document.querySelector('#dateFrom').value;\r\n * console.log(`dateFrom.value = '${value}', formatted: '${formatDate(value)}'`);\r\n * // 控制台会输出dateFrom.value = '2024-01-30', formatted: '1/30/2024'\r\n */\r\n static resolve(dom = document.body, trigger) {\r\n const dates = dom.querySelectorAll('input[data-type=\"date\"]');\r\n for (let dat of dates) {\r\n const val = dat.value;\r\n const dateSelector = new DateSelector({\r\n minDate: dat.getAttribute('data-min'),\r\n maxDate: dat.getAttribute('data-max')\r\n });\r\n if (typeof trigger === 'function') {\r\n dateSelector.onDateChanged = date => trigger.call(dateSelector, date);\r\n }\r\n dat.removeAttribute('data-type');\r\n dat.removeAttribute('data-min');\r\n dat.removeAttribute('data-max');\r\n dateSelector.create(dat);\r\n dateSelector.value = val;\r\n }\r\n }\r\n}","import { global } from \"../../utility\";\r\nimport { createElement } from \"../../functions\";\r\nimport { createIcon } from \"../icon\";\r\nimport { createCheckbox, createRadiobox } from \"../checkbox\";\r\n// import { setTooltip } from \"../tooltip\";\r\nimport { Dropdown } from \"../dropdown\";\r\nimport { convertCssStyle } from \"../extension\";\r\nimport { createDateInput, formatDate, setDateValue, getDateValue } from \"../date\";\r\n// definition\r\nimport { GridRowItem, DropdownOptions, GridColumnDefinition, GridSourceItem, GridItemWrapper, Grid } from \"./grid\";\r\n\r\n/**\r\n * @ignore\r\n * @callback DropExpandedCallback\r\n * @param {GridRowItem} item - 行数据对象\r\n * @param {Dropdown} drop - 下拉框对象\r\n * @this GridColumnDefinition\r\n */\r\n\r\n/**\r\n * 列定义基类\r\n * \r\n * _函数调用流程图示_<br/>\r\n * <img src=\"./assets/column-refresh.jpg\" alt=\"Column Refresh\"/>\r\n * @class\r\n * @static\r\n * @hideconstructor\r\n */\r\nexport class GridColumn {\r\n /**\r\n * 该属性返回 `true` 后,在任意事件中修改行包装对象的 `__editing` 值,则会在行列元素变动时及时触发 [onChanged]{@linkcode GridColumnDefinition#onChanged} 方法,避免例如文本框和日期框还未触发事件就被移除元素而导致的问题\r\n * @member\r\n * @name GridColumn.editing\r\n * @readonly\r\n * @type {boolean}\r\n * @see 更多例子参考 {@linkcode GridInputColumn} {@linkcode GridDateColumn} 中的代码实现\r\n */\r\n\r\n /**\r\n * 标记该类型是否可编辑\r\n * @member\r\n * @name GridColumn.canEdit\r\n * @readonly\r\n * @type {boolean}\r\n */\r\n\r\n /**\r\n * 创建显示单元格时调用的方法\r\n * @param {GridColumnDefinition} col - 列定义对象\r\n * @param {number} index - 行元素索引(需要配合 [startIndex]{@linkcode Grid#startIndex} 相加得到真实数据索引)\r\n * @param {Grid} grid - Grid 实例\r\n * @returns {HTMLElement} 返回创建的单元格元素\r\n * @virtual\r\n */\r\n static create() {\r\n return createElement('span');\r\n }\r\n\r\n /**\r\n * 创建编辑单元格时调用的方法\r\n * \r\n * 元素修改后设置行包装对象的 `__editing` 后,支持在离开编辑状态时及时触发 [leaveEdit]{@linkcode GridColumn.leaveEdit} 方法<br/>\r\n * 更多例子参考代码中 {@linkcode GridDropdownColumn} 的实现。\r\n * @method\r\n * @name GridColumn.createEdit\r\n * @param {Function} trigger - 编辑事件回调函数\r\n * @param {any} trigger.e - 该参数会传递给 [getValue]{@linkcode GridColumn.getValue} 方法\r\n * @param {GridColumnDefinition} col - 列定义对象\r\n * @param {HTMLElement} [container] - 父容器元素\r\n * @param {GridItemWrapper} [wrapper] - 行包装对象,其 `values` 属性为行数据对象\r\n * @returns {HTMLElement} 返回创建的编辑状态的单元格元素\r\n * @virtual\r\n */\r\n\r\n /**\r\n * 创建列头时调用的方法\r\n * @method\r\n * @name GridColumn.createCaption\r\n * @param {GridColumnDefinition} col - 列定义对象\r\n * @returns {HTMLElement} 返回创建的列头元素\r\n * @virtual\r\n */\r\n\r\n /**\r\n * 获取用于判断文本大小的元素\r\n * @method\r\n * @name GridColumn.getElement\r\n * @param {HTMLElement} element - 单元格主内容元素\r\n * @returns {HTMLElement} 返回文本元素\r\n * @virtual\r\n */\r\n\r\n /**\r\n * 获取编辑状态单元格值时调用的方法\r\n * @method\r\n * @name GridColumn.getValue\r\n * @param {any} e - 由 [createEdit]{@linkcode GridColumn.createEdit} 方法中 `trigger` 函数传递来的对象\r\n * @param {GridColumnDefinition} col - 列定义对象\r\n * @returns {(string | boolean | number)} 返回单元格的值\r\n * @virtual\r\n */\r\n\r\n /**\r\n * 设置单元格值时调用的方法\r\n * @param {HTMLElement} element - 单元格元素\r\n * @param {(string | boolean | number)} val - 待设置的单元格值\r\n * @param {GridItemWrapper} wrapper - 行包装对象\r\n * @param {GridColumnDefinition} col - 列定义对象\r\n * @param {Grid} grid - Grid 对象\r\n * @virtual\r\n */\r\n static setValue(element, val) {\r\n element.innerText = val;\r\n }\r\n\r\n /**\r\n * 设置单元格样式时调用的方法\r\n * @param {HTMLElement} element - 单元格元素\r\n * @param {object} style - 样式对象\r\n * @virtual\r\n */\r\n static setStyle(element, style) {\r\n // for (let css of Object.entries(style)) {\r\n // element.style.setProperty(css[0], css[1]);\r\n // }\r\n element.style.cssText = convertCssStyle(style);\r\n }\r\n\r\n /**\r\n * 设置单元格类名时调用的方法\r\n * @param {HTMLElement} element - 单元格元素\r\n * @param {string} name - 要设置的类名\r\n * @virtual\r\n */\r\n static setClass(element, name) {\r\n element.className = name ?? '';\r\n }\r\n\r\n /**\r\n * 设置单元格可用性时调用的方法\r\n * @param {HTMLElement} element - 单元格元素\r\n * @param {boolean} enabled - 启用值,为 `false` 时代表禁用\r\n * @param {boolean} editing - 是否处于编辑状态\r\n * @virtual\r\n */\r\n static setEnabled(element, enabled) {\r\n const tooltip = element.querySelector('.ui-tooltip-wrapper');\r\n if (tooltip != null) {\r\n tooltip.style.display = enabled === false ? 'none' : '';\r\n }\r\n }\r\n\r\n /**\r\n * 单元格编辑状态发生改变时调用的方法\r\n * @method\r\n * @name GridColumn.setEditing\r\n * @param {HTMLElement} element - 单元格元素\r\n * @param {boolean} editing - 是否处于编辑状态\r\n * @virtual\r\n */\r\n\r\n /**\r\n * 单元格离开编辑元素时调用的方法,需要由行包装对象的 `__editing` 来确定是否触发。\r\n * @method\r\n * @name GridColumn.leaveEdit\r\n * @param {HTMLElement} element - 单元格元素\r\n * @param {HTMLElement} container - 父容器元素\r\n * @virtual\r\n */\r\n\r\n /**\r\n * @ignore\r\n */\r\n static toString() { return 'GridCommon' }\r\n\r\n /**\r\n * @ignore\r\n * @param {string} key \r\n * @param {GridItemWrapper} wrapper \r\n * @param {any} value \r\n */\r\n static _changeValue(key, wrapper, value) {\r\n const val = wrapper.values[key] ?? null;\r\n const hasValue = val != null && Object.prototype.hasOwnProperty.call(val, 'Value');\r\n if (wrapper.__editing == null) {\r\n wrapper.__editing = {\r\n [key]: hasValue ? val.Value : val\r\n }\r\n } else if (!Object.prototype.hasOwnProperty.call(wrapper.__editing, key)) {\r\n wrapper.__editing[key] = hasValue ? val.Value : val;\r\n }\r\n if (hasValue) {\r\n val.Value = value;\r\n if (Object.prototype.hasOwnProperty.call(val, 'DisplayValue')) {\r\n val.DisplayValue = value;\r\n }\r\n } else {\r\n wrapper.values[key] = value;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * 单行文本输入列\r\n * @class\r\n * @static\r\n * @extends GridColumn\r\n * @hideconstructor\r\n */\r\nexport class GridInputColumn extends GridColumn {\r\n static get editing() { return true };\r\n static get canEdit() { return true };\r\n\r\n /**\r\n * @ignore\r\n * @param {Function} trigger \r\n * @param {GridColumnDefinition} col \r\n * @param {HTMLElement} _container \r\n * @param {GridItemWrapper} wrapper \r\n * @returns {HTMLElement}\r\n */\r\n static createEdit(trigger, col, _container, wrapper) {\r\n const input = createElement('input');\r\n input.setAttribute('type', 'text');\r\n input.addEventListener('input', () => super._changeValue(col.key, wrapper, input.value));\r\n input.addEventListener('change', trigger);\r\n return input;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {string} val \r\n */\r\n static setValue(element, val) {\r\n if (element.tagName !== 'INPUT') {\r\n super.setValue(element, val);\r\n } else {\r\n element.value = val;\r\n }\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {Event} e \r\n * @returns {string}\r\n */\r\n static getValue(e) { return e.target.value }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {boolean} enabled \r\n */\r\n static setEnabled(element, enabled) {\r\n super.setEnabled(element, enabled);\r\n element.disabled = enabled === false;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n static toString() { return 'GridInput' }\r\n}\r\n\r\n/**\r\n * 多行文本输入列\r\n * @class\r\n * @static\r\n * @extends GridInputColumn\r\n * @hideconstructor\r\n * @ignore\r\n */\r\nexport class GridTextColumn extends GridInputColumn {\r\n /**\r\n * @ignore\r\n * @param {Function} trigger \r\n * @param {GridColumnDefinition} col \r\n * @param {HTMLElement} _container \r\n * @param {GridItemWrapper} wrapper \r\n * @returns {HTMLElement}\r\n */\r\n static createEdit(trigger, col, _container, wrapper) {\r\n const input = createElement('textarea');\r\n input.addEventListener('input', () => super._changeValue(col.key, wrapper, input.value));\r\n input.addEventListener('change', trigger);\r\n return input;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {string} val \r\n * @param {GridItemWrapper} _wrapper \r\n * @param {GridColumnDefinition} _col \r\n * @param {Grid} grid \r\n */\r\n static setValue(element, val, _wrapper, _col, grid) {\r\n if (element.tagName !== 'TEXTAREA') {\r\n super.setValue(element, val);\r\n } else {\r\n element.value = val;\r\n if (val != null) {\r\n const lines = String(val).split('\\n').length;\r\n element.style.height = `${lines * grid.lineHeight + 12}px`;\r\n }\r\n // TODO: bad performance\r\n }\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n static toString() { return 'GridText' }\r\n}\r\n\r\nconst SymbolDropdown = Symbol.for('ui-dropdown');\r\n\r\n/**\r\n * 下拉选择列\r\n * @class\r\n * @static\r\n * @extends GridColumn\r\n * @hideconstructor\r\n */\r\nexport class GridDropdownColumn extends GridColumn {\r\n static get canEdit() { return true };\r\n\r\n /**\r\n * @ignore\r\n * @returns {HTMLElement}\r\n */\r\n static create() {\r\n return createElement('span', 'ui-drop-span', createElement('span'));\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {Function} trigger \r\n * @param {GridColumnDefinition} col \r\n * @param {HTMLElement} container \r\n * @param {GridItemWrapper} wrapper \r\n * @returns {HTMLElement}\r\n */\r\n static createEdit(trigger, col, container, wrapper) {\r\n const drop = new Dropdown({\r\n ...col.dropOptions,\r\n wrapper: container.parentElement\r\n });\r\n drop.onSelected = trigger;\r\n drop.onExpanded = () => {\r\n if (wrapper.__editing == null) {\r\n wrapper.__editing = {\r\n [col.key]: true\r\n }\r\n } else {\r\n wrapper.__editing[col.key] = true;\r\n }\r\n if (typeof col.onDropExpanded === 'function') {\r\n col.onDropExpanded.call(col, wrapper.values, drop);\r\n }\r\n };\r\n return drop.create();\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @returns {HTMLElement}\r\n */\r\n static getElement(element) {\r\n if (element.tagName === 'DIV') {\r\n return element.children[0].children[0];\r\n }\r\n return element.children[0];\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {HTMLElement} element \r\n * @returns {Dropdown}\r\n */\r\n static _getDrop(element) {\r\n /**\r\n * @type {Map<string, Dropdown>}\r\n */\r\n const dropGlobal = global[SymbolDropdown];\r\n if (dropGlobal == null) {\r\n return null;\r\n }\r\n const dropId = element.dataset.dropId;\r\n const drop = dropGlobal[dropId];\r\n if (drop == null) {\r\n return null;\r\n }\r\n return drop;\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {GridItemWrapper} wrapper \r\n * @param {GridColumnDefinition} col \r\n * @returns {GridSourceItem[]}\r\n */\r\n static _getSource(wrapper, col) {\r\n let source;\r\n if (col.sourceCache !== false) {\r\n source = wrapper.source?.[col.key];\r\n if (source != null) {\r\n return source;\r\n }\r\n }\r\n source = col.source;\r\n if (typeof source === 'function') {\r\n source = source(wrapper.values);\r\n }\r\n if (col.sourceCache !== false) {\r\n if (wrapper.source == null) {\r\n wrapper.source = { [col.key]: source };\r\n } else {\r\n wrapper.source[col.key] = source;\r\n }\r\n }\r\n return source;\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {GridSourceItem[]} source \r\n * @param {HTMLElement} element \r\n * @param {any} val \r\n * @param {DropdownOptions} opts \r\n */\r\n static _setValue(source, element, val, opts) {\r\n const data = source?.find(v => v[opts?.valueKey ?? 'value'] === val);\r\n if (data != null) {\r\n val = data[opts?.textKey ?? 'text'];\r\n }\r\n element.children[0].innerText = val;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {any} val \r\n * @param {GridItemWrapper} wrapper \r\n * @param {GridColumnDefinition} col \r\n */\r\n static setValue(element, val, wrapper, col) {\r\n if (element.tagName !== 'DIV') {\r\n let source = this._getSource(wrapper, col);\r\n if (source instanceof Promise) {\r\n source.then(s => this._setValue(s, element, val, col.dropOptions));\r\n } else {\r\n this._setValue(source, element, val, col.dropOptions);\r\n }\r\n return;\r\n }\r\n const drop = this._getDrop(element);\r\n if (drop == null) {\r\n return;\r\n }\r\n if (drop.source == null || drop.source.length === 0) {\r\n let source = this._getSource(wrapper, col);\r\n if (source instanceof Promise) {\r\n source.then(s => {\r\n drop.source = s;\r\n drop.select(val, true);\r\n })\r\n return;\r\n } else if (source != null) {\r\n drop.source = source;\r\n }\r\n }\r\n drop.select(val, true);\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {GridSourceItem} e \r\n * @param {GridColumnDefinition} col \r\n * @returns {any}\r\n */\r\n static getValue(e, col) {\r\n return {\r\n value: e[col.dropOptions?.valueKey ?? 'value'],\r\n text: e[col.dropOptions?.textKey ?? 'text']\r\n };\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {string} name \r\n */\r\n static setClass(element, name) {\r\n if (element.tagName === 'DIV') {\r\n element.className = `ui-drop-wrapper ${name ?? ''}`;\r\n } else {\r\n super.setClass(element, name);\r\n }\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {boolean} enabled \r\n */\r\n static setEnabled(element, enabled) {\r\n super.setEnabled(element, enabled);\r\n const drop = this._getDrop(element);\r\n if (drop == null) {\r\n return;\r\n }\r\n drop.disabled = enabled === false;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {HTMLElement} container \r\n */\r\n static leaveEdit(element, container) {\r\n container.parentElement.querySelectorAll('.ui-drop-box.active').forEach(e => {\r\n if (e != null) {\r\n e.classList.remove('active');\r\n }\r\n });\r\n const drop = this._getDrop(element);\r\n if (drop == null) {\r\n return;\r\n }\r\n if (drop?.multiSelect && typeof drop.onCollapsed === 'function') {\r\n drop.onCollapsed();\r\n }\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n static toString() { return 'GridDropdown' }\r\n}\r\n\r\n/**\r\n * 复选框列\r\n * @class\r\n * @static\r\n * @extends GridColumn\r\n * @hideconstructor\r\n * @ignore\r\n */\r\nexport class GridCheckboxColumn extends GridColumn {\r\n static get canEdit() { return true };\r\n\r\n /**\r\n * @ignore\r\n * @param {Function} trigger \r\n * @returns {HTMLElement}\r\n */\r\n static createEdit(trigger) {\r\n const check = createCheckbox({\r\n onchange: trigger\r\n });\r\n return check;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {boolean} val \r\n */\r\n static setValue(element, val) {\r\n // element.querySelector('input').checked = val;\r\n element.children[0].checked = val;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {Event} e \r\n * @returns {boolean}\r\n */\r\n static getValue(e) { return e.target.checked }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {string} name \r\n */\r\n static setClass(element, name) {\r\n if (element.tagName === 'LABEL') {\r\n element.className = `ui-check-wrapper ${name ?? ''}`;\r\n } else {\r\n super.setClass(element, name);\r\n }\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {boolean} enabled \r\n */\r\n static setEnabled(element, enabled) {\r\n super.setEnabled(element, enabled);\r\n // element.querySelector('input').disabled = enabled === false;\r\n element.children[0].disabled = enabled === false;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n static toString() { return 'GridCheckbox' }\r\n}\r\n\r\n/**\r\n * 单选框列\r\n * @class\r\n * @static\r\n * @extends GridCheckboxColumn\r\n * @hideconstructor\r\n * @ignore\r\n */\r\nexport class GridRadioboxColumn extends GridCheckboxColumn {\r\n /**\r\n * @ignore\r\n * @param {Function} trigger \r\n * @param {GridColumnDefinition} _col \r\n * @param {number} index \r\n * @returns {HTMLElement}\r\n */\r\n static createEdit(trigger, _col, index) {\r\n const check = createRadiobox({\r\n name: `r_${index}`,\r\n onchange: trigger\r\n });\r\n return check;\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n static toString() { return 'GridRadiobox' }\r\n}\r\n\r\n/**\r\n * 图标列\r\n * @class\r\n * @static\r\n * @extends GridColumn\r\n * @hideconstructor\r\n * @ignore\r\n */\r\nexport class GridIconColumn extends GridColumn {\r\n /**\r\n * @ignore\r\n * @returns {HTMLElement}\r\n */\r\n static create() { return createElement('span', 'col-icon') }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {string} val \r\n * @param {GridItemWrapper} wrapper \r\n * @param {GridColumnDefinition} col \r\n */\r\n static setValue(element, val, wrapper, col) {\r\n // let className = col.iconClassName;\r\n // if (typeof className === 'function') {\r\n // className = className.call(col, wrapper.values);\r\n // }\r\n // if (className == null) {\r\n // element.className = 'col-icon';\r\n // } else {\r\n // element.className = `col-icon ${className}`;\r\n // }\r\n let type = col.iconType;\r\n if (typeof type === 'function') {\r\n type = type.call(col, wrapper.values);\r\n }\r\n type ??= 'fa-light';\r\n if (element.dataset.type !== type || element.dataset.icon !== val) {\r\n const icon = createIcon(type, val);\r\n // const layer = element.children[0];\r\n element.replaceChildren(icon);\r\n // !nullOrEmpty(col.tooltip) && setTooltip(element, col.tooltip, false, grid.element);\r\n element.dataset.type = type;\r\n element.dataset.icon = val;\r\n }\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {string} name \r\n */\r\n static setClass(element, name) {\r\n element.className = `col-icon ${name ?? ''}`;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {boolean} enabled \r\n */\r\n static setEnabled(element, enabled) {\r\n super.setEnabled(element, enabled);\r\n if (enabled === false) {\r\n element.classList.add('disabled');\r\n } else {\r\n element.classList.remove('disabled');\r\n }\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n static toString() { return 'GridIcon' }\r\n}\r\n\r\n/**\r\n * 日期选择列\r\n * @class\r\n * @static\r\n * @extends GridColumn\r\n * @hideconstructor\r\n */\r\nexport class GridDateColumn extends GridColumn {\r\n static get editing() { return true };\r\n static get canEdit() { return true };\r\n\r\n /**\r\n * @ignore\r\n * @param {Function} trigger \r\n * @param {GridColumnDefinition} col \r\n * @param {HTMLElement} _container \r\n * @param {GridItemWrapper} wrapper \r\n * @returns {HTMLElement}\r\n */\r\n static createEdit(trigger, col, _container, wrapper) {\r\n let enabled = col.enabled;\r\n if (typeof enabled === 'string') {\r\n enabled = wrapper.values[enabled];\r\n } else if (typeof enabled === 'function') {\r\n enabled = col.enabled(wrapper.values);\r\n }\r\n if (enabled === false) {\r\n return super.create();\r\n }\r\n const date = createDateInput(col.dateMin, col.dateMax);\r\n date.addEventListener('change', () => super._changeValue(col.key, wrapper, date.value));\r\n date.addEventListener('blur', trigger);\r\n return date;\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {(string | number | Date)} val \r\n */\r\n static setValue(element, val) {\r\n setDateValue(element, val);\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {Event} e \r\n * @param {GridColumnDefinition} col \r\n * @returns {string}\r\n */\r\n static getValue(e, col) {\r\n return getDateValue(e.target, col.dateValueFormatter);\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {string} name \r\n */\r\n static setClass(element, name) {\r\n if (element.tagName === 'INPUT') {\r\n element.className = `ui-date-cell ${name ?? ''}`;\r\n } else {\r\n super.setClass(element, name);\r\n }\r\n }\r\n\r\n /**\r\n * @ignore\r\n * @param {HTMLElement} element \r\n * @param {boolean} enabled \r\n */\r\n static setEnabled(element, enabled) {\r\n element.disabled = enabled === false;\r\n }\r\n\r\n /**\r\n * 格式化日期字符串\r\n * @param {(string | number | Date)} date - 要格式化的日期值\r\n * \r\n * 支持以下几种数据类型\r\n * * `\"2024-01-26\"`\r\n * * `\"1/26/2024\"`\r\n * * `\"638418240000000000\"`\r\n * * `new Date('2024-01-26')`\r\n * @returns {string} 格式化为 M/d/yyyy 的日期字符串\r\n */\r\n static formatDate(date) {\r\n return formatDate(date);\r\n }\r\n\r\n /**\r\n * @ignore\r\n */\r\n static toString() { return 'GridDate' }\r\n}","import '../css/grid.scss';\r\nimport { global, isPositive, isMobile, throttle, truncate, debounce } from \"../../utility\";\r\nimport { r as lang } from \"../../utility/lgres\";\r\nimport { nullOrEmpty } from \"../../utility/strings\";\r\nimport { createElement } from \"../../functions\";\r\nimport { createIcon } from \"../icon\";\r\nimport { createCheckbox } from \"../checkbox\";\r\nimport { setTooltip } from \"../tooltip\";\r\nimport { Popup, showAlert } from \"../popup\";\r\nimport { convertCssStyle } from \"../extension\";\r\nimport { GridColumn, GridInputColumn, GridTextColumn, GridDropdownColumn, GridCheckboxColumn, GridRadioboxColumn, GridIconColumn, GridDateColumn } from \"./column\";\r\n\r\n/**\r\n * @author Tsanie Lily <tsorgy@gmail.com>\r\n * @license MIT\r\n * @version 1.0.2\r\n */\r\n\r\nconst ScriptPath = (self.document == null ? self.location.href : self.document.currentScript?.src ?? '').replace(/ui\\.min\\.js\\?.+$/, '');\r\nconst Encoder = new TextEncoder('utf-8');\r\n\r\nconst ColumnChangedType = {\r\n Reorder: 'reorder',\r\n Resize: 'resize',\r\n Sort: 'sort'\r\n};\r\nconst RefreshInterval = isMobile() ? 32 : 10;\r\nconst HoverInternal = 200;\r\nconst RedumCount = 4;\r\nconst MiniDragOffset = 10;\r\nconst MiniColumnWidth = 50;\r\nconst FilterPanelWidth = 200;\r\nconst ExpandableWidth = 24;\r\n\r\n/**\r\n * @private\r\n * @param {Event} e \r\n * @returns {number}\r\n */\r\nfunction getClientX(e) {\r\n if (e == null) {\r\n return null;\r\n }\r\n const cx = e.touches && e.touches[0]?.clientX;\r\n return cx ?? e.clientX;\r\n}\r\n\r\n/**\r\n * @private\r\n * @param {HTMLElement} target \r\n * @returns {number}\r\n */\r\nfunction indexOfParent(target) {\r\n // return [...target.parentElement.children].indexOf(target);\r\n return Array.prototype.indexOf.call(target.parentElement.children, target);\r\n}\r\n\r\nconst ColumnTypeDefs = {\r\n 0: GridColumn,\r\n 1: GridInputColumn,\r\n 2: GridDropdownColumn,\r\n 3: GridCheckboxColumn,\r\n 4: GridIconColumn,\r\n 5: GridTextColumn,\r\n 6: GridDateColumn,\r\n 7: GridRadioboxColumn\r\n};\r\n\r\nlet r = lang;\r\n\r\n/**\r\n * 键值字典\r\n * @template T\r\n * @typedef {{[key: string]: T}} KeyMap\r\n */\r\n\r\n/**\r\n * 索引字典\r\n * @template T\r\n * @typedef {{[index: number]: T}} IndexMap\r\n */\r\n\r\n/**\r\n * 数据项\r\n * @typedef ValueItem\r\n * @property {any} Value - 值\r\n * @property {string} DisplayValue - 显示值\r\n * @property {boolean} [__checked] - 已选中\r\n * @interface\r\n */\r\n\r\n/**\r\n * 行数据对象\r\n * @typedef GridRowItem\r\n * @type {KeyMap<ValueItem>}\r\n * @property {(ValueItem | any)} {key} - 数据项\r\n * @extends {KeyMap<ValueItem>}\r\n * @interface\r\n */\r\n\r\n/**\r\n * 行数据包装接口\r\n * @typedef GridItemWrapper\r\n * @property {GridRowItem} values - 真实数据对象\r\n * @property {KeyMap<GridSourceItem[]>} source - 下拉数据源缓存对象\r\n * @property {number} __index - 行索引\r\n * @property {number} __offset - 批量删除时暂存的索引偏移量\r\n * @property {KeyMap<any>} __editing - 正在编辑的列的原始值字典\r\n * @property {boolean} __changed - 行数据是否发生改变\r\n * @property {boolean} __expanded - 行是否已展开\r\n * @property {GridExpandableObject} __expandable_object - 行扩展对象\r\n * @interface\r\n */\r\n\r\n/**\r\n * 下拉框数据源接口\r\n * @typedef GridSourceItem\r\n * @property {string} value - 值\r\n * @property {string} text - 显示文本\r\n * @interface\r\n */\r\n\r\n/**\r\n * 行数据可用性回调函数\r\n * @callback GridItemBooleanCallback\r\n * @param {GridRowItem} item - 行数据对象\r\n * @returns {boolean} 返回是否可用\r\n * @this GridColumnDefinition\r\n */\r\n\r\n/**\r\n * 行数据过滤回调函数\r\n * @callback GridItemFilterCallback\r\n * @param {GridRowItem} item - 行数据对象\r\n * @param {boolean} editing - 是否处于编辑状态\r\n * @param {HTMLElement} [body] - Grid 控件的 `<tbody>` 部分\r\n * @returns {ValueItem} - 返回过滤后的显示或编辑值\r\n * @this GridColumnDefinition\r\n */\r\n\r\n/**\r\n * 行数据处理回调函数\r\n * @callback GridItemObjectCallback\r\n * @param {GridRowItem} item - 行数据对象\r\n * @returns {any} 返回任意对象\r\n * @this GridColumnDefinition\r\n */\r\n\r\n/**\r\n * 行数据字符串回调函数\r\n * @callback GridItemStringCallback\r\n * @param {GridRowItem} item - 行数据对象\r\n * @returns {string} 返回字符串\r\n * @this GridColumnDefinition\r\n */\r\n\r\n/**\r\n * 列过滤器数据源回调函数\r\n * @callback GridColumnFilterSourceCallback\r\n * @param {GridColumnDefinition} col - 列定义对象\r\n * @returns {ValueItem[]} 返回过滤器的数据数组\r\n * @this Grid\r\n */\r\n\r\n/**\r\n * 行数据排序回调函数\r\n * @callback GridItemSortCallback\r\n * @param {GridRowItem} a - 对比行数据1\r\n * @param {GridRowItem} b - 对比行数据2\r\n * @returns {number} 返回大小对比结果\r\n */\r\n\r\n/**\r\n * 下拉列表数据源回调函数\r\n * @callback GridDropdownSourceCallback\r\n * @param {GridRowItem} item - 行数据对象\r\n * @returns {GridSourceItem[]} 行下拉列表数据源\r\n */\r\n\r\n/**\r\n * 下拉列表参数对象\r\n * @typedef DropdownOptions\r\n * @property {string} [textKey=text] - 文本关键字\r\n * @property {string} [valueKey=value] - 值关键字\r\n * @property {string} [htmlKey=html] - 源码显示的关键字\r\n * @property {number} [maxLength=500] - 最大输入长度\r\n * @property {boolean} [multiSelect] - 是否允许多选\r\n * @property {string} [selected] - 选中值\r\n * @property {string[]} [selectedList] - 选中的数组\r\n * @property {boolean} [disabled] - 是否禁用\r\n * @property {boolean} [input] - 是否支持输入\r\n * @property {boolean} [search] - 是否支持搜索\r\n * @property {string[]} [searchKeys] - 搜索的关键字数组\r\n * @property {string} [searchPlaceholder] - 搜索提示文本,默认值取语言资源 `searchHolder` \"Search...\"\r\n * @property {number} [tabIndex] - 焦点索引\r\n * @property {string} [placeholder] - 输入框的提示文本\r\n * @property {boolean} [slideFixed] - 是否固定为向下展开\r\n * @property {HTMLElement} [wrapper] - 父元素,默认添加到头元素之后\r\n * @interface\r\n */\r\n\r\n/**\r\n * 自定义日期格式化回调函数\r\n * @callback DateFormatterCallback\r\n * @param {Date} date - 日期值\r\n * @returns {any} 返回格式化后的结果\r\n */\r\n\r\n/**\r\n * 列定义接口\r\n * \r\n * <img src=\"./assets/column-types.png\" alt=\"Column Types\"/><br/>\r\n * 代码参考页面下方的示例\r\n * @typedef GridColumnDefinition\r\n * @property {string} key - 列关键字,默认以该关键字从行数据中提取单元格值,行数据的关键字属性值里包含 DisplayValue 则优先显示此值\r\n * @property {(GridColumnTypeEnum | GridColumn)} [type=Grid.ColumnTypes.Common] - 列的类型,可以为 {@linkcode GridColumn} 的子类,或者如下内置类型 {@linkcode Grid.ColumnTypes}\r\n * * Grid.ColumnTypes.Common - 0: 通用列(只读)\r\n * * Grid.ColumnTypes.Input - 1: 单行文本列\r\n * * Grid.ColumnTypes.Dropdown - 2: 下拉选择列\r\n * * Grid.ColumnTypes.Checkbox - 3: 复选框列\r\n * * Grid.ColumnTypes.Icon - 4: 图标列\r\n * * Grid.ColumnTypes.Text - 5: 多行文本列\r\n * * Grid.ColumnTypes.Date - 6: 日期选择列\r\n * * Grid.ColumnTypes.Radio - 7: 单选框列\r\n * @property {string} [caption] - 列标题文本\r\n * @property {any} [captionStyle] - 列标题的元素样式\r\n * @property {string} [captionTooltip] - 列标题的帮助文本\r\n * @property {number} [width] - 大于 0 则设置为该宽度,否则根据列内容自动调整列宽\r\n * @property {(\"left\" |\"center\" | \"right\")} [align=left] 列对齐方式\r\n * @property {(boolean | string | GridItemBooleanCallback)} [enabled] - 列是否可用(可编辑),允许以下类型\r\n * \r\n * * `boolean` 则直接使用该值\r\n * * `string` 则以该值为关键字从行数据中取值作为判断条件\r\n * * `GridItemBooleanCallback` 则调用回调,以返回值作为判断条件\r\n * @property {GridItemFilterCallback} [filter] - 单元格取值采用该函数返回的值\r\n * @property {string} [text] - 单元格以该值填充内容忽略filter与关键字属性\r\n * @property {boolean} [visible=true] - 列是否可见\r\n * @property {boolean} [resizable=true] - 列是否允许调整宽度\r\n * @property {boolean} [sortable=true] - 列是否允许排序\r\n * @property {boolean} [orderable=true] - 列是否允许重排顺序\r\n * @property {boolean} [allcheck=false] - 列为复选框类型时是否在列头增加全选复选框\r\n * @property {boolean} [shrink=false] - 列为收缩列,禁用自动调整大小\r\n * @property {string} [class] - 单元格元素的额外样式类型字符串(仅在重建行元素时设置)\r\n * @property {boolean} [contentWrap=false] - 单元格文本是否换行(仅在重建行元素时设置)\r\n * @property {number} [maxLines=0] - 大于 0 时限制显示最大行数\r\n * @property {any} [css] - 单元格css样式对象仅在重建行元素时读取\r\n * @property {any} [totalCss] - 合计行样式(仅在重建合计行元素时读取)\r\n * @property {(any | GridItemObjectCallback)} [style] - 单元格样式(填充行列数据时读取),支持直接返回样式对象或调用函数返回(若赋值则忽略 [styleFilter]{@linkcode GridColumnDefinition#styleFilter}\r\n * @property {GridItemObjectCallback} [styleFilter] - **已过时**<br/>_根据返回值填充单元格样式填充行列数据时读取_\r\n * @property {(string | GridItemStringCallback)} [background] - 设置单元格背景色(填充行列数据时读取),支持直接设置颜色字符串或调用函数返回(若赋值则忽略 [bgFilter]{@linkcode GridColumnDefinition#bgFilter}\r\n * @property {GridItemStringCallback} [bgFilter] - **已过时**<br/>_根据返回值设置单元格背景色_\r\n * @property {KeyMap<Function>} [events] - 给单元格元素附加事件(事件函数上下文为数据行对象)\r\n * @property {(any | GridItemObjectCallback)} [attrs] - 根据返回值设置单元格元素的附加属性,允许直接设置对象也支持调用函数返回对象\r\n * @property {boolean} [allowFilter=false] - 是否允许进行列头过滤\r\n * @property {any[]} [filterValues] - 过滤值的数组\r\n * @property {boolean} [filterAllowNull=false] - 是否区分 `null` 与空字符串\r\n * @property {(ValueItem[] | GridColumnFilterSourceCallback)} [filterSource] - 自定义列过滤器的数据源,支持调用函数返回数据源\r\n * @property {GridItemSortCallback} [sortFilter] - 自定义列排序函数\r\n * @property {DropdownOptions} [dropOptions] - 列为下拉列表类型时以该值设置下拉框的参数\r\n * @property {(GridSourceItem[] | Promise<GridSourceItem[]> | GridDropdownSourceCallback)} [source] - 列为下拉列表类型时以该值设置下拉列表数据源,支持返回异步对象,也支持调用函数返回\r\n * @property {boolean} [sourceCache=false] - 下拉列表数据源是否缓存结果即行数据未发生变化时仅从source属性获取一次值\r\n * @property {(\"fa-light\" | \"fa-regular\" | \"fa-solid\")} [iconType=fa-light] - 列为图标类型时以该值设置图标样式\r\n * @property {string} [dateMin] - 列为日期类型时以该值作为最小可选日期值\r\n * @property {string} [dateMax] - 列为日期类型时以该值作为最大可选日期值\r\n * @property {DateFormatterCallback} [dateValueFormatter] - 列为日期类型时自定义日期格式化函数\r\n * @property {(string | GridItemStringCallback)} [tooltip] - 额外设置单元格的 tooltip支持直接使用字符串或者使用函数返回的字符串\r\n * @property {Function} [onAllChecked] - 列头复选框改变时触发事件\r\n * @property {Function} [onChanged] - 单元格变化时触发事件\r\n * @property {Function} [onFilterOk] - 列过滤点击 `OK` 时触发的事件\r\n * @property {Function} [onFiltered] - 列过滤后触发的事件\r\n * @property {Function} [onDropExpanded] - 列为下拉框类型时在下拉列表展开时触发的事件\r\n * @interface\r\n * @example\r\n * [\r\n * {\r\n * key: 'name',\r\n * // type: Grid.ColumnTypes.Common,\r\n * caption: 'Name',\r\n * captionStyle: {\r\n * 'font-style': 'italic'\r\n * },\r\n * width: 150,\r\n * allowFilter: true\r\n * },\r\n * {\r\n * key: 'birthday',\r\n * type: Grid.ColumnTypes.Date,\r\n * caption: 'Birthday',\r\n * width: 120,\r\n * dateMin: '1900-01-01',\r\n * dateMax: '2025-01-01',\r\n * dateValueFormatter: toDateValue\r\n * },\r\n * {\r\n * key: 'age',\r\n * type: Grid.ColumnTypes.Input,\r\n * caption: 'Age',\r\n * enabled: false,\r\n * align: 'right',\r\n * filter: item => {\r\n * const ms = new Date() - new Date(item.birthday);\r\n * const age = Math.floor(ms / 1000 / 60 / 60 / 24 / 365);\r\n * return String(age);\r\n * }\r\n * },\r\n * {\r\n * key: 'sex',\r\n * type: Grid.ColumnTypes.Dropdown,\r\n * caption: 'Sex',\r\n * source: [\r\n * { value: 'male', text: 'Male' },\r\n * { value: 'female', text: 'Female' },\r\n * { value: 'other', text: 'Other' }\r\n * ]\r\n * },\r\n * {\r\n * key: 'active',\r\n * type: Grid.ColumnTypes.Checkbox,\r\n * caption: 'Active'\r\n * },\r\n * {\r\n * key: 'remove',\r\n * type: Grid.ColumnTypes.Icon,\r\n * text: 'times',\r\n * resizable: false,\r\n * sortable: false,\r\n * orderable: false,\r\n * tooltip: 'Remove',\r\n * events: {\r\n * onclick: () => {\r\n * showConfirm('Remove', 'Are you sure you want to remove this person?', [\r\n * {\r\n * key: 'yes',\r\n * text: 'Yes',\r\n * trigger: () => {\r\n * console.log('yes');\r\n * return true;\r\n * }\r\n * },\r\n * {\r\n * key: 'no',\r\n * text: 'No'\r\n * }\r\n * ], 'question')\r\n * }\r\n * }\r\n * }\r\n * ]\r\n */\r\n/**\r\n * 列头复选框改变时触发的事件\r\n * @name onAllChecked\r\n * @event\r\n * @param {GridColumnDefinition} col - 列定义对象\r\n * @param {boolean} flag - 是否选中\r\n * @this Grid\r\n * @memberof GridColumnDefinition\r\n */\r\n/**\r\n * 单元格发生变化时触发的事件\r\n * @name onChanged\r\n * @event\r\n * @param {GridRowItem} item - 行数据对象\r\n * @param {(boolean | string | number)} value - 修改后的值\r\n * @param {(boolean | string | number)} oldValue - 修改前的值\r\n * @param {any} [e] - 列修改事件传递过来的任意对象\r\n * @this Grid\r\n * @memberof GridColumnDefinition\r\n */\r\n/**\r\n * 列过滤点击 `OK` 时触发的事件\r\n * @name onFilterOk\r\n * @event\r\n * @param {GridColumnDefinition} col - 列定义对象\r\n * @param {ValueItem[]} selected - 选中的过滤项\r\n * @this Grid\r\n * @memberof GridColumnDefinition\r\n */\r\n/**\r\n * 列过滤后触发的事件\r\n * @name onFiltered\r\n * @event\r\n * @param {GridColumnDefinition} col - 列定义对象\r\n * @this Grid\r\n * @memberof GridColumnDefinition\r\n */\r\n/**\r\n * 列为下拉框类型时在下拉列表展开时触发的事件\r\n * @name onDropExpanded\r\n * @event\r\n * @param {GridRowItem} item - 行数据对象\r\n * @param {Dropdown} drop - 下拉框对象\r\n * @this GridColumnDefinition\r\n * @memberof GridColumnDefinition\r\n */\r\n\r\n/**\r\n * 判断列是否始终编辑的回调函数\r\n * @callback ColumnTypesEnumIsAlwaysEditing\r\n * @param {number} type - 列类型\r\n * @returns {boolean} 返回是否始终编辑\r\n */\r\n\r\n/**\r\n * 列类型枚举\r\n * @enum {number}\r\n */\r\nconst GridColumnTypeEnum = {\r\n /** 0 - 通用列(只读) */\r\n Common: 0,\r\n /** 1 - 单行文本列 */\r\n Input: 1,\r\n /** 2 - 下拉选择列 */\r\n Dropdown: 2,\r\n /** 3 - 复选框列 */\r\n Checkbox: 3,\r\n /** 4 - 图标列 */\r\n Icon: 4,\r\n /** 5 - 多行文本列 */\r\n Text: 5,\r\n /** 6 - 日期选择列 */\r\n Date: 6,\r\n /** 7 - 单选框列 */\r\n Radio: 7,\r\n /**\r\n * 判断列是否为复选框列\r\n * @type {ColumnTypesEnumIsAlwaysEditing}\r\n */\r\n isAlwaysEditing(type) { return type === 3 || type === 7 }\r\n};\r\n\r\n/**\r\n * 列排序枚举\r\n * @enum {number}\r\n */\r\nconst GridColumnDirection = {\r\n /** -1 - 倒序 */\r\n Descending: -1,\r\n /** 1 - 升序 */\r\n Ascending: 1\r\n};\r\n\r\n/**\r\n * 多语言资源接口\r\n * @typedef GridLanguages\r\n * @property {string} [all] - ( All )\r\n * @property {string} [ok] - OK\r\n * @property {string} [reset] - Reset\r\n * @property {string} [cancel] - Cancel\r\n * @property {string} [null] - ( Null )\r\n * @property {string} [addLevel] - Add Level\r\n * @property {string} [deleteLevel] - Delete Level\r\n * @property {string} [copyLevel] - Copy Level\r\n * @property {string} [asc] - Ascending\r\n * @property {string} [desc] - Descending\r\n * @property {string} [column] - Column\r\n * @property {string} [order] - Order\r\n * @property {string} [sort] - Sort\r\n * @property {string} [requirePrompt] - All sort criteria must have a column specified. Check the selected sort criteria and try again.\r\n * @property {string} [duplicatePrompt] - {column} is being sorted more than once. Delete the duplicate sort criteria and try again.\r\n * @interface\r\n */\r\n\r\n/**\r\n * Grid 数据导出对象\r\n * @typedef GridExportData\r\n * @property {Uint8Array} data - 导出数据\r\n * @property {string} [type] - 导出类型,`\"compressed\"` 意为压缩数据\r\n * @property {string} [error] - 压缩中的异常信息提示\r\n * @interface\r\n */\r\n\r\n/**\r\n * 列排序定义接口\r\n * @typedef GridColumnSortDefinition\r\n * @property {string} column - 排序列的关键字\r\n * @property {(\"asc\" | \"desc\")} order - 升序或降序\r\n * @interface\r\n */\r\n\r\n/**\r\n * 扩展行对象接口\r\n * @typedef GridExpandableObject\r\n * @property {HTMLElement} element - 扩展行元素\r\n * @interface\r\n */\r\n\r\n/**\r\n * 扩展行生成回调函数\r\n * @callback GridExpandableObjectCallback\r\n * @param {GridRowItem} item - 行数据对象\r\n * @returns {GridExpandableObject} 返回扩展行对象\r\n * @this Grid\r\n */\r\n\r\n/**\r\n * @typedef GridVirtualRow\r\n * @property {boolean} editing - 行处于编辑状态\r\n * @property {KeyMap<GridVirtualCell>} cells - 虚拟单元格数组\r\n * @private\r\n */\r\n\r\n/**\r\n * @typedef GridVirtualCell\r\n * @property {string} background - 单元格背景色\r\n * @property {string} value - 单元格值\r\n * @property {string} tooltip - 单元格提示文本\r\n * @property {boolean} enabled - 单元格是否可用\r\n * @property {string} style - 单元格样式字符串\r\n * @property {string} attrs - 单元格附加属性字符串\r\n * @private\r\n */\r\n\r\n/**\r\n * @typedef GridColumnAttr\r\n * @property {boolean} dragging - 列正在拖拽\r\n * @property {number} offset - 列拖拽偏移\r\n * @property {Function} mousemove - 拖拽或调整大小移动回调函数\r\n * @property {Function} mouseup - 拖拽或调整大小鼠标释放回调函数\r\n * @property {number} resizing - 列临时大小\r\n * @property {boolean} sizing - 列已进入修改大小的状态\r\n * @property {boolean} autoResize - 列需要自动调整大小\r\n * @property {any} style - 列样式对象\r\n * @property {ValueItem[]} filterSource - 列过滤面板数据源\r\n * @property {number} filterHeight - 列过滤面板高度\r\n * @property {number} filterTop - 列过滤面板滚动头部间距\r\n * @private\r\n */\r\n\r\n/**\r\n * Grid 控件基础类\r\n * \r\n * <img src=\"./assets/grid-sample.png\" alt=\"Grid Sample\"/><br/>\r\n * 函数调用流程图<br/>\r\n * <img src=\"./assets/grid.jpg\" alt=\"Grid\"/>\r\n * @class\r\n * @example <caption>基础示例</caption>\r\n * <div id=\"grid\"></div>\r\n * @example\r\n * #grid>.ui-grid {\r\n * width: 600px;\r\n * height: 400px;\r\n * }\r\n * @example\r\n * const grid = new Grid('#grid', GetTextByKey);\r\n * grid.columns = [\r\n * {\r\n * key: 'name',\r\n * caption: 'Name',\r\n * width: 140,\r\n * allowFilter: true\r\n * },\r\n * {\r\n * key: 'age',\r\n * caption: 'Age',\r\n * type: Grid.ColumnTypes.Input,\r\n * width: 80\r\n * },\r\n * {\r\n * key: 'study',\r\n * caption: 'Study',\r\n * type: Grid.ColumnTypes.Dropdown,\r\n * width: 120,\r\n * source: [\r\n * { value: 'a', text: 'A' },\r\n * { value: 'b', text: 'B' },\r\n * { value: 'c', text: 'C' }\r\n * ]\r\n * }\r\n * ];\r\n * grid.multiSelect = true;\r\n * grid.init();\r\n * grid.source = [\r\n * { name: '张三', age: '19', study: 'a' },\r\n * { name: '李四', age: '24', study: 'a' },\r\n * { name: '王五', age: '20', study: 'c' }\r\n * ];\r\n */\r\nexport class Grid {\r\n\r\n /**\r\n * 内部引用变量\r\n * @private\r\n */\r\n _var = {\r\n /**\r\n * 父容器元素\r\n * @type {HTMLElement}\r\n * @private\r\n */\r\n parent: null,\r\n /**\r\n * Grid 元素 - `div.ui-grid`\r\n * @type {HTMLDivElement}\r\n * @private\r\n */\r\n el: null,\r\n /**\r\n * 全部数据数组\r\n * @type {GridItemWrapper[]}\r\n * @private\r\n */\r\n source: null,\r\n /**\r\n * 当前已过滤显示的数据数组\r\n * @type {GridItemWrapper[]}\r\n * @private\r\n */\r\n currentSource: null,\r\n /**\r\n * 列可用性的关联字典\r\n * @type {KeyMap<string | boolean>}\r\n * @private\r\n */\r\n enabledDict: null,\r\n /**\r\n * 合计行数据\r\n * @type {GridRowItem}\r\n * @private\r\n */\r\n total: null,\r\n /**\r\n * Grid 是否只读\r\n * @type {boolean}\r\n * @private\r\n */\r\n readonly: false,\r\n /**\r\n * 当前选中的列索引\r\n * @type {number}\r\n * @private\r\n */\r\n selectedColumnIndex: -1,\r\n /**\r\n * 当前选中的行索引数组\r\n * @type {number[]}\r\n * @private\r\n */\r\n selectedIndexes: null,\r\n /**\r\n * 虚模式头部索引\r\n * @type {number}\r\n * @private\r\n */\r\n startIndex: 0,\r\n /**\r\n * 当前滚动上边距\r\n * @type {number}\r\n * @private\r\n */\r\n scrollTop: 0,\r\n /**\r\n * 当前滚动左边距\r\n * @type {number}\r\n * @private\r\n */\r\n scrollLeft: 0,\r\n /**\r\n * 浏览器是否为 Firefox\r\n * @type {boolean}\r\n * @private\r\n */\r\n isFirefox: false,\r\n /**\r\n * 一页高度可显示的行数\r\n * @type {number}\r\n * @private\r\n */\r\n rowCount: -1,\r\n /**\r\n * 虚拟单元格字典\r\n * @type {IndexMap<GridVirtualRow>}\r\n * @private\r\n */\r\n virtualRows: {},\r\n /**\r\n * 列类型缓存字典\r\n * @type {KeyMap<GridColumn>}\r\n * @private\r\n */\r\n colTypes: {},\r\n /**\r\n * 列属性字典\r\n * @type {KeyMap<GridColumnAttr>}\r\n * @private\r\n */\r\n colAttrs: {\r\n /**\r\n * 有已过滤的列\r\n * @type {boolean}\r\n * @private\r\n */\r\n __filtered: false,\r\n /**\r\n * 过滤面板已打开\r\n * @type {boolean}\r\n * @private\r\n */\r\n __filtering: false,\r\n /**\r\n * 上一个目标排序列索引\r\n * @type {number}\r\n * @private\r\n */\r\n __orderIndex: -1,\r\n },\r\n /**\r\n * 是否处于渲染中\r\n * @type {boolean}\r\n * @private\r\n */\r\n rendering: false,\r\n /**\r\n * 头部高度\r\n * @type {number}\r\n * @private\r\n */\r\n headerHeight: null,\r\n /**\r\n * 正文高度\r\n * @type {number}\r\n * @private\r\n */\r\n containerHeight: null,\r\n /**\r\n * 合计行高度\r\n * @type {number}\r\n * @private\r\n */\r\n footerHeight: null,\r\n /**\r\n * 合计行底边距偏移量\r\n * @type {number}\r\n * @private\r\n */\r\n footerOffset: null,\r\n /**\r\n * 容器宽度\r\n * @type {number}\r\n * @private\r\n */\r\n wrapClientWidth: null,\r\n /**\r\n * 正文宽度\r\n * @type {number}\r\n * @private\r\n */\r\n bodyClientWidth: null,\r\n /**\r\n * 是否需要 resize\r\n * @type {boolean}\r\n * @private\r\n */\r\n needResize: null,\r\n /**\r\n * 提示条消失的 Timer\r\n * @type {number}\r\n * @private\r\n */\r\n tooltipTimer: null,\r\n /**\r\n * 页面元素引用\r\n * @private\r\n */\r\n refs: {\r\n /**\r\n * 表格引用 - table.ui-grid-table\r\n * @type {HTMLTableElement}\r\n * @private\r\n */\r\n table: null,\r\n /**\r\n * 表格正文引用 - tbody\r\n * @type {HTMLTableSectionElement}\r\n * @private\r\n */\r\n body: null,\r\n /**\r\n * 表格头部引用 - thead>tr\r\n * @type {HTMLTableSectionElement}\r\n * @private\r\n */\r\n header: null,\r\n /**\r\n * 表格合计行引用 - tfooter>tr\r\n * @type {HTMLTableSectionElement}\r\n * @private\r\n */\r\n footer: null,\r\n /**\r\n * 加载状态元素引用 - div.ui-grid-loading\r\n * @type {HTMLDivElement}\r\n * @private\r\n */\r\n loading: null,\r\n /**\r\n * 大小计算元素引用 - span.ui-grid-sizer\r\n * @type {HTMLSpanElement}\r\n * @private\r\n */\r\n sizer: null,\r\n /**\r\n * 包装元素引用 - div.ui-grid-wrapper\r\n * @type {HTMLDivElement}\r\n * @private\r\n */\r\n wrapper: null,\r\n /**\r\n * 拖拽块引用 - div.dragger\r\n * @type {HTMLDivElement}\r\n * @private\r\n */\r\n dragger: null,\r\n /**\r\n * 拖拽光标引用 - layer.dragger-cursor\r\n * @type {HTMLElement}\r\n * @private\r\n */\r\n draggerCursor: null,\r\n }\r\n };\r\n\r\n /**\r\n * 列定义的数组\r\n * @type {GridColumnDefinition[]}\r\n * @ignore\r\n */\r\n columns = [];\r\n /**\r\n * 多语言资源对象\r\n * @type {GridLanguages}\r\n * @ignore\r\n */\r\n langs = {};\r\n /**\r\n * 行数大于等于该值则启用虚模式\r\n * @type {number}\r\n * @default 100\r\n * @ignore\r\n */\r\n virtualCount = 100;\r\n /**\r\n * 未设置宽度的列自动调整列宽\r\n * @type {boolean}\r\n * @default true\r\n * @ignore\r\n */\r\n autoResize = true;\r\n /**\r\n * 表格行高\r\n * @type {number}\r\n * @default 36\r\n * @ignore\r\n */\r\n rowHeight = 36;\r\n /**\r\n * 文本行高(多行文本列计算高度时使用)\r\n * @type {number}\r\n * @default 18\r\n * @ignore\r\n */\r\n lineHeight = 18;\r\n /**\r\n * 列头未过滤时的图标\r\n * @type {string}\r\n * @default \"ellipsis-h\"\r\n * @ignore\r\n */\r\n filterIcon = 'ellipsis-h';\r\n /**\r\n * 列头已过滤时的图标\r\n * @type {string}\r\n * @default \"filter\"\r\n * @ignore\r\n */\r\n filteredIcon = 'filter';\r\n /**\r\n * 列表底部留出额外的空白行\r\n * @type {number}\r\n * @default 0\r\n * @ignore\r\n */\r\n extraRows = 0;\r\n /**\r\n * 过滤条件列表的行高\r\n * @type {number}\r\n * @default 30\r\n * @ignore\r\n */\r\n filterRowHeight = 30;\r\n /**\r\n * 列表高度值,为 0 时列表始终显示全部内容(自增高),为非数字或者小于 0 则根据容器高度来确定虚模式的渲染行数\r\n * @type {number | null}\r\n * @ignore\r\n */\r\n height;\r\n /**\r\n * 是否允许多选\r\n * @type {boolean}\r\n * @default false\r\n * @ignore\r\n */\r\n multiSelect = false;\r\n /**\r\n * 为 `false` 时只有点击在单元格内才会选中行\r\n * @type {boolean}\r\n * @default true\r\n * @ignore\r\n */\r\n fullrowClick = true;\r\n /**\r\n * 单元格 tooltip 是否禁用\r\n * @type {boolean}\r\n * @default false\r\n * @ignore\r\n */\r\n tooltipDisabled = false;\r\n /**\r\n * 列头是否显示\r\n * @type {boolean}\r\n * @default true\r\n * @ignore\r\n */\r\n headerVisible = true;\r\n /**\r\n * 列头是否允许换行\r\n * @type {boolean}\r\n * @default true\r\n * @ignore\r\n */\r\n headerWrap = true;\r\n /**\r\n * 监听事件的窗口载体\r\n * @type {(Window | HTMLElement)}\r\n * @default window\r\n * @ignore\r\n */\r\n window;\r\n /**\r\n * 排序列的索引\r\n * @type {number}\r\n * @default -1\r\n * @ignore\r\n */\r\n sortIndex = -1;\r\n /**\r\n * 排序方式,正数升序,负数倒序\r\n * @type {GridColumnDirection}\r\n * @default GridColumnDirection.Ascending\r\n * @ignore\r\n */\r\n sortDirection = GridColumnDirection.Ascending;\r\n /**\r\n * 排序列数组\r\n * @type {GridColumnSortDefinition[]}\r\n * @default null\r\n * @ignore\r\n */\r\n sortArray = null;\r\n /**\r\n * 是否支持点击扩展\r\n * @type {boolean}\r\n * @default false\r\n * @ignore\r\n */\r\n expandable;\r\n /**\r\n * 扩展行生成器\r\n * @type {GridExpandableObjectCallback}\r\n * @ignore\r\n */\r\n expandableGenerator;\r\n\r\n /**\r\n * 即将选中行时触发\r\n * @event\r\n * @param {number} index - 即将选中的行索引\r\n * @param {number} colIndex - 即将选中的列索引\r\n * @returns {boolean} 返回 `false`、`null`、`undefined`、`0` 等则取消选中动作\r\n * @this Grid\r\n */\r\n willSelect;\r\n /**\r\n * 单元格单击时触发colIndex 为 -1 则表示点击的是行的空白处\r\n * @event\r\n * @param {number} index - 点击的行索引\r\n * @param {number} colIndex - 点击的列索引\r\n * @returns {boolean} 返回 false 则取消事件冒泡\r\n * @this Grid\r\n */\r\n cellClicked;\r\n\r\n /**\r\n * 选中行发生变化时触发的事件\r\n * @event\r\n * @param {number} index - 选中的行索引\r\n * @this Grid\r\n */\r\n onSelectedRowChanged;\r\n /**\r\n * 单元格双击时触发的事件colIndex 为 -1 则表示点击的是行的空白处\r\n * @event\r\n * @param {number} index - 双击的行索引\r\n * @param {number} colIndex - 双击的列索引\r\n * @this Grid\r\n */\r\n onCellDblClicked;\r\n /**\r\n * 行双击时触发的事件\r\n * @event\r\n * @param {number} index - 双击的行索引\r\n * @this Grid\r\n */\r\n onRowDblClicked;\r\n /**\r\n * 列发生变化时触发的事件\r\n * @event\r\n * @param {(\"reorder\" | \"resize\" | \"sort\")} type - 事件类型\r\n * \r\n * * \"reorder\" 为发生列重排事件,此时 value 为目标列索引\r\n * * \"resize\" 为发生列宽调整事件,此时 value 为列宽度值\r\n * * \"sort\" 为发生列排序事件,此时 value 为 1升序或 -1倒序\r\n * @param {number} colIndex - 发生变化事件的列索引\r\n * @param {number | GridColumnDirection} value - 变化的值\r\n * @this Grid\r\n */\r\n onColumnChanged;\r\n /**\r\n * 列滚动时触发的事件\r\n * @event\r\n * @param {Event} e - 滚动事件对象\r\n * @this Grid\r\n */\r\n onBodyScrolled;\r\n /**\r\n * 扩展行展开时触发的事件\r\n * @event\r\n * @param {GridRowItem} item - 行数据对象\r\n * @param {GridExpandableObject} expandableObject - 由 [expandableGenerator]{@linkcode Grid#expandableGenerator} 产生的行扩展对象\r\n * @param {HTMLElement} expandableObject.element - 扩展行元素\r\n * @this Grid\r\n */\r\n onRowExpanded;\r\n /**\r\n * 扩展行收缩时触发的事件\r\n * @event\r\n * @param {GridRowItem} item - 行数据对象\r\n * @param {GridExpandableObject} expandableObject - 由 [expandableGenerator]{@linkcode Grid#expandableGenerator} 产生的行扩展对象\r\n * @param {HTMLElement} expandableObject.element - 扩展行元素\r\n * @this Grid\r\n */\r\n onRowCollapsed;\r\n\r\n /**\r\n * 列类型枚举\r\n * @readonly\r\n * @type {GridColumnTypeEnum}\r\n * @property {number} Common=0 - 通用列(只读)\r\n * @property {number} Input=1 - 单行文本列\r\n * @property {number} Dropdown=2 - 下拉选择列\r\n * @property {number} Checkbox=3 - 复选框列\r\n * @property {number} Icon=4 - 图标列\r\n * @property {number} Text=5 - 多行文本列\r\n * @property {number} Date=6 - 日期选择列\r\n * @property {number} Radio=7 - 单选框列\r\n */\r\n static get ColumnTypes() { return GridColumnTypeEnum }\r\n\r\n /**\r\n * Grid 控件构造函数\r\n * @param {(string | HTMLElement)?} container Grid 控件所在的父容器,可以是 string 表示选择器,也可以是 HTMLElement 对象<br/>_**构造时可以不进行赋值,但是调用 init 函数时则必须进行赋值**_\r\n * @param {Function} [getText] 获取多语言文本的函数代理\r\n * @param {string} getText.id - 资源 ID\r\n * @param {string} [getText.def] - 默认资源\r\n * @param {string} getText.{returns} 返回的多语言\r\n * @property {GridColumnDefinition[]} columns - 列定义的数组\r\n * @property {GridLanguages} [langs] - 多语言资源对象\r\n * @property {number} [virtualCount=100] - 行数大于等于该值则启用虚模式\r\n * @property {boolean} [autoResize=true] - 未设置宽度的列自动调整列宽\r\n * @property {number} [rowHeight=36] - 表格行高\r\n * @property {number} [lineHeight=18] - 文本行高(多行文本列计算高度时使用)\r\n * @property {string} [filterIcon=ellipsis-h] - 列头未过滤时的图标\r\n * @property {string} [filteredIcon=filter] - 列头已过滤时的图标\r\n * @property {number} [extraRows=0] - 列表底部留出额外的空白行\r\n * @property {number} [filterRowHeight=30] - 过滤条件列表的行高\r\n * @property {number} [height] - 列表高度值,为 0 时列表始终显示全部内容(自增高),为非数字或者小于 0 则根据容器高度来确定虚模式的渲染行数\r\n * @property {boolean} [multiSelect=false] - 是否允许多选\r\n * @property {boolean} [fullrowClick=true] - 为 `false` 时只有点击在单元格内才会选中行\r\n * @property {boolean} [tooltipDisabled=false] - 单元格 tooltip 是否禁用\r\n * @property {boolean} [headerVisible=true] - 列头是否显示\r\n * @property {boolean} [headerWrap=true] - 列头是否允许换行\r\n * @property {(Window | HTMLElement)} [window=global] - 监听事件的窗口载体\r\n * @property {number} [sortIndex=-1] - 排序列的索引\r\n * @property {GridColumnDirection} [sortDirection=GridColumnDirection.Ascending] - 排序方式,正数升序,负数倒序\r\n * @property {GridColumnSortDefinition[]} [sortArray] - 排序列数组\r\n * @property {boolean} [expandable=false] - 是否支持点击扩展\r\n * @property {GridExpandableObjectCallback} [expandableGenerator] - 扩展行生成器\r\n */\r\n constructor(container, getText) {\r\n this._var.parent = typeof container === 'string' ? document.querySelector(container) : container;\r\n if (typeof getText === 'function') {\r\n r = getText;\r\n }\r\n }\r\n\r\n /**\r\n * 获取 Grid 的页面元素\r\n * @readonly\r\n * @type {HTMLDivElement}\r\n */\r\n get element() { return this._var.el }\r\n\r\n /**\r\n * 获取当前 Grid 是否已发生改变\r\n * @readonly\r\n * @type {boolean}\r\n */\r\n get changed() {\r\n const source = this._var.source;\r\n if (source == null) {\r\n return false;\r\n }\r\n return source.find(r => r.__changed) != null;\r\n }\r\n\r\n /**\r\n * 返回所有数据的数据(未过滤)\r\n * @readonly\r\n * @type {GridRowItem[]}\r\n */\r\n get allSource() { return this._var.source?.map(s => s.values) }\r\n\r\n /**\r\n * 获取已过滤的数据中的扩展对象数组\r\n * @readonly\r\n * @type {GridExpandableObject[]}\r\n * @property {HTMLElement} element - 扩展行元素\r\n */\r\n get sourceExpandable() { return this._var.currentSource?.map(s => s.__expandable_object) }\r\n\r\n /**\r\n * 获取当前是否为虚模式状态\r\n * @readonly\r\n * @type {boolean}\r\n */\r\n get virtual() { return this._var.currentSource?.length > this.virtualCount }\r\n\r\n /**\r\n * 获取当前排序的列关键字,为 null 则当前无排序列\r\n * @readonly\r\n * @type {string | null}\r\n */\r\n get sortKey() {\r\n if (this.columns == null) {\r\n return null;\r\n }\r\n return this.columns[this.sortIndex]?.key;\r\n }\r\n\r\n /**\r\n * @private\r\n * @type {HTMLTableRowElement[]}\r\n */\r\n get _tableRows() {\r\n // return [...this._var.refs.body.children];\r\n return Array.prototype.slice.call(this._var.refs.body.querySelectorAll('&>.ui-grid-row'));\r\n }\r\n\r\n /**\r\n * @private\r\n * @type {HTMLTableCellElement[]}\r\n */\r\n get _headerCells() {\r\n return Array.prototype.slice.call(this._var.refs.header.querySelectorAll('&>th.column'));\r\n }\r\n\r\n /**\r\n * @private\r\n * @type {HTMLTableCellElement[]}\r\n */\r\n get _footerCells() {\r\n return Array.prototype.slice.call(this._var.refs.footer.querySelectorAll('&>.ui-grid-cell'));\r\n }\r\n\r\n /**\r\n * 获取虚模式起始索引\r\n * @readonly\r\n * @type {number}\r\n */\r\n get startIndex() { return this._var.startIndex }\r\n\r\n /**\r\n * 获取当前选中行的索引,为 -1 则当前没有选中行\r\n * @readonly\r\n * @type {number}\r\n */\r\n get selectedIndex() { return (this._var.selectedIndexes && this._var.selectedIndexes[0]) ?? -1 }\r\n\r\n /**\r\n * 获取或设置 Grid 是否为只读\r\n * @type {boolean}\r\n */\r\n get readonly() { return this._var.readonly === true }\r\n set readonly(flag) {\r\n this._var.readonly = flag;\r\n this.refresh();\r\n }\r\n\r\n /**\r\n * 获取已过滤的数据数组,或者设置数据并刷新列表\r\n * @type {GridRowItem[]}\r\n */\r\n get source() { return this._var.currentSource?.map(s => s.values) }\r\n set source(list) {\r\n if (!Array.isArray(list)) {\r\n throw new Error('source is not an Array.')\r\n }\r\n list = list.map((it, index) => {\r\n return {\r\n __index: index,\r\n values: it\r\n };\r\n });\r\n this._var.source = list;\r\n this._var.scrollLeft = 0;\r\n if (this._var.el != null) {\r\n this._var.el.scrollLeft = 0;\r\n }\r\n this._refreshSource(list);\r\n }\r\n\r\n /**\r\n * 获取或设置合计行数据\r\n * @type {GridRowItem}\r\n * @since 1.0.1\r\n */\r\n get total() { return this._var.total }\r\n set total(total) {\r\n this._var.total = total;\r\n this.reload(true);\r\n }\r\n\r\n /**\r\n * 获取或设置当前选中的行索引的数组,设置后会刷新列表\r\n * @type {number[]}\r\n */\r\n get selectedIndexes() { return this._var.selectedIndexes }\r\n set selectedIndexes(indexes) {\r\n const startIndex = this._var.startIndex;\r\n this._var.selectedIndexes.splice(0, this._var.selectedIndexes.length, ...indexes);\r\n if (this.readonly) {\r\n this._tableRows.forEach((row, i) => {\r\n if (indexes.includes(startIndex + i)) {\r\n row.classList.add('selected');\r\n } else if (row.classList.contains('selected')) {\r\n row.classList.remove('selected');\r\n }\r\n });\r\n } else {\r\n this.refresh();\r\n }\r\n if (typeof this.onSelectedRowChanged === 'function') {\r\n this.onSelectedRowChanged();\r\n }\r\n }\r\n\r\n /**\r\n * 获取或设置 Grid 当前的加载状态\r\n * @type {boolean}\r\n */\r\n get loading() { return this._var.refs.loading?.style?.visibility === 'visible' }\r\n set loading(flag) {\r\n if (this._var.refs.loading == null) {\r\n return;\r\n }\r\n if (flag === false) {\r\n this._var.refs.loading.style.visibility = 'hidden';\r\n this._var.refs.loading.style.opacity = 0;\r\n } else {\r\n this._var.refs.loading.style.visibility = 'visible';\r\n this._var.refs.loading.style.opacity = 1;\r\n }\r\n }\r\n\r\n /**\r\n * 获取或设置 Grid 当前滚动的偏移量\r\n * @type {number}\r\n */\r\n get scrollTop() { return this._var.el?.scrollTop; }\r\n set scrollTop(top) {\r\n if (this._var.el == null) {\r\n return;\r\n }\r\n this._var.el.scrollTop = top;\r\n this.reload(true);\r\n }\r\n\r\n /**\r\n * 初始化Grid控件\r\n * @param {HTMLElement} [container=.ctor#container] - 父容器元素,若未传值则采用构造方法中传入的父容器元素\r\n */\r\n init(container = this._var.parent) {\r\n if (container == null) {\r\n throw new Error('no specified parent.');\r\n }\r\n if (!(container instanceof HTMLElement)) {\r\n const ele = container[0];\r\n if (!(ele instanceof HTMLElement)) {\r\n throw new Error(`parent type not supported. ${JSON.stringify(Object.getPrototypeOf(container))}`);\r\n }\r\n container = ele;\r\n }\r\n if (!Array.isArray(this.columns)) {\r\n throw new Error('no specified column definitions.');\r\n }\r\n if (Object.keys(this.langs).length === 0) {\r\n this.langs = {\r\n all: r('allItem', '( All )'),\r\n ok: r('ok', 'OK'),\r\n reset: r('reset', 'Reset'),\r\n cancel: r('cancel', 'Cancel'),\r\n null: r('null', '( Null )'),\r\n addLevel: r('addLevel', 'Add level'),\r\n deleteLevel: r('deleteLevel', 'Delete level'),\r\n copyLevel: r('copyLevel', 'Copy level'),\r\n asc: r('asc', 'Ascending'),\r\n desc: r('desc', 'Descending'),\r\n column: r('column', 'Column'),\r\n order: r('order', 'Order'),\r\n sort: r('sort', 'Sort'),\r\n requirePrompt: r('requirePrompt', 'All sort criteria must have a column specified. Check the selected sort criteria and try again.'),\r\n duplicatePrompt: r('duplicatePrompt', '{column} is being sorted more than once. Delete the duplicate sort criteria and try again.')\r\n };\r\n }\r\n this._var.el = null;\r\n this._var.refs = {};\r\n this._var.rendering = true;\r\n this._var.parent = container;\r\n this._var.isFirefox = /Firefox\\//i.test(navigator.userAgent);\r\n this._var.enabledDict = {};\r\n const grid = createElement('div', 'ui-grid');\r\n grid.setAttribute('tabindex', 0);\r\n grid.addEventListener('keydown', e => {\r\n let index = this.selectedIndex;\r\n let flag = false;\r\n if (e.key === 'ArrowUp') {\r\n // up\r\n if (index > 0) {\r\n flag = true;\r\n index -= 1;\r\n }\r\n } else if (e.key === 'ArrowDown') {\r\n // down\r\n const count = this._var.currentSource?.length ?? 0;\r\n if (index < count - 1) {\r\n flag = true;\r\n index += 1;\r\n }\r\n }\r\n if (flag) {\r\n this._var.selectedIndexes = [index];\r\n this.scrollToIndex(index);\r\n this.refresh();\r\n if (typeof this.onSelectedRowChanged === 'function') {\r\n this.onSelectedRowChanged(index);\r\n }\r\n e.stopPropagation();\r\n }\r\n });\r\n grid.addEventListener('mousedown', e => {\r\n if (e.target === this._var.el) {\r\n // cancel selections\r\n const selectedIndexes = this._var.selectedIndexes;\r\n if (selectedIndexes == null || selectedIndexes.length === 0) {\r\n return;\r\n }\r\n selectedIndexes.splice(0);\r\n if (this.readonly) {\r\n this._tableRows.forEach(row => {\r\n row.classList.remove('selected');\r\n });\r\n } else {\r\n this.refresh();\r\n }\r\n if (typeof this.onSelectedRowChanged === 'function') {\r\n this.onSelectedRowChanged(-1);\r\n }\r\n this._var.selectedColumnIndex = -1;\r\n return;\r\n }\r\n let [parent, target] = this._getRowTarget(e.target);\r\n if (parent == null) {\r\n return;\r\n }\r\n const rowIndex = parent.classList.contains('ui-grid-total-row') ? -1 : this._tableRows.indexOf(parent);\r\n let colIndex = indexOfParent(target) - (this.expandable ? 1 : 0);\r\n if (colIndex >= this.columns.length) {\r\n colIndex = -1;\r\n }\r\n this._onRowClicked(e, rowIndex, colIndex);\r\n });\r\n container.replaceChildren(grid);\r\n const sizer = createElement('span', 'ui-grid-sizer');\r\n grid.appendChild(sizer);\r\n this._var.refs.sizer = sizer;\r\n\r\n grid.addEventListener('scroll', e => throttle(this._onScroll, RefreshInterval, this, e), { passive: true });\r\n\r\n // header & body\r\n const wrapper = createElement('div', 'ui-grid-wrapper');\r\n this._var.refs.wrapper = wrapper;\r\n grid.appendChild(wrapper);\r\n const table = createElement('table', 'ui-grid-table');\r\n this._var.refs.table = table;\r\n this._createHeader(table);\r\n this._createBody(table);\r\n this._createFooter(table);\r\n wrapper.appendChild(table);\r\n // tooltip\r\n if (!this.tooltipDisabled) {\r\n const holder = createElement('div', 'ui-grid-hover-holder');\r\n holder.addEventListener('mousedown', e => {\r\n const holder = e.currentTarget;\r\n const row = Number(holder.dataset.row);\r\n const col = Number(holder.dataset.col);\r\n if (holder.classList.contains('active')) {\r\n holder.classList.remove('active');\r\n this._clearHolder(holder);\r\n }\r\n return this._onRowClicked(e, row, col);\r\n });\r\n holder.addEventListener('dblclick', e => this._onRowDblClicked(e));\r\n wrapper.appendChild(holder);\r\n grid.addEventListener('mousemove', e => throttle(this._onGridMouseMove, HoverInternal, this, e, holder), { passive: true });\r\n }\r\n\r\n // loading\r\n const loading = createElement('div', 'ui-grid-loading',\r\n createElement('div', null, createIcon('fa-regular', 'spinner-third'))\r\n );\r\n this._var.refs.loading = loading;\r\n grid.appendChild(loading);\r\n this._var.el = grid;\r\n\r\n this._var.rendering = false;\r\n if (this._var.source != null) {\r\n if (this.sortIndex >= 0) {\r\n this.sortColumn(true);\r\n } else if (this.sortArray?.length > 0) {\r\n this.sort(true);\r\n } else {\r\n this.resize(true);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * 设置数据列表,该方法为 [source]{@linkcode Grid#source} 属性的语法糖\r\n * @param {GridRowItem[]} source - 待设置的数据列表\r\n */\r\n setData(source) {\r\n this.source = source;\r\n }\r\n\r\n /**\r\n * 滚动到指定行的位置\r\n * @param {number} index - 待滚动至的行索引\r\n */\r\n scrollToIndex(index) {\r\n const top = this._scrollToTop(index * (this.rowHeight + 1), true);\r\n this._var.el.scrollTop = top;\r\n }\r\n\r\n /**\r\n * 调整 Grid 元素的大小,一般需要在宽度变化时(如页面大小发生变化时)调用\r\n * @param {boolean} [force] - 是否强制 [reload]{@linkcode Grid#reload},默认只有待渲染的行数发生变化时才会调用\r\n * @param {boolean} [keep] - 是否保持当前滚动位置\r\n * @param {Function} [callback] - 计算大小后的回调函数,上下文为 Grid\r\n */\r\n resize(force, keep, callback) {\r\n if (this._var.rendering || this._var.el == null) {\r\n return;\r\n }\r\n const body = this._var.refs.body;\r\n const top = this.headerVisible === false ? 0 : (this._var.refs.header.offsetHeight || this.rowHeight);\r\n\r\n let height = this.height;\r\n if (height === 0) {\r\n height = this._var.containerHeight;\r\n } else if (isNaN(height) || height < 0) {\r\n height = this._var.el.offsetHeight - top;\r\n }\r\n const count = truncate((height - 1) / (this.rowHeight + 1)) + (RedumCount * 2) + 1;\r\n if (force || count !== this._var.rowCount) {\r\n this._var.rowCount = count;\r\n if (typeof callback === 'function') {\r\n callback.call(this);\r\n } else {\r\n this.reload(keep);\r\n }\r\n }\r\n this._var.wrapClientWidth = this._var.refs.wrapper.clientWidth;\r\n this._var.bodyClientWidth = body.clientWidth;\r\n }\r\n\r\n /**\r\n * 重新计算需要渲染的行,并载入元素,一般需要在高度变化时调用\r\n * @param {boolean} [keep] - 是否保持当前滚动位置\r\n */\r\n reload(keep) {\r\n if (this._var.rendering || this._var.el == null) {\r\n return;\r\n }\r\n const filtered = this.columns.some(c => c.filterValues != null);\r\n if ((filtered ^ this._var.colAttrs.__filtered) === 1) {\r\n this._var.colAttrs.__filtered = filtered;\r\n const headers = this._headerCells;\r\n for (let i = 0; i < this.columns.length; ++i) {\r\n const ele = headers[i].querySelector('.filter');\r\n if (ele == null) {\r\n continue;\r\n }\r\n if (this.columns[i].filterValues != null) {\r\n ele.replaceChildren(createIcon('fa-solid', this.filteredIcon));\r\n ele.classList.add('active');\r\n } else {\r\n ele.replaceChildren(createIcon('fa-solid', this.filterIcon));\r\n ele.classList.remove('active');\r\n }\r\n }\r\n this._refreshSource();\r\n return;\r\n } else if (filtered) {\r\n const headers = this._headerCells;\r\n for (let i = 0; i < this.columns.length; ++i) {\r\n const ele = headers[i].querySelector('.filter');\r\n if (ele == null) {\r\n continue;\r\n }\r\n if (this.columns[i].filterValues != null) {\r\n ele.replaceChildren(createIcon('fa-solid', this.filteredIcon));\r\n ele.classList.add('active');\r\n } else {\r\n ele.replaceChildren(createIcon('fa-solid', this.filterIcon));\r\n ele.classList.remove('active');\r\n }\r\n }\r\n }\r\n let length = this._var.currentSource?.length ?? 0;\r\n if (this.extraRows > 0) {\r\n length += this.extraRows;\r\n }\r\n this._var.containerHeight = length * (this.rowHeight + 1);\r\n if (!keep) {\r\n this._var.scrollTop = 0;\r\n this._var.startIndex = 0;\r\n this._var.el.scrollTop = 0;\r\n this._var.refs.table.style.top = '0px';\r\n }\r\n this._adjustRows(this._var.refs.body);\r\n this.refresh();\r\n // size adjustment\r\n const headerHeight = this._var.headerHeight || this.rowHeight;\r\n if (this.total != null) {\r\n const footerHeight = this._var.footerHeight || this.rowHeight;\r\n this._var.refs.wrapper.style.height = `${headerHeight + this._var.containerHeight + footerHeight}px`;\r\n // footer position\r\n this._var.footerOffset = this._var.refs.table.offsetHeight - this._var.el.clientHeight;\r\n this._var.refs.footer.parentElement.style.bottom = `${this._var.refs.table.offsetTop + this._var.footerOffset - this._var.el.scrollTop}px`;\r\n } else {\r\n this._var.refs.wrapper.style.height = `${headerHeight + this._var.containerHeight}px`;\r\n }\r\n }\r\n\r\n /**\r\n * 重新填充Grid单元格数据\r\n */\r\n refresh() {\r\n if (this._var.refs.body == null) {\r\n throw new Error('body has not been created.');\r\n }\r\n const widths = {};\r\n this._fillRows(this._tableRows, this.columns, widths);\r\n if (this._var.needResize && widths.flag) {\r\n this._var.needResize = false;\r\n this.columns.forEach((col, i) => {\r\n if (!this._get(col.key, 'autoResize')) {\r\n return;\r\n }\r\n let width = widths[i];\r\n if (width < col.width) {\r\n width = col.width;\r\n }\r\n if (width > 0) {\r\n this._changeColumnWidth(i, width, true);\r\n }\r\n });\r\n }\r\n this._layoutHeaderFooter();\r\n }\r\n\r\n /**\r\n * 把所有行重置为未修改的状态\r\n */\r\n resetChange() {\r\n if (this._var.source == null) {\r\n return;\r\n }\r\n for (let row of this._var.source) {\r\n delete row.__changed;\r\n }\r\n }\r\n\r\n /**\r\n * 根据当前排序字段进行列排序\r\n * @param {boolean} [reload] - 为 `true` 则在列排序后调用 [reload]{@linkcode Grid#reload} 方法\r\n */\r\n sortColumn(reload) {\r\n const index = this.sortIndex;\r\n const col = this.columns[index];\r\n if (col == null) {\r\n return;\r\n }\r\n this.sortArray = null;\r\n const direction = this.sortDirection;\r\n [...this._headerCells].forEach((th, i) => {\r\n const arrow = th.querySelector('.arrow');\r\n if (arrow == null) {\r\n return;\r\n }\r\n if (i === index) {\r\n arrow.className = `arrow ${(direction !== 1 ? 'desc' : 'asc')}`;\r\n } else if (arrow.className !== 'arrow') {\r\n arrow.className = 'arrow';\r\n }\r\n });\r\n const comparer = this._getComparer(col, direction);\r\n this._var.source.sort(comparer);\r\n if (this._var.colAttrs.__filtered === true) {\r\n this._var.currentSource.sort(comparer);\r\n }\r\n if (this._var.rowCount < 0) {\r\n return;\r\n }\r\n if (reload) {\r\n this.reload();\r\n } else {\r\n this.refresh();\r\n }\r\n }\r\n\r\n /**\r\n * 根据当前排序列数组进行多列排序\r\n * @param {boolean} [reload] - 为 `true` 则在多列排序后调用 [reload]{@linkcode Grid#reload} 方法\r\n */\r\n sort(reload) {\r\n const sortArray = this.sortArray;\r\n if (sortArray == null || sortArray.length === 0) {\r\n return;\r\n }\r\n this.sortIndex = -1;\r\n const comparer = (a, b) => {\r\n for (let i = 0; i < sortArray.length; ++i) {\r\n const s = sortArray[i];\r\n const col = this.columns.find(c => c.key === s.column && c.visible !== false);\r\n if (col != null) {\r\n const result = this._getComparer(col, s.order === 'desc' ? -1 : 1)(a, b);\r\n if (result !== 0) {\r\n return result;\r\n }\r\n }\r\n }\r\n return 0;\r\n };\r\n this._var.source.sort(comparer);\r\n if (this._var.colAttrs.__filtered === true) {\r\n this._var.currentSource.sort(comparer);\r\n }\r\n if (this._var.rowCount < 0) {\r\n return;\r\n }\r\n if (reload) {\r\n this.reload();\r\n } else {\r\n this.refresh();\r\n }\r\n // arrow icon\r\n [...this._headerCells].forEach((th, i) => {\r\n const arrow = th.querySelector('.arrow');\r\n if (arrow == null) {\r\n return;\r\n }\r\n const col = this.columns[i];\r\n const s = sortArray.find(s => s.column === col.key && col.visible !== false);\r\n if (s != null) {\r\n arrow.className = `arrow ${s.order}`;\r\n } else if (arrow.className !== 'arrow') {\r\n arrow.className = 'arrow';\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * 清除列头复选框的选中状态\r\n */\r\n clearHeaderCheckbox() {\r\n const boxes = this._var.refs.header.querySelectorAll('.ui-check-wrapper>input');\r\n boxes.forEach(box => box.checked = false);\r\n }\r\n\r\n /**\r\n * 显示多列排序设置面板\r\n * @since 1.0.1\r\n */\r\n showSortPanel() {\r\n const content = createElement('div', 'ui-sort-panel-content');\r\n const buttonWrapper = createElement('div', 'ui-sort-panel-buttons');\r\n const grid = new Grid(null, r);\r\n grid.langs = this.langs;\r\n const rowChanged = index => {\r\n buttonWrapper.querySelector('.ui-button-delete').disabled = index < 0;\r\n buttonWrapper.querySelector('.ui-button-copy').disabled = index < 0;\r\n buttonWrapper.querySelector('.ui-button-move-up').disabled = index < 1;\r\n buttonWrapper.querySelector('.ui-button-move-down').disabled = index >= grid.source.length - 1;\r\n };\r\n grid.onSelectedRowChanged = rowChanged;\r\n const reload = index => {\r\n grid.selectedIndexes = [index];\r\n grid.scrollTop = index * (grid.rowHeight + 1);\r\n rowChanged(index);\r\n }\r\n buttonWrapper.append(\r\n createElement('span', 'button',\r\n createIcon('fa-light', 'plus'),\r\n createElement('span', span => {\r\n span.innerText = this.langs.addLevel;\r\n span.addEventListener('click', () => {\r\n let index = grid.selectedIndex;\r\n const n = { column: '', order: 'asc' };\r\n if (index >= 0) {\r\n index += 1;\r\n grid.addItem(n, index);\r\n } else {\r\n grid.addItem(n);\r\n index = grid.source.length - 1;\r\n }\r\n reload(index);\r\n });\r\n })\r\n ),\r\n createElement('span', 'button ui-button-delete',\r\n createIcon('fa-light', 'times'),\r\n createElement('span', span => {\r\n span.innerText = this.langs.deleteLevel;\r\n span.addEventListener('click', () => {\r\n let index = grid.selectedIndex;\r\n if (index < 0) {\r\n return;\r\n }\r\n grid.removeItem(index);\r\n const length = grid.source.length;\r\n if (index >= length) {\r\n index = length - 1;\r\n }\r\n reload(index);\r\n });\r\n })\r\n ),\r\n createElement('span', 'button ui-button-copy',\r\n createIcon('fa-light', 'copy'),\r\n createElement('span', span => {\r\n span.innerText = this.langs.copyLevel;\r\n span.addEventListener('click', () => {\r\n const index = grid.selectedIndex;\r\n if (index < 0) {\r\n return;\r\n }\r\n const item = grid.source[index];\r\n if (item == null) {\r\n return;\r\n }\r\n grid.addItem(Object.assign({}, item), index + 1);\r\n reload(index + 1);\r\n });\r\n })\r\n ),\r\n createElement('span', button => {\r\n button.className = 'button ui-button-move-up';\r\n const icon = createIcon('fa-light', 'chevron-up');\r\n icon.addEventListener('click', () => {\r\n const index = grid.selectedIndex;\r\n if (index < 1) {\r\n return;\r\n }\r\n const item = grid.source[index];\r\n if (item == null) {\r\n return;\r\n }\r\n const it = grid.removeItem(index);\r\n grid.addItem(it, index - 1);\r\n reload(index - 1);\r\n });\r\n button.appendChild(icon);\r\n }),\r\n createElement('span', button => {\r\n button.className = 'button ui-button-move-down';\r\n const icon = createIcon('fa-light', 'chevron-down');\r\n icon.addEventListener('click', () => {\r\n const index = grid.selectedIndex;\r\n if (index >= grid.source.length - 1) {\r\n return;\r\n }\r\n const item = grid.source[index];\r\n if (item == null) {\r\n return;\r\n }\r\n const it = grid.removeItem(index);\r\n grid.addItem(it, index + 1);\r\n reload(index + 1);\r\n });\r\n button.appendChild(icon);\r\n })\r\n );\r\n const gridWrapper = createElement('div', 'ui-sort-panel-grid');\r\n content.append(buttonWrapper, gridWrapper);\r\n const columnSource = this.columns.filter(c => c.sortable !== false && c.visible !== false);\r\n grid.columns = [\r\n {\r\n key: 'column',\r\n caption: this.langs.column,\r\n width: 270,\r\n type: GridColumnTypeEnum.Dropdown,\r\n dropOptions: {\r\n textKey: 'caption',\r\n valueKey: 'key'\r\n },\r\n source: columnSource,\r\n sortable: false,\r\n orderable: false\r\n },\r\n {\r\n key: 'order',\r\n caption: this.langs.order,\r\n width: 150,\r\n type: GridColumnTypeEnum.Dropdown,\r\n source: [\r\n { value: 'asc', text: this.langs.asc },\r\n { value: 'desc', text: this.langs.desc }\r\n ],\r\n sortable: false,\r\n orderable: false\r\n }\r\n ];\r\n const pop = new Popup({\r\n title: this.langs.sort,\r\n content,\r\n resizable: true,\r\n buttons: [\r\n {\r\n text: this.langs.ok,\r\n trigger: () => {\r\n const source = grid.source;\r\n if (source == null || source.length === 0) {\r\n this.sortArray = null;\r\n } else {\r\n const dict = {};\r\n for (let i = 0; i < source.length; ++i) {\r\n const it = source[i];\r\n if (it.column == null || it.column === '') {\r\n grid.selectedIndexes = [i];\r\n grid.refresh();\r\n showAlert(this.langs.sort, this.langs.requirePrompt, 'warn');\r\n return false;\r\n }\r\n if (Object.prototype.hasOwnProperty.call(dict, it.column)) {\r\n grid.selectedIndexes = [i];\r\n grid.refresh();\r\n let name = columnSource.find(c => c.key === it.column);\r\n if (name == null) {\r\n name = it.column;\r\n } else {\r\n name = name.caption;\r\n }\r\n showAlert(this.langs.sort, this.langs.duplicatePrompt.replace('{column}', name), 'warn');\r\n return false;\r\n }\r\n dict[it.column] = true;\r\n }\r\n this.sortArray = source;\r\n this.sortDirection = 1;\r\n this.sort();\r\n }\r\n if (typeof this.onSorted === 'function') {\r\n this.onSorted(this.sortArray);\r\n }\r\n return true;\r\n }\r\n },\r\n { text: this.langs.cancel }\r\n ],\r\n onResizeEnded: () => grid.resize()\r\n });\r\n const source = this.sortArray || [{ column: '', order: 'asc' }];\r\n pop.show(this._var.el).then(() => {\r\n pop.container.style.cssText += 'width: 520px; height: 400px';\r\n grid.init(gridWrapper);\r\n grid.source = source.filter(s => s.column === '' || columnSource.find(c => c.key === s.column) != null);\r\n grid.selectedIndexes = [0];\r\n grid.refresh();\r\n rowChanged(0);\r\n });\r\n }\r\n\r\n /**\r\n * 设置单行数据\r\n * @param {number} index - 行索引\r\n * @param {GridRowItem} item - 待设置的行数据对象\r\n * @since 1.0.1\r\n */\r\n setItem(index, item) {\r\n if (this._var.currentSource == null) {\r\n throw new Error('no source');\r\n }\r\n const it = this._var.currentSource[index];\r\n // clear dropdown source cache\r\n delete it.source;\r\n it.values = item;\r\n if (this.sortIndex >= 0) {\r\n this.sortColumn();\r\n } else if (this.sortArray?.length > 0) {\r\n this.sort();\r\n } else {\r\n this.refresh();\r\n }\r\n }\r\n\r\n /**\r\n * 添加行数据\r\n * @param {GridRowItem} item - 待添加的行数据值\r\n * @param {number} [index] - 待添加的行索引\r\n * @returns {GridRowItem} 返回已添加的行数据\r\n * @since 1.0.1\r\n */\r\n addItem(item, index) {\r\n if (this._var.currentSource == null) {\r\n throw new Error('no source');\r\n }\r\n const it = index >= 0 ? this._var.currentSource[index] : null;\r\n const newIt = { __index: null, values: item };\r\n if (it != null) {\r\n newIt.__index = it.__index;\r\n this._var.currentSource.splice(index, 0, newIt);\r\n if (this._var.colAttrs.__filtered === true) {\r\n this._var.source.splice(it.__index, 0, newIt);\r\n }\r\n for (let i = it.__index + 1; i < this._var.source.length; ++i) {\r\n this._var.source[i].__index += 1;\r\n }\r\n } else {\r\n newIt.__index = this._var.source.length;\r\n this._var.currentSource.push(newIt);\r\n if (this._var.colAttrs.__filtered === true) {\r\n this._var.source.push(newIt);\r\n }\r\n }\r\n if (this.sortIndex >= 0) {\r\n this.sortColumn(true);\r\n } else if (this.sortArray?.length > 0) {\r\n this.sort(true);\r\n } else {\r\n this.reload();\r\n }\r\n return item;\r\n }\r\n\r\n /**\r\n * 批量添加行数据\r\n * @param {GridRowItem[]} array - 待添加的行数据数组\r\n * @param {number} [index] - 待添加的行索引\r\n * @returns {GridRowItem[]} 返回已添加的行数据数组\r\n * @since 1.0.1\r\n */\r\n addItems(array, index) {\r\n if (this._var.currentSource == null) {\r\n throw new Error('no source');\r\n }\r\n if (!Array.isArray(array) || array.length <= 0) {\r\n // throw new Error(`invalid items array: ${array}`);\r\n return;\r\n }\r\n const it = index >= 0 ? this._var.currentSource[index] : null;\r\n if (it != null) {\r\n const items = array.map((a, i) => ({ __index: it.__index + i, values: a }));\r\n this._var.currentSource.splice(index, 0, ...items);\r\n if (this._var.colAttrs.__filtered === true) {\r\n this._var.source.splice(it.__index, 0, ...items);\r\n }\r\n const offset = array.length;\r\n for (let i = it.__index + offset; i < this._var.source.length; ++i) {\r\n this._var.source[i].__index += offset;\r\n }\r\n } else {\r\n const length = this._var.source.length;\r\n const items = array.map((a, i) => ({ __index: length + i, values: a }));\r\n this._var.currentSource.push(...items);\r\n if (this._var.colAttrs.__filtered === true) {\r\n this._var.source.push(...items);\r\n }\r\n }\r\n if (this.sortIndex >= 0) {\r\n this.sortColumn(true);\r\n } else if (this.sortArray?.length > 0) {\r\n this.sort(true);\r\n } else {\r\n this.reload();\r\n }\r\n return array;\r\n }\r\n\r\n /**\r\n * 删除行数据\r\n * @param {number} index - 待删除的行索引\r\n * @returns {GridRowItem} 返回已删除的行数据\r\n * @since 1.0.1\r\n */\r\n removeItem(index) {\r\n if (this._var.currentSource == null) {\r\n throw new Error('no source');\r\n }\r\n const it = this._var.currentSource.splice(index, 1)[0];\r\n if (it == null) {\r\n return null;\r\n }\r\n if (this._var.colAttrs.__filtered === true) {\r\n this._var.source.splice(it.__index, 1);\r\n }\r\n for (let i = it.__index; i < this._var.source.length; ++i) {\r\n this._var.source[i].__index -= 1;\r\n }\r\n if (index < 1) {\r\n this._var.selectedIndexes = [index - 1];\r\n } else {\r\n this._var.selectedIndexes = [];\r\n }\r\n this.reload();\r\n return it.values;\r\n }\r\n\r\n /**\r\n * 批量删除行数据\r\n * @param {number[]} [indexes] - 待删除的行索引数组,未传值时删除所有行\r\n * @returns {GridRowItem[]} 返回已删除的行数据数组\r\n * @since 1.0.1\r\n */\r\n removeItems(indexes) {\r\n if (this._var.currentSource == null) {\r\n throw new Error('no source');\r\n }\r\n if (Array.isArray(indexes) && indexes.length > 0) {\r\n indexes = indexes.slice().sort();\r\n } else {\r\n indexes = this._var.currentSource.map(a => a.__index);\r\n }\r\n const array = [];\r\n let first = 0;\r\n for (let i = indexes.length - 1; i >= 0; --i) {\r\n let it = this._var.currentSource.splice(indexes[i], 1)[0];\r\n if (it == null) {\r\n continue;\r\n }\r\n let next = this._var.source[it.__index];\r\n if (next != null && next.__offset == null) {\r\n next.__offset = i + 1;\r\n }\r\n if (this._var.colAttrs.__filtered === true) {\r\n this._var.source.splice(it.__index, 1);\r\n }\r\n array.splice(0, 0, it.values);\r\n first = it.__index;\r\n }\r\n let offset = 1;\r\n for (let i = first; i < this._var.source.length; ++i) {\r\n let it = this._var.source[i];\r\n if (it.__offset > 0) {\r\n offset = it.__offset;\r\n delete it.__offset;\r\n }\r\n it.__index -= offset;\r\n }\r\n const index = indexes[0];\r\n if (index < 1) {\r\n this._var.selectedIndexes = [index - 1];\r\n } else {\r\n this._var.selectedIndexes = [];\r\n }\r\n this.reload();\r\n return array;\r\n }\r\n\r\n /**\r\n * 导出已压缩的数据源,结构为\r\n * ```\r\n * {\r\n * columns: [],\r\n * source: [],\r\n * rowHeight: number,\r\n * sortDirection: number,\r\n * sortKey?: string,\r\n * sortArray?: Array<{\r\n * column: string,\r\n * order: \"asc\" | \"desc\"\r\n * }>\r\n * }\r\n * ```\r\n * @param {string | boolean} [compressed=deflate] - 压缩编码,传入 false 则取消压缩\r\n * @param {string} [module] - 压缩模块,默认采用 wasm_flate.deflate 编码,自定义模块需要实现以下消息事件\r\n * * `onmessage` - 接收消息\r\n * * `{ type: 'init', path: string}` - 初始化消息,参数 `path` 为 `ui.min.js` 脚本所在路径\r\n * * `{ type: 'compress', data: Uint8Array }` - 压缩消息,参数 `data` 为原始数据\r\n * * `postMessage` - 返回消息\r\n * * `{ type: 'init', result?: 0, error?: string}` - 初始化事件中的消息反馈,没有 `error` 意为成功\r\n * * `{ error: string }` - 压缩事件中的消息反馈,`error` 值为错误信息\r\n * * `Uint8Array` - 反馈压缩后的数据\r\n * @returns {Promise<GridExportData>} 返回 `Uint8Array` 数据对象\r\n * @since 1.0.2\r\n */\r\n export(compressed, module) {\r\n const data = {\r\n columns: this.columns.map(c => ({\r\n key: c.key,\r\n type: c.type?.toString(),\r\n caption: c.caption,\r\n width: c.width,\r\n align: c.align,\r\n visible: c.visible\r\n })),\r\n source: this.source.map(s => {\r\n const item = Object.create(null);\r\n for (let c of this.columns) {\r\n if (c.key == null) {\r\n continue;\r\n }\r\n let val;\r\n if (c.text != null) {\r\n val = c.text;\r\n } else if (typeof c.filter === 'function') {\r\n val = c.filter(s, false, this._var.refs.body);\r\n } else {\r\n val = s[c.key];\r\n if (val != null) {\r\n if (Object.prototype.hasOwnProperty.call(val, 'DisplayValue') && val.Value === val.DisplayValue) {\r\n val = val.DisplayValue;\r\n } else if (Array.isArray(val)) {\r\n val = val.join(', ');\r\n }\r\n }\r\n }\r\n val ??= '';\r\n item[c.key] = val;\r\n }\r\n for (let prop of Object.keys(s)) {\r\n if (Object.prototype.hasOwnProperty.call(item, prop)) {\r\n continue;\r\n }\r\n let val;\r\n val = s[prop];\r\n if (val != null) {\r\n if (Object.prototype.hasOwnProperty.call(val, 'DisplayValue')) {\r\n val = val.DisplayValue;\r\n }\r\n }\r\n item[prop] = val;\r\n }\r\n return item;\r\n }),\r\n rowHeight: this.rowHeight,\r\n sortDirection: this.sortDirection,\r\n sortKey: this.sortKey,\r\n sortArray: this.sortArray\r\n };\r\n const json = JSON.stringify(data);\r\n if (compressed === false) {\r\n return Promise.resolve(Encoder.encode(json));\r\n }\r\n return new Promise(resolve => {\r\n let working;\r\n let url;\r\n if (typeof module === 'string') {\r\n url = `${ScriptPath}${module}`;\r\n } else {\r\n url = URL.createObjectURL(new Blob([`let wasm,WASM_VECTOR_LEN=0,cachegetUint8Memory0=null;function getUint8Memory0(){return null!==cachegetUint8Memory0&&cachegetUint8Memory0.buffer===wasm.memory.buffer||(cachegetUint8Memory0=new Uint8Array(wasm.memory.buffer)),cachegetUint8Memory0}let cachegetInt32Memory0=null;function getInt32Memory0(){return null!==cachegetInt32Memory0&&cachegetInt32Memory0.buffer===wasm.memory.buffer||(cachegetInt32Memory0=new Int32Array(wasm.memory.buffer)),cachegetInt32Memory0}function passArray8ToWasm0(e,t){const a=t(1*e.length);return getUint8Memory0().set(e,a/1),WASM_VECTOR_LEN=e.length,a}function getArrayU8FromWasm0(e,t){return getUint8Memory0().subarray(e/1,e/1+t)}function encode_raw(e,t){var a=passArray8ToWasm0(t,wasm.__wbindgen_malloc),r=WASM_VECTOR_LEN;wasm[e+\"_encode_raw\"](8,a,r);var s=getInt32Memory0()[2],n=getInt32Memory0()[3],m=getArrayU8FromWasm0(s,n).slice();return wasm.__wbindgen_free(s,1*n),m}self.addEventListener(\"message\",e=>{const t=e.data.type;if(\"init\"===t)if(\"function\"==typeof WebAssembly.instantiateStreaming){const t={},a=fetch(e.data.path+\"wasm_flate_bg.wasm\");WebAssembly.instantiateStreaming(a,t).then(({instance:e})=>{wasm=e.exports,self.postMessage({type:\"init\",result:0})}).catch(e=>a.then(t=>{\"application/wasm\"!==t.headers.get(\"Content-Type\")?self.postMessage({type:\"init\",error:\"\\`WebAssembly.instantiateStreaming\\` failed because your server does not serve wasm with \\`application/wasm\\` MIME type. Original error: \"+e.message}):self.postMessage({type:\"init\",error:e.message})}))}else self.postMessage({type:\"init\",error:\"no \\`WebAssembly.instantiateStreaming\\`\"});else if(\"compress\"===t)if(null==wasm)self.postMessage({error:\"no \\`wasm\\` instance\"});else{let t=encode_raw(\"${compressed ?? 'deflate'}\",e.data.data);self.postMessage(t,[t.buffer])}});`]));\r\n }\r\n const worker = new Worker(url);\r\n /**\r\n * @private\r\n * @param {Function} next \r\n * @param {any} data \r\n */\r\n const terminate = (next, data) => {\r\n working = false;\r\n worker.terminate();\r\n URL.revokeObjectURL(url);\r\n next(data);\r\n }\r\n // 超过 30 秒则返回无压缩数据\r\n const timer = setTimeout(() => {\r\n if (working) {\r\n // terminate(reject, { message: 'timeout' });\r\n terminate(resolve, { data: Encoder.encode(json), error: 'timeout' });\r\n }\r\n }, 30000);\r\n worker.addEventListener('message', e => {\r\n if (working) {\r\n if (e.data.error != null) {\r\n // terminate(reject, { message: e.data.error });\r\n terminate(resolve, { data: Encoder.encode(json), error: e.data.error });\r\n } else {\r\n if (e.data.type === 'init') {\r\n const uncompressed = Encoder.encode(json);\r\n worker.postMessage({ type: 'compress', data: uncompressed }, [uncompressed.buffer]);\r\n } else {\r\n clearTimeout(timer);\r\n terminate(resolve, { type: 'compressed', data: e.data });\r\n }\r\n }\r\n }\r\n })\r\n worker.addEventListener('error', e => {\r\n if (working) {\r\n clearTimeout(timer);\r\n // terminate(reject, e);\r\n terminate(resolve, { data: Encoder.encode(json), error: e.message });\r\n }\r\n })\r\n working = true;\r\n worker.postMessage({ type: 'init', path: ScriptPath.replace(/ui\\.min\\.js$/, 'wasm_flate_bg.wasm') });\r\n });\r\n }\r\n\r\n /**\r\n * @private\r\n * @callback PrivateGridComparerCallback\r\n * @param {GridItemWrapper} a \r\n * @param {GridItemWrapper} b \r\n * @returns {number}\r\n */\r\n\r\n /**\r\n * @private\r\n * @param {GridColumnDefinition} col \r\n * @param {GridColumnDirection} direction \r\n * @returns {PrivateGridComparerCallback}\r\n */\r\n _getComparer(col, direction) {\r\n if (typeof col.sortFilter !== 'function') {\r\n if (isNaN(direction)) {\r\n direction = 1;\r\n }\r\n return (a, b) => {\r\n a = this._getItemProp(a.values, true, col);\r\n b = this._getItemProp(b.values, true, col);\r\n if (a == null && typeof b === 'number') {\r\n a = 0;\r\n } else if (typeof a === 'number' && b == null) {\r\n b = 0;\r\n } else if (a != null && b == null) {\r\n return direction;\r\n } else if (typeof a === 'string' && typeof b === 'string') {\r\n a = a.toLowerCase();\r\n b = b.toLowerCase();\r\n }\r\n return a === b ? 0 : (a > b ? 1 : -1) * direction;\r\n };\r\n }\r\n return (a, b) => col.sortFilter(a.values, b.values) * direction;\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {GridItemWrapper[]} [list] \r\n */\r\n _refreshSource(list) {\r\n list ??= this._var.source;\r\n if (this._var.colAttrs.__filtered === true) {\r\n this._var.currentSource = list.filter(it => {\r\n for (let col of this.columns) {\r\n const nullValue = col.filterAllowNull ? null : '';\r\n if (Array.isArray(col.filterValues)) {\r\n const v = this._getItemProp(it.values, false, col) ?? nullValue;\r\n if (Array.isArray(v)) {\r\n if (v.every(item => col.filterValues.indexOf(item) < 0)) {\r\n return false;\r\n }\r\n } else if (col.filterValues.indexOf(v) < 0) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n });\r\n } else {\r\n this._var.currentSource = list;\r\n }\r\n this._var.selectedColumnIndex = -1;\r\n this._var.selectedIndexes = [];\r\n this._var.startIndex = 0;\r\n this._var.scrollTop = 0;\r\n this._var.rowCount = -1;\r\n\r\n this.resize(true, false, () => {\r\n if (this.sortIndex >= 0) {\r\n this.sortColumn(true);\r\n } else if (this.sortArray?.length > 0) {\r\n this.sort(true);\r\n } else {\r\n this.reload();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {HTMLTableElement} table \r\n * @returns {HTMLTableSectionElement}\r\n */\r\n _createHeader(table) {\r\n const thead = createElement('thead');\r\n if (this.headerVisible === false) {\r\n thead.style.display = 'none';\r\n }\r\n table.appendChild(thead);\r\n const header = createElement('tr');\r\n thead.appendChild(header);\r\n const sizer = this._var.refs.sizer;\r\n let left = this.expandable ? ExpandableWidth : 0;\r\n const readonly = this.readonly;\r\n if (this.expandable) {\r\n header.appendChild(createElement('th', th => {\r\n th.className = 'ui-expandable sticky';\r\n const w = `${ExpandableWidth}px`;\r\n th.style.cssText = convertCssStyle({\r\n 'width': w,\r\n 'max-width': w,\r\n 'min-width': w,\r\n 'left': '0px'\r\n });\r\n }, createElement('div')));\r\n }\r\n for (let col of this.columns) {\r\n if (col.visible === false) {\r\n const hidden = createElement('th', 'column');\r\n hidden.style.display = 'none';\r\n if (col.sortable !== false) {\r\n hidden.dataset.key = col.key;\r\n hidden.addEventListener('click', e => this._onHeaderClicked(e, col, true));\r\n }\r\n header.appendChild(hidden);\r\n continue;\r\n }\r\n // style\r\n const alwaysEditing = GridColumnTypeEnum.isAlwaysEditing(col.type);\r\n let type = this._var.colTypes[col.key];\r\n if (type == null) {\r\n if (isNaN(col.type)) {\r\n type = col.type;\r\n } else {\r\n type = ColumnTypeDefs[col.type];\r\n }\r\n type ??= GridColumn;\r\n this._var.colTypes[col.key] = type;\r\n }\r\n if (col.width > 0 || col.shrink || !this.autoResize || typeof type.createCaption === 'function') {\r\n // col.autoResize = false;\r\n if (isNaN(col.width) || col.width <= 0) {\r\n col.width = 50;\r\n }\r\n } else {\r\n this._set(col.key, 'autoResize', true);\r\n this._var.needResize = true;\r\n sizer.innerText = col.caption ?? '';\r\n let width = sizer.offsetWidth + 22;\r\n if (!readonly && col.enabled !== false && col.allcheck && alwaysEditing) {\r\n width += 32;\r\n }\r\n if (col.allowFilter === true) {\r\n width += 14;\r\n }\r\n if (width < MiniColumnWidth) {\r\n width = MiniColumnWidth;\r\n }\r\n col.width = width;\r\n }\r\n col.align ??= alwaysEditing ? 'center' : 'left';\r\n if (col.sortable !== false) {\r\n col.sortable = true;\r\n }\r\n let style;\r\n if (col.shrink) {\r\n style = { 'text-align': col.align };\r\n } else {\r\n const w = `${col.width}px`;\r\n style = {\r\n 'width': w,\r\n 'max-width': w,\r\n 'min-width': w,\r\n 'text-align': col.align\r\n };\r\n }\r\n this._set(col.key, 'style', style);\r\n // element\r\n const th = createElement('th', 'column');\r\n const thStyle = { ...style };\r\n if (col.isfixed) {\r\n th.classList.add('sticky');\r\n thStyle.left = `${left}px`;\r\n }\r\n left += col.width;\r\n th.dataset.key = col.key;\r\n if (col.sortable) {\r\n thStyle.cursor = 'pointer';\r\n th.addEventListener('click', e => this._onHeaderClicked(e, col));\r\n }\r\n th.style.cssText = convertCssStyle(thStyle);\r\n if (col.orderable !== false) {\r\n col.orderable = true;\r\n th.addEventListener('mousedown', e => this._onDragStart(e, col));\r\n }\r\n const wrapper = createElement('div');\r\n if (col.align === 'right') {\r\n wrapper.style.justifyContent = 'flex-end';\r\n } else if (col.align === 'center') {\r\n wrapper.style.justifyContent = 'center';\r\n }\r\n th.appendChild(wrapper);\r\n if (!readonly && col.enabled !== false && col.allcheck && alwaysEditing) {\r\n const check = createCheckbox({\r\n onchange: e => this._onColumnAllChecked(col, e.target.checked)\r\n });\r\n wrapper.appendChild(check);\r\n }\r\n let caption;\r\n if (typeof type.createCaption === 'function') {\r\n caption = type.createCaption(col);\r\n } else {\r\n caption = createElement('span');\r\n caption.innerText = col.caption ?? '';\r\n }\r\n if (caption instanceof HTMLElement) {\r\n if (this.headerWrap) {\r\n caption.classList.add('wrap');\r\n }\r\n if (col.captionStyle != null) {\r\n caption.style.cssText = convertCssStyle(col.captionStyle);\r\n }\r\n wrapper.appendChild(caption);\r\n }\r\n if (col.captionTooltip != null) {\r\n const help = createIcon('fa-solid', 'question-circle');\r\n wrapper.appendChild(help);\r\n setTooltip(help, col.captionTooltip, false, this._var.parent);\r\n }\r\n // order arrow\r\n if (col.sortable) {\r\n th.appendChild(createElement('layer', 'arrow'));\r\n }\r\n // filter\r\n if (col.allowFilter === true) {\r\n const filter = createElement('layer', 'filter');\r\n filter.appendChild(createIcon('fa-solid', this.filterIcon));\r\n filter.addEventListener('mousedown', e => this._onFilter(e, col));\r\n th.classList.add('header-filter');\r\n th.appendChild(filter);\r\n }\r\n // resize spliter\r\n if (col.resizable !== false) {\r\n const spliter = createElement('layer', 'spliter');\r\n spliter.addEventListener('mousedown', e => this._onResizeStart(e, col));\r\n spliter.addEventListener('dblclick', e => this._onAutoResize(e, col));\r\n th.appendChild(spliter);\r\n }\r\n // bottom border\r\n th.appendChild(createElement('layer', 'bottom-border'));\r\n // tooltip\r\n // !nullOrEmpty(col.tooltip) && setTooltip(th, col.tooltip);\r\n header.appendChild(th);\r\n }\r\n const dragger = createElement('div', 'dragger');\r\n const draggerCursor = createElement('layer', 'dragger-cursor');\r\n header.appendChild(\r\n createElement('th', null,\r\n dragger, draggerCursor, createElement('div'), createElement('layer', 'bottom-border')));\r\n\r\n sizer.replaceChildren();\r\n this._var.refs.header = header;\r\n this._var.refs.dragger = dragger;\r\n this._var.refs.draggerCursor = draggerCursor;\r\n return thead;\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {HTMLTableElement} table \r\n * @returns {HTMLTableSectionElement}\r\n */\r\n _createBody(table) {\r\n const body = createElement('tbody');\r\n table.appendChild(body);\r\n const cols = this.columns;\r\n let width = 1;\r\n for (let col of cols) {\r\n if (col.visible !== false && !isNaN(col.width)) {\r\n width += col.width + 1;\r\n }\r\n }\r\n if (this.expandable) {\r\n width += ExpandableWidth;\r\n }\r\n table.style.width = `${width}px`;\r\n // body content\r\n body.addEventListener('dblclick', e => this._onRowDblClicked(e));\r\n // this._adjustRows(body);\r\n this._var.refs.body = body;\r\n\r\n // this.refresh();\r\n return body;\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {HTMLTableElement} table \r\n * @returns {HTMLTableSectionElement}\r\n */\r\n _createFooter(table) {\r\n const tfoot = createElement('tfoot');\r\n tfoot.style.display = 'none';\r\n table.appendChild(tfoot);\r\n tfoot.addEventListener('dblclick', e => this._onRowDblClicked(e));\r\n const footer = createElement('tr', 'ui-grid-row ui-grid-total-row');\r\n tfoot.appendChild(footer);\r\n let left = this.expandable ? ExpandableWidth : 0;\r\n if (this.expandable) {\r\n footer.appendChild(createElement('td', td => {\r\n td.className = 'ui-expandable sticky';\r\n const w = `${ExpandableWidth}px`;\r\n td.style.cssText = convertCssStyle({\r\n 'width': w,\r\n 'max-width': w,\r\n 'min-width': w,\r\n 'left': '0px'\r\n });\r\n }, createElement('div')));\r\n }\r\n this.columns.forEach((col, j) => {\r\n const cell = createElement('td', 'ui-grid-cell');\r\n if (col.visible !== false) {\r\n let style = this._get(col.key, 'style') ?? {};\r\n if (col.isfixed) {\r\n cell.classList.add('sticky');\r\n style.left = `${left}px`;\r\n }\r\n left += col.width;\r\n cell.dataset.col = String(j);\r\n if (col.totalCss != null) {\r\n style = { ...style, ...col.totalCss };\r\n }\r\n style = convertCssStyle(style);\r\n if (style !== '') {\r\n cell.style.cssText = style;\r\n }\r\n const element = GridColumn.create(col);\r\n if (typeof col.class === 'string') {\r\n GridColumn.setClass(element, col.class);\r\n }\r\n if (col.contentWrap) {\r\n element.classList.add('wrap');\r\n }\r\n cell.appendChild(element);\r\n } else {\r\n cell.style.display = 'none';\r\n }\r\n footer.appendChild(cell);\r\n })\r\n footer.appendChild(createElement('td', td => td.innerText = '\\u00a0'));\r\n\r\n this._var.refs.footer = footer;\r\n return tfoot;\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {HTMLTableSectionElement} content \r\n */\r\n _adjustRows(content) {\r\n let count = this._var.rowCount;\r\n if (isNaN(count) || count < 0 || !this.virtual) {\r\n count = this._var.currentSource?.length ?? 0;\r\n }\r\n const cols = this.columns;\r\n const exists = content.querySelectorAll('&>.ui-grid-row').length;\r\n count -= exists;\r\n if (count > 0) {\r\n const readonly = this.readonly;\r\n for (let i = 0; i < count; ++i) {\r\n const row = createElement('tr', 'ui-grid-row');\r\n const virtualRow = { cells: {} };\r\n this._var.virtualRows[exists + i] = virtualRow;\r\n let left = this.expandable ? ExpandableWidth : 0;\r\n if (this.expandable) {\r\n const icon = createIcon('fa-solid', 'caret-right');\r\n icon.dataset.expanded = '0';\r\n row.appendChild(createElement('td', td => {\r\n td.className = 'ui-expandable sticky';\r\n td.style.cssText = 'left: 0px';\r\n td.addEventListener('mousedown', e => {\r\n this._onExpandable(e, exists + i, row);\r\n e.stopPropagation();\r\n });\r\n },\r\n icon\r\n ));\r\n }\r\n cols.forEach((col, j) => {\r\n const cell = createElement('td', 'ui-grid-cell');\r\n virtualRow.cells[col.key ?? j] = { style: '' };\r\n if (col.visible !== false) {\r\n let style = this._get(col.key, 'style') ?? {};\r\n if (col.isfixed) {\r\n cell.classList.add('sticky');\r\n style.left = `${left}px`;\r\n }\r\n left += col.width;\r\n cell.dataset.row = String(exists + i);\r\n cell.dataset.col = String(j);\r\n if (col.css != null) {\r\n style = { ...style, ...col.css };\r\n }\r\n style = convertCssStyle(style);\r\n if (style !== '') {\r\n cell.style.cssText = style;\r\n }\r\n let type = this._var.colTypes[col.key];\r\n if (type == null) {\r\n if (isNaN(col.type)) {\r\n type = col.type;\r\n } else {\r\n type = ColumnTypeDefs[col.type];\r\n }\r\n type ??= GridColumn;\r\n this._var.colTypes[col.key] = type;\r\n }\r\n let element;\r\n if (!readonly && GridColumnTypeEnum.isAlwaysEditing(col.type)) {\r\n element = type.createEdit(e => this._onRowChanged(e, exists + i, col, e.target.checked, cell), col, exists + i);\r\n } else {\r\n element = type.create(col, i, this);\r\n if (typeof col.class === 'string') {\r\n type.setClass(element, col.class);\r\n }\r\n if (col.contentWrap) {\r\n element.classList.add('wrap');\r\n }\r\n }\r\n cell.appendChild(element);\r\n if (col.events != null) {\r\n for (let ev of Object.entries(col.events)) {\r\n element[ev[0]] = e => {\r\n const item = this._var.currentSource[this._var.startIndex + exists + i].values;\r\n ev[1].call(item, e);\r\n };\r\n }\r\n }\r\n } else {\r\n cell.style.display = 'none';\r\n }\r\n row.appendChild(cell);\r\n });\r\n row.appendChild(createElement('td', td => td.innerText = '\\u00a0'));\r\n content.appendChild(row);\r\n }\r\n } else if (count < 0) {\r\n let last = content.querySelectorAll('&>.ui-grid-row')[exists + count];\r\n while (last != null) {\r\n const next = last.nextElementSibling;\r\n last.remove();\r\n last = next;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {HTMLTableRowElement[]} rows \r\n * @param {GridColumnDefinition[]} cols \r\n * @param {any} [widths] \r\n */\r\n _fillRows(rows, cols, widths) {\r\n const startIndex = this._var.startIndex;\r\n const selectedIndexes = this._var.selectedIndexes;\r\n const offset = this.expandable ? 1 : 0;\r\n const readonly = this.readonly;\r\n rows.forEach((row, i) => {\r\n const vals = this._var.currentSource[startIndex + i];\r\n if (vals == null) {\r\n return;\r\n }\r\n if (!isPositive(row.children.length)) {\r\n return;\r\n }\r\n const virtualRow = this._var.virtualRows[i];\r\n const item = vals.values;\r\n const selected = selectedIndexes.includes(startIndex + i);\r\n if (selected) {\r\n row.classList.add('selected');\r\n } else if (row.classList.contains('selected')) {\r\n row.classList.remove('selected');\r\n }\r\n const stateChanged = virtualRow.editing !== selected;\r\n virtualRow.editing = selected;\r\n // data\r\n if (this.expandable) {\r\n const expanded = vals.__expanded;\r\n let rowExpanded = row.nextElementSibling;\r\n if (rowExpanded?.className !== 'ui-grid-row-expanded') {\r\n rowExpanded = null;\r\n }\r\n if (expanded) {\r\n let expandableObject = vals.__expandable_object;\r\n if (expandableObject == null && typeof this.expandableGenerator === 'function') {\r\n expandableObject = this.expandableGenerator(item);\r\n if (expandableObject?.element == null) {\r\n return;\r\n }\r\n expandableObject.element = createElement('td', td => {\r\n td.colSpan = cols.length + 2;\r\n },\r\n expandableObject.element\r\n );\r\n vals.__expandable_object = expandableObject;\r\n }\r\n if (rowExpanded == null) {\r\n rowExpanded = createElement('tr', 'ui-grid-row-expanded');\r\n this._var.refs.body.insertBefore(rowExpanded, row.nextElementSibling);\r\n } else {\r\n rowExpanded.style.display = '';\r\n }\r\n rowExpanded.replaceChildren(expandableObject.element);\r\n } else {\r\n if (rowExpanded != null) {\r\n rowExpanded.style.display = 'none';\r\n }\r\n }\r\n const iconCell = row.children[0];\r\n if (iconCell.children[0].dataset.expanded !== (expanded ? '1' : '0')) {\r\n const icon = createIcon('fa-solid', expanded ? 'caret-down' : 'caret-right');\r\n icon.dataset.expanded = expanded ? '1' : '0';\r\n iconCell.replaceChildren(icon);\r\n if (expanded) {\r\n if (typeof this.onRowExpanded === 'function') {\r\n this.onRowExpanded(vals.values, vals.__expandable_object);\r\n }\r\n } else {\r\n if (typeof this.onRowCollapsed === 'function') {\r\n this.onRowCollapsed(vals.values, vals.__expandable_object);\r\n }\r\n }\r\n }\r\n }\r\n cols.forEach((col, j) => {\r\n if (col.visible === false) {\r\n return;\r\n }\r\n const cell = row.children[j + offset];\r\n if (cell == null) {\r\n return;\r\n }\r\n const virtualCell = virtualRow.cells[col.key ?? j];\r\n let val;\r\n if (col.text != null) {\r\n val = col.text;\r\n } else if (typeof col.filter === 'function') {\r\n val = col.filter(item, selected, this._var.refs.body);\r\n } else {\r\n val = item[col.key];\r\n if (val != null) {\r\n if (Object.prototype.hasOwnProperty.call(val, 'DisplayValue')) {\r\n val = val.DisplayValue;\r\n } else if (Array.isArray(val)) {\r\n val = val.join(', ');\r\n }\r\n }\r\n }\r\n val ??= '';\r\n // fill\r\n let bg = col.background;\r\n if (bg != null) {\r\n if (typeof bg === 'function') {\r\n bg = col.background(item);\r\n }\r\n } else if (typeof col.bgFilter === 'function') {\r\n bg = col.bgFilter(item);\r\n }\r\n bg ??= '';\r\n if (bg !== virtualCell.background) {\r\n virtualCell.background = bg;\r\n cell.style.backgroundColor = bg;\r\n }\r\n const alwaysEditing = GridColumnTypeEnum.isAlwaysEditing(col.type);\r\n const type = this._var.colTypes[col.key] ?? GridColumn;\r\n let element;\r\n if (!readonly && !alwaysEditing && typeof type.createEdit === 'function') {\r\n const oldValue = vals.__editing?.[col.key];\r\n if (oldValue !== undefined) {\r\n delete vals.__editing[col.key];\r\n if (typeof type.leaveEdit === 'function') {\r\n type.leaveEdit(cell.children[0], this._var.el);\r\n }\r\n if (type.editing) {\r\n val = type.getValue({ target: cell.children[0] }, col);\r\n this._onRowChanged(null, i, col, val, cell, oldValue);\r\n }\r\n }\r\n if (stateChanged) {\r\n element = selected ?\r\n type.createEdit(e => {\r\n let old;\r\n if (type.editing) {\r\n old = vals.__editing?.[col.key];\r\n if (old === undefined) {\r\n return;\r\n }\r\n delete vals.__editing[col.key];\r\n }\r\n this._onRowChanged(e, i, col, type.getValue(e, col), cell, old);\r\n }, col, this._var.el, vals) :\r\n type.create(col, i, this);\r\n if (typeof col.class === 'string') {\r\n type.setClass(element, col.class);\r\n }\r\n if (col.contentWrap) {\r\n element.classList.add('wrap');\r\n }\r\n cell.replaceChildren(element);\r\n if (col.events != null) {\r\n for (let ev of Object.entries(col.events)) {\r\n element[ev[0]] = ev[1].bind(item);\r\n }\r\n }\r\n } else {\r\n element = cell.children[0];\r\n }\r\n } else {\r\n element = cell.children[0];\r\n }\r\n if (stateChanged) {\r\n if (typeof type.createEdit === 'function') {\r\n delete virtualCell.attrs;\r\n virtualCell.style = '';\r\n delete virtualCell.value;\r\n delete virtualCell.enabled;\r\n }\r\n }\r\n if (val !== virtualCell.value) {\r\n virtualCell.value = val;\r\n type.setValue(element, val, vals, col, this);\r\n }\r\n if (typeof type.setEnabled === 'function') {\r\n let enabled;\r\n if (readonly) {\r\n enabled = false;\r\n } else {\r\n enabled = col.enabled;\r\n if (typeof enabled === 'function') {\r\n this._var.enabledDict[col.key] = true;\r\n enabled = enabled.call(col, item);\r\n } else if (typeof enabled === 'string') {\r\n this._var.enabledDict[col.key] = enabled;\r\n enabled = item[enabled];\r\n }\r\n }\r\n if (enabled !== virtualCell.enabled) {\r\n virtualCell.enabled = enabled;\r\n type.setEnabled(element, enabled, selected);\r\n }\r\n }\r\n if (stateChanged && typeof type.setEditing === 'function') {\r\n type.setEditing(element, selected);\r\n }\r\n let tip = col.tooltip;\r\n if (typeof tip === 'function') {\r\n tip = tip.call(col, item);\r\n }\r\n if (tip !== virtualCell.tooltip) {\r\n virtualCell.tooltip = tip;\r\n if (nullOrEmpty(tip)) {\r\n element.querySelector('.ui-tooltip-wrapper')?.remove();\r\n } else {\r\n setTooltip(element, tip, false, this.element);\r\n }\r\n }\r\n // auto resize\r\n if (this._var.needResize && widths != null && this._get(col.key, 'autoResize')) {\r\n const width = element.scrollWidth + 12;\r\n if (width > 0 && (isNaN(widths[j]) || widths[j] < width)) {\r\n widths[j] = width;\r\n widths.flag = true;\r\n }\r\n }\r\n let style = col.style;\r\n if (style != null) {\r\n if (typeof style === 'function') {\r\n style = col.style(item);\r\n }\r\n } else if (typeof col.styleFilter === 'function') {\r\n style = col.styleFilter(item);\r\n }\r\n const separateElement = typeof type.getElement === 'function';\r\n let maxHeight;\r\n if (col.maxLines > 0) {\r\n maxHeight = `${col.maxLines * this.lineHeight}px`;\r\n if (!separateElement) {\r\n if (style == null) {\r\n style = { 'max-height': maxHeight };\r\n } else {\r\n style['max-height'] = maxHeight;\r\n }\r\n }\r\n }\r\n const styleText = style != null ? convertCssStyle(style) : '';\r\n if (styleText !== virtualCell.style) {\r\n virtualCell.style = styleText;\r\n if (style != null) {\r\n type.setStyle(element, style);\r\n } else {\r\n element.style.cssText = '';\r\n }\r\n }\r\n if (separateElement && maxHeight != null) {\r\n const e = type.getElement(element);\r\n if (e != null) {\r\n e.style['max-height'] = maxHeight;\r\n }\r\n }\r\n if (col.attrs != null) {\r\n let attrs = col.attrs;\r\n if (typeof attrs === 'function') {\r\n attrs = attrs(item);\r\n }\r\n const attrsText = convertCssStyle(attrs);\r\n if (attrsText !== virtualCell.attrs) {\r\n virtualCell.attrs = attrsText;\r\n for (let attr of Object.entries(attrs)) {\r\n element.setAttribute(attr[0], attr[1]);\r\n }\r\n }\r\n }\r\n });\r\n if (vals.__editing != null) {\r\n delete vals.__editing;\r\n }\r\n });\r\n // total\r\n const tfoot = this._var.refs.footer.parentElement;\r\n if (this.total != null) {\r\n if (tfoot.style.display === 'none') {\r\n tfoot.style.display = '';\r\n }\r\n const cells = this._var.refs.footer.children;\r\n this.columns.forEach((col, j) => {\r\n if (col.visible === false) {\r\n return;\r\n }\r\n const cell = cells[j + offset];\r\n if (cell == null) {\r\n return;\r\n }\r\n let val = this.total[col.key];\r\n if (val != null && Object.prototype.hasOwnProperty.call(val, 'DisplayValue')) {\r\n val = val.DisplayValue;\r\n }\r\n val ??= '';\r\n const element = cell.children[0];\r\n GridColumn.setValue(element, val);\r\n // auto resize\r\n if (this._var.needResize && this._get(col.key, 'autoResize')) {\r\n const width = element.scrollWidth + 12;\r\n if (width > 0 && widths != null && (isNaN(widths[j]) || widths[j] < width)) {\r\n widths[j] = width;\r\n widths.flag = true;\r\n }\r\n }\r\n });\r\n } else if (tfoot.style.display === '') {\r\n tfoot.style.display = 'none';\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {number} index \r\n * @param {number} width \r\n * @param {boolean} [freeze] \r\n */\r\n _changeColumnWidth(index, width, freeze) {\r\n const col = this.columns[index];\r\n // const oldwidth = col.width;\r\n const w = `${width}px`;\r\n col.width = width;\r\n const style = this._get(col.key, 'style');\r\n style.width = w;\r\n style['max-width'] = w;\r\n style['min-width'] = w;\r\n const headerCells = this._headerCells;\r\n let element = headerCells[index];\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n // element.style.cssText += `width: ${w}; max-width: ${w}; min-width: ${w}`;\r\n let left = this.expandable ? ExpandableWidth : 0;\r\n if (col.isfixed) {\r\n left = element.offsetLeft + width;\r\n let l = left;\r\n for (let i = index + 1; i < this.columns.length; ++i) {\r\n if (this.columns[i].isfixed) {\r\n headerCells[i].style.left = `${l}px`;\r\n l += this.columns[i].width;\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n const offset = this.expandable ? 1 : 0;\r\n for (let row of this._tableRows) {\r\n element = row.children[index + offset];\r\n if (element != null) {\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n // element.style.cssText += `width: ${w}; max-width: ${w}; min-width: ${w}`;\r\n if (col.isfixed) {\r\n let l = left;\r\n for (let i = index + offset + 1; i < this.columns.length; ++i) {\r\n if (this.columns[i].isfixed) {\r\n row.children[i].style.left = `${l}px`;\r\n l += this.columns[i].width;\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n // footer\r\n if (this.total != null) {\r\n const footerCells = this._footerCells;\r\n element = footerCells[index];\r\n element.style.width = w;\r\n element.style.maxWidth = w;\r\n element.style.minWidth = w;\r\n if (col.isfixed) {\r\n let l = left;\r\n for (let i = index + 1; i < this.columns.length; ++i) {\r\n if (this.columns[i].isfixed) {\r\n footerCells[i].style.left = `${l}px`;\r\n l += this.columns[i].width;\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!freeze) {\r\n this._layoutHeaderFooter();\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n _layoutHeaderFooter() {\r\n const children = this._var.refs.table.children;\r\n this._var.headerHeight = this.headerVisible === false ? 0 : (this.headerWrap ? children[0].offsetHeight : this.rowHeight);\r\n if (this.total != null) {\r\n this._var.footerHeight = children[2].offsetHeight;\r\n const footerOffset = this._var.refs.table.offsetHeight - this._var.el.clientHeight;\r\n if (this._var.footerOffset !== footerOffset) {\r\n this._var.footerOffset = footerOffset;\r\n this._var.refs.footer.parentElement.style.bottom = `${this._var.refs.table.offsetTop + footerOffset - this._var.el.scrollTop}px`;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {number} index \r\n * @param {number} offset \r\n * @param {number} mouse \r\n * @param {number} draggerCellLeft \r\n */\r\n _changingColumnOrder(index, offset, mouse, draggerCellLeft) {\r\n const children = this._headerCells;\r\n let element = children[index];\r\n this._var.refs.dragger.style.cssText = `left: ${element.offsetLeft - draggerCellLeft + offset}px; width: ${element.style.width}; display: block`;\r\n // offset = x + gridScrollLeft - element.offsetLeft; // getOffsetLeftFromWindow(element);\r\n offset += mouse;\r\n let idx;\r\n const toLeft = offset < 0;\r\n if (toLeft) {\r\n offset = -offset;\r\n for (let i = index - 1; i >= 0 && offset >= 0; i -= 1) {\r\n element = children[i];\r\n if (element == null || !element.className || element.classList.contains('sticky')) {\r\n idx = i + 1;\r\n break;\r\n }\r\n if (offset < element.offsetWidth) {\r\n idx = (offset > element.offsetWidth / 2) ? i : i + 1;\r\n break;\r\n }\r\n offset -= element.offsetWidth;\r\n }\r\n idx ??= 0;\r\n } else {\r\n const count = children.length;\r\n for (let i = index; i < count - 1 && offset >= 0; ++i) {\r\n element = children[i];\r\n if (element == null || !element.className || element.classList.contains('sticky')) {\r\n idx = i;\r\n break;\r\n }\r\n if (offset < element.offsetWidth) {\r\n idx = (offset > element.offsetWidth / 2) ? i + 1 : i;\r\n break;\r\n }\r\n offset -= element.offsetWidth;\r\n }\r\n idx ??= count - 1;\r\n }\r\n if (idx !== this._var.colAttrs.__orderIndex || this._var.refs.draggerCursor.style.display !== 'block') {\r\n element = children[idx];\r\n if (element == null) {\r\n return;\r\n }\r\n this._var.colAttrs.__orderIndex = idx;\r\n // avoid `offsetLeft` of hidden header to be 0\r\n let left;\r\n if (element.style.display === 'none') {\r\n left = 0;\r\n while (left === 0 && (element = children[++idx]) != null) {\r\n left = element.offsetLeft;\r\n }\r\n if (!toLeft && left === 0) {\r\n left = draggerCellLeft;\r\n }\r\n } else {\r\n left = element.offsetLeft;\r\n }\r\n // set position of dragger cursor\r\n this._var.refs.draggerCursor.style.cssText = `left: ${left - draggerCellLeft}px; display: block`;\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {number} index \r\n */\r\n _changeColumnOrder(index) {\r\n this._var.refs.dragger.style.display = '';\r\n this._var.refs.draggerCursor.style.display = '';\r\n const orderIndex = this._var.colAttrs.__orderIndex;\r\n if (orderIndex >= 0 && orderIndex !== index) {\r\n let targetIndex = orderIndex - index;\r\n if (targetIndex >= 0 && targetIndex <= 1) {\r\n return;\r\n }\r\n const header = this._var.refs.header;\r\n const children = this._headerCells;\r\n const rows = this._tableRows;\r\n const columns = this.columns;\r\n const offset = this.expandable ? 1 : 0;\r\n if (targetIndex > 1) {\r\n targetIndex = orderIndex - 1;\r\n // const current = columns[index];\r\n // for (let i = index; i < targetIndex; ++i) {\r\n // columns[i] = columns[i + 1];\r\n // }\r\n // columns[targetIndex] = current;\r\n const current = columns.splice(index, 1)[0];\r\n columns.splice(targetIndex, 0, current);\r\n header.insertBefore(children[index], children[targetIndex].nextElementSibling);\r\n for (let row of rows) {\r\n row.insertBefore(row.children[index + offset], row.children[targetIndex + offset].nextElementSibling);\r\n }\r\n } else {\r\n targetIndex = orderIndex;\r\n // const current = columns[index];\r\n // for (let i = index; i > targetIndex; i -= 1) {\r\n // columns[i] = columns[i - 1];\r\n // }\r\n // columns[targetIndex] = current;\r\n const current = columns.splice(index, 1)[0];\r\n columns.splice(targetIndex, 0, current);\r\n header.insertBefore(children[index], children[targetIndex]);\r\n for (let row of rows) {\r\n row.insertBefore(row.children[index + offset], row.children[targetIndex + offset]);\r\n }\r\n }\r\n if (this.sortArray == null || this.sortArray.length === 0) {\r\n // refresh sortIndex\r\n [...children].forEach((th, i) => {\r\n const arrow = th.querySelector('.arrow');\r\n if (arrow == null) {\r\n return;\r\n }\r\n if (arrow.className !== 'arrow') {\r\n this.sortIndex = i;\r\n }\r\n });\r\n }\r\n\r\n if (typeof this.onColumnChanged === 'function') {\r\n this.onColumnChanged(ColumnChangedType.Reorder, index, targetIndex);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {number} top \r\n * @param {boolean} [reload] \r\n * @returns {number}\r\n */\r\n _scrollToTop(top, reload) {\r\n const rowHeight = (this.rowHeight + 1);\r\n top -= (top % (rowHeight * 2)) + (RedumCount * rowHeight);\r\n if (top < 0) {\r\n top = 0;\r\n } else {\r\n let bottomTop = this._var.containerHeight - (reload ? 0 : this._var.rowCount * rowHeight);\r\n if (bottomTop < 0) {\r\n bottomTop = 0;\r\n }\r\n if (top > bottomTop) {\r\n top = bottomTop;\r\n }\r\n }\r\n if (this._var.scrollTop !== top) {\r\n this._var.scrollTop = top;\r\n if (this.virtual) {\r\n this._var.startIndex = top / rowHeight;\r\n }\r\n this._fillRows(this._tableRows, this.columns);\r\n if (this.virtual) {\r\n this._var.refs.table.style.top = `${top}px`;\r\n }\r\n } else if (reload) {\r\n this._fillRows(this._tableRows, this.columns);\r\n }\r\n\r\n return top;\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {string} key \r\n * @param {(\"autoResize\" | \"style\" | \"resizing\" | \"dragging\" | \"filterSource\" | \"filterHeight\" | \"filterTop\")} name \r\n * @returns {any}\r\n */\r\n _get(key, name) {\r\n const attr = this._var.colAttrs[key];\r\n if (attr == null) {\r\n return null;\r\n }\r\n return attr[name];\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {string} key \r\n * @param {(\"autoResize\" | \"style\" | \"filterSource\" | \"filterHeight\" | \"filterTop\")} name \r\n * @param {any} value \r\n */\r\n _set(key, name, value) {\r\n const attr = this._var.colAttrs[key];\r\n if (attr == null) {\r\n this._var.colAttrs[key] = { [name]: value };\r\n } else {\r\n attr[name] = value;\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {GridRowItem} item \r\n * @param {boolean} editing \r\n * @param {GridColumnDefinition} col \r\n * @returns {any}\r\n */\r\n _getItemProp(item, editing, col) {\r\n let value;\r\n if (typeof col?.filter === 'function') {\r\n value = col.filter(item, editing, this._var.refs.body);\r\n } else {\r\n value = item[col.key];\r\n }\r\n if (value == null) {\r\n return value;\r\n }\r\n const prop = editing ? 'Value' : 'DisplayValue';\r\n if (Object.prototype.hasOwnProperty.call(value, prop)) {\r\n return value[prop];\r\n }\r\n return value;\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {HTMLElement} target \r\n * @returns {HTMLElement[]}\r\n */\r\n _getRowTarget(target) {\r\n let parent;\r\n while ((parent = target.parentElement) != null && !parent.classList.contains('ui-grid-row')) {\r\n target = parent;\r\n }\r\n return [parent, target];\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {HTMLElement} element \r\n * @returns {HTMLElement}\r\n */\r\n _getParentElement(element) {\r\n while (element != null && element.className !== 'ui-grid') {\r\n element = element.parentElement;\r\n }\r\n return element;\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {string} tagName \r\n * @returns {boolean}\r\n */\r\n _notHeader(tagName) {\r\n return /^(input|label|layer|svg|use)$/i.test(tagName);\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {MouseEvent} e \r\n * @param {GridColumnDefinition} col \r\n * @param {boolean} [force] \r\n */\r\n _onHeaderClicked(e, col, force) {\r\n if (!force && (this._get(col.key, 'resizing') || this._get(col.key, 'dragging'))) {\r\n return;\r\n }\r\n if (!this._notHeader(e.target.tagName)) {\r\n const index = this.columns.indexOf(col);\r\n if (index < 0) {\r\n return;\r\n }\r\n if (this.sortIndex === index) {\r\n this.sortDirection = this.sortDirection === 1 ? -1 : 1;\r\n } else {\r\n this.sortIndex = index;\r\n }\r\n this.sortColumn();\r\n if (typeof this.onColumnChanged === 'function') {\r\n this.onColumnChanged(ColumnChangedType.Sort, index, this.sortDirection);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {MouseEvent} [e] \r\n * @returns {boolean}\r\n */\r\n _onCloseFilter(e) {\r\n if (e != null) {\r\n if ((e.target.tagName === 'LAYER' && e.target.classList.contains('filter')) ||\r\n e.target.tagName === 'use') {\r\n return false;\r\n }\r\n }\r\n const panels = this._var.el.querySelectorAll('.filter-panel.active');\r\n if (panels.length > 0) {\r\n panels.forEach(el => el.classList.remove('active'));\r\n setTimeout(() => this._var.el.querySelectorAll('.filter-panel').forEach(el => el.remove()), 120);\r\n const filtering = this._var.colAttrs.__filtering;\r\n if (filtering instanceof HTMLElement) {\r\n filtering.classList.remove('hover');\r\n }\r\n delete this._var.colAttrs.__filtering;\r\n document.removeEventListener('mousedown', this._onCloseFilter);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {MouseEvent} e \r\n * @param {GridColumnDefinition} col \r\n */\r\n _onFilter(e, col) {\r\n if (this._onCloseFilter()) {\r\n return;\r\n }\r\n document.addEventListener('mousedown', this._onCloseFilter.bind(this));\r\n const panel = createElement('div', 'filter-panel');\r\n panel.addEventListener('mousedown', e => e.stopPropagation());\r\n const filter = e.currentTarget;\r\n const th = filter.parentElement;\r\n const width = th.offsetWidth;\r\n panel.style.top = `${th.offsetHeight + this._var.el.scrollTop}px`;\r\n const offsetLeft = th.offsetLeft;\r\n const totalWidth = th.parentElement.offsetWidth;\r\n const left = offsetLeft + FilterPanelWidth > totalWidth ?\r\n totalWidth - FilterPanelWidth :\r\n offsetLeft + (width > FilterPanelWidth ? width - FilterPanelWidth : 0);\r\n panel.style.left = `${left}px`;\r\n const maxHeight = this._var.el.offsetHeight - this._var.headerHeight;\r\n if (maxHeight < 300) {\r\n panel.style.height = `${maxHeight}px`;\r\n } else {\r\n panel.style.height = '';\r\n }\r\n\r\n // search\r\n let searchbox;\r\n if (col.allowSearch !== false) {\r\n const searchholder = createElement('div', 'filter-search-holder');\r\n searchbox = createElement('input', 'filter-search-box ui-text');\r\n searchbox.type = 'text';\r\n const searchicon = createIcon('fa-regular', 'search');\r\n searchicon.addEventListener('mousedown', e => {\r\n searchbox.focus();\r\n e.preventDefault();\r\n });\r\n searchholder.append(searchbox, searchicon);\r\n panel.append(searchholder);\r\n }\r\n // list\r\n const itemlist = createElement('div', 'filter-item-list');\r\n itemlist.addEventListener('scroll', e => throttle(this._onFilterScroll, RefreshInterval, this, col, itemlist, e.target.scrollTop), { passive: true });\r\n // - all\r\n const itemall = createElement('div', 'filter-item filter-all');\r\n itemall.appendChild(createCheckbox({\r\n label: this.langs.all,\r\n onchange: e => {\r\n const checked = e.target.checked;\r\n itemlist.querySelectorAll('.filter-content input').forEach(box => box.checked = checked);\r\n for (let it of this._get(col.key, 'filterSource')) {\r\n it.__checked = checked;\r\n }\r\n }\r\n }));\r\n itemlist.appendChild(itemall);\r\n // - items\r\n let array;\r\n if (Array.isArray(col.filterSource)) {\r\n array = col.filterSource;\r\n } else if (typeof col.filterSource === 'function') {\r\n array = col.filterSource.call(this, col);\r\n } else {\r\n const dict = Object.create(null);\r\n for (let item of this._var.source) {\r\n let displayValue = this._getItemProp(item.values, false, col);\r\n if (displayValue == null) {\r\n displayValue = col.filterAllowNull ? this.langs.null : '';\r\n }\r\n if (Array.isArray(displayValue)) {\r\n const vals = this._getItemProp(item.values, true, col);\r\n displayValue.forEach((display, i) => {\r\n if (!Object.hasOwnProperty.call(dict, display)) {\r\n dict[display] = {\r\n Value: vals[i],\r\n DisplayValue: display\r\n };\r\n }\r\n });\r\n } else if (!Object.hasOwnProperty.call(dict, displayValue)) {\r\n dict[displayValue] = {\r\n Value: this._getItemProp(item.values, true, col),\r\n DisplayValue: displayValue\r\n };\r\n }\r\n }\r\n array = Object.values(dict)\r\n .sort((a, b) => {\r\n // if (a == null && b == null) {\r\n // return 0;\r\n // }\r\n // if (a == null && b != null) {\r\n // return -1;\r\n // }\r\n // if (a != null && b == null) {\r\n // return 1;\r\n // }\r\n // if (Object.prototype.hasOwnProperty.call(a, 'Value')) {\r\n // a = a.Value;\r\n // }\r\n // if (Object.prototype.hasOwnProperty.call(b, 'Value')) {\r\n // b = b.Value;\r\n // }\r\n // return a > b ? 1 : a < b ? -1 : 0;\r\n return a.Value > b.Value ? 1 : a.Value < b.Value ? -1 : 0;\r\n });\r\n }\r\n array = array.map(i => {\r\n if (Object.prototype.hasOwnProperty.call(i, 'Value') &&\r\n Object.prototype.hasOwnProperty.call(i, 'DisplayValue')) {\r\n return i;\r\n }\r\n return {\r\n Value: i,\r\n DisplayValue: i == null ? this.langs.null : i\r\n };\r\n });\r\n this._fillFilterList(col, itemlist, array, itemall);\r\n itemall.querySelector('input').checked = ![...itemlist.querySelectorAll('.filter-content input')].some(i => !i.checked);\r\n panel.appendChild(itemlist);\r\n if (searchbox != null) {\r\n searchbox.addEventListener('input', e => {\r\n const key = e.currentTarget.value.toLowerCase();\r\n const items = key.length === 0 ? array : array.filter(i => {\r\n let displayValue;\r\n if (i != null && Object.prototype.hasOwnProperty.call(i, 'DisplayValue')) {\r\n displayValue = i.DisplayValue;\r\n } else {\r\n displayValue = i;\r\n }\r\n if (displayValue == null) {\r\n displayValue = this.langs.null;\r\n }\r\n return String(displayValue).toLowerCase().includes(key);\r\n });\r\n this._fillFilterList(col, itemlist, items, itemall);\r\n });\r\n }\r\n // function\r\n const functions = createElement('div', 'filter-function');\r\n functions.append(\r\n createElement('span', ok => {\r\n ok.className = 'button';\r\n ok.innerText = this.langs.ok;\r\n ok.addEventListener('click', () => {\r\n const array = this._get(col.key, 'filterSource').filter(i => i.__checked !== false);\r\n if (typeof col.onFilterOk === 'function') {\r\n col.onFilterOk.call(this, col, array);\r\n } else {\r\n if (GridColumnTypeEnum.isAlwaysEditing(col.type)) {\r\n col.filterValues = array.map(a => a.Value);\r\n } else {\r\n const nullValue = col.filterAllowNull ? null : '';\r\n col.filterValues = array.map(a => a.Value == null ? nullValue : a.DisplayValue);\r\n }\r\n }\r\n this._var.colAttrs.__filtered = true;\r\n this._refreshSource();\r\n if (typeof col.onFiltered === 'function') {\r\n col.onFiltered.call(this, col);\r\n }\r\n filter.replaceChildren(createIcon('fa-solid', this.filteredIcon));\r\n filter.classList.add('active');\r\n this._onCloseFilter();\r\n });\r\n }),\r\n createElement('span', reset => {\r\n reset.className = 'button';\r\n reset.innerText = this.langs.reset;\r\n reset.addEventListener('click', () => {\r\n delete col.filterValues;\r\n this._var.colAttrs.__filtered = this.columns.some(c => c.filterValues != null)\r\n this._refreshSource();\r\n if (typeof col.onFiltered === 'function') {\r\n col.onFiltered.call(this, col);\r\n }\r\n filter.replaceChildren(createIcon('fa-solid', this.filterIcon));\r\n filter.classList.remove('active');\r\n this._onCloseFilter();\r\n });\r\n })\r\n );\r\n panel.appendChild(functions);\r\n\r\n this._var.el.appendChild(panel);\r\n setTimeout(() => panel.classList.add('active'), 0);\r\n this._var.colAttrs.__filtering = filter;\r\n filter.classList.add('hover');\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {GridColumnDefinition} col \r\n * @param {HTMLDivElement} list \r\n * @param {ValueItem[]} array \r\n * @param {HTMLDivElement} all \r\n */\r\n _fillFilterList(col, list, array, all) {\r\n list.querySelector('.filter-holder')?.remove();\r\n list.querySelector('.filter-content')?.remove();\r\n const rowHeight = this.filterRowHeight;\r\n const height = array.length * rowHeight;\r\n this._set(col.key, 'filterHeight', height);\r\n const holder = createElement('div', 'filter-holder');\r\n holder.style.height = `${height}px`;\r\n const content = createElement('div', 'filter-content');\r\n content.style.top = `${rowHeight}px`;\r\n this._set(col.key, 'filterSource', array);\r\n const propKey = GridColumnTypeEnum.isAlwaysEditing(col.type) ? 'Value' : 'DisplayValue';\r\n const nullValue = col.filterAllowNull ? null : '';\r\n const allSelected = !Array.isArray(col.filterValues);\r\n for (let item of array) {\r\n let v = item.Value ?? nullValue;\r\n if (v != null) {\r\n v = Object.prototype.hasOwnProperty.call(item, propKey) ? item[propKey] : item;\r\n }\r\n item.__checked = allSelected || col.filterValues.some(it => Array.isArray(it) ? it.includes(v) : it === v);\r\n }\r\n if (array.length > 12) {\r\n array = array.slice(0, 12);\r\n }\r\n this._doFillFilterList(content, array, all);\r\n list.append(holder, content);\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {HTMLDivElement} content \r\n * @param {ValueItem[]} array \r\n * @param {HTMLDivElement} all \r\n */\r\n _doFillFilterList(content, array, all) {\r\n for (let item of array) {\r\n const div = createElement('div', 'filter-item');\r\n const display = Object.prototype.hasOwnProperty.call(item, 'DisplayValue') ? item.DisplayValue : item;\r\n div.appendChild(createCheckbox({\r\n checked: item.__checked,\r\n label: display && String(display).replace(/(\\r\\n|\\n|<br[ \\t]*\\/?>)/g, '\\u00a0'),\r\n title: display,\r\n onchange: e => {\r\n item.__checked = e.target.checked;\r\n all.querySelector('input').checked = ![...content.querySelectorAll('input')].some(i => !i.checked);\r\n }\r\n }));\r\n content.appendChild(div);\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {GridColumnDefinition} col \r\n * @param {HTMLDivElement} list \r\n * @param {number} top \r\n */\r\n _onFilterScroll(col, list, top) {\r\n const rowHeight = this.filterRowHeight;\r\n top -= (top % (rowHeight * 2)) + rowHeight;\r\n if (top < 0) {\r\n top = 0;\r\n } else {\r\n let bottomTop = this._get(col.key, 'filterHeight') - (12 * rowHeight);\r\n if (bottomTop < 0) {\r\n bottomTop = 0;\r\n }\r\n if (top > bottomTop) {\r\n top = bottomTop;\r\n }\r\n }\r\n if (this._get(col.key, 'filterTop') !== top) {\r\n this._set(col.key, 'filterTop', top);\r\n const startIndex = top / rowHeight;\r\n let array = this._get(col.key, 'filterSource');\r\n if (startIndex + 12 < array.length) {\r\n array = array.slice(startIndex, startIndex + 12);\r\n } else {\r\n array = array.slice(-12);\r\n }\r\n const content = list.querySelector('.filter-content');\r\n content.replaceChildren();\r\n this._doFillFilterList(content, array, list.querySelector('.filter-all'));\r\n content.style.top = `${top + rowHeight}px`;\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {MouseEvent} e \r\n * @param {GridColumnDefinition} col \r\n */\r\n _onDragStart(e, col) {\r\n if (this._notHeader(e.target.tagName)) {\r\n return;\r\n }\r\n if (e.currentTarget.classList.contains('sticky')) {\r\n return;\r\n }\r\n const index = indexOfParent(e.currentTarget) - (this.expandable ? 1 : 0);\r\n const cx = getClientX(e);\r\n const window = this.window ?? global;\r\n const clearEvents = attr => {\r\n for (let event of ['mousemove', 'mouseup']) {\r\n if (Object.prototype.hasOwnProperty.call(attr, event)) {\r\n window.removeEventListener(event, attr[event]);\r\n delete attr[event];\r\n }\r\n }\r\n };\r\n let attr = this._var.colAttrs[col.key];\r\n if (attr == null) {\r\n attr = this._var.colAttrs[col.key] = {};\r\n } else {\r\n clearEvents(attr);\r\n }\r\n attr.dragging = true;\r\n const draggerCellLeft = this._var.refs.header.querySelector('th:last-child').offsetLeft;\r\n let p = this._var.el;\r\n let gridLeftFromWindow = p.offsetLeft;\r\n while ((p = p.offsetParent) != null) {\r\n gridLeftFromWindow += p.offsetLeft + p.clientLeft;\r\n }\r\n const mouse = cx - e.currentTarget.offsetLeft + this._var.scrollLeft - gridLeftFromWindow;\r\n const dragmove = e => {\r\n const cx2 = getClientX(e);\r\n const offset = cx2 - cx;\r\n let pos = attr.offset;\r\n let dragging;\r\n if (pos == null) {\r\n if (offset > MiniDragOffset || offset < -MiniDragOffset) {\r\n dragging = true;\r\n }\r\n } else if (pos !== offset) {\r\n dragging = true;\r\n }\r\n if (dragging) {\r\n this._changingColumnOrder(index, offset, mouse, draggerCellLeft);\r\n attr.offset = offset;\r\n }\r\n };\r\n attr.mousemove = e => throttle(dragmove, RefreshInterval, this, e);\r\n attr.mouseup = () => {\r\n clearEvents(attr);\r\n if (attr.offset == null) {\r\n delete attr.dragging;\r\n } else {\r\n setTimeout(() => {\r\n delete attr.dragging;\r\n delete attr.offset;\r\n });\r\n this._changeColumnOrder(index);\r\n }\r\n };\r\n ['mousemove', 'mouseup'].forEach(event => window.addEventListener(event, attr[event]));\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {MouseEvent} e \r\n * @param {GridColumnDefinition} col \r\n */\r\n _onResizeStart(e, col) {\r\n const cx = getClientX(e);\r\n const width = col.width;\r\n const index = indexOfParent(e.currentTarget.parentElement) - (this.expandable ? 1 : 0);\r\n const window = this.window ?? global;\r\n const clearEvents = attr => {\r\n for (let event of ['mousemove', 'mouseup']) {\r\n if (Object.prototype.hasOwnProperty.call(attr, event)) {\r\n window.removeEventListener(event, attr[event]);\r\n delete attr[event];\r\n }\r\n }\r\n };\r\n let attr = this._var.colAttrs[col.key];\r\n if (attr == null) {\r\n attr = this._var.colAttrs[col.key] = {};\r\n } else {\r\n clearEvents(attr);\r\n }\r\n attr.resizing = width;\r\n const resizemove = e => {\r\n const cx2 = getClientX(e);\r\n const val = width + (cx2 - cx);\r\n if (val < MiniColumnWidth) {\r\n return;\r\n }\r\n attr.resizing = val;\r\n attr.sizing = true;\r\n this._changeColumnWidth(index, val);\r\n };\r\n attr.mousemove = e => throttle(resizemove, RefreshInterval, this, e);\r\n attr.mouseup = e => {\r\n clearEvents(attr);\r\n const width = attr.resizing;\r\n if (width != null) {\r\n setTimeout(() => delete attr.resizing);\r\n if (attr.sizing) {\r\n delete attr.sizing;\r\n delete attr.autoResize;\r\n this._changeColumnWidth(index, width);\r\n if (typeof this.onColumnChanged === 'function') {\r\n this.onColumnChanged(ColumnChangedType.Resize, index, width);\r\n }\r\n }\r\n }\r\n e.stopPropagation();\r\n e.preventDefault();\r\n };\r\n ['mousemove', 'mouseup'].forEach(event => window.addEventListener(event, attr[event]));\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {MouseEvent} e \r\n * @param {GridColumnDefinition} col \r\n */\r\n _onAutoResize(e, col) {\r\n const th = e.currentTarget.parentElement;\r\n const index = indexOfParent(th);\r\n const offset = this.expandable ? 1 : 0;\r\n let width = th.querySelector('div:first-child').scrollWidth;\r\n for (let row of this._tableRows) {\r\n const element = row.children[index + offset].children[0];\r\n const w = element.scrollWidth;\r\n if (w > width) {\r\n width = w;\r\n }\r\n }\r\n if (width < MiniColumnWidth) {\r\n width = MiniColumnWidth;\r\n }\r\n if (width > 0 && width !== col.width) {\r\n width += 12;\r\n this._changeColumnWidth(index - offset, width);\r\n if (typeof this.onColumnChanged === 'function') {\r\n this.onColumnChanged(ColumnChangedType.Resize, index - offset, width);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {GridColumnDefinition} col \r\n * @param {boolean} flag \r\n */\r\n _onColumnAllChecked(col, flag) {\r\n if (this._var.currentSource == null) {\r\n return;\r\n }\r\n const key = col.key;\r\n const isFunction = typeof col.enabled === 'function';\r\n const isString = typeof col.enabled === 'string';\r\n if (typeof col.onAllChecked === 'function') {\r\n col.onAllChecked.call(this, col, flag);\r\n } else {\r\n for (let row of this._var.currentSource) {\r\n const item = row.values;\r\n if (item == null) {\r\n continue;\r\n }\r\n const enabled = isFunction ? col.enabled(item) : isString ? item[col.enabled] : col.enabled;\r\n if (enabled !== false) {\r\n item[key] = flag;\r\n row.__changed = true;\r\n if (typeof col.onChanged === 'function') {\r\n col.onChanged.call(this, item, flag);\r\n }\r\n }\r\n }\r\n this.refresh();\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {Event} e \r\n */\r\n _onScroll(e) {\r\n if (this._var.colAttrs.__filtering != null) {\r\n this._onCloseFilter();\r\n }\r\n if (this.onBodyScrolled === 'function') {\r\n this.onBodyScrolled(e);\r\n }\r\n this._var.scrollLeft = e.target.scrollLeft;\r\n if (!this.virtual) {\r\n if (this.total != null) {\r\n this._var.refs.footer.parentElement.style.bottom = `${this._var.footerOffset - e.target.scrollTop}px`;\r\n }\r\n return;\r\n }\r\n const top = e.target.scrollTop;\r\n this._scrollToTop(top);\r\n if (this.total != null) {\r\n this._var.refs.footer.parentElement.style.bottom = `${this._var.refs.table.offsetTop + this._var.footerOffset - e.target.scrollTop}px`;\r\n }\r\n if (this._var.isFirefox) {\r\n // 修复 firefox 下列头显示位置不正确的问题\r\n debounce(this._fillRows, RefreshInterval, this, this._tableRows, this.columns);\r\n }\r\n }\r\n\r\n /**\r\n * 清除 tooltip 显示框,并延时后设置 `display: none`\r\n * 不设置 display 的话会导致元素依然被算入滚动范围,从而影响滚动条显示\r\n * @private\r\n * @param {HTMLDivElement} holder \r\n */\r\n _clearHolder(holder) {\r\n if (this._var.tooltipTimer != null) {\r\n clearTimeout(this._var.tooltipTimer);\r\n }\r\n this._var.tooltipTimer = setTimeout(() => {\r\n holder.style.display = 'none';\r\n this._var.tooltipTimer = null;\r\n }, 120);\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {MouseEvent} e \r\n * @param {HTMLDivElement} holder \r\n */\r\n _onGridMouseMove(e, holder) {\r\n e.stopPropagation();\r\n if (e.target.classList.contains('ui-grid-hover-holder')) {\r\n return;\r\n }\r\n let [parent, target] = this._getRowTarget(e.target);\r\n if (parent == null) {\r\n delete holder.dataset.row;\r\n delete holder.dataset.col;\r\n if (holder.classList.contains('active')) {\r\n holder.classList.remove('active');\r\n this._clearHolder(holder);\r\n }\r\n return;\r\n }\r\n if (this._getParentElement(parent) !== this._var.el) {\r\n // sub ui-grid\r\n return;\r\n }\r\n const col = target.dataset.col;\r\n const row = target.dataset.row;\r\n if (holder.dataset.row === row &&\r\n holder.dataset.col === col) {\r\n return;\r\n }\r\n const type = this._var.colTypes[this.columns[col]?.key];\r\n if (type?.canEdit && this._var.virtualRows[row]?.editing) {\r\n delete holder.dataset.row;\r\n delete holder.dataset.col;\r\n if (holder.classList.contains('active')) {\r\n holder.classList.remove('active');\r\n this._clearHolder(holder);\r\n }\r\n return;\r\n }\r\n let element = target.children[0];\r\n if (type != null && typeof type.getElement === 'function') {\r\n element = type.getElement(element);\r\n }\r\n if (element?.tagName !== 'SPAN') {\r\n if (holder.classList.contains('active')) {\r\n delete holder.dataset.row;\r\n delete holder.dataset.col;\r\n holder.classList.remove('active');\r\n this._clearHolder(holder);\r\n }\r\n return;\r\n }\r\n if (element.scrollWidth > element.offsetWidth ||\r\n element.scrollHeight > element.offsetHeight) {\r\n holder.dataset.row = row;\r\n holder.dataset.col = col;\r\n holder.innerText = element.innerText;\r\n const top = (parent.classList.contains('ui-grid-total-row') ? this._var.refs.footer.parentElement.offsetTop + 1 : target.offsetTop) + this._var.refs.table.offsetTop;\r\n let left = target.offsetLeft;\r\n let width = holder.offsetWidth;\r\n if (width > this._var.wrapClientWidth) {\r\n width = this._var.wrapClientWidth;\r\n }\r\n const maxleft = this._var.wrapClientWidth + this._var.scrollLeft - width;\r\n if (left > maxleft) {\r\n left = maxleft;\r\n }\r\n const height = target.offsetHeight;\r\n holder.style.cssText = `top: ${top}px; left: ${left}px; max-width: ${this._var.wrapClientWidth}px; min-height: ${height - 2}px`;\r\n holder.classList.add('active');\r\n } else if (holder.classList.contains('active')) {\r\n delete holder.dataset.row;\r\n delete holder.dataset.col;\r\n holder.classList.remove('active');\r\n this._clearHolder(holder);\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {MouseEvent} e \r\n * @param {number} index \r\n * @param {number} colIndex \r\n */\r\n _onRowClicked(e, index, colIndex) {\r\n const startIndex = this._var.startIndex;\r\n const selectedIndex = startIndex + index;\r\n if (typeof this.willSelect === 'function' && !this.willSelect(selectedIndex, colIndex)) {\r\n return;\r\n }\r\n // multi-select\r\n let flag = false;\r\n const selectedIndexes = this._var.selectedIndexes;\r\n if (this.multiSelect) {\r\n if (e.ctrlKey) {\r\n const i = selectedIndexes.indexOf(selectedIndex);\r\n if (i < 0) {\r\n selectedIndexes.push(selectedIndex);\r\n } else {\r\n selectedIndexes.splice(i, 1);\r\n }\r\n flag = true;\r\n } else if (e.shiftKey && selectedIndexes.length > 0) {\r\n if (selectedIndexes.length > 1 || selectedIndexes[0] !== selectedIndex) {\r\n let start = selectedIndexes[selectedIndexes.length - 1];\r\n let end;\r\n if (start > selectedIndex) {\r\n end = start;\r\n start = selectedIndex;\r\n } else {\r\n end = selectedIndex;\r\n }\r\n selectedIndexes.splice(0);\r\n for (let i = start; i <= end; ++i) {\r\n selectedIndexes.push(i);\r\n }\r\n flag = true;\r\n }\r\n }\r\n }\r\n if (!flag && (selectedIndexes.length !== 1 || selectedIndexes[0] !== selectedIndex)) {\r\n selectedIndexes.splice(0, selectedIndexes.length, selectedIndex);\r\n flag = true;\r\n }\r\n // apply style\r\n if (flag) {\r\n if (this.readonly) {\r\n this._tableRows.forEach((row, i) => {\r\n if (selectedIndexes.includes(startIndex + i)) {\r\n row.classList.add('selected');\r\n } else if (row.classList.contains('selected')) {\r\n row.classList.remove('selected');\r\n }\r\n });\r\n } else {\r\n this.refresh();\r\n }\r\n if (typeof this.onSelectedRowChanged === 'function') {\r\n this.onSelectedRowChanged(selectedIndex);\r\n }\r\n }\r\n this._var.selectedColumnIndex = colIndex;\r\n if ((this.fullrowClick || colIndex >= 0) && e.buttons === 1 && typeof this.cellClicked === 'function') {\r\n if (this.cellClicked(selectedIndex, colIndex) === false) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {MouseEvent} e \r\n */\r\n _onRowDblClicked(e) {\r\n if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.tagName === 'LAYER' && e.target.className === 'ui-check-inner' || e.target.tagName === 'LABEL' && (e.target.className === 'ui-drop-text' || e.target.className === 'ui-drop-caret')) {\r\n return;\r\n }\r\n const index = this.selectedIndex;\r\n if (typeof this.onRowDblClicked === 'function') {\r\n this.onRowDblClicked(index);\r\n }\r\n if (typeof this.onCellDblClicked === 'function') {\r\n const colIndex = this._var.selectedColumnIndex;\r\n if (this.fullrowClick || colIndex >= 0) {\r\n this.onCellDblClicked(index, colIndex);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {any} e \r\n * @param {number} index \r\n * @param {GridColumnDefinition} col \r\n * @param {any} value \r\n * @param {HTMLTableCellElement} cell \r\n * @param {any} [oldValue] \r\n */\r\n _onRowChanged(e, index, col, value, cell, oldValue) {\r\n if (this._var.currentSource == null) {\r\n return;\r\n }\r\n const vals = this._var.currentSource[this._var.startIndex + index];\r\n delete vals.source;\r\n const item = vals.values;\r\n if (item == null) {\r\n return;\r\n }\r\n let enabled = col.enabled;\r\n if (typeof enabled === 'function') {\r\n enabled = enabled.call(col, item);\r\n } else if (typeof enabled === 'string') {\r\n enabled = item[enabled];\r\n }\r\n if (enabled !== false) {\r\n let v;\r\n let t;\r\n if (value != null) {\r\n v = Object.prototype.hasOwnProperty.call(value, 'value') ? value.value : value;\r\n t = Object.prototype.hasOwnProperty.call(value, 'text') ? value.text : value;\r\n } else {\r\n v = t = value;\r\n }\r\n const val = item[col.key];\r\n if (val != null && Object.prototype.hasOwnProperty.call(val, 'Value')) {\r\n oldValue ??= val.Value;\r\n val.Value = v;\r\n if (Object.prototype.hasOwnProperty.call(val, 'DisplayValue')) {\r\n val.DisplayValue = t;\r\n }\r\n } else {\r\n oldValue ??= val;\r\n item[col.key] = v;\r\n }\r\n const virtualRow = this._var.virtualRows[index];\r\n const virtualCell = virtualRow.cells[col.key];\r\n if (virtualCell != null) {\r\n virtualCell.value = v;\r\n }\r\n let tip = col.tooltip;\r\n if (typeof tip === 'function') {\r\n tip = tip.call(col, item);\r\n }\r\n if (nullOrEmpty(tip)) {\r\n cell.querySelector('.ui-tooltip-wrapper')?.remove();\r\n } else {\r\n setTooltip(cell.children[0], tip, false, this.element);\r\n }\r\n // 调整其他列的可用性\r\n const row = this._tableRows[index];\r\n const offset = this.expandable ? 1 : 0;\r\n this.columns.forEach((c, j) => {\r\n const cache = this._var.enabledDict[c.key];\r\n if (cache !== true && cache !== col.key) {\r\n return;\r\n }\r\n const cell = row.children[j + offset];\r\n if (cell == null) {\r\n return;\r\n }\r\n const type = this._var.colTypes[c.key] ?? GridColumn;\r\n if (typeof type.setEnabled === 'function') {\r\n if (typeof c.enabled === 'function') {\r\n enabled = c.enabled(item);\r\n } else if (typeof c.enabled === 'string') {\r\n enabled = item[c.enabled];\r\n } else {\r\n return;\r\n }\r\n const vCell = virtualRow.cells[c.key ?? j];\r\n if (enabled !== vCell.enabled) {\r\n vCell.enabled = enabled;\r\n type.setEnabled(cell.children[0], enabled);\r\n }\r\n }\r\n });\r\n vals.__changed = true;\r\n if (typeof col.onChanged === 'function') {\r\n col.onChanged.call(this, item, value, oldValue, e);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @private\r\n * @param {MouseEvent} _e \r\n * @param {number} index \r\n * @param {HTMLTableRowElement} _row \r\n */\r\n _onExpandable(_e, index, _row) {\r\n if (this._var.currentSource == null) {\r\n return;\r\n }\r\n const vals = this._var.currentSource[this._var.startIndex + index];\r\n vals.__expanded = !vals.__expanded\r\n this.refresh();\r\n }\r\n}","import \"./css/media.scss\";\r\nimport { createElement } from \"../functions\";\r\nimport { createIcon } from \"./icon\";\r\nimport { get } from \"../utility\";\r\n\r\nexport function createPicture(url) {\r\n return createElement('a', a => {\r\n a.className = 'ui-media-picture';\r\n a.target = '_blank';\r\n a.href = url;\r\n },\r\n createElement('img', img => {\r\n img.src = url;\r\n })\r\n );\r\n}\r\n\r\nfunction readBlob(blob) {\r\n return new Promise((resolve, reject) => {\r\n const reader = new FileReader();\r\n reader.onload = e => {\r\n const data = new Uint8Array(e.target.result);\r\n resolve(data);\r\n };\r\n reader.onerror = reject;\r\n reader.readAsArrayBuffer(blob);\r\n });\r\n}\r\n\r\nfunction playAmrArray(array) {\r\n return new Promise((resolve, reject) => {\r\n const samples = AMR.decode(array);\r\n if (samples != null) {\r\n resolve(samples);\r\n } else {\r\n reject();\r\n }\r\n });\r\n}\r\n\r\nfunction playPcm(samples, ended) {\r\n return new Promise(resolve => {\r\n const ctx = new AudioContext();\r\n ctx.addEventListener('statechange', () => resolve(ctx));\r\n const source = ctx.createBufferSource();\r\n if (typeof ended === 'function') {\r\n source.addEventListener('ended', () => ended(ctx));\r\n }\r\n const buffer = ctx.createBuffer(1, samples.length, 8000);\r\n if (typeof buffer.copyToChannel === 'function') {\r\n buffer.copyToChannel(samples, 0, 0);\r\n } else {\r\n const channelBuffer = buffer.getChannelData(0);\r\n channelBuffer.set(samples);\r\n }\r\n source.buffer = buffer;\r\n source.connect(ctx.destination);\r\n ctx.duration = buffer.duration;\r\n source.start();\r\n // resolve(ctx);\r\n });\r\n}\r\n\r\nfunction getTimeLabel(time) {\r\n time = Math.round(time);\r\n return String(Math.floor(time / 60)).padStart(2, '0') + ':' + String(time % 60).padStart(2, '0');\r\n}\r\n\r\nexport function createAudio(mime, url) {\r\n if ((mime === 'audio/amr' || mime === '.amr') && typeof AMR !== 'undefined') {\r\n const timestamp = createElement('span', 'ui-media-timestamp');\r\n timestamp.textContent = '00:00 / 00:00';\r\n let context;\r\n let timer;\r\n return createElement('div', 'ui-media-audio',\r\n createElement('button', button => {\r\n button.className = 'play';\r\n button.addEventListener('click', () => {\r\n if (context != null) {\r\n clearInterval(timer);\r\n context.close();\r\n context = null;\r\n timestamp.textContent = '00:00 / 00:00';\r\n button.className = 'play';\r\n button.replaceChildren(createIcon('fa-solid', 'play'));\r\n return;\r\n }\r\n get(url, { accept: mime })\r\n .then(r => r.blob())\r\n .then(r => readBlob(r))\r\n .then(r => playAmrArray(r))\r\n .then(r => playPcm(r, ctx => {\r\n context = null;\r\n clearInterval(timer);\r\n timestamp.textContent = '00:00 / ' + getTimeLabel(ctx.duration);\r\n button.className = 'play';\r\n button.replaceChildren(createIcon('fa-solid', 'play'));\r\n }))\r\n .then(ctx => {\r\n context = ctx;\r\n button.className = 'stop';\r\n button.replaceChildren(createIcon('fa-solid', 'stop'));\r\n const total = getTimeLabel(ctx.duration);\r\n const refresh = () => timestamp.textContent = getTimeLabel(ctx.currentTime) + ' / ' + total;\r\n refresh();\r\n timer = setInterval(refresh, 500);\r\n })\r\n .catch(e => {\r\n clearInterval(timer);\r\n console.error(e);\r\n });\r\n });\r\n },\r\n createIcon('fa-solid', 'play')\r\n ),\r\n timestamp\r\n );\r\n }\r\n return createElement('audio', audio => {\r\n audio.src = url;\r\n audio.controls = true;\r\n });\r\n}\r\n\r\nexport function createVideo(url) {\r\n return createElement('video', video => {\r\n video.className = 'ui-media-video';\r\n video.src = url;\r\n video.controls = true;\r\n });\r\n}\r\n\r\nexport function createFile(url, icon = 'file-alt') {\r\n return createElement('div', `ui-media-file ${icon}`,\r\n createIcon('fa-solid', icon),\r\n createElement('a', a => {\r\n a.target = '_blank';\r\n a.href = url;\r\n a.innerText = 'Click here to view the file';\r\n })\r\n );\r\n}"],"names":["createElement","tagName","init","children","element","svgns","dict","createUse","type","id","c","path","ver","use","changeIcon","svg","createIcon","style","css","resolveIcon","container","svgs","icon","fillCheckbox","label","tabindex","charactor","title","layer","e","input","span","createRadiobox","opts","entry","createCheckbox","resolveCheckbox","legacy","checks","chk","text","boxes","box","pointerHeight","setTooltip","content","flag","parent","isParent","tipid","tip","wrapper","cnt","tipId","tid","p","left","top","offsetParent","offsetHeight","offsetWidth","t","l","lastWidth","lastHeight","containerOffsetHeight","resolveTooltip","tips","createTab","options","header","page","combineUrl","url","get","nullOrEmpty","s","contains","key","ignoreCase","r","defaultValue","g","isPositive","n","isMobile","throttle","method","delay","context","args","current","debounce","truncate","v","SymbolDropdown","DropdownItemHeight","dropdownGlobal","global","panels","panel","dropId","dropdown","selectItems","itemlist","htmlkey","textkey","htmls","it","filterSource","searchkeys","source","k","Dropdown","__publicField","up","down","count","valuekey","index","target","_a","active","list","selected","silence","item","expanded","li","html","selectedlist","a","_b","search","value","headerHeight","slideUp","multiselect","allchecked","scrolled","i","val","checkbox","dom","trigger","selects","sel","drop","ResizeMods","trimPx","px","size","Popup","collapsed","bounds","collapse","animation","mask","option","masks","max","m","tabIndex","d","x","y","moved","move","icons","rect","cancel","b","button","result","reason","tabs","tabMin","tabMax","last","first","exists","zindex","ex","z","resolve","_c","loading","mod","originalX","originalY","original","minWidth","minHeight","resized","offsetX","offsetY","width","height","createPopup","buttons","iconTypes","showAlert","message","iconType","showConfirm","validation","regex","convertCssStyle","createDateInput","min","date","toDateValue","dt","month","resolveDate","ticks","formatDate","setDateValue","getDateValue","formatter","year","DateSelector","el","dates","dat","dateSelector","GridColumn","name","enabled","tooltip","hasValue","GridInputColumn","col","_container","GridTextColumn","_wrapper","_col","grid","lines","GridDropdownColumn","dropGlobal","data","GridCheckboxColumn","GridRadioboxColumn","GridIconColumn","GridDateColumn","ScriptPath","Encoder","ColumnChangedType","RefreshInterval","HoverInternal","RedumCount","MiniDragOffset","MiniColumnWidth","FilterPanelWidth","ExpandableWidth","getClientX","indexOfParent","ColumnTypeDefs","lang","GridColumnTypeEnum","GridColumnDirection","Grid","getText","total","indexes","startIndex","row","ele","selectedIndexes","rowIndex","colIndex","sizer","table","holder","force","keep","callback","body","filtered","headers","length","footerHeight","widths","reload","direction","th","arrow","comparer","sortArray","buttonWrapper","rowChanged","gridWrapper","columnSource","pop","newIt","array","items","offset","next","compressed","module","prop","json","working","worker","terminate","timer","uncompressed","nullValue","thead","readonly","w","hidden","alwaysEditing","thStyle","check","caption","help","filter","spliter","dragger","draggerCursor","cols","tfoot","footer","td","j","cell","virtualRow","ev","rows","vals","stateChanged","rowExpanded","expandableObject","iconCell","virtualCell","bg","oldValue","old","separateElement","maxHeight","styleText","attrs","attrsText","attr","cells","freeze","headerCells","footerCells","footerOffset","mouse","draggerCellLeft","idx","toLeft","orderIndex","targetIndex","columns","rowHeight","bottomTop","editing","filtering","offsetLeft","totalWidth","searchbox","searchholder","searchicon","itemall","checked","displayValue","display","functions","ok","reset","all","propKey","allSelected","div","cx","window","clearEvents","event","gridLeftFromWindow","dragmove","pos","dragging","resizemove","cx2","isFunction","isString","maxleft","selectedIndex","start","end","cache","vCell","_e","_row","createPicture","img","readBlob","blob","reject","reader","playAmrArray","samples","playPcm","ended","ctx","buffer","getTimeLabel","time","createAudio","mime","timestamp","refresh","audio","createVideo","video","createFile"],"mappings":"oZAAO,SAASA,EAAcC,EAASC,KAASC,EAAU,CACtD,MAAMC,EAAU,SAAS,cAAcH,CAAO,EAC9C,OAAI,OAAOC,GAAS,WAChBA,EAAKE,CAAO,EACLF,GAAQ,OACfE,EAAQ,UAAYF,GAEpBC,EAAS,OAAS,GAClBC,EAAQ,OAAO,GAAGD,CAAQ,EAEvBC,CACX,CCXA,MAAMC,EAAQ,6BACRC,GAAO,CACT,IAAU,gBACV,IAAU,QACV,IAAU,SACV,IAAU,QACV,IAAU,OACV,IAAU,OACV,IAAU,OACV,IAAU,WACV,IAAU,KACV,IAAU,UACV,IAAU,QACV,IAAU,QACV,IAAU,cACV,IAAU,eACV,IAAU,YACV,IAAU,SACV,IAAU,MACV,IAAU,OACV,IAAU,QACV,IAAU,OACV,IAAU,WACV,IAAU,QACV,IAAU,OACV,IAAU,OACV,IAAU,WACV,IAAU,OACV,IAAU,OACV,IAAU,aACV,IAAU,aACV,IAAU,cACV,IAAU,YACV,IAAU,SACV,IAAU,UACV,IAAU,MACV,IAAU,OACV,IAAU,OACV,IAAU,WACV,IAAU,QACV,IAAU,SACV,IAAU,OACV,IAAU,OACV,IAAU,SACV,IAAU,cACV,IAAU,aACV,IAAU,aACV,IAAU,eACV,IAAU,cACV,IAAU,gBACV,IAAU,OACV,IAAU,UACV,IAAU,SACV,IAAU,QACV,IAAU,QACV,IAAU,SACV,IAAU,aACV,IAAU,SACV,IAAU,OACV,IAAU,OACV,IAAU,SACV,IAAU,gBACV,IAAU,gBACV,IAAU,WACV,IAAU,OACV,IAAU,QACV,IAAU,OACV,IAAU,UACV,IAAU,eACV,IAAU,eACV,IAAU,QACV,IAAU,eACV,IAAU,gBACV,IAAU,cACV,IAAU,eACV,IAAU,eACV,IAAU,eACV,IAAU,kBACV,IAAU,cACV,IAAU,aACV,IAAU,MACV,IAAU,aACV,IAAU,cACV,IAAU,WACV,IAAU,aACV,IAAU,QACV,IAAU,SACV,IAAU,WACV,IAAU,OACV,IAAU,QACV,IAAU,WACV,IAAU,qBACV,IAAU,OACV,IAAU,OACV,IAAU,OACV,IAAU,MACV,IAAU,YACV,IAAU,uBACV,IAAU,QACV,IAAU,eACV,IAAU,SACV,IAAU,UACV,IAAU,SACV,IAAU,aACV,IAAU,eACV,IAAU,UACV,IAAU,gBACV,IAAU,SACV,IAAU,cACV,IAAU,WACV,IAAU,WACV,IAAU,YACV,IAAU,eACV,IAAU,MACV,IAAU,OACV,IAAU,WACV,IAAU,YACV,IAAU,WACV,IAAU,YACV,IAAU,gBACV,IAAU,UACV,IAAU,SACV,IAAU,SACV,IAAU,QACV,IAAU,QACV,IAAU,eACV,IAAU,SACV,IAAU,cACV,IAAU,MACV,IAAU,MACV,IAAU,WACV,IAAU,cACV,IAAU,mBACV,IAAU,kBACV,IAAU,gBACV,IAAU,kBACV,IAAU,oBACV,IAAU,qBACV,IAAU,kBACV,IAAU,oBACV,IAAU,QACV,IAAU,SACV,IAAU,QACV,IAAU,SACV,IAAU,YACV,IAAU,aACV,IAAU,QACV,IAAU,OACV,IAAU,QACV,IAAU,QACV,IAAU,MACV,IAAU,OACV,IAAU,YACV,IAAU,OACV,IAAU,SACV,IAAU,OACV,IAAU,UACV,IAAU,UACV,IAAU,gBACV,IAAU,YACV,IAAU,QACV,IAAU,QACV,IAAU,QACV,IAAU,aACV,IAAU,aACV,IAAU,WACV,IAAU,aACV,IAAU,cACV,IAAU,UACV,IAAU,OACV,IAAU,YACV,IAAU,UACV,IAAU,WACV,IAAU,OACV,IAAU,QACV,IAAU,aACV,IAAU,OACV,IAAU,UACV,IAAU,WACV,IAAU,QACV,IAAU,YACV,IAAU,WACV,IAAU,iBACV,IAAU,eACV,IAAU,UACV,IAAU,cACV,IAAU,WACV,IAAU,OACV,IAAU,SACV,IAAU,WACV,IAAU,YACV,IAAU,SACV,IAAU,cACV,IAAU,OACV,IAAU,WACV,IAAU,cACV,IAAU,oBACV,IAAU,qBACV,IAAU,kBACV,IAAU,oBACV,IAAU,aACV,IAAU,cACV,IAAU,WACV,IAAU,aACV,IAAU,UACV,IAAU,SACV,IAAU,SACV,IAAU,SACV,IAAU,aACV,IAAU,cACV,IAAU,UACV,IAAU,SACV,IAAU,QACV,IAAU,QACV,IAAU,MACV,IAAU,UACV,IAAU,WACV,IAAU,iBACV,IAAU,WACV,IAAU,OACV,IAAU,YACV,IAAU,iBACV,IAAU,OACV,IAAU,cACV,IAAU,SACV,IAAU,WACV,IAAU,OACV,IAAU,cACV,IAAU,cACV,IAAU,YACV,IAAU,SACV,IAAU,eACV,IAAU,aACV,IAAU,mBACV,IAAU,SACV,IAAU,WACV,IAAU,oBACV,IAAU,SACV,IAAU,sBACV,IAAU,uBACV,IAAU,oBACV,IAAU,sBACV,IAAU,SACV,IAAU,aACV,IAAU,WACV,IAAU,aACV,IAAU,aACV,IAAU,aACV,IAAU,cACV,IAAU,SACV,IAAU,eACV,IAAU,WACV,IAAU,aACV,IAAU,eACV,IAAU,aACV,IAAU,uBACV,IAAU,eACV,IAAU,UACV,IAAU,oBACV,IAAU,kBACV,IAAU,qBACV,IAAU,YACV,IAAU,aACV,IAAU,cACV,IAAU,aACV,IAAU,WACV,IAAU,aACV,IAAU,WACV,IAAU,OACV,IAAU,WACV,IAAU,kBACV,IAAU,gBACV,IAAU,mBACV,IAAU,iBACV,IAAU,oBACV,IAAU,kBACV,IAAU,YACV,IAAU,cACV,IAAU,kBACV,IAAU,gBACV,IAAU,kBACV,IAAU,mBACV,IAAU,SACV,IAAU,OACV,IAAU,MACV,IAAU,OACV,IAAU,UACV,IAAU,MACV,IAAU,oBACV,IAAU,aACV,IAAU,aACV,IAAU,YACV,IAAU,gBACV,IAAU,kBACV,IAAU,aACV,IAAU,iBACV,IAAU,WACV,IAAU,MACV,IAAU,WACV,IAAU,QACV,IAAU,MACV,IAAU,OACV,IAAU,QACV,IAAU,UACV,IAAU,MACV,IAAU,OACV,IAAU,OACV,IAAU,WACV,IAAU,WACV,IAAU,YACV,IAAU,aACV,IAAU,kBACV,IAAU,aACV,IAAU,eACV,IAAU,aACV,IAAU,aACV,IAAU,YACV,IAAU,YACV,IAAU,eACV,IAAU,cACV,IAAU,UACV,IAAU,UACV,IAAU,YACV,IAAU,YACV,IAAU,YACV,IAAU,mBACV,IAAU,OACV,IAAU,SACV,IAAU,MACV,IAAU,aACV,IAAU,OACV,IAAU,YACV,IAAU,OACV,IAAU,aACV,IAAU,aACV,IAAU,QACV,IAAU,YACV,IAAU,KACV,IAAU,cACV,IAAU,cACV,IAAU,gBACV,IAAU,aACV,IAAU,YACV,IAAU,aACV,IAAU,aACV,IAAU,YACV,IAAU,UACV,IAAU,MACV,IAAU,oBACV,IAAU,cACV,IAAU,YACV,IAAU,kBACV,IAAU,UACV,IAAU,OACV,IAAU,cACV,IAAU,aACV,IAAU,cACV,IAAU,YACV,IAAU,QACV,IAAU,OACV,IAAU,UACV,IAAU,cACV,IAAU,kBACV,IAAU,eACV,IAAU,cACV,IAAU,aACV,IAAU,cACV,IAAU,gBACV,IAAU,gBACV,IAAU,SACV,IAAU,aACV,IAAU,SACV,IAAU,YACV,IAAU,aACV,IAAU,MACV,IAAU,QACV,IAAU,SACV,IAAU,eACV,IAAU,yBACV,IAAU,eACV,IAAU,kBACV,IAAU,gBACV,IAAU,gBACV,IAAU,WACV,IAAU,eACV,IAAU,iBACV,IAAU,cACV,IAAU,QACV,IAAU,gBACV,IAAU,kBACV,IAAU,iBACV,IAAU,gBACV,IAAU,YACV,IAAU,YACV,IAAU,aACV,IAAU,gBACV,IAAU,cACV,IAAU,aACV,IAAU,eACV,IAAU,aACV,IAAU,YACV,IAAU,aACV,IAAU,KACV,IAAU,gBACV,IAAU,iBACV,IAAU,iBACV,IAAU,iBACV,IAAU,WACV,IAAU,UACV,IAAU,YACV,IAAU,MACV,IAAU,cACV,IAAU,eACV,IAAU,cACV,IAAU,eACV,IAAU,kBACV,IAAU,UACV,IAAU,UACV,IAAU,mBACV,IAAU,QACV,IAAU,oBACV,IAAU,eACV,IAAU,UACV,IAAU,8BACV,IAAU,sCACV,IAAU,OACV,IAAU,gBACV,IAAU,aACV,IAAU,YACV,IAAU,gBACV,IAAU,eACV,IAAU,eACV,IAAU,cACV,IAAU,WACV,IAAU,UACV,IAAU,mBACV,IAAU,6BACV,IAAU,mBACV,IAAU,sBACV,IAAU,oBACV,IAAU,SACV,IAAU,OACV,IAAU,UACV,IAAU,kBACV,IAAU,kBACV,IAAU,iBACV,IAAU,eACV,IAAU,YACV,IAAU,YACV,IAAU,QACV,IAAU,eACV,IAAU,eACV,IAAU,gBACV,IAAU,gBACV,IAAU,eACV,IAAU,WACV,IAAU,aACV,IAAU,aACV,IAAU,WACV,IAAU,aACV,IAAU,WACV,IAAU,YACV,IAAU,gBACV,IAAU,gBACV,IAAU,WACV,IAAU,YACV,IAAU,mBACV,IAAU,QACV,IAAU,eACV,IAAU,cACV,IAAU,eACV,IAAU,WACV,IAAU,WACV,IAAU,sBACV,IAAU,qBACV,IAAU,iBACV,IAAU,kBACV,IAAU,MACV,IAAU,eACV,IAAU,eACV,IAAU,SACV,IAAU,aACV,IAAU,MACV,IAAU,UACV,IAAU,UACV,IAAU,gBACV,IAAU,gBACV,IAAU,sBACV,IAAU,sBACV,IAAU,uBACV,IAAU,oBACV,IAAU,WACV,IAAU,iBACV,IAAU,cACV,IAAU,WACV,IAAU,YACV,IAAU,UACV,IAAU,KACV,IAAU,KACV,IAAU,KACV,IAAU,aACV,IAAU,aACV,IAAU,aACV,IAAU,YACV,IAAU,mBACV,IAAU,YACV,IAAU,gBACV,IAAU,oBACV,IAAU,cACV,IAAU,qBACV,IAAU,sBACV,IAAU,sBACV,IAAU,uBACV,IAAU,oBACV,IAAU,gBACV,IAAU,OACV,IAAU,YACV,IAAU,sBACV,IAAU,sBACV,IAAU,uBACV,IAAU,oBACV,IAAU,oBACV,IAAU,oBACV,IAAU,qBACV,IAAU,kBACV,IAAU,aACV,IAAU,gBACV,IAAU,uBACV,IAAU,QACV,IAAU,cACV,IAAU,eACV,IAAU,eACV,IAAU,oBACV,IAAU,oBACV,IAAU,qBACV,IAAU,kBACV,IAAU,kBACV,IAAU,gBACV,IAAU,iBACV,IAAU,eACV,IAAU,oBACV,IAAU,kBACV,IAAU,mBACV,IAAU,iBACV,IAAU,wBACV,IAAU,sBACV,IAAU,uBACV,IAAU,qBACV,IAAU,sBACV,IAAU,oBACV,IAAU,qBACV,IAAU,mBACV,IAAU,cACV,IAAU,wBACV,IAAU,wBACV,IAAU,yBACV,IAAU,sBACV,IAAU,iBACV,IAAU,iBACV,IAAU,kBACV,IAAU,eACV,IAAU,wBACV,IAAU,wBACV,IAAU,yBACV,IAAU,sBACV,IAAU,oBACV,IAAU,2BACV,IAAU,cACV,IAAU,eACV,IAAU,SACV,IAAU,aACV,IAAU,WACV,IAAU,eACV,IAAU,YACV,IAAU,eACV,IAAU,gBACV,IAAU,UACV,IAAU,qBACV,IAAU,mBACV,IAAU,cACV,IAAU,aACV,IAAU,oBACV,IAAU,oBACV,IAAU,cACV,IAAU,iBACV,IAAU,iBACV,IAAU,WACV,IAAU,MACV,IAAU,eACV,IAAU,iBACV,IAAU,eACV,IAAU,YACV,IAAU,gBACV,IAAU,iBACV,IAAU,iBACV,IAAU,aACV,IAAU,iBACV,IAAU,qBACV,IAAU,iBACV,IAAU,cACV,IAAU,YACV,IAAU,WACV,IAAU,QACV,IAAU,aACV,IAAU,mBACV,IAAU,YACV,IAAU,mBACV,IAAU,gBACV,IAAU,aACV,IAAU,iBACV,IAAU,qBACV,IAAU,iBACV,IAAU,aACV,IAAU,WACV,IAAU,WACV,IAAU,WACV,IAAU,SACV,IAAU,aACV,IAAU,eACV,IAAU,eACV,IAAU,aACV,IAAU,WACV,IAAU,gBACV,IAAU,kBACV,IAAU,kBACV,IAAU,eACV,IAAU,eACV,IAAU,eACV,IAAU,QACV,IAAU,eACV,IAAU,mBACV,IAAU,cACV,IAAU,cACV,IAAU,kBACV,IAAU,aACV,IAAU,iBACV,IAAU,eACV,IAAU,mBACV,IAAU,aACV,IAAU,iBACV,IAAU,cACV,IAAU,kBACV,IAAU,aACV,IAAU,iBACV,IAAU,UACV,IAAU,UACV,IAAU,WACV,IAAU,eACV,IAAU,gBACV,IAAU,kBACV,IAAU,YACV,IAAU,YACV,IAAU,cACV,IAAU,gBACV,IAAU,WACV,IAAU,UACV,IAAU,YACV,IAAU,UACV,IAAU,cACV,IAAU,cACV,IAAU,eACV,IAAU,cACV,IAAU,kBACV,IAAU,UACV,IAAU,YACV,IAAU,WACV,IAAU,cACV,IAAU,eACV,IAAU,eACV,IAAU,MACV,IAAU,YACV,IAAU,QACV,IAAU,oBACV,IAAU,OACV,IAAU,WACV,IAAU,kBACV,IAAU,iBACV,IAAU,gBACV,IAAU,oBACV,IAAU,YACV,IAAU,MACV,IAAU,QACV,IAAU,cACV,IAAU,gBACV,IAAU,oBACV,IAAU,sBACV,IAAU,eACV,IAAU,mBACV,IAAU,YACV,IAAU,WACV,IAAU,mBACV,IAAU,iBACV,IAAU,eACV,IAAU,kBACV,IAAU,cACV,IAAU,YACV,IAAU,gBACV,IAAU,SACV,IAAU,aACV,IAAU,QACV,IAAU,sBACV,IAAU,0BACV,IAAU,aACV,IAAU,UACV,IAAU,mBACV,IAAU,sBACV,IAAU,gBACV,IAAU,iBACV,IAAU,UACV,IAAU,UACV,IAAU,gBACV,IAAU,UACV,IAAU,cACV,IAAU,OACV,IAAU,QACV,IAAU,YACV,IAAU,gBACV,IAAU,SACV,IAAU,QACV,IAAU,UACV,IAAU,aACV,IAAU,UACV,IAAU,cACV,IAAU,WACV,IAAU,YACV,IAAU,WACV,IAAU,SACV,IAAU,UACV,IAAU,YACV,IAAU,oBACV,IAAU,mBACV,IAAU,mBACV,IAAU,0BACV,IAAU,oBACV,IAAU,oBACV,IAAU,mBACV,IAAU,oBACV,IAAU,oBACV,IAAU,oBACV,IAAU,gBACV,IAAU,eACV,IAAU,eACV,IAAU,sBACV,IAAU,gBACV,IAAU,gBACV,IAAU,eACV,IAAU,gBACV,IAAU,gBACV,IAAU,gBACV,IAAU,eACV,IAAU,oBACV,IAAU,QACV,IAAU,SACV,IAAU,OACV,IAAU,UACV,IAAU,aACV,IAAU,eACV,IAAU,qBACV,IAAU,wBACV,IAAU,mBACV,IAAU,qBACV,IAAU,QACV,IAAU,cACV,IAAU,gBACV,IAAU,YACV,IAAU,gBACV,IAAU,eACV,IAAU,eACV,IAAU,aACV,IAAU,OACV,IAAU,aACV,IAAU,WACV,IAAU,gBACV,IAAU,eACV,IAAU,eACV,IAAU,eACV,IAAU,qBACV,IAAU,aACV,IAAU,aACV,IAAU,eACV,IAAU,SACV,IAAU,QACV,IAAU,WACV,IAAU,OACV,IAAU,aACV,IAAU,OACV,IAAU,kBACV,IAAU,cACV,IAAU,gBACV,IAAU,eACV,IAAU,aACV,IAAU,aACV,IAAU,cACV,IAAU,aACV,IAAU,iBACV,IAAU,iBACV,IAAU,aACV,IAAU,aACV,IAAU,WACV,IAAU,YACV,IAAU,eACV,IAAU,gBACV,IAAU,YACV,IAAU,aACV,IAAU,aACV,IAAU,cACV,IAAU,aACV,IAAU,WACV,IAAU,WACV,IAAU,YACV,IAAU,qBACV,IAAU,sBACV,IAAU,UACV,IAAU,YACV,IAAU,kBACV,IAAU,QACV,IAAU,aACV,IAAU,qBACV,IAAU,SACV,IAAU,QACV,IAAU,eACV,IAAU,OACV,IAAU,QACV,IAAU,OACV,IAAU,YACV,IAAU,YACV,IAAU,WACV,IAAU,WACV,IAAU,aACV,IAAU,WACV,IAAU,SACV,IAAU,cACV,IAAU,YACV,IAAU,SACV,IAAU,UACV,IAAU,OACV,IAAU,WACV,IAAU,UACV,IAAU,eACV,IAAU,qBACV,IAAU,aACV,IAAU,WACV,IAAU,YACV,IAAU,YACV,IAAU,kBACV,IAAU,SACV,IAAU,uBACV,IAAU,kBACV,IAAU,sBACV,IAAU,cACV,IAAU,kBACV,IAAU,YACV,IAAU,UACV,IAAU,UACV,IAAU,aACV,IAAU,kBACV,IAAU,UACV,IAAU,QACV,IAAU,QACV,IAAU,iBACV,IAAU,mBACV,IAAU,iBACV,IAAU,SACV,IAAU,cACV,IAAU,cACV,IAAU,QACV,IAAU,cACV,IAAU,QACV,IAAU,YACV,IAAU,SACV,IAAU,cACV,IAAU,UACV,IAAU,SACV,IAAU,UACV,IAAU,SACV,IAAU,QACV,IAAU,UACV,IAAU,QACV,IAAU,QACV,IAAU,YACV,IAAU,eACV,IAAU,OACV,IAAU,QACV,IAAU,UACV,IAAU,WACV,IAAU,eACV,IAAU,WACV,IAAU,iBACV,IAAU,SACV,IAAU,cACV,IAAU,WACV,IAAU,qBACV,IAAU,QACV,IAAU,mBACV,IAAU,OACV,IAAU,gBACV,IAAU,cACV,IAAU,gBACV,IAAU,gBACV,IAAU,cACV,IAAU,cACV,IAAU,eACV,IAAU,sBACV,IAAU,oBACV,IAAU,iBACV,IAAU,cACV,IAAU,OACV,IAAU,YACV,IAAU,cACV,IAAU,OACV,IAAU,UACV,IAAU,aACV,IAAU,oBACV,IAAU,eACV,IAAU,iBACV,IAAU,aACV,IAAU,UACV,IAAU,OACV,IAAU,WACV,IAAU,YACV,IAAU,kBACV,IAAU,cACV,IAAU,cACV,IAAU,oBACV,IAAU,aACV,IAAU,aACV,IAAU,cACV,IAAU,qBACV,IAAU,mBACV,IAAU,YACV,IAAU,kBACV,IAAU,gBACV,IAAU,iBACV,IAAU,UACV,IAAU,cACV,IAAU,UACV,IAAU,QACV,IAAU,QACV,IAAU,OACV,IAAU,YACV,IAAU,kBACV,IAAU,QACV,IAAU,aACV,IAAU,eACV,IAAU,aACV,IAAU,eACV,IAAU,aACV,IAAU,iBACV,IAAU,SACV,IAAU,QACV,IAAU,YACV,IAAU,mBACV,IAAU,WACV,IAAU,gBACV,IAAU,kBACV,IAAU,eACV,IAAU,WACV,IAAU,YACV,IAAU,UACV,IAAU,eACV,IAAU,gBACV,IAAU,kBACV,IAAU,eACV,IAAU,UACV,IAAU,WACV,IAAU,cACV,IAAU,YACV,IAAU,aACV,IAAU,aACV,IAAU,cACV,IAAU,MACV,IAAU,UACV,IAAU,YACV,IAAU,QACV,IAAU,gBACV,IAAU,mBACV,IAAU,WACV,IAAU,aACV,IAAU,UACV,IAAU,gBACV,IAAU,aACV,IAAU,QACV,IAAU,QACV,IAAU,iBACV,IAAU,gBACV,IAAU,iBACV,IAAU,iBACV,IAAU,gBACV,IAAU,YACV,IAAU,OACV,IAAU,WACV,IAAU,WACV,IAAU,cACV,IAAU,oBACV,IAAU,OACV,IAAU,aACV,IAAU,WACV,IAAU,cACV,IAAU,QACV,IAAU,QACV,IAAU,aACV,IAAU,UACV,IAAU,cACV,IAAU,WACV,IAAU,YACV,IAAU,aACV,IAAU,eACV,IAAU,WACV,IAAU,WACV,IAAU,WACV,IAAU,mBACV,IAAU,yBACV,IAAU,gBACV,IAAU,UACV,IAAU,aACV,IAAU,eACV,IAAU,cACV,IAAU,eACV,IAAU,cACV,IAAU,MACV,IAAU,iBACV,IAAU,mBACV,IAAU,iBACV,IAAU,cACV,IAAU,cACV,IAAU,aACV,IAAU,UACV,IAAU,UACV,IAAU,cACV,IAAU,cACV,IAAU,cACV,IAAU,aACV,IAAU,OACV,IAAU,WACV,IAAU,kBACV,IAAU,iBACV,IAAU,QACV,IAAU,uBACV,IAAU,mBACV,IAAU,kBACV,IAAU,yBACV,IAAU,mBACV,IAAU,kBACV,IAAU,sBACV,IAAU,mBACV,IAAU,mBACV,IAAU,mBACV,IAAU,aACV,IAAU,qBACV,IAAU,UACV,IAAU,WACV,IAAU,iBACV,IAAU,uBACV,IAAU,gBACV,IAAU,oBACV,IAAU,OACV,IAAU,gBACV,IAAU,mBACV,IAAU,iBACV,IAAU,UACV,IAAU,eACV,IAAU,SACV,IAAU,WACV,IAAU,eACV,IAAU,iBACV,IAAU,UACV,IAAU,yBACV,IAAU,sBACV,IAAU,yBACV,IAAU,sBACV,IAAU,yBACV,IAAU,qBACV,IAAU,kBACV,IAAU,qBACV,IAAU,kBACV,IAAU,qBACV,IAAU,QACV,IAAU,aACV,IAAU,gBACV,IAAU,OACV,IAAU,YACV,IAAU,wBACV,IAAU,cACV,IAAU,aACV,IAAU,eACV,IAAU,gBACV,IAAU,mBACV,IAAU,qBACV,IAAU,qBACV,IAAU,gBACV,IAAU,eACV,IAAU,cACV,IAAU,gBACV,IAAU,SACV,IAAU,KACV,IAAU,YACV,IAAU,OACV,IAAU,eACV,IAAU,gBACV,IAAU,QACV,IAAU,iBACV,IAAU,mBACV,IAAU,gBACV,IAAU,iBACV,IAAU,iBACV,IAAU,kBACV,IAAU,gBACV,IAAU,OACV,IAAU,qBACV,IAAU,iBACV,IAAU,sBACV,IAAU,kBACV,IAAU,QACV,IAAU,eACV,IAAU,YACV,IAAU,uBACV,IAAU,qBACV,IAAU,kBACV,IAAU,iBACV,IAAU,mBACV,IAAU,YACV,IAAU,eACV,IAAU,cACV,IAAU,eACV,IAAU,UACV,IAAU,WACV,IAAU,gBACV,IAAU,YACV,IAAU,UACV,IAAU,QACV,IAAU,SACV,IAAU,WACV,IAAU,eACV,IAAU,OACV,IAAU,iBACV,IAAU,QACV,IAAU,UACV,IAAU,SACV,IAAU,SACV,IAAU,WACV,IAAU,mBACV,IAAU,wBACV,IAAU,eACV,IAAU,kBACV,IAAU,YACV,IAAU,YACV,IAAU,UACV,IAAU,aACV,IAAU,SACV,IAAU,KACV,IAAU,QACV,IAAU,iBACV,IAAU,QACV,IAAU,eACV,IAAU,KACV,IAAU,mBACV,IAAU,SACV,IAAU,OACV,IAAU,SACV,IAAU,OACV,IAAU,gBACV,IAAU,eACV,IAAU,cACV,IAAU,QACV,IAAU,gBACV,IAAU,kBACV,IAAU,WACV,IAAU,QACV,IAAU,WACV,IAAU,WACV,IAAU,WACV,IAAU,WACV,IAAU,aACV,IAAU,eACV,IAAU,eACV,IAAU,eACV,IAAU,mBACV,IAAU,eACV,IAAU,QACV,IAAU,cACV,IAAU,kBACV,IAAU,oBACV,IAAU,gBACV,IAAU,YACV,IAAU,QACV,IAAU,QACV,IAAU,QACV,IAAU,QACV,IAAU,aACV,IAAU,QACV,IAAU,aACV,IAAU,aACV,IAAU,cACV,IAAU,iBACV,IAAU,SACV,IAAU,SACV,IAAU,cACV,IAAU,SACV,IAAU,SACV,IAAU,aACV,IAAU,WACV,IAAU,QACV,IAAU,UACV,IAAU,cACV,IAAU,MACV,IAAU,aACV,IAAU,eACV,IAAU,MACV,IAAU,gBACV,IAAU,YACV,IAAU,cACV,IAAU,YACV,IAAU,WACV,IAAU,aACV,IAAU,gBACV,IAAU,aACV,IAAU,MACV,IAAU,WACV,IAAU,QACV,IAAU,eACV,IAAU,aACV,IAAU,aACV,IAAU,YACV,IAAU,cACV,IAAU,SACV,IAAU,OACV,IAAU,MACV,IAAU,SACV,IAAU,WACV,IAAU,WACV,IAAU,WACV,IAAU,UACV,IAAU,UACV,IAAU,UACV,IAAU,MACV,IAAU,cACV,IAAU,SACV,IAAU,YACV,IAAU,iBACV,IAAU,OACV,IAAU,UACV,IAAU,WACV,IAAU,WACV,IAAU,WACV,IAAU,cACV,IAAU,QACV,IAAU,eACV,IAAU,eACV,IAAU,QACV,IAAU,SACV,IAAU,aACV,IAAU,qBACV,IAAU,WACV,IAAU,YACV,IAAU,aACV,IAAU,YACV,IAAU,UACV,IAAU,gBACV,IAAU,SACV,IAAU,QACV,IAAU,cACV,IAAU,aACV,IAAU,QACV,IAAU,eACV,IAAU,UACV,IAAU,eACV,IAAU,OACV,IAAU,gBACV,IAAU,aACV,IAAU,WACV,IAAU,OACV,IAAU,WACV,IAAU,OACV,IAAU,SACV,IAAU,WACV,IAAU,YACV,IAAU,UACV,IAAU,gBACV,IAAU,QACV,IAAU,UACV,IAAU,YACV,IAAU,UACV,IAAU,MACV,IAAU,MACV,IAAU,UACV,IAAU,SACV,IAAU,cACV,IAAU,MACV,IAAU,OACV,IAAU,UACV,IAAU,YACV,IAAU,SACV,IAAU,aACV,IAAU,SACV,IAAU,QACV,IAAU,eACV,IAAU,SACV,IAAU,mBACV,IAAU,QACV,IAAU,QACV,IAAU,SACV,IAAU,qBACV,IAAU,aACV,IAAU,WACV,IAAU,QACV,IAAU,QACV,IAAU,SACV,IAAU,eACV,IAAU,mBACV,IAAU,YACV,IAAU,gBACV,IAAU,UACV,IAAU,iBACV,IAAU,QACV,IAAU,SACV,IAAU,SACV,IAAU,UACV,IAAU,eACV,IAAU,eACV,IAAU,OACV,IAAU,aACV,IAAU,QACV,IAAU,QACV,IAAU,OACV,IAAU,cACV,IAAU,SACV,IAAU,eACV,IAAU,gBACV,IAAU,aACV,IAAU,gBACV,IAAU,uBACV,IAAU,gBACV,IAAU,aACV,IAAU,mBACV,IAAU,iBACV,IAAU,kBACV,IAAU,aACV,IAAU,gBACV,IAAU,gBACV,IAAU,sBACV,IAAU,cACV,IAAU,aACV,IAAU,iBACV,IAAU,SACV,IAAU,cACV,IAAU,aACV,IAAU,WACV,IAAU,WACV,IAAU,UACV,IAAU,cACV,IAAU,aACV,IAAU,WACV,IAAU,WACV,IAAU,MACV,IAAU,cACV,IAAU,WACV,IAAU,YACV,IAAU,eACV,IAAU,SACV,IAAU,aACV,IAAU,aACV,IAAU,eACV,IAAU,cACV,IAAU,cACV,IAAU,cACV,IAAU,YACV,IAAU,UACV,IAAU,YACV,IAAU,aACV,IAAU,OACV,IAAU,QACV,IAAU,eACV,IAAU,QACV,IAAU,YACV,IAAU,WACV,IAAU,WACV,IAAU,UACV,IAAU,SACV,IAAU,qBACV,IAAU,mBACV,IAAU,kBACV,IAAU,kBACV,IAAU,eACV,IAAU,oBACV,IAAU,mBACV,IAAU,UACV,IAAU,UACV,IAAU,WACV,IAAU,WACV,IAAU,QACV,IAAU,cACV,IAAU,aACV,IAAU,eACV,IAAU,WACV,IAAU,QACV,IAAU,OACV,IAAU,gBACV,IAAU,YACV,IAAU,QACV,IAAU,YACV,IAAU,OACV,IAAU,OACV,IAAU,eACV,IAAU,gBACV,IAAU,aACV,IAAU,SACV,IAAU,gBACV,IAAU,gBACV,IAAU,UACV,IAAU,sBACV,IAAU,OACV,IAAU,eACV,IAAU,UACV,IAAU,WACV,IAAU,gBACV,IAAU,YACV,IAAU,WACV,IAAU,YACV,IAAU,cACV,IAAU,QACV,IAAU,kBACV,IAAU,kBACV,IAAU,eACV,IAAU,gBACV,IAAU,sBACV,IAAU,eACV,IAAU,aACV,IAAU,aACV,IAAU,sBACV,IAAU,SACV,IAAU,YACV,IAAU,aACV,IAAU,eACV,IAAU,cACV,IAAU,aACV,IAAU,YACV,IAAU,UACV,IAAU,QACV,IAAU,iBACV,IAAU,YACV,IAAU,SACV,IAAU,UACV,IAAU,mBACV,IAAU,WACV,IAAU,YACV,IAAU,gBACV,IAAU,WACV,IAAU,KACV,IAAU,YACV,IAAU,iBACV,IAAU,QACV,IAAU,UACV,IAAU,cACV,IAAU,WACV,IAAU,UACV,IAAU,WACV,IAAU,WACV,IAAU,SACV,IAAU,gBACV,IAAU,WACV,IAAU,SACV,IAAU,MACV,IAAU,eACV,IAAU,aACV,IAAU,UACV,IAAU,aACV,IAAU,WACV,IAAU,iBACV,IAAU,WACV,IAAU,QACV,IAAU,SACV,IAAU,QACV,IAAU,OACV,IAAU,iBACV,IAAU,iBACV,IAAU,aACV,IAAU,aACV,IAAU,SACV,IAAU,WACV,IAAU,QACV,IAAU,eACV,IAAU,YACV,IAAU,gBACV,IAAU,WACV,IAAU,iBACV,IAAU,aACV,IAAU,cACV,IAAU,UACV,IAAU,gBACV,IAAU,SACV,IAAU,eACV,IAAU,eACV,IAAU,iBACV,IAAU,iBACV,IAAU,sBACV,IAAU,kBACV,IAAU,YACV,IAAU,SACV,IAAU,WACV,IAAU,QACV,IAAU,UACV,IAAU,MACV,IAAU,YACV,IAAU,gBACV,IAAU,cACV,IAAU,SACV,IAAU,kBACV,IAAU,eACV,IAAU,cACV,IAAU,eACV,IAAU,QACV,IAAU,YACV,IAAU,qBACV,IAAU,WACV,IAAU,kBACV,IAAU,oBACV,IAAU,WACV,IAAU,UACV,IAAU,cACV,IAAU,gBACV,IAAU,YACV,IAAU,SACV,IAAU,YACV,IAAU,kBACV,IAAU,iBACV,IAAU,UACV,IAAU,OACV,IAAU,QACV,IAAU,aACV,IAAU,QACV,IAAU,cACV,IAAU,UACV,IAAU,eACV,IAAU,gBACV,IAAU,OACV,IAAU,cACV,IAAU,QACV,IAAU,WACV,IAAU,UACV,IAAU,cACV,IAAU,SACV,IAAU,OACV,IAAU,QACV,IAAU,YACV,IAAU,OACV,IAAU,SACV,IAAU,YACV,IAAU,gBACV,IAAU,oBACV,IAAU,YACV,IAAU,gBACV,IAAU,eACV,IAAU,eACV,IAAU,aACV,IAAU,gBACV,IAAU,SACV,IAAU,SACV,IAAU,eACV,IAAU,cACV,IAAU,oBACV,IAAU,aACV,IAAU,eACV,IAAU,cACV,IAAU,gBACV,IAAU,mBACV,IAAU,YACV,IAAU,SACV,IAAU,kBACV,IAAU,aACV,IAAU,gBACV,IAAU,eACV,IAAU,cACV,IAAU,cACV,IAAU,eACV,IAAU,eACV,IAAU,eACV,IAAU,mBACV,IAAU,aACV,IAAU,gBACV,IAAU,cACV,IAAU,cACV,IAAU,eACV,IAAU,UACV,IAAU,OACV,IAAU,OACV,IAAU,eACV,IAAU,UACV,IAAU,QACV,IAAU,YACV,IAAU,QACV,IAAU,YACV,IAAU,MACV,IAAU,OACV,IAAU,cACV,IAAU,YACV,IAAU,aACV,IAAU,iBACV,IAAU,eACV,IAAU,KACV,IAAU,WACV,IAAU,kBACV,IAAU,Q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